Re: Unable to round-trip tab character using XMLHttpRequest and XMLSerializer

"Mark A. Ziesemer" <[email protected]> Sun, 30 Sep 2007 13:53:28 -0500
Newsgroups gmane.comp.mozilla.devel.xml
Message-ID <[email protected]>
Christian Biesinger wrote:
> Boris Zbarsky wrote:
>> Parsing that should give a 3-letter attr value in Gecko.  As a simple 
>> test:
>>
>>   data:text/xml,<root%20attr="%20%09%20"/>
>>
>>   javascript:alert(document.documentElement.getAttribute("attr").length)
> 
> But 
> javascript:alert(document.documentElement.getAttribute("attr").charCodeAt(1).toString(16)) 
> alerts (hex) 20, i.e. a space.
> 
> Which is consistent with http://www.w3.org/TR/xml11/#AVNormalize (and 
> http://www.w3.org/TR/xml/#AVNormalize), which are better references than 
> the xml:space one from the original post.

I am confused with the above example, mostly with how "document" is 
being populated from the given "root" example element.  Actually, per my 
testing (as mentioned in the original post), XMLHttpRequest returns the 
data as expected, including a tab character, IF the XML was saved using 
a character entity for the tab.

I think the assumption should be that XMLHttpRequest is working as 
expected.  I think that the XMLSerializer is what needs to be looked at. 
    As mentioned previously, it is operating differently than Apache 
Xalan-J which seems to be a pretty good reference implementation.

I'll also respond to Boris's post regarding nsIDocumentEncoder.