Open Tomas-Kraus opened 13 years ago
@glassfishrobot Commented Reported by hwellmann
@glassfishrobot Commented ccu54 said: I got the same issue : I need to generate a package-info.java containing a custom XmlNs prefix, eg. :
@javax.xml.bind.annotation.XmlSchema(
(...),
xmlns = {@javax.xml.bind.annotation.XmlNs(prefix = "foo", namespaceURI = "http://mysite.com/xml/foo-v1.0.xsd")},
(...))
@glassfishrobot Commented silverhawk87 said: I am having the same issue; this would be a great feature to have...
@glassfishrobot Commented puce said: +1 for taking defaults from the XSD and generate the @XmlNs annotations +1 for making this customizable with xjb customization
@glassfishrobot Commented Was assigned to snajper
@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-818
I'm using xjc to generate a JAXB model from an XSD schema with multiple imported namespaces. I would like to override the default namespace prefixes (ns1, ns2, ...) used by the JAXB marshaller by sensible defaults.
This can be done by setting an xmlns property in the @XmlSchema annotation at package level in package-info.java.
However, this file is generated by xjc by default, without any prefix definitions.
Currently, the only way of overriding this behaviour seems to be:
It would be convenient if the generated package-info.java contained @XmlNs annotations using the prefixes defined in the schema to be compiled, if present. In addition, there should be a mechanism to override the defaults by a suitable xjb customization.
Affected Versions
[2.2.2]