W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2006

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>

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:attribute name="att1" use="optional" type="xs:decimal"/>
		<xs:anyAttribute namespace="##local"

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

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

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
Received on Friday, 8 December 2006 16:29:48 UTC

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