I have several xsd's that I do not own, that need to be converted to an in-house xml standard to work within our application.
There is an xslt script that does this for us through an ant task, but now we've come to a roadblock:
when the xsd contains an xs:import
statement, the xslt will not be able to find the fields defined in the referenced xsd.
example xsd's:
main.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema>
<xs:import namespace="urn:company:ns.common" schemaLocation="common.xsd"/>
<xs:complexType name="User">
<xs:element ref="common:Address">
</xs:complexType>
</xs:schema>
common.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="urn:company:ns.common">
<xs:complexType name="Address">
<xs:sequence>
<xs:element name="Street" type="xs:string"/>
<xs:element name="HouseNumber" type="xs:number"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
while I can't show the current xslt since it would be akin to divulging some company information, the expected output should be something like this:
<User>
<Address>
<Street></Street>
<HouseNumber></HouseNumber>
</Address>
</User>
at this time, the xslt ignores what it can't find when it is inside the imported xsd.
wrong result:
<User></User>