W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2001

Re: FW: spaces in value fields

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 21 Sep 2001 10:03:52 +0100
To: "Penick, Thomas" <tpenick@vignette.com>
Cc: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>, "Miller, Scott" <smiller@vignette.com>
Message-ID: <f5b8zf8530n.fsf@cogsci.ed.ac.uk>
This is a bit tricky, but the bottom line is straightforward -- your
documents are fine, the parser has a problem.

Full story:  ' 3.5' is not in the lexical space of the 'double'
builtin primitive datatype.  _However_  both

  <foo> 3.5</foo>
and
  <baz f=' 3.5'/>

_are_ XML Schema-valid if <foo> and 'f' are declared as xs:double.

Why?  Because all non-string datatypes by definition have the
'collapse' value for their 'whitespace' facet, which means that
parsers must _inter alia_ strip leading and trailing whitespace from
the input to _construct_ the candidate lexical space string.

So in both those cases, the string to be considered is '3.5', which is 
fine.

Hope this helps

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Friday, 21 September 2001 05:03:16 GMT

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