version 1.1, 2012/02/21 23:37:59
|
version 1.1.1.2, 2014/06/15 19:53:36
|
Line 1
|
Line 1
|
<examples> |
<examples> |
<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='109' file='parser' name='xmlCleanupParser'/> |
|
<function line='38' file='xmlreader' name='xmlTextReaderNodeType'/> |
|
<typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/> |
|
<function line='113' file='xmlmemory' name='xmlMemoryDump'/> |
|
<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'/> |
|
<macro line='104' file='xmlversion' name='LIBXML_TEST_VERSION'/> |
|
<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='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='xpath1.c'> |
<example filename='xpath1.c'> |
<synopsis>Evaluate XPath expression and prints result node set.</synopsis> |
<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> |
<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> |
<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> | <test>xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res</test> |
<author>Aleksey Sanin</author> |
<author>Aleksey Sanin</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>XPath</section> |
<section>XPath</section> |
Line 123
|
Line 58
|
<typedef line='27' file='tree' name='xmlDocPtr'/> |
<typedef line='27' file='tree' name='xmlDocPtr'/> |
</uses> |
</uses> |
</example> |
</example> |
<example filename='io2.c'> | <example filename='reader2.c'> |
<synopsis>Output to char buffer</synopsis> | <synopsis>Parse and validate an XML file with an xmlReader</synopsis> |
<purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose> | <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>io2</usage> | <usage>reader2 <valid_xml_filename></usage> |
<test>io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp</test> | <test>reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res</test> |
<author>John Fleck</author> | <author>Daniel Veillard</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>InputOutput</section> | <section>xmlReader</section> |
<includes> |
<includes> |
<include><libxml/parser.h></include> | <include><libxml/xmlreader.h></include> |
</includes> |
</includes> |
<uses> |
<uses> |
<function line='29' file='tree' name='xmlNodeSetContent'/> | <function line='45' file='xmlstring' name='xmlStrlen'/> |
<function line='36' file='tree' name='xmlDocDumpFormatMemory'/> | <function line='109' file='parser' name='xmlCleanupParser'/> |
<variable line='42' file='globals' name='xmlFree'/> | <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/> |
<function line='30' file='tree' name='xmlDocSetRootElement'/> | <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/> |
<typedef line='20' file='tree' name='xmlDocPtr'/> | <function line='113' file='xmlmemory' name='xmlMemoryDump'/> |
<function line='43' file='tree' name='xmlFreeDoc'/> | <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/> |
<typedef line='19' file='tree' name='xmlNodePtr'/> | <enum line='70' file='parser' name='XML_PARSE_NOENT'/> |
<function line='27' file='tree' name='xmlNewDoc'/> | <function line='37' file='xmlreader' name='xmlTextReaderDepth'/> |
<function line='28' file='tree' name='xmlNewNode'/> | <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'/> |
| <macro line='104' file='xmlversion' name='LIBXML_TEST_VERSION'/> |
| <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> |
</uses> |
</example> |
</example> |
<example filename='tree2.c'> |
<example filename='tree2.c'> |
<synopsis>Creates a tree</synopsis> |
<synopsis>Creates a tree</synopsis> |
<purpose>Shows how to create document, nodes and dump it to stdout or file.</purpose> |
<purpose>Shows how to create document, nodes and dump it to stdout or file.</purpose> |
<usage>tree2 <filename> -Default output: stdout</usage> |
<usage>tree2 <filename> -Default output: stdout</usage> |
<test>tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp</test> | <test>tree2 > tree2.tmp && diff tree2.tmp $(srcdir)/tree2.res</test> |
<author>Lucas Brasilino <brasilino@recife.pe.gov.br></author> |
<author>Lucas Brasilino <brasilino@recife.pe.gov.br></author> |
<copy>see Copyright for the status of this software </copy> |
<copy>see Copyright for the status of this software </copy> |
<section>Tree</section> |
<section>Tree</section> |
Line 174
|
Line 118
|
<function line='39' file='tree' name='xmlNewDoc'/> |
<function line='39' file='tree' name='xmlNewDoc'/> |
</uses> |
</uses> |
</example> |
</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 $(srcdir)/io1.res</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='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='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> |
|
<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 $(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><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='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'/> |
|
<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='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 $(srcdir)/io2.res</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='20' file='tree' name='xmlDocPtr'/> |
|
<typedef line='19' file='tree' name='xmlNodePtr'/> |
|
<function line='27' file='tree' name='xmlNewDoc'/> |
|
<function line='28' file='tree' name='xmlNewNode'/> |
|
</uses> |
|
</example> |
<example filename='reader1.c'> |
<example filename='reader1.c'> |
<synopsis>Parse an XML file with an xmlReader</synopsis> |
<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> |
<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> |
<usage>reader1 <filename></usage> |
<test>reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test> | <test>reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res</test> |
<author>Daniel Veillard</author> |
<author>Daniel Veillard</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>xmlReader</section> |
<section>xmlReader</section> |
Line 187
|
Line 233
|
</includes> |
</includes> |
<uses> |
<uses> |
<function line='44' file='xmlstring' name='xmlStrlen'/> |
<function line='44' file='xmlstring' name='xmlStrlen'/> |
<function line='94' file='parser' name='xmlCleanupParser'/> |
|
<function line='37' file='xmlreader' name='xmlTextReaderNodeType'/> |
<function line='37' file='xmlreader' name='xmlTextReaderNodeType'/> |
<typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/> |
<typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/> |
<function line='98' file='xmlmemory' name='xmlMemoryDump'/> |
|
<function line='33' file='xmlreader' name='xmlTextReaderConstValue'/> |
<function line='33' file='xmlreader' name='xmlTextReaderConstValue'/> |
<function line='36' file='xmlreader' name='xmlTextReaderDepth'/> |
<function line='36' file='xmlreader' name='xmlTextReaderDepth'/> |
<function line='69' file='xmlreader' name='xmlFreeTextReader'/> |
<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='29' file='xmlreader' name='xmlTextReaderConstName'/> |
<function line='40' file='xmlreader' name='xmlTextReaderHasValue'/> |
<function line='40' file='xmlreader' name='xmlTextReaderHasValue'/> |
<function line='67' file='xmlreader' name='xmlTextReaderRead'/> |
<function line='67' file='xmlreader' name='xmlTextReaderRead'/> |
Line 202
|
Line 245
|
<function line='62' file='xmlreader' name='xmlReaderForFile'/> |
<function line='62' file='xmlreader' name='xmlReaderForFile'/> |
</uses> |
</uses> |
</example> |
</example> |
<example filename='testWriter.c'> | <example filename='tree1.c'> |
<synopsis>use various APIs for the xmlWriter</synopsis> | <synopsis>Navigates a tree to print element names</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> | <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>testWriter</usage> | <usage>tree1 filename_or_URL</usage> |
<test>testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res</test> | <test>tree1 test2.xml > tree1.tmp && diff tree1.tmp $(srcdir)/tree1.res</test> |
<author>Alfred Mickautsch</author> | <author>Dodji Seketeli</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>xmlWriter</section> | <section>Tree</section> |
<includes> |
<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'/> |
|
<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'/> |
|
<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'/> |
|
<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='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/tree.h></include> |
<include><libxml/parser.h></include> |
<include><libxml/parser.h></include> |
</includes> |
</includes> |
<uses> |
<uses> |
<function line='94' file='parser' name='xmlFreeParserCtxt'/> | <enum line='36' file='tree' name='XML_ELEMENT_NODE'/> |
<function line='86' file='parser' name='xmlParseChunk'/> | <function line='74' file='tree' name='xmlDocGetRootElement'/> |
<function line='67' file='parser' name='xmlCreatePushParserCtxt'/> | <function line='67' file='parser' name='xmlReadFile'/> |
<typedef line='45' file='tree' name='xmlParserCtxtPtr'/> | |
<typedef line='47' file='tree' name='xmlDocPtr'/> | |
</uses> |
</uses> |
</example> |
</example> |
<example filename='reader3.c'> |
<example filename='reader3.c'> |
<synopsis>Show how to extract subdocuments with xmlReader</synopsis> |
<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> |
<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> |
<usage>reader3</usage> |
<test>reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp</test> | <test>reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res</test> |
<author>Daniel Veillard</author> |
<author>Daniel Veillard</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>xmlReader</section> |
<section>xmlReader</section> |
Line 289
|
Line 284
|
<function line='38' file='xmlreader' name='xmlReaderForFile'/> |
<function line='38' file='xmlreader' name='xmlReaderForFile'/> |
</uses> |
</uses> |
</example> |
</example> |
<example filename='io1.c'> | <example filename='parse2.c'> |
<synopsis>Example of custom Input/Output</synopsis> | <synopsis>Parse and validate an XML file to a tree and free the result</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> | <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>io1</usage> | <usage>parse2 test2.xml</usage> |
<test>io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp</test> | <test>parse2 test2.xml</test> |
<author>Daniel Veillard</author> |
<author>Daniel Veillard</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>InputOutput</section> | <section>Parsing</section> |
<includes> |
<includes> |
<include><libxml/parser.h></include> |
|
<include><libxml/xmlIO.h></include> |
|
<include><libxml/xinclude.h></include> |
|
<include><libxml/tree.h></include> |
<include><libxml/tree.h></include> |
|
<include><libxml/parser.h></include> |
</includes> |
</includes> |
<uses> |
<uses> |
<function line='143' file='tree' name='xmlDocDump'/> | <function line='47' file='parser' name='xmlFreeParserCtxt'/> |
<function line='134' file='xinclude' name='xmlXIncludeProcess'/> | <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/> |
<function line='117' file='xmlIO' name='xmlRegisterInputCallbacks'/> | <function line='29' file='parser' name='xmlNewParserCtxt'/> |
<function line='124' file='parser' name='xmlReadMemory'/> | <typedef line='25' file='tree' name='xmlParserCtxtPtr'/> |
| <function line='35' file='parser' name='xmlCtxtReadFile'/> |
</uses> |
</uses> |
</example> |
</example> |
<example filename='parse1.c'> |
<example filename='parse1.c'> |
Line 326
|
Line 320
|
<function line='26' file='parser' name='xmlReadFile'/> |
<function line='26' file='parser' name='xmlReadFile'/> |
</uses> |
</uses> |
</example> |
</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='67' file='parser' name='xmlReadFile'/> |
|
</uses> |
|
</example> |
|
<example filename='reader4.c'> |
<example filename='reader4.c'> |
<synopsis>Parse multiple XML files reusing an xmlReader</synopsis> |
<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> |
<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> |
<usage>reader4 <filename> [ filename ... ]</usage> |
<test>reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp</test> | <test>reader4 test1.xml test2.xml test3.xml > reader4.tmp && diff reader4.tmp $(srcdir)/reader4.res</test> |
<author>Graham Bennett</author> |
<author>Graham Bennett</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>xmlReader</section> |
<section>xmlReader</section> |
Line 364
|
Line 340
|
<function line='72' file='xmlreader' name='xmlReaderForFile'/> |
<function line='72' file='xmlreader' name='xmlReaderForFile'/> |
</uses> |
</uses> |
</example> |
</example> |
<example filename='parse2.c'> | <example filename='testWriter.c'> |
<synopsis>Parse and validate an XML file to a tree and free the result</synopsis> | <synopsis>use various APIs for the xmlWriter</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> | <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>parse2 test2.xml</usage> | <usage>testWriter</usage> |
<test>parse2 test2.xml</test> | <test>testWriter && for i in 1 2 3 4 ; do diff $(srcdir)/writer.xml writer$$i.tmp || break ; done</test> |
<author>Daniel Veillard</author> | <author>Alfred Mickautsch</author> |
<copy>see Copyright for the status of this software. </copy> |
<copy>see Copyright for the status of this software. </copy> |
<section>Parsing</section> | <section>xmlWriter</section> |
<includes> |
<includes> |
<include><libxml/tree.h></include> | <include><libxml/encoding.h></include> |
<include><libxml/parser.h></include> | <include><libxml/xmlwriter.h></include> |
</includes> |
</includes> |
<uses> |
<uses> |
<function line='47' file='parser' name='xmlFreeParserCtxt'/> | <function line='913' file='xmlwriter' name='xmlTextWriterStartDocument'/> |
<enum line='35' file='parser' name='XML_PARSE_DTDVALID'/> | <function line='1121' file='xmlwriter' name='xmlTextWriterEndDocument'/> |
<function line='29' file='parser' name='xmlNewParserCtxt'/> | <variable line='1183' file='globals' name='xmlRealloc'/> |
<typedef line='25' file='tree' name='xmlParserCtxtPtr'/> | <function line='925' file='xmlwriter' name='xmlTextWriterWriteComment'/> |
<function line='35' file='parser' name='xmlCtxtReadFile'/> | <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'/> |
</uses> |
</uses> |
</example> |
</example> |
<symbols> |
<symbols> |
<symbol name='LIBXML_TEST_VERSION'> |
<symbol name='LIBXML_TEST_VERSION'> |
<ref filename='reader2.c'/> |
|
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
<ref filename='parse3.c'/> |
<ref filename='parse3.c'/> |
|
<ref filename='reader2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='reader1.c'/> | <ref filename='io1.c'/> |
| <ref filename='parse4.c'/> |
</symbol> |
</symbol> |
<symbol name='XML_DEFAULT_VERSION'> |
<symbol name='XML_DEFAULT_VERSION'> |
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
Line 401
|
Line 401
|
<ref filename='tree1.c'/> |
<ref filename='tree1.c'/> |
</symbol> |
</symbol> |
<symbol name='XML_NAMESPACE_DECL'> |
<symbol name='XML_NAMESPACE_DECL'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='XML_PARSE_DTDATTR'> |
<symbol name='XML_PARSE_DTDATTR'> |
<ref filename='reader2.c'/> |
<ref filename='reader2.c'/> |
Line 430
|
Line 430
|
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlCleanupParser'> |
<symbol name='xmlCleanupParser'> |
<ref filename='reader2.c'/> |
|
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
<ref filename='parse3.c'/> |
<ref filename='parse3.c'/> |
|
<ref filename='reader2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='reader1.c'/> | <ref filename='io1.c'/> |
| <ref filename='parse4.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlCreateIntSubset'> |
<symbol name='xmlCreateIntSubset'> |
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
Line 447
|
Line 447
|
<ref filename='parse2.c'/> |
<ref filename='parse2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlDocDump'> |
<symbol name='xmlDocDump'> |
|
<ref filename='io1.c'/> |
<ref filename='xpath2.c'/> |
<ref filename='xpath2.c'/> |
<ref filename='reader3.c'/> |
<ref filename='reader3.c'/> |
<ref filename='io1.c'/> |
|
</symbol> |
</symbol> |
<symbol name='xmlDocDumpFormatMemory'> |
<symbol name='xmlDocDumpFormatMemory'> |
<ref filename='io2.c'/> |
<ref filename='io2.c'/> |
Line 458
|
Line 458
|
<ref filename='tree1.c'/> |
<ref filename='tree1.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlDocPtr'> |
<symbol name='xmlDocPtr'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
<ref filename='parse3.c'/> |
<ref filename='parse3.c'/> |
<ref filename='io2.c'/> | <ref filename='io1.c'/> |
<ref filename='testWriter.c'/> | |
<ref filename='parse4.c'/> |
<ref filename='parse4.c'/> |
|
<ref filename='xpath2.c'/> |
|
<ref filename='io2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlDocSetRootElement'> |
<symbol name='xmlDocSetRootElement'> |
<ref filename='io2.c'/> |
|
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
|
<ref filename='io2.c'/> |
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlFindCharEncodingHandler'> |
<symbol name='xmlFindCharEncodingHandler'> |
Line 479
|
Line 479
|
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlFreeDoc'> |
<symbol name='xmlFreeDoc'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
<ref filename='parse3.c'/> |
<ref filename='parse3.c'/> |
<ref filename='io2.c'/> |
|
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='testWriter.c'/> | <ref filename='io1.c'/> |
| <ref filename='parse4.c'/> |
| <ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlFreeParserCtxt'> |
<symbol name='xmlFreeParserCtxt'> |
<ref filename='parse4.c'/> |
<ref filename='parse4.c'/> |
Line 500
|
Line 500
|
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlInitParser'> |
<symbol name='xmlInitParser'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlMalloc'> |
<symbol name='xmlMalloc'> |
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlMemoryDump'> |
<symbol name='xmlMemoryDump'> |
<ref filename='reader2.c'/> |
|
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
<ref filename='parse3.c'/> |
<ref filename='parse3.c'/> |
|
<ref filename='reader2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
<ref filename='reader1.c'/> | <ref filename='io1.c'/> |
| <ref filename='parse4.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlNewChild'> |
<symbol name='xmlNewChild'> |
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlNewDoc'> |
<symbol name='xmlNewDoc'> |
<ref filename='io2.c'/> |
|
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
|
<ref filename='io2.c'/> |
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlNewDocNode'> |
<symbol name='xmlNewDocNode'> |
<ref filename='testWriter.c'/> |
<ref filename='testWriter.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlNewNode'> |
<symbol name='xmlNewNode'> |
<ref filename='io2.c'/> |
|
<ref filename='tree2.c'/> |
<ref filename='tree2.c'/> |
|
<ref filename='io2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlNewParserCtxt'> |
<symbol name='xmlNewParserCtxt'> |
<ref filename='parse2.c'/> |
<ref filename='parse2.c'/> |
Line 566
|
Line 566
|
<ref filename='parse4.c'/> |
<ref filename='parse4.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlParseFile'> |
<symbol name='xmlParseFile'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlParserCtxtPtr'> |
<symbol name='xmlParserCtxtPtr'> |
<ref filename='parse4.c'/> |
<ref filename='parse4.c'/> |
<ref filename='parse2.c'/> |
<ref filename='parse2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlReadFile'> |
<symbol name='xmlReadFile'> |
<ref filename='parse1.c'/> |
|
<ref filename='tree1.c'/> |
<ref filename='tree1.c'/> |
|
<ref filename='parse1.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlReadMemory'> |
<symbol name='xmlReadMemory'> |
<ref filename='parse3.c'/> |
<ref filename='parse3.c'/> |
Line 692
|
Line 692
|
<ref filename='io1.c'/> |
<ref filename='io1.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathContextPtr'> |
<symbol name='xmlXPathContextPtr'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathEvalExpression'> |
<symbol name='xmlXPathEvalExpression'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathFreeContext'> |
<symbol name='xmlXPathFreeContext'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathFreeObject'> |
<symbol name='xmlXPathFreeObject'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathNewContext'> |
<symbol name='xmlXPathNewContext'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathObjectPtr'> |
<symbol name='xmlXPathObjectPtr'> |
<ref filename='xpath2.c'/> |
|
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
|
<ref filename='xpath2.c'/> |
</symbol> |
</symbol> |
<symbol name='xmlXPathRegisterNs'> |
<symbol name='xmlXPathRegisterNs'> |
<ref filename='xpath1.c'/> |
<ref filename='xpath1.c'/> |
Line 721
|
Line 721
|
</symbols> |
</symbols> |
<sections> |
<sections> |
<section name='InputOutput'> |
<section name='InputOutput'> |
<example filename='io2.c'/> |
|
<example filename='io1.c'/> |
<example filename='io1.c'/> |
|
<example filename='io2.c'/> |
</section> |
</section> |
<section name='Parsing'> |
<section name='Parsing'> |
<example filename='parse3.c'/> |
<example filename='parse3.c'/> |
<example filename='parse4.c'/> |
<example filename='parse4.c'/> |
<example filename='parse1.c'/> |
|
<example filename='parse2.c'/> |
<example filename='parse2.c'/> |
|
<example filename='parse1.c'/> |
</section> |
</section> |
<section name='Tree'> |
<section name='Tree'> |
<example filename='tree2.c'/> |
<example filename='tree2.c'/> |
<example filename='tree1.c'/> |
<example filename='tree1.c'/> |
</section> |
</section> |
<section name='XPath'> |
<section name='XPath'> |
<example filename='xpath2.c'/> |
|
<example filename='xpath1.c'/> |
<example filename='xpath1.c'/> |
|
<example filename='xpath2.c'/> |
</section> |
</section> |
<section name='xmlReader'> |
<section name='xmlReader'> |
<example filename='reader2.c'/> |
<example filename='reader2.c'/> |