Created
May 10, 2012 14:10
-
-
Save ncb000gt/2653243 to your computer and use it in GitHub Desktop.
Revisions
-
ncb000gt created this gist
May 10, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ var libxml = require('libxml'); module.exports.to_string = function(assert) { var doc1_string = [ '<?xml version="1.0" encoding="UTF-8"?>', '<root><child to="wongfoo"/></root>', ].join("\n"); var expected_string = "<child/>"; var doc1 = libxml.parseXmlString(doc1_string); var node = doc1.child(0).node('child'); require('util').print(node + "\n"); require('util').print(require('util').format.apply(console, [node]) + "\n"); console.log(node); assert.equal(node.toString(), expected_string); assert.done(); }