[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Interaction of explicit attributes and wildcards

From: Michael Kay <mike@saxonica.com>
Date: Fri, 8 Dec 2006 16:29:37 -0000
To: <xmlschema-dev@w3.org>
Message-ID: <00f501c71ae6$0df04980$6401a8c0@turtle>
Interaction of explicit attributes and wildcards

According to several schema processors, (Saxon, Xerces, MS .NET), the
following instance:

<e att1="banana"/>

is valid against the following schema:

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

	<xs:complexType name="B">
		<xs:sequence/>
		<xs:attribute name="att1" use="optional" type="xs:decimal"/>
		<xs:anyAttribute namespace="##local"
processContents="skip"/>
	</xs:complexType>

	<xs:complexType name="R">
		<xs:complexContent>
			<xs:restriction base="B">
				<xs:attribute name="att1" use="prohibited"/>
				<xs:anyAttribute namespace="##local"
processContents="skip"/>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>

	<xs:element name="e" type="R"/>
</xs:schema>

But change the element declaration to <xs:element name="e" type="B"/>, and
validation fails, saying that "banana" is not a valid xs:decimal (the same
set of schema processors agree on this).

Surely the element cannot be a valid instance of R unless it is also a valid
instance of B?

Michael Kay
http://www.saxonica.com/
Received on Friday, 8 December 2006 16:29:48 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.