per-namespace package name
You can now generate classes under different packages per-namespace.
-p:<namespaceURI>=<package> | --package:<namespaceURI>=<package>
specifies the target package for <namespaceURI>
For example XML Signature and SAML 2.0 assertion probably should be under different package name:
$ scalaxb -p:http://www.w3.org/2000/09/xmldsig#=org.w3.xmldsig -p:http://www.w3.org/2001/04/xmlenc#=org.w3.xmlenc -p:urn:oasis:names:tc:SAML:2.0:assertion=org.xml.saml2.assertion -p:urn:oasis:names:tc:SAML:2.0:metadata=org.xml.saml2.metadata saml-schema-metadata-2.0.xsd saml-schema-assertion-2.0.xsd xenc-schema.xsd xmldsig-core-schema.xsd
generated ./xmldsig-core-schema.scala
generated ./xenc-schema.scala
generated ./saml-schema-assertion-2.scala
generated ./saml-schema-metadata-2.scala
$ scalac xmldsig-core-schema.scala xenc-schema.scala saml-schema-assertion-2.scala saml-schema-metadata-2.scala Helper.scala
I've been thinking about this feature for a while. At least a week, since I implemented keyValueOpt
in scopt a week ago. With this change, Helper
object is now pushed out to its own namespace org.scalaxb.rt
and file Helper.scala.