W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2012

SimpleType not enforced for extended element

From: Karl Stubsjoen <kstubs@gmail.com>
Date: Thu, 5 Jan 2012 17:48:02 -0700
Message-ID: <CAHL+Fe3Vra_Zd+BiVgdNfmjDPi3t1MnV0qzf2v_V64y_+cCZYA@mail.gmail.com>
To: xmlschema-dev@w3.org
I have an element that extends a complex type but the additional
attribute with a simple type definition is not being enforced.  The
attribute is enforced, just not it's simple type.  Have I defined
something incorrectly?  Here they are:

<!-- to be used in extension below -->
    <xs:complexType name="ProjXm_QueryType">
            <xs:element ref="command"/>
            <xs:element ref="parameters"/>
            <xs:element ref="fields" minOccurs="0"/>

<!-- extends the above and adds a name attribute of specified simple type -->
    <xs:element name="SharedDB">
                <xs:extension base="ProjXm_QueryType">
                    <xs:attribute name="name"
type="simpleType_SharedDBQueries" />

<!-- expected values for name attribute ->
    <xs:simpleType name="simpleType_SharedDBQueries">
        <xs:restriction base="xs:NCName">
            <xs:enumeration value="insert"/>
            <xs:enumeration value="update"/>

<!-- sample xml (snipped) -->
            <name>insertxx</name><!-- would expect validation to fail here -->

Received on Friday, 6 January 2012 00:48:31 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:20 UTC