Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
description and readme
  • Loading branch information
teknopaul committed Aug 15, 2011
1 parent c9c303d commit 70603b6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README
Expand Up @@ -13,15 +13,15 @@ The Element object has a method toXml() which returns a String with whitespace i
Thats it (for now) no bells, no whistles.


var DomJS = require("dom-js").DomJS;
var DomJS = require("dom-js").DomJS;

var domjs = new DomJS();
var domjs = new DomJS();

var string = '<xml><!-- the comment --><elem someAtt="fat &amp; red">Hello &amp; World</elem></xml>';
domjs.parse(string, function(err, dom) {
console.log(util.inspect(dom, false, 23));
console.log("serializes to : " + dom.toXml());
});
var string = '<xml><!-- the comment --><elem someAtt="fat &amp; red">Hello &amp; World</elem></xml>';
domjs.parse(string, function(err, dom) {
console.log(util.inspect(dom, false, 23));
console.log("serializes to : " + dom.toXml());
});



Expand Down
4 changes: 4 additions & 0 deletions lib/dom-js.js
Expand Up @@ -45,6 +45,10 @@ DomJS = function() {
};

DomJS.prototype.parse = function(string, cb) {
if (typeof string != 'string') {
cb(true, 'Data is not a string');
return;
}
var self = this;
parser = sax.parser(strict);

Expand Down
3 changes: 2 additions & 1 deletion package.json
@@ -1,6 +1,7 @@
{
"name": "dom-js",
"version": "0.1",
"version": "0.0.2",
"description" : "XML DOM based on sax",
"dependencies": {
"sax": ">=0.1.5"
},
Expand Down

0 comments on commit 70603b6

Please sign in to comment.