Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - >Thread Next - xsts-2002-01-16 - msxsdtest - errors Whitespace normalization for union typesTo: XML-SCHEMA <xmlschema-dev@--.---> Date: 6/1/2005 8:20:00 PM Hi, I noticed a difference in processing of the following example with: Xerces-J 2.6.2 - eats it XSV 2.8 - eats it MSXML 4.0 - reports an error: "The element: 'foo' has an invalid value according to its data type." Schema: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:simpleType name="fooType"> <xsd:union memberTypes="xsd:string xsd:token"/> </xsd:simpleType> <xsd:element name="foo"> <xsd:simpleType> <xsd:restriction base="fooType"> <xsd:pattern value="[a-z]"/> </xsd:restriction> </xsd:simpleType> </xsd:element> </xsd:schema> Instance: <foo> a </foo> Due to [1]... "For all datatypes =B7derived=B7 by =B7union=B7 whiteSpace does not apply directly; however, the normalization behavior of =B7union=B7 types is controlled by the value of whiteSpace on that one of the =B7memberTypes=B7 against which the =B7union=B7 is successfully validated." ...I assume that the whitespace of xs:string is used here; thus the value " a " should not be accepted by the pattern "[a-z]". Can someone confirm this? MSXML 4.0 seems to reflect this, the other processors not. The fact that the whitespace-value is at hand when the value was already validated against the member-types, seems to contradict with [2] Datatype Valid, which mandates the pattern facet to be applied first; but without the whitespace-value, normalization is not possible, so applying the pattern facet is not possible as well. Can someone clarify this? [1] http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace [2] http://www.w3.org/TR/xmlschema-2/#defn-validation-rules Regards, Kasimier From xan.gregg@j... Wed Jun 01 19:36:24 2005 Received: from lisa.w3.org ([128.30.52.41]) | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
