Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Whitespace normalization for union types

From: Kasimier Buchcik <kbuchcik@---------.-->
To: 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])
	


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