1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 * The origin of this IDL file is
6 * http://domparsing.spec.whatwg.org/#the-xmlserializer-interface
9 interface OutputStream;
12 interface XMLSerializer {
16 * The subtree rooted by the specified element is serialized to
19 * @param root The root of the subtree to be serialized. This could
20 * be any node, including a Document.
21 * @returns The serialized subtree in the form of a Unicode string
24 DOMString serializeToString(Node root);
26 // Mozilla-specific stuff
28 * The subtree rooted by the specified element is serialized to
29 * a byte stream using the character set specified.
30 * @param root The root of the subtree to be serialized. This could
31 * be any node, including a Document.
32 * @param stream The byte stream to which the subtree is serialized.
33 * @param charset The name of the character set to use for the encoding
34 * to a byte stream. If this string is empty and root is
35 * a document, the document's character set will be used.
38 void serializeToStream(Node root, OutputStream stream, DOMString? charset);