xref: /aosp_15_r20/external/libxml2/doc/devhelp/libxml2-debugXML.html (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>debugXML: Tree debugging APIs</title>
5<meta name="generator" content="Libxml2 devhelp stylesheet">
6<link rel="start" href="index.html" title="libxml2 Reference Manual">
7<link rel="up" href="general.html" title="API">
8<link rel="stylesheet" href="style.css" type="text/css">
9<link rel="chapter" href="general.html" title="API">
10</head>
11<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
12<table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
13<td><a accesskey="p" href="libxml2-chvalid.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
14<td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
15<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
16<td><a accesskey="n" href="libxml2-dict.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
17<th width="100%" align="center">libxml2 Reference Manual</th>
18</tr></table>
19<h2><span class="refentrytitle">debugXML</span></h2>
20<p>debugXML - Tree debugging APIs</p>
21<p>Interfaces to a set of routines used for debugging the tree produced by the XML parser. </p>
22<p>Author(s): Daniel Veillard </p>
23<div class="refsynopsisdiv">
24<h2>Synopsis</h2>
25<pre class="synopsis">typedef struct _xmlShellCtxt <a href="#xmlShellCtxt">xmlShellCtxt</a>;
26typedef <a href="libxml2-debugXML.html#xmlShellCtxt">xmlShellCtxt</a> * <a href="#xmlShellCtxtPtr">xmlShellCtxtPtr</a>;
27const char *	<a href="#xmlBoolToText">xmlBoolToText</a>		(int boolval);
28int	<a href="#xmlDebugCheckDocument">xmlDebugCheckDocument</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
29void	<a href="#xmlDebugDumpAttr">xmlDebugDumpAttr</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth);
30void	<a href="#xmlDebugDumpAttrList">xmlDebugDumpAttrList</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth);
31void	<a href="#xmlDebugDumpDTD">xmlDebugDumpDTD</a>			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd);
32void	<a href="#xmlDebugDumpDocument">xmlDebugDumpDocument</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
33void	<a href="#xmlDebugDumpDocumentHead">xmlDebugDumpDocumentHead</a>	(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
34void	<a href="#xmlDebugDumpEntities">xmlDebugDumpEntities</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
35void	<a href="#xmlDebugDumpNode">xmlDebugDumpNode</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth);
36void	<a href="#xmlDebugDumpNodeList">xmlDebugDumpNodeList</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth);
37void	<a href="#xmlDebugDumpOneNode">xmlDebugDumpOneNode</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth);
38void	<a href="#xmlDebugDumpString">xmlDebugDumpString</a>		(FILE * output, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str);
39int	<a href="#xmlLsCountNode">xmlLsCountNode</a>			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
40void	<a href="#xmlLsOneNode">xmlLsOneNode</a>			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
41void	<a href="#xmlShell">xmlShell</a>			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const char * filename, <br>					 <a href="libxml2-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a> input, <br>					 FILE * output);
42int	<a href="#xmlShellBase">xmlShellBase</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
43int	<a href="#xmlShellCat">xmlShellCat</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
44typedef int <a href="#xmlShellCmd">xmlShellCmd</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
45int	<a href="#xmlShellDir">xmlShellDir</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
46int	<a href="#xmlShellDu">xmlShellDu</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
47int	<a href="#xmlShellList">xmlShellList</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
48int	<a href="#xmlShellLoad">xmlShellLoad</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
49void	<a href="#xmlShellPrintNode">xmlShellPrintNode</a>		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
50void	<a href="#xmlShellPrintXPathError">xmlShellPrintXPathError</a>		(int errorType, <br>					 const char * arg);
51void	<a href="#xmlShellPrintXPathResult">xmlShellPrintXPathResult</a>	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> list);
52int	<a href="#xmlShellPwd">xmlShellPwd</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * buffer, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
53typedef char * <a href="#xmlShellReadlineFunc">xmlShellReadlineFunc</a>		(char * prompt);
54int	<a href="#xmlShellSave">xmlShellSave</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
55int	<a href="#xmlShellValidate">xmlShellValidate</a>		(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * dtd, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
56int	<a href="#xmlShellWrite">xmlShellWrite</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
57</pre>
58</div>
59<div class="refsect1" lang="en"><h2>Description</h2></div>
60<div class="refsect1" lang="en">
61<h2>Details</h2>
62<div class="refsect2" lang="en">
63<div class="refsect2" lang="en">
64<h3>
65<a name="xmlShellCtxt">Structure </a>xmlShellCtxt</h3>
66<pre class="programlisting">struct _xmlShellCtxt {
67    char *	filename
68    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc
69    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
70    <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>	pctxt
71    int	loaded
72    FILE *	output
73    <a href="libxml2-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a>	input
74} xmlShellCtxt;
75</pre>
76<p></p>
77</div>
78<hr>
79<div class="refsect2" lang="en">
80<h3>
81<a name="xmlShellCtxtPtr">Typedef </a>xmlShellCtxtPtr</h3>
82<pre class="programlisting"><a href="libxml2-debugXML.html#xmlShellCtxt">xmlShellCtxt</a> * xmlShellCtxtPtr;
83</pre>
84<p></p>
85</div>
86<hr>
87<div class="refsect2" lang="en">
88<h3>
89<a name="xmlShellCmd"></a>Function type xmlShellCmd</h3>
90<pre class="programlisting">int	xmlShellCmd			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
91</pre>
92<p>This is a generic signature for the XML shell functions.</p>
93<div class="variablelist"><table border="0">
94<col align="left">
95<tbody>
96<tr>
97<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
98<td>a shell context</td>
99</tr>
100<tr>
101<td><span class="term"><i><tt>arg</tt></i>:</span></td>
102<td>a string argument</td>
103</tr>
104<tr>
105<td><span class="term"><i><tt>node</tt></i>:</span></td>
106<td>a first node</td>
107</tr>
108<tr>
109<td><span class="term"><i><tt>node2</tt></i>:</span></td>
110<td>a second node</td>
111</tr>
112<tr>
113<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
114<td>an int, negative returns indicating errors.</td>
115</tr>
116</tbody>
117</table></div>
118</div>
119<hr>
120<div class="refsect2" lang="en">
121<h3>
122<a name="xmlShellReadlineFunc"></a>Function type xmlShellReadlineFunc</h3>
123<pre class="programlisting">char *	xmlShellReadlineFunc		(char * prompt)<br>
124</pre>
125<p>This is a generic signature for the XML shell input function.</p>
126<div class="variablelist"><table border="0">
127<col align="left">
128<tbody>
129<tr>
130<td><span class="term"><i><tt>prompt</tt></i>:</span></td>
131<td>a string prompt</td>
132</tr>
133<tr>
134<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
135<td>a string which will be freed by the Shell.</td>
136</tr>
137</tbody>
138</table></div>
139</div>
140<hr>
141<div class="refsect2" lang="en">
142<h3>
143<a name="xmlBoolToText"></a>xmlBoolToText ()</h3>
144<pre class="programlisting">const char *	xmlBoolToText		(int boolval)<br>
145</pre>
146<p>Convenient way to turn bool into text</p>
147<div class="variablelist"><table border="0">
148<col align="left">
149<tbody>
150<tr>
151<td><span class="term"><i><tt>boolval</tt></i>:</span></td>
152<td>a bool to turn into text</td>
153</tr>
154<tr>
155<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
156<td>a pointer to either "True" or "False"</td>
157</tr>
158</tbody>
159</table></div>
160</div>
161<hr>
162<div class="refsect2" lang="en">
163<h3>
164<a name="xmlDebugCheckDocument"></a>xmlDebugCheckDocument ()</h3>
165<pre class="programlisting">int	xmlDebugCheckDocument		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
166</pre>
167<p>Check the document for potential content problems, and output the errors to @output</p>
168<div class="variablelist"><table border="0">
169<col align="left">
170<tbody>
171<tr>
172<td><span class="term"><i><tt>output</tt></i>:</span></td>
173<td>the FILE * for the output</td>
174</tr>
175<tr>
176<td><span class="term"><i><tt>doc</tt></i>:</span></td>
177<td>the document</td>
178</tr>
179<tr>
180<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
181<td>the number of errors found</td>
182</tr>
183</tbody>
184</table></div>
185</div>
186<hr>
187<div class="refsect2" lang="en">
188<h3>
189<a name="xmlDebugDumpAttr"></a>xmlDebugDumpAttr ()</h3>
190<pre class="programlisting">void	xmlDebugDumpAttr		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth)<br>
191</pre>
192<p>Dumps debug information for the <a href="libxml2-SAX.html#attribute">attribute</a></p>
193<div class="variablelist"><table border="0">
194<col align="left">
195<tbody>
196<tr>
197<td><span class="term"><i><tt>output</tt></i>:</span></td>
198<td>the FILE * for the output</td>
199</tr>
200<tr>
201<td><span class="term"><i><tt>attr</tt></i>:</span></td>
202<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
203</td>
204</tr>
205<tr>
206<td><span class="term"><i><tt>depth</tt></i>:</span></td>
207<td>the indentation level.</td>
208</tr>
209</tbody>
210</table></div>
211</div>
212<hr>
213<div class="refsect2" lang="en">
214<h3>
215<a name="xmlDebugDumpAttrList"></a>xmlDebugDumpAttrList ()</h3>
216<pre class="programlisting">void	xmlDebugDumpAttrList		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth)<br>
217</pre>
218<p>Dumps debug information for the <a href="libxml2-SAX.html#attribute">attribute</a> list</p>
219<div class="variablelist"><table border="0">
220<col align="left">
221<tbody>
222<tr>
223<td><span class="term"><i><tt>output</tt></i>:</span></td>
224<td>the FILE * for the output</td>
225</tr>
226<tr>
227<td><span class="term"><i><tt>attr</tt></i>:</span></td>
228<td>the <a href="libxml2-SAX.html#attribute">attribute</a> list</td>
229</tr>
230<tr>
231<td><span class="term"><i><tt>depth</tt></i>:</span></td>
232<td>the indentation level.</td>
233</tr>
234</tbody>
235</table></div>
236</div>
237<hr>
238<div class="refsect2" lang="en">
239<h3>
240<a name="xmlDebugDumpDTD"></a>xmlDebugDumpDTD ()</h3>
241<pre class="programlisting">void	xmlDebugDumpDTD			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd)<br>
242</pre>
243<p>Dumps debug information for the DTD</p>
244<div class="variablelist"><table border="0">
245<col align="left">
246<tbody>
247<tr>
248<td><span class="term"><i><tt>output</tt></i>:</span></td>
249<td>the FILE * for the output</td>
250</tr>
251<tr>
252<td><span class="term"><i><tt>dtd</tt></i>:</span></td>
253<td>the DTD</td>
254</tr>
255</tbody>
256</table></div>
257</div>
258<hr>
259<div class="refsect2" lang="en">
260<h3>
261<a name="xmlDebugDumpDocument"></a>xmlDebugDumpDocument ()</h3>
262<pre class="programlisting">void	xmlDebugDumpDocument		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
263</pre>
264<p>Dumps debug information for the document, it's recursive</p>
265<div class="variablelist"><table border="0">
266<col align="left">
267<tbody>
268<tr>
269<td><span class="term"><i><tt>output</tt></i>:</span></td>
270<td>the FILE * for the output</td>
271</tr>
272<tr>
273<td><span class="term"><i><tt>doc</tt></i>:</span></td>
274<td>the document</td>
275</tr>
276</tbody>
277</table></div>
278</div>
279<hr>
280<div class="refsect2" lang="en">
281<h3>
282<a name="xmlDebugDumpDocumentHead"></a>xmlDebugDumpDocumentHead ()</h3>
283<pre class="programlisting">void	xmlDebugDumpDocumentHead	(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
284</pre>
285<p>Dumps debug information concerning the document, not recursive</p>
286<div class="variablelist"><table border="0">
287<col align="left">
288<tbody>
289<tr>
290<td><span class="term"><i><tt>output</tt></i>:</span></td>
291<td>the FILE * for the output</td>
292</tr>
293<tr>
294<td><span class="term"><i><tt>doc</tt></i>:</span></td>
295<td>the document</td>
296</tr>
297</tbody>
298</table></div>
299</div>
300<hr>
301<div class="refsect2" lang="en">
302<h3>
303<a name="xmlDebugDumpEntities"></a>xmlDebugDumpEntities ()</h3>
304<pre class="programlisting">void	xmlDebugDumpEntities		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
305</pre>
306<p>Dumps debug information for all the entities in use by the document</p>
307<div class="variablelist"><table border="0">
308<col align="left">
309<tbody>
310<tr>
311<td><span class="term"><i><tt>output</tt></i>:</span></td>
312<td>the FILE * for the output</td>
313</tr>
314<tr>
315<td><span class="term"><i><tt>doc</tt></i>:</span></td>
316<td>the document</td>
317</tr>
318</tbody>
319</table></div>
320</div>
321<hr>
322<div class="refsect2" lang="en">
323<h3>
324<a name="xmlDebugDumpNode"></a>xmlDebugDumpNode ()</h3>
325<pre class="programlisting">void	xmlDebugDumpNode		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth)<br>
326</pre>
327<p>Dumps debug information for the element node, it is recursive</p>
328<div class="variablelist"><table border="0">
329<col align="left">
330<tbody>
331<tr>
332<td><span class="term"><i><tt>output</tt></i>:</span></td>
333<td>the FILE * for the output</td>
334</tr>
335<tr>
336<td><span class="term"><i><tt>node</tt></i>:</span></td>
337<td>the node</td>
338</tr>
339<tr>
340<td><span class="term"><i><tt>depth</tt></i>:</span></td>
341<td>the indentation level.</td>
342</tr>
343</tbody>
344</table></div>
345</div>
346<hr>
347<div class="refsect2" lang="en">
348<h3>
349<a name="xmlDebugDumpNodeList"></a>xmlDebugDumpNodeList ()</h3>
350<pre class="programlisting">void	xmlDebugDumpNodeList		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth)<br>
351</pre>
352<p>Dumps debug information for the list of element node, it is recursive</p>
353<div class="variablelist"><table border="0">
354<col align="left">
355<tbody>
356<tr>
357<td><span class="term"><i><tt>output</tt></i>:</span></td>
358<td>the FILE * for the output</td>
359</tr>
360<tr>
361<td><span class="term"><i><tt>node</tt></i>:</span></td>
362<td>the node list</td>
363</tr>
364<tr>
365<td><span class="term"><i><tt>depth</tt></i>:</span></td>
366<td>the indentation level.</td>
367</tr>
368</tbody>
369</table></div>
370</div>
371<hr>
372<div class="refsect2" lang="en">
373<h3>
374<a name="xmlDebugDumpOneNode"></a>xmlDebugDumpOneNode ()</h3>
375<pre class="programlisting">void	xmlDebugDumpOneNode		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth)<br>
376</pre>
377<p>Dumps debug information for the element node, it is not recursive</p>
378<div class="variablelist"><table border="0">
379<col align="left">
380<tbody>
381<tr>
382<td><span class="term"><i><tt>output</tt></i>:</span></td>
383<td>the FILE * for the output</td>
384</tr>
385<tr>
386<td><span class="term"><i><tt>node</tt></i>:</span></td>
387<td>the node</td>
388</tr>
389<tr>
390<td><span class="term"><i><tt>depth</tt></i>:</span></td>
391<td>the indentation level.</td>
392</tr>
393</tbody>
394</table></div>
395</div>
396<hr>
397<div class="refsect2" lang="en">
398<h3>
399<a name="xmlDebugDumpString"></a>xmlDebugDumpString ()</h3>
400<pre class="programlisting">void	xmlDebugDumpString		(FILE * output, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str)<br>
401</pre>
402<p>Dumps information about the string, shorten it if necessary</p>
403<div class="variablelist"><table border="0">
404<col align="left">
405<tbody>
406<tr>
407<td><span class="term"><i><tt>output</tt></i>:</span></td>
408<td>the FILE * for the output</td>
409</tr>
410<tr>
411<td><span class="term"><i><tt>str</tt></i>:</span></td>
412<td>the string</td>
413</tr>
414</tbody>
415</table></div>
416</div>
417<hr>
418<div class="refsect2" lang="en">
419<h3>
420<a name="xmlLsCountNode"></a>xmlLsCountNode ()</h3>
421<pre class="programlisting">int	xmlLsCountNode			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br>
422</pre>
423<p>Count the children of @node.</p>
424<div class="variablelist"><table border="0">
425<col align="left">
426<tbody>
427<tr>
428<td><span class="term"><i><tt>node</tt></i>:</span></td>
429<td>the node to count</td>
430</tr>
431<tr>
432<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
433<td>the number of children of @node.</td>
434</tr>
435</tbody>
436</table></div>
437</div>
438<hr>
439<div class="refsect2" lang="en">
440<h3>
441<a name="xmlLsOneNode"></a>xmlLsOneNode ()</h3>
442<pre class="programlisting">void	xmlLsOneNode			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br>
443</pre>
444<p>Dump to @output the type and name of @node.</p>
445<div class="variablelist"><table border="0">
446<col align="left">
447<tbody>
448<tr>
449<td><span class="term"><i><tt>output</tt></i>:</span></td>
450<td>the FILE * for the output</td>
451</tr>
452<tr>
453<td><span class="term"><i><tt>node</tt></i>:</span></td>
454<td>the node to dump</td>
455</tr>
456</tbody>
457</table></div>
458</div>
459<hr>
460<div class="refsect2" lang="en">
461<h3>
462<a name="xmlShell"></a>xmlShell ()</h3>
463<pre class="programlisting">void	xmlShell			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const char * filename, <br>					 <a href="libxml2-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a> input, <br>					 FILE * output)<br>
464</pre>
465<p>Implements the XML shell This allow to load, validate, view, modify and save a document using a environment similar to a UNIX commandline.</p>
466<div class="variablelist"><table border="0">
467<col align="left">
468<tbody>
469<tr>
470<td><span class="term"><i><tt>doc</tt></i>:</span></td>
471<td>the initial document</td>
472</tr>
473<tr>
474<td><span class="term"><i><tt>filename</tt></i>:</span></td>
475<td>the output buffer</td>
476</tr>
477<tr>
478<td><span class="term"><i><tt>input</tt></i>:</span></td>
479<td>the line reading function</td>
480</tr>
481<tr>
482<td><span class="term"><i><tt>output</tt></i>:</span></td>
483<td>the output FILE*, defaults to stdout if NULL</td>
484</tr>
485</tbody>
486</table></div>
487</div>
488<hr>
489<div class="refsect2" lang="en">
490<h3>
491<a name="xmlShellBase"></a>xmlShellBase ()</h3>
492<pre class="programlisting">int	xmlShellBase			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
493</pre>
494<p>Implements the XML shell function "base" dumps the current XML base of the node</p>
495<div class="variablelist"><table border="0">
496<col align="left">
497<tbody>
498<tr>
499<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
500<td>the shell context</td>
501</tr>
502<tr>
503<td><span class="term"><i><tt>arg</tt></i>:</span></td>
504<td>unused</td>
505</tr>
506<tr>
507<td><span class="term"><i><tt>node</tt></i>:</span></td>
508<td>a node</td>
509</tr>
510<tr>
511<td><span class="term"><i><tt>node2</tt></i>:</span></td>
512<td>unused</td>
513</tr>
514<tr>
515<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
516<td>0</td>
517</tr>
518</tbody>
519</table></div>
520</div>
521<hr>
522<div class="refsect2" lang="en">
523<h3>
524<a name="xmlShellCat"></a>xmlShellCat ()</h3>
525<pre class="programlisting">int	xmlShellCat			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
526</pre>
527<p>Implements the XML shell function "cat" dumps the serialization node content (XML or HTML).</p>
528<div class="variablelist"><table border="0">
529<col align="left">
530<tbody>
531<tr>
532<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
533<td>the shell context</td>
534</tr>
535<tr>
536<td><span class="term"><i><tt>arg</tt></i>:</span></td>
537<td>unused</td>
538</tr>
539<tr>
540<td><span class="term"><i><tt>node</tt></i>:</span></td>
541<td>a node</td>
542</tr>
543<tr>
544<td><span class="term"><i><tt>node2</tt></i>:</span></td>
545<td>unused</td>
546</tr>
547<tr>
548<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
549<td>0</td>
550</tr>
551</tbody>
552</table></div>
553</div>
554<hr>
555<div class="refsect2" lang="en">
556<h3>
557<a name="xmlShellDir"></a>xmlShellDir ()</h3>
558<pre class="programlisting">int	xmlShellDir			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
559</pre>
560<p>Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).</p>
561<div class="variablelist"><table border="0">
562<col align="left">
563<tbody>
564<tr>
565<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
566<td>the shell context</td>
567</tr>
568<tr>
569<td><span class="term"><i><tt>arg</tt></i>:</span></td>
570<td>unused</td>
571</tr>
572<tr>
573<td><span class="term"><i><tt>node</tt></i>:</span></td>
574<td>a node</td>
575</tr>
576<tr>
577<td><span class="term"><i><tt>node2</tt></i>:</span></td>
578<td>unused</td>
579</tr>
580<tr>
581<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
582<td>0</td>
583</tr>
584</tbody>
585</table></div>
586</div>
587<hr>
588<div class="refsect2" lang="en">
589<h3>
590<a name="xmlShellDu"></a>xmlShellDu ()</h3>
591<pre class="programlisting">int	xmlShellDu			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
592</pre>
593<p>Implements the XML shell function "du" show the structure of the subtree under node @tree If @tree is null, the command works on the current node.</p>
594<div class="variablelist"><table border="0">
595<col align="left">
596<tbody>
597<tr>
598<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
599<td>the shell context</td>
600</tr>
601<tr>
602<td><span class="term"><i><tt>arg</tt></i>:</span></td>
603<td>unused</td>
604</tr>
605<tr>
606<td><span class="term"><i><tt>tree</tt></i>:</span></td>
607<td>a node defining a subtree</td>
608</tr>
609<tr>
610<td><span class="term"><i><tt>node2</tt></i>:</span></td>
611<td>unused</td>
612</tr>
613<tr>
614<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
615<td>0 or -1 in case of error</td>
616</tr>
617</tbody>
618</table></div>
619</div>
620<hr>
621<div class="refsect2" lang="en">
622<h3>
623<a name="xmlShellList"></a>xmlShellList ()</h3>
624<pre class="programlisting">int	xmlShellList			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
625</pre>
626<p>Implements the XML shell function "ls" Does an Unix like listing of the given node (like a directory)</p>
627<div class="variablelist"><table border="0">
628<col align="left">
629<tbody>
630<tr>
631<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
632<td>the shell context</td>
633</tr>
634<tr>
635<td><span class="term"><i><tt>arg</tt></i>:</span></td>
636<td>unused</td>
637</tr>
638<tr>
639<td><span class="term"><i><tt>node</tt></i>:</span></td>
640<td>a node</td>
641</tr>
642<tr>
643<td><span class="term"><i><tt>node2</tt></i>:</span></td>
644<td>unused</td>
645</tr>
646<tr>
647<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
648<td>0</td>
649</tr>
650</tbody>
651</table></div>
652</div>
653<hr>
654<div class="refsect2" lang="en">
655<h3>
656<a name="xmlShellLoad"></a>xmlShellLoad ()</h3>
657<pre class="programlisting">int	xmlShellLoad			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
658</pre>
659<p>Implements the XML shell function "load" loads a new document specified by the filename</p>
660<div class="variablelist"><table border="0">
661<col align="left">
662<tbody>
663<tr>
664<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
665<td>the shell context</td>
666</tr>
667<tr>
668<td><span class="term"><i><tt>filename</tt></i>:</span></td>
669<td>the file name</td>
670</tr>
671<tr>
672<td><span class="term"><i><tt>node</tt></i>:</span></td>
673<td>unused</td>
674</tr>
675<tr>
676<td><span class="term"><i><tt>node2</tt></i>:</span></td>
677<td>unused</td>
678</tr>
679<tr>
680<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
681<td>0 or -1 if loading failed</td>
682</tr>
683</tbody>
684</table></div>
685</div>
686<hr>
687<div class="refsect2" lang="en">
688<h3>
689<a name="xmlShellPrintNode"></a>xmlShellPrintNode ()</h3>
690<pre class="programlisting">void	xmlShellPrintNode		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br>
691</pre>
692<p>Print node to the output FILE</p>
693<div class="variablelist"><table border="0">
694<col align="left">
695<tbody><tr>
696<td><span class="term"><i><tt>node</tt></i>:</span></td>
697<td>a non-null node to print to the output FILE</td>
698</tr></tbody>
699</table></div>
700</div>
701<hr>
702<div class="refsect2" lang="en">
703<h3>
704<a name="xmlShellPrintXPathError"></a>xmlShellPrintXPathError ()</h3>
705<pre class="programlisting">void	xmlShellPrintXPathError		(int errorType, <br>					 const char * arg)<br>
706</pre>
707<p>Print the xpath error to libxml default error channel</p>
708<div class="variablelist"><table border="0">
709<col align="left">
710<tbody>
711<tr>
712<td><span class="term"><i><tt>errorType</tt></i>:</span></td>
713<td>valid xpath error id</td>
714</tr>
715<tr>
716<td><span class="term"><i><tt>arg</tt></i>:</span></td>
717<td>the argument that cause xpath to fail</td>
718</tr>
719</tbody>
720</table></div>
721</div>
722<hr>
723<div class="refsect2" lang="en">
724<h3>
725<a name="xmlShellPrintXPathResult"></a>xmlShellPrintXPathResult ()</h3>
726<pre class="programlisting">void	xmlShellPrintXPathResult	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> list)<br>
727</pre>
728<p>Prints result to the output FILE</p>
729<div class="variablelist"><table border="0">
730<col align="left">
731<tbody><tr>
732<td><span class="term"><i><tt>list</tt></i>:</span></td>
733<td>a valid result generated by an xpath evaluation</td>
734</tr></tbody>
735</table></div>
736</div>
737<hr>
738<div class="refsect2" lang="en">
739<h3>
740<a name="xmlShellPwd"></a>xmlShellPwd ()</h3>
741<pre class="programlisting">int	xmlShellPwd			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * buffer, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
742</pre>
743<p>Implements the XML shell function "pwd" Show the full path from the root to the node, if needed building thumblers when similar elements exists at a given ancestor level. The output is compatible with XPath commands.</p>
744<div class="variablelist"><table border="0">
745<col align="left">
746<tbody>
747<tr>
748<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
749<td>the shell context</td>
750</tr>
751<tr>
752<td><span class="term"><i><tt>buffer</tt></i>:</span></td>
753<td>the output buffer</td>
754</tr>
755<tr>
756<td><span class="term"><i><tt>node</tt></i>:</span></td>
757<td>a node</td>
758</tr>
759<tr>
760<td><span class="term"><i><tt>node2</tt></i>:</span></td>
761<td>unused</td>
762</tr>
763<tr>
764<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
765<td>0 or -1 in case of error</td>
766</tr>
767</tbody>
768</table></div>
769</div>
770<hr>
771<div class="refsect2" lang="en">
772<h3>
773<a name="xmlShellSave"></a>xmlShellSave ()</h3>
774<pre class="programlisting">int	xmlShellSave			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
775</pre>
776<p>Implements the XML shell function "save" Write the current document to the filename, or it's original name</p>
777<div class="variablelist"><table border="0">
778<col align="left">
779<tbody>
780<tr>
781<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
782<td>the shell context</td>
783</tr>
784<tr>
785<td><span class="term"><i><tt>filename</tt></i>:</span></td>
786<td>the file name (optional)</td>
787</tr>
788<tr>
789<td><span class="term"><i><tt>node</tt></i>:</span></td>
790<td>unused</td>
791</tr>
792<tr>
793<td><span class="term"><i><tt>node2</tt></i>:</span></td>
794<td>unused</td>
795</tr>
796<tr>
797<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
798<td>0 or -1 in case of error</td>
799</tr>
800</tbody>
801</table></div>
802</div>
803<hr>
804<div class="refsect2" lang="en">
805<h3>
806<a name="xmlShellValidate"></a>xmlShellValidate ()</h3>
807<pre class="programlisting">int	xmlShellValidate		(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * dtd, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
808</pre>
809<p>Implements the XML shell function "validate" Validate the document, if a DTD path is provided, then the validation is done against the given DTD.</p>
810<div class="variablelist"><table border="0">
811<col align="left">
812<tbody>
813<tr>
814<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
815<td>the shell context</td>
816</tr>
817<tr>
818<td><span class="term"><i><tt>dtd</tt></i>:</span></td>
819<td>the DTD URI (optional)</td>
820</tr>
821<tr>
822<td><span class="term"><i><tt>node</tt></i>:</span></td>
823<td>unused</td>
824</tr>
825<tr>
826<td><span class="term"><i><tt>node2</tt></i>:</span></td>
827<td>unused</td>
828</tr>
829<tr>
830<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
831<td>0 or -1 in case of error</td>
832</tr>
833</tbody>
834</table></div>
835</div>
836<hr>
837<div class="refsect2" lang="en">
838<h3>
839<a name="xmlShellWrite"></a>xmlShellWrite ()</h3>
840<pre class="programlisting">int	xmlShellWrite			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
841</pre>
842<p>Implements the XML shell function "write" Write the current node to the filename, it saves the serialization of the subtree under the @node specified</p>
843<div class="variablelist"><table border="0">
844<col align="left">
845<tbody>
846<tr>
847<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
848<td>the shell context</td>
849</tr>
850<tr>
851<td><span class="term"><i><tt>filename</tt></i>:</span></td>
852<td>the file name</td>
853</tr>
854<tr>
855<td><span class="term"><i><tt>node</tt></i>:</span></td>
856<td>a node in the tree</td>
857</tr>
858<tr>
859<td><span class="term"><i><tt>node2</tt></i>:</span></td>
860<td>unused</td>
861</tr>
862<tr>
863<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
864<td>0 or -1 in case of error</td>
865</tr>
866</tbody>
867</table></div>
868</div>
869<hr>
870</div>
871</div>
872</body>
873</html>
874