The examples are stored per section depending on the main focus
of the example: Parsing Examplesparse1.c: Parse an XML file to a tree and free itDemonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree Includes: Uses: Usage: parse1 test1.xml Author: Daniel Veillard parse2.c: Parse and validate an XML file to a tree and free the resultCreate 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. Includes: Uses: Usage: parse2 test2.xml Author: Daniel Veillard Tree Examplestree1.c: Navigates a tree to print element namesParse 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. Includes: Uses: Usage: tree1 filename_or_URL Author: Dodji Seketeli tree2.c: Creates a treeShows how to create document, nodes and dump it to stdout or file. Includes: Uses: Usage: tree2 <filename> -Default output: stdout Author: Lucas Brasilino <brasilino@recife.pe.gov.br> XPath Examplesxpath1.c: Evaluate XPath expression and prints result node set.Shows how to evaluate XPath expression and register known namespaces in XPath context. Includes: Uses: Usage: xpath1 <xml-file> <xpath-expr> [<known-ns-list>] Author: Aleksey Sanin xmlReader Examplesreader1.c: Parse an XML file with an xmlReaderDemonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process Includes: Uses: Usage: reader1 <filename> Author: Daniel Veillard reader2.c: Parse and validate an XML file with an xmlReaderDemonstrate 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 Includes: Uses: Usage: reader2 <valid_xml_filename> Author: Daniel Veillard reader3.c: Show how to extract subdocuments with xmlReaderDemonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document Includes: Uses: Usage: reader3 Author: Daniel Veillard xmlWriter ExamplestestWriter.c: use various APIs for the xmlWritertests 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. Includes: Uses: Usage: testWriter Author: Alfred Mickautsch Daniel Veillard |