Chris said:
> Dunno, I thought XML treated whitespace the same as HTML but
> I could well be wrong...
According to the XML spec, the element content passed through to an
application by an XML parser should include the line breaks. i.e.
http://www.w3.org/TR/REC-xml#sec-white-space
says: "An XML processor must always pass all characters in a document
that are not markup through to the application."
It may well be true that an application like a browser might adopt the
behaviour of an HTML browser and ignore the line breaks, but that choice
is at the level of the application, I think?
So I rather expected a parser doing schema validation to reject the
example with leading and trailing linebreaks, but the MSXML parser
appears to accept the it....
Roland said:
> XML Schema Schema defines treatment of whitespace relative to
dataType.
Right.... so I _think_ (but I'm not sure) the example is OK because the
definition of the xs:anyURI builtin type specifies
<xs:whiteSpace value="collapse".... >
which following
http://www.w3.org/TR/xmlschema-2/#rf-whiteSpace
means
1. All occurrences of #x9 (tab), #xA (line feed) and #xD (carriage
return) are replaced with #x20 (space)
2. After [1], contiguous sequences of #x20's are collapsed to a single
#x20, and leading and trailing #x20's are removed.
So this (I think) _does_ strip the leading and trailing linebreaks....
and mean that the example is valid as an instance of an xs:anyURI?
But I might have misread this..... ;-)
> In any case I only wrote it like that so that the line didn't
> wrap in peoples mail clients.
I suspect the same is true for the layout of the examples in the
Guidelines document.
Pete
|