# PaCkAgE DaTaStReAm
libxml2 1 32682
# end of header
0707010002b1b0000081a40000000000000000000000014cb7d88c000000ff000000b500010002ffffffffffffffff0000001000000000libxml2/pkginfo PKG=libxml2
NAME=libxml2 2.7.7 i86pc Solaris 10
VERSION=2.7.7
PSTAMP=15th October 2010
VENDOR=Daniel Veillard
EMAIL=http://xmlsoft.org/downloads.html
DESC=XML C library
ARCH=i386
CATEGORY=utility
CLASSES=none
BASEDIR=/
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
0707010002b1af000081a40000000000000000000000014cb7d88c00006fb3000000b500010002ffffffffffffffff0000000f00000000libxml2/pkgmap : 1 32682
1 d none /usr ? ? ?
1 d none /usr/local ? ? ?
1 d none /usr/local/bin 0755 root root
1 f none /usr/local/bin/xml2-config 0755 root root 1980 21608 1287116933
1 f none /usr/local/bin/xmlcatalog 0755 root root 27840 34685 1287116933
1 f none /usr/local/bin/xmllint 0755 root root 135492 39209 1287116933
1 d none /usr/local/include 0755 root root
1 d none /usr/local/include/libxml2 0755 root root
1 d none /usr/local/include/libxml2/libxml 0755 root root
1 f none /usr/local/include/libxml2/libxml/DOCBparser.h 0644 root root 3277 26997 1287116932
1 f none /usr/local/include/libxml2/libxml/HTMLparser.h 0644 root root 9296 21688 1287116932
1 f none /usr/local/include/libxml2/libxml/HTMLtree.h 0644 root root 3685 24202 1287116932
1 f none /usr/local/include/libxml2/libxml/SAX.h 0644 root root 4412 254 1287116932
1 f none /usr/local/include/libxml2/libxml/SAX2.h 0644 root root 4944 47206 1287116932
1 f none /usr/local/include/libxml2/libxml/c14n.h 0644 root root 3110 45713 1287116932
1 f none /usr/local/include/libxml2/libxml/catalog.h 0644 root root 4958 62701 1287116932
1 f none /usr/local/include/libxml2/libxml/chvalid.h 0644 root root 5159 6441 1287116932
1 f none /usr/local/include/libxml2/libxml/debugXML.h 0644 root root 5181 58739 1287116932
1 f none /usr/local/include/libxml2/libxml/dict.h 0644 root root 1582 54062 1287116932
1 f none /usr/local/include/libxml2/libxml/encoding.h 0644 root root 7931 33159 1287116932
1 f none /usr/local/include/libxml2/libxml/entities.h 0644 root root 4672 34987 1287116932
1 f none /usr/local/include/libxml2/libxml/globals.h 0644 root root 14651 41700 1287116932
1 f none /usr/local/include/libxml2/libxml/hash.h 0644 root root 6567 40118 1287116932
1 f none /usr/local/include/libxml2/libxml/list.h 0644 root root 3422 9290 1287116932
1 f none /usr/local/include/libxml2/libxml/nanoftp.h 0644 root root 3347 65046 1287116932
1 f none /usr/local/include/libxml2/libxml/nanohttp.h 0644 root root 2018 25405 1287116932
1 f none /usr/local/include/libxml2/libxml/parser.h 0644 root root 39556 20438 1287116932
1 f none /usr/local/include/libxml2/libxml/parserInternals.h 0644 root root 16573 38289 1287116932
1 f none /usr/local/include/libxml2/libxml/pattern.h 0644 root root 2586 14250 1287116932
1 f none /usr/local/include/libxml2/libxml/relaxng.h 0644 root root 5958 14236 1287116932
1 f none /usr/local/include/libxml2/libxml/schemasInternals.h 0644 root root 26023 46943 1287116932
1 f none /usr/local/include/libxml2/libxml/schematron.h 0644 root root 4393 38715 1287116932
1 f none /usr/local/include/libxml2/libxml/threads.h 0644 root root 1852 22060 1287116932
1 f none /usr/local/include/libxml2/libxml/tree.h 0644 root root 36628 28341 1287116932
1 f none /usr/local/include/libxml2/libxml/uri.h 0644 root root 2664 14130 1287116932
1 f none /usr/local/include/libxml2/libxml/valid.h 0644 root root 13818 42837 1287116932
1 f none /usr/local/include/libxml2/libxml/xinclude.h 0644 root root 2967 33993 1287116932
1 f none /usr/local/include/libxml2/libxml/xlink.h 0644 root root 5051 29979 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlIO.h 0644 root root 10448 54431 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlautomata.h 0644 root root 3992 52088 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlerror.h 0644 root root 36676 39870 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlexports.h 0644 root root 3914 45768 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlmemory.h 0644 root root 5945 32295 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlmodule.h 0644 root root 1171 28508 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlreader.h 0644 root root 12551 25798 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlregexp.h 0644 root root 5458 46433 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlsave.h 0644 root root 2260 49170 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlschemas.h 0644 root root 6202 44970 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlschemastypes.h 0644 root root 4893 2118 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlstring.h 0644 root root 5472 10623 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlunicode.h 0644 root root 9993 44615 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlversion.h 0644 root root 7636 59172 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlwriter.h 0644 root root 21159 10920 1287116932
1 f none /usr/local/include/libxml2/libxml/xpath.h 0644 root root 16199 42789 1287116932
1 f none /usr/local/include/libxml2/libxml/xpathInternals.h 0644 root root 19448 19089 1287116932
1 f none /usr/local/include/libxml2/libxml/xpointer.h 0644 root root 3411 12454 1287116932
1 d none /usr/local/lib 0755 root root
1 f none /usr/local/lib/libxml2.a 0644 root root 4797692 20086 1287116932
1 f none /usr/local/lib/libxml2.la 0755 root root 1014 23283 1287116932
1 s none /usr/local/lib/libxml2.so=libxml2.so.2.7.7
1 s none /usr/local/lib/libxml2.so.2=libxml2.so.2.7.7
1 f none /usr/local/lib/libxml2.so.2.7.7 0755 root root 4089284 4979 1287116932
1 d none /usr/local/lib/pkgconfig 0755 root root
1 f none /usr/local/lib/pkgconfig/libxml-2.0.pc 0644 root root 369 32976 1287116933
1 f none /usr/local/lib/xml2Conf.sh 0644 root root 330 27338 1287116933
1 d none /usr/local/share 0755 root root
1 d none /usr/local/share/aclocal 0755 root root
1 f none /usr/local/share/aclocal/libxml.m4 0644 root root 7880 31344 1287116933
1 d none /usr/local/share/doc 0755 root root
1 d none /usr/local/share/doc/libxml2-2.7.7 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/Copyright 0644 root root 1498 60471 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/examples 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/testHTML.c 0644 root root 21178 11625 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/testSAX.c 0644 root root 27618 44379 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/testXPath.c 0644 root root 5900 8360 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/xmllint.c 0644 root root 96991 8100 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/DOM.gif 0644 root root 3166 16454 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/FAQ.html 0644 root root 21086 20502 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-180x168.gif 0644 root root 8195 18372 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-90x34.gif 0644 root root 3070 5797 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/encoding.html 0644 root root 19332 45298 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/examples.xml 0644 root root 32143 64944 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/examples.xsl 0644 root root 7232 22745 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/html 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/book1.html 0644 root root 9645 56651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/home.png 0644 root root 654 8089 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/index.html 0644 root root 9645 56651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/left.png 0644 root root 459 49669 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-DOCBparser.html 0644 root root 20644 9976 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLparser.html 0644 root root 59714 54097 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLtree.html 0644 root root 28620 28841 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX.html 0644 root root 43501 2070 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX2.html 0644 root root 44470 29057 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-c14n.html 0644 root root 18074 34566 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-catalog.html 0644 root root 41039 42872 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-chvalid.html 0644 root root 18442 36279 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-debugXML.html 0644 root root 37931 47824 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-dict.html 0644 root root 15745 47928 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-encoding.html 0644 root root 34231 58628 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-entities.html 0644 root root 27700 56334 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-globals.html 0644 root root 33107 11987 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-hash.html 0644 root root 46558 65082 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-lib.html 0644 root root 9645 56651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-list.html 0644 root root 30126 56146 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-nanoftp.html 0644 root root 26396 22543 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-nanohttp.html 0644 root root 21243 49368 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-parser.html 0644 root root 146100 54015 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-parserInternals.html 0644 root root 120088 15304 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-pattern.html 0644 root root 23692 41744 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-relaxng.html 0644 root root 41021 5883 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-schemasInternals.html 0644 root root 64077 1066 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-schematron.html 0644 root root 21748 25694 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-threads.html 0644 root root 17180 60252 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-tree.html 0644 root root 226158 8499 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-uri.html 0644 root root 22697 58171 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-valid.html 0644 root root 102478 18341 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xinclude.html 0644 root root 19725 885 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xlink.html 0644 root root 21665 29749 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlIO.html 0644 root root 61477 37480 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlautomata.html 0644 root root 39585 3665 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlerror.html 0644 root root 109408 17081 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlexports.html 0644 root root 7610 49486 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmemory.html 0644 root root 29237 40271 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmodule.html 0644 root root 11220 47362 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlreader.html 0644 root root 112604 4431 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlregexp.html 0644 root root 45805 15284 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlsave.html 0644 root root 19182 19763 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemas.html 0644 root root 44179 2731 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemastypes.html 0644 root root 49399 28650 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlstring.html 0644 root root 39315 46149 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlunicode.html 0644 root root 112871 31965 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlversion.html 0644 root root 19720 55141 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlwriter.html 0644 root root 116402 37530 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xpath.html 0644 root root 62165 26014 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xpathInternals.html 0644 root root 142763 55727 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xpointer.html 0644 root root 29887 17355 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/right.png 0644 root root 472 50613 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/up.png 0644 root root 406 41501 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io1.c 0644 root root 3758 32816 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io1.res 0644 root root 165 13941 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io2.c 0644 root root 1187 27049 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io2.res 0644 root root 43 3641 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/libxml.gif 0644 root root 7692 3071 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse1.c 0644 root root 1300 37651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse2.c 0644 root root 1967 26348 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse3.c 0644 root root 1506 55755 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse4.c 0644 root root 3545 15935 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader1.c 0644 root root 2536 438 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader1.res 0644 root root 149 7963 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader2.c 0644 root root 3139 49199 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader3.c 0644 root root 2953 33274 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader3.res 0644 root root 360 28205 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader4.c 0644 root root 3134 48755 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader4.res 0644 root root 72 6501 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/redhat.gif 0644 root root 697 1392 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/smallfootonly.gif 0644 root root 2772 33479 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/structure.gif 0644 root root 5559 10757 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/test1.xml 0644 root root 7 489 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/test2.xml 0644 root root 227 16084 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/test3.xml 0644 root root 833 64269 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/testWriter.c 0644 root root 38443 23535 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree1.c 0644 root root 2249 49217 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree1.res 0644 root root 121 10602 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree2.c 0644 root root 3475 64636 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree2.res 0644 root root 453 34440 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tst.xml 0644 root root 91 7269 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/tutorial 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apa.html 0644 root root 2114 50077 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apb.html 0644 root root 2026 41976 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apc.html 0644 root root 3094 59411 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apd.html 0644 root root 3232 10161 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ape.html 0644 root root 3096 60954 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apf.html 0644 root root 2949 50052 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apg.html 0644 root root 3022 55514 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/aph.html 0644 root root 3600 14216 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/api.html 0644 root root 1899 32299 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s02.html 0644 root root 3298 21719 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s03.html 0644 root root 5718 25593 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s04.html 0644 root root 6223 3967 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s05.html 0644 root root 7422 46605 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s06.html 0644 root root 3849 62759 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s07.html 0644 root root 3866 788 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s08.html 0644 root root 3894 1098 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s09.html 0644 root root 7603 1099 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/blank.png 0644 root root 374 27553 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/1.png 0644 root root 329 26541 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/10.png 0644 root root 361 31046 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/2.png 0644 root root 353 30241 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/3.png 0644 root root 350 30758 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/4.png 0644 root root 345 29927 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/5.png 0644 root root 348 29262 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/6.png 0644 root root 355 31934 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/7.png 0644 root root 344 29378 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/8.png 0644 root root 357 30798 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/9.png 0644 root root 357 30377 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/caution.png 0644 root root 1250 25620 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/draft.png 0644 root root 17454 5031 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/home.png 0644 root root 1156 29224 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/important.png 0644 root root 722 19454 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/next.png 0644 root root 1150 26768 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/note.png 0644 root root 490 47376 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/prev.png 0644 root root 1132 25218 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/tip.png 0644 root root 449 41167 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-blank.png 0644 root root 318 25047 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-minus.png 0644 root root 259 19780 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-plus.png 0644 root root 264 20542 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/up.png 0644 root root 1111 21898 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/warning.png 0644 root root 1241 17822 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddattribute.c 0644 root root 1136 25548 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddkeyword.c 0644 root root 1320 40297 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includeconvert.c 0644 root root 1808 56314 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includegetattribute.c 0644 root root 1171 27155 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includekeyword.c 0644 root root 1351 41532 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includexpath.c 0644 root root 1491 58164 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/index.html 0644 root root 5930 50707 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ix01.html 0644 root root 2545 19990 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/xmltutorial.pdf 0644 root root 51709 26614 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/w3c.png 0644 root root 2028 53965 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/writer.xml 0644 root root 544 42503 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xml.html 0644 root root 249610 1241 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath1.c 0644 root root 6631 749 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath1.res 0644 root root 114 9317 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath2.c 0644 root root 5335 38108 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath2.res 0644 root root 757 60811 1287116933
1 d none /usr/local/share/gtk-doc 0755 root root
1 d none /usr/local/share/gtk-doc/html 0755 root root
1 d none /usr/local/share/gtk-doc/html/libxml2 0755 root root
1 f none /usr/local/share/gtk-doc/html/libxml2/general.html 0644 root root 5459 10614 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/home.png 0644 root root 654 8089 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/index.html 0644 root root 4321 23385 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/left.png 0644 root root 459 49669 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-DOCBparser.html 0644 root root 17361 21918 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-HTMLparser.html 0644 root root 57872 3734 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-HTMLtree.html 0644 root root 24416 11475 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-SAX.html 0644 root root 38875 56552 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-SAX2.html 0644 root root 39659 2380 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-c14n.html 0644 root root 13546 17146 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-catalog.html 0644 root root 36549 35065 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-chvalid.html 0644 root root 19835 32590 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-debugXML.html 0644 root root 33317 47086 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-dict.html 0644 root root 11361 30250 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-encoding.html 0644 root root 29012 21195 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-entities.html 0644 root root 23118 9981 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-globals.html 0644 root root 35642 21806 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-hash.html 0644 root root 42055 10287 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-list.html 0644 root root 25568 55847 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-nanoftp.html 0644 root root 21563 17347 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-nanohttp.html 0644 root root 16614 5874 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-parser.html 0644 root root 137314 29487 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-parserInternals.html 0644 root root 122546 15856 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-pattern.html 0644 root root 19362 15833 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-relaxng.html 0644 root root 35230 40777 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-schemasInternals.html 0644 root root 65119 15818 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-schematron.html 0644 root root 17105 38134 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-threads.html 0644 root root 12896 39118 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-tree.html 0644 root root 225192 48172 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-uri.html 0644 root root 18434 43196 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-valid.html 0644 root root 98504 41382 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xinclude.html 0644 root root 15920 18434 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xlink.html 0644 root root 17329 12128 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlIO.html 0644 root root 55659 16744 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlautomata.html 0644 root root 35179 33651 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlerror.html 0644 root root 84473 26265 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlexports.html 0644 root root 3585 8335 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlmemory.html 0644 root root 24012 60278 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlmodule.html 0644 root root 6858 40149 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlreader.html 0644 root root 106566 41623 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlregexp.html 0644 root root 42013 8561 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlsave.html 0644 root root 14737 61995 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlschemas.html 0644 root root 39085 22777 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlschemastypes.html 0644 root root 44455 54737 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlstring.html 0644 root root 35113 14365 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlunicode.html 0644 root root 106596 4303 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlversion.html 0644 root root 17973 24519 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlwriter.html 0644 root root 110993 3662 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xpath.html 0644 root root 59447 952 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xpathInternals.html 0644 root root 144553 28328 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xpointer.html 0644 root root 25453 42833 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2.devhelp 0644 root root 339203 52285 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/right.png 0644 root root 472 50613 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/style.css 0644 root root 820 1833 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/up.png 0644 root root 406 41501 1287116933
1 d none /usr/local/share/man 0755 root root
1 d none /usr/local/share/man/man1 0755 root root
1 f none /usr/local/share/man/man1/xml2-config.1 0644 root root 1184 36544 1287116933
1 f none /usr/local/share/man/man1/xmlcatalog.1 0644 root root 6103 7794 1287116933
1 f none /usr/local/share/man/man1/xmllint.1 0644 root root 10772 27186 1287116933
1 d none /usr/local/share/man/man3 0755 root root
1 f none /usr/local/share/man/man3/libxml.3 0644 root root 1630 6442 1287116933
1 i checkinstall 790 2504 1287116940
1 i pkginfo 255 19474 1287116940
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000b00000000TRAILER!!! 0707010002b1b0000081a40000000000000000000000014cb7d88c000000ff000000b500010002ffffffffffffffff0000000800000000pkginfo PKG=libxml2
NAME=libxml2 2.7.7 i86pc Solaris 10
VERSION=2.7.7
PSTAMP=15th October 2010
VENDOR=Daniel Veillard
EMAIL=http://xmlsoft.org/downloads.html
DESC=XML C library
ARCH=i386
CATEGORY=utility
CLASSES=none
BASEDIR=/
ISTATES=S s 1 2 3
RSTATES=S s 1 2 3
0707010002b1af000081a40000000000000000000000014cb7d88c00006fb3000000b500010002ffffffffffffffff0000000700000000pkgmap : 1 32682
1 d none /usr ? ? ?
1 d none /usr/local ? ? ?
1 d none /usr/local/bin 0755 root root
1 f none /usr/local/bin/xml2-config 0755 root root 1980 21608 1287116933
1 f none /usr/local/bin/xmlcatalog 0755 root root 27840 34685 1287116933
1 f none /usr/local/bin/xmllint 0755 root root 135492 39209 1287116933
1 d none /usr/local/include 0755 root root
1 d none /usr/local/include/libxml2 0755 root root
1 d none /usr/local/include/libxml2/libxml 0755 root root
1 f none /usr/local/include/libxml2/libxml/DOCBparser.h 0644 root root 3277 26997 1287116932
1 f none /usr/local/include/libxml2/libxml/HTMLparser.h 0644 root root 9296 21688 1287116932
1 f none /usr/local/include/libxml2/libxml/HTMLtree.h 0644 root root 3685 24202 1287116932
1 f none /usr/local/include/libxml2/libxml/SAX.h 0644 root root 4412 254 1287116932
1 f none /usr/local/include/libxml2/libxml/SAX2.h 0644 root root 4944 47206 1287116932
1 f none /usr/local/include/libxml2/libxml/c14n.h 0644 root root 3110 45713 1287116932
1 f none /usr/local/include/libxml2/libxml/catalog.h 0644 root root 4958 62701 1287116932
1 f none /usr/local/include/libxml2/libxml/chvalid.h 0644 root root 5159 6441 1287116932
1 f none /usr/local/include/libxml2/libxml/debugXML.h 0644 root root 5181 58739 1287116932
1 f none /usr/local/include/libxml2/libxml/dict.h 0644 root root 1582 54062 1287116932
1 f none /usr/local/include/libxml2/libxml/encoding.h 0644 root root 7931 33159 1287116932
1 f none /usr/local/include/libxml2/libxml/entities.h 0644 root root 4672 34987 1287116932
1 f none /usr/local/include/libxml2/libxml/globals.h 0644 root root 14651 41700 1287116932
1 f none /usr/local/include/libxml2/libxml/hash.h 0644 root root 6567 40118 1287116932
1 f none /usr/local/include/libxml2/libxml/list.h 0644 root root 3422 9290 1287116932
1 f none /usr/local/include/libxml2/libxml/nanoftp.h 0644 root root 3347 65046 1287116932
1 f none /usr/local/include/libxml2/libxml/nanohttp.h 0644 root root 2018 25405 1287116932
1 f none /usr/local/include/libxml2/libxml/parser.h 0644 root root 39556 20438 1287116932
1 f none /usr/local/include/libxml2/libxml/parserInternals.h 0644 root root 16573 38289 1287116932
1 f none /usr/local/include/libxml2/libxml/pattern.h 0644 root root 2586 14250 1287116932
1 f none /usr/local/include/libxml2/libxml/relaxng.h 0644 root root 5958 14236 1287116932
1 f none /usr/local/include/libxml2/libxml/schemasInternals.h 0644 root root 26023 46943 1287116932
1 f none /usr/local/include/libxml2/libxml/schematron.h 0644 root root 4393 38715 1287116932
1 f none /usr/local/include/libxml2/libxml/threads.h 0644 root root 1852 22060 1287116932
1 f none /usr/local/include/libxml2/libxml/tree.h 0644 root root 36628 28341 1287116932
1 f none /usr/local/include/libxml2/libxml/uri.h 0644 root root 2664 14130 1287116932
1 f none /usr/local/include/libxml2/libxml/valid.h 0644 root root 13818 42837 1287116932
1 f none /usr/local/include/libxml2/libxml/xinclude.h 0644 root root 2967 33993 1287116932
1 f none /usr/local/include/libxml2/libxml/xlink.h 0644 root root 5051 29979 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlIO.h 0644 root root 10448 54431 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlautomata.h 0644 root root 3992 52088 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlerror.h 0644 root root 36676 39870 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlexports.h 0644 root root 3914 45768 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlmemory.h 0644 root root 5945 32295 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlmodule.h 0644 root root 1171 28508 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlreader.h 0644 root root 12551 25798 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlregexp.h 0644 root root 5458 46433 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlsave.h 0644 root root 2260 49170 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlschemas.h 0644 root root 6202 44970 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlschemastypes.h 0644 root root 4893 2118 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlstring.h 0644 root root 5472 10623 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlunicode.h 0644 root root 9993 44615 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlversion.h 0644 root root 7636 59172 1287116932
1 f none /usr/local/include/libxml2/libxml/xmlwriter.h 0644 root root 21159 10920 1287116932
1 f none /usr/local/include/libxml2/libxml/xpath.h 0644 root root 16199 42789 1287116932
1 f none /usr/local/include/libxml2/libxml/xpathInternals.h 0644 root root 19448 19089 1287116932
1 f none /usr/local/include/libxml2/libxml/xpointer.h 0644 root root 3411 12454 1287116932
1 d none /usr/local/lib 0755 root root
1 f none /usr/local/lib/libxml2.a 0644 root root 4797692 20086 1287116932
1 f none /usr/local/lib/libxml2.la 0755 root root 1014 23283 1287116932
1 s none /usr/local/lib/libxml2.so=libxml2.so.2.7.7
1 s none /usr/local/lib/libxml2.so.2=libxml2.so.2.7.7
1 f none /usr/local/lib/libxml2.so.2.7.7 0755 root root 4089284 4979 1287116932
1 d none /usr/local/lib/pkgconfig 0755 root root
1 f none /usr/local/lib/pkgconfig/libxml-2.0.pc 0644 root root 369 32976 1287116933
1 f none /usr/local/lib/xml2Conf.sh 0644 root root 330 27338 1287116933
1 d none /usr/local/share 0755 root root
1 d none /usr/local/share/aclocal 0755 root root
1 f none /usr/local/share/aclocal/libxml.m4 0644 root root 7880 31344 1287116933
1 d none /usr/local/share/doc 0755 root root
1 d none /usr/local/share/doc/libxml2-2.7.7 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/Copyright 0644 root root 1498 60471 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/examples 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/testHTML.c 0644 root root 21178 11625 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/testSAX.c 0644 root root 27618 44379 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/testXPath.c 0644 root root 5900 8360 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/examples/xmllint.c 0644 root root 96991 8100 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/DOM.gif 0644 root root 3166 16454 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/FAQ.html 0644 root root 21086 20502 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-180x168.gif 0644 root root 8195 18372 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/Libxml2-Logo-90x34.gif 0644 root root 3070 5797 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/encoding.html 0644 root root 19332 45298 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/examples.xml 0644 root root 32143 64944 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/examples.xsl 0644 root root 7232 22745 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/html 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/book1.html 0644 root root 9645 56651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/home.png 0644 root root 654 8089 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/index.html 0644 root root 9645 56651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/left.png 0644 root root 459 49669 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-DOCBparser.html 0644 root root 20644 9976 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLparser.html 0644 root root 59714 54097 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-HTMLtree.html 0644 root root 28620 28841 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX.html 0644 root root 43501 2070 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-SAX2.html 0644 root root 44470 29057 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-c14n.html 0644 root root 18074 34566 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-catalog.html 0644 root root 41039 42872 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-chvalid.html 0644 root root 18442 36279 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-debugXML.html 0644 root root 37931 47824 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-dict.html 0644 root root 15745 47928 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-encoding.html 0644 root root 34231 58628 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-entities.html 0644 root root 27700 56334 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-globals.html 0644 root root 33107 11987 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-hash.html 0644 root root 46558 65082 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-lib.html 0644 root root 9645 56651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-list.html 0644 root root 30126 56146 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-nanoftp.html 0644 root root 26396 22543 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-nanohttp.html 0644 root root 21243 49368 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-parser.html 0644 root root 146100 54015 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-parserInternals.html 0644 root root 120088 15304 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-pattern.html 0644 root root 23692 41744 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-relaxng.html 0644 root root 41021 5883 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-schemasInternals.html 0644 root root 64077 1066 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-schematron.html 0644 root root 21748 25694 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-threads.html 0644 root root 17180 60252 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-tree.html 0644 root root 226158 8499 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-uri.html 0644 root root 22697 58171 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-valid.html 0644 root root 102478 18341 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xinclude.html 0644 root root 19725 885 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xlink.html 0644 root root 21665 29749 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlIO.html 0644 root root 61477 37480 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlautomata.html 0644 root root 39585 3665 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlerror.html 0644 root root 109408 17081 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlexports.html 0644 root root 7610 49486 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmemory.html 0644 root root 29237 40271 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlmodule.html 0644 root root 11220 47362 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlreader.html 0644 root root 112604 4431 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlregexp.html 0644 root root 45805 15284 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlsave.html 0644 root root 19182 19763 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemas.html 0644 root root 44179 2731 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlschemastypes.html 0644 root root 49399 28650 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlstring.html 0644 root root 39315 46149 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlunicode.html 0644 root root 112871 31965 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlversion.html 0644 root root 19720 55141 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xmlwriter.html 0644 root root 116402 37530 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xpath.html 0644 root root 62165 26014 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xpathInternals.html 0644 root root 142763 55727 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/libxml-xpointer.html 0644 root root 29887 17355 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/right.png 0644 root root 472 50613 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/html/up.png 0644 root root 406 41501 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io1.c 0644 root root 3758 32816 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io1.res 0644 root root 165 13941 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io2.c 0644 root root 1187 27049 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/io2.res 0644 root root 43 3641 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/libxml.gif 0644 root root 7692 3071 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse1.c 0644 root root 1300 37651 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse2.c 0644 root root 1967 26348 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse3.c 0644 root root 1506 55755 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/parse4.c 0644 root root 3545 15935 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader1.c 0644 root root 2536 438 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader1.res 0644 root root 149 7963 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader2.c 0644 root root 3139 49199 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader3.c 0644 root root 2953 33274 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader3.res 0644 root root 360 28205 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader4.c 0644 root root 3134 48755 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/reader4.res 0644 root root 72 6501 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/redhat.gif 0644 root root 697 1392 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/smallfootonly.gif 0644 root root 2772 33479 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/structure.gif 0644 root root 5559 10757 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/test1.xml 0644 root root 7 489 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/test2.xml 0644 root root 227 16084 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/test3.xml 0644 root root 833 64269 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/testWriter.c 0644 root root 38443 23535 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree1.c 0644 root root 2249 49217 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree1.res 0644 root root 121 10602 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree2.c 0644 root root 3475 64636 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tree2.res 0644 root root 453 34440 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tst.xml 0644 root root 91 7269 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/tutorial 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apa.html 0644 root root 2114 50077 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apb.html 0644 root root 2026 41976 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apc.html 0644 root root 3094 59411 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apd.html 0644 root root 3232 10161 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ape.html 0644 root root 3096 60954 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apf.html 0644 root root 2949 50052 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/apg.html 0644 root root 3022 55514 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/aph.html 0644 root root 3600 14216 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/api.html 0644 root root 1899 32299 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s02.html 0644 root root 3298 21719 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s03.html 0644 root root 5718 25593 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s04.html 0644 root root 6223 3967 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s05.html 0644 root root 7422 46605 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s06.html 0644 root root 3849 62759 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s07.html 0644 root root 3866 788 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s08.html 0644 root root 3894 1098 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ar01s09.html 0644 root root 7603 1099 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/blank.png 0644 root root 374 27553 1287116933
1 d none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts 0755 root root
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/1.png 0644 root root 329 26541 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/10.png 0644 root root 361 31046 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/2.png 0644 root root 353 30241 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/3.png 0644 root root 350 30758 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/4.png 0644 root root 345 29927 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/5.png 0644 root root 348 29262 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/6.png 0644 root root 355 31934 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/7.png 0644 root root 344 29378 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/8.png 0644 root root 357 30798 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/callouts/9.png 0644 root root 357 30377 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/caution.png 0644 root root 1250 25620 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/draft.png 0644 root root 17454 5031 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/home.png 0644 root root 1156 29224 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/important.png 0644 root root 722 19454 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/next.png 0644 root root 1150 26768 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/note.png 0644 root root 490 47376 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/prev.png 0644 root root 1132 25218 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/tip.png 0644 root root 449 41167 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-blank.png 0644 root root 318 25047 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-minus.png 0644 root root 259 19780 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/toc-plus.png 0644 root root 264 20542 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/up.png 0644 root root 1111 21898 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/images/warning.png 0644 root root 1241 17822 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddattribute.c 0644 root root 1136 25548 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includeaddkeyword.c 0644 root root 1320 40297 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includeconvert.c 0644 root root 1808 56314 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includegetattribute.c 0644 root root 1171 27155 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includekeyword.c 0644 root root 1351 41532 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/includexpath.c 0644 root root 1491 58164 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/index.html 0644 root root 5930 50707 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/ix01.html 0644 root root 2545 19990 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/tutorial/xmltutorial.pdf 0644 root root 51709 26614 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/w3c.png 0644 root root 2028 53965 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/writer.xml 0644 root root 544 42503 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xml.html 0644 root root 249610 1241 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath1.c 0644 root root 6631 749 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath1.res 0644 root root 114 9317 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath2.c 0644 root root 5335 38108 1287116933
1 f none /usr/local/share/doc/libxml2-2.7.7/html/xpath2.res 0644 root root 757 60811 1287116933
1 d none /usr/local/share/gtk-doc 0755 root root
1 d none /usr/local/share/gtk-doc/html 0755 root root
1 d none /usr/local/share/gtk-doc/html/libxml2 0755 root root
1 f none /usr/local/share/gtk-doc/html/libxml2/general.html 0644 root root 5459 10614 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/home.png 0644 root root 654 8089 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/index.html 0644 root root 4321 23385 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/left.png 0644 root root 459 49669 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-DOCBparser.html 0644 root root 17361 21918 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-HTMLparser.html 0644 root root 57872 3734 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-HTMLtree.html 0644 root root 24416 11475 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-SAX.html 0644 root root 38875 56552 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-SAX2.html 0644 root root 39659 2380 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-c14n.html 0644 root root 13546 17146 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-catalog.html 0644 root root 36549 35065 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-chvalid.html 0644 root root 19835 32590 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-debugXML.html 0644 root root 33317 47086 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-dict.html 0644 root root 11361 30250 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-encoding.html 0644 root root 29012 21195 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-entities.html 0644 root root 23118 9981 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-globals.html 0644 root root 35642 21806 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-hash.html 0644 root root 42055 10287 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-list.html 0644 root root 25568 55847 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-nanoftp.html 0644 root root 21563 17347 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-nanohttp.html 0644 root root 16614 5874 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-parser.html 0644 root root 137314 29487 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-parserInternals.html 0644 root root 122546 15856 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-pattern.html 0644 root root 19362 15833 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-relaxng.html 0644 root root 35230 40777 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-schemasInternals.html 0644 root root 65119 15818 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-schematron.html 0644 root root 17105 38134 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-threads.html 0644 root root 12896 39118 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-tree.html 0644 root root 225192 48172 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-uri.html 0644 root root 18434 43196 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-valid.html 0644 root root 98504 41382 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xinclude.html 0644 root root 15920 18434 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xlink.html 0644 root root 17329 12128 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlIO.html 0644 root root 55659 16744 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlautomata.html 0644 root root 35179 33651 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlerror.html 0644 root root 84473 26265 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlexports.html 0644 root root 3585 8335 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlmemory.html 0644 root root 24012 60278 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlmodule.html 0644 root root 6858 40149 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlreader.html 0644 root root 106566 41623 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlregexp.html 0644 root root 42013 8561 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlsave.html 0644 root root 14737 61995 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlschemas.html 0644 root root 39085 22777 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlschemastypes.html 0644 root root 44455 54737 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlstring.html 0644 root root 35113 14365 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlunicode.html 0644 root root 106596 4303 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlversion.html 0644 root root 17973 24519 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xmlwriter.html 0644 root root 110993 3662 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xpath.html 0644 root root 59447 952 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xpathInternals.html 0644 root root 144553 28328 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2-xpointer.html 0644 root root 25453 42833 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/libxml2.devhelp 0644 root root 339203 52285 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/right.png 0644 root root 472 50613 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/style.css 0644 root root 820 1833 1287116933
1 f none /usr/local/share/gtk-doc/html/libxml2/up.png 0644 root root 406 41501 1287116933
1 d none /usr/local/share/man 0755 root root
1 d none /usr/local/share/man/man1 0755 root root
1 f none /usr/local/share/man/man1/xml2-config.1 0644 root root 1184 36544 1287116933
1 f none /usr/local/share/man/man1/xmlcatalog.1 0644 root root 6103 7794 1287116933
1 f none /usr/local/share/man/man1/xmllint.1 0644 root root 10772 27186 1287116933
1 d none /usr/local/share/man/man3 0755 root root
1 f none /usr/local/share/man/man3/libxml.3 0644 root root 1630 6442 1287116933
1 i checkinstall 790 2504 1287116940
1 i pkginfo 255 19474 1287116940
0707010002b2d5000041ed0000000000000000000000024cb7d88c00000000000000b500010002ffffffffffffffff0000000800000000install 0707010002b2d6000081ed0000000000000000000000014cb7d88c00000316000000b500010002ffffffffffffffff0000001500000000install/checkinstall #!/bin/sh
#
expected_bits="64"
expected_release="5.10"
expected_platform="i386"
#
release=`uname -r`
platform=`uname -p`
bits=`isainfo -b`
#
if [ ${platform} != ${expected_platform} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_platform} architecture\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
if [ ${release} != ${expected_release} ]; then
echo "\n\n\n\tThis package must be installed on a ${expected_release} machine\n"
echo "\tAborting installation.\n\n\n"
exit 1
fi
#if [ ${bits} != ${expected_bits} ]; then
# echo "\n\n\n\tThis package must be installed on a ${expected_bits} bit machine\n"
# echo "\tYour machine is running a ${bits} bit O.S. currently\n"
# echo "\tAborting installation.\n\n\n"
# exit 1
#fi
exit 0
0707010002b1b1000041ed0000000000000000000000034cb7d88c00000000000000b500010002ffffffffffffffff0000000500000000root 0707010002b1b2000041ed0000000000000000000000034cb7d88c00000000000000b500010002ffffffffffffffff0000000900000000root/usr 0707010002b1b3000041ed0000000000000000000000064cb7d88c00000000000000b500010002ffffffffffffffff0000000f00000000root/usr/local 0707010002b1f2000041ed0000000000000000000000064cb7d88c00000000000000b500010002ffffffffffffffff0000001500000000root/usr/local/share 0707010002b1f5000041ed0000000000000000000000034cb7d88c00000000000000b500010002ffffffffffffffff0000001900000000root/usr/local/share/doc 0707010002b1f6000041ed0000000000000000000000044cb7d88c00000000000000b500010002ffffffffffffffff0000002700000000root/usr/local/share/doc/libxml2-2.7.7 0707010002b1f8000041ed0000000000000000000000024cb7d88c00000000000000b500010002ffffffffffffffff0000003000000000root/usr/local/share/doc/libxml2-2.7.7/examples 0707010002b1fc000081a40000000000000000000000014cb7d88500017adf000000b500010002ffffffffffffffff0000003a00000000root/usr/local/share/doc/libxml2-2.7.7/examples/xmllint.c /*
* xmllint.c : a small tester program for XML input.
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#include "libxml.h"
#include
#include
#include
#if defined (_WIN32) && !defined(__CYGWIN__)
#if defined (_MSC_VER) || defined(__BORLANDC__)
#include
#pragma comment(lib, "ws2_32.lib")
#define gettimeofday(p1,p2)
#endif /* _MSC_VER */
#endif /* _WIN32 */
#ifdef HAVE_SYS_TIME_H
#include
#endif
#ifdef HAVE_TIME_H
#include
#endif
#ifdef __MINGW32__
#define _WINSOCKAPI_
#include
#include
#undef XML_SOCKLEN_T
#define XML_SOCKLEN_T unsigned int
#endif
#ifdef HAVE_SYS_TIMEB_H
#include
#endif
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_SYS_STAT_H
#include
#endif
#ifdef HAVE_FCNTL_H
#include
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_SYS_MMAN_H
#include
/* seems needed for Solaris */
#ifndef MAP_FAILED
#define MAP_FAILED ((void *) -1)
#endif
#endif
#ifdef HAVE_STDLIB_H
#include
#endif
#ifdef HAVE_LIBREADLINE
#include
#ifdef HAVE_LIBHISTORY
#include
#endif
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef LIBXML_XINCLUDE_ENABLED
#include
#endif
#ifdef LIBXML_CATALOG_ENABLED
#include
#endif
#include
#include
#ifdef LIBXML_SCHEMATRON_ENABLED
#include
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
#include
#include
#endif
#ifdef LIBXML_PATTERN_ENABLED
#include
#endif
#ifdef LIBXML_C14N_ENABLED
#include
#endif
#ifdef LIBXML_OUTPUT_ENABLED
#include
#endif
#ifndef XML_XML_DEFAULT_CATALOG
#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
#endif
typedef enum {
XMLLINT_RETURN_OK = 0, /* No error */
XMLLINT_ERR_UNCLASS = 1, /* Unclassified */
XMLLINT_ERR_DTD = 2, /* Error in DTD */
XMLLINT_ERR_VALID = 3, /* Validation error */
XMLLINT_ERR_RDFILE = 4, /* CtxtReadFile error */
XMLLINT_ERR_SCHEMACOMP = 5, /* Schema compilation */
XMLLINT_ERR_OUT = 6, /* Error writing output */
XMLLINT_ERR_SCHEMAPAT = 7, /* Error in schema pattern */
XMLLINT_ERR_RDREGIS = 8, /* Error in Reader registration */
XMLLINT_ERR_MEM = 9, /* Out of memory error */
XMLLINT_ERR_XPATH = 10 /* XPath evaluation error */
} xmllintReturnCode;
#ifdef LIBXML_DEBUG_ENABLED
static int shell = 0;
static int debugent = 0;
#endif
static int debug = 0;
static int maxmem = 0;
#ifdef LIBXML_TREE_ENABLED
static int copy = 0;
#endif /* LIBXML_TREE_ENABLED */
static int recovery = 0;
static int noent = 0;
static int noblanks = 0;
static int noout = 0;
static int nowrap = 0;
#ifdef LIBXML_OUTPUT_ENABLED
static int format = 0;
static const char *output = NULL;
static int compress = 0;
static int oldout = 0;
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
static int valid = 0;
static int postvalid = 0;
static char * dtdvalid = NULL;
static char * dtdvalidfpi = NULL;
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
static char * relaxng = NULL;
static xmlRelaxNGPtr relaxngschemas = NULL;
static char * schema = NULL;
static xmlSchemaPtr wxschemas = NULL;
#endif
#ifdef LIBXML_SCHEMATRON_ENABLED
static char * schematron = NULL;
static xmlSchematronPtr wxschematron = NULL;
#endif
static int repeat = 0;
static int insert = 0;
#if defined(LIBXML_HTML_ENABLED) || defined(LIBXML_VALID_ENABLED)
static int html = 0;
static int xmlout = 0;
#endif
static int htmlout = 0;
#ifdef LIBXML_PUSH_ENABLED
static int push = 0;
#endif /* LIBXML_PUSH_ENABLED */
#ifdef HAVE_SYS_MMAN_H
static int memory = 0;
#endif
static int testIO = 0;
static char *encoding = NULL;
#ifdef LIBXML_XINCLUDE_ENABLED
static int xinclude = 0;
#endif
static int dtdattrs = 0;
static int loaddtd = 0;
static xmllintReturnCode progresult = XMLLINT_RETURN_OK;
static int timing = 0;
static int generate = 0;
static int dropdtd = 0;
#ifdef LIBXML_CATALOG_ENABLED
static int catalogs = 0;
static int nocatalogs = 0;
#endif
#ifdef LIBXML_C14N_ENABLED
static int canonical = 0;
static int canonical_11 = 0;
static int exc_canonical = 0;
#endif
#ifdef LIBXML_READER_ENABLED
static int stream = 0;
static int walker = 0;
#endif /* LIBXML_READER_ENABLED */
static int chkregister = 0;
static int nbregister = 0;
#ifdef LIBXML_SAX1_ENABLED
static int sax1 = 0;
#endif /* LIBXML_SAX1_ENABLED */
#ifdef LIBXML_PATTERN_ENABLED
static const char *pattern = NULL;
static xmlPatternPtr patternc = NULL;
static xmlStreamCtxtPtr patstream = NULL;
#endif
#ifdef LIBXML_XPATH_ENABLED
static const char *xpathquery = NULL;
#endif
static int options = XML_PARSE_COMPACT;
static int sax = 0;
static int oldxml10 = 0;
/************************************************************************
* *
* Entity loading control and customization. *
* *
************************************************************************/
#define MAX_PATHS 64
#ifdef _WIN32
# define PATH_SEPARATOR ';'
#else
# define PATH_SEPARATOR ':'
#endif
static xmlChar *paths[MAX_PATHS + 1];
static int nbpaths = 0;
static int load_trace = 0;
static
void parsePath(const xmlChar *path) {
const xmlChar *cur;
if (path == NULL)
return;
while (*path != 0) {
if (nbpaths >= MAX_PATHS) {
fprintf(stderr, "MAX_PATHS reached: too many paths\n");
return;
}
cur = path;
while ((*cur == ' ') || (*cur == PATH_SEPARATOR))
cur++;
path = cur;
while ((*cur != 0) && (*cur != ' ') && (*cur != PATH_SEPARATOR))
cur++;
if (cur != path) {
paths[nbpaths] = xmlStrndup(path, cur - path);
if (paths[nbpaths] != NULL)
nbpaths++;
path = cur;
}
}
}
static xmlExternalEntityLoader defaultEntityLoader = NULL;
static xmlParserInputPtr
xmllintExternalEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlParserInputPtr ret;
warningSAXFunc warning = NULL;
errorSAXFunc err = NULL;
int i;
const char *lastsegment = URL;
const char *iter = URL;
if ((nbpaths > 0) && (iter != NULL)) {
while (*iter != 0) {
if (*iter == '/')
lastsegment = iter + 1;
iter++;
}
}
if ((ctxt != NULL) && (ctxt->sax != NULL)) {
warning = ctxt->sax->warning;
err = ctxt->sax->error;
ctxt->sax->warning = NULL;
ctxt->sax->error = NULL;
}
if (defaultEntityLoader != NULL) {
ret = defaultEntityLoader(URL, ID, ctxt);
if (ret != NULL) {
if (warning != NULL)
ctxt->sax->warning = warning;
if (err != NULL)
ctxt->sax->error = err;
if (load_trace) {
fprintf \
(stderr,
"Loaded URL=\"%s\" ID=\"%s\"\n",
URL ? URL : "(null)",
ID ? ID : "(null)");
}
return(ret);
}
}
for (i = 0;i < nbpaths;i++) {
xmlChar *newURL;
newURL = xmlStrdup((const xmlChar *) paths[i]);
newURL = xmlStrcat(newURL, (const xmlChar *) "/");
newURL = xmlStrcat(newURL, (const xmlChar *) lastsegment);
if (newURL != NULL) {
ret = defaultEntityLoader((const char *)newURL, ID, ctxt);
if (ret != NULL) {
if (warning != NULL)
ctxt->sax->warning = warning;
if (err != NULL)
ctxt->sax->error = err;
if (load_trace) {
fprintf \
(stderr,
"Loaded URL=\"%s\" ID=\"%s\"\n",
newURL,
ID ? ID : "(null)");
}
xmlFree(newURL);
return(ret);
}
xmlFree(newURL);
}
}
if (err != NULL)
ctxt->sax->error = err;
if (warning != NULL) {
ctxt->sax->warning = warning;
if (URL != NULL)
warning(ctxt, "failed to load external entity \"%s\"\n", URL);
else if (ID != NULL)
warning(ctxt, "failed to load external entity \"%s\"\n", ID);
}
return(NULL);
}
/************************************************************************
* *
* Memory allocation consumption debugging *
* *
************************************************************************/
static void
OOM(void)
{
fprintf(stderr, "Ran out of memory needs > %d bytes\n", maxmem);
progresult = XMLLINT_ERR_MEM;
}
static void
myFreeFunc(void *mem)
{
xmlMemFree(mem);
}
static void *
myMallocFunc(size_t size)
{
void *ret;
ret = xmlMemMalloc(size);
if (ret != NULL) {
if (xmlMemUsed() > maxmem) {
OOM();
xmlMemFree(ret);
return (NULL);
}
}
return (ret);
}
static void *
myReallocFunc(void *mem, size_t size)
{
void *ret;
ret = xmlMemRealloc(mem, size);
if (ret != NULL) {
if (xmlMemUsed() > maxmem) {
OOM();
xmlMemFree(ret);
return (NULL);
}
}
return (ret);
}
static char *
myStrdupFunc(const char *str)
{
char *ret;
ret = xmlMemoryStrdup(str);
if (ret != NULL) {
if (xmlMemUsed() > maxmem) {
OOM();
xmlFree(ret);
return (NULL);
}
}
return (ret);
}
/************************************************************************
* *
* Internal timing routines to remove the necessity to have *
* unix-specific function calls. *
* *
************************************************************************/
#ifndef HAVE_GETTIMEOFDAY
#ifdef HAVE_SYS_TIMEB_H
#ifdef HAVE_SYS_TIME_H
#ifdef HAVE_FTIME
static int
my_gettimeofday(struct timeval *tvp, void *tzp)
{
struct timeb timebuffer;
ftime(&timebuffer);
if (tvp) {
tvp->tv_sec = timebuffer.time;
tvp->tv_usec = timebuffer.millitm * 1000L;
}
return (0);
}
#define HAVE_GETTIMEOFDAY 1
#define gettimeofday my_gettimeofday
#endif /* HAVE_FTIME */
#endif /* HAVE_SYS_TIME_H */
#endif /* HAVE_SYS_TIMEB_H */
#endif /* !HAVE_GETTIMEOFDAY */
#if defined(HAVE_GETTIMEOFDAY)
static struct timeval begin, end;
/*
* startTimer: call where you want to start timing
*/
static void
startTimer(void)
{
gettimeofday(&begin, NULL);
}
/*
* endTimer: call where you want to stop timing and to print out a
* message about the timing performed; format is a printf
* type argument
*/
static void XMLCDECL
endTimer(const char *fmt, ...)
{
long msec;
va_list ap;
gettimeofday(&end, NULL);
msec = end.tv_sec - begin.tv_sec;
msec *= 1000;
msec += (end.tv_usec - begin.tv_usec) / 1000;
#ifndef HAVE_STDARG_H
#error "endTimer required stdarg functions"
#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, " took %ld ms\n", msec);
}
#elif defined(HAVE_TIME_H)
/*
* No gettimeofday function, so we have to make do with calling clock.
* This is obviously less accurate, but there's little we can do about
* that.
*/
#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC 100
#endif
static clock_t begin, end;
static void
startTimer(void)
{
begin = clock();
}
static void XMLCDECL
endTimer(const char *fmt, ...)
{
long msec;
va_list ap;
end = clock();
msec = ((end - begin) * 1000) / CLOCKS_PER_SEC;
#ifndef HAVE_STDARG_H
#error "endTimer required stdarg functions"
#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, " took %ld ms\n", msec);
}
#else
/*
* We don't have a gettimeofday or time.h, so we just don't do timing
*/
static void
startTimer(void)
{
/*
* Do nothing
*/
}
static void XMLCDECL
endTimer(char *format, ...)
{
/*
* We cannot do anything because we don't have a timing function
*/
#ifdef HAVE_STDARG_H
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
fprintf(stderr, " was not timed\n", msec);
#else
/* We don't have gettimeofday, time or stdarg.h, what crazy world is
* this ?!
*/
#endif
}
#endif
/************************************************************************
* *
* HTML ouput *
* *
************************************************************************/
static char buffer[50000];
static void
xmlHTMLEncodeSend(void) {
char *result;
result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
if (result) {
xmlGenericError(xmlGenericErrorContext, "%s", result);
xmlFree(result);
}
buffer[0] = 0;
}
/**
* xmlHTMLPrintFileInfo:
* @input: an xmlParserInputPtr input
*
* Displays the associated file and line informations for the current input
*/
static void
xmlHTMLPrintFileInfo(xmlParserInputPtr input) {
int len;
xmlGenericError(xmlGenericErrorContext, "");
len = strlen(buffer);
if (input != NULL) {
if (input->filename) {
snprintf(&buffer[len], sizeof(buffer) - len, "%s:%d: ", input->filename,
input->line);
} else {
snprintf(&buffer[len], sizeof(buffer) - len, "Entity: line %d: ", input->line);
}
}
xmlHTMLEncodeSend();
}
/**
* xmlHTMLPrintFileContext:
* @input: an xmlParserInputPtr input
*
* Displays current context within the input content for error tracking
*/
static void
xmlHTMLPrintFileContext(xmlParserInputPtr input) {
const xmlChar *cur, *base;
int len;
int n;
if (input == NULL) return;
xmlGenericError(xmlGenericErrorContext, "
\n");
cur = input->cur;
base = input->base;
while ((cur > base) && ((*cur == '\n') || (*cur == '\r'))) {
cur--;
}
n = 0;
while ((n++ < 80) && (cur > base) && (*cur != '\n') && (*cur != '\r'))
cur--;
if ((*cur == '\n') || (*cur == '\r')) cur++;
base = cur;
n = 0;
while ((*cur != 0) && (*cur != '\n') && (*cur != '\r') && (n < 79)) {
len = strlen(buffer);
snprintf(&buffer[len], sizeof(buffer) - len, "%c",
(unsigned char) *cur++);
n++;
}
len = strlen(buffer);
snprintf(&buffer[len], sizeof(buffer) - len, "\n");
cur = input->cur;
while ((*cur == '\n') || (*cur == '\r'))
cur--;
n = 0;
while ((cur != base) && (n++ < 80)) {
len = strlen(buffer);
snprintf(&buffer[len], sizeof(buffer) - len, " ");
base++;
}
len = strlen(buffer);
snprintf(&buffer[len], sizeof(buffer) - len, "^\n");
xmlHTMLEncodeSend();
xmlGenericError(xmlGenericErrorContext, "");
}
/**
* xmlHTMLError:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format an error messages, gives file, line, position and
* extra parameters.
*/
static void XMLCDECL
xmlHTMLError(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input;
va_list args;
int len;
buffer[0] = 0;
input = ctxt->input;
if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
input = ctxt->inputTab[ctxt->inputNr - 2];
}
xmlHTMLPrintFileInfo(input);
xmlGenericError(xmlGenericErrorContext, "error: ");
va_start(args, msg);
len = strlen(buffer);
vsnprintf(&buffer[len], sizeof(buffer) - len, msg, args);
va_end(args);
xmlHTMLEncodeSend();
xmlGenericError(xmlGenericErrorContext, "
\n");
xmlHTMLPrintFileContext(input);
xmlHTMLEncodeSend();
}
/**
* xmlHTMLWarning:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a warning messages, gives file, line, position and
* extra parameters.
*/
static void XMLCDECL
xmlHTMLWarning(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input;
va_list args;
int len;
buffer[0] = 0;
input = ctxt->input;
if ((input != NULL) && (input->filename == NULL) && (ctxt->inputNr > 1)) {
input = ctxt->inputTab[ctxt->inputNr - 2];
}
xmlHTMLPrintFileInfo(input);
xmlGenericError(xmlGenericErrorContext, "warning: ");
va_start(args, msg);
len = strlen(buffer);
vsnprintf(&buffer[len], sizeof(buffer) - len, msg, args);
va_end(args);
xmlHTMLEncodeSend();
xmlGenericError(xmlGenericErrorContext, "\n");
xmlHTMLPrintFileContext(input);
xmlHTMLEncodeSend();
}
/**
* xmlHTMLValidityError:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format an validity error messages, gives file,
* line, position and extra parameters.
*/
static void XMLCDECL
xmlHTMLValidityError(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input;
va_list args;
int len;
buffer[0] = 0;
input = ctxt->input;
if ((input->filename == NULL) && (ctxt->inputNr > 1))
input = ctxt->inputTab[ctxt->inputNr - 2];
xmlHTMLPrintFileInfo(input);
xmlGenericError(xmlGenericErrorContext, "validity error: ");
len = strlen(buffer);
va_start(args, msg);
vsnprintf(&buffer[len], sizeof(buffer) - len, msg, args);
va_end(args);
xmlHTMLEncodeSend();
xmlGenericError(xmlGenericErrorContext, "\n");
xmlHTMLPrintFileContext(input);
xmlHTMLEncodeSend();
progresult = XMLLINT_ERR_VALID;
}
/**
* xmlHTMLValidityWarning:
* @ctx: an XML parser context
* @msg: the message to display/transmit
* @...: extra parameters for the message display
*
* Display and format a validity warning messages, gives file, line,
* position and extra parameters.
*/
static void XMLCDECL
xmlHTMLValidityWarning(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input;
va_list args;
int len;
buffer[0] = 0;
input = ctxt->input;
if ((input->filename == NULL) && (ctxt->inputNr > 1))
input = ctxt->inputTab[ctxt->inputNr - 2];
xmlHTMLPrintFileInfo(input);
xmlGenericError(xmlGenericErrorContext, "validity warning: ");
va_start(args, msg);
len = strlen(buffer);
vsnprintf(&buffer[len], sizeof(buffer) - len, msg, args);
va_end(args);
xmlHTMLEncodeSend();
xmlGenericError(xmlGenericErrorContext, "\n");
xmlHTMLPrintFileContext(input);
xmlHTMLEncodeSend();
}
/************************************************************************
* *
* Shell Interface *
* *
************************************************************************/
#ifdef LIBXML_DEBUG_ENABLED
#ifdef LIBXML_XPATH_ENABLED
/**
* xmlShellReadline:
* @prompt: the prompt value
*
* Read a string
*
* Returns a pointer to it or NULL on EOF the caller is expected to
* free the returned string.
*/
static char *
xmlShellReadline(char *prompt) {
#ifdef HAVE_LIBREADLINE
char *line_read;
/* Get a line from the user. */
line_read = readline (prompt);
/* If the line has any text in it, save it on the history. */
if (line_read && *line_read)
add_history (line_read);
return (line_read);
#else
char line_read[501];
char *ret;
int len;
if (prompt != NULL)
fprintf(stdout, "%s", prompt);
if (!fgets(line_read, 500, stdin))
return(NULL);
line_read[500] = 0;
len = strlen(line_read);
ret = (char *) malloc(len + 1);
if (ret != NULL) {
memcpy (ret, line_read, len + 1);
}
return(ret);
#endif
}
#endif /* LIBXML_XPATH_ENABLED */
#endif /* LIBXML_DEBUG_ENABLED */
/************************************************************************
* *
* I/O Interfaces *
* *
************************************************************************/
static int myRead(FILE *f, char * buf, int len) {
return(fread(buf, 1, len, f));
}
static void myClose(FILE *f) {
if (f != stdin) {
fclose(f);
}
}
/************************************************************************
* *
* SAX based tests *
* *
************************************************************************/
/*
* empty SAX block
*/
static xmlSAXHandler emptySAXHandlerStruct = {
NULL, /* internalSubset */
NULL, /* isStandalone */
NULL, /* hasInternalSubset */
NULL, /* hasExternalSubset */
NULL, /* resolveEntity */
NULL, /* getEntity */
NULL, /* entityDecl */
NULL, /* notationDecl */
NULL, /* attributeDecl */
NULL, /* elementDecl */
NULL, /* unparsedEntityDecl */
NULL, /* setDocumentLocator */
NULL, /* startDocument */
NULL, /* endDocument */
NULL, /* startElement */
NULL, /* endElement */
NULL, /* reference */
NULL, /* characters */
NULL, /* ignorableWhitespace */
NULL, /* processingInstruction */
NULL, /* comment */
NULL, /* xmlParserWarning */
NULL, /* xmlParserError */
NULL, /* xmlParserError */
NULL, /* getParameterEntity */
NULL, /* cdataBlock; */
NULL, /* externalSubset; */
XML_SAX2_MAGIC,
NULL,
NULL, /* startElementNs */
NULL, /* endElementNs */
NULL /* xmlStructuredErrorFunc */
};
static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
extern xmlSAXHandlerPtr debugSAXHandler;
static int callbacks;
/**
* isStandaloneDebug:
* @ctxt: An XML parser context
*
* Is this document tagged standalone ?
*
* Returns 1 if true
*/
static int
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return(0);
fprintf(stdout, "SAX.isStandalone()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*
* Returns 1 if true
*/
static int
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return(0);
fprintf(stdout, "SAX.hasInternalSubset()\n");
return(0);
}
/**
* hasExternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an external subset
*
* Returns 1 if true
*/
static int
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return(0);
fprintf(stdout, "SAX.hasExternalSubset()\n");
return(0);
}
/**
* internalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*/
static void
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.internalSubset(%s,", name);
if (ExternalID == NULL)
fprintf(stdout, " ,");
else
fprintf(stdout, " %s,", ExternalID);
if (SystemID == NULL)
fprintf(stdout, " )\n");
else
fprintf(stdout, " %s)\n", SystemID);
}
/**
* externalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an external subset
*/
static void
externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.externalSubset(%s,", name);
if (ExternalID == NULL)
fprintf(stdout, " ,");
else
fprintf(stdout, " %s,", ExternalID);
if (SystemID == NULL)
fprintf(stdout, " )\n");
else
fprintf(stdout, " %s)\n", SystemID);
}
/**
* resolveEntityDebug:
* @ctxt: An XML parser context
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
* The default behaviour is to NOT resolve the entities, in that case
* the ENTITY_REF nodes are built in the structure (and the parameter
* values).
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
{
callbacks++;
if (noout)
return(NULL);
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
fprintf(stdout, "SAX.resolveEntity(");
if (publicId != NULL)
fprintf(stdout, "%s", (char *)publicId);
else
fprintf(stdout, " ");
if (systemId != NULL)
fprintf(stdout, ", %s)\n", (char *)systemId);
else
fprintf(stdout, ", )\n");
return(NULL);
}
/**
* getEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get an entity by name
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (noout)
return(NULL);
fprintf(stdout, "SAX.getEntity(%s)\n", name);
return(NULL);
}
/**
* getParameterEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get a parameter entity by name
*
* Returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (noout)
return(NULL);
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
return(NULL);
}
/**
* entityDeclDebug:
* @ctxt: An XML parser context
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
*
* An entity definition has been parsed
*/
static void
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{
const xmlChar *nullstr = BAD_CAST "(null)";
/* not all libraries handle printing null pointers nicely */
if (publicId == NULL)
publicId = nullstr;
if (systemId == NULL)
systemId = nullstr;
if (content == NULL)
content = (xmlChar *)nullstr;
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
name, type, publicId, systemId, content);
}
/**
* attributeDeclDebug:
* @ctxt: An XML parser context
* @name: the attribute name
* @type: the attribute type
*
* An attribute definition has been parsed
*/
static void
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem,
const xmlChar * name, int type, int def,
const xmlChar * defaultValue, xmlEnumerationPtr tree)
{
callbacks++;
if (noout)
return;
if (defaultValue == NULL)
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n",
elem, name, type, def);
else
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
elem, name, type, def, defaultValue);
xmlFreeEnumeration(tree);
}
/**
* elementDeclDebug:
* @ctxt: An XML parser context
* @name: the element name
* @type: the element type
* @content: the element value (without processing).
*
* An element definition has been parsed
*/
static void
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
xmlElementContentPtr content ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
name, type);
}
/**
* notationDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
static void
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId);
}
/**
* unparsedEntityDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
static void
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName)
{
const xmlChar *nullstr = BAD_CAST "(null)";
if (publicId == NULL)
publicId = nullstr;
if (systemId == NULL)
systemId = nullstr;
if (notationName == NULL)
notationName = nullstr;
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId,
(char *) notationName);
}
/**
* setDocumentLocatorDebug:
* @ctxt: An XML parser context
* @loc: A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
*/
static void
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.setDocumentLocator()\n");
}
/**
* startDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document start being processed.
*/
static void
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.startDocument()\n");
}
/**
* endDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document end has been detected.
*/
static void
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.endDocument()\n");
}
/**
* startElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when an opening tag has been processed.
*/
static void
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
{
int i;
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.startElement(%s", (char *) name);
if (atts != NULL) {
for (i = 0;(atts[i] != NULL);i++) {
fprintf(stdout, ", %s='", atts[i++]);
if (atts[i] != NULL)
fprintf(stdout, "%s'", atts[i]);
}
}
fprintf(stdout, ")\n");
}
/**
* endElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when the end of an element has been detected.
*/
static void
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (noout)
return;
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
}
/**
* charactersDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
*/
static void
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
char out[40];
int i;
callbacks++;
if (noout)
return;
for (i = 0;(i 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
} else {
fprintf(stderr, "%s validation generated an internal error\n",
filename);
progresult = XMLLINT_ERR_VALID;
}
}
xmlSchemaFreeValidCtxt(vctxt);
} else
#endif
{
/*
* Create the parser context amd hook the input
*/
ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
xmlFreeParserInputBuffer(buf);
goto error;
}
old_sax = ctxt->sax;
ctxt->sax = handler;
ctxt->userData = (void *) user_data;
inputStream = xmlNewIOInputStream(ctxt, buf, XML_CHAR_ENCODING_NONE);
if (inputStream == NULL) {
xmlFreeParserInputBuffer(buf);
goto error;
}
inputPush(ctxt, inputStream);
/* do the parsing */
xmlParseDocument(ctxt);
if (ctxt->myDoc != NULL) {
fprintf(stderr, "SAX generated a doc !\n");
xmlFreeDoc(ctxt->myDoc);
ctxt->myDoc = NULL;
}
}
error:
if (ctxt != NULL) {
ctxt->sax = old_sax;
xmlFreeParserCtxt(ctxt);
}
}
/************************************************************************
* *
* Stream Test processing *
* *
************************************************************************/
#ifdef LIBXML_READER_ENABLED
static void processNode(xmlTextReaderPtr reader) {
const xmlChar *name, *value;
int type, empty;
type = xmlTextReaderNodeType(reader);
empty = xmlTextReaderIsEmptyElement(reader);
if (debug) {
name = xmlTextReaderConstName(reader);
if (name == NULL)
name = BAD_CAST "--";
value = xmlTextReaderConstValue(reader);
printf("%d %d %s %d %d",
xmlTextReaderDepth(reader),
type,
name,
empty,
xmlTextReaderHasValue(reader));
if (value == NULL)
printf("\n");
else {
printf(" %s\n", value);
}
}
#ifdef LIBXML_PATTERN_ENABLED
if (patternc) {
xmlChar *path = NULL;
int match = -1;
if (type == XML_READER_TYPE_ELEMENT) {
/* do the check only on element start */
match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader));
if (match) {
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
path = xmlGetNodePath(xmlTextReaderCurrentNode(reader));
printf("Node %s matches pattern %s\n", path, pattern);
#else
printf("Node %s matches pattern %s\n",
xmlTextReaderConstName(reader), pattern);
#endif
}
}
if (patstream != NULL) {
int ret;
if (type == XML_READER_TYPE_ELEMENT) {
ret = xmlStreamPush(patstream,
xmlTextReaderConstLocalName(reader),
xmlTextReaderConstNamespaceUri(reader));
if (ret < 0) {
fprintf(stderr, "xmlStreamPush() failure\n");
xmlFreeStreamCtxt(patstream);
patstream = NULL;
} else if (ret != match) {
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
if (path == NULL) {
path = xmlGetNodePath(
xmlTextReaderCurrentNode(reader));
}
#endif
fprintf(stderr,
"xmlPatternMatch and xmlStreamPush disagree\n");
if (path != NULL)
fprintf(stderr, " pattern %s node %s\n",
pattern, path);
else
fprintf(stderr, " pattern %s node %s\n",
pattern, xmlTextReaderConstName(reader));
}
}
if ((type == XML_READER_TYPE_END_ELEMENT) ||
((type == XML_READER_TYPE_ELEMENT) && (empty))) {
ret = xmlStreamPop(patstream);
if (ret < 0) {
fprintf(stderr, "xmlStreamPop() failure\n");
xmlFreeStreamCtxt(patstream);
patstream = NULL;
}
}
}
if (path != NULL)
xmlFree(path);
}
#endif
}
static void streamFile(char *filename) {
xmlTextReaderPtr reader;
int ret;
#ifdef HAVE_SYS_MMAN_H
int fd = -1;
struct stat info;
const char *base = NULL;
xmlParserInputBufferPtr input = NULL;
if (memory) {
if (stat(filename, &info) < 0)
return;
if ((fd = open(filename, O_RDONLY)) < 0)
return;
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
if (base == (void *) MAP_FAILED)
return;
reader = xmlReaderForMemory(base, info.st_size, filename,
NULL, options);
} else
#endif
reader = xmlReaderForFile(filename, NULL, options);
#ifdef LIBXML_PATTERN_ENABLED
if (pattern != NULL) {
patternc = xmlPatterncompile((const xmlChar *) pattern, NULL, 0, NULL);
if (patternc == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Pattern %s failed to compile\n", pattern);
progresult = XMLLINT_ERR_SCHEMAPAT;
pattern = NULL;
}
}
if (patternc != NULL) {
patstream = xmlPatternGetStreamCtxt(patternc);
if (patstream != NULL) {
ret = xmlStreamPush(patstream, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "xmlStreamPush() failure\n");
xmlFreeStreamCtxt(patstream);
patstream = NULL;
}
}
}
#endif
if (reader != NULL) {
#ifdef LIBXML_VALID_ENABLED
if (valid)
xmlTextReaderSetParserProp(reader, XML_PARSER_VALIDATE, 1);
else
#endif /* LIBXML_VALID_ENABLED */
xmlTextReaderSetParserProp(reader, XML_PARSER_LOADDTD, 1);
#ifdef LIBXML_SCHEMAS_ENABLED
if (relaxng != NULL) {
if ((timing) && (!repeat)) {
startTimer();
}
ret = xmlTextReaderRelaxNGValidate(reader, relaxng);
if (ret < 0) {
xmlGenericError(xmlGenericErrorContext,
"Relax-NG schema %s failed to compile\n", relaxng);
progresult = XMLLINT_ERR_SCHEMACOMP;
relaxng = NULL;
}
if ((timing) && (!repeat)) {
endTimer("Compiling the schemas");
}
}
if (schema != NULL) {
if ((timing) && (!repeat)) {
startTimer();
}
ret = xmlTextReaderSchemaValidate(reader, schema);
if (ret < 0) {
xmlGenericError(xmlGenericErrorContext,
"XSD schema %s failed to compile\n", schema);
progresult = XMLLINT_ERR_SCHEMACOMP;
schema = NULL;
}
if ((timing) && (!repeat)) {
endTimer("Compiling the schemas");
}
}
#endif
/*
* Process all nodes in sequence
*/
if ((timing) && (!repeat)) {
startTimer();
}
ret = xmlTextReaderRead(reader);
while (ret == 1) {
if ((debug)
#ifdef LIBXML_PATTERN_ENABLED
|| (patternc)
#endif
)
processNode(reader);
ret = xmlTextReaderRead(reader);
}
if ((timing) && (!repeat)) {
#ifdef LIBXML_SCHEMAS_ENABLED
if (relaxng != NULL)
endTimer("Parsing and validating");
else
#endif
#ifdef LIBXML_VALID_ENABLED
if (valid)
endTimer("Parsing and validating");
else
#endif
endTimer("Parsing");
}
#ifdef LIBXML_VALID_ENABLED
if (valid) {
if (xmlTextReaderIsValid(reader) != 1) {
xmlGenericError(xmlGenericErrorContext,
"Document %s does not validate\n", filename);
progresult = XMLLINT_ERR_VALID;
}
}
#endif /* LIBXML_VALID_ENABLED */
#ifdef LIBXML_SCHEMAS_ENABLED
if ((relaxng != NULL) || (schema != NULL)) {
if (xmlTextReaderIsValid(reader) != 1) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
} else {
fprintf(stderr, "%s validates\n", filename);
}
}
#endif
/*
* Done, cleanup and status
*/
xmlFreeTextReader(reader);
if (ret != 0) {
fprintf(stderr, "%s : failed to parse\n", filename);
progresult = XMLLINT_ERR_UNCLASS;
}
} else {
fprintf(stderr, "Unable to open %s\n", filename);
progresult = XMLLINT_ERR_UNCLASS;
}
#ifdef LIBXML_PATTERN_ENABLED
if (patstream != NULL) {
xmlFreeStreamCtxt(patstream);
patstream = NULL;
}
#endif
#ifdef HAVE_SYS_MMAN_H
if (memory) {
xmlFreeParserInputBuffer(input);
munmap((char *) base, info.st_size);
close(fd);
}
#endif
}
static void walkDoc(xmlDocPtr doc) {
xmlTextReaderPtr reader;
int ret;
#ifdef LIBXML_PATTERN_ENABLED
xmlNodePtr root;
const xmlChar *namespaces[22];
int i;
xmlNsPtr ns;
root = xmlDocGetRootElement(doc);
for (ns = root->nsDef, i = 0;ns != NULL && i < 20;ns=ns->next) {
namespaces[i++] = ns->href;
namespaces[i++] = ns->prefix;
}
namespaces[i++] = NULL;
namespaces[i] = NULL;
if (pattern != NULL) {
patternc = xmlPatterncompile((const xmlChar *) pattern, doc->dict,
0, &namespaces[0]);
if (patternc == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Pattern %s failed to compile\n", pattern);
progresult = XMLLINT_ERR_SCHEMAPAT;
pattern = NULL;
}
}
if (patternc != NULL) {
patstream = xmlPatternGetStreamCtxt(patternc);
if (patstream != NULL) {
ret = xmlStreamPush(patstream, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "xmlStreamPush() failure\n");
xmlFreeStreamCtxt(patstream);
patstream = NULL;
}
}
}
#endif /* LIBXML_PATTERN_ENABLED */
reader = xmlReaderWalker(doc);
if (reader != NULL) {
if ((timing) && (!repeat)) {
startTimer();
}
ret = xmlTextReaderRead(reader);
while (ret == 1) {
if ((debug)
#ifdef LIBXML_PATTERN_ENABLED
|| (patternc)
#endif
)
processNode(reader);
ret = xmlTextReaderRead(reader);
}
if ((timing) && (!repeat)) {
endTimer("walking through the doc");
}
xmlFreeTextReader(reader);
if (ret != 0) {
fprintf(stderr, "failed to walk through the doc\n");
progresult = XMLLINT_ERR_UNCLASS;
}
} else {
fprintf(stderr, "Failed to crate a reader from the document\n");
progresult = XMLLINT_ERR_UNCLASS;
}
#ifdef LIBXML_PATTERN_ENABLED
if (patstream != NULL) {
xmlFreeStreamCtxt(patstream);
patstream = NULL;
}
#endif
}
#endif /* LIBXML_READER_ENABLED */
#ifdef LIBXML_XPATH_ENABLED
/************************************************************************
* *
* XPath Query *
* *
************************************************************************/
static void doXPathDump(xmlXPathObjectPtr cur) {
switch(cur->type) {
case XPATH_NODESET: {
int i;
xmlNodePtr node;
#ifdef LIBXML_OUTPUT_ENABLED
xmlSaveCtxtPtr ctxt;
if (cur->nodesetval->nodeNr <= 0) {
fprintf(stderr, "XPath set is empty\n");
progresult = XMLLINT_ERR_XPATH;
break;
}
ctxt = xmlSaveToFd(1, NULL, 0);
if (ctxt == NULL) {
fprintf(stderr, "Out of memory for XPath\n");
progresult = XMLLINT_ERR_MEM;
return;
}
for (i = 0;i < cur->nodesetval->nodeNr;i++) {
node = cur->nodesetval->nodeTab[i];
xmlSaveTree(ctxt, node);
}
xmlSaveClose(ctxt);
#else
printf("xpath returned %d nodes\n", cur->nodesetval->nodeNr);
#endif
break;
}
case XPATH_BOOLEAN:
if (cur->boolval) printf("true");
else printf("false");
break;
case XPATH_NUMBER:
switch (xmlXPathIsInf(cur->floatval)) {
case 1:
printf("Infinity");
break;
case -1:
printf("-Infinity");
break;
default:
if (xmlXPathIsNaN(cur->floatval)) {
printf("NaN");
} else {
printf("%0g", cur->floatval);
}
}
break;
case XPATH_STRING:
printf("%s", (const char *) cur->stringval);
break;
case XPATH_UNDEFINED:
fprintf(stderr, "XPath Object is uninitialized\n");
progresult = XMLLINT_ERR_XPATH;
break;
default:
fprintf(stderr, "XPath object of unexpected type\n");
progresult = XMLLINT_ERR_XPATH;
break;
}
}
static void doXPathQuery(xmlDocPtr doc, const char *query) {
xmlXPathContextPtr ctxt;
xmlXPathObjectPtr res;
ctxt = xmlXPathNewContext(doc);
if (ctxt == NULL) {
fprintf(stderr, "Out of memory for XPath\n");
progresult = XMLLINT_ERR_MEM;
return;
}
ctxt->node = xmlDocGetRootElement(doc);
res = xmlXPathEval(BAD_CAST query, ctxt);
xmlXPathFreeContext(ctxt);
if (res == NULL) {
fprintf(stderr, "XPath evaluation failure\n");
progresult = XMLLINT_ERR_XPATH;
return;
}
doXPathDump(res);
xmlXPathFreeObject(res);
}
#endif /* LIBXML_XPATH_ENABLED */
/************************************************************************
* *
* Tree Test processing *
* *
************************************************************************/
static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
xmlDocPtr doc = NULL;
#ifdef LIBXML_TREE_ENABLED
xmlDocPtr tmp;
#endif /* LIBXML_TREE_ENABLED */
if ((timing) && (!repeat))
startTimer();
#ifdef LIBXML_TREE_ENABLED
if (filename == NULL) {
if (generate) {
xmlNodePtr n;
doc = xmlNewDoc(BAD_CAST "1.0");
n = xmlNewDocNode(doc, NULL, BAD_CAST "info", NULL);
xmlNodeSetContent(n, BAD_CAST "abc");
xmlDocSetRootElement(doc, n);
}
}
#endif /* LIBXML_TREE_ENABLED */
#ifdef LIBXML_HTML_ENABLED
#ifdef LIBXML_PUSH_ENABLED
else if ((html) && (push)) {
FILE *f;
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
htmlParserCtxtPtr ctxt;
/* if (repeat) */
size = 4096;
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
fclose(f);
}
}
#endif /* LIBXML_PUSH_ENABLED */
#ifdef HAVE_SYS_MMAN_H
else if ((html) && (memory)) {
int fd;
struct stat info;
const char *base;
if (stat(filename, &info) < 0)
return;
if ((fd = open(filename, O_RDONLY)) < 0)
return;
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
if (base == (void *) MAP_FAILED)
return;
doc = htmlReadMemory((char *) base, info.st_size, filename,
NULL, options);
munmap((char *) base, info.st_size);
close(fd);
}
#endif
else if (html) {
doc = htmlReadFile(filename, NULL, options);
}
#endif /* LIBXML_HTML_ENABLED */
else {
#ifdef LIBXML_PUSH_ENABLED
/*
* build an XML tree from a string;
*/
if (push) {
FILE *f;
/* '-' Usually means stdin - */
if ((filename[0] == '-') && (filename[1] == 0)) {
f = stdin;
} else {
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
}
if (f != NULL) {
int ret;
int res, size = 1024;
char chars[1024];
xmlParserCtxtPtr ctxt;
/* if (repeat) size = 1024; */
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = xmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename);
xmlCtxtUseOptions(ctxt, options);
while ((res = fread(chars, 1, size, f)) > 0) {
xmlParseChunk(ctxt, chars, res, 0);
}
xmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
ret = ctxt->wellFormed;
xmlFreeParserCtxt(ctxt);
if (!ret) {
xmlFreeDoc(doc);
doc = NULL;
}
}
if (f != stdin)
fclose(f);
}
} else
#endif /* LIBXML_PUSH_ENABLED */
if (testIO) {
if ((filename[0] == '-') && (filename[1] == 0)) {
doc = xmlReadFd(0, NULL, NULL, options);
} else {
FILE *f;
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
if (rectxt == NULL)
doc = xmlReadIO((xmlInputReadCallback) myRead,
(xmlInputCloseCallback) myClose, f,
filename, NULL, options);
else
doc = xmlCtxtReadIO(rectxt,
(xmlInputReadCallback) myRead,
(xmlInputCloseCallback) myClose, f,
filename, NULL, options);
} else
doc = NULL;
}
} else if (htmlout) {
xmlParserCtxtPtr ctxt;
if (rectxt == NULL)
ctxt = xmlNewParserCtxt();
else
ctxt = rectxt;
if (ctxt == NULL) {
doc = NULL;
} else {
ctxt->sax->error = xmlHTMLError;
ctxt->sax->warning = xmlHTMLWarning;
ctxt->vctxt.error = xmlHTMLValidityError;
ctxt->vctxt.warning = xmlHTMLValidityWarning;
doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
if (rectxt == NULL)
xmlFreeParserCtxt(ctxt);
}
#ifdef HAVE_SYS_MMAN_H
} else if (memory) {
int fd;
struct stat info;
const char *base;
if (stat(filename, &info) < 0)
return;
if ((fd = open(filename, O_RDONLY)) < 0)
return;
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
if (base == (void *) MAP_FAILED)
return;
if (rectxt == NULL)
doc = xmlReadMemory((char *) base, info.st_size,
filename, NULL, options);
else
doc = xmlCtxtReadMemory(rectxt, (char *) base, info.st_size,
filename, NULL, options);
munmap((char *) base, info.st_size);
close(fd);
#endif
#ifdef LIBXML_VALID_ENABLED
} else if (valid) {
xmlParserCtxtPtr ctxt = NULL;
if (rectxt == NULL)
ctxt = xmlNewParserCtxt();
else
ctxt = rectxt;
if (ctxt == NULL) {
doc = NULL;
} else {
doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
if (ctxt->valid == 0)
progresult = XMLLINT_ERR_RDFILE;
if (rectxt == NULL)
xmlFreeParserCtxt(ctxt);
}
#endif /* LIBXML_VALID_ENABLED */
} else {
if (rectxt != NULL)
doc = xmlCtxtReadFile(rectxt, filename, NULL, options);
else {
#ifdef LIBXML_SAX1_ENABLED
if (sax1)
doc = xmlParseFile(filename);
else
#endif /* LIBXML_SAX1_ENABLED */
doc = xmlReadFile(filename, NULL, options);
}
}
}
/*
* If we don't have a document we might as well give up. Do we
* want an error message here? */
if (doc == NULL) {
progresult = XMLLINT_ERR_UNCLASS;
return;
}
if ((timing) && (!repeat)) {
endTimer("Parsing");
}
/*
* Remove DOCTYPE nodes
*/
if (dropdtd) {
xmlDtdPtr dtd;
dtd = xmlGetIntSubset(doc);
if (dtd != NULL) {
xmlUnlinkNode((xmlNodePtr)dtd);
xmlFreeDtd(dtd);
}
}
#ifdef LIBXML_XINCLUDE_ENABLED
if (xinclude) {
if ((timing) && (!repeat)) {
startTimer();
}
if (xmlXIncludeProcessFlags(doc, options) < 0)
progresult = XMLLINT_ERR_UNCLASS;
if ((timing) && (!repeat)) {
endTimer("Xinclude processing");
}
}
#endif
#ifdef LIBXML_XPATH_ENABLED
if (xpathquery != NULL) {
doXPathQuery(doc, xpathquery);
}
#endif
#ifdef LIBXML_DEBUG_ENABLED
#ifdef LIBXML_XPATH_ENABLED
/*
* shell interaction
*/
if (shell) {
xmlXPathOrderDocElems(doc);
xmlShell(doc, filename, xmlShellReadline, stdout);
}
#endif
#endif
#ifdef LIBXML_TREE_ENABLED
/*
* test intermediate copy if needed.
*/
if (copy) {
tmp = doc;
if (timing) {
startTimer();
}
doc = xmlCopyDoc(doc, 1);
if (timing) {
endTimer("Copying");
}
if (timing) {
startTimer();
}
xmlFreeDoc(tmp);
if (timing) {
endTimer("Freeing original");
}
}
#endif /* LIBXML_TREE_ENABLED */
#ifdef LIBXML_VALID_ENABLED
if ((insert) && (!html)) {
const xmlChar* list[256];
int nb, i;
xmlNodePtr node;
if (doc->children != NULL) {
node = doc->children;
while ((node != NULL) && (node->last == NULL)) node = node->next;
if (node != NULL) {
nb = xmlValidGetValidElements(node->last, NULL, list, 256);
if (nb < 0) {
fprintf(stderr, "could not get valid list of elements\n");
} else if (nb == 0) {
fprintf(stderr, "No element can be inserted under root\n");
} else {
fprintf(stderr, "%d element types can be inserted under root:\n",
nb);
for (i = 0;i < nb;i++) {
fprintf(stderr, "%s\n", (char *) list[i]);
}
}
}
}
}else
#endif /* LIBXML_VALID_ENABLED */
#ifdef LIBXML_READER_ENABLED
if (walker) {
walkDoc(doc);
}
#endif /* LIBXML_READER_ENABLED */
#ifdef LIBXML_OUTPUT_ENABLED
if (noout == 0) {
int ret;
/*
* print it.
*/
#ifdef LIBXML_DEBUG_ENABLED
if (!debug) {
#endif
if ((timing) && (!repeat)) {
startTimer();
}
#ifdef LIBXML_HTML_ENABLED
if ((html) && (!xmlout)) {
if (compress) {
htmlSaveFile(output ? output : "-", doc);
}
else if (encoding != NULL) {
if ( format ) {
htmlSaveFileFormat(output ? output : "-", doc, encoding, 1);
}
else {
htmlSaveFileFormat(output ? output : "-", doc, encoding, 0);
}
}
else if (format) {
htmlSaveFileFormat(output ? output : "-", doc, NULL, 1);
}
else {
FILE *out;
if (output == NULL)
out = stdout;
else {
out = fopen(output,"wb");
}
if (out != NULL) {
if (htmlDocDump(out, doc) < 0)
progresult = XMLLINT_ERR_OUT;
if (output != NULL)
fclose(out);
} else {
fprintf(stderr, "failed to open %s\n", output);
progresult = XMLLINT_ERR_OUT;
}
}
if ((timing) && (!repeat)) {
endTimer("Saving");
}
} else
#endif
#ifdef LIBXML_C14N_ENABLED
if (canonical) {
xmlChar *result = NULL;
int size;
size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_0, NULL, 1, &result);
if (size >= 0) {
write(1, result, size);
xmlFree(result);
} else {
fprintf(stderr, "Failed to canonicalize\n");
progresult = XMLLINT_ERR_OUT;
}
} else if (canonical) {
xmlChar *result = NULL;
int size;
size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_1_1, NULL, 1, &result);
if (size >= 0) {
write(1, result, size);
xmlFree(result);
} else {
fprintf(stderr, "Failed to canonicalize\n");
progresult = XMLLINT_ERR_OUT;
}
} else
if (exc_canonical) {
xmlChar *result = NULL;
int size;
size = xmlC14NDocDumpMemory(doc, NULL, XML_C14N_EXCLUSIVE_1_0, NULL, 1, &result);
if (size >= 0) {
write(1, result, size);
xmlFree(result);
} else {
fprintf(stderr, "Failed to canonicalize\n");
progresult = XMLLINT_ERR_OUT;
}
} else
#endif
#ifdef HAVE_SYS_MMAN_H
if (memory) {
xmlChar *result;
int len;
if (encoding != NULL) {
if ( format ) {
xmlDocDumpFormatMemoryEnc(doc, &result, &len, encoding, 1);
} else {
xmlDocDumpMemoryEnc(doc, &result, &len, encoding);
}
} else {
if (format)
xmlDocDumpFormatMemory(doc, &result, &len, 1);
else
xmlDocDumpMemory(doc, &result, &len);
}
if (result == NULL) {
fprintf(stderr, "Failed to save\n");
progresult = XMLLINT_ERR_OUT;
} else {
write(1, result, len);
xmlFree(result);
}
} else
#endif /* HAVE_SYS_MMAN_H */
if (compress) {
xmlSaveFile(output ? output : "-", doc);
} else if (oldout) {
if (encoding != NULL) {
if ( format ) {
ret = xmlSaveFormatFileEnc(output ? output : "-", doc,
encoding, 1);
}
else {
ret = xmlSaveFileEnc(output ? output : "-", doc,
encoding);
}
if (ret < 0) {
fprintf(stderr, "failed save to %s\n",
output ? output : "-");
progresult = XMLLINT_ERR_OUT;
}
} else if (format) {
ret = xmlSaveFormatFile(output ? output : "-", doc, 1);
if (ret < 0) {
fprintf(stderr, "failed save to %s\n",
output ? output : "-");
progresult = XMLLINT_ERR_OUT;
}
} else {
FILE *out;
if (output == NULL)
out = stdout;
else {
out = fopen(output,"wb");
}
if (out != NULL) {
if (xmlDocDump(out, doc) < 0)
progresult = XMLLINT_ERR_OUT;
if (output != NULL)
fclose(out);
} else {
fprintf(stderr, "failed to open %s\n", output);
progresult = XMLLINT_ERR_OUT;
}
}
} else {
xmlSaveCtxtPtr ctxt;
int saveOpts = 0;
if (format)
saveOpts |= XML_SAVE_FORMAT;
#if defined(LIBXML_HTML_ENABLED) || defined(LIBXML_VALID_ENABLED)
if (xmlout)
saveOpts |= XML_SAVE_AS_XML;
#endif
if (output == NULL)
ctxt = xmlSaveToFd(1, encoding, saveOpts);
else
ctxt = xmlSaveToFilename(output, encoding, saveOpts);
if (ctxt != NULL) {
if (xmlSaveDoc(ctxt, doc) < 0) {
fprintf(stderr, "failed save to %s\n",
output ? output : "-");
progresult = XMLLINT_ERR_OUT;
}
xmlSaveClose(ctxt);
} else {
progresult = XMLLINT_ERR_OUT;
}
}
if ((timing) && (!repeat)) {
endTimer("Saving");
}
#ifdef LIBXML_DEBUG_ENABLED
} else {
FILE *out;
if (output == NULL)
out = stdout;
else {
out = fopen(output,"wb");
}
if (out != NULL) {
xmlDebugDumpDocument(out, doc);
if (output != NULL)
fclose(out);
} else {
fprintf(stderr, "failed to open %s\n", output);
progresult = XMLLINT_ERR_OUT;
}
}
#endif
}
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
/*
* A posteriori validation test
*/
if ((dtdvalid != NULL) || (dtdvalidfpi != NULL)) {
xmlDtdPtr dtd;
if ((timing) && (!repeat)) {
startTimer();
}
if (dtdvalid != NULL)
dtd = xmlParseDTD(NULL, (const xmlChar *)dtdvalid);
else
dtd = xmlParseDTD((const xmlChar *)dtdvalidfpi, NULL);
if ((timing) && (!repeat)) {
endTimer("Parsing DTD");
}
if (dtd == NULL) {
if (dtdvalid != NULL)
xmlGenericError(xmlGenericErrorContext,
"Could not parse DTD %s\n", dtdvalid);
else
xmlGenericError(xmlGenericErrorContext,
"Could not parse DTD %s\n", dtdvalidfpi);
progresult = XMLLINT_ERR_DTD;
} else {
xmlValidCtxtPtr cvp;
if ((cvp = xmlNewValidCtxt()) == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Couldn't allocate validation context\n");
exit(-1);
}
cvp->userData = (void *) stderr;
cvp->error = (xmlValidityErrorFunc) fprintf;
cvp->warning = (xmlValidityWarningFunc) fprintf;
if ((timing) && (!repeat)) {
startTimer();
}
if (!xmlValidateDtd(cvp, doc, dtd)) {
if (dtdvalid != NULL)
xmlGenericError(xmlGenericErrorContext,
"Document %s does not validate against %s\n",
filename, dtdvalid);
else
xmlGenericError(xmlGenericErrorContext,
"Document %s does not validate against %s\n",
filename, dtdvalidfpi);
progresult = XMLLINT_ERR_VALID;
}
if ((timing) && (!repeat)) {
endTimer("Validating against DTD");
}
xmlFreeValidCtxt(cvp);
xmlFreeDtd(dtd);
}
} else if (postvalid) {
xmlValidCtxtPtr cvp;
if ((cvp = xmlNewValidCtxt()) == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Couldn't allocate validation context\n");
exit(-1);
}
if ((timing) && (!repeat)) {
startTimer();
}
cvp->userData = (void *) stderr;
cvp->error = (xmlValidityErrorFunc) fprintf;
cvp->warning = (xmlValidityWarningFunc) fprintf;
if (!xmlValidateDocument(cvp, doc)) {
xmlGenericError(xmlGenericErrorContext,
"Document %s does not validate\n", filename);
progresult = XMLLINT_ERR_VALID;
}
if ((timing) && (!repeat)) {
endTimer("Validating");
}
xmlFreeValidCtxt(cvp);
}
#endif /* LIBXML_VALID_ENABLED */
#ifdef LIBXML_SCHEMATRON_ENABLED
if (wxschematron != NULL) {
xmlSchematronValidCtxtPtr ctxt;
int ret;
int flag;
if ((timing) && (!repeat)) {
startTimer();
}
if (debug)
flag = XML_SCHEMATRON_OUT_XML;
else
flag = XML_SCHEMATRON_OUT_TEXT;
if (noout)
flag |= XML_SCHEMATRON_OUT_QUIET;
ctxt = xmlSchematronNewValidCtxt(wxschematron, flag);
#if 0
xmlSchematronSetValidErrors(ctxt,
(xmlSchematronValidityErrorFunc) fprintf,
(xmlSchematronValidityWarningFunc) fprintf,
stderr);
#endif
ret = xmlSchematronValidateDoc(ctxt, doc);
if (ret == 0) {
fprintf(stderr, "%s validates\n", filename);
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
} else {
fprintf(stderr, "%s validation generated an internal error\n",
filename);
progresult = XMLLINT_ERR_VALID;
}
xmlSchematronFreeValidCtxt(ctxt);
if ((timing) && (!repeat)) {
endTimer("Validating");
}
}
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
if (relaxngschemas != NULL) {
xmlRelaxNGValidCtxtPtr ctxt;
int ret;
if ((timing) && (!repeat)) {
startTimer();
}
ctxt = xmlRelaxNGNewValidCtxt(relaxngschemas);
xmlRelaxNGSetValidErrors(ctxt,
(xmlRelaxNGValidityErrorFunc) fprintf,
(xmlRelaxNGValidityWarningFunc) fprintf,
stderr);
ret = xmlRelaxNGValidateDoc(ctxt, doc);
if (ret == 0) {
fprintf(stderr, "%s validates\n", filename);
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
} else {
fprintf(stderr, "%s validation generated an internal error\n",
filename);
progresult = XMLLINT_ERR_VALID;
}
xmlRelaxNGFreeValidCtxt(ctxt);
if ((timing) && (!repeat)) {
endTimer("Validating");
}
} else if (wxschemas != NULL) {
xmlSchemaValidCtxtPtr ctxt;
int ret;
if ((timing) && (!repeat)) {
startTimer();
}
ctxt = xmlSchemaNewValidCtxt(wxschemas);
xmlSchemaSetValidErrors(ctxt,
(xmlSchemaValidityErrorFunc) fprintf,
(xmlSchemaValidityWarningFunc) fprintf,
stderr);
ret = xmlSchemaValidateDoc(ctxt, doc);
if (ret == 0) {
fprintf(stderr, "%s validates\n", filename);
} else if (ret > 0) {
fprintf(stderr, "%s fails to validate\n", filename);
progresult = XMLLINT_ERR_VALID;
} else {
fprintf(stderr, "%s validation generated an internal error\n",
filename);
progresult = XMLLINT_ERR_VALID;
}
xmlSchemaFreeValidCtxt(ctxt);
if ((timing) && (!repeat)) {
endTimer("Validating");
}
}
#endif
#ifdef LIBXML_DEBUG_ENABLED
#if defined(LIBXML_HTML_ENABLED) || defined(LIBXML_VALID_ENABLED)
if ((debugent) && (!html))
xmlDebugDumpEntities(stderr, doc);
#endif
#endif
/*
* free it.
*/
if ((timing) && (!repeat)) {
startTimer();
}
xmlFreeDoc(doc);
if ((timing) && (!repeat)) {
endTimer("Freeing");
}
}
/************************************************************************
* *
* Usage and Main *
* *
************************************************************************/
static void showVersion(const char *name) {
fprintf(stderr, "%s: using libxml version %s\n", name, xmlParserVersion);
fprintf(stderr, " compiled with: ");
if (xmlHasFeature(XML_WITH_THREAD)) fprintf(stderr, "Threads ");
if (xmlHasFeature(XML_WITH_TREE)) fprintf(stderr, "Tree ");
if (xmlHasFeature(XML_WITH_OUTPUT)) fprintf(stderr, "Output ");
if (xmlHasFeature(XML_WITH_PUSH)) fprintf(stderr, "Push ");
if (xmlHasFeature(XML_WITH_READER)) fprintf(stderr, "Reader ");
if (xmlHasFeature(XML_WITH_PATTERN)) fprintf(stderr, "Patterns ");
if (xmlHasFeature(XML_WITH_WRITER)) fprintf(stderr, "Writer ");
if (xmlHasFeature(XML_WITH_SAX1)) fprintf(stderr, "SAXv1 ");
if (xmlHasFeature(XML_WITH_FTP)) fprintf(stderr, "FTP ");
if (xmlHasFeature(XML_WITH_HTTP)) fprintf(stderr, "HTTP ");
if (xmlHasFeature(XML_WITH_VALID)) fprintf(stderr, "DTDValid ");
if (xmlHasFeature(XML_WITH_HTML)) fprintf(stderr, "HTML ");
if (xmlHasFeature(XML_WITH_LEGACY)) fprintf(stderr, "Legacy ");
if (xmlHasFeature(XML_WITH_C14N)) fprintf(stderr, "C14N ");
if (xmlHasFeature(XML_WITH_CATALOG)) fprintf(stderr, "Catalog ");
if (xmlHasFeature(XML_WITH_XPATH)) fprintf(stderr, "XPath ");
if (xmlHasFeature(XML_WITH_XPTR)) fprintf(stderr, "XPointer ");
if (xmlHasFeature(XML_WITH_XINCLUDE)) fprintf(stderr, "XInclude ");
if (xmlHasFeature(XML_WITH_ICONV)) fprintf(stderr, "Iconv ");
if (xmlHasFeature(XML_WITH_ISO8859X)) fprintf(stderr, "ISO8859X ");
if (xmlHasFeature(XML_WITH_UNICODE)) fprintf(stderr, "Unicode ");
if (xmlHasFeature(XML_WITH_REGEXP)) fprintf(stderr, "Regexps ");
if (xmlHasFeature(XML_WITH_AUTOMATA)) fprintf(stderr, "Automata ");
if (xmlHasFeature(XML_WITH_EXPR)) fprintf(stderr, "Expr ");
if (xmlHasFeature(XML_WITH_SCHEMAS)) fprintf(stderr, "Schemas ");
if (xmlHasFeature(XML_WITH_SCHEMATRON)) fprintf(stderr, "Schematron ");
if (xmlHasFeature(XML_WITH_MODULES)) fprintf(stderr, "Modules ");
if (xmlHasFeature(XML_WITH_DEBUG)) fprintf(stderr, "Debug ");
if (xmlHasFeature(XML_WITH_DEBUG_MEM)) fprintf(stderr, "MemDebug ");
if (xmlHasFeature(XML_WITH_DEBUG_RUN)) fprintf(stderr, "RunDebug ");
if (xmlHasFeature(XML_WITH_ZLIB)) fprintf(stderr, "Zlib ");
fprintf(stderr, "\n");
}
static void usage(const char *name) {
printf("Usage : %s [options] XMLfiles ...\n", name);
#ifdef LIBXML_OUTPUT_ENABLED
printf("\tParse the XML files and output the result of the parsing\n");
#else
printf("\tParse the XML files\n");
#endif /* LIBXML_OUTPUT_ENABLED */
printf("\t--version : display the version of the XML library used\n");
#ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n");
printf("\t--shell : run a navigating shell\n");
printf("\t--debugent : debug the entities defined in the document\n");
#else
#ifdef LIBXML_READER_ENABLED
printf("\t--debug : dump the nodes content when using --stream\n");
#endif /* LIBXML_READER_ENABLED */
#endif
#ifdef LIBXML_TREE_ENABLED
printf("\t--copy : used to test the internal copy implementation\n");
#endif /* LIBXML_TREE_ENABLED */
printf("\t--recover : output what was parsable on broken XML documents\n");
printf("\t--huge : remove any internal arbitrary parser limits\n");
printf("\t--noent : substitute entity references by their value\n");
printf("\t--noout : don't output the result tree\n");
printf("\t--path 'paths': provide a set of paths for resources\n");
printf("\t--load-trace : print trace of all external entites loaded\n");
printf("\t--nonet : refuse to fetch DTDs or entities over network\n");
printf("\t--nocompact : do not generate compact text nodes\n");
printf("\t--htmlout : output results as HTML\n");
printf("\t--nowrap : do not put HTML doc wrapper\n");
#ifdef LIBXML_VALID_ENABLED
printf("\t--valid : validate the document in addition to std well-formed check\n");
printf("\t--postvalid : do a posteriori validation, i.e after parsing\n");
printf("\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
printf("\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
#endif /* LIBXML_VALID_ENABLED */
printf("\t--timing : print some timings\n");
printf("\t--output file or -o file: save to a given file\n");
printf("\t--repeat : repeat 100 times, for timing or profiling\n");
printf("\t--insert : ad-hoc test for valid insertions\n");
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
printf("\t--compress : turn on gzip compression of output\n");
#endif
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED
printf("\t--html : use the HTML parser\n");
printf("\t--xmlout : force to use the XML serializer when using --html\n");
#endif
#ifdef LIBXML_PUSH_ENABLED
printf("\t--push : use the push mode of the parser\n");
#endif /* LIBXML_PUSH_ENABLED */
#ifdef HAVE_SYS_MMAN_H
printf("\t--memory : parse from memory\n");
#endif
printf("\t--maxmem nbbytes : limits memory allocation to nbbytes bytes\n");
printf("\t--nowarning : do not emit warnings from parser/validator\n");
printf("\t--noblanks : drop (ignorable?) blanks spaces\n");
printf("\t--nocdata : replace cdata section with text nodes\n");
#ifdef LIBXML_OUTPUT_ENABLED
printf("\t--format : reformat/reindent the input\n");
printf("\t--encode encoding : output in the given encoding\n");
printf("\t--dropdtd : remove the DOCTYPE of the input docs\n");
#endif /* LIBXML_OUTPUT_ENABLED */
printf("\t--c14n : save in W3C canonical format v1.0 (with comments)\n");
printf("\t--c14n11 : save in W3C canonical format v1.1 (with comments)\n");
printf("\t--exc-c14n : save in W3C exclusive canonical format (with comments)\n");
#ifdef LIBXML_C14N_ENABLED
#endif /* LIBXML_C14N_ENABLED */
printf("\t--nsclean : remove redundant namespace declarations\n");
printf("\t--testIO : test user I/O support\n");
#ifdef LIBXML_CATALOG_ENABLED
printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n");
printf("\t otherwise XML Catalogs starting from \n");
printf("\t %s are activated by default\n", XML_XML_DEFAULT_CATALOG);
printf("\t--nocatalogs: deactivate all catalogs\n");
#endif
printf("\t--auto : generate a small doc on the fly\n");
#ifdef LIBXML_XINCLUDE_ENABLED
printf("\t--xinclude : do XInclude processing\n");
printf("\t--noxincludenode : same but do not generate XInclude nodes\n");
printf("\t--nofixup-base-uris : do not fixup xml:base uris\n");
#endif
printf("\t--loaddtd : fetch external DTD\n");
printf("\t--dtdattr : loaddtd + populate the tree with inherited attributes \n");
#ifdef LIBXML_READER_ENABLED
printf("\t--stream : use the streaming interface to process very large files\n");
printf("\t--walker : create a reader and walk though the resulting doc\n");
#endif /* LIBXML_READER_ENABLED */
#ifdef LIBXML_PATTERN_ENABLED
printf("\t--pattern pattern_value : test the pattern support\n");
#endif
printf("\t--chkregister : verify the node registration code\n");
#ifdef LIBXML_SCHEMAS_ENABLED
printf("\t--relaxng schema : do RelaxNG validation against the schema\n");
printf("\t--schema schema : do validation against the WXS schema\n");
#endif
#ifdef LIBXML_SCHEMATRON_ENABLED
printf("\t--schematron schema : do validation against a schematron\n");
#endif
#ifdef LIBXML_SAX1_ENABLED
printf("\t--sax1: use the old SAX1 interfaces for processing\n");
#endif
printf("\t--sax: do not build a tree but work just at the SAX level\n");
printf("\t--oldxml10: use XML-1.0 parsing rules before the 5th edition\n");
#ifdef LIBXML_XPATH_ENABLED
printf("\t--xpath expr: evaluate the XPath expression, inply --noout\n");
#endif
printf("\nLibxml project home page: http://xmlsoft.org/\n");
printf("To report bugs or get some help check: http://xmlsoft.org/bugs.html\n");
}
static void registerNode(xmlNodePtr node)
{
node->_private = malloc(sizeof(long));
*(long*)node->_private = (long) 0x81726354;
nbregister++;
}
static void deregisterNode(xmlNodePtr node)
{
assert(node->_private != NULL);
assert(*(long*)node->_private == (long) 0x81726354);
free(node->_private);
nbregister--;
}
int
main(int argc, char **argv) {
int i, acount;
int files = 0;
int version = 0;
const char* indent;
if (argc <= 1) {
usage(argv[0]);
return(1);
}
LIBXML_TEST_VERSION
for (i = 1; i < argc ; i++) {
if (!strcmp(argv[i], "-"))
break;
if (argv[i][0] != '-')
continue;
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;
else
#ifdef LIBXML_DEBUG_ENABLED
if ((!strcmp(argv[i], "-shell")) ||
(!strcmp(argv[i], "--shell"))) {
shell++;
noout = 1;
} else
#endif
#ifdef LIBXML_TREE_ENABLED
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
copy++;
else
#endif /* LIBXML_TREE_ENABLED */
if ((!strcmp(argv[i], "-recover")) ||
(!strcmp(argv[i], "--recover"))) {
recovery++;
options |= XML_PARSE_RECOVER;
} else if ((!strcmp(argv[i], "-huge")) ||
(!strcmp(argv[i], "--huge"))) {
options |= XML_PARSE_HUGE;
} else if ((!strcmp(argv[i], "-noent")) ||
(!strcmp(argv[i], "--noent"))) {
noent++;
options |= XML_PARSE_NOENT;
} else if ((!strcmp(argv[i], "-nsclean")) ||
(!strcmp(argv[i], "--nsclean"))) {
options |= XML_PARSE_NSCLEAN;
} else if ((!strcmp(argv[i], "-nocdata")) ||
(!strcmp(argv[i], "--nocdata"))) {
options |= XML_PARSE_NOCDATA;
} else if ((!strcmp(argv[i], "-nodict")) ||
(!strcmp(argv[i], "--nodict"))) {
options |= XML_PARSE_NODICT;
} else if ((!strcmp(argv[i], "-version")) ||
(!strcmp(argv[i], "--version"))) {
showVersion(argv[0]);
version = 1;
} else if ((!strcmp(argv[i], "-noout")) ||
(!strcmp(argv[i], "--noout")))
noout++;
#ifdef LIBXML_OUTPUT_ENABLED
else if ((!strcmp(argv[i], "-o")) ||
(!strcmp(argv[i], "-output")) ||
(!strcmp(argv[i], "--output"))) {
i++;
output = argv[i];
}
#endif /* LIBXML_OUTPUT_ENABLED */
else if ((!strcmp(argv[i], "-htmlout")) ||
(!strcmp(argv[i], "--htmlout")))
htmlout++;
else if ((!strcmp(argv[i], "-nowrap")) ||
(!strcmp(argv[i], "--nowrap")))
nowrap++;
#ifdef LIBXML_HTML_ENABLED
else if ((!strcmp(argv[i], "-html")) ||
(!strcmp(argv[i], "--html"))) {
html++;
}
else if ((!strcmp(argv[i], "-xmlout")) ||
(!strcmp(argv[i], "--xmlout"))) {
xmlout++;
}
#endif /* LIBXML_HTML_ENABLED */
else if ((!strcmp(argv[i], "-loaddtd")) ||
(!strcmp(argv[i], "--loaddtd"))) {
loaddtd++;
options |= XML_PARSE_DTDLOAD;
} else if ((!strcmp(argv[i], "-dtdattr")) ||
(!strcmp(argv[i], "--dtdattr"))) {
loaddtd++;
dtdattrs++;
options |= XML_PARSE_DTDATTR;
}
#ifdef LIBXML_VALID_ENABLED
else if ((!strcmp(argv[i], "-valid")) ||
(!strcmp(argv[i], "--valid"))) {
valid++;
options |= XML_PARSE_DTDVALID;
} else if ((!strcmp(argv[i], "-postvalid")) ||
(!strcmp(argv[i], "--postvalid"))) {
postvalid++;
loaddtd++;
options |= XML_PARSE_DTDLOAD;
} else if ((!strcmp(argv[i], "-dtdvalid")) ||
(!strcmp(argv[i], "--dtdvalid"))) {
i++;
dtdvalid = argv[i];
loaddtd++;
options |= XML_PARSE_DTDLOAD;
} else if ((!strcmp(argv[i], "-dtdvalidfpi")) ||
(!strcmp(argv[i], "--dtdvalidfpi"))) {
i++;
dtdvalidfpi = argv[i];
loaddtd++;
options |= XML_PARSE_DTDLOAD;
}
#endif /* LIBXML_VALID_ENABLED */
else if ((!strcmp(argv[i], "-dropdtd")) ||
(!strcmp(argv[i], "--dropdtd")))
dropdtd++;
else if ((!strcmp(argv[i], "-insert")) ||
(!strcmp(argv[i], "--insert")))
insert++;
else if ((!strcmp(argv[i], "-timing")) ||
(!strcmp(argv[i], "--timing")))
timing++;
else if ((!strcmp(argv[i], "-auto")) ||
(!strcmp(argv[i], "--auto")))
generate++;
else if ((!strcmp(argv[i], "-repeat")) ||
(!strcmp(argv[i], "--repeat"))) {
if (repeat)
repeat *= 10;
else
repeat = 100;
}
#ifdef LIBXML_PUSH_ENABLED
else if ((!strcmp(argv[i], "-push")) ||
(!strcmp(argv[i], "--push")))
push++;
#endif /* LIBXML_PUSH_ENABLED */
#ifdef HAVE_SYS_MMAN_H
else if ((!strcmp(argv[i], "-memory")) ||
(!strcmp(argv[i], "--memory")))
memory++;
#endif
else if ((!strcmp(argv[i], "-testIO")) ||
(!strcmp(argv[i], "--testIO")))
testIO++;
#ifdef LIBXML_XINCLUDE_ENABLED
else if ((!strcmp(argv[i], "-xinclude")) ||
(!strcmp(argv[i], "--xinclude"))) {
xinclude++;
options |= XML_PARSE_XINCLUDE;
}
else if ((!strcmp(argv[i], "-noxincludenode")) ||
(!strcmp(argv[i], "--noxincludenode"))) {
xinclude++;
options |= XML_PARSE_XINCLUDE;
options |= XML_PARSE_NOXINCNODE;
}
else if ((!strcmp(argv[i], "-nofixup-base-uris")) ||
(!strcmp(argv[i], "--nofixup-base-uris"))) {
xinclude++;
options |= XML_PARSE_XINCLUDE;
options |= XML_PARSE_NOBASEFIX;
}
#endif
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
else if ((!strcmp(argv[i], "-compress")) ||
(!strcmp(argv[i], "--compress"))) {
compress++;
xmlSetCompressMode(9);
}
#endif
#endif /* LIBXML_OUTPUT_ENABLED */
else if ((!strcmp(argv[i], "-nowarning")) ||
(!strcmp(argv[i], "--nowarning"))) {
xmlGetWarningsDefaultValue = 0;
xmlPedanticParserDefault(0);
options |= XML_PARSE_NOWARNING;
}
else if ((!strcmp(argv[i], "-pedantic")) ||
(!strcmp(argv[i], "--pedantic"))) {
xmlGetWarningsDefaultValue = 1;
xmlPedanticParserDefault(1);
options |= XML_PARSE_PEDANTIC;
}
#ifdef LIBXML_DEBUG_ENABLED
else if ((!strcmp(argv[i], "-debugent")) ||
(!strcmp(argv[i], "--debugent"))) {
debugent++;
xmlParserDebugEntities = 1;
}
#endif
#ifdef LIBXML_C14N_ENABLED
else if ((!strcmp(argv[i], "-c14n")) ||
(!strcmp(argv[i], "--c14n"))) {
canonical++;
options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
}
else if ((!strcmp(argv[i], "-c14n11")) ||
(!strcmp(argv[i], "--c14n11"))) {
canonical_11++;
options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
}
else if ((!strcmp(argv[i], "-exc-c14n")) ||
(!strcmp(argv[i], "--exc-c14n"))) {
exc_canonical++;
options |= XML_PARSE_NOENT | XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD;
}
#endif
#ifdef LIBXML_CATALOG_ENABLED
else if ((!strcmp(argv[i], "-catalogs")) ||
(!strcmp(argv[i], "--catalogs"))) {
catalogs++;
} else if ((!strcmp(argv[i], "-nocatalogs")) ||
(!strcmp(argv[i], "--nocatalogs"))) {
nocatalogs++;
}
#endif
else if ((!strcmp(argv[i], "-encode")) ||
(!strcmp(argv[i], "--encode"))) {
i++;
encoding = argv[i];
/*
* OK it's for testing purposes
*/
xmlAddEncodingAlias("UTF-8", "DVEnc");
}
else if ((!strcmp(argv[i], "-noblanks")) ||
(!strcmp(argv[i], "--noblanks"))) {
noblanks++;
xmlKeepBlanksDefault(0);
}
else if ((!strcmp(argv[i], "-maxmem")) ||
(!strcmp(argv[i], "--maxmem"))) {
i++;
if (sscanf(argv[i], "%d", &maxmem) == 1) {
xmlMemSetup(myFreeFunc, myMallocFunc, myReallocFunc,
myStrdupFunc);
} else {
maxmem = 0;
}
}
else if ((!strcmp(argv[i], "-format")) ||
(!strcmp(argv[i], "--format"))) {
noblanks++;
#ifdef LIBXML_OUTPUT_ENABLED
format++;
#endif /* LIBXML_OUTPUT_ENABLED */
xmlKeepBlanksDefault(0);
}
#ifdef LIBXML_READER_ENABLED
else if ((!strcmp(argv[i], "-stream")) ||
(!strcmp(argv[i], "--stream"))) {
stream++;
}
else if ((!strcmp(argv[i], "-walker")) ||
(!strcmp(argv[i], "--walker"))) {
walker++;
noout++;
}
#endif /* LIBXML_READER_ENABLED */
#ifdef LIBXML_SAX1_ENABLED
else if ((!strcmp(argv[i], "-sax1")) ||
(!strcmp(argv[i], "--sax1"))) {
sax1++;
options |= XML_PARSE_SAX1;
}
#endif /* LIBXML_SAX1_ENABLED */
else if ((!strcmp(argv[i], "-sax")) ||
(!strcmp(argv[i], "--sax"))) {
sax++;
}
else if ((!strcmp(argv[i], "-chkregister")) ||
(!strcmp(argv[i], "--chkregister"))) {
chkregister++;
#ifdef LIBXML_SCHEMAS_ENABLED
} else if ((!strcmp(argv[i], "-relaxng")) ||
(!strcmp(argv[i], "--relaxng"))) {
i++;
relaxng = argv[i];
noent++;
options |= XML_PARSE_NOENT;
} else if ((!strcmp(argv[i], "-schema")) ||
(!strcmp(argv[i], "--schema"))) {
i++;
schema = argv[i];
noent++;
#endif
#ifdef LIBXML_SCHEMATRON_ENABLED
} else if ((!strcmp(argv[i], "-schematron")) ||
(!strcmp(argv[i], "--schematron"))) {
i++;
schematron = argv[i];
noent++;
#endif
} else if ((!strcmp(argv[i], "-nonet")) ||
(!strcmp(argv[i], "--nonet"))) {
options |= XML_PARSE_NONET;
xmlSetExternalEntityLoader(xmlNoNetExternalEntityLoader);
} else if ((!strcmp(argv[i], "-nocompact")) ||
(!strcmp(argv[i], "--nocompact"))) {
options &= ~XML_PARSE_COMPACT;
} else if ((!strcmp(argv[i], "-load-trace")) ||
(!strcmp(argv[i], "--load-trace"))) {
load_trace++;
} else if ((!strcmp(argv[i], "-path")) ||
(!strcmp(argv[i], "--path"))) {
i++;
parsePath(BAD_CAST argv[i]);
#ifdef LIBXML_PATTERN_ENABLED
} else if ((!strcmp(argv[i], "-pattern")) ||
(!strcmp(argv[i], "--pattern"))) {
i++;
pattern = argv[i];
#endif
#ifdef LIBXML_XPATH_ENABLED
} else if ((!strcmp(argv[i], "-xpath")) ||
(!strcmp(argv[i], "--xpath"))) {
i++;
noout++;
xpathquery = argv[i];
#endif
} else if ((!strcmp(argv[i], "-oldxml10")) ||
(!strcmp(argv[i], "--oldxml10"))) {
oldxml10++;
options |= XML_PARSE_OLD10;
} else {
fprintf(stderr, "Unknown option %s\n", argv[i]);
usage(argv[0]);
return(1);
}
}
#ifdef LIBXML_CATALOG_ENABLED
if (nocatalogs == 0) {
if (catalogs) {
const char *catal;
catal = getenv("SGML_CATALOG_FILES");
if (catal != NULL) {
xmlLoadCatalogs(catal);
} else {
fprintf(stderr, "Variable $SGML_CATALOG_FILES not set\n");
}
}
}
#endif
#ifdef LIBXML_SAX1_ENABLED
if (sax1)
xmlSAXDefaultVersion(1);
else
xmlSAXDefaultVersion(2);
#endif /* LIBXML_SAX1_ENABLED */
if (chkregister) {
xmlRegisterNodeDefault(registerNode);
xmlDeregisterNodeDefault(deregisterNode);
}
indent = getenv("XMLLINT_INDENT");
if(indent != NULL) {
xmlTreeIndentString = indent;
}
defaultEntityLoader = xmlGetExternalEntityLoader();
xmlSetExternalEntityLoader(xmllintExternalEntityLoader);
xmlLineNumbersDefault(1);
if (loaddtd != 0)
xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
if (dtdattrs)
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
if (noent != 0) xmlSubstituteEntitiesDefault(1);
#ifdef LIBXML_VALID_ENABLED
if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
#endif /* LIBXML_VALID_ENABLED */
if ((htmlout) && (!nowrap)) {
xmlGenericError(xmlGenericErrorContext,
"\n");
xmlGenericError(xmlGenericErrorContext,
"%s output\n",
argv[0]);
xmlGenericError(xmlGenericErrorContext,
"%s output
\n",
argv[0]);
}
#ifdef LIBXML_SCHEMATRON_ENABLED
if ((schematron != NULL) && (sax == 0)
#ifdef LIBXML_READER_ENABLED
&& (stream == 0)
#endif /* LIBXML_READER_ENABLED */
) {
xmlSchematronParserCtxtPtr ctxt;
/* forces loading the DTDs */
xmlLoadExtDtdDefaultValue |= 1;
options |= XML_PARSE_DTDLOAD;
if (timing) {
startTimer();
}
ctxt = xmlSchematronNewParserCtxt(schematron);
#if 0
xmlSchematronSetParserErrors(ctxt,
(xmlSchematronValidityErrorFunc) fprintf,
(xmlSchematronValidityWarningFunc) fprintf,
stderr);
#endif
wxschematron = xmlSchematronParse(ctxt);
if (wxschematron == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Schematron schema %s failed to compile\n", schematron);
progresult = XMLLINT_ERR_SCHEMACOMP;
schematron = NULL;
}
xmlSchematronFreeParserCtxt(ctxt);
if (timing) {
endTimer("Compiling the schemas");
}
}
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
if ((relaxng != NULL) && (sax == 0)
#ifdef LIBXML_READER_ENABLED
&& (stream == 0)
#endif /* LIBXML_READER_ENABLED */
) {
xmlRelaxNGParserCtxtPtr ctxt;
/* forces loading the DTDs */
xmlLoadExtDtdDefaultValue |= 1;
options |= XML_PARSE_DTDLOAD;
if (timing) {
startTimer();
}
ctxt = xmlRelaxNGNewParserCtxt(relaxng);
xmlRelaxNGSetParserErrors(ctxt,
(xmlRelaxNGValidityErrorFunc) fprintf,
(xmlRelaxNGValidityWarningFunc) fprintf,
stderr);
relaxngschemas = xmlRelaxNGParse(ctxt);
if (relaxngschemas == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Relax-NG schema %s failed to compile\n", relaxng);
progresult = XMLLINT_ERR_SCHEMACOMP;
relaxng = NULL;
}
xmlRelaxNGFreeParserCtxt(ctxt);
if (timing) {
endTimer("Compiling the schemas");
}
} else if ((schema != NULL)
#ifdef LIBXML_READER_ENABLED
&& (stream == 0)
#endif
) {
xmlSchemaParserCtxtPtr ctxt;
if (timing) {
startTimer();
}
ctxt = xmlSchemaNewParserCtxt(schema);
xmlSchemaSetParserErrors(ctxt,
(xmlSchemaValidityErrorFunc) fprintf,
(xmlSchemaValidityWarningFunc) fprintf,
stderr);
wxschemas = xmlSchemaParse(ctxt);
if (wxschemas == NULL) {
xmlGenericError(xmlGenericErrorContext,
"WXS schema %s failed to compile\n", schema);
progresult = XMLLINT_ERR_SCHEMACOMP;
schema = NULL;
}
xmlSchemaFreeParserCtxt(ctxt);
if (timing) {
endTimer("Compiling the schemas");
}
}
#endif /* LIBXML_SCHEMAS_ENABLED */
#ifdef LIBXML_PATTERN_ENABLED
if ((pattern != NULL)
#ifdef LIBXML_READER_ENABLED
&& (walker == 0)
#endif
) {
patternc = xmlPatterncompile((const xmlChar *) pattern, NULL, 0, NULL);
if (patternc == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Pattern %s failed to compile\n", pattern);
progresult = XMLLINT_ERR_SCHEMAPAT;
pattern = NULL;
}
}
#endif /* LIBXML_PATTERN_ENABLED */
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-encode")) ||
(!strcmp(argv[i], "--encode"))) {
i++;
continue;
} else if ((!strcmp(argv[i], "-o")) ||
(!strcmp(argv[i], "-output")) ||
(!strcmp(argv[i], "--output"))) {
i++;
continue;
}
#ifdef LIBXML_VALID_ENABLED
if ((!strcmp(argv[i], "-dtdvalid")) ||
(!strcmp(argv[i], "--dtdvalid"))) {
i++;
continue;
}
if ((!strcmp(argv[i], "-path")) ||
(!strcmp(argv[i], "--path"))) {
i++;
continue;
}
if ((!strcmp(argv[i], "-dtdvalidfpi")) ||
(!strcmp(argv[i], "--dtdvalidfpi"))) {
i++;
continue;
}
#endif /* LIBXML_VALID_ENABLED */
if ((!strcmp(argv[i], "-relaxng")) ||
(!strcmp(argv[i], "--relaxng"))) {
i++;
continue;
}
if ((!strcmp(argv[i], "-maxmem")) ||
(!strcmp(argv[i], "--maxmem"))) {
i++;
continue;
}
if ((!strcmp(argv[i], "-schema")) ||
(!strcmp(argv[i], "--schema"))) {
i++;
continue;
}
if ((!strcmp(argv[i], "-schematron")) ||
(!strcmp(argv[i], "--schematron"))) {
i++;
continue;
}
#ifdef LIBXML_PATTERN_ENABLED
if ((!strcmp(argv[i], "-pattern")) ||
(!strcmp(argv[i], "--pattern"))) {
i++;
continue;
}
#endif
#ifdef LIBXML_XPATH_ENABLED
if ((!strcmp(argv[i], "-xpath")) ||
(!strcmp(argv[i], "--xpath"))) {
i++;
continue;
}
#endif
if ((timing) && (repeat))
startTimer();
/* Remember file names. "-" means stdin. */
if ((argv[i][0] != '-') || (strcmp(argv[i], "-") == 0)) {
if (repeat) {
xmlParserCtxtPtr ctxt = NULL;
for (acount = 0;acount < repeat;acount++) {
#ifdef LIBXML_READER_ENABLED
if (stream != 0) {
streamFile(argv[i]);
} else {
#endif /* LIBXML_READER_ENABLED */
if (sax) {
testSAX(argv[i]);
} else {
if (ctxt == NULL)
ctxt = xmlNewParserCtxt();
parseAndPrintFile(argv[i], ctxt);
}
#ifdef LIBXML_READER_ENABLED
}
#endif /* LIBXML_READER_ENABLED */
}
if (ctxt != NULL)
xmlFreeParserCtxt(ctxt);
} else {
nbregister = 0;
#ifdef LIBXML_READER_ENABLED
if (stream != 0)
streamFile(argv[i]);
else
#endif /* LIBXML_READER_ENABLED */
if (sax) {
testSAX(argv[i]);
} else {
parseAndPrintFile(argv[i], NULL);
}
if ((chkregister) && (nbregister != 0)) {
fprintf(stderr, "Registration count off: %d\n", nbregister);
progresult = XMLLINT_ERR_RDREGIS;
}
}
files ++;
if ((timing) && (repeat)) {
endTimer("%d iterations", repeat);
}
}
}
if (generate)
parseAndPrintFile(NULL, NULL);
if ((htmlout) && (!nowrap)) {
xmlGenericError(xmlGenericErrorContext, "\n");
}
if ((files == 0) && (!generate) && (version == 0)) {
usage(argv[0]);
}
#ifdef LIBXML_SCHEMATRON_ENABLED
if (wxschematron != NULL)
xmlSchematronFree(wxschematron);
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
if (relaxngschemas != NULL)
xmlRelaxNGFree(relaxngschemas);
if (wxschemas != NULL)
xmlSchemaFree(wxschemas);
xmlRelaxNGCleanupTypes();
#endif
#ifdef LIBXML_PATTERN_ENABLED
if (patternc != NULL)
xmlFreePattern(patternc);
#endif
xmlCleanupParser();
xmlMemoryDump();
return(progresult);
}
0707010002b1fa000081a40000000000000000000000014cb7d88500006be2000000b500010002ffffffffffffffff0000003a00000000root/usr/local/share/doc/libxml2-2.7.7/examples/testSAX.c /*
* testSAX.c : a small tester program for parsing using the SAX API.
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#include "libxml.h"
#ifdef HAVE_SYS_TIME_H
#include
#endif
#ifdef HAVE_SYS_TIMEB_H
#include
#endif
#ifdef HAVE_TIME_H
#include
#endif
#ifdef LIBXML_SAX1_ENABLED
#include
#include
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_SYS_STAT_H
#include
#endif
#ifdef HAVE_FCNTL_H
#include
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_STDLIB_H
#include
#endif
#ifdef HAVE_STRING_H
#include
#endif
#include
#include
#include
#include /* only for xmlNewInputFromFile() */
#include
#include
#include
static int debug = 0;
static int copy = 0;
static int recovery = 0;
static int push = 0;
static int speed = 0;
static int noent = 0;
static int quiet = 0;
static int nonull = 0;
static int sax2 = 0;
static int repeat = 0;
static int callbacks = 0;
static int timing = 0;
/*
* Timing routines.
*/
/*
* Internal timing routines to remove the necessity to have unix-specific
* function calls
*/
#ifndef HAVE_GETTIMEOFDAY
#ifdef HAVE_SYS_TIMEB_H
#ifdef HAVE_SYS_TIME_H
#ifdef HAVE_FTIME
static int
my_gettimeofday(struct timeval *tvp, void *tzp)
{
struct timeb timebuffer;
ftime(&timebuffer);
if (tvp) {
tvp->tv_sec = timebuffer.time;
tvp->tv_usec = timebuffer.millitm * 1000L;
}
return (0);
}
#define HAVE_GETTIMEOFDAY 1
#define gettimeofday my_gettimeofday
#endif /* HAVE_FTIME */
#endif /* HAVE_SYS_TIME_H */
#endif /* HAVE_SYS_TIMEB_H */
#endif /* !HAVE_GETTIMEOFDAY */
#if defined(HAVE_GETTIMEOFDAY)
static struct timeval begin, end;
/*
* startTimer: call where you want to start timing
*/
static void
startTimer(void)
{
gettimeofday(&begin, NULL);
}
/*
* endTimer: call where you want to stop timing and to print out a
* message about the timing performed; format is a printf
* type argument
*/
static void XMLCDECL
endTimer(const char *fmt, ...)
{
long msec;
va_list ap;
gettimeofday(&end, NULL);
msec = end.tv_sec - begin.tv_sec;
msec *= 1000;
msec += (end.tv_usec - begin.tv_usec) / 1000;
#ifndef HAVE_STDARG_H
#error "endTimer required stdarg functions"
#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, " took %ld ms\n", msec);
}
#elif defined(HAVE_TIME_H)
/*
* No gettimeofday function, so we have to make do with calling clock.
* This is obviously less accurate, but there's little we can do about
* that.
*/
#ifndef CLOCKS_PER_SEC
#define CLOCKS_PER_SEC 100
#endif
static clock_t begin, end;
static void
startTimer(void)
{
begin = clock();
}
static void XMLCDECL
endTimer(const char *fmt, ...)
{
long msec;
va_list ap;
end = clock();
msec = ((end - begin) * 1000) / CLOCKS_PER_SEC;
#ifndef HAVE_STDARG_H
#error "endTimer required stdarg functions"
#endif
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
fprintf(stderr, " took %ld ms\n", msec);
}
#else
/*
* We don't have a gettimeofday or time.h, so we just don't do timing
*/
static void
startTimer(void)
{
/*
* Do nothing
*/
}
static void XMLCDECL
endTimer(char *format, ...)
{
/*
* We cannot do anything because we don't have a timing function
*/
#ifdef HAVE_STDARG_H
va_start(ap, format);
vfprintf(stderr, format, ap);
va_end(ap);
fprintf(stderr, " was not timed\n", msec);
#else
/* We don't have gettimeofday, time or stdarg.h, what crazy world is
* this ?!
*/
#endif
}
#endif
/*
* empty SAX block
*/
static xmlSAXHandler emptySAXHandlerStruct = {
NULL, /* internalSubset */
NULL, /* isStandalone */
NULL, /* hasInternalSubset */
NULL, /* hasExternalSubset */
NULL, /* resolveEntity */
NULL, /* getEntity */
NULL, /* entityDecl */
NULL, /* notationDecl */
NULL, /* attributeDecl */
NULL, /* elementDecl */
NULL, /* unparsedEntityDecl */
NULL, /* setDocumentLocator */
NULL, /* startDocument */
NULL, /* endDocument */
NULL, /* startElement */
NULL, /* endElement */
NULL, /* reference */
NULL, /* characters */
NULL, /* ignorableWhitespace */
NULL, /* processingInstruction */
NULL, /* comment */
NULL, /* xmlParserWarning */
NULL, /* xmlParserError */
NULL, /* xmlParserError */
NULL, /* getParameterEntity */
NULL, /* cdataBlock; */
NULL, /* externalSubset; */
1,
NULL,
NULL, /* startElementNs */
NULL, /* endElementNs */
NULL /* xmlStructuredErrorFunc */
};
static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
extern xmlSAXHandlerPtr debugSAXHandler;
/************************************************************************
* *
* Debug Handlers *
* *
************************************************************************/
/**
* isStandaloneDebug:
* @ctxt: An XML parser context
*
* Is this document tagged standalone ?
*
* Returns 1 if true
*/
static int
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return(0);
fprintf(stdout, "SAX.isStandalone()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*
* Returns 1 if true
*/
static int
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return(0);
fprintf(stdout, "SAX.hasInternalSubset()\n");
return(0);
}
/**
* hasExternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an external subset
*
* Returns 1 if true
*/
static int
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return(0);
fprintf(stdout, "SAX.hasExternalSubset()\n");
return(0);
}
/**
* internalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*/
static void
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.internalSubset(%s,", name);
if (ExternalID == NULL)
fprintf(stdout, " ,");
else
fprintf(stdout, " %s,", ExternalID);
if (SystemID == NULL)
fprintf(stdout, " )\n");
else
fprintf(stdout, " %s)\n", SystemID);
}
/**
* externalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an external subset
*/
static void
externalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.externalSubset(%s,", name);
if (ExternalID == NULL)
fprintf(stdout, " ,");
else
fprintf(stdout, " %s,", ExternalID);
if (SystemID == NULL)
fprintf(stdout, " )\n");
else
fprintf(stdout, " %s)\n", SystemID);
}
/**
* resolveEntityDebug:
* @ctxt: An XML parser context
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
* The default behaviour is to NOT resolve the entities, in that case
* the ENTITY_REF nodes are built in the structure (and the parameter
* values).
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
{
callbacks++;
if (quiet)
return(NULL);
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
fprintf(stdout, "SAX.resolveEntity(");
if (publicId != NULL)
fprintf(stdout, "%s", (char *)publicId);
else
fprintf(stdout, " ");
if (systemId != NULL)
fprintf(stdout, ", %s)\n", (char *)systemId);
else
fprintf(stdout, ", )\n");
/*********
if (systemId != NULL) {
return(xmlNewInputFromFile(ctxt, (char *) systemId));
}
*********/
return(NULL);
}
/**
* getEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get an entity by name
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (quiet)
return(NULL);
fprintf(stdout, "SAX.getEntity(%s)\n", name);
return(NULL);
}
/**
* getParameterEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get a parameter entity by name
*
* Returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (quiet)
return(NULL);
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
return(NULL);
}
/**
* entityDeclDebug:
* @ctxt: An XML parser context
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
*
* An entity definition has been parsed
*/
static void
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{
const xmlChar *nullstr = BAD_CAST "(null)";
/* not all libraries handle printing null pointers nicely */
if (publicId == NULL)
publicId = nullstr;
if (systemId == NULL)
systemId = nullstr;
if (content == NULL)
content = (xmlChar *)nullstr;
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
name, type, publicId, systemId, content);
}
/**
* attributeDeclDebug:
* @ctxt: An XML parser context
* @name: the attribute name
* @type: the attribute type
*
* An attribute definition has been parsed
*/
static void
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem,
const xmlChar * name, int type, int def,
const xmlChar * defaultValue, xmlEnumerationPtr tree)
{
callbacks++;
if (quiet)
return;
if (defaultValue == NULL)
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, NULL, ...)\n",
elem, name, type, def);
else
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
elem, name, type, def, defaultValue);
xmlFreeEnumeration(tree);
}
/**
* elementDeclDebug:
* @ctxt: An XML parser context
* @name: the element name
* @type: the element type
* @content: the element value (without processing).
*
* An element definition has been parsed
*/
static void
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
xmlElementContentPtr content ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
name, type);
}
/**
* notationDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
static void
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId);
}
/**
* unparsedEntityDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
static void
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName)
{
const xmlChar *nullstr = BAD_CAST "(null)";
if (publicId == NULL)
publicId = nullstr;
if (systemId == NULL)
systemId = nullstr;
if (notationName == NULL)
notationName = nullstr;
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId,
(char *) notationName);
}
/**
* setDocumentLocatorDebug:
* @ctxt: An XML parser context
* @loc: A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
*/
static void
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.setDocumentLocator()\n");
}
/**
* startDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document start being processed.
*/
static void
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.startDocument()\n");
}
/**
* endDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document end has been detected.
*/
static void
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.endDocument()\n");
}
/**
* startElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when an opening tag has been processed.
*/
static void
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
{
int i;
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.startElement(%s", (char *) name);
if (atts != NULL) {
for (i = 0;(atts[i] != NULL);i++) {
fprintf(stdout, ", %s='", atts[i++]);
if (atts[i] != NULL)
fprintf(stdout, "%s'", atts[i]);
}
}
fprintf(stdout, ")\n");
}
/**
* endElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when the end of an element has been detected.
*/
static void
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
callbacks++;
if (quiet)
return;
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
}
/**
* charactersDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
*/
static void
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
char output[40];
int i;
callbacks++;
if (quiet)
return;
for (i = 0;(i 0) {
ctxt = xmlCreatePushParserCtxt(emptySAXHandler, NULL,
chars, ret, filename);
while ((ret = fread(chars, 1, 3, f)) > 0) {
xmlParseChunk(ctxt, chars, ret, 0);
}
xmlParseChunk(ctxt, chars, 0, 1);
xmlFreeParserCtxt(ctxt);
}
fclose(f);
} else {
xmlGenericError(xmlGenericErrorContext,
"Cannot read file %s\n", filename);
}
}
/*
* Debug callback
*/
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int ret;
char chars[10];
xmlParserCtxtPtr ctxt;
ret = fread(chars, 1, 4, f);
if (ret > 0) {
if (sax2)
ctxt = xmlCreatePushParserCtxt(debugSAX2Handler, NULL,
chars, ret, filename);
else
ctxt = xmlCreatePushParserCtxt(debugSAXHandler, NULL,
chars, ret, filename);
while ((ret = fread(chars, 1, 3, f)) > 0) {
xmlParseChunk(ctxt, chars, ret, 0);
}
ret = xmlParseChunk(ctxt, chars, 0, 1);
xmlFreeParserCtxt(ctxt);
if (ret != 0) {
fprintf(stdout,
"xmlSAXUserParseFile returned error %d\n", ret);
}
}
fclose(f);
}
} else {
#endif /* LIBXML_PUSH_ENABLED */
if (!speed) {
/*
* Empty callbacks for checking
*/
if ((!quiet) && (!nonull)) {
res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
}
/*
* Debug callback
*/
callbacks = 0;
if (repeat) {
int i;
for (i = 0;i < 99;i++) {
if (sax2)
res = xmlSAXUserParseFile(debugSAX2Handler, NULL,
filename);
else
res = xmlSAXUserParseFile(debugSAXHandler, NULL,
filename);
}
}
if (sax2)
res = xmlSAXUserParseFile(debugSAX2Handler, NULL, filename);
else
res = xmlSAXUserParseFile(debugSAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
if (quiet)
fprintf(stdout, "%d callbacks generated\n", callbacks);
} else {
/*
* test 100x the SAX parse
*/
int i;
for (i = 0; i<100;i++)
res = xmlSAXUserParseFile(emptySAXHandler, NULL, filename);
if (res != 0) {
fprintf(stdout, "xmlSAXUserParseFile returned error %d\n", res);
}
}
#ifdef LIBXML_PUSH_ENABLED
}
#endif
}
int main(int argc, char **argv) {
int i;
int files = 0;
LIBXML_TEST_VERSION /* be safe, plus calls xmlInitParser */
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;
else if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
copy++;
else if ((!strcmp(argv[i], "-recover")) ||
(!strcmp(argv[i], "--recover")))
recovery++;
else if ((!strcmp(argv[i], "-push")) ||
(!strcmp(argv[i], "--push")))
#ifdef LIBXML_PUSH_ENABLED
push++;
#else
fprintf(stderr,"'push' not enabled in library - ignoring\n");
#endif /* LIBXML_PUSH_ENABLED */
else if ((!strcmp(argv[i], "-speed")) ||
(!strcmp(argv[i], "--speed")))
speed++;
else if ((!strcmp(argv[i], "-timing")) ||
(!strcmp(argv[i], "--timing"))) {
nonull++;
timing++;
quiet++;
} else if ((!strcmp(argv[i], "-repeat")) ||
(!strcmp(argv[i], "--repeat"))) {
repeat++;
quiet++;
} else if ((!strcmp(argv[i], "-noent")) ||
(!strcmp(argv[i], "--noent")))
noent++;
else if ((!strcmp(argv[i], "-quiet")) ||
(!strcmp(argv[i], "--quiet")))
quiet++;
else if ((!strcmp(argv[i], "-sax2")) ||
(!strcmp(argv[i], "--sax2")))
sax2++;
else if ((!strcmp(argv[i], "-nonull")) ||
(!strcmp(argv[i], "--nonull")))
nonull++;
}
if (noent != 0) xmlSubstituteEntitiesDefault(1);
for (i = 1; i < argc ; i++) {
if (argv[i][0] != '-') {
if (timing) {
startTimer();
}
parseAndPrintFile(argv[i]);
if (timing) {
endTimer("Parsing");
}
files ++;
}
}
xmlCleanupParser();
xmlMemoryDump();
return(0);
}
#else
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : SAX1 parsing support not compiled in\n", argv[0]);
return(0);
}
#endif /* LIBXML_SAX1_ENABLED */
0707010002b1fb000081a40000000000000000000000014cb7d8850000170c000000b500010002ffffffffffffffff0000003c00000000root/usr/local/share/doc/libxml2-2.7.7/examples/testXPath.c /*
* testXPath.c : a small tester program for XPath.
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#include "libxml.h"
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
#include
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_SYS_STAT_H
#include
#endif
#ifdef HAVE_FCNTL_H
#include
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_STDLIB_H
#include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#if defined(LIBXML_XPTR_ENABLED)
#include
static int xptr = 0;
#endif
static int debug = 0;
static int valid = 0;
static int expr = 0;
static int tree = 0;
static int nocdata = 0;
static xmlDocPtr document = NULL;
/*
* Default document
*/
static xmlChar buffer[] =
"\n\
\n\
\n\
Welcome to Gnome\n\
\n\
\n\
The Linux adventure\n\
bla bla bla ...
\n\
\n\
...
\n\
\n\
\n\
Chapter 2\n\
this is chapter 2 ...
\n\
\n\
\n\
Chapter 3\n\
this is chapter 3 ...
\n\
\n\
\n\
";
static void
testXPath(const char *str) {
xmlXPathObjectPtr res;
xmlXPathContextPtr ctxt;
#if defined(LIBXML_XPTR_ENABLED)
if (xptr) {
ctxt = xmlXPtrNewContext(document, NULL, NULL);
res = xmlXPtrEval(BAD_CAST str, ctxt);
} else {
#endif
ctxt = xmlXPathNewContext(document);
ctxt->node = xmlDocGetRootElement(document);
if (expr)
res = xmlXPathEvalExpression(BAD_CAST str, ctxt);
else {
/* res = xmlXPathEval(BAD_CAST str, ctxt); */
xmlXPathCompExprPtr comp;
comp = xmlXPathCompile(BAD_CAST str);
if (comp != NULL) {
if (tree)
xmlXPathDebugDumpCompExpr(stdout, comp, 0);
res = xmlXPathCompiledEval(comp, ctxt);
xmlXPathFreeCompExpr(comp);
} else
res = NULL;
}
#if defined(LIBXML_XPTR_ENABLED)
}
#endif
xmlXPathDebugDumpObject(stdout, res, 0);
xmlXPathFreeObject(res);
xmlXPathFreeContext(ctxt);
}
static void
testXPathFile(const char *filename) {
FILE *input;
char expression[5000];
int len;
input = fopen(filename, "r");
if (input == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Cannot open %s for reading\n", filename);
return;
}
while (fgets(expression, 4500, input) != NULL) {
len = strlen(expression);
len--;
while ((len >= 0) &&
((expression[len] == '\n') || (expression[len] == '\t') ||
(expression[len] == '\r') || (expression[len] == ' '))) len--;
expression[len + 1] = 0;
if (len >= 0) {
printf("\n========================\nExpression: %s\n", expression) ;
testXPath(expression);
}
}
fclose(input);
}
int main(int argc, char **argv) {
int i;
int strings = 0;
int usefile = 0;
char *filename = NULL;
for (i = 1; i < argc ; i++) {
#if defined(LIBXML_XPTR_ENABLED)
if ((!strcmp(argv[i], "-xptr")) || (!strcmp(argv[i], "--xptr")))
xptr++;
else
#endif
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;
else if ((!strcmp(argv[i], "-valid")) || (!strcmp(argv[i], "--valid")))
valid++;
else if ((!strcmp(argv[i], "-expr")) || (!strcmp(argv[i], "--expr")))
expr++;
else if ((!strcmp(argv[i], "-tree")) || (!strcmp(argv[i], "--tree")))
tree++;
else if ((!strcmp(argv[i], "-nocdata")) ||
(!strcmp(argv[i], "--nocdata")))
nocdata++;
else if ((!strcmp(argv[i], "-i")) || (!strcmp(argv[i], "--input")))
filename = argv[++i];
else if ((!strcmp(argv[i], "-f")) || (!strcmp(argv[i], "--file")))
usefile++;
}
if (valid != 0) xmlDoValidityCheckingDefaultValue = 1;
xmlLoadExtDtdDefaultValue |= XML_DETECT_IDS;
xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS;
xmlSubstituteEntitiesDefaultValue = 1;
if (nocdata != 0) {
xmlDefaultSAXHandlerInit();
xmlDefaultSAXHandler.cdataBlock = NULL;
}
if (document == NULL) {
if (filename == NULL)
document = xmlReadDoc(buffer,NULL,NULL,XML_PARSE_COMPACT);
else
document = xmlReadFile(filename,NULL,XML_PARSE_COMPACT);
}
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-i")) || (!strcmp(argv[i], "--input"))) {
i++; continue;
}
if (argv[i][0] != '-') {
if (usefile)
testXPathFile(argv[i]);
else
testXPath(argv[i]);
strings ++;
}
}
if (strings == 0) {
printf("Usage : %s [--debug] [--copy] stringsorfiles ...\n",
argv[0]);
printf("\tParse the XPath strings and output the result of the parsing\n");
printf("\t--debug : dump a debug version of the result\n");
printf("\t--valid : switch on DTD support in the parser\n");
#if defined(LIBXML_XPTR_ENABLED)
printf("\t--xptr : expressions are XPointer expressions\n");
#endif
printf("\t--expr : debug XPath expressions only\n");
printf("\t--tree : show the compiled XPath tree\n");
printf("\t--nocdata : do not generate CDATA nodes\n");
printf("\t--input filename : or\n");
printf("\t-i filename : read the document from filename\n");
printf("\t--file : or\n");
printf("\t-f : read queries from files, args\n");
}
if (document != NULL)
xmlFreeDoc(document);
xmlCleanupParser();
xmlMemoryDump();
return(0);
}
#else
#include
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : XPath/Debug support not compiled in\n", argv[0]);
return(0);
}
#endif /* LIBXML_XPATH_ENABLED */
0707010002b1f9000081a40000000000000000000000014cb7d885000052ba000000b500010002ffffffffffffffff0000003b00000000root/usr/local/share/doc/libxml2-2.7.7/examples/testHTML.c /*
* testHTML.c : a small tester program for HTML input.
*
* See Copyright for the status of this software.
*
* daniel@veillard.com
*/
#include "libxml.h"
#ifdef LIBXML_HTML_ENABLED
#include
#include
#ifdef HAVE_SYS_TYPES_H
#include
#endif
#ifdef HAVE_SYS_STAT_H
#include
#endif
#ifdef HAVE_FCNTL_H
#include
#endif
#ifdef HAVE_UNISTD_H
#include
#endif
#ifdef HAVE_STDLIB_H
#include
#endif
#include
#include
#include
#include
#include
#include
#ifdef LIBXML_DEBUG_ENABLED
static int debug = 0;
#endif
static int copy = 0;
static int sax = 0;
static int repeat = 0;
static int noout = 0;
#ifdef LIBXML_PUSH_ENABLED
static int push = 0;
#endif /* LIBXML_PUSH_ENABLED */
static char *encoding = NULL;
static int options = 0;
static xmlSAXHandler emptySAXHandlerStruct = {
NULL, /* internalSubset */
NULL, /* isStandalone */
NULL, /* hasInternalSubset */
NULL, /* hasExternalSubset */
NULL, /* resolveEntity */
NULL, /* getEntity */
NULL, /* entityDecl */
NULL, /* notationDecl */
NULL, /* attributeDecl */
NULL, /* elementDecl */
NULL, /* unparsedEntityDecl */
NULL, /* setDocumentLocator */
NULL, /* startDocument */
NULL, /* endDocument */
NULL, /* startElement */
NULL, /* endElement */
NULL, /* reference */
NULL, /* characters */
NULL, /* ignorableWhitespace */
NULL, /* processingInstruction */
NULL, /* comment */
NULL, /* xmlParserWarning */
NULL, /* xmlParserError */
NULL, /* xmlParserError */
NULL, /* getParameterEntity */
NULL, /* cdataBlock */
NULL, /* externalSubset */
1, /* initialized */
NULL, /* private */
NULL, /* startElementNsSAX2Func */
NULL, /* endElementNsSAX2Func */
NULL /* xmlStructuredErrorFunc */
};
static xmlSAXHandlerPtr emptySAXHandler = &emptySAXHandlerStruct;
extern xmlSAXHandlerPtr debugSAXHandler;
/************************************************************************
* *
* Debug Handlers *
* *
************************************************************************/
/**
* isStandaloneDebug:
* @ctxt: An XML parser context
*
* Is this document tagged standalone ?
*
* Returns 1 if true
*/
static int
isStandaloneDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.isStandalone()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*
* Returns 1 if true
*/
static int
hasInternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.hasInternalSubset()\n");
return(0);
}
/**
* hasExternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an external subset
*
* Returns 1 if true
*/
static int
hasExternalSubsetDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.hasExternalSubset()\n");
return(0);
}
/**
* hasInternalSubsetDebug:
* @ctxt: An XML parser context
*
* Does this document has an internal subset
*/
static void
internalSubsetDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *ExternalID, const xmlChar *SystemID)
{
fprintf(stdout, "SAX.internalSubset(%s,", name);
if (ExternalID == NULL)
fprintf(stdout, " ,");
else
fprintf(stdout, " %s,", ExternalID);
if (SystemID == NULL)
fprintf(stdout, " )\n");
else
fprintf(stdout, " %s)\n", SystemID);
}
/**
* resolveEntityDebug:
* @ctxt: An XML parser context
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
* The default behaviour is to NOT resolve the entities, in that case
* the ENTITY_REF nodes are built in the structure (and the parameter
* values).
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlParserInputPtr
resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xmlChar *systemId)
{
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
fprintf(stdout, "SAX.resolveEntity(");
if (publicId != NULL)
fprintf(stdout, "%s", (char *)publicId);
else
fprintf(stdout, " ");
if (systemId != NULL)
fprintf(stdout, ", %s)\n", (char *)systemId);
else
fprintf(stdout, ", )\n");
/*********
if (systemId != NULL) {
return(xmlNewInputFromFile(ctxt, (char *) systemId));
}
*********/
return(NULL);
}
/**
* getEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get an entity by name
*
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
*/
static xmlEntityPtr
getEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.getEntity(%s)\n", name);
return(NULL);
}
/**
* getParameterEntityDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* Get a parameter entity by name
*
* Returns the xmlParserInputPtr
*/
static xmlEntityPtr
getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.getParameterEntity(%s)\n", name);
return(NULL);
}
/**
* entityDeclDebug:
* @ctxt: An XML parser context
* @name: the entity name
* @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
*
* An entity definition has been parsed
*/
static void
entityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
const xmlChar *publicId, const xmlChar *systemId, xmlChar *content)
{
fprintf(stdout, "SAX.entityDecl(%s, %d, %s, %s, %s)\n",
name, type, publicId, systemId, content);
}
/**
* attributeDeclDebug:
* @ctxt: An XML parser context
* @name: the attribute name
* @type: the attribute type
*
* An attribute definition has been parsed
*/
static void
attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *elem, const xmlChar *name,
int type, int def, const xmlChar *defaultValue,
xmlEnumerationPtr tree ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.attributeDecl(%s, %s, %d, %d, %s, ...)\n",
elem, name, type, def, defaultValue);
}
/**
* elementDeclDebug:
* @ctxt: An XML parser context
* @name: the element name
* @type: the element type
* @content: the element value (without processing).
*
* An element definition has been parsed
*/
static void
elementDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, int type,
xmlElementContentPtr content ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.elementDecl(%s, %d, ...)\n",
name, type);
}
/**
* notationDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the notation
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
*
* What to do when a notation declaration has been parsed.
*/
static void
notationDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId)
{
fprintf(stdout, "SAX.notationDecl(%s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId);
}
/**
* unparsedEntityDeclDebug:
* @ctxt: An XML parser context
* @name: The name of the entity
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @notationName: the name of the notation
*
* What to do when an unparsed entity declaration is parsed
*/
static void
unparsedEntityDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
const xmlChar *publicId, const xmlChar *systemId,
const xmlChar *notationName)
{
fprintf(stdout, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
(char *) name, (char *) publicId, (char *) systemId,
(char *) notationName);
}
/**
* setDocumentLocatorDebug:
* @ctxt: An XML parser context
* @loc: A SAX Locator
*
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
*/
static void
setDocumentLocatorDebug(void *ctx ATTRIBUTE_UNUSED, xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.setDocumentLocator()\n");
}
/**
* startDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document start being processed.
*/
static void
startDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.startDocument()\n");
}
/**
* endDocumentDebug:
* @ctxt: An XML parser context
*
* called when the document end has been detected.
*/
static void
endDocumentDebug(void *ctx ATTRIBUTE_UNUSED)
{
fprintf(stdout, "SAX.endDocument()\n");
}
/**
* startElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when an opening tag has been processed.
*/
static void
startElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name, const xmlChar **atts)
{
int i;
fprintf(stdout, "SAX.startElement(%s", (char *) name);
if (atts != NULL) {
for (i = 0;(atts[i] != NULL);i++) {
fprintf(stdout, ", %s", atts[i++]);
if (atts[i] != NULL) {
unsigned char output[40];
const unsigned char *att = atts[i];
int outlen, attlen;
fprintf(stdout, "='");
while ((attlen = strlen((char*)att)) > 0) {
outlen = sizeof output - 1;
htmlEncodeEntities(output, &outlen, att, &attlen, '\'');
output[outlen] = 0;
fprintf(stdout, "%s", (char *) output);
att += attlen;
}
fprintf(stdout, "'");
}
}
}
fprintf(stdout, ")\n");
}
/**
* endElementDebug:
* @ctxt: An XML parser context
* @name: The element name
*
* called when the end of an element has been detected.
*/
static void
endElementDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.endElement(%s)\n", (char *) name);
}
/**
* charactersDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
*
* receiving some chars from the parser.
* Question: how much at a time ???
*/
static void
charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
unsigned char output[40];
int inlen = len, outlen = 30;
htmlEncodeEntities(output, &outlen, ch, &inlen, 0);
output[outlen] = 0;
fprintf(stdout, "SAX.characters(%s, %d)\n", output, len);
}
/**
* cdataDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @len: the number of xmlChar
*
* receiving some cdata chars from the parser.
* Question: how much at a time ???
*/
static void
cdataDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
unsigned char output[40];
int inlen = len, outlen = 30;
htmlEncodeEntities(output, &outlen, ch, &inlen, 0);
output[outlen] = 0;
fprintf(stdout, "SAX.cdata(%s, %d)\n", output, len);
}
/**
* referenceDebug:
* @ctxt: An XML parser context
* @name: The entity name
*
* called when an entity reference is detected.
*/
static void
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
{
fprintf(stdout, "SAX.reference(%s)\n", name);
}
/**
* ignorableWhitespaceDebug:
* @ctxt: An XML parser context
* @ch: a xmlChar string
* @start: the first char in the string
* @len: the number of xmlChar
*
* receiving some ignorable whitespaces from the parser.
* Question: how much at a time ???
*/
static void
ignorableWhitespaceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
{
char output[40];
int i;
for (i = 0;(i 0) {
ctxt = htmlCreatePushParserCtxt(emptySAXHandler, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
fclose(f);
}
if (!noout) {
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
htmlParserCtxtPtr ctxt;
/* if (repeat) */
size = 4096;
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(debugSAXHandler, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
fclose(f);
}
}
} else {
#endif /* LIBXML_PUSH_ENABLED */
doc = htmlSAXParseFile(filename, NULL, emptySAXHandler, NULL);
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
if (!noout) {
/*
* Debug callback
*/
doc = htmlSAXParseFile(filename, NULL, debugSAXHandler, NULL);
if (doc != NULL) {
fprintf(stdout, "htmlSAXParseFile returned non-NULL\n");
xmlFreeDoc(doc);
}
}
#ifdef LIBXML_PUSH_ENABLED
}
#endif /* LIBXML_PUSH_ENABLED */
}
static void
parseAndPrintFile(char *filename) {
htmlDocPtr doc = NULL;
/*
* build an HTML tree from a string;
*/
#ifdef LIBXML_PUSH_ENABLED
if (push) {
FILE *f;
#if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
f = fopen(filename, "rb");
#else
f = fopen(filename, "r");
#endif
if (f != NULL) {
int res, size = 3;
char chars[4096];
htmlParserCtxtPtr ctxt;
/* if (repeat) */
size = 4096;
res = fread(chars, 1, 4, f);
if (res > 0) {
ctxt = htmlCreatePushParserCtxt(NULL, NULL,
chars, res, filename, XML_CHAR_ENCODING_NONE);
while ((res = fread(chars, 1, size, f)) > 0) {
htmlParseChunk(ctxt, chars, res, 0);
}
htmlParseChunk(ctxt, chars, 0, 1);
doc = ctxt->myDoc;
htmlFreeParserCtxt(ctxt);
}
fclose(f);
}
} else {
doc = htmlReadFile(filename, NULL, options);
}
#else
doc = htmlReadFile(filename,NULL,options);
#endif
if (doc == NULL) {
xmlGenericError(xmlGenericErrorContext,
"Could not parse %s\n", filename);
}
#ifdef LIBXML_TREE_ENABLED
/*
* test intermediate copy if needed.
*/
if (copy) {
htmlDocPtr tmp;
tmp = doc;
doc = xmlCopyDoc(doc, 1);
xmlFreeDoc(tmp);
}
#endif
#ifdef LIBXML_OUTPUT_ENABLED
/*
* print it.
*/
if (!noout) {
#ifdef LIBXML_DEBUG_ENABLED
if (!debug) {
if (encoding)
htmlSaveFileEnc("-", doc, encoding);
else
htmlDocDump(stdout, doc);
} else
xmlDebugDumpDocument(stdout, doc);
#else
if (encoding)
htmlSaveFileEnc("-", doc, encoding);
else
htmlDocDump(stdout, doc);
#endif
}
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* free it.
*/
xmlFreeDoc(doc);
}
int main(int argc, char **argv) {
int i, count;
int files = 0;
for (i = 1; i < argc ; i++) {
#ifdef LIBXML_DEBUG_ENABLED
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
debug++;
else
#endif
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
copy++;
#ifdef LIBXML_PUSH_ENABLED
else if ((!strcmp(argv[i], "-push")) || (!strcmp(argv[i], "--push")))
push++;
#endif /* LIBXML_PUSH_ENABLED */
else if ((!strcmp(argv[i], "-sax")) || (!strcmp(argv[i], "--sax")))
sax++;
else if ((!strcmp(argv[i], "-noout")) || (!strcmp(argv[i], "--noout")))
noout++;
else if ((!strcmp(argv[i], "-repeat")) ||
(!strcmp(argv[i], "--repeat")))
repeat++;
else if ((!strcmp(argv[i], "-encode")) ||
(!strcmp(argv[i], "--encode"))) {
i++;
encoding = argv[i];
}
}
for (i = 1; i < argc ; i++) {
if ((!strcmp(argv[i], "-encode")) ||
(!strcmp(argv[i], "--encode"))) {
i++;
continue;
}
if (argv[i][0] != '-') {
if (repeat) {
for (count = 0;count < 100 * repeat;count++) {
if (sax)
parseSAXFile(argv[i]);
else
parseAndPrintFile(argv[i]);
}
} else {
if (sax)
parseSAXFile(argv[i]);
else
parseAndPrintFile(argv[i]);
}
files ++;
}
}
if (files == 0) {
printf("Usage : %s [--debug] [--copy] [--copy] HTMLfiles ...\n",
argv[0]);
printf("\tParse the HTML files and output the result of the parsing\n");
#ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n");
#endif
printf("\t--copy : used to test the internal copy implementation\n");
printf("\t--sax : debug the sequence of SAX callbacks\n");
printf("\t--repeat : parse the file 100 times, for timing\n");
printf("\t--noout : do not print the result\n");
#ifdef LIBXML_PUSH_ENABLED
printf("\t--push : use the push mode parser\n");
#endif /* LIBXML_PUSH_ENABLED */
printf("\t--encode encoding : output in the given encoding\n");
}
xmlCleanupParser();
xmlMemoryDump();
return(0);
}
#else /* !LIBXML_HTML_ENABLED */
#include
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : HTML support not compiled in\n", argv[0]);
return(0);
}
#endif
0707010002b1f7000081a40000000000000000000000014cb7d885000005da000000b500010002ffffffffffffffff0000003100000000root/usr/local/share/doc/libxml2-2.7.7/Copyright Except where otherwise noted in the source code (e.g. the files hash.c,
list.c and the trio files, which are covered by a similar licence but
with different Copyright notices) all the files are:
Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is fur-
nished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of Daniel Veillard shall not
be used in advertising or otherwise to promote the sale, use or other deal-
ings in this Software without prior written authorization from him.
0707010002b1fd000041ed0000000000000000000000044cb7d88c00000000000000b500010002ffffffffffffffff0000002c00000000root/usr/local/share/doc/libxml2-2.7.7/html 0707010002b254000081a40000000000000000000000014cb7d88500000079000000b500010002ffffffffffffffff0000003600000000root/usr/local/share/doc/libxml2-2.7.7/html/tree1.res node type: Element, name: doc
node type: Element, name: src
node type: Element, name: dest
node type: Element, name: src
0707010002b24d000081a40000000000000000000000014cb7d88500000ad4000000b500010002ffffffffffffffff0000003e00000000root/usr/local/share/doc/libxml2-2.7.7/html/smallfootonly.gif GIF89a0 <