B2G/gecko/content/base/test/unit/test_xmlserializer.js
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
This Source Code Form is subject to the terms of the Mozilla Public
License, v.
This Source Code Form is subject to the terms of the Mozilla Public License v .
function xmlEncode(aFile, aFlags, aCharset) {
    if(aFlags == undefined) aFlags = 0;
    if(aCharset == undefined) aCharset = "UTF-8";
    var doc = do_parse_document(aFile, "text/xml");
    var encoder = Components.classes["@mozilla.org/layout/documentEncoder;1?type=text/xml"]
                   .createInstance(nsIDocumentEncoder);
    encoder.setCharset(aCharset);
    encoder.init(doc, "text/xml", aFlags);
    return encoder.encodeToString();
}
function xmlEncode ( aFile , aFlags , aCharset ) { if ( aFlags == undefined ) aFlags = 0 ; if ( aCharset == undefined ) aCharset = "UTF-8" ; var doc = do_parse_document ( aFile , "text/xml" ) ; var encoder = Components . classes [ "@mozilla.org/layout/documentEncoder;1?type=text/xml" ] . createInstance ( nsIDocumentEncoder ) ; encoder . setCharset ( aCharset ) ; encoder . init ( doc , "text/xml" , aFlags ) ; return encoder . encodeToString ( ) ; }
This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0.
This Source Code Form is subject to the terms of the Mozilla Public License v . 2 . 0 .