Skip to content

Commit 71f8124

Browse files
Robert RighterRobert Righter
authored andcommitted
setup example to show both file and chunck parsing in the same exmple
1 parent f7b8d84 commit 71f8124

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

example.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ var parser = new xml.SaxParser(function(cb) {
3434
});
3535

3636

37+
//example read from file
38+
parser.parseFile("sample.xml");
39+
3740
//example read from chunks
3841
parser.parseString("<html><body>");
3942
parser.parseString("<!-- This is the start");
@@ -47,6 +50,6 @@ parser.parseString(" cdata ]]>");
4750
parser.parseString("</body");
4851
parser.parseString("></html>");
4952

50-
//example read from file
51-
parser.parseFile("sample.xml");
53+
54+
5255

0 commit comments

Comments
 (0)