XMLSerializer.webidl (1425B)
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/. 4 * 5 * The origin of this IDL file is 6 * http://domparsing.spec.whatwg.org/#the-xmlserializer-interface 7 */ 8 9 interface OutputStream; 10 11 [Exposed=Window] 12 interface XMLSerializer { 13 constructor(); 14 15 /** 16 * The subtree rooted by the specified element is serialized to 17 * a string. 18 * 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 22 */ 23 [Throws] 24 DOMString serializeToString(Node root); 25 26 // Mozilla-specific stuff 27 /** 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. 36 */ 37 [Throws, ChromeOnly] 38 undefined serializeToStream(Node root, OutputStream stream, DOMString? charset); 39 };