michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIOutputStream; michael@0: interface nsIDOMNode; michael@0: michael@0: /** michael@0: * The nsIDOMSerializer interface is really a placeholder till the W3C michael@0: * DOM Working Group defines a mechanism for serializing DOM nodes. michael@0: * An instance of this interface can be used to serialize a DOM document michael@0: * or any DOM subtree. michael@0: */ michael@0: michael@0: [scriptable, uuid(9fd4ba15-e67c-4c98-b52c-7715f62c9196)] michael@0: interface nsIDOMSerializer : nsISupports michael@0: { michael@0: /** michael@0: * The subtree rooted by the specified element is serialized to michael@0: * a string. michael@0: * michael@0: * @param root The root of the subtree to be serialized. This could michael@0: * be any node, including a Document. michael@0: * @returns The serialized subtree in the form of a Unicode string michael@0: */ michael@0: AString serializeToString(in nsIDOMNode root); michael@0: michael@0: /** michael@0: * The subtree rooted by the specified element is serialized to michael@0: * a byte stream using the character set specified. michael@0: * @param root The root of the subtree to be serialized. This could michael@0: * be any node, including a Document. michael@0: * @param stream The byte stream to which the subtree is serialized. michael@0: * @param charset The name of the character set to use for the encoding michael@0: * to a byte stream. If this string is empty and root is michael@0: * a document, the document's character set will be used. michael@0: */ michael@0: void serializeToStream(in nsIDOMNode root, in nsIOutputStream stream, michael@0: in AUTF8String charset); michael@0: }; michael@0: michael@0: %{ C++ michael@0: #define NS_XMLSERIALIZER_CID \ michael@0: { /* a6cf9124-15b3-11d2-932e-00805f8add32 */ \ michael@0: 0xa6cf9124, 0x15b3, 0x11d2, \ michael@0: {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } michael@0: #define NS_XMLSERIALIZER_CONTRACTID \ michael@0: "@mozilla.org/xmlextras/xmlserializer;1" michael@0: %} michael@0: