examples.xml 31.4 KB
Newer Older
1
<examples>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
2 3 4 5 6 7
  <example filename='io1.c'>
    <synopsis>Example of custom Input/Output</synopsis>
    <purpose>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</purpose>
    <usage>io1</usage>
    <test>io1 &gt; io1.tmp &amp;&amp; diff io1.tmp $(srcdir)/io1.res</test>
    <author>Daniel Veillard</author>
8
    <copy>see Copyright for the status of this software. </copy>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
9
    <section>InputOutput</section>
10 11
    <includes>
      <include>&lt;libxml/parser.h&gt;</include>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
12 13
      <include>&lt;libxml/xmlIO.h&gt;</include>
      <include>&lt;libxml/xinclude.h&gt;</include>
14
      <include>&lt;libxml/tree.h&gt;</include>
15 16
    </includes>
    <uses>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
17 18 19 20 21 22 23 24 25
      <function line='143' file='tree' name='xmlDocDump'/>
      <function line='158' file='xmlmemory' name='xmlMemoryDump'/>
      <function line='149' file='tree' name='xmlFreeDoc'/>
      <function line='154' file='parser' name='xmlCleanupParser'/>
      <macro line='117' file='xmlversion' name='LIBXML_TEST_VERSION'/>
      <function line='134' file='xinclude' name='xmlXIncludeProcess'/>
      <function line='117' file='xmlIO' name='xmlRegisterInputCallbacks'/>
      <function line='124' file='parser' name='xmlReadMemory'/>
      <typedef line='105' file='tree' name='xmlDocPtr'/>
26 27
    </uses>
  </example>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
28 29 30 31 32 33
  <example filename='io2.c'>
    <synopsis>Output to char buffer</synopsis>
    <purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose>
    <usage>io2</usage>
    <test>io2 &gt; io2.tmp &amp;&amp; diff io2.tmp $(srcdir)/io2.res</test>
    <author>John Fleck</author>
34
    <copy>see Copyright for the status of this software. </copy>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
35
    <section>InputOutput</section>
36 37 38 39
    <includes>
      <include>&lt;libxml/parser.h&gt;</include>
    </includes>
    <uses>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
40 41 42 43 44 45 46 47 48
      <function line='29' file='tree' name='xmlNodeSetContent'/>
      <function line='36' file='tree' name='xmlDocDumpFormatMemory'/>
      <variable line='42' file='globals' name='xmlFree'/>
      <function line='30' file='tree' name='xmlDocSetRootElement'/>
      <typedef line='20' file='tree' name='xmlDocPtr'/>
      <function line='43' file='tree' name='xmlFreeDoc'/>
      <typedef line='19' file='tree' name='xmlNodePtr'/>
      <function line='27' file='tree' name='xmlNewDoc'/>
      <function line='28' file='tree' name='xmlNewNode'/>
49 50
    </uses>
  </example>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
51 52
  <example filename='parse1.c'>
    <synopsis>Parse an XML file to a tree and free it</synopsis>
Jared Yanovich's avatar
Jared Yanovich committed
53
    <purpose>Demonstrate the use of xmlReadFile() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</purpose>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
54 55
    <usage>parse1 test1.xml</usage>
    <test>parse1 test1.xml</test>
56
    <author>Daniel Veillard</author>
57
    <copy>see Copyright for the status of this software. </copy>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
58
    <section>Parsing</section>
59
    <includes>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
60 61
      <include>&lt;libxml/tree.h&gt;</include>
      <include>&lt;libxml/parser.h&gt;</include>
62 63
    </includes>
    <uses>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
64 65 66 67 68 69
      <function line='54' file='xmlmemory' name='xmlMemoryDump'/>
      <function line='50' file='parser' name='xmlCleanupParser'/>
      <macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/>
      <typedef line='24' file='tree' name='xmlDocPtr'/>
      <function line='31' file='tree' name='xmlFreeDoc'/>
      <function line='26' file='parser' name='xmlReadFile'/>
70 71
    </uses>
  </example>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
72 73 74 75 76 77 78 79
  <example filename='parse2.c'>
    <synopsis>Parse and validate an XML file to a tree and free the result</synopsis>
    <purpose>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</purpose>
    <usage>parse2 test2.xml</usage>
    <test>parse2 test2.xml</test>
    <author>Daniel Veillard</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>Parsing</section>
80 81 82 83 84
    <includes>
      <include>&lt;libxml/tree.h&gt;</include>
      <include>&lt;libxml/parser.h&gt;</include>
    </includes>
    <uses>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
85 86 87 88 89 90 91 92 93 94
      <function line='47' file='parser' name='xmlFreeParserCtxt'/>
      <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/>
      <function line='29' file='parser' name='xmlNewParserCtxt'/>
      <typedef line='25' file='tree' name='xmlParserCtxtPtr'/>
      <function line='35' file='parser' name='xmlCtxtReadFile'/>
      <function line='66' file='parser' name='xmlCleanupParser'/>
      <macro line='61' file='xmlversion' name='LIBXML_TEST_VERSION'/>
      <function line='44' file='tree' name='xmlFreeDoc'/>
      <typedef line='26' file='tree' name='xmlDocPtr'/>
      <function line='70' file='xmlmemory' name='xmlMemoryDump'/>
95 96
    </uses>
  </example>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
97 98
  <example filename='parse3.c'>
    <synopsis>Parse an XML document in memory to a tree and free it</synopsis>
Jared Yanovich's avatar
Jared Yanovich committed
99
    <purpose>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</purpose>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
100 101
    <usage>parse3</usage>
    <test>parse3</test>
102 103
    <author>Daniel Veillard</author>
    <copy>see Copyright for the status of this software. </copy>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
104
    <section>Parsing</section>
105 106
    <includes>
      <include>&lt;libxml/tree.h&gt;</include>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
107
      <include>&lt;libxml/parser.h&gt;</include>
108 109
    </includes>
    <uses>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
110 111 112 113 114 115
      <function line='33' file='parser' name='xmlReadMemory'/>
      <function line='58' file='xmlmemory' name='xmlMemoryDump'/>
      <function line='54' file='parser' name='xmlCleanupParser'/>
      <macro line='49' file='xmlversion' name='LIBXML_TEST_VERSION'/>
      <function line='38' file='tree' name='xmlFreeDoc'/>
      <typedef line='27' file='tree' name='xmlDocPtr'/>
116 117 118 119
    </uses>
  </example>
  <example filename='parse4.c'>
    <synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis>
Jared Yanovich's avatar
Jared Yanovich committed
120
    <purpose>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and xmlFreeDoc() to free the resulting tree</purpose>
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
    <usage>parse4 test3.xml</usage>
    <test>parse4 test3.xml</test>
    <author>Daniel Veillard</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>Parsing</section>
    <includes>
      <include>&lt;libxml/tree.h&gt;</include>
      <include>&lt;libxml/parser.h&gt;</include>
    </includes>
    <uses>
      <function line='94' file='parser' name='xmlFreeParserCtxt'/>
      <function line='86' file='parser' name='xmlParseChunk'/>
      <function line='103' file='tree' name='xmlFreeDoc'/>
      <function line='135' file='xmlmemory' name='xmlMemoryDump'/>
      <function line='67' file='parser' name='xmlCreatePushParserCtxt'/>
      <function line='131' file='parser' name='xmlCleanupParser'/>
      <macro line='120' file='xmlversion' name='LIBXML_TEST_VERSION'/>
      <typedef line='45' file='tree' name='xmlParserCtxtPtr'/>
      <typedef line='47' file='tree' name='xmlDocPtr'/>
    </uses>
  </example>
142 143 144 145
  <example filename='reader1.c'>
    <synopsis>Parse an XML file with an xmlReader</synopsis>
    <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
    <usage>reader1 &lt;filename&gt;</usage>
146
    <test>reader1 test2.xml &gt; reader1.tmp &amp;&amp; diff reader1.tmp $(srcdir)/reader1.res</test>
147 148
    <author>Daniel Veillard</author>
    <copy>see Copyright for the status of this software. </copy>
149
    <section>xmlReader</section>
150
    <includes>
151
      <include>&lt;libxml/xmlreader.h&gt;</include>
152 153
    </includes>
    <uses>
154
      <function line='44' file='xmlstring' name='xmlStrlen'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
155
      <function line='94' file='parser' name='xmlCleanupParser'/>
156 157
      <function line='37' file='xmlreader' name='xmlTextReaderNodeType'/>
      <typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
158
      <function line='98' file='xmlmemory' name='xmlMemoryDump'/>
159 160 161
      <function line='33' file='xmlreader' name='xmlTextReaderConstValue'/>
      <function line='36' file='xmlreader' name='xmlTextReaderDepth'/>
      <function line='69' file='xmlreader' name='xmlFreeTextReader'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
162
      <macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/>
163 164 165 166 167
      <function line='29' file='xmlreader' name='xmlTextReaderConstName'/>
      <function line='40' file='xmlreader' name='xmlTextReaderHasValue'/>
      <function line='67' file='xmlreader' name='xmlTextReaderRead'/>
      <function line='39' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
      <function line='62' file='xmlreader' name='xmlReaderForFile'/>
168 169
    </uses>
  </example>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
170 171 172 173 174 175
  <example filename='reader2.c'>
    <synopsis>Parse and validate an XML file with an xmlReader</synopsis>
    <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
    <usage>reader2 &lt;valid_xml_filename&gt;</usage>
    <test>reader2 test2.xml &gt; reader1.tmp &amp;&amp; diff reader1.tmp $(srcdir)/reader1.res</test>
    <author>Daniel Veillard</author>
176
    <copy>see Copyright for the status of this software. </copy>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
177
    <section>xmlReader</section>
178
    <includes>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
179
      <include>&lt;libxml/xmlreader.h&gt;</include>
180 181
    </includes>
    <uses>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
      <function line='45' file='xmlstring' name='xmlStrlen'/>
      <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/>
      <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/>
      <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/>
      <enum line='70' file='parser' name='XML_PARSE_NOENT'/>
      <function line='37' file='xmlreader' name='xmlTextReaderDepth'/>
      <enum line='71' file='parser' name='XML_PARSE_DTDVALID'/>
      <enum line='69' file='parser' name='XML_PARSE_DTDATTR'/>
      <function line='84' file='xmlreader' name='xmlFreeTextReader'/>
      <function line='30' file='xmlreader' name='xmlTextReaderConstName'/>
      <function line='41' file='xmlreader' name='xmlTextReaderHasValue'/>
      <function line='76' file='xmlreader' name='xmlTextReaderRead'/>
      <function line='40' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
      <function line='68' file='xmlreader' name='xmlReaderForFile'/>
      <function line='81' file='xmlreader' name='xmlTextReaderIsValid'/>
197 198 199 200 201 202
    </uses>
  </example>
  <example filename='reader3.c'>
    <synopsis>Show how to extract subdocuments with xmlReader</synopsis>
    <purpose>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
    <usage>reader3</usage>
203
    <test>reader3 &gt; reader3.tmp &amp;&amp; diff reader3.tmp $(srcdir)/reader3.res</test>
204 205 206 207 208 209 210
    <author>Daniel Veillard</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>xmlReader</section>
    <includes>
      <include>&lt;libxml/xmlreader.h&gt;</include>
    </includes>
    <uses>
Daniel Veillard's avatar
Daniel Veillard committed
211 212 213 214 215 216 217
      <typedef line='32' file='xmlreader' name='xmlTextReaderPtr'/>
      <function line='66' file='xmlreader' name='xmlFreeTextReader'/>
      <function line='96' file='tree' name='xmlDocDump'/>
      <function line='52' file='xmlreader' name='xmlTextReaderRead'/>
      <function line='62' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
      <function line='43' file='xmlreader' name='xmlTextReaderPreservePattern'/>
      <function line='38' file='xmlreader' name='xmlReaderForFile'/>
218 219 220 221 222 223
    </uses>
  </example>
  <example filename='reader4.c'>
    <synopsis>Parse multiple XML files reusing an xmlReader</synopsis>
    <purpose>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context.  (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
    <usage>reader4 &lt;filename&gt; [ filename ... ]</usage>
224
    <test>reader4 test1.xml test2.xml test3.xml &gt; reader4.tmp &amp;&amp; diff reader4.tmp $(srcdir)/reader4.res</test>
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
    <author>Graham Bennett</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>xmlReader</section>
    <includes>
      <include>&lt;libxml/xmlreader.h&gt;</include>
    </includes>
    <uses>
      <typedef line='54' file='xmlreader' name='xmlTextReaderPtr'/>
      <function line='83' file='xmlreader' name='xmlReaderNewFile'/>
      <function line='104' file='xmlreader' name='xmlFreeTextReader'/>
      <function line='26' file='xmlreader' name='xmlTextReaderRead'/>
      <function line='97' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
      <function line='72' file='xmlreader' name='xmlReaderForFile'/>
    </uses>
  </example>
240 241 242 243
  <example filename='testWriter.c'>
    <synopsis>use various APIs for the xmlWriter</synopsis>
    <purpose>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</purpose>
    <usage>testWriter</usage>
244
    <test>testWriter &amp;&amp; for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done</test>
245
    <author>Alfred Mickautsch</author>
246
    <copy>see Copyright for the status of this software. </copy>
247
    <section>xmlWriter</section>
248
    <includes>
249 250
      <include>&lt;libxml/encoding.h&gt;</include>
      <include>&lt;libxml/xmlwriter.h&gt;</include>
251 252
    </includes>
    <uses>
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
      <function line='913' file='xmlwriter' name='xmlTextWriterStartDocument'/>
      <function line='1121' file='xmlwriter' name='xmlTextWriterEndDocument'/>
      <variable line='1183' file='globals' name='xmlRealloc'/>
      <function line='925' file='xmlwriter' name='xmlTextWriterWriteComment'/>
      <function line='1156' file='encoding' name='xmlFindCharEncodingHandler'/>
      <variable line='1166' file='globals' name='xmlMalloc'/>
      <typedef line='341' file='tree' name='xmlBufferPtr'/>
      <macro line='885' file='parser' name='XML_DEFAULT_VERSION'/>
      <function line='901' file='tree' name='xmlDocSetRootElement'/>
      <function line='1127' file='xmlwriter' name='xmlFreeTextWriter'/>
      <function line='1096' file='xmlwriter' name='xmlTextWriterStartElement'/>
      <function line='347' file='tree' name='xmlBufferCreate'/>
      <function line='1111' file='xmlwriter' name='xmlTextWriterEndElement'/>
      <function line='76' file='xmlwriter' name='xmlNewTextWriterFilename'/>
      <function line='959' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/>
      <function line='1073' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/>
      <typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/>
      <typedef line='880' file='tree' name='xmlNodePtr'/>
      <function line='949' file='xmlwriter' name='xmlTextWriterWriteAttribute'/>
      <function line='632' file='xmlwriter' name='xmlNewTextWriterDoc'/>
      <function line='894' file='tree' name='xmlNewDocNode'/>
      <function line='1129' file='tree' name='xmlSaveFileEnc'/>
      <function line='904' file='xmlwriter' name='xmlNewTextWriterTree'/>
      <function line='355' file='xmlwriter' name='xmlNewTextWriterMemory'/>
      <variable line='1180' file='globals' name='xmlFree'/>
      <function line='613' file='tree' name='xmlBufferFree'/>
      <typedef line='878' file='xmlwriter' name='xmlTextWriterPtr'/>
      <function line='1103' file='xmlwriter' name='xmlTextWriterWriteElement'/>
      <function line='885' file='tree' name='xmlNewDoc'/>
282 283
    </uses>
  </example>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386
  <example filename='tree1.c'>
    <synopsis>Navigates a tree to print element names</synopsis>
    <purpose>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</purpose>
    <usage>tree1 filename_or_URL</usage>
    <test>tree1 test2.xml &gt; tree1.tmp &amp;&amp; diff tree1.tmp $(srcdir)/tree1.res</test>
    <author>Dodji Seketeli</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>Tree</section>
    <includes>
      <include>&lt;libxml/tree.h&gt;</include>
      <include>&lt;libxml/parser.h&gt;</include>
    </includes>
    <uses>
      <enum line='36' file='tree' name='XML_ELEMENT_NODE'/>
      <function line='74' file='tree' name='xmlDocGetRootElement'/>
      <function line='67' file='parser' name='xmlReadFile'/>
    </uses>
  </example>
  <example filename='tree2.c'>
    <synopsis>Creates a tree</synopsis>
    <purpose>Shows how to create document, nodes and dump it to stdout or file.</purpose>
    <usage>tree2 &lt;filename&gt;  -Default output: stdout</usage>
    <test>tree2 &gt; tree2.tmp &amp;&amp; diff tree2.tmp $(srcdir)/tree2.res</test>
    <author>Lucas Brasilino &lt;brasilino@recife.pe.gov.br&gt;</author>
    <copy>see Copyright for the status of this software </copy>
    <section>Tree</section>
    <includes>
      <include>&lt;libxml/tree.h&gt;</include>
      <include>&lt;libxml/parser.h&gt;</include>
    </includes>
    <uses>
      <function line='74' file='tree' name='xmlNewText'/>
      <function line='95' file='tree' name='xmlSaveFormatFileEnc'/>
      <function line='77' file='tree' name='xmlAddChild'/>
      <function line='40' file='tree' name='xmlDocSetRootElement'/>
      <function line='88' file='tree' name='xmlNewProp'/>
      <function line='87' file='tree' name='xmlNewChild'/>
      <function line='73' file='tree' name='xmlNewNode'/>
      <function line='45' file='tree' name='xmlCreateIntSubset'/>
      <function line='38' file='tree' name='xmlNewDoc'/>
    </uses>
  </example>
  <example filename='xpath1.c'>
    <synopsis>Evaluate XPath expression and prints result node set.</synopsis>
    <purpose>Shows how to evaluate XPath expression and register known namespaces in XPath context.</purpose>
    <usage>xpath1 &lt;xml-file&gt; &lt;xpath-expr&gt; [&lt;known-ns-list&gt;]</usage>
    <test>xpath1 test3.xml &apos;//child2&apos; &gt; xpath1.tmp &amp;&amp; diff xpath1.tmp $(srcdir)/xpath1.res</test>
    <author>Aleksey Sanin</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>XPath</section>
    <includes>
      <include>&lt;libxml/parser.h&gt;</include>
      <include>&lt;libxml/xpath.h&gt;</include>
      <include>&lt;libxml/xpathInternals.h&gt;</include>
      <include>&lt;libxml/tree.h&gt;</include>
    </includes>
    <uses>
      <enum line='229' file='tree' name='XML_ELEMENT_NODE'/>
      <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
      <function line='117' file='xpath' name='xmlXPathEvalExpression'/>
      <function line='94' file='parser' name='xmlParseFile'/>
      <function line='186' file='xpathInternals' name='xmlXPathRegisterNs'/>
      <function line='129' file='xpath' name='xmlXPathFreeObject'/>
      <variable line='193' file='globals' name='xmlFree'/>
      <typedef line='218' file='tree' name='xmlNsPtr'/>
      <function line='101' file='xpath' name='xmlXPathNewContext'/>
      <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
      <function line='130' file='xpath' name='xmlXPathFreeContext'/>
      <function line='39' file='parser' name='xmlInitParser'/>
      <function line='156' file='xmlstring' name='xmlStrdup'/>
      <function line='180' file='xmlstring' name='xmlStrchr'/>
      <typedef line='206' file='tree' name='xmlNodePtr'/>
      <enum line='217' file='tree' name='XML_NAMESPACE_DECL'/>
    </uses>
  </example>
  <example filename='xpath2.c'>
    <synopsis>Load a document, locate subelements with XPath, modify said elements and save the resulting document.</synopsis>
    <purpose>Shows how to make a full round-trip from a load/edit/save</purpose>
    <usage>xpath2 &lt;xml-file&gt; &lt;xpath-expr&gt; &lt;new-value&gt;</usage>
    <test>xpath2 test3.xml &apos;//discarded&apos; discarded &gt; xpath2.tmp &amp;&amp; diff xpath2.tmp $(srcdir)/xpath2.res</test>
    <author>Aleksey Sanin and Daniel Veillard</author>
    <copy>see Copyright for the status of this software. </copy>
    <section>XPath</section>
    <includes>
      <include>&lt;libxml/parser.h&gt;</include>
      <include>&lt;libxml/xpath.h&gt;</include>
      <include>&lt;libxml/xpathInternals.h&gt;</include>
      <include>&lt;libxml/tree.h&gt;</include>
    </includes>
    <uses>
      <function line='162' file='tree' name='xmlNodeSetContent'/>
      <function line='127' file='tree' name='xmlDocDump'/>
      <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
      <function line='110' file='xpath' name='xmlXPathEvalExpression'/>
      <function line='95' file='parser' name='xmlParseFile'/>
      <function line='123' file='xpath' name='xmlXPathFreeObject'/>
      <function line='102' file='xpath' name='xmlXPathNewContext'/>
      <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
      <function line='124' file='xpath' name='xmlXPathFreeContext'/>
      <function line='41' file='parser' name='xmlInitParser'/>
      <enum line='180' file='tree' name='XML_NAMESPACE_DECL'/>
    </uses>
  </example>
387 388
  <symbols>
    <symbol name='LIBXML_TEST_VERSION'>
389
      <ref filename='io1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
390 391 392
      <ref filename='parse1.c'/>
      <ref filename='parse2.c'/>
      <ref filename='parse3.c'/>
393
      <ref filename='parse4.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
394
      <ref filename='reader1.c'/>
395 396 397 398 399 400
    </symbol>
    <symbol name='XML_DEFAULT_VERSION'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='XML_ELEMENT_NODE'>
      <ref filename='tree1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
401
      <ref filename='xpath1.c'/>
402 403 404
    </symbol>
    <symbol name='XML_NAMESPACE_DECL'>
      <ref filename='xpath1.c'/>
405
      <ref filename='xpath2.c'/>
406 407 408 409 410
    </symbol>
    <symbol name='XML_PARSE_DTDATTR'>
      <ref filename='reader2.c'/>
    </symbol>
    <symbol name='XML_PARSE_DTDVALID'>
411
      <ref filename='parse2.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
412
      <ref filename='reader2.c'/>
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432
    </symbol>
    <symbol name='XML_PARSE_NOENT'>
      <ref filename='reader2.c'/>
    </symbol>
    <symbol name='xmlAddChild'>
      <ref filename='tree2.c'/>
    </symbol>
    <symbol name='xmlBufferCreate'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlBufferFree'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlBufferPtr'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlCharEncodingHandlerPtr'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlCleanupParser'>
433
      <ref filename='io1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
434 435 436
      <ref filename='parse1.c'/>
      <ref filename='parse2.c'/>
      <ref filename='parse3.c'/>
437
      <ref filename='parse4.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
438
      <ref filename='reader1.c'/>
439 440 441 442 443 444 445 446 447 448 449
    </symbol>
    <symbol name='xmlCreateIntSubset'>
      <ref filename='tree2.c'/>
    </symbol>
    <symbol name='xmlCreatePushParserCtxt'>
      <ref filename='parse4.c'/>
    </symbol>
    <symbol name='xmlCtxtReadFile'>
      <ref filename='parse2.c'/>
    </symbol>
    <symbol name='xmlDocDump'>
450
      <ref filename='io1.c'/>
451
      <ref filename='reader3.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
452
      <ref filename='xpath2.c'/>
453 454 455 456 457 458 459 460
    </symbol>
    <symbol name='xmlDocDumpFormatMemory'>
      <ref filename='io2.c'/>
    </symbol>
    <symbol name='xmlDocGetRootElement'>
      <ref filename='tree1.c'/>
    </symbol>
    <symbol name='xmlDocPtr'>
461 462
      <ref filename='io1.c'/>
      <ref filename='io2.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
463 464 465 466
      <ref filename='parse1.c'/>
      <ref filename='parse2.c'/>
      <ref filename='parse3.c'/>
      <ref filename='parse4.c'/>
467 468
    </symbol>
    <symbol name='xmlDocSetRootElement'>
469
      <ref filename='io2.c'/>
470
      <ref filename='testWriter.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
471
      <ref filename='tree2.c'/>
472 473 474 475 476 477 478
    </symbol>
    <symbol name='xmlFindCharEncodingHandler'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlFree'>
      <ref filename='io2.c'/>
      <ref filename='testWriter.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
479
      <ref filename='xpath1.c'/>
480 481
    </symbol>
    <symbol name='xmlFreeDoc'>
482
      <ref filename='io1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
483 484 485 486
      <ref filename='io2.c'/>
      <ref filename='parse1.c'/>
      <ref filename='parse2.c'/>
      <ref filename='parse3.c'/>
487
      <ref filename='parse4.c'/>
488 489
    </symbol>
    <symbol name='xmlFreeParserCtxt'>
490
      <ref filename='parse2.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
491
      <ref filename='parse4.c'/>
492 493
    </symbol>
    <symbol name='xmlFreeTextReader'>
494
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
495
      <ref filename='reader2.c'/>
496
      <ref filename='reader3.c'/>
497
      <ref filename='reader4.c'/>
498 499 500 501 502 503
    </symbol>
    <symbol name='xmlFreeTextWriter'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlInitParser'>
      <ref filename='xpath1.c'/>
504
      <ref filename='xpath2.c'/>
505 506 507 508 509
    </symbol>
    <symbol name='xmlMalloc'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlMemoryDump'>
510
      <ref filename='io1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
511 512 513
      <ref filename='parse1.c'/>
      <ref filename='parse2.c'/>
      <ref filename='parse3.c'/>
514
      <ref filename='parse4.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
515
      <ref filename='reader1.c'/>
516 517 518 519 520
    </symbol>
    <symbol name='xmlNewChild'>
      <ref filename='tree2.c'/>
    </symbol>
    <symbol name='xmlNewDoc'>
521
      <ref filename='io2.c'/>
522
      <ref filename='testWriter.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
523
      <ref filename='tree2.c'/>
524 525 526 527 528
    </symbol>
    <symbol name='xmlNewDocNode'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlNewNode'>
529
      <ref filename='io2.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
530
      <ref filename='tree2.c'/>
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
    </symbol>
    <symbol name='xmlNewParserCtxt'>
      <ref filename='parse2.c'/>
    </symbol>
    <symbol name='xmlNewProp'>
      <ref filename='tree2.c'/>
    </symbol>
    <symbol name='xmlNewText'>
      <ref filename='tree2.c'/>
    </symbol>
    <symbol name='xmlNewTextWriterDoc'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlNewTextWriterFilename'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlNewTextWriterMemory'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlNewTextWriterTree'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlNodePtr'>
      <ref filename='io2.c'/>
      <ref filename='testWriter.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
556
      <ref filename='xpath1.c'/>
557 558 559
    </symbol>
    <symbol name='xmlNodeSetContent'>
      <ref filename='io2.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
560
      <ref filename='xpath2.c'/>
561 562 563 564 565 566 567 568 569
    </symbol>
    <symbol name='xmlNsPtr'>
      <ref filename='xpath1.c'/>
    </symbol>
    <symbol name='xmlParseChunk'>
      <ref filename='parse4.c'/>
    </symbol>
    <symbol name='xmlParseFile'>
      <ref filename='xpath1.c'/>
570
      <ref filename='xpath2.c'/>
571 572
    </symbol>
    <symbol name='xmlParserCtxtPtr'>
573
      <ref filename='parse2.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
574
      <ref filename='parse4.c'/>
575 576
    </symbol>
    <symbol name='xmlReadFile'>
577
      <ref filename='parse1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
578
      <ref filename='tree1.c'/>
579 580 581
    </symbol>
    <symbol name='xmlReadMemory'>
      <ref filename='io1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
582
      <ref filename='parse3.c'/>
583 584
    </symbol>
    <symbol name='xmlReaderForFile'>
585
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
586
      <ref filename='reader2.c'/>
587
      <ref filename='reader3.c'/>
588
      <ref filename='reader4.c'/>
589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611
    </symbol>
    <symbol name='xmlReaderNewFile'>
      <ref filename='reader4.c'/>
    </symbol>
    <symbol name='xmlRealloc'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlRegisterInputCallbacks'>
      <ref filename='io1.c'/>
    </symbol>
    <symbol name='xmlSaveFileEnc'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlSaveFormatFileEnc'>
      <ref filename='tree2.c'/>
    </symbol>
    <symbol name='xmlStrchr'>
      <ref filename='xpath1.c'/>
    </symbol>
    <symbol name='xmlStrdup'>
      <ref filename='xpath1.c'/>
    </symbol>
    <symbol name='xmlStrlen'>
612
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
613
      <ref filename='reader2.c'/>
614 615
    </symbol>
    <symbol name='xmlTextReaderConstName'>
616
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
617
      <ref filename='reader2.c'/>
618 619
    </symbol>
    <symbol name='xmlTextReaderConstValue'>
620
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
621
      <ref filename='reader2.c'/>
622 623 624
    </symbol>
    <symbol name='xmlTextReaderCurrentDoc'>
      <ref filename='reader3.c'/>
625
      <ref filename='reader4.c'/>
626 627
    </symbol>
    <symbol name='xmlTextReaderDepth'>
628
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
629
      <ref filename='reader2.c'/>
630 631
    </symbol>
    <symbol name='xmlTextReaderHasValue'>
632
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
633
      <ref filename='reader2.c'/>
634 635
    </symbol>
    <symbol name='xmlTextReaderIsEmptyElement'>
636
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
637
      <ref filename='reader2.c'/>
638 639 640 641 642
    </symbol>
    <symbol name='xmlTextReaderIsValid'>
      <ref filename='reader2.c'/>
    </symbol>
    <symbol name='xmlTextReaderNodeType'>
643
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
644
      <ref filename='reader2.c'/>
645 646 647 648 649
    </symbol>
    <symbol name='xmlTextReaderPreservePattern'>
      <ref filename='reader3.c'/>
    </symbol>
    <symbol name='xmlTextReaderPtr'>
650
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
651
      <ref filename='reader2.c'/>
652
      <ref filename='reader3.c'/>
653
      <ref filename='reader4.c'/>
654 655
    </symbol>
    <symbol name='xmlTextReaderRead'>
656
      <ref filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
657
      <ref filename='reader2.c'/>
658
      <ref filename='reader3.c'/>
659
      <ref filename='reader4.c'/>
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
    </symbol>
    <symbol name='xmlTextWriterEndDocument'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterEndElement'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterPtr'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterStartDocument'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterStartElement'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterWriteAttribute'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterWriteComment'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterWriteElement'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterWriteFormatComment'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlTextWriterWriteFormatElement'>
      <ref filename='testWriter.c'/>
    </symbol>
    <symbol name='xmlXIncludeProcess'>
      <ref filename='io1.c'/>
    </symbol>
    <symbol name='xmlXPathContextPtr'>
      <ref filename='xpath1.c'/>
696
      <ref filename='xpath2.c'/>
697 698 699
    </symbol>
    <symbol name='xmlXPathEvalExpression'>
      <ref filename='xpath1.c'/>
700
      <ref filename='xpath2.c'/>
701 702 703
    </symbol>
    <symbol name='xmlXPathFreeContext'>
      <ref filename='xpath1.c'/>
704
      <ref filename='xpath2.c'/>
705 706 707
    </symbol>
    <symbol name='xmlXPathFreeObject'>
      <ref filename='xpath1.c'/>
708
      <ref filename='xpath2.c'/>
709 710 711
    </symbol>
    <symbol name='xmlXPathNewContext'>
      <ref filename='xpath1.c'/>
712
      <ref filename='xpath2.c'/>
713 714 715
    </symbol>
    <symbol name='xmlXPathObjectPtr'>
      <ref filename='xpath1.c'/>
716
      <ref filename='xpath2.c'/>
717 718 719 720 721 722 723 724
    </symbol>
    <symbol name='xmlXPathRegisterNs'>
      <ref filename='xpath1.c'/>
    </symbol>
  </symbols>
  <sections>
    <section name='InputOutput'>
      <example filename='io1.c'/>
725
      <example filename='io2.c'/>
726 727
    </section>
    <section name='Parsing'>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
728 729
      <example filename='parse1.c'/>
      <example filename='parse2.c'/>
730 731 732 733 734
      <example filename='parse3.c'/>
      <example filename='parse4.c'/>
    </section>
    <section name='Tree'>
      <example filename='tree1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
735
      <example filename='tree2.c'/>
736 737 738
    </section>
    <section name='XPath'>
      <example filename='xpath1.c'/>
739
      <example filename='xpath2.c'/>
740 741
    </section>
    <section name='xmlReader'>
742
      <example filename='reader1.c'/>
Nick Wellnhofer's avatar
Nick Wellnhofer committed
743
      <example filename='reader2.c'/>
744
      <example filename='reader3.c'/>
745
      <example filename='reader4.c'/>
746 747 748 749 750 751
    </section>
    <section name='xmlWriter'>
      <example filename='testWriter.c'/>
    </section>
  </sections>
</examples>