using substitutionGroup members in complexType derviation by restriction ?

hi!

is there an non-ambiguous rule in the spec which allows the use of
substitutionGroup members instead of the original element in the derived
type ?

i've the following schema:

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

        <xs:element name="A" type="xs:token"/>

        <xs:element name="B" substitutionGroup="A">
                <xs:simpleType>
                        <xs:restriction base="xs:token">
                                <xs:maxLength value="2"/>
                        </xs:restriction>
                </xs:simpleType>
        </xs:element>

        <xs:complexType name="X">
                <xs:sequence>
                        <xs:element ref="A"/>
                </xs:sequence>
        </xs:complexType>

        <xs:complexType name="Y">
                <xs:complexContent>
                        <xs:restriction base="X">
                                <xs:sequence>
                                        <!-- use of an substitutionGroup
member from element A in the
restriction -->
                                        <xs:element ref="B"/>
                                </xs:sequence>
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>

</xs:schema>

as i understand the spec, this schema is not valid because the derived
type uses element B instead of element A in the content model;

the rule/clause that should be violated is rcase-NameAndTypeOK.1:
1 The declarations' {name}s and {target namespace}s are the same.

however, other people argue that rule/clause cos-particle-restrict.1:
1 They are the same particle.
is fulfilled because A contains B as a substitutionGroup member:

any hint most wellcome!

-- 
edmund vorauer

Received on Tuesday, 16 November 2004 14:33:38 UTC