W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2009

[XML Schema 1.1] Can I invent elements if I specify vc:maxVersion="3.2"?

From: Costello, Roger L. <costello@mitre.org>
Date: Wed, 29 Apr 2009 13:20:33 -0400
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB5003F245AA9F@IMCMBX3.MITRE.ORG>

Hi Folks,

It's my understanding that a 1.1 schema validator will strip out the second Book:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
           targetNamespace="http://www.books.org"
           elementFormDefault="qualified">

    <xs:element name="BookStore">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Book" maxOccurs="unbounded" vc:minVersion="1.1" vc:maxVersion="3.2">
                    ...
                </xs:element>
                <xs:element name="Book" maxOccurs="unbounded" vc:minVersion="3.2">
                    ...
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>


Correct?


Since the 1.1 schema validator strips out the second Book, I figure that I should be able to put any crazy elements I want in there. For example, here I invent a new element that I call "new":


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
           targetNamespace="http://www.books.org"
           elementFormDefault="qualified">
    <xs:element name="BookStore">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Book" maxOccurs="unbounded" vc:minVersion="1.1" vc:maxVersion="3.2">
                    ...
                </xs:element>
                <xs:element name="Book" maxOccurs="unbounded" vc:minVersion="3.2">
                    <xs:new>
                           ...
                    </xs:new>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema> 


However, when I run this schema using a 1.1 validator (SAXON) I get an error message saying <xs:new> is not allowed within <xs:element>.


Why?


It seems to me, SAXON should never have seen <xs:new>.

Would you clarify this for me please?

/Rgoer
Received on Wednesday, 29 April 2009 17:21:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:11 GMT