XMLSerializer

  • Revision slug: XMLSerializer
  • Revision title: XMLSerializer
  • Revision id: 127805
  • Created:
  • Creator: Mw22
  • Is current revision? No
  • Comment /* Methods */

Revision Content

XMLSerializer can be used to convert DOM subtree or DOM document into text. XMLSerializer is available to unprivileged scripts.

XMLSerializer is mainly useful for applications and extensions based on Mozilla platform. While it's available to web pages, it's not part of any standard and level of support in other browsers is unknown.

Methods

serializeToString
Returns the serialized subtree in the form of a string
serializeToStream
The subtree rooted by the specified element is serialized to a byte stream using the character set specified.

Example

 var s = new XMLSerializer();
 var d = document.body;
 var str = s.serializeToString(d);
 alert(str);

Revision Source

<p>
</p><p><code>XMLSerializer</code> can be used to convert DOM subtree or DOM document into text. <code>XMLSerializer</code> is available to unprivileged scripts.
</p>
<div class="note">
<p><code>XMLSerializer</code> is mainly useful for applications and extensions based on Mozilla platform. While it's available to web pages, it's not part of any standard and level of support in other browsers is unknown.
</p>
</div>
<h3 name="Methods"> Methods </h3>
<dl><dt>serializeToString
</dt><dd>Returns the serialized subtree in the form of a string
</dd><dt>serializeToStream
</dt><dd>The subtree rooted by the specified element is serialized to a byte stream using the character set specified.
</dd></dl>
<h3 name="Example"> Example </h3>
<pre class="eval"> var s = new XMLSerializer();
 var d = document.body;
 var str = s.serializeToString(d);
 alert(str);
</pre>
Revert to this revision