Community
Participate
Working Groups
Consider the following Java class / XML Bindings file: ===== @XmlRootElement public class CustomerAnno { @XmlAnyElement public Object anyElem; } ===== <java-types> <java-type name="Customer"> <xml-root-element /> <java-attributes> <xml-any-element java-attribute="anyElem" /> </java-attributes> </java-type> </java-types> ===== If a namespace-qualified Element is set on anyElem: anyElem = doc.createElementNS("any-element", "my-elem"); Annotations: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <customerAnno xmlns="http://www.example.org/package"> <my-elem:my-elem xmlns:my-elem="any-element" xmlns="any-element"/> </customerAnno> * Note duplicate declaration of 'any-element' XML Bindings: <?xml version="1.0" encoding="UTF-8"?> <ns0:customer xmlns:ns0="http://www.example.org/package"> <my-elem xmlns="any-element"/> </ns0:customer> * Note that this is not textually identical to the Annotations version
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink