Tuesday, 17 February 2015

Offline inclusion of XMLSchema with xcj



I have an XSD file that reference and element xs:schema. When I run xcj connected to the internet it creates the appropriate JAXB objects. When I try and reference XMLSchema.xsd as a local file it fails.


How do I reference the local xsd file copy of XMLSchema.xsd so I can run xcj offline to create the JAXB classes?


Currently I call xcj -d out schema0.xsd schema1.xsd


Schema0.xsd



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://ift.tt/rAg5Mm"
xmlns="http://ift.tt/rAg5Mm" xmlns:xs="http://ift.tt/tphNwY"
elementFormDefault="qualified">

<xs:import namespace="http://ift.tt/tphNwY" schemaLocation="http://ift.tt/1ifJ804"/>
<xs:element name="children">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="1" name="childname" />
<xs:element ref="xs:schema" />
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>


Schema1.xsd



<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
targetNamespace="http://ift.tt/rAg5Mm"
xmlns="http://ift.tt/rAg5Mm"
xmlns:xs="http://ift.tt/tphNwY"
elementFormDefault="qualified">
<xs:import namespace="http://ift.tt/tphNwY" schemaLocation="http://ift.tt/1ifJ804" />
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
<xs:any minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

No comments:

Post a Comment