nsIDOMSerializer 编辑
content/base/public/nsIDOMSerializer.idl
Scriptable This interface is really a placeholder till the W3C DOM Working Group defines a mechanism for serializing DOM nodes. An instance of this interface can be used to serialize a DOM document or any DOM subtree. Inherits from: nsISupports
Last changed in Gecko 1.7Implemented by: @mozilla.org/xmlextras/xmlserializer;1
. To create an instance, use:
var domSerializer = Components.classes["@mozilla.org/xmlextras/xmlserializer;1"] .createInstance(Components.interfaces.nsIDOMSerializer);
Method overview
void serializeToStream(in nsIDOMNode root, in nsIOutputStream stream, in AUTF8String charset); |
AString serializeToString(in nsIDOMNode root); |
Methods
serializeToStream()
The subtree rooted by the specified element is serialized to a byte stream using the character set specified.
void serializeToStream( in nsIDOMNode root, in nsIOutputStream stream, in AUTF8String charset );
Parameters
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. If this string is empty and root is a document, the document's character set will be used.
serializeToString()
The subtree rooted by the specified element is serialized to a string.
AString serializeToString( in nsIDOMNode root );
Parameters
root
- The root of the subtree to be serialized. This could be any node, including a Document.
Return value
The serialized subtree in the form of a Unicode string.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论