I have a xsd schema from which I\'m generating some java classes. I\'m using jaxb for the generation.
I want to be able to generate a class annotated with @Xml
I suggest you to use this bindings
<bindings version="2.0" xmlns="http://java.sun.com/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
xmlns:annox="http://annox.dev.java.net"
xmlns:namespace="http://jaxb2-commons.dev.java.net/namespace-prefix">
<bindings schemaLocation="../your.xsd">
<bindings node="//xs:element[@name='customer']//xs:complexType">
<annox:annotate>
<annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
name="customer" namespace="yourNamespaceIfYouWant">
</annox:annotate>
</annox:annotate>
<class name="CustomerRequest"/>
</bindings>
</bindings>
</bindings>
Class
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"header"
})
@XmlRootElement(name = "customer", namespace = "yourNamespaceIfYouWant")
public class CustomerRequest