substitutiongroup

Amoureux erwan <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <000b01c6eea1$8f83c240$7501730a@AMOUREUXER>
Bonjour je me pose une petite question sur les substitution group
soit un xml
<?xml version="1.0" encoding="UTF-8"?>

<r>

    <a>

        <b>ase</b>

    </a>

    <a>

        <c>aze</c>

    </a>

    <a>

        <d>22</d>

    </a>

      <e>

        <f>111</f>

      </e>

</r>

j'arrive à le valider sous xmlspy 2004 avec



<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <xs:element name="r">

        <xs:complexType>

            <xs:sequence>

                <xs:element ref="a-typ" maxOccurs="unbounded"/>

            </xs:sequence>

        </xs:complexType>

    </xs:element>

    <xs:element name="a-typ" abstract="true"/>

    <xs:element name="a" substitutionGroup="a-typ">

        <xs:complexType>

            <xs:choice>

                <xs:element name="b" type="xs:string"/>

                <xs:element name="c" type="xs:string"/>

                <xs:element name="d" type="xs:string"/>

            </xs:choice>

        </xs:complexType>

    </xs:element>

    <xs:element name="e" substitutionGroup="a-typ">

        <xs:complexType>

            <xs:sequence>

                <xs:element name="f" type="xs:int"/>

            </xs:sequence>

        </xs:complexType>

    </xs:element>

</xs:schema>



mais n'est ce pas en contradiction avec

Elements in a substitution group must have the same type as the head element, or they can have a type that has been derived from the head element's type. 

ou est ce qu'il suffit de ne pas donner de type au head element pour se permettre d'avoir des éléments avec des types differents ?



merci d'avance
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.