Hash :
aa2404e9
Author :
Date :
2008-01-11T06:44:00
apply patch from Fred Crozat to avoid outputting -L/usr/lib from * xml2-config.in: apply patch from Fred Crozat to avoid outputting -L/usr/lib from xml2-config, fixes #497012 Daniel svn path=/trunk/; revision=3672
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 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 282 283 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
<examples>
<example filename='parse1.c'>
<synopsis>Parse an XML file to a tree and free it</synopsis>
<purpose>Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
<usage>parse1 test1.xml</usage>
<test>parse1 test1.xml</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>Parsing</section>
<includes>
<include><libxml/tree.h></include>
<include><libxml/parser.h></include>
</includes>
<uses>
<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'/>
</uses>
</example>
<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 <filename></usage>
<test>reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>xmlReader</section>
<includes>
<include><libxml/xmlreader.h></include>
</includes>
<uses>
<function line='44' file='xmlstring' name='xmlStrlen'/>
<function line='94' file='parser' name='xmlCleanupParser'/>
<function line='37' file='xmlreader' name='xmlTextReaderNodeType'/>
<typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/>
<function line='98' file='xmlmemory' name='xmlMemoryDump'/>
<function line='33' file='xmlreader' name='xmlTextReaderConstValue'/>
<function line='36' file='xmlreader' name='xmlTextReaderDepth'/>
<function line='69' file='xmlreader' name='xmlFreeTextReader'/>
<macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<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'/>
</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 <xml-file> <xpath-expr> <new-value></usage>
<test>xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp</test>
<author>Aleksey Sanin and Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>XPath</section>
<includes>
<include><libxml/parser.h></include>
<include><libxml/xpath.h></include>
<include><libxml/xpathInternals.h></include>
<include><libxml/tree.h></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='56' file='xmlmemory' name='xmlMemoryDump'/>
<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'/>
<function line='51' file='parser' name='xmlCleanupParser'/>
<macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
<function line='124' file='xpath' name='xmlXPathFreeContext'/>
<function line='41' file='parser' name='xmlInitParser'/>
<function line='131' file='tree' name='xmlFreeDoc'/>
<enum line='180' file='tree' name='XML_NAMESPACE_DECL'/>
<typedef line='86' file='tree' name='xmlDocPtr'/>
</uses>
</example>
<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 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>InputOutput</section>
<includes>
<include><libxml/parser.h></include>
<include><libxml/xmlIO.h></include>
<include><libxml/xinclude.h></include>
<include><libxml/tree.h></include>
</includes>
<uses>
<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'/>
</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>
<test>reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>xmlReader</section>
<includes>
<include><libxml/xmlreader.h></include>
</includes>
<uses>
<function line='106' file='parser' name='xmlCleanupParser'/>
<typedef line='31' file='xmlreader' name='xmlTextReaderPtr'/>
<function line='110' file='xmlmemory' name='xmlMemoryDump'/>
<function line='99' file='tree' name='xmlFreeDoc'/>
<function line='65' file='xmlreader' name='xmlFreeTextReader'/>
<macro line='90' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<function line='95' file='tree' name='xmlDocDump'/>
<function line='51' file='xmlreader' name='xmlTextReaderRead'/>
<function line='61' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
<function line='42' file='xmlreader' name='xmlTextReaderPreservePattern'/>
<function line='37' file='xmlreader' name='xmlReaderForFile'/>
<typedef line='76' file='tree' name='xmlDocPtr'/>
</uses>
</example>
<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>
<test>testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res</test>
<author>Alfred Mickautsch</author>
<copy>see Copyright for the status of this software. </copy>
<section>xmlWriter</section>
<includes>
<include><libxml/encoding.h></include>
<include><libxml/xmlwriter.h></include>
</includes>
<uses>
<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='879' file='tree' name='xmlDocPtr'/>
<typedef line='341' file='tree' name='xmlBufferPtr'/>
<function line='58' file='xmlmemory' name='xmlMemoryDump'/>
<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='54' file='parser' name='xmlCleanupParser'/>
<function line='1073' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/>
<typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/>
<function line='1131' file='tree' name='xmlFreeDoc'/>
<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'/>
<macro line='40' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<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'/>
</uses>
</example>
<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 > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp</test>
<author>Dodji Seketeli</author>
<copy>see Copyright for the status of this software. </copy>
<section>Tree</section>
<includes>
<include><libxml/tree.h></include>
<include><libxml/parser.h></include>
</includes>
<uses>
<enum line='36' file='tree' name='XML_ELEMENT_NODE'/>
<function line='74' file='tree' name='xmlDocGetRootElement'/>
<function line='79' file='tree' name='xmlFreeDoc'/>
<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 <filename> -Default output: stdout</usage>
<test>tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp</test>
<author>Lucas Brasilino <brasilino@recife.pe.gov.br></author>
<copy>see Copyright for the status of this software </copy>
<section>Tree</section>
<includes>
<include><libxml/tree.h></include>
<include><libxml/parser.h></include>
</includes>
<uses>
<function line='75' file='tree' name='xmlNewText'/>
<function line='96' file='tree' name='xmlSaveFormatFileEnc'/>
<function line='78' file='tree' name='xmlAddChild'/>
<function line='41' file='tree' name='xmlDocSetRootElement'/>
<function line='89' file='tree' name='xmlNewProp'/>
<function line='88' file='tree' name='xmlNewChild'/>
<function line='74' file='tree' name='xmlNewNode'/>
<function line='46' file='tree' name='xmlCreateIntSubset'/>
<function line='39' file='tree' name='xmlNewDoc'/>
</uses>
</example>
<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>
<includes>
<include><libxml/tree.h></include>
<include><libxml/parser.h></include>
</includes>
<uses>
<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'/>
<typedef line='26' file='tree' name='xmlDocPtr'/>
</uses>
</example>
<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 <valid_xml_filename></usage>
<test>reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>xmlReader</section>
<includes>
<include><libxml/xmlreader.h></include>
</includes>
<uses>
<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'/>
</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 <filename> [ filename ... ]</usage>
<test>reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp</test>
<author>Graham Bennett</author>
<copy>see Copyright for the status of this software. </copy>
<section>xmlReader</section>
<includes>
<include><libxml/xmlreader.h></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>
<example filename='parse4.c'>
<synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis>
<purpose>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
<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><libxml/tree.h></include>
<include><libxml/parser.h></include>
</includes>
<uses>
<function line='94' file='parser' name='xmlFreeParserCtxt'/>
<function line='86' file='parser' name='xmlParseChunk'/>
<function line='67' file='parser' name='xmlCreatePushParserCtxt'/>
<typedef line='45' file='tree' name='xmlParserCtxtPtr'/>
</uses>
</example>
<example filename='parse3.c'>
<synopsis>Parse an XML document in memory to a tree and free it</synopsis>
<purpose>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
<usage>parse3</usage>
<test>parse3</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
<section>Parsing</section>
<includes>
<include><libxml/tree.h></include>
<include><libxml/parser.h></include>
</includes>
<uses>
<function line='33' file='parser' name='xmlReadMemory'/>
</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 <xml-file> <xpath-expr> [<known-ns-list>]</usage>
<test>./xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp</test>
<author>Aleksey Sanin</author>
<copy>see Copyright for the status of this software. </copy>
<section>XPath</section>
<includes>
<include><libxml/parser.h></include>
<include><libxml/xpath.h></include>
<include><libxml/xpathInternals.h></include>
<include><libxml/tree.h></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='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 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp</test>
<author>John Fleck</author>
<copy>see Copyright for the status of this software. </copy>
<section>InputOutput</section>
<includes>
<include><libxml/parser.h></include>
</includes>
<uses>
<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='19' file='tree' name='xmlNodePtr'/>
<function line='27' file='tree' name='xmlNewDoc'/>
<function line='28' file='tree' name='xmlNewNode'/>
</uses>
</example>