W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2009

[whatwg] DOMParser / XMLSerializer

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 20 May 2009 23:23:40 -0400
Message-ID: <4A14C93C.5090906@mit.edu>
Anne van Kesteren wrote:
> or is there something that DOMParser / XMLSerializer can do that document.innerHTML cannot?

Ignoring the non-web-facing functionality (like parsing from and 
serializing to streams), and speaking only of Gecko's implementations, 
basically the following:

1)  DOMParser can parse as a given content type (in theory XML vs HTML;
     I assume that if document.innerHTML doesn't do that yet it could be
     changed to do so).
2)  DOMParser can parse from a byte array instead of a string; this
     makes it a little easier to work with XML in encodings other than
     UTF-8 or UTF-16.
2)  XMLSerializer can serialize a subtree rooted at a given node without
     removing the node from its current location in the DOM.

-Boris
Received on Wednesday, 20 May 2009 20:23:40 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:12 UTC