Hash :
d9d63d6e
Author :
Date :
2003-11-13T11:45:43
added Dodji's example, added output handling Daniel * doc/examples/*: added Dodji's example, added output handling Daniel
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
<examples>
<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>
<author>Aleksey Sanin</author>
<copy>see Copyright for the status of this software. </copy>
<section>XPath</section>
<includes>
<include><libxml/xpath.h></include>
<include><libxml/parser.h></include>
<include><libxml/xpathInternals.h></include>
<include><libxml/tree.h></include>
</includes>
<uses>
<typedef line='80' file='xpath' name='xmlXPathObjectPtr'/>
<enum line='221' file='tree' name='XML_ELEMENT_NODE'/>
<function line='109' file='xpath' name='xmlXPathEvalExpression'/>
<function line='178' file='xpathInternals' name='xmlXPathRegisterNs'/>
<function line='121' file='xpath' name='xmlXPathFreeObject'/>
<typedef line='78' file='tree' name='xmlDocPtr'/>
<typedef line='210' file='tree' name='xmlNsPtr'/>
<function line='93' file='xpath' name='xmlXPathNewContext'/>
<function line='45' file='parser' name='xmlCleanupParser'/>
<macro line='39' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<typedef line='79' file='xpath' name='xmlXPathContextPtr'/>
<function line='122' file='xpath' name='xmlXPathFreeContext'/>
<function line='35' file='parser' name='xmlInitParser'/>
<function line='148' file='parser' name='xmlStrdup'/>
<function line='123' file='tree' name='xmlFreeDoc'/>
<function line='172' file='parser' name='xmlStrchr'/>
<typedef line='198' file='tree' name='xmlNodePtr'/>
<function line='86' file='parser' name='xmlParseFile'/>
<enum line='209' file='tree' name='XML_NAMESPACE_DECL'/>
</uses>
</example>
<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='50' file='parser' name='xmlCleanupParser'/>
<macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<function line='31' file='tree' name='xmlFreeDoc'/>
<function line='26' file='parser' name='xmlReadFile'/>
<typedef line='24' file='tree' name='xmlDocPtr'/>
</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'/>
<macro line='61' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<enum line='35' file='parser' name='XML_PARSE_DTDVALID'/>
<function line='29' file='parser' name='xmlNewParserCtxt'/>
<function line='66' file='parser' name='xmlCleanupParser'/>
<typedef line='25' file='tree' name='xmlParserCtxtPtr'/>
<function line='35' file='parser' name='xmlCtxtReadFile'/>
<function line='44' file='tree' name='xmlFreeDoc'/>
<typedef line='26' file='tree' name='xmlDocPtr'/>
</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.out ; 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>
<function line='83' file='parser' name='xmlCleanupParser'/>
<macro line='65' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<enum line='34' file='tree' name='XML_ELEMENT_NODE'/>
<function line='77' file='tree' name='xmlFreeDoc'/>
<function line='65' file='parser' name='xmlParseFile'/>
<function line='72' file='tree' name='xmlDocGetRootElement'/>
</uses>
</example>
<symbols>
<symbol name='LIBXML_TEST_VERSION'>
<ref filename='xpath1.c'/>
<ref filename='parse1.c'/>
<ref filename='parse2.c'/>
<ref filename='tree1.c'/>
</symbol>
<symbol name='XML_ELEMENT_NODE'>
<ref filename='xpath1.c'/>
<ref filename='tree1.c'/>
</symbol>
<symbol name='XML_NAMESPACE_DECL'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='XML_PARSE_DTDVALID'>
<ref filename='parse2.c'/>
</symbol>
<symbol name='xmlCleanupParser'>
<ref filename='xpath1.c'/>
<ref filename='parse1.c'/>
<ref filename='parse2.c'/>
<ref filename='tree1.c'/>
</symbol>
<symbol name='xmlCtxtReadFile'>
<ref filename='parse2.c'/>
</symbol>
<symbol name='xmlDocGetRootElement'>
<ref filename='tree1.c'/>
</symbol>
<symbol name='xmlDocPtr'>
<ref filename='xpath1.c'/>
<ref filename='parse1.c'/>
<ref filename='parse2.c'/>
</symbol>
<symbol name='xmlFreeDoc'>
<ref filename='xpath1.c'/>
<ref filename='parse1.c'/>
<ref filename='parse2.c'/>
<ref filename='tree1.c'/>
</symbol>
<symbol name='xmlFreeParserCtxt'>
<ref filename='parse2.c'/>
</symbol>
<symbol name='xmlInitParser'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlNewParserCtxt'>
<ref filename='parse2.c'/>
</symbol>
<symbol name='xmlNodePtr'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlNsPtr'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlParseFile'>
<ref filename='xpath1.c'/>
<ref filename='tree1.c'/>
</symbol>
<symbol name='xmlParserCtxtPtr'>
<ref filename='parse2.c'/>
</symbol>
<symbol name='xmlReadFile'>
<ref filename='parse1.c'/>
</symbol>
<symbol name='xmlStrchr'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlStrdup'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathContextPtr'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathEvalExpression'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathFreeContext'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathFreeObject'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathNewContext'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathObjectPtr'>
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlXPathRegisterNs'>
<ref filename='xpath1.c'/>
</symbol>
</symbols>
<sections>
<section name='Parsing'>
<example filename='parse1.c'/>
<example filename='parse2.c'/>
</section>
<section name='Tree'>
<example filename='tree1.c'/>
</section>
<section name='XPath'>
<example filename='xpath1.c'/>
</section>
</sections>
</examples>