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 {
14 * The subtree rooted by the specified element is serialized to
17 * @param root The root of the subtree to be serialized. This could
18 * be any node, including a Document.
19 * @returns The serialized subtree in the form of a Unicode string
22 DOMString serializeToString(Node root);
24 // Mozilla-specific stuff
26 * The subtree rooted by the specified element is serialized to
27 * a byte stream using the character set specified.
28 * @param root The root of the subtree to be serialized. This could
29 * be any node, including a Document.
30 * @param stream The byte stream to which the subtree is serialized.
31 * @param charset The name of the character set to use for the encoding
32 * to a byte stream. If this string is empty and root is
33 * a document, the document's character set will be used.
36 void serializeToStream(Node root, OutputStream stream, DOMString? charset);