I have a simple Java class I am annotating with JAXB:
class Foo {
@XmlAnyElement(lax=true)
List<Object> any;
}
Which produces the following schema:
<xs:complexType name="foo">
<xs:sequence>
<xs:any processContents="lax" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
Is there any way to set the namespace attribute for the <any>
element, so that it generates like:
<xs:any namespace="##targetNamespace" processContents="lax" maxOccurs="unbounded"/>
insert a package-info.java file into your foo class package with contents like :
@javax.xml.bind.annotation.XmlSchema(namespace = "urn:foo:v1", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package java.ns.foo;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With