I have a complexType that's defined across two .XSD files.
Parent.xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:Parent"
xmlns:emb="urn:Embedded" targetNamespace="urn:Parent" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="urn:Embedded" schemaLocation="Embedded.xsd"/>
<xs:element name="ParentType">
<xs:complexType>
<xs:sequence>
<xs:element name="embedded" type="emb:EmbeddedType"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Embedded.xsd:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:Embedded" targetNamespace="urn:Embedded"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:complexType name="EmbeddedType">
<xs:sequence>
<xs:element name="numeric" type="xs:int"></xs:element>
<xs:element name="embedded" type="EmbeddedType"
minOccurs="0" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>
And my XML looks something like this:
<?xml version="1.0" encoding="utf-8"?>
<ParentType xmlns="urn:Parent" xmlns:emb="urn:Embedded">
<embedded>
<emb:numeric>12</emb:numeric>
<emb:embedded>
<emb:numeric>5</emb:numeric>
</emb:embedded>
</embedded>
</ParentType>
Is there a way to alter things so that both embedded
elements have the same prefix? I can't just copy the EmbeddedType
into Parent.xsd for external reasons. Further, a solution that eliminates all usage of the emb
prefix indiscriminately will not work.