W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2002

whiteSpace facet definition

From: Jeremy Carroll <jjc@hpl.hp.com>
Date: Tue, 26 Nov 2002 16:01:56 +0100
To: www-xml-schema-comments@w3.org
Message-id: <BHEGLCKMOHGLGNOKPGHDIEMICAAA.jjc@hpl.hp.com>


In XML Schema Part 2

http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/#rf-whiteSpace

We have:

[[
[Definition:]   whiteSpace constrains the ·value space· of types ·derived·
from string such that the various behaviors specified in Attribute Value
Normalization in [XML 1.0 (Second Edition)] are realized. The value of
whiteSpace must be one of {preserve, replace, collapse}.
]]

This is an unfortunate wording.

It leaves open possibilities such as:

+ There is no constraint. Attribute Value Normalization leaves all character
references unchanged, so arbitrary string values can be encoded.

+ The constraint is only on the value space. The lexical-to-value mapping is
changed to realized the desired whitespace normalization. This reading would
have the string " 1" being a member of the lexical space of int, which is
then trimmed before being mapped to the integer one.

It also says nothing about its effect on types other than those derived from
string.

Looking at the process described in section 3.1.4 White Space Normalization
during Validation of [XML Schema Structures]. I understand that the
normalization described there is applied before the lexical-to-value mapping
that occurs in datatyping.

I suggest a declarative definition:

[Definition:]   whiteSpace constrains the ·lexical space· of types. The
value of whiteSpace must be one of {preserve, replace, collapse}. If the
value is replace or collapse then the string does not contain any characters
#x9 (tab), #xA (line feed) and #xD (carriage return). If the value is
collapse then the string neither starts nor ends with character #x20
(space), nor does it contain two consecutive #x20 (space) characters.

Jeremy Carroll
Received on Tuesday, 26 November 2002 10:02:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT