Dart API Referencedart:htmlXMLSerializer

XMLSerializer Interface

XMLSerializer can be used to convert DOM subtree or DOM document into text. XMLSerializer is available to unprivileged scripts.

XMLSerializer is mainly useful for applications and extensions based on the Mozilla platform. While it is available for web pages, it's not part of any standard and level of support in other browsers unknown.
 

Constructors

Code new XMLSerializer() #

XMLSerializer();

Methods

Code String serializeToString(Node node) #

     Returns the serialized subtree of a string.
serializeToStream
     The subtree rooted by the specified element is serialized to a byte stream using the character set specified.    
Example
var s = new XMLSerializer();
 var d = document;
 var str = s.serializeToString(d);
 alert(str);
var s = new XMLSerializer();
 var stream = {
   close : function()
   {
     alert("Stream closed");
   },
   flush : function()
   {
   },
   write : function(string, count)
   {
     alert("'" + string + "'\n bytes count: " + count + "");
   }
 };
 s.serializeToStream(document, stream, "UTF-8");
String serializeToString(Node node);

This page includes content from the Mozilla Foundation that is graciously licensed under a Creative Commons: Attribution-Sharealike license. Mozilla has no other association with Dart or dartlang.org. We encourage you to improve the web by contributing to The Mozilla Developer Network.