1 | <examples>
|
---|
2 | <example filename='parse1.c'>
|
---|
3 | <synopsis>Parse an XML file to a tree and free it</synopsis>
|
---|
4 | <purpose>Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
|
---|
5 | <usage>parse1 test1.xml</usage>
|
---|
6 | <test>parse1 test1.xml</test>
|
---|
7 | <author>Daniel Veillard</author>
|
---|
8 | <copy>see Copyright for the status of this software. </copy>
|
---|
9 | <section>Parsing</section>
|
---|
10 | <includes>
|
---|
11 | <include><libxml/tree.h></include>
|
---|
12 | <include><libxml/parser.h></include>
|
---|
13 | </includes>
|
---|
14 | <uses>
|
---|
15 | <function line='54' file='xmlmemory' name='xmlMemoryDump'/>
|
---|
16 | <function line='50' file='parser' name='xmlCleanupParser'/>
|
---|
17 | <macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/>
|
---|
18 | <typedef line='24' file='tree' name='xmlDocPtr'/>
|
---|
19 | <function line='31' file='tree' name='xmlFreeDoc'/>
|
---|
20 | <function line='26' file='parser' name='xmlReadFile'/>
|
---|
21 | </uses>
|
---|
22 | </example>
|
---|
23 | <example filename='reader1.c'>
|
---|
24 | <synopsis>Parse an XML file with an xmlReader</synopsis>
|
---|
25 | <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>
|
---|
26 | <usage>reader1 <filename></usage>
|
---|
27 | <test>reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
|
---|
28 | <author>Daniel Veillard</author>
|
---|
29 | <copy>see Copyright for the status of this software. </copy>
|
---|
30 | <section>xmlReader</section>
|
---|
31 | <includes>
|
---|
32 | <include><libxml/xmlreader.h></include>
|
---|
33 | </includes>
|
---|
34 | <uses>
|
---|
35 | <function line='44' file='xmlstring' name='xmlStrlen'/>
|
---|
36 | <function line='94' file='parser' name='xmlCleanupParser'/>
|
---|
37 | <function line='37' file='xmlreader' name='xmlTextReaderNodeType'/>
|
---|
38 | <typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/>
|
---|
39 | <function line='98' file='xmlmemory' name='xmlMemoryDump'/>
|
---|
40 | <function line='33' file='xmlreader' name='xmlTextReaderConstValue'/>
|
---|
41 | <function line='36' file='xmlreader' name='xmlTextReaderDepth'/>
|
---|
42 | <function line='69' file='xmlreader' name='xmlFreeTextReader'/>
|
---|
43 | <macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/>
|
---|
44 | <function line='29' file='xmlreader' name='xmlTextReaderConstName'/>
|
---|
45 | <function line='40' file='xmlreader' name='xmlTextReaderHasValue'/>
|
---|
46 | <function line='67' file='xmlreader' name='xmlTextReaderRead'/>
|
---|
47 | <function line='39' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
|
---|
48 | <function line='62' file='xmlreader' name='xmlReaderForFile'/>
|
---|
49 | </uses>
|
---|
50 | </example>
|
---|
51 | <example filename='xpath2.c'>
|
---|
52 | <synopsis>Load a document, locate subelements with XPath, modify said elements and save the resulting document.</synopsis>
|
---|
53 | <purpose>Shows how to make a full round-trip from a load/edit/save</purpose>
|
---|
54 | <usage>xpath2 <xml-file> <xpath-expr> <new-value></usage>
|
---|
55 | <test>xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp</test>
|
---|
56 | <author>Aleksey Sanin and Daniel Veillard</author>
|
---|
57 | <copy>see Copyright for the status of this software. </copy>
|
---|
58 | <section>XPath</section>
|
---|
59 | <includes>
|
---|
60 | <include><libxml/parser.h></include>
|
---|
61 | <include><libxml/xpath.h></include>
|
---|
62 | <include><libxml/xpathInternals.h></include>
|
---|
63 | <include><libxml/tree.h></include>
|
---|
64 | </includes>
|
---|
65 | <uses>
|
---|
66 | <function line='162' file='tree' name='xmlNodeSetContent'/>
|
---|
67 | <function line='127' file='tree' name='xmlDocDump'/>
|
---|
68 | <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
|
---|
69 | <function line='56' file='xmlmemory' name='xmlMemoryDump'/>
|
---|
70 | <function line='110' file='xpath' name='xmlXPathEvalExpression'/>
|
---|
71 | <function line='95' file='parser' name='xmlParseFile'/>
|
---|
72 | <function line='123' file='xpath' name='xmlXPathFreeObject'/>
|
---|
73 | <function line='102' file='xpath' name='xmlXPathNewContext'/>
|
---|
74 | <function line='51' file='parser' name='xmlCleanupParser'/>
|
---|
75 | <macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/>
|
---|
76 | <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
|
---|
77 | <function line='124' file='xpath' name='xmlXPathFreeContext'/>
|
---|
78 | <function line='41' file='parser' name='xmlInitParser'/>
|
---|
79 | <function line='131' file='tree' name='xmlFreeDoc'/>
|
---|
80 | <enum line='180' file='tree' name='XML_NAMESPACE_DECL'/>
|
---|
81 | <typedef line='86' file='tree' name='xmlDocPtr'/>
|
---|
82 | </uses>
|
---|
83 | </example>
|
---|
84 | <example filename='io1.c'>
|
---|
85 | <synopsis>Example of custom Input/Output</synopsis>
|
---|
86 | <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>
|
---|
87 | <usage>io1</usage>
|
---|
88 | <test>io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp</test>
|
---|
89 | <author>Daniel Veillard</author>
|
---|
90 | <copy>see Copyright for the status of this software. </copy>
|
---|
91 | <section>InputOutput</section>
|
---|
92 | <includes>
|
---|
93 | <include><libxml/parser.h></include>
|
---|
94 | <include><libxml/xmlIO.h></include>
|
---|
95 | <include><libxml/xinclude.h></include>
|
---|
96 | <include><libxml/tree.h></include>
|
---|
97 | </includes>
|
---|
98 | <uses>
|
---|
99 | <function line='143' file='tree' name='xmlDocDump'/>
|
---|
100 | <function line='158' file='xmlmemory' name='xmlMemoryDump'/>
|
---|
101 | <function line='149' file='tree' name='xmlFreeDoc'/>
|
---|
102 | <function line='154' file='parser' name='xmlCleanupParser'/>
|
---|
103 | <macro line='117' file='xmlversion' name='LIBXML_TEST_VERSION'/>
|
---|
104 | <function line='134' file='xinclude' name='xmlXIncludeProcess'/>
|
---|
105 | <function line='117' file='xmlIO' name='xmlRegisterInputCallbacks'/>
|
---|
106 | <function line='124' file='parser' name='xmlReadMemory'/>
|
---|
107 | <typedef line='105' file='tree' name='xmlDocPtr'/>
|
---|
108 | </uses>
|
---|
109 | </example>
|
---|
110 | <example filename='reader3.c'>
|
---|
111 | <synopsis>Show how to extract subdocuments with xmlReader</synopsis>
|
---|
112 | <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>
|
---|
113 | <usage>reader3</usage>
|
---|
114 | <test>reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp</test>
|
---|
115 | <author>Daniel Veillard</author>
|
---|
116 | <copy>see Copyright for the status of this software. </copy>
|
---|
117 | <section>xmlReader</section>
|
---|
118 | <includes>
|
---|
119 | <include><libxml/xmlreader.h></include>
|
---|
120 | </includes>
|
---|
121 | <uses>
|
---|
122 | <function line='106' file='parser' name='xmlCleanupParser'/>
|
---|
123 | <typedef line='31' file='xmlreader' name='xmlTextReaderPtr'/>
|
---|
124 | <function line='110' file='xmlmemory' name='xmlMemoryDump'/>
|
---|
125 | <function line='99' file='tree' name='xmlFreeDoc'/>
|
---|
126 | <function line='65' file='xmlreader' name='xmlFreeTextReader'/>
|
---|
127 | <macro line='90' file='xmlversion' name='LIBXML_TEST_VERSION'/>
|
---|
128 | <function line='95' file='tree' name='xmlDocDump'/>
|
---|
129 | <function line='51' file='xmlreader' name='xmlTextReaderRead'/>
|
---|
130 | <function line='61' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
|
---|
131 | <function line='42' file='xmlreader' name='xmlTextReaderPreservePattern'/>
|
---|
132 | <function line='37' file='xmlreader' name='xmlReaderForFile'/>
|
---|
133 | <typedef line='76' file='tree' name='xmlDocPtr'/>
|
---|
134 | </uses>
|
---|
135 | </example>
|
---|
136 | <example filename='testWriter.c'>
|
---|
137 | <synopsis>use various APIs for the xmlWriter</synopsis>
|
---|
138 | <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>
|
---|
139 | <usage>testWriter</usage>
|
---|
140 | <test>testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res</test>
|
---|
141 | <author>Alfred Mickautsch</author>
|
---|
142 | <copy>see Copyright for the status of this software. </copy>
|
---|
143 | <section>xmlWriter</section>
|
---|
144 | <includes>
|
---|
145 | <include><libxml/encoding.h></include>
|
---|
146 | <include><libxml/xmlwriter.h></include>
|
---|
147 | </includes>
|
---|
148 | <uses>
|
---|
149 | <function line='913' file='xmlwriter' name='xmlTextWriterStartDocument'/>
|
---|
150 | <function line='1121' file='xmlwriter' name='xmlTextWriterEndDocument'/>
|
---|
151 | <variable line='1183' file='globals' name='xmlRealloc'/>
|
---|
152 | <function line='925' file='xmlwriter' name='xmlTextWriterWriteComment'/>
|
---|
153 | <function line='1156' file='encoding' name='xmlFindCharEncodingHandler'/>
|
---|
154 | <variable line='1166' file='globals' name='xmlMalloc'/>
|
---|
155 | <typedef line='879' file='tree' name='xmlDocPtr'/>
|
---|
156 | <typedef line='341' file='tree' name='xmlBufferPtr'/>
|
---|
157 | <function line='58' file='xmlmemory' name='xmlMemoryDump'/>
|
---|
158 | <macro line='885' file='parser' name='XML_DEFAULT_VERSION'/>
|
---|
159 | <function line='901' file='tree' name='xmlDocSetRootElement'/>
|
---|
160 | <function line='1127' file='xmlwriter' name='xmlFreeTextWriter'/>
|
---|
161 | <function line='1096' file='xmlwriter' name='xmlTextWriterStartElement'/>
|
---|
162 | <function line='347' file='tree' name='xmlBufferCreate'/>
|
---|
163 | <function line='1111' file='xmlwriter' name='xmlTextWriterEndElement'/>
|
---|
164 | <function line='76' file='xmlwriter' name='xmlNewTextWriterFilename'/>
|
---|
165 | <function line='959' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/>
|
---|
166 | <function line='54' file='parser' name='xmlCleanupParser'/>
|
---|
167 | <function line='1073' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/>
|
---|
168 | <typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/>
|
---|
169 | <function line='1131' file='tree' name='xmlFreeDoc'/>
|
---|
170 | <typedef line='880' file='tree' name='xmlNodePtr'/>
|
---|
171 | <function line='949' file='xmlwriter' name='xmlTextWriterWriteAttribute'/>
|
---|
172 | <function line='632' file='xmlwriter' name='xmlNewTextWriterDoc'/>
|
---|
173 | <function line='894' file='tree' name='xmlNewDocNode'/>
|
---|
174 | <function line='1129' file='tree' name='xmlSaveFileEnc'/>
|
---|
175 | <function line='904' file='xmlwriter' name='xmlNewTextWriterTree'/>
|
---|
176 | <function line='355' file='xmlwriter' name='xmlNewTextWriterMemory'/>
|
---|
177 | <variable line='1180' file='globals' name='xmlFree'/>
|
---|
178 | <macro line='40' file='xmlversion' name='LIBXML_TEST_VERSION'/>
|
---|
179 | <function line='613' file='tree' name='xmlBufferFree'/>
|
---|
180 | <typedef line='878' file='xmlwriter' name='xmlTextWriterPtr'/>
|
---|
181 | <function line='1103' file='xmlwriter' name='xmlTextWriterWriteElement'/>
|
---|
182 | <function line='885' file='tree' name='xmlNewDoc'/>
|
---|
183 | </uses>
|
---|
184 | </example>
|
---|
185 | <example filename='tree1.c'>
|
---|
186 | <synopsis>Navigates a tree to print element names</synopsis>
|
---|
187 | <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>
|
---|
188 | <usage>tree1 filename_or_URL</usage>
|
---|
189 | <test>tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp</test>
|
---|
190 | <author>Dodji Seketeli</author>
|
---|
191 | <copy>see Copyright for the status of this software. </copy>
|
---|
192 | <section>Tree</section>
|
---|
193 | <includes>
|
---|
194 | <include><libxml/tree.h></include>
|
---|
195 | <include><libxml/parser.h></include>
|
---|
196 | </includes>
|
---|
197 | <uses>
|
---|
198 | <enum line='36' file='tree' name='XML_ELEMENT_NODE'/>
|
---|
199 | <function line='74' file='tree' name='xmlDocGetRootElement'/>
|
---|
200 | <function line='79' file='tree' name='xmlFreeDoc'/>
|
---|
201 | <function line='67' file='parser' name='xmlReadFile'/>
|
---|
202 | </uses>
|
---|
203 | </example>
|
---|
204 | <example filename='tree2.c'>
|
---|
205 | <synopsis>Creates a tree</synopsis>
|
---|
206 | <purpose>Shows how to create document, nodes and dump it to stdout or file.</purpose>
|
---|
207 | <usage>tree2 <filename> -Default output: stdout</usage>
|
---|
208 | <test>tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp</test>
|
---|
209 | <author>Lucas Brasilino <[email protected]></author>
|
---|
210 | <copy>see Copyright for the status of this software </copy>
|
---|
211 | <section>Tree</section>
|
---|
212 | <includes>
|
---|
213 | <include><libxml/tree.h></include>
|
---|
214 | <include><libxml/parser.h></include>
|
---|
215 | </includes>
|
---|
216 | <uses>
|
---|
217 | <function line='75' file='tree' name='xmlNewText'/>
|
---|
218 | <function line='96' file='tree' name='xmlSaveFormatFileEnc'/>
|
---|
219 | <function line='78' file='tree' name='xmlAddChild'/>
|
---|
220 | <function line='41' file='tree' name='xmlDocSetRootElement'/>
|
---|
221 | <function line='89' file='tree' name='xmlNewProp'/>
|
---|
222 | <function line='88' file='tree' name='xmlNewChild'/>
|
---|
223 | <function line='74' file='tree' name='xmlNewNode'/>
|
---|
224 | <function line='46' file='tree' name='xmlCreateIntSubset'/>
|
---|
225 | <function line='39' file='tree' name='xmlNewDoc'/>
|
---|
226 | </uses>
|
---|
227 | </example>
|
---|
228 | <example filename='parse2.c'>
|
---|
229 | <synopsis>Parse and validate an XML file to a tree and free the result</synopsis>
|
---|
230 | <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>
|
---|
231 | <usage>parse2 test2.xml</usage>
|
---|
232 | <test>parse2 test2.xml</test>
|
---|
233 | <author>Daniel Veillard</author>
|
---|
234 | <copy>see Copyright for the status of this software. </copy>
|
---|
235 | <section>Parsing</section>
|
---|
236 | <includes>
|
---|
237 | <include><libxml/tree.h></include>
|
---|
238 | <include><libxml/parser.h></include>
|
---|
239 | </includes>
|
---|
240 | <uses>
|
---|
241 | <function line='47' file='parser' name='xmlFreeParserCtxt'/>
|
---|
242 | <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/>
|
---|
243 | <function line='29' file='parser' name='xmlNewParserCtxt'/>
|
---|
244 | <typedef line='25' file='tree' name='xmlParserCtxtPtr'/>
|
---|
245 | <function line='35' file='parser' name='xmlCtxtReadFile'/>
|
---|
246 | <typedef line='26' file='tree' name='xmlDocPtr'/>
|
---|
247 | </uses>
|
---|
248 | </example>
|
---|
249 | <example filename='reader2.c'>
|
---|
250 | <synopsis>Parse and validate an XML file with an xmlReader</synopsis>
|
---|
251 | <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>
|
---|
252 | <usage>reader2 <valid_xml_filename></usage>
|
---|
253 | <test>reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
|
---|
254 | <author>Daniel Veillard</author>
|
---|
255 | <copy>see Copyright for the status of this software. </copy>
|
---|
256 | <section>xmlReader</section>
|
---|
257 | <includes>
|
---|
258 | <include><libxml/xmlreader.h></include>
|
---|
259 | </includes>
|
---|
260 | <uses>
|
---|
261 | <function line='45' file='xmlstring' name='xmlStrlen'/>
|
---|
262 | <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/>
|
---|
263 | <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/>
|
---|
264 | <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/>
|
---|
265 | <enum line='70' file='parser' name='XML_PARSE_NOENT'/>
|
---|
266 | <function line='37' file='xmlreader' name='xmlTextReaderDepth'/>
|
---|
267 | <enum line='71' file='parser' name='XML_PARSE_DTDVALID'/>
|
---|
268 | <enum line='69' file='parser' name='XML_PARSE_DTDATTR'/>
|
---|
269 | <function line='84' file='xmlreader' name='xmlFreeTextReader'/>
|
---|
270 | <function line='30' file='xmlreader' name='xmlTextReaderConstName'/>
|
---|
271 | <function line='41' file='xmlreader' name='xmlTextReaderHasValue'/>
|
---|
272 | <function line='76' file='xmlreader' name='xmlTextReaderRead'/>
|
---|
273 | <function line='40' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
|
---|
274 | <function line='68' file='xmlreader' name='xmlReaderForFile'/>
|
---|
275 | <function line='81' file='xmlreader' name='xmlTextReaderIsValid'/>
|
---|
276 | </uses>
|
---|
277 | </example>
|
---|
278 | <example filename='reader4.c'>
|
---|
279 | <synopsis>Parse multiple XML files reusing an xmlReader</synopsis>
|
---|
280 | <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>
|
---|
281 | <usage>reader4 <filename> [ filename ... ]</usage>
|
---|
282 | <test>reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp</test>
|
---|
283 | <author>Graham Bennett</author>
|
---|
284 | <copy>see Copyright for the status of this software. </copy>
|
---|
285 | <section>xmlReader</section>
|
---|
286 | <includes>
|
---|
287 | <include><libxml/xmlreader.h></include>
|
---|
288 | </includes>
|
---|
289 | <uses>
|
---|
290 | <typedef line='54' file='xmlreader' name='xmlTextReaderPtr'/>
|
---|
291 | <function line='83' file='xmlreader' name='xmlReaderNewFile'/>
|
---|
292 | <function line='104' file='xmlreader' name='xmlFreeTextReader'/>
|
---|
293 | <function line='26' file='xmlreader' name='xmlTextReaderRead'/>
|
---|
294 | <function line='97' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
|
---|
295 | <function line='72' file='xmlreader' name='xmlReaderForFile'/>
|
---|
296 | </uses>
|
---|
297 | </example>
|
---|
298 | <example filename='parse4.c'>
|
---|
299 | <synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis>
|
---|
300 | <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>
|
---|
301 | <usage>parse4 test3.xml</usage>
|
---|
302 | <test>parse4 test3.xml</test>
|
---|
303 | <author>Daniel Veillard</author>
|
---|
304 | <copy>see Copyright for the status of this software. </copy>
|
---|
305 | <section>Parsing</section>
|
---|
306 | <includes>
|
---|
307 | <include><libxml/tree.h></include>
|
---|
308 | <include><libxml/parser.h></include>
|
---|
309 | </includes>
|
---|
310 | <uses>
|
---|
311 | <function line='94' file='parser' name='xmlFreeParserCtxt'/>
|
---|
312 | <function line='86' file='parser' name='xmlParseChunk'/>
|
---|
313 | <function line='67' file='parser' name='xmlCreatePushParserCtxt'/>
|
---|
314 | <typedef line='45' file='tree' name='xmlParserCtxtPtr'/>
|
---|
315 | </uses>
|
---|
316 | </example>
|
---|
317 | <example filename='parse3.c'>
|
---|
318 | <synopsis>Parse an XML document in memory to a tree and free it</synopsis>
|
---|
319 | <purpose>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
|
---|
320 | <usage>parse3</usage>
|
---|
321 | <test>parse3</test>
|
---|
322 | <author>Daniel Veillard</author>
|
---|
323 | <copy>see Copyright for the status of this software. </copy>
|
---|
324 | <section>Parsing</section>
|
---|
325 | <includes>
|
---|
326 | <include><libxml/tree.h></include>
|
---|
327 | <include><libxml/parser.h></include>
|
---|
328 | </includes>
|
---|
329 | <uses>
|
---|
330 | <function line='33' file='parser' name='xmlReadMemory'/>
|
---|
331 | </uses>
|
---|
332 | </example>
|
---|
333 | <example filename='xpath1.c'>
|
---|
334 | <synopsis>Evaluate XPath expression and prints result node set.</synopsis>
|
---|
335 | <purpose>Shows how to evaluate XPath expression and register known namespaces in XPath context.</purpose>
|
---|
336 | <usage>xpath1 <xml-file> <xpath-expr> [<known-ns-list>]</usage>
|
---|
337 | <test>./xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp</test>
|
---|
338 | <author>Aleksey Sanin</author>
|
---|
339 | <copy>see Copyright for the status of this software. </copy>
|
---|
340 | <section>XPath</section>
|
---|
341 | <includes>
|
---|
342 | <include><libxml/parser.h></include>
|
---|
343 | <include><libxml/xpath.h></include>
|
---|
344 | <include><libxml/xpathInternals.h></include>
|
---|
345 | <include><libxml/tree.h></include>
|
---|
346 | </includes>
|
---|
347 | <uses>
|
---|
348 | <enum line='229' file='tree' name='XML_ELEMENT_NODE'/>
|
---|
349 | <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
|
---|
350 | <function line='117' file='xpath' name='xmlXPathEvalExpression'/>
|
---|
351 | <function line='94' file='parser' name='xmlParseFile'/>
|
---|
352 | <function line='186' file='xpathInternals' name='xmlXPathRegisterNs'/>
|
---|
353 | <function line='129' file='xpath' name='xmlXPathFreeObject'/>
|
---|
354 | <variable line='193' file='globals' name='xmlFree'/>
|
---|
355 | <typedef line='218' file='tree' name='xmlNsPtr'/>
|
---|
356 | <function line='101' file='xpath' name='xmlXPathNewContext'/>
|
---|
357 | <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
|
---|
358 | <function line='130' file='xpath' name='xmlXPathFreeContext'/>
|
---|
359 | <function line='39' file='parser' name='xmlInitParser'/>
|
---|
360 | <function line='156' file='xmlstring' name='xmlStrdup'/>
|
---|
361 | <function line='180' file='xmlstring' name='xmlStrchr'/>
|
---|
362 | <typedef line='206' file='tree' name='xmlNodePtr'/>
|
---|
363 | <enum line='217' file='tree' name='XML_NAMESPACE_DECL'/>
|
---|
364 | </uses>
|
---|
365 | </example>
|
---|
366 | <example filename='io2.c'>
|
---|
367 | <synopsis>Output to char buffer</synopsis>
|
---|
368 | <purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose>
|
---|
369 | <usage>io2</usage>
|
---|
370 | <test>io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp</test>
|
---|
371 | <author>John Fleck</author>
|
---|
372 | <copy>see Copyright for the status of this software. </copy>
|
---|
373 | <section>InputOutput</section>
|
---|
374 | <includes>
|
---|
375 | <include><libxml/parser.h></include>
|
---|
376 | </includes>
|
---|
377 | <uses>
|
---|
378 | <function line='29' file='tree' name='xmlNodeSetContent'/>
|
---|
379 | <function line='36' file='tree' name='xmlDocDumpFormatMemory'/>
|
---|
380 | <variable line='42' file='globals' name='xmlFree'/>
|
---|
381 | <function line='30' file='tree' name='xmlDocSetRootElement'/>
|
---|
382 | <typedef line='19' file='tree' name='xmlNodePtr'/>
|
---|
383 | <function line='27' file='tree' name='xmlNewDoc'/>
|
---|
384 | <function line='28' file='tree' name='xmlNewNode'/>
|
---|
385 | </uses>
|
---|
386 | </example>
|
---|