[Bug 3446] [XQueryX] constructing attribute values with whitespace characters

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3446





------- Comment #5 from mike@saxonica.com  2006-07-29 08:45 -------
The two elements in 

<x><elem attr="a&#x09;b"></elem><y/><elem attr="a    b"></elem></x>

should not produce the same result. XQuery 3.7.1.1 clause 1 says:

"Each consecutive sequence of literal characters in the attribute content is
treated as a string containing those characters. Attribute value normalization
is then applied to normalize whitespace and expand character references and
predefined entity references. An XQuery processor that supports XML 1.0 uses
the rules for attribute value normalization in Section 3.3.3 of [XML 1.0]; "

and the relevant rule in XML 1.0 is 

* For a character reference, append the referenced character to the normalized
value.

* For a white space character (#x20, #xD, #xA, #x9), append a space character
(#x20) to the normalized value.

Thus a character reference #x9 should result in a tab character, whereas a tab
character should result in a single space (#x20) character.

Received on Saturday, 29 July 2006 08:45:09 UTC