Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


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

From: "Costello, Roger L." <costello@-----.--->
To: "'xmlschema-dev@--.---'" <-------------@--.--->
Date: 4/29/2009 9:21:00 AM
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:minVer=
sion="1.1" vc:maxVersion="3.2">
                    ...
                </xs:element>
                <xs:element name="Book" maxOccurs="unbounded" vc:minVer=
sion="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:minVer=
sion="1.1" vc:maxVersion="3.2">
                    ...
                </xs:element>
                <xs:element name="Book" maxOccurs="unbounded" vc:minVer=
sion="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 erro=
r 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=

From costello@m... Thu Apr 30 15:36:56 2009
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent