You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/howto.html
+67-27Lines changed: 67 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,7 @@ <h2>How to</h2>
125
125
</ul>
126
126
</li>
127
127
<li><ahref="#CUSTOM">Handle new tags</a>
128
+
<li><ahref="#INACTIVE">Handle inactive nodes</a>
128
129
</ul>
129
130
130
131
<hr/>
@@ -174,9 +175,9 @@ <h5>SAX parser</h5>
174
175
There are only 6 callbacks that can be called when using the SAX parser (plus an additional one if needed):
175
176
<ul>
176
177
<li><code>start_doc</code> is called when document parsing starts, before parsing the first node.</li>
177
-
<li><code>start_node</code> is called when a new node has been found (e.g. "<code><newNode param="val"></code>")</li>
178
+
<li><code>start_node</code> is called when a new node has been found (e.g. "<code><newNode param="val"></code>"). <em>All node attributes are already read</em>.</li>
178
179
<li><code>end_node</code> is called when a node is being closed. (e.g. "<code></newNode></code>")</li>
179
-
<li><code>new_text</code> is called when text has been read from a node(e.g. "<code><newNode>My text</newNode></code>")</li>
180
+
<li><code>new_text</code> is called when text has been read from a node(e.g. "<code><newNode>My text</newNode></code>" or "<code><newNode>My text<OtherNode>...</code>")</li>
180
181
<li><code>end_doc</code> is called when document parsing ends. No other callbacks will be called after.</li>
181
182
<li><code>on_error</code> is called when an error occurs during parsing. Parsing stops after.</li>
182
183
<li><code>all_event</code> is given for those who prefer to handle all such events in a single function instead of three
@@ -297,9 +298,15 @@ <h6>DOM text handling</h6>
297
298
<ul>
298
299
<li><code>node1.text</code> is <code>NULL</code></li>
299
300
<li><code>node1.n_children</code> is 3</li>
300
-
<li><code>node1.children[0]->tag_type</code> is <code>TAG_FATHER</code></li>
301
-
<li><code>node1.children[0]->text</code> is <code>text1</code></li>
302
-
<li><code>node1.children[2]->text</code> is <code>text3</code></li>
301
+
<li><code>node1.children[0]</code>:<ul>
302
+
<li><code>.tag_type</code> is <code>TAG_TEXT</code></li>
303
+
<li><code>.text</code> is <code>text1</code></li></ul></li>
304
+
<li><code>node1.children[1]</code>:<ul>
305
+
<li><code>.tag_type</code> is <code>TAG_FATHER</code></li>
306
+
<li><code>.text</code> is <code>NULL</code></li></ul></li>
307
+
<li><code>node1.children[2]</code>:<ul>
308
+
<li><code>.tag_type</code> is <code>TAG_TEXT</code></li>
309
+
<li><code>.text</code> is <code>text3</code></li></ul></li>
303
310
</ul>
304
311
The previous behavior is kept if <code>DOM_through_SAX.text_as_nodes</code> is 0 (text concatenation).
305
312
</p>
@@ -318,38 +325,22 @@ <h4>Create an XML document</h4>
0 commit comments