rsvg2 2.0.2-x86-mingw32 → 2.0.3-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +63 -7
- data/ext/rsvg2/extconf.rb +4 -1
- data/lib/1.9/rsvg2.so +0 -0
- data/lib/2.0/rsvg2.so +0 -0
- data/vendor/local/bin/croco-0.6-config +87 -0
- data/vendor/local/bin/csslint-0.6.exe +0 -0
- data/vendor/local/bin/libcroco-0.6-3.dll +0 -0
- data/vendor/local/bin/librsvg-2-2.dll +0 -0
- data/vendor/local/bin/rsvg-convert.exe +0 -0
- data/vendor/local/include/libcroco-0.6/libcroco/cr-cascade.h +1 -1
- data/vendor/local/include/libcroco-0.6/libcroco/cr-enc-handler.h +1 -1
- data/vendor/local/include/libcroco-0.6/libcroco/cr-om-parser.h +1 -1
- data/vendor/local/include/libcroco-0.6/libcroco/cr-sel-eng.h +1 -5
- data/vendor/local/include/libcroco-0.6/libcroco/libcroco-config.h +4 -5
- data/vendor/local/include/librsvg-2.0/librsvg/librsvg-enum-types.h +4 -0
- data/vendor/local/include/librsvg-2.0/librsvg/librsvg-features.h +13 -10
- data/vendor/local/include/librsvg-2.0/librsvg/rsvg-cairo.h +4 -0
- data/vendor/local/include/librsvg-2.0/librsvg/rsvg.h +64 -34
- data/vendor/local/lib/girepository-1.0/Rsvg-2.0.typelib +0 -0
- data/vendor/local/lib/libcroco-0.6.a +0 -0
- data/vendor/local/lib/libcroco-0.6.dll.a +0 -0
- data/vendor/local/lib/libcroco-0.6.la +41 -0
- data/vendor/local/lib/librsvg-2.a +0 -0
- data/vendor/local/lib/librsvg-2.dll.a +0 -0
- data/vendor/local/lib/librsvg-2.la +41 -0
- data/vendor/local/lib/pkgconfig/libcroco-0.6.pc +3 -4
- data/vendor/local/lib/pkgconfig/librsvg-2.0.pc +1 -1
- data/vendor/local/share/gir-1.0/Rsvg-2.0.gir +693 -0
- data/vendor/local/share/gtk-doc/html/libcroco/ch01.html +113 -0
- data/vendor/local/share/{doc/libxml2-2.9.0/html/html → gtk-doc/html/libcroco}/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/libcroco/index.html +109 -0
- data/vendor/local/share/gtk-doc/html/libcroco/index.sgml +582 -0
- data/vendor/local/share/{doc/libxml2-2.9.0/html/html → gtk-doc/html/libcroco}/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-additional-sel.html +337 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-attr-sel.html +203 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-cascade.html +240 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-declaration.html +642 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-doc-handler.html +517 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-enc-handler.html +164 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-fonts.html +670 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-input.html +1102 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-num.html +265 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-om-parser.html +380 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-parser.html +913 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-parsing-location.html +205 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-prop-list.html +421 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-pseudo.html +141 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-rgb.html +503 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-sel-eng.html +346 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-selector.html +246 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-simple-sel.html +240 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-statement.html +1408 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-string.html +137 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-style.html +384 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-stylesheet.html +158 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-term.html +304 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-tknzr.html +312 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-token.html +428 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-cr-utils.html +334 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco-libcroco-config.html +80 -0
- data/vendor/local/share/gtk-doc/html/libcroco/libcroco.devhelp2 +511 -0
- data/vendor/local/share/{doc/libxml2-2.9.0/html/html → gtk-doc/html/libcroco}/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/libcroco/style.css +266 -0
- data/vendor/local/share/{doc/libxml2-2.9.0/html/html → gtk-doc/html/libcroco}/up.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/RsvgHandle.html +1073 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/annotation-glossary.html +55 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-14.html +58 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-22.html +46 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-32.html +50 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-36.html +51 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-4.html +42 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-8.html +59 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-2-9.html +58 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-deprecated.html +105 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/api-index-full.html +328 -0
- data/vendor/local/share/gtk-doc/html/{libxml2 → rsvg-2.0}/home.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/index.html +88 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/index.sgml +101 -0
- data/vendor/local/share/gtk-doc/html/{libxml2 → rsvg-2.0}/left.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/licence.html +57 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/object-tree.html +38 -0
- data/vendor/local/share/gtk-doc/html/{libxml2 → rsvg-2.0}/right.png +0 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-2.0.devhelp2 +96 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-GIO.html +283 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-GdkPixbuf.html +386 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Using-RSVG-with-cairo.html +126 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg-Version-check-and-feature-tests.html +109 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/rsvg.html +57 -0
- data/vendor/local/share/gtk-doc/html/rsvg-2.0/style.css +266 -0
- data/vendor/local/share/gtk-doc/html/{libxml2 → rsvg-2.0}/up.png +0 -0
- data/vendor/local/share/license/libcroco/AUTHORS +13 -0
- data/vendor/local/share/license/libcroco/COPYING +481 -0
- data/vendor/local/share/license/libcroco/COPYING.LIB +481 -0
- data/vendor/local/share/license/librsvg/AUTHORS +1 -0
- data/vendor/local/share/license/librsvg/COPYING +340 -0
- data/vendor/local/share/license/librsvg/COPYING.LIB +482 -0
- data/vendor/local/share/man/man1/rsvg-convert.1 +55 -0
- metadata +90 -299
- data/vendor/local/bin/libxml2-2.dll +0 -0
- data/vendor/local/bin/rsvg-view.exe +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 +0 -96
- data/vendor/local/include/libxml2/libxml/HTMLparser.h +0 -306
- data/vendor/local/include/libxml2/libxml/HTMLtree.h +0 -147
- data/vendor/local/include/libxml2/libxml/SAX.h +0 -173
- data/vendor/local/include/libxml2/libxml/SAX2.h +0 -176
- data/vendor/local/include/libxml2/libxml/c14n.h +0 -126
- data/vendor/local/include/libxml2/libxml/catalog.h +0 -182
- data/vendor/local/include/libxml2/libxml/chvalid.h +0 -230
- data/vendor/local/include/libxml2/libxml/debugXML.h +0 -217
- data/vendor/local/include/libxml2/libxml/dict.h +0 -80
- data/vendor/local/include/libxml2/libxml/encoding.h +0 -240
- data/vendor/local/include/libxml2/libxml/entities.h +0 -150
- data/vendor/local/include/libxml2/libxml/globals.h +0 -502
- data/vendor/local/include/libxml2/libxml/hash.h +0 -233
- data/vendor/local/include/libxml2/libxml/list.h +0 -137
- data/vendor/local/include/libxml2/libxml/nanoftp.h +0 -163
- data/vendor/local/include/libxml2/libxml/nanohttp.h +0 -81
- data/vendor/local/include/libxml2/libxml/parser.h +0 -1240
- data/vendor/local/include/libxml2/libxml/parserInternals.h +0 -644
- data/vendor/local/include/libxml2/libxml/pattern.h +0 -100
- data/vendor/local/include/libxml2/libxml/relaxng.h +0 -213
- data/vendor/local/include/libxml2/libxml/schemasInternals.h +0 -958
- data/vendor/local/include/libxml2/libxml/schematron.h +0 -142
- data/vendor/local/include/libxml2/libxml/threads.h +0 -84
- data/vendor/local/include/libxml2/libxml/tree.h +0 -1303
- data/vendor/local/include/libxml2/libxml/uri.h +0 -94
- data/vendor/local/include/libxml2/libxml/valid.h +0 -458
- data/vendor/local/include/libxml2/libxml/xinclude.h +0 -129
- data/vendor/local/include/libxml2/libxml/xlink.h +0 -189
- data/vendor/local/include/libxml2/libxml/xmlIO.h +0 -366
- data/vendor/local/include/libxml2/libxml/xmlautomata.h +0 -146
- data/vendor/local/include/libxml2/libxml/xmlerror.h +0 -944
- data/vendor/local/include/libxml2/libxml/xmlexports.h +0 -162
- data/vendor/local/include/libxml2/libxml/xmlmemory.h +0 -224
- data/vendor/local/include/libxml2/libxml/xmlmodule.h +0 -57
- data/vendor/local/include/libxml2/libxml/xmlreader.h +0 -428
- data/vendor/local/include/libxml2/libxml/xmlregexp.h +0 -222
- data/vendor/local/include/libxml2/libxml/xmlsave.h +0 -88
- data/vendor/local/include/libxml2/libxml/xmlschemas.h +0 -246
- data/vendor/local/include/libxml2/libxml/xmlschemastypes.h +0 -151
- data/vendor/local/include/libxml2/libxml/xmlstring.h +0 -140
- data/vendor/local/include/libxml2/libxml/xmlunicode.h +0 -202
- data/vendor/local/include/libxml2/libxml/xmlversion.h +0 -480
- data/vendor/local/include/libxml2/libxml/xmlwriter.h +0 -488
- data/vendor/local/include/libxml2/libxml/xpath.h +0 -550
- data/vendor/local/include/libxml2/libxml/xpathInternals.h +0 -632
- data/vendor/local/include/libxml2/libxml/xpointer.h +0 -114
- data/vendor/local/lib/libxml2.def +0 -1659
- 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 +0 -13
- data/vendor/local/manifest/libcroco-dev_0.6.2-1_win32.mft +0 -36
- data/vendor/local/manifest/libcroco_0.6.2-1_win32.mft +0 -2
- data/vendor/local/manifest/librsvg-dev_2.32.1-1_win32.mft +0 -11
- data/vendor/local/manifest/librsvg_2.32.1-1_win32.mft +0 -2
- data/vendor/local/manifest/libxml2-dev_2.9.0-1_win32.mft +0 -268
- data/vendor/local/manifest/libxml2_2.9.0-1_win32.mft +0 -2
- data/vendor/local/share/aclocal/libxml.m4 +0 -188
- data/vendor/local/share/doc/libxml2-2.9.0/Copyright +0 -27
- data/vendor/local/share/doc/libxml2-2.9.0/examples/testHTML.c +0 -880
- data/vendor/local/share/doc/libxml2-2.9.0/examples/testSAX.c +0 -1198
- data/vendor/local/share/doc/libxml2-2.9.0/examples/testXPath.c +0 -229
- data/vendor/local/share/doc/libxml2-2.9.0/examples/xmllint.c +0 -3770
- 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 +0 -282
- 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 +0 -207
- data/vendor/local/share/doc/libxml2-2.9.0/html/examples.xml +0 -751
- data/vendor/local/share/doc/libxml2-2.9.0/html/examples.xsl +0 -174
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/book1.html +0 -13
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/index.html +0 -13
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-DOCBparser.html +0 -51
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-HTMLparser.html +0 -184
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-HTMLtree.html +0 -73
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-SAX.html +0 -125
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-SAX2.html +0 -128
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-c14n.html +0 -38
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-catalog.html +0 -142
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-chvalid.html +0 -72
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-debugXML.html +0 -120
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-dict.html +0 -58
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-encoding.html +0 -124
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-entities.html +0 -79
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-globals.html +0 -152
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-hash.html +0 -116
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-lib.html +0 -13
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-list.html +0 -120
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-nanoftp.html +0 -94
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-nanohttp.html +0 -65
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-parser.html +0 -559
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-parserInternals.html +0 -322
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-pattern.html +0 -76
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-relaxng.html +0 -162
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-schemasInternals.html +0 -373
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-schematron.html +0 -81
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-threads.html +0 -72
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-tree.html +0 -989
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-uri.html +0 -73
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-valid.html +0 -289
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xinclude.html +0 -59
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xlink.html +0 -82
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlIO.html +0 -212
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlautomata.html +0 -85
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlerror.html +0 -864
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlexports.html +0 -20
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlmemory.html +0 -107
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlmodule.html +0 -38
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlreader.html +0 -330
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlregexp.html +0 -143
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlsave.html +0 -60
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlschemas.html +0 -185
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlschemastypes.html +0 -123
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlstring.html +0 -108
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlunicode.html +0 -512
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlversion.html +0 -62
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xmlwriter.html +0 -261
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpath.html +0 -310
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpathInternals.html +0 -394
- data/vendor/local/share/doc/libxml2-2.9.0/html/html/libxml-xpointer.html +0 -83
- data/vendor/local/share/doc/libxml2-2.9.0/html/index.html +0 -14
- data/vendor/local/share/doc/libxml2-2.9.0/html/io1.c +0 -166
- data/vendor/local/share/doc/libxml2-2.9.0/html/io1.res +0 -5
- data/vendor/local/share/doc/libxml2-2.9.0/html/io2.c +0 -58
- data/vendor/local/share/doc/libxml2-2.9.0/html/io2.res +0 -2
- 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 +0 -56
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse2.c +0 -72
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse3.c +0 -60
- data/vendor/local/share/doc/libxml2-2.9.0/html/parse4.c +0 -143
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader1.c +0 -107
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader1.res +0 -14
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader2.c +0 -122
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader3.c +0 -120
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader3.res +0 -13
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader4.c +0 -122
- data/vendor/local/share/doc/libxml2-2.9.0/html/reader4.res +0 -3
- 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 +0 -1
- data/vendor/local/share/doc/libxml2-2.9.0/html/test2.xml +0 -13
- data/vendor/local/share/doc/libxml2-2.9.0/html/test3.xml +0 -39
- data/vendor/local/share/doc/libxml2-2.9.0/html/testWriter.c +0 -1198
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree1.c +0 -94
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree1.res +0 -4
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree2.c +0 -118
- data/vendor/local/share/doc/libxml2-2.9.0/html/tree2.res +0 -18
- data/vendor/local/share/doc/libxml2-2.9.0/html/tst.xml +0 -7
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apa.html +0 -8
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apb.html +0 -14
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apc.html +0 -82
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apd.html +0 -76
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ape.html +0 -78
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apf.html +0 -67
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/apg.html +0 -75
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/aph.html +0 -76
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/api.html +0 -4
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s02.html +0 -14
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s03.html +0 -47
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s04.html +0 -54
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s05.html +0 -55
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s06.html +0 -35
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s07.html +0 -30
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s08.html +0 -38
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ar01s09.html +0 -63
- 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 +0 -64
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeaddkeyword.c +0 -75
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includeconvert.c +0 -73
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includegetattribute.c +0 -72
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includekeyword.c +0 -79
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/includexpath.c +0 -74
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/index.html +0 -14
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/ix01.html +0 -1
- data/vendor/local/share/doc/libxml2-2.9.0/html/tutorial/xmltutorial.pdf +0 -1336
- 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 +0 -2
- data/vendor/local/share/doc/libxml2-2.9.0/html/xml.html +0 -5715
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath1.c +0 -250
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath1.res +0 -5
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath2.c +0 -190
- data/vendor/local/share/doc/libxml2-2.9.0/html/xpath2.res +0 -30
- data/vendor/local/share/gtk-doc/html/libxml2/general.html +0 -38
- data/vendor/local/share/gtk-doc/html/libxml2/index.html +0 -67
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-DOCBparser.html +0 -138
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-HTMLparser.html +0 -373
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-HTMLtree.html +0 -172
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-SAX.html +0 -243
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-SAX2.html +0 -247
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-c14n.html +0 -91
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-catalog.html +0 -278
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-chvalid.html +0 -241
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-debugXML.html +0 -225
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-dict.html +0 -134
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-encoding.html +0 -218
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-entities.html +0 -166
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-globals.html +0 -383
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-hash.html +0 -214
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-list.html +0 -226
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-nanoftp.html +0 -187
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-nanohttp.html +0 -142
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parser.html +0 -766
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-parserInternals.html +0 -688
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-pattern.html +0 -166
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-relaxng.html +0 -278
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-schemasInternals.html +0 -860
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-schematron.html +0 -166
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-threads.html +0 -161
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-tree.html +0 -1596
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-uri.html +0 -154
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-valid.html +0 -528
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xinclude.html +0 -169
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xlink.html +0 -160
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlIO.html +0 -347
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlautomata.html +0 -176
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlerror.html +0 -952
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlexports.html +0 -87
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlmemory.html +0 -186
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlmodule.html +0 -97
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlreader.html +0 -565
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlregexp.html +0 -280
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlsave.html +0 -133
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlschemas.html +0 -314
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlschemastypes.html +0 -237
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlstring.html +0 -217
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlunicode.html +0 -887
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlversion.html +0 -287
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xmlwriter.html +0 -479
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpath.html +0 -532
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpathInternals.html +0 -787
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2-xpointer.html +0 -171
- data/vendor/local/share/gtk-doc/html/libxml2/libxml2.devhelp +0 -3569
- data/vendor/local/share/gtk-doc/html/libxml2/style.css +0 -66
- data/vendor/local/share/man/man1/xml2-config.1 +0 -30
- data/vendor/local/share/man/man1/xmlcatalog.1 +0 -340
- data/vendor/local/share/man/man1/xmllint.1 +0 -427
- data/vendor/local/share/man/man3/libxml.3 +0 -71
- data/vendor/local/src/dieterv/packaging/libxml2_2.9.0-1_win32.log +0 -867
- data/vendor/local/src/dieterv/packaging/libxml2_2.9.0-1_win32.sh +0 -68
- data/vendor/local/src/tml/packaging/libcroco_0.6.2-1_win32.log +0 -471
- data/vendor/local/src/tml/packaging/libcroco_0.6.2-1_win32.sh +0 -61
- data/vendor/local/src/tml/packaging/librsvg_2.32.1-1_win32.log +0 -535
- data/vendor/local/src/tml/packaging/librsvg_2.32.1-1_win32.sh +0 -125
@@ -1,250 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: XPath
|
3
|
-
* synopsis: Evaluate XPath expression and prints result node set.
|
4
|
-
* purpose: Shows how to evaluate XPath expression and register
|
5
|
-
* known namespaces in XPath context.
|
6
|
-
* usage: xpath1 <xml-file> <xpath-expr> [<known-ns-list>]
|
7
|
-
* test: xpath1 test3.xml '//child2' > xpath1.tmp && diff xpath1.tmp $(srcdir)/xpath1.res
|
8
|
-
* author: Aleksey Sanin
|
9
|
-
* copy: see Copyright for the status of this software.
|
10
|
-
*/
|
11
|
-
#include <stdlib.h>
|
12
|
-
#include <stdio.h>
|
13
|
-
#include <string.h>
|
14
|
-
#include <assert.h>
|
15
|
-
|
16
|
-
#include <libxml/tree.h>
|
17
|
-
#include <libxml/parser.h>
|
18
|
-
#include <libxml/xpath.h>
|
19
|
-
#include <libxml/xpathInternals.h>
|
20
|
-
|
21
|
-
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_SAX1_ENABLED)
|
22
|
-
|
23
|
-
|
24
|
-
static void usage(const char *name);
|
25
|
-
int execute_xpath_expression(const char* filename, const xmlChar* xpathExpr, const xmlChar* nsList);
|
26
|
-
int register_namespaces(xmlXPathContextPtr xpathCtx, const xmlChar* nsList);
|
27
|
-
void print_xpath_nodes(xmlNodeSetPtr nodes, FILE* output);
|
28
|
-
|
29
|
-
int
|
30
|
-
main(int argc, char **argv) {
|
31
|
-
/* Parse command line and process file */
|
32
|
-
if((argc < 3) || (argc > 4)) {
|
33
|
-
fprintf(stderr, "Error: wrong number of arguments.\n");
|
34
|
-
usage(argv[0]);
|
35
|
-
return(-1);
|
36
|
-
}
|
37
|
-
|
38
|
-
/* Init libxml */
|
39
|
-
xmlInitParser();
|
40
|
-
LIBXML_TEST_VERSION
|
41
|
-
|
42
|
-
/* Do the main job */
|
43
|
-
if(execute_xpath_expression(argv[1], BAD_CAST argv[2], (argc > 3) ? BAD_CAST argv[3] : NULL) < 0) {
|
44
|
-
usage(argv[0]);
|
45
|
-
return(-1);
|
46
|
-
}
|
47
|
-
|
48
|
-
/* Shutdown libxml */
|
49
|
-
xmlCleanupParser();
|
50
|
-
|
51
|
-
/*
|
52
|
-
* this is to debug memory for regression tests
|
53
|
-
*/
|
54
|
-
xmlMemoryDump();
|
55
|
-
return 0;
|
56
|
-
}
|
57
|
-
|
58
|
-
/**
|
59
|
-
* usage:
|
60
|
-
* @name: the program name.
|
61
|
-
*
|
62
|
-
* Prints usage information.
|
63
|
-
*/
|
64
|
-
static void
|
65
|
-
usage(const char *name) {
|
66
|
-
assert(name);
|
67
|
-
|
68
|
-
fprintf(stderr, "Usage: %s <xml-file> <xpath-expr> [<known-ns-list>]\n", name);
|
69
|
-
fprintf(stderr, "where <known-ns-list> is a list of known namespaces\n");
|
70
|
-
fprintf(stderr, "in \"<prefix1>=<href1> <prefix2>=href2> ...\" format\n");
|
71
|
-
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* execute_xpath_expression:
|
75
|
-
* @filename: the input XML filename.
|
76
|
-
* @xpathExpr: the xpath expression for evaluation.
|
77
|
-
* @nsList: the optional list of known namespaces in
|
78
|
-
* "<prefix1>=<href1> <prefix2>=href2> ..." format.
|
79
|
-
*
|
80
|
-
* Parses input XML file, evaluates XPath expression and prints results.
|
81
|
-
*
|
82
|
-
* Returns 0 on success and a negative value otherwise.
|
83
|
-
*/
|
84
|
-
int
|
85
|
-
execute_xpath_expression(const char* filename, const xmlChar* xpathExpr, const xmlChar* nsList) {
|
86
|
-
xmlDocPtr doc;
|
87
|
-
xmlXPathContextPtr xpathCtx;
|
88
|
-
xmlXPathObjectPtr xpathObj;
|
89
|
-
|
90
|
-
assert(filename);
|
91
|
-
assert(xpathExpr);
|
92
|
-
|
93
|
-
/* Load XML document */
|
94
|
-
doc = xmlParseFile(filename);
|
95
|
-
if (doc == NULL) {
|
96
|
-
fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename);
|
97
|
-
return(-1);
|
98
|
-
}
|
99
|
-
|
100
|
-
/* Create xpath evaluation context */
|
101
|
-
xpathCtx = xmlXPathNewContext(doc);
|
102
|
-
if(xpathCtx == NULL) {
|
103
|
-
fprintf(stderr,"Error: unable to create new XPath context\n");
|
104
|
-
xmlFreeDoc(doc);
|
105
|
-
return(-1);
|
106
|
-
}
|
107
|
-
|
108
|
-
/* Register namespaces from list (if any) */
|
109
|
-
if((nsList != NULL) && (register_namespaces(xpathCtx, nsList) < 0)) {
|
110
|
-
fprintf(stderr,"Error: failed to register namespaces list \"%s\"\n", nsList);
|
111
|
-
xmlXPathFreeContext(xpathCtx);
|
112
|
-
xmlFreeDoc(doc);
|
113
|
-
return(-1);
|
114
|
-
}
|
115
|
-
|
116
|
-
/* Evaluate xpath expression */
|
117
|
-
xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx);
|
118
|
-
if(xpathObj == NULL) {
|
119
|
-
fprintf(stderr,"Error: unable to evaluate xpath expression \"%s\"\n", xpathExpr);
|
120
|
-
xmlXPathFreeContext(xpathCtx);
|
121
|
-
xmlFreeDoc(doc);
|
122
|
-
return(-1);
|
123
|
-
}
|
124
|
-
|
125
|
-
/* Print results */
|
126
|
-
print_xpath_nodes(xpathObj->nodesetval, stdout);
|
127
|
-
|
128
|
-
/* Cleanup */
|
129
|
-
xmlXPathFreeObject(xpathObj);
|
130
|
-
xmlXPathFreeContext(xpathCtx);
|
131
|
-
xmlFreeDoc(doc);
|
132
|
-
|
133
|
-
return(0);
|
134
|
-
}
|
135
|
-
|
136
|
-
/**
|
137
|
-
* register_namespaces:
|
138
|
-
* @xpathCtx: the pointer to an XPath context.
|
139
|
-
* @nsList: the list of known namespaces in
|
140
|
-
* "<prefix1>=<href1> <prefix2>=href2> ..." format.
|
141
|
-
*
|
142
|
-
* Registers namespaces from @nsList in @xpathCtx.
|
143
|
-
*
|
144
|
-
* Returns 0 on success and a negative value otherwise.
|
145
|
-
*/
|
146
|
-
int
|
147
|
-
register_namespaces(xmlXPathContextPtr xpathCtx, const xmlChar* nsList) {
|
148
|
-
xmlChar* nsListDup;
|
149
|
-
xmlChar* prefix;
|
150
|
-
xmlChar* href;
|
151
|
-
xmlChar* next;
|
152
|
-
|
153
|
-
assert(xpathCtx);
|
154
|
-
assert(nsList);
|
155
|
-
|
156
|
-
nsListDup = xmlStrdup(nsList);
|
157
|
-
if(nsListDup == NULL) {
|
158
|
-
fprintf(stderr, "Error: unable to strdup namespaces list\n");
|
159
|
-
return(-1);
|
160
|
-
}
|
161
|
-
|
162
|
-
next = nsListDup;
|
163
|
-
while(next != NULL) {
|
164
|
-
/* skip spaces */
|
165
|
-
while((*next) == ' ') next++;
|
166
|
-
if((*next) == '\0') break;
|
167
|
-
|
168
|
-
/* find prefix */
|
169
|
-
prefix = next;
|
170
|
-
next = (xmlChar*)xmlStrchr(next, '=');
|
171
|
-
if(next == NULL) {
|
172
|
-
fprintf(stderr,"Error: invalid namespaces list format\n");
|
173
|
-
xmlFree(nsListDup);
|
174
|
-
return(-1);
|
175
|
-
}
|
176
|
-
*(next++) = '\0';
|
177
|
-
|
178
|
-
/* find href */
|
179
|
-
href = next;
|
180
|
-
next = (xmlChar*)xmlStrchr(next, ' ');
|
181
|
-
if(next != NULL) {
|
182
|
-
*(next++) = '\0';
|
183
|
-
}
|
184
|
-
|
185
|
-
/* do register namespace */
|
186
|
-
if(xmlXPathRegisterNs(xpathCtx, prefix, href) != 0) {
|
187
|
-
fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", prefix, href);
|
188
|
-
xmlFree(nsListDup);
|
189
|
-
return(-1);
|
190
|
-
}
|
191
|
-
}
|
192
|
-
|
193
|
-
xmlFree(nsListDup);
|
194
|
-
return(0);
|
195
|
-
}
|
196
|
-
|
197
|
-
/**
|
198
|
-
* print_xpath_nodes:
|
199
|
-
* @nodes: the nodes set.
|
200
|
-
* @output: the output file handle.
|
201
|
-
*
|
202
|
-
* Prints the @nodes content to @output.
|
203
|
-
*/
|
204
|
-
void
|
205
|
-
print_xpath_nodes(xmlNodeSetPtr nodes, FILE* output) {
|
206
|
-
xmlNodePtr cur;
|
207
|
-
int size;
|
208
|
-
int i;
|
209
|
-
|
210
|
-
assert(output);
|
211
|
-
size = (nodes) ? nodes->nodeNr : 0;
|
212
|
-
|
213
|
-
fprintf(output, "Result (%d nodes):\n", size);
|
214
|
-
for(i = 0; i < size; ++i) {
|
215
|
-
assert(nodes->nodeTab[i]);
|
216
|
-
|
217
|
-
if(nodes->nodeTab[i]->type == XML_NAMESPACE_DECL) {
|
218
|
-
xmlNsPtr ns;
|
219
|
-
|
220
|
-
ns = (xmlNsPtr)nodes->nodeTab[i];
|
221
|
-
cur = (xmlNodePtr)ns->next;
|
222
|
-
if(cur->ns) {
|
223
|
-
fprintf(output, "= namespace \"%s\"=\"%s\" for node %s:%s\n",
|
224
|
-
ns->prefix, ns->href, cur->ns->href, cur->name);
|
225
|
-
} else {
|
226
|
-
fprintf(output, "= namespace \"%s\"=\"%s\" for node %s\n",
|
227
|
-
ns->prefix, ns->href, cur->name);
|
228
|
-
}
|
229
|
-
} else if(nodes->nodeTab[i]->type == XML_ELEMENT_NODE) {
|
230
|
-
cur = nodes->nodeTab[i];
|
231
|
-
if(cur->ns) {
|
232
|
-
fprintf(output, "= element node \"%s:%s\"\n",
|
233
|
-
cur->ns->href, cur->name);
|
234
|
-
} else {
|
235
|
-
fprintf(output, "= element node \"%s\"\n",
|
236
|
-
cur->name);
|
237
|
-
}
|
238
|
-
} else {
|
239
|
-
cur = nodes->nodeTab[i];
|
240
|
-
fprintf(output, "= node \"%s\": type %d\n", cur->name, cur->type);
|
241
|
-
}
|
242
|
-
}
|
243
|
-
}
|
244
|
-
|
245
|
-
#else
|
246
|
-
int main(void) {
|
247
|
-
fprintf(stderr, "XPath support not compiled in\n");
|
248
|
-
exit(1);
|
249
|
-
}
|
250
|
-
#endif
|
@@ -1,190 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* section: XPath
|
3
|
-
* synopsis: Load a document, locate subelements with XPath, modify
|
4
|
-
* said elements and save the resulting document.
|
5
|
-
* purpose: Shows how to make a full round-trip from a load/edit/save
|
6
|
-
* usage: xpath2 <xml-file> <xpath-expr> <new-value>
|
7
|
-
* test: xpath2 test3.xml '//discarded' discarded > xpath2.tmp && diff xpath2.tmp $(srcdir)/xpath2.res
|
8
|
-
* author: Aleksey Sanin and Daniel Veillard
|
9
|
-
* copy: see Copyright for the status of this software.
|
10
|
-
*/
|
11
|
-
#include <stdlib.h>
|
12
|
-
#include <stdio.h>
|
13
|
-
#include <string.h>
|
14
|
-
#include <assert.h>
|
15
|
-
|
16
|
-
#include <libxml/tree.h>
|
17
|
-
#include <libxml/parser.h>
|
18
|
-
#include <libxml/xpath.h>
|
19
|
-
#include <libxml/xpathInternals.h>
|
20
|
-
|
21
|
-
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_SAX1_ENABLED) && \
|
22
|
-
defined(LIBXML_OUTPUT_ENABLED)
|
23
|
-
|
24
|
-
|
25
|
-
static void usage(const char *name);
|
26
|
-
static int example4(const char *filename, const xmlChar * xpathExpr,
|
27
|
-
const xmlChar * value);
|
28
|
-
static void update_xpath_nodes(xmlNodeSetPtr nodes, const xmlChar * value);
|
29
|
-
|
30
|
-
|
31
|
-
int
|
32
|
-
main(int argc, char **argv) {
|
33
|
-
/* Parse command line and process file */
|
34
|
-
if (argc != 4) {
|
35
|
-
fprintf(stderr, "Error: wrong number of arguments.\n");
|
36
|
-
usage(argv[0]);
|
37
|
-
return(-1);
|
38
|
-
}
|
39
|
-
|
40
|
-
/* Init libxml */
|
41
|
-
xmlInitParser();
|
42
|
-
LIBXML_TEST_VERSION
|
43
|
-
|
44
|
-
/* Do the main job */
|
45
|
-
if (example4(argv[1], BAD_CAST argv[2], BAD_CAST argv[3])) {
|
46
|
-
usage(argv[0]);
|
47
|
-
return(-1);
|
48
|
-
}
|
49
|
-
|
50
|
-
/* Shutdown libxml */
|
51
|
-
xmlCleanupParser();
|
52
|
-
|
53
|
-
/*
|
54
|
-
* this is to debug memory for regression tests
|
55
|
-
*/
|
56
|
-
xmlMemoryDump();
|
57
|
-
return 0;
|
58
|
-
}
|
59
|
-
|
60
|
-
/**
|
61
|
-
* usage:
|
62
|
-
* @name: the program name.
|
63
|
-
*
|
64
|
-
* Prints usage information.
|
65
|
-
*/
|
66
|
-
static void
|
67
|
-
usage(const char *name) {
|
68
|
-
assert(name);
|
69
|
-
|
70
|
-
fprintf(stderr, "Usage: %s <xml-file> <xpath-expr> <value>\n", name);
|
71
|
-
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* example4:
|
75
|
-
* @filename: the input XML filename.
|
76
|
-
* @xpathExpr: the xpath expression for evaluation.
|
77
|
-
* @value: the new node content.
|
78
|
-
*
|
79
|
-
* Parses input XML file, evaluates XPath expression and update the nodes
|
80
|
-
* then print the result.
|
81
|
-
*
|
82
|
-
* Returns 0 on success and a negative value otherwise.
|
83
|
-
*/
|
84
|
-
static int
|
85
|
-
example4(const char* filename, const xmlChar* xpathExpr, const xmlChar* value) {
|
86
|
-
xmlDocPtr doc;
|
87
|
-
xmlXPathContextPtr xpathCtx;
|
88
|
-
xmlXPathObjectPtr xpathObj;
|
89
|
-
|
90
|
-
assert(filename);
|
91
|
-
assert(xpathExpr);
|
92
|
-
assert(value);
|
93
|
-
|
94
|
-
/* Load XML document */
|
95
|
-
doc = xmlParseFile(filename);
|
96
|
-
if (doc == NULL) {
|
97
|
-
fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename);
|
98
|
-
return(-1);
|
99
|
-
}
|
100
|
-
|
101
|
-
/* Create xpath evaluation context */
|
102
|
-
xpathCtx = xmlXPathNewContext(doc);
|
103
|
-
if(xpathCtx == NULL) {
|
104
|
-
fprintf(stderr,"Error: unable to create new XPath context\n");
|
105
|
-
xmlFreeDoc(doc);
|
106
|
-
return(-1);
|
107
|
-
}
|
108
|
-
|
109
|
-
/* Evaluate xpath expression */
|
110
|
-
xpathObj = xmlXPathEvalExpression(xpathExpr, xpathCtx);
|
111
|
-
if(xpathObj == NULL) {
|
112
|
-
fprintf(stderr,"Error: unable to evaluate xpath expression \"%s\"\n", xpathExpr);
|
113
|
-
xmlXPathFreeContext(xpathCtx);
|
114
|
-
xmlFreeDoc(doc);
|
115
|
-
return(-1);
|
116
|
-
}
|
117
|
-
|
118
|
-
/* update selected nodes */
|
119
|
-
update_xpath_nodes(xpathObj->nodesetval, value);
|
120
|
-
|
121
|
-
|
122
|
-
/* Cleanup of XPath data */
|
123
|
-
xmlXPathFreeObject(xpathObj);
|
124
|
-
xmlXPathFreeContext(xpathCtx);
|
125
|
-
|
126
|
-
/* dump the resulting document */
|
127
|
-
xmlDocDump(stdout, doc);
|
128
|
-
|
129
|
-
|
130
|
-
/* free the document */
|
131
|
-
xmlFreeDoc(doc);
|
132
|
-
|
133
|
-
return(0);
|
134
|
-
}
|
135
|
-
|
136
|
-
/**
|
137
|
-
* update_xpath_nodes:
|
138
|
-
* @nodes: the nodes set.
|
139
|
-
* @value: the new value for the node(s)
|
140
|
-
*
|
141
|
-
* Prints the @nodes content to @output.
|
142
|
-
*/
|
143
|
-
static void
|
144
|
-
update_xpath_nodes(xmlNodeSetPtr nodes, const xmlChar* value) {
|
145
|
-
int size;
|
146
|
-
int i;
|
147
|
-
|
148
|
-
assert(value);
|
149
|
-
size = (nodes) ? nodes->nodeNr : 0;
|
150
|
-
|
151
|
-
/*
|
152
|
-
* NOTE: the nodes are processed in reverse order, i.e. reverse document
|
153
|
-
* order because xmlNodeSetContent can actually free up descendant
|
154
|
-
* of the node and such nodes may have been selected too ! Handling
|
155
|
-
* in reverse order ensure that descendant are accessed first, before
|
156
|
-
* they get removed. Mixing XPath and modifications on a tree must be
|
157
|
-
* done carefully !
|
158
|
-
*/
|
159
|
-
for(i = size - 1; i >= 0; i--) {
|
160
|
-
assert(nodes->nodeTab[i]);
|
161
|
-
|
162
|
-
xmlNodeSetContent(nodes->nodeTab[i], value);
|
163
|
-
/*
|
164
|
-
* All the elements returned by an XPath query are pointers to
|
165
|
-
* elements from the tree *except* namespace nodes where the XPath
|
166
|
-
* semantic is different from the implementation in libxml2 tree.
|
167
|
-
* As a result when a returned node set is freed when
|
168
|
-
* xmlXPathFreeObject() is called, that routine must check the
|
169
|
-
* element type. But node from the returned set may have been removed
|
170
|
-
* by xmlNodeSetContent() resulting in access to freed data.
|
171
|
-
* This can be exercised by running
|
172
|
-
* valgrind xpath2 test3.xml '//discarded' discarded
|
173
|
-
* There is 2 ways around it:
|
174
|
-
* - make a copy of the pointers to the nodes from the result set
|
175
|
-
* then call xmlXPathFreeObject() and then modify the nodes
|
176
|
-
* or
|
177
|
-
* - remove the reference to the modified nodes from the node set
|
178
|
-
* as they are processed, if they are not namespace nodes.
|
179
|
-
*/
|
180
|
-
if (nodes->nodeTab[i]->type != XML_NAMESPACE_DECL)
|
181
|
-
nodes->nodeTab[i] = NULL;
|
182
|
-
}
|
183
|
-
}
|
184
|
-
|
185
|
-
#else
|
186
|
-
int main(void) {
|
187
|
-
fprintf(stderr, "XPath support not compiled in\n");
|
188
|
-
exit(1);
|
189
|
-
}
|
190
|
-
#endif
|
@@ -1,30 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
<doc>
|
3
|
-
<parent>
|
4
|
-
<discarded>discarded</discarded>
|
5
|
-
<preserved/>
|
6
|
-
This text node must be discarded
|
7
|
-
<discarded>discarded</discarded>
|
8
|
-
<preserved>
|
9
|
-
content1
|
10
|
-
<child1/>
|
11
|
-
<child2>content2</child2>
|
12
|
-
<preserved>too</preserved>
|
13
|
-
<child2>content3</child2>
|
14
|
-
<preserved/>
|
15
|
-
<child2>content4</child2>
|
16
|
-
<preserved/>
|
17
|
-
<child2>content5</child2>
|
18
|
-
content6
|
19
|
-
</preserved>
|
20
|
-
This text node must be discarded
|
21
|
-
<discarded>discarded</discarded>
|
22
|
-
This text node must be discarded
|
23
|
-
<preserved/>
|
24
|
-
This text node must be discarded
|
25
|
-
<preserved/>
|
26
|
-
This text node must be discarded
|
27
|
-
<discarded>discarded</discarded>
|
28
|
-
This text node must be discarded
|
29
|
-
</parent>
|
30
|
-
</doc>
|