I also tried to make it work, as I described to Peter. Rahul did not post his decision, so here is my binding file.
<?xml version="1.0" encoding="UTF-8"?> <jaxb:bindings xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc" version="2.1"> <jaxb:bindings schemaLocation="test.xsd" node="//xs:element[@name='A']/xs:complexType/xs:choice[1]"> <jaxb:property name="OutsideY"/> </jaxb:bindings> </jaxb:bindings>
XJC Output:
$xjc -version xjc version "JAXB 2.1.10 in JDK 6" JavaTM Architecture for XML Binding(JAXB) Reference Implementation, (build JAXB 2.1.10 in JDK 6) $xjc -p com.example.test -d src -extension -b bindings.xml test.xsd parsing a schema... compiling a schema... com\example\test\A.java com\example\test\ObjectFactory.java
source share