rsvg2 1.1.5-x86-mingw32 → 1.1.6-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/1.8/rsvg2.so +0 -0
- data/lib/1.9/rsvg2.so +0 -0
- data/vendor/local/bin/libxml2-2.dll +0 -0
- data/vendor/local/bin/xmlcatalog.exe +0 -0
- data/vendor/local/bin/xmllint.exe +0 -0
- data/vendor/local/include/libxml2/libxml/DOCBparser.h +9 -9
- data/vendor/local/include/libxml2/libxml/HTMLparser.h +25 -23
- data/vendor/local/include/libxml2/libxml/HTMLtree.h +19 -19
- data/vendor/local/include/libxml2/libxml/SAX.h +37 -37
- data/vendor/local/include/libxml2/libxml/SAX2.h +34 -34
- data/vendor/local/include/libxml2/libxml/c14n.h +1 -1
- data/vendor/local/include/libxml2/libxml/catalog.h +35 -35
- data/vendor/local/include/libxml2/libxml/debugXML.h +26 -26
- data/vendor/local/include/libxml2/libxml/dict.h +16 -5
- data/vendor/local/include/libxml2/libxml/encoding.h +28 -14
- data/vendor/local/include/libxml2/libxml/hash.h +24 -24
- data/vendor/local/include/libxml2/libxml/list.h +26 -26
- data/vendor/local/include/libxml2/libxml/nanoftp.h +44 -24
- data/vendor/local/include/libxml2/libxml/nanohttp.h +13 -13
- data/vendor/local/include/libxml2/libxml/parser.h +78 -73
- data/vendor/local/include/libxml2/libxml/parserInternals.h +106 -73
- data/vendor/local/include/libxml2/libxml/schemasInternals.h +2 -2
- data/vendor/local/include/libxml2/libxml/schematron.h +11 -11
- data/vendor/local/include/libxml2/libxml/tree.h +203 -152
- data/vendor/local/include/libxml2/libxml/valid.h +72 -72
- data/vendor/local/include/libxml2/libxml/xlink.h +7 -7
- data/vendor/local/include/libxml2/libxml/xmlIO.h +71 -65
- data/vendor/local/include/libxml2/libxml/xmlautomata.h +22 -22
- data/vendor/local/include/libxml2/libxml/xmlerror.h +6 -6
- data/vendor/local/include/libxml2/libxml/xmlexports.h +2 -2
- data/vendor/local/include/libxml2/libxml/xmlmodule.h +1 -1
- data/vendor/local/include/libxml2/libxml/xmlreader.h +24 -20
- data/vendor/local/include/libxml2/libxml/xmlsave.h +2 -1
- data/vendor/local/include/libxml2/libxml/xmlschemas.h +30 -2
- data/vendor/local/include/libxml2/libxml/xmlschemastypes.h +20 -20
- data/vendor/local/include/libxml2/libxml/xmlstring.h +3 -3
- data/vendor/local/include/libxml2/libxml/xmlversion.h +29 -7
- data/vendor/local/include/libxml2/libxml/xmlwriter.h +4 -1
- data/vendor/local/include/libxml2/libxml/xpath.h +47 -43
- data/vendor/local/include/libxml2/libxml/xpathInternals.h +81 -79
- data/vendor/local/include/libxml2/libxml/xpointer.h +23 -23
- data/vendor/local/lib/libxml2.def +16 -14
- data/vendor/local/lib/libxml2.dll.a +0 -0
- data/vendor/local/lib/libxml2.lib +0 -0
- data/vendor/local/lib/pkgconfig/libxml-2.0.pc +3 -3
- data/vendor/local/manifest/libxml2-dev_2.9.0-1_win32.mft +268 -0
- data/vendor/local/manifest/libxml2_2.9.0-1_win32.mft +2 -0
- data/vendor/local/share/doc/libxml2-2.9.0/Copyright +27 -0
- data/vendor/local/share/doc/libxml2-2.9.0/examples/testHTML.c +880 -0
- data/vendor/local/share/doc/libxml2-2.9.0/examples/testSAX.c +1198 -0
- data/vendor/local/share/doc/libxml2-2.9.0/examples/testXPath.c +229 -0
- data/vendor/local/share/doc/libxml2-2.9.0/examples/xmllint.c +3770 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/DOM.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/FAQ.html +282 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/Libxml2-Logo-180x168.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/Libxml2-Logo-90x34.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/encoding.html +207 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/examples.xml +751 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/examples.xsl +174 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/book1.html +13 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/home.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/index.html +13 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/left.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-DOCBparser.html +51 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-HTMLparser.html +184 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-HTMLtree.html +73 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-SAX.html +125 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-SAX2.html +128 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-c14n.html +38 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-catalog.html +142 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-chvalid.html +72 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-debugXML.html +120 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-dict.html +58 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-encoding.html +124 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-entities.html +79 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-globals.html +152 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-hash.html +116 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-lib.html +13 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-list.html +120 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-nanoftp.html +94 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-nanohttp.html +65 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-parser.html +559 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-parserInternals.html +322 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-pattern.html +76 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-relaxng.html +162 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-schemasInternals.html +373 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-schematron.html +81 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-threads.html +72 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-tree.html +989 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-uri.html +73 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-valid.html +289 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xinclude.html +59 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xlink.html +82 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlIO.html +212 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlautomata.html +85 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlerror.html +864 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlexports.html +20 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlmemory.html +107 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlmodule.html +38 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlreader.html +330 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlregexp.html +143 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlsave.html +60 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlschemas.html +185 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlschemastypes.html +123 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlstring.html +108 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlunicode.html +512 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlversion.html +62 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlwriter.html +261 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpath.html +310 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpathInternals.html +394 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpointer.html +83 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/right.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/up.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/index.html +14 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/io1.c +166 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/io1.res +5 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/io2.c +58 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/io2.res +2 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/libxml.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse1.c +56 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse2.c +72 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse3.c +60 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse4.c +143 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader1.c +107 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader1.res +14 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader2.c +122 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader3.c +120 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader3.res +13 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader4.c +122 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader4.res +3 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/redhat.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/smallfootonly.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/structure.gif +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/test1.xml +1 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/test2.xml +13 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/test3.xml +39 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/testWriter.c +1198 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree1.c +94 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree1.res +4 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree2.c +118 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree2.res +18 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tst.xml +7 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apa.html +8 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apb.html +14 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apc.html +82 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apd.html +76 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ape.html +78 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apf.html +67 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apg.html +75 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/aph.html +76 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/api.html +4 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s02.html +14 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s03.html +47 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s04.html +54 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s05.html +55 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s06.html +35 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s07.html +30 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s08.html +38 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s09.html +63 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/blank.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/1.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/10.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/2.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/3.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/4.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/5.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/6.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/7.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/8.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/callouts/9.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/caution.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/draft.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/home.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/important.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/next.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/note.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/prev.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/tip.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/toc-blank.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/toc-minus.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/toc-plus.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/up.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/images/warning.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeaddattribute.c +64 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeaddkeyword.c +75 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeconvert.c +73 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includegetattribute.c +72 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includekeyword.c +79 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includexpath.c +74 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/index.html +14 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ix01.html +1 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/xmltutorial.pdf +1336 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/w3c.png +0 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/writer.xml +2 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/xml.html +5715 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath1.c +250 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath1.res +5 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath2.c +190 -0
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath2.res +30 -0
- data/vendor/local/share/gtk-doc/html/libxml2/general.html +1 -1
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-HTMLparser.html +3 -1
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-dict.html +16 -1
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-encoding.html +11 -1
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-nanoftp.html +15 -5
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parser.html +8 -4
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parserInternals.html +20 -5
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-tree.html +72 -18
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlIO.html +10 -0
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlerror.html +5 -3
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlmodule.html +2 -2
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlreader.html +8 -3
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlsave.html +2 -1
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlschemas.html +15 -0
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlversion.html +12 -2
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlwriter.html +8 -3
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpath.html +3 -0
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpathInternals.html +9 -9
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2.devhelp +42 -2
- data/vendor/local/share/man/man1/xml2-config.1 +0 -1
- data/vendor/local/share/man/man1/xmlcatalog.1 +204 -93
- data/vendor/local/share/man/man3/libxml.3 +1 -1
- data/vendor/local/src/dieterv/packaging/libxml2_2.9.0-1_win32.log +867 -0
- data/vendor/local/src/dieterv/packaging/libxml2_2.9.0-1_win32.sh +68 -0
- metadata +163 -7
@@ -0,0 +1,143 @@
|
|
1
|
+
/**
|
2
|
+
* section: Parsing
|
3
|
+
* synopsis: Parse an XML document chunk by chunk to a tree and free it
|
4
|
+
* purpose: Demonstrate the use of xmlCreatePushParserCtxt() and
|
5
|
+
* xmlParseChunk() to read an XML file progressively
|
6
|
+
* into a tree and and xmlFreeDoc() to free the resulting tree
|
7
|
+
* usage: parse4 test3.xml
|
8
|
+
* test: parse4 test3.xml
|
9
|
+
* author: Daniel Veillard
|
10
|
+
* copy: see Copyright for the status of this software.
|
11
|
+
*/
|
12
|
+
|
13
|
+
#include <stdio.h>
|
14
|
+
#include <libxml/parser.h>
|
15
|
+
#include <libxml/tree.h>
|
16
|
+
|
17
|
+
#ifdef LIBXML_PUSH_ENABLED
|
18
|
+
static FILE *desc;
|
19
|
+
|
20
|
+
/**
|
21
|
+
* readPacket:
|
22
|
+
* @mem: array to store the packet
|
23
|
+
* @size: the packet size
|
24
|
+
*
|
25
|
+
* read at most @size bytes from the document and store it in @mem
|
26
|
+
*
|
27
|
+
* Returns the number of bytes read
|
28
|
+
*/
|
29
|
+
static int
|
30
|
+
readPacket(char *mem, int size) {
|
31
|
+
int res;
|
32
|
+
|
33
|
+
res = fread(mem, 1, size, desc);
|
34
|
+
return(res);
|
35
|
+
}
|
36
|
+
|
37
|
+
/**
|
38
|
+
* example4Func:
|
39
|
+
* @filename: a filename or an URL
|
40
|
+
*
|
41
|
+
* Parse the resource and free the resulting tree
|
42
|
+
*/
|
43
|
+
static void
|
44
|
+
example4Func(const char *filename) {
|
45
|
+
xmlParserCtxtPtr ctxt;
|
46
|
+
char chars[4];
|
47
|
+
xmlDocPtr doc; /* the resulting document tree */
|
48
|
+
int res;
|
49
|
+
|
50
|
+
/*
|
51
|
+
* Read a few first byte to check the input used for the
|
52
|
+
* encoding detection at the parser level.
|
53
|
+
*/
|
54
|
+
res = readPacket(chars, 4);
|
55
|
+
if (res <= 0) {
|
56
|
+
fprintf(stderr, "Failed to parse %s\n", filename);
|
57
|
+
return;
|
58
|
+
}
|
59
|
+
|
60
|
+
/*
|
61
|
+
* Create a progressive parsing context, the 2 first arguments
|
62
|
+
* are not used since we want to build a tree and not use a SAX
|
63
|
+
* parsing interface. We also pass the first bytes of the document
|
64
|
+
* to allow encoding detection when creating the parser but this
|
65
|
+
* is optional.
|
66
|
+
*/
|
67
|
+
ctxt = xmlCreatePushParserCtxt(NULL, NULL,
|
68
|
+
chars, res, filename);
|
69
|
+
if (ctxt == NULL) {
|
70
|
+
fprintf(stderr, "Failed to create parser context !\n");
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
/*
|
75
|
+
* loop on the input getting the document data, of course 4 bytes
|
76
|
+
* at a time is not realistic but allows to verify testing on small
|
77
|
+
* documents.
|
78
|
+
*/
|
79
|
+
while ((res = readPacket(chars, 4)) > 0) {
|
80
|
+
xmlParseChunk(ctxt, chars, res, 0);
|
81
|
+
}
|
82
|
+
|
83
|
+
/*
|
84
|
+
* there is no more input, indicate the parsing is finished.
|
85
|
+
*/
|
86
|
+
xmlParseChunk(ctxt, chars, 0, 1);
|
87
|
+
|
88
|
+
/*
|
89
|
+
* collect the document back and if it was wellformed
|
90
|
+
* and destroy the parser context.
|
91
|
+
*/
|
92
|
+
doc = ctxt->myDoc;
|
93
|
+
res = ctxt->wellFormed;
|
94
|
+
xmlFreeParserCtxt(ctxt);
|
95
|
+
|
96
|
+
if (!res) {
|
97
|
+
fprintf(stderr, "Failed to parse %s\n", filename);
|
98
|
+
}
|
99
|
+
|
100
|
+
/*
|
101
|
+
* since we don't use the document, destroy it now.
|
102
|
+
*/
|
103
|
+
xmlFreeDoc(doc);
|
104
|
+
}
|
105
|
+
|
106
|
+
int main(int argc, char **argv) {
|
107
|
+
if (argc != 2)
|
108
|
+
return(1);
|
109
|
+
|
110
|
+
/*
|
111
|
+
* this initialize the library and check potential ABI mismatches
|
112
|
+
* between the version it was compiled for and the actual shared
|
113
|
+
* library used.
|
114
|
+
*/
|
115
|
+
LIBXML_TEST_VERSION
|
116
|
+
|
117
|
+
/*
|
118
|
+
* simulate a progressive parsing using the input file.
|
119
|
+
*/
|
120
|
+
desc = fopen(argv[1], "rb");
|
121
|
+
if (desc != NULL) {
|
122
|
+
example4Func(argv[1]);
|
123
|
+
fclose(desc);
|
124
|
+
} else {
|
125
|
+
fprintf(stderr, "Failed to parse %s\n", argv[1]);
|
126
|
+
}
|
127
|
+
|
128
|
+
/*
|
129
|
+
* Cleanup function for the XML library.
|
130
|
+
*/
|
131
|
+
xmlCleanupParser();
|
132
|
+
/*
|
133
|
+
* this is to debug memory for regression tests
|
134
|
+
*/
|
135
|
+
xmlMemoryDump();
|
136
|
+
return(0);
|
137
|
+
}
|
138
|
+
#else /* ! LIBXML_PUSH_ENABLED */
|
139
|
+
int main(int argc, char **argv) {
|
140
|
+
fprintf(stderr, "Library not compiled with push parser support\n");
|
141
|
+
return(1);
|
142
|
+
}
|
143
|
+
#endif
|
@@ -0,0 +1,107 @@
|
|
1
|
+
/**
|
2
|
+
* section: xmlReader
|
3
|
+
* synopsis: Parse an XML file with an xmlReader
|
4
|
+
* purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
|
5
|
+
* and dump the informations about the nodes found in the process.
|
6
|
+
* (Note that the XMLReader functions require libxml2 version later
|
7
|
+
* than 2.6.)
|
8
|
+
* usage: reader1 <filename>
|
9
|
+
* test: reader1 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res
|
10
|
+
* author: Daniel Veillard
|
11
|
+
* copy: see Copyright for the status of this software.
|
12
|
+
*/
|
13
|
+
|
14
|
+
#include <stdio.h>
|
15
|
+
#include <libxml/xmlreader.h>
|
16
|
+
|
17
|
+
#ifdef LIBXML_READER_ENABLED
|
18
|
+
|
19
|
+
/**
|
20
|
+
* processNode:
|
21
|
+
* @reader: the xmlReader
|
22
|
+
*
|
23
|
+
* Dump information about the current node
|
24
|
+
*/
|
25
|
+
static void
|
26
|
+
processNode(xmlTextReaderPtr reader) {
|
27
|
+
const xmlChar *name, *value;
|
28
|
+
|
29
|
+
name = xmlTextReaderConstName(reader);
|
30
|
+
if (name == NULL)
|
31
|
+
name = BAD_CAST "--";
|
32
|
+
|
33
|
+
value = xmlTextReaderConstValue(reader);
|
34
|
+
|
35
|
+
printf("%d %d %s %d %d",
|
36
|
+
xmlTextReaderDepth(reader),
|
37
|
+
xmlTextReaderNodeType(reader),
|
38
|
+
name,
|
39
|
+
xmlTextReaderIsEmptyElement(reader),
|
40
|
+
xmlTextReaderHasValue(reader));
|
41
|
+
if (value == NULL)
|
42
|
+
printf("\n");
|
43
|
+
else {
|
44
|
+
if (xmlStrlen(value) > 40)
|
45
|
+
printf(" %.40s...\n", value);
|
46
|
+
else
|
47
|
+
printf(" %s\n", value);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
/**
|
52
|
+
* streamFile:
|
53
|
+
* @filename: the file name to parse
|
54
|
+
*
|
55
|
+
* Parse and print information about an XML file.
|
56
|
+
*/
|
57
|
+
static void
|
58
|
+
streamFile(const char *filename) {
|
59
|
+
xmlTextReaderPtr reader;
|
60
|
+
int ret;
|
61
|
+
|
62
|
+
reader = xmlReaderForFile(filename, NULL, 0);
|
63
|
+
if (reader != NULL) {
|
64
|
+
ret = xmlTextReaderRead(reader);
|
65
|
+
while (ret == 1) {
|
66
|
+
processNode(reader);
|
67
|
+
ret = xmlTextReaderRead(reader);
|
68
|
+
}
|
69
|
+
xmlFreeTextReader(reader);
|
70
|
+
if (ret != 0) {
|
71
|
+
fprintf(stderr, "%s : failed to parse\n", filename);
|
72
|
+
}
|
73
|
+
} else {
|
74
|
+
fprintf(stderr, "Unable to open %s\n", filename);
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
int main(int argc, char **argv) {
|
79
|
+
if (argc != 2)
|
80
|
+
return(1);
|
81
|
+
|
82
|
+
/*
|
83
|
+
* this initialize the library and check potential ABI mismatches
|
84
|
+
* between the version it was compiled for and the actual shared
|
85
|
+
* library used.
|
86
|
+
*/
|
87
|
+
LIBXML_TEST_VERSION
|
88
|
+
|
89
|
+
streamFile(argv[1]);
|
90
|
+
|
91
|
+
/*
|
92
|
+
* Cleanup function for the XML library.
|
93
|
+
*/
|
94
|
+
xmlCleanupParser();
|
95
|
+
/*
|
96
|
+
* this is to debug memory for regression tests
|
97
|
+
*/
|
98
|
+
xmlMemoryDump();
|
99
|
+
return(0);
|
100
|
+
}
|
101
|
+
|
102
|
+
#else
|
103
|
+
int main(void) {
|
104
|
+
fprintf(stderr, "XInclude support not compiled in\n");
|
105
|
+
exit(1);
|
106
|
+
}
|
107
|
+
#endif
|
@@ -0,0 +1,122 @@
|
|
1
|
+
/**
|
2
|
+
* section: xmlReader
|
3
|
+
* synopsis: Parse and validate an XML file with an xmlReader
|
4
|
+
* purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
|
5
|
+
* validating the content in the process and activating options
|
6
|
+
* like entities substitution, and DTD attributes defaulting.
|
7
|
+
* (Note that the XMLReader functions require libxml2 version later
|
8
|
+
* than 2.6.)
|
9
|
+
* usage: reader2 <valid_xml_filename>
|
10
|
+
* test: reader2 test2.xml > reader1.tmp && diff reader1.tmp $(srcdir)/reader1.res
|
11
|
+
* author: Daniel Veillard
|
12
|
+
* copy: see Copyright for the status of this software.
|
13
|
+
*/
|
14
|
+
|
15
|
+
#include <stdio.h>
|
16
|
+
#include <libxml/xmlreader.h>
|
17
|
+
|
18
|
+
#ifdef LIBXML_READER_ENABLED
|
19
|
+
|
20
|
+
/**
|
21
|
+
* processNode:
|
22
|
+
* @reader: the xmlReader
|
23
|
+
*
|
24
|
+
* Dump information about the current node
|
25
|
+
*/
|
26
|
+
static void
|
27
|
+
processNode(xmlTextReaderPtr reader) {
|
28
|
+
const xmlChar *name, *value;
|
29
|
+
|
30
|
+
name = xmlTextReaderConstName(reader);
|
31
|
+
if (name == NULL)
|
32
|
+
name = BAD_CAST "--";
|
33
|
+
|
34
|
+
value = xmlTextReaderConstValue(reader);
|
35
|
+
|
36
|
+
printf("%d %d %s %d %d",
|
37
|
+
xmlTextReaderDepth(reader),
|
38
|
+
xmlTextReaderNodeType(reader),
|
39
|
+
name,
|
40
|
+
xmlTextReaderIsEmptyElement(reader),
|
41
|
+
xmlTextReaderHasValue(reader));
|
42
|
+
if (value == NULL)
|
43
|
+
printf("\n");
|
44
|
+
else {
|
45
|
+
if (xmlStrlen(value) > 40)
|
46
|
+
printf(" %.40s...\n", value);
|
47
|
+
else
|
48
|
+
printf(" %s\n", value);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
/**
|
53
|
+
* streamFile:
|
54
|
+
* @filename: the file name to parse
|
55
|
+
*
|
56
|
+
* Parse, validate and print information about an XML file.
|
57
|
+
*/
|
58
|
+
static void
|
59
|
+
streamFile(const char *filename) {
|
60
|
+
xmlTextReaderPtr reader;
|
61
|
+
int ret;
|
62
|
+
|
63
|
+
|
64
|
+
/*
|
65
|
+
* Pass some special parsing options to activate DTD attribute defaulting,
|
66
|
+
* entities substitution and DTD validation
|
67
|
+
*/
|
68
|
+
reader = xmlReaderForFile(filename, NULL,
|
69
|
+
XML_PARSE_DTDATTR | /* default DTD attributes */
|
70
|
+
XML_PARSE_NOENT | /* substitute entities */
|
71
|
+
XML_PARSE_DTDVALID); /* validate with the DTD */
|
72
|
+
if (reader != NULL) {
|
73
|
+
ret = xmlTextReaderRead(reader);
|
74
|
+
while (ret == 1) {
|
75
|
+
processNode(reader);
|
76
|
+
ret = xmlTextReaderRead(reader);
|
77
|
+
}
|
78
|
+
/*
|
79
|
+
* Once the document has been fully parsed check the validation results
|
80
|
+
*/
|
81
|
+
if (xmlTextReaderIsValid(reader) != 1) {
|
82
|
+
fprintf(stderr, "Document %s does not validate\n", filename);
|
83
|
+
}
|
84
|
+
xmlFreeTextReader(reader);
|
85
|
+
if (ret != 0) {
|
86
|
+
fprintf(stderr, "%s : failed to parse\n", filename);
|
87
|
+
}
|
88
|
+
} else {
|
89
|
+
fprintf(stderr, "Unable to open %s\n", filename);
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
int main(int argc, char **argv) {
|
94
|
+
if (argc != 2)
|
95
|
+
return(1);
|
96
|
+
|
97
|
+
/*
|
98
|
+
* this initialize the library and check potential ABI mismatches
|
99
|
+
* between the version it was compiled for and the actual shared
|
100
|
+
* library used.
|
101
|
+
*/
|
102
|
+
LIBXML_TEST_VERSION
|
103
|
+
|
104
|
+
streamFile(argv[1]);
|
105
|
+
|
106
|
+
/*
|
107
|
+
* Cleanup function for the XML library.
|
108
|
+
*/
|
109
|
+
xmlCleanupParser();
|
110
|
+
/*
|
111
|
+
* this is to debug memory for regression tests
|
112
|
+
*/
|
113
|
+
xmlMemoryDump();
|
114
|
+
return(0);
|
115
|
+
}
|
116
|
+
|
117
|
+
#else
|
118
|
+
int main(void) {
|
119
|
+
fprintf(stderr, "XInclude support not compiled in\n");
|
120
|
+
exit(1);
|
121
|
+
}
|
122
|
+
#endif
|
@@ -0,0 +1,120 @@
|
|
1
|
+
/**
|
2
|
+
* section: xmlReader
|
3
|
+
* synopsis: Show how to extract subdocuments with xmlReader
|
4
|
+
* purpose: Demonstrate the use of xmlTextReaderPreservePattern()
|
5
|
+
* to parse an XML file with the xmlReader while collecting
|
6
|
+
* only some subparts of the document.
|
7
|
+
* (Note that the XMLReader functions require libxml2 version later
|
8
|
+
* than 2.6.)
|
9
|
+
* usage: reader3
|
10
|
+
* test: reader3 > reader3.tmp && diff reader3.tmp $(srcdir)/reader3.res
|
11
|
+
* author: Daniel Veillard
|
12
|
+
* copy: see Copyright for the status of this software.
|
13
|
+
*/
|
14
|
+
|
15
|
+
#include <stdio.h>
|
16
|
+
#include <libxml/xmlreader.h>
|
17
|
+
|
18
|
+
#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
19
|
+
|
20
|
+
|
21
|
+
/**
|
22
|
+
* streamFile:
|
23
|
+
* @filename: the file name to parse
|
24
|
+
*
|
25
|
+
* Parse and print information about an XML file.
|
26
|
+
*
|
27
|
+
* Returns the resulting doc with just the elements preserved.
|
28
|
+
*/
|
29
|
+
static xmlDocPtr
|
30
|
+
extractFile(const char *filename, const xmlChar *pattern) {
|
31
|
+
xmlDocPtr doc;
|
32
|
+
xmlTextReaderPtr reader;
|
33
|
+
int ret;
|
34
|
+
|
35
|
+
/*
|
36
|
+
* build an xmlReader for that file
|
37
|
+
*/
|
38
|
+
reader = xmlReaderForFile(filename, NULL, 0);
|
39
|
+
if (reader != NULL) {
|
40
|
+
/*
|
41
|
+
* add the pattern to preserve
|
42
|
+
*/
|
43
|
+
if (xmlTextReaderPreservePattern(reader, pattern, NULL) < 0) {
|
44
|
+
fprintf(stderr, "%s : failed add preserve pattern %s\n",
|
45
|
+
filename, (const char *) pattern);
|
46
|
+
}
|
47
|
+
/*
|
48
|
+
* Parse and traverse the tree, collecting the nodes in the process
|
49
|
+
*/
|
50
|
+
ret = xmlTextReaderRead(reader);
|
51
|
+
while (ret == 1) {
|
52
|
+
ret = xmlTextReaderRead(reader);
|
53
|
+
}
|
54
|
+
if (ret != 0) {
|
55
|
+
fprintf(stderr, "%s : failed to parse\n", filename);
|
56
|
+
xmlFreeTextReader(reader);
|
57
|
+
return(NULL);
|
58
|
+
}
|
59
|
+
/*
|
60
|
+
* get the resulting nodes
|
61
|
+
*/
|
62
|
+
doc = xmlTextReaderCurrentDoc(reader);
|
63
|
+
/*
|
64
|
+
* Free up the reader
|
65
|
+
*/
|
66
|
+
xmlFreeTextReader(reader);
|
67
|
+
} else {
|
68
|
+
fprintf(stderr, "Unable to open %s\n", filename);
|
69
|
+
return(NULL);
|
70
|
+
}
|
71
|
+
return(doc);
|
72
|
+
}
|
73
|
+
|
74
|
+
int main(int argc, char **argv) {
|
75
|
+
const char *filename = "test3.xml";
|
76
|
+
const char *pattern = "preserved";
|
77
|
+
xmlDocPtr doc;
|
78
|
+
|
79
|
+
if (argc == 3) {
|
80
|
+
filename = argv[1];
|
81
|
+
pattern = argv[2];
|
82
|
+
}
|
83
|
+
|
84
|
+
/*
|
85
|
+
* this initialize the library and check potential ABI mismatches
|
86
|
+
* between the version it was compiled for and the actual shared
|
87
|
+
* library used.
|
88
|
+
*/
|
89
|
+
LIBXML_TEST_VERSION
|
90
|
+
|
91
|
+
doc = extractFile(filename, (const xmlChar *) pattern);
|
92
|
+
if (doc != NULL) {
|
93
|
+
/*
|
94
|
+
* ouptut the result.
|
95
|
+
*/
|
96
|
+
xmlDocDump(stdout, doc);
|
97
|
+
/*
|
98
|
+
* don't forget to free up the doc
|
99
|
+
*/
|
100
|
+
xmlFreeDoc(doc);
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
/*
|
105
|
+
* Cleanup function for the XML library.
|
106
|
+
*/
|
107
|
+
xmlCleanupParser();
|
108
|
+
/*
|
109
|
+
* this is to debug memory for regression tests
|
110
|
+
*/
|
111
|
+
xmlMemoryDump();
|
112
|
+
return(0);
|
113
|
+
}
|
114
|
+
|
115
|
+
#else
|
116
|
+
int main(void) {
|
117
|
+
fprintf(stderr, "Reader, Pattern or output support not compiled in\n");
|
118
|
+
exit(1);
|
119
|
+
}
|
120
|
+
#endif
|