On Wed, Jun 05, 2002 at 04:28:58PM -0700, Stewart, Daniel J wrote:
> The following XML snippet validates fine against the xs:dateTime built-in
> schema type using Xerces:
> 
>       <StartTime> 2001-01-01T08:38:22 </StartTime>
> 
> However, it fails validation in XML Spy v4.3.  I sent a bug report to
> Altova, and their response was "This is not a bug.  There is a leading space
> which makes the tag invalid".  Sure enough, if I remove the leading and
> trailing space, XML Spy validates just fine:
> 
>       <StartTime>2001-01-01T08:38:22</StartTime>
> 
> I found this also to be true for the xs:duration built-in schema type.
> 
> I looked at the W3C recommendation, and I don't see any mention of whether
> leading/trailing spaces are invalid.  

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

It says:
 whiteSpace is applicable to all �atomic� and �list� datatypes. For all
 �atomic� datatypes other than string (and types �derived� by
 �restriction� from it) the value of whiteSpace is collapse and cannot
 be changed by a schema author

And defines "collapse" to be:
  After the processing implied by replace, contiguous sequences of #x20's
  are collapsed to a single #x20, and leading and trailing #x20's are
  removed. 

As xs:dateTime is an atomic, primitive type, not derived by restriction from
string, then whitespace should be stripped from the beginning and end of
the content before processing. Hence I read this as a bug in XMLSpy.

David
-- 
David Sheldon, Client Services        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to