Re: View Source

Boris Zbarsky wrote:
> Lachlan Hunt wrote:
>> Are you asking for the spec to more thoroughly define how to serialise 
>> a given DOM in a way that guarantees well-formedness, even in such 
>> cases where that can't be done losslessly?  There are some DOMs that 
>> can be produced by text/html which simply cannot be represented in 
>> well-formed XML documents, so such things would need to be modified in 
>> some way.
> 
> For what it's worth, such DOMs can also be produced via the DOM APIs, 
> once namespaces are involved.  Most simply, stick an attribute with the 
> local name "xmlns" and the null namespace onto an element.

That doesn't round-trip losslessly, but simply serialising it as <foo 
xmlns="..."> doesn't result in a well-formedness error.  I was thinking 
about things that cause well formedness errors, such as comments 
containing extra pairs of hyphens (<!-- foo -- bar -->), or attribute 
names containing characters that aren't allowed in XML (<p #="">), etc.

-- 
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/

Received on Tuesday, 17 March 2009 15:14:41 UTC