- From: Graham Mann <gmann@adobe.com>
- Date: Fri, 11 Jul 2003 14:20:02 +0100
- To: xmlschema-dev@w3.org
Given the following schema <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="TESTING"> <xs:complexType> <xs:attribute name="Name" type="Name" use="required"/> <xs:attribute name="NameList_A" type="NameList" use="required"/> <xs:attribute name="NameList_B" type="NameList" use="required"/> </xs:complexType> </xs:element> <xs:simpleType name="Name"> <xs:restriction base="xs:NMTOKEN"> <xs:enumeration value="Peter"/> <xs:enumeration value="Paul"/> <xs:enumeration value="Mark"/> <xs:enumeration value="John"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="NameList"> <xs:list itemType="Name"/> </xs:simpleType> </xs:schema> And the following document <TESTING xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\JDF\CIP4\jdf\schema\Version_1_2\ListTest.xsd" # Name="John" NameList_B="Paul" NameList_A="Mark John"/> Is NameList_A valid? I say Yes Xerces C++ say's Yes Altova (XML Spy) support say's "... This has been reported to us before but here is our finding on this: The customer is incorrect in its assessment of the situation. While it is correct that the datatype NMTOKENS allows for a white-space separated list of individual NMTOKEN entries, there is nothing in the XML Schema specification that would support the claim, that the allowed range of individual values can be specified in an enumeration facet. The enumeration facet is clearly defined under http://www.xmlspy.com/specs_schema2.html#rf-enumeration and the validation rule for this facet is specified as: Validation Rule: enumeration valid A value in a *value space* is facet-valid with respect to *enumeration* if the value is one of the values specified in {value} There is no special provision for NMTOKENS in the validation rule for the enumeration facet, and thus XML Spy correctly flags this as an error, because the value "A B" does not match any of the enumeration values in the schema. ..." Graham Mann Adobe Systems Europe Ltd.
Received on Friday, 11 July 2003 09:20:56 UTC