Created
February 16, 2010 01:31
-
-
Save tmpvar/305190 to your computer and use it in GitHub Desktop.
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 characters
// sax-test.js | |
var sys = require("sys"), sax = require("./sax"); | |
parser = sax.parser(false); | |
sax.EVENTS.forEach(function (ev) { | |
parser["on" + ev] = function() { sys.puts(sys.inspect(arguments)); }; | |
}); | |
parser.write("<span>Welcome,</span> to monkey land"); | |
// output | |
tmpvar@tmpvar:~/Work/Javascript/jsdom/example/pure$ node sax-test.js | |
{ | |
"0": { | |
"name": "SPAN", | |
"attributes": {} | |
} | |
} | |
{ | |
"0": "Welcome," | |
} | |
{ | |
"0": "SPAN" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment