WARNING: Most of this content (with the exception of the Mozilla 1.9 XPCOM reference) is very old, and can be expected to be out of date and possibly obsolete. For better XUL documentation, please visit the XUL hub at the Mozilla Developer Center.

XMLSerializer

This object is available to unprivileged JavaScript. It implements the following interfaces:

Methods

void serializeToStream ( Node root , nsIOutputStream stream , AUTF8String charset ) AString serializeToString ( Node root )

void serializeToStream ( Node root , nsIOutputStream stream , AUTF8String charset )

The subtree rooted by the specified element is serialized to a byte stream using the character set specified.

Arguments:
root: The root of the subtree to be serialized. This could be any node, including a Document.
stream: The byte stream to which the subtree is serialized.
charset: The name of the character set to use for the encoding to a byte stream.

AString serializeToString ( Node root )

The subtree rooted by the specified element is serialized to a string.

Arguments:
root: The root of the subtree to be serialized. This could be any node, including a Document.

Reference documentation is generated from Mozilla's source.