I have got the following simple XML Schema...
<xs:complexType name="OrderReferenceType">
<xs:sequence>
<xs:element name="ReferenceID" type="xs:string"/>
</xs:sequence>
<xs:attribute name="Type">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="SalesOrder"/>
<xs:enumeration value="CustomerPO"/>
<xs:enumeration value="WorkOrder"/>
<xs:enumeration value="Misc"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
And I'd like to hint to the XJC JAXB compiler so that it should generate the type safe enum class for "Type".
<jaxb:bindings schemaLocation="file:./WorkOrder.xsd">
<jaxb:bindings node="//xs:element[@name='ReferenceID']//xs:complexType//xs:attribute[@name='Type']//xs:simpleType">
<jaxb:typesafeEnumClass name="TypeEnum" />
</jaxb:bindings>
But when i run the command
xjc -d src workOrder.xsd -b customizedBindings.xjb
i get the following error.
parsing a schema...
[ERROR] XPath evaluation of "//xs:element[@name='ReferenceID']//xs:complexType//xs:attribute[@name='Type']//xs:simpleType" results in empty target node
line 69 of file:/C:/jaxB_workspace/jaxbExp/resources/mybindings.xjb
Failed to parse a schema.
Can someone help how to achieve this goal without modifying the original XSD?