@@ -33,85 +33,75 @@ Node-xml provides a SAX2 parser interface that can take a string, file.
33
33
34
34
parser.parseString(string)
35
35
36
- * Parse an in memory string
36
+ Parse an in memory string
37
37
* return: boolean. true if no errors, false otherwise
38
38
* Arguments
39
- + string - a string representing the document to parse
40
-
39
+ * string - a string representing the document to parse
41
40
42
41
parser.parseFile(filename)
43
42
44
- * Parse a file
45
- * return: boolean. true if no errors, false otherwise
46
- * Arguments
47
- +filename - a string representing the file to be parsed
48
-
49
- Callbacks
50
-
51
- parser.onStartDocument(function() {})
52
-
53
- Called at the start of a document
54
-
55
- parse.onEndDocument(function() {})
56
-
57
- Called at the end of the document parse
58
-
59
- parser.onStartElementNS(function(elem, attrs, prefix, uri, namespaces) {})
60
-
61
- Called on an open element tag
62
- Arguments
63
-
64
- * elem - a string representing the element name
65
- * attrs - an array of arrays: [[key, value], [key, value]]
66
- * prefix - a string representing the namespace prefix of the element
67
- * uri - the namespace URI of the element
68
- * namespaces - an array of arrays: [[prefix, uri], [prefix, uri]]
69
-
70
- parser.onEndElementNS(function(elem, prefix, uri) {})
43
+ Parse a file
44
+ * return: boolean. true if no errors, false otherwise
45
+ * Arguments
46
+ * filename - a string representing the file to be parsed
71
47
72
- Called at the close of an element
73
- Arguments
48
+ #Callbacks#
74
49
75
- * elem - a string representing the element name
76
- * prefix - a string representing the namespace prefix of the element
77
- * uri - the namespace URI of the element
50
+ parser.onStartDocument(function() {})
78
51
79
- parser.onCharacters(function(chars) {})
52
+ Called at the start of a document
80
53
81
- Called when a set of content characters is encountered
82
- Arguments
54
+ parse.onEndDocument(function() {})
83
55
84
- * chars - a string of characters
56
+ Called at the end of the document parse
85
57
86
- parser.onCdata (function(cdata ) {})
58
+ parser.onStartElementNS (function(elem, attrs, prefix, uri, namespaces ) {})
87
59
88
- Called when a CDATA is encountered
89
- Arguments
60
+ Called on an open element tag
61
+ * Arguments
62
+ * elem - a string representing the element name
63
+ * attrs - an array of arrays: [[key, value], [key, value]]
64
+ * prefix - a string representing the namespace prefix of the element
65
+ * uri - the namespace URI of the element
66
+ * namespaces - an array of arrays: [[prefix, uri], [prefix, uri]]
90
67
91
- * cdata - a string representing the CDATA
68
+ parser.onEndElementNS(function(elem, prefix, uri) {})
92
69
93
- parser.onComment(function(msg) {})
70
+ Called at the close of an element
71
+ * Arguments
72
+ * elem - a string representing the element name
73
+ * prefix - a string representing the namespace prefix of the element
74
+ * uri - the namespace URI of the element
94
75
95
- Called when a comment is encountered
96
- Arguments
76
+ parser.onCharacters(function(chars) {})
97
77
98
- * msg - a string representing the comment
78
+ Called when a set of content characters is encountered
79
+ * Arguments
80
+ * chars - a string of characters
99
81
100
- parser.onWarning (function(msg ) {})
82
+ parser.onCdata (function(cdata ) {})
101
83
102
- Called when a warning is encountered
103
- Arguments
84
+ Called when a CDATA is encountered
85
+ * Arguments
86
+ * cdata - a string representing the CDATA
104
87
105
- * msg - a string representing the warning message
88
+ parser.onComment(function( msg) {})
106
89
107
- parser.onError(function(msg) {})
90
+ Called when a comment is encountered
91
+ * Arguments
92
+ * msg - a string representing the comment
108
93
109
- Called when an error is encountered
110
- Arguments
94
+ parser.onWarning(function(msg) {})
111
95
112
- * msg - a string representing the error message
96
+ Called when a warning is encountered
97
+ * Arguments
98
+ * msg - a string representing the warning message
113
99
100
+ parser.onError(function(msg) {})
114
101
102
+ Called when an error is encountered
103
+ * Arguments
104
+ * msg - a string representing the error message
115
105
116
106
117
107
EXAMPLE USAGE
0 commit comments