tags:

views:

15

answers:

0

Hi, I'm searching a way to add a new complexType to a substitution group. This type should be contained in a separate file and i don't want to add something to the sourcefile (like a include or import). The intent is to enable someone to add his own types by simply adding a separate xsd-file without changing the original.

What I have found so far points me to build a xsd-file and import the sourcefile. Then adding the definitions. My Problem is that I can't use the imported root-element in a xml-instance.

Is there a better way to make my file customizable without changing it? Or can I somehow use a imported Element as root?

Thanks for your time :)

Example for the sourcefile:

<xs:element name="serviceElement" type="type1"/>
<xs:element name="serviceElement2" substitutionGroup="serviceElement" type="type2"/>

<xs:complexType name="type1">
    <xs:sequence>
        <xs:element name="A" type="xs:string"/>
        <xs:element name="B" type="xs:string"/>
    </xs:sequence>
</xs:complexType>

<xs:complexType name="type2">
    <xs:complexContent>
        <xs:extension base="type1">
            <xs:sequence>
                <xs:element name="C" type="xs:string"/>
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>