Imported Upstream version 2.9.11 upstream/2.9.11
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Jun 2021 06:33:41 +0000 (15:33 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 29 Jun 2021 06:33:41 +0000 (15:33 +0900)
433 files changed:
.gitattributes [new file with mode: 0644]
.gitignore [new file with mode: 0644]
.gitlab-ci.yml [new file with mode: 0644]
.travis.yml [new file with mode: 0644]
CMakeLists.txt [new file with mode: 0644]
ChangeLog
HTMLparser.c
HTMLtree.c
INSTALL.libxml2
Makefile.am
Makefile.tests
README
SAX2.c
TODO
bakefile/Readme.txt
buf.c
c14n.c
catalog.c
config.h.cmake.in [new file with mode: 0644]
configure.ac
debugXML.c
dict.c
doc/APIchunk1.html
doc/APIchunk10.html
doc/APIchunk11.html
doc/APIchunk12.html
doc/APIchunk13.html
doc/APIchunk14.html
doc/APIchunk15.html
doc/APIchunk16.html
doc/APIchunk17.html
doc/APIchunk19.html
doc/APIchunk2.html
doc/APIchunk20.html
doc/APIchunk21.html
doc/APIchunk22.html
doc/APIchunk23.html
doc/APIchunk24.html
doc/APIchunk25.html
doc/APIchunk28.html
doc/APIchunk29.html
doc/APIchunk3.html
doc/APIchunk4.html
doc/APIchunk6.html
doc/APIchunk7.html
doc/APIchunk8.html
doc/APIfiles.html
doc/APIsymbols.html
doc/apibuild.py
doc/devhelp/general.html
doc/devhelp/libxml2-HTMLtree.html
doc/devhelp/libxml2-SAX2.html
doc/devhelp/libxml2-debugXML.html
doc/devhelp/libxml2-encoding.html
doc/devhelp/libxml2-nanoftp.html
doc/devhelp/libxml2-nanohttp.html
doc/devhelp/libxml2-parser.html
doc/devhelp/libxml2-parserInternals.html
doc/devhelp/libxml2-relaxng.html
doc/devhelp/libxml2-tree.html
doc/devhelp/libxml2-xinclude.html
doc/devhelp/libxml2-xmlIO.html
doc/devhelp/libxml2-xmlerror.html
doc/devhelp/libxml2-xmlexports.html
doc/devhelp/libxml2-xmlreader.html
doc/devhelp/libxml2-xmlregexp.html
doc/devhelp/libxml2-xmlsave.html
doc/devhelp/libxml2-xmlschemas.html
doc/devhelp/libxml2-xmlversion.html
doc/devhelp/libxml2-xpath.html
doc/devhelp/libxml2.devhelp
doc/examples/examples.xml
doc/examples/index.html
doc/examples/reader1.c
doc/examples/testWriter.c
doc/guidelines.html
doc/html/book1.html
doc/html/index.html
doc/html/libxml-HTMLtree.html
doc/html/libxml-SAX2.html
doc/html/libxml-debugXML.html
doc/html/libxml-encoding.html
doc/html/libxml-lib.html
doc/html/libxml-nanoftp.html
doc/html/libxml-nanohttp.html
doc/html/libxml-parser.html
doc/html/libxml-parserInternals.html
doc/html/libxml-relaxng.html
doc/html/libxml-tree.html
doc/html/libxml-xinclude.html
doc/html/libxml-xmlIO.html
doc/html/libxml-xmlerror.html
doc/html/libxml-xmlexports.html
doc/html/libxml-xmlreader.html
doc/html/libxml-xmlregexp.html
doc/html/libxml-xmlsave.html
doc/html/libxml-xmlschemas.html
doc/html/libxml-xmlversion.html
doc/html/libxml-xpath.html
doc/html/libxml.devhelp
doc/index.py
doc/libxml2-api.xml
doc/libxml2-refs.xml
doc/libxml2.xsa
doc/news.html
doc/python.html
doc/symbols.xml
doc/xml.html
doc/xmlreader.html
encoding.c
entities.c
error.c
fuzz/.gitignore [new file with mode: 0644]
fuzz/Makefile.am [new file with mode: 0644]
fuzz/README [new file with mode: 0644]
fuzz/fuzz.c [new file with mode: 0644]
fuzz/fuzz.h [new file with mode: 0644]
fuzz/genSeed.c [new file with mode: 0644]
fuzz/html.c [new file with mode: 0644]
fuzz/html.dict [new file with mode: 0644]
fuzz/html.options [new file with mode: 0644]
fuzz/regexp.c [new file with mode: 0644]
fuzz/regexp.dict [new file with mode: 0644]
fuzz/regexp.options [new file with mode: 0644]
fuzz/schema.c [new file with mode: 0644]
fuzz/schema.dict [new file with mode: 0644]
fuzz/schema.options [new file with mode: 0644]
fuzz/seed/regexp/branch-1 [new file with mode: 0644]
fuzz/seed/regexp/branch-10 [new file with mode: 0644]
fuzz/seed/regexp/branch-11 [new file with mode: 0644]
fuzz/seed/regexp/branch-12 [new file with mode: 0644]
fuzz/seed/regexp/branch-13 [new file with mode: 0644]
fuzz/seed/regexp/branch-2 [new file with mode: 0644]
fuzz/seed/regexp/branch-3 [new file with mode: 0644]
fuzz/seed/regexp/branch-4 [new file with mode: 0644]
fuzz/seed/regexp/branch-5 [new file with mode: 0644]
fuzz/seed/regexp/branch-6 [new file with mode: 0644]
fuzz/seed/regexp/branch-7 [new file with mode: 0644]
fuzz/seed/regexp/branch-8 [new file with mode: 0644]
fuzz/seed/regexp/branch-9 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-1 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-10 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-11 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-12 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-13 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-14 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-15 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-16 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-2 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-3 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-4 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-5 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-6 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-7 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-8 [new file with mode: 0644]
fuzz/seed/regexp/bug316338-9 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-1 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-2 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-3 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-4 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-5 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-6 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-7 [new file with mode: 0644]
fuzz/seed/regexp/bug420596-8 [new file with mode: 0644]
fuzz/seed/regexp/content-1 [new file with mode: 0644]
fuzz/seed/regexp/content-10 [new file with mode: 0644]
fuzz/seed/regexp/content-2 [new file with mode: 0644]
fuzz/seed/regexp/content-3 [new file with mode: 0644]
fuzz/seed/regexp/content-4 [new file with mode: 0644]
fuzz/seed/regexp/content-5 [new file with mode: 0644]
fuzz/seed/regexp/content-6 [new file with mode: 0644]
fuzz/seed/regexp/content-7 [new file with mode: 0644]
fuzz/seed/regexp/content-8 [new file with mode: 0644]
fuzz/seed/regexp/content-9 [new file with mode: 0644]
fuzz/seed/regexp/hard-1 [new file with mode: 0644]
fuzz/seed/regexp/hard-10 [new file with mode: 0644]
fuzz/seed/regexp/hard-2 [new file with mode: 0644]
fuzz/seed/regexp/hard-3 [new file with mode: 0644]
fuzz/seed/regexp/hard-4 [new file with mode: 0644]
fuzz/seed/regexp/hard-5 [new file with mode: 0644]
fuzz/seed/regexp/hard-6 [new file with mode: 0644]
fuzz/seed/regexp/hard-7 [new file with mode: 0644]
fuzz/seed/regexp/hard-8 [new file with mode: 0644]
fuzz/seed/regexp/hard-9 [new file with mode: 0644]
fuzz/seed/regexp/ncname-1 [new file with mode: 0644]
fuzz/seed/regexp/ncname-2 [new file with mode: 0644]
fuzz/seed/regexp/ncname-3 [new file with mode: 0644]
fuzz/seed/regexp/ncname-4 [new file with mode: 0644]
fuzz/seed/regexp/ncname-5 [new file with mode: 0644]
fuzz/seed/regexp/ranges-1 [new file with mode: 0644]
fuzz/seed/regexp/ranges-10 [new file with mode: 0644]
fuzz/seed/regexp/ranges-11 [new file with mode: 0644]
fuzz/seed/regexp/ranges-12 [new file with mode: 0644]
fuzz/seed/regexp/ranges-2 [new file with mode: 0644]
fuzz/seed/regexp/ranges-3 [new file with mode: 0644]
fuzz/seed/regexp/ranges-4 [new file with mode: 0644]
fuzz/seed/regexp/ranges-5 [new file with mode: 0644]
fuzz/seed/regexp/ranges-6 [new file with mode: 0644]
fuzz/seed/regexp/ranges-7 [new file with mode: 0644]
fuzz/seed/regexp/ranges-8 [new file with mode: 0644]
fuzz/seed/regexp/ranges-9 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-1 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-10 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-11 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-12 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-2 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-3 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-4 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-5 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-6 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-7 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-8 [new file with mode: 0644]
fuzz/seed/regexp/ranges2-9 [new file with mode: 0644]
fuzz/seed/regexp/xpath-1 [new file with mode: 0644]
fuzz/seed/regexp/xpath-10 [new file with mode: 0644]
fuzz/seed/regexp/xpath-11 [new file with mode: 0644]
fuzz/seed/regexp/xpath-12 [new file with mode: 0644]
fuzz/seed/regexp/xpath-13 [new file with mode: 0644]
fuzz/seed/regexp/xpath-14 [new file with mode: 0644]
fuzz/seed/regexp/xpath-15 [new file with mode: 0644]
fuzz/seed/regexp/xpath-16 [new file with mode: 0644]
fuzz/seed/regexp/xpath-17 [new file with mode: 0644]
fuzz/seed/regexp/xpath-18 [new file with mode: 0644]
fuzz/seed/regexp/xpath-19 [new file with mode: 0644]
fuzz/seed/regexp/xpath-2 [new file with mode: 0644]
fuzz/seed/regexp/xpath-20 [new file with mode: 0644]
fuzz/seed/regexp/xpath-21 [new file with mode: 0644]
fuzz/seed/regexp/xpath-22 [new file with mode: 0644]
fuzz/seed/regexp/xpath-23 [new file with mode: 0644]
fuzz/seed/regexp/xpath-24 [new file with mode: 0644]
fuzz/seed/regexp/xpath-25 [new file with mode: 0644]
fuzz/seed/regexp/xpath-26 [new file with mode: 0644]
fuzz/seed/regexp/xpath-27 [new file with mode: 0644]
fuzz/seed/regexp/xpath-28 [new file with mode: 0644]
fuzz/seed/regexp/xpath-29 [new file with mode: 0644]
fuzz/seed/regexp/xpath-3 [new file with mode: 0644]
fuzz/seed/regexp/xpath-30 [new file with mode: 0644]
fuzz/seed/regexp/xpath-31 [new file with mode: 0644]
fuzz/seed/regexp/xpath-32 [new file with mode: 0644]
fuzz/seed/regexp/xpath-33 [new file with mode: 0644]
fuzz/seed/regexp/xpath-34 [new file with mode: 0644]
fuzz/seed/regexp/xpath-35 [new file with mode: 0644]
fuzz/seed/regexp/xpath-4 [new file with mode: 0644]
fuzz/seed/regexp/xpath-5 [new file with mode: 0644]
fuzz/seed/regexp/xpath-6 [new file with mode: 0644]
fuzz/seed/regexp/xpath-7 [new file with mode: 0644]
fuzz/seed/regexp/xpath-8 [new file with mode: 0644]
fuzz/seed/regexp/xpath-9 [new file with mode: 0644]
fuzz/seed/uri/dot [new file with mode: 0644]
fuzz/seed/uri/full [new file with mode: 0644]
fuzz/testFuzzer.c [new file with mode: 0644]
fuzz/uri.c [new file with mode: 0644]
fuzz/uri.options [new file with mode: 0644]
fuzz/xml.c [new file with mode: 0644]
fuzz/xml.dict [new file with mode: 0644]
fuzz/xml.options [new file with mode: 0644]
fuzz/xpath.c [new file with mode: 0644]
fuzz/xpath.dict [new file with mode: 0644]
fuzz/xpath.options [new file with mode: 0644]
gentest.py
globals.c
hash.c
include/libxml/c14n.h
include/libxml/parser.h
include/libxml/tree.h
include/libxml/xmlIO.h
include/libxml/xmlexports.h
include/libxml/xmlschemas.h
include/libxml/xmlversion.h.in
include/libxml/xmlwin32version.h
include/libxml/xmlwin32version.h.in
include/libxml/xpath.h
libxml.m4
libxml2-config.cmake.cmake.in [new file with mode: 0644]
libxml2-config.cmake.in
libxml2.syms
list.c
nanoftp.c
nanohttp.c
optim/TOTRY
os400/iconv/bldcsndfa/ccsid_mibenum.xml
os400/libxmlrpg/catalog.rpgle
os400/libxmlrpg/parser.rpgle
os400/libxmlrpg/schemasInternals.rpgle
os400/libxmlrpg/tree.rpgle
os400/libxmlrpg/xmlIO.rpgle
os400/libxmlrpg/xmlTypesC.rpgle
os400/libxmlrpg/xmlexports.rpgle
os400/libxmlrpg/xmlschemas.rpgle
os400/libxmlrpg/xmlversion.rpgle.in
os400/libxmlrpg/xpath.rpgle
os400/rpgsupport.c
os400/rpgsupport.h
os400/transcode.c
parser.c
parserInternals.c
python/generator.py
python/libxml.c
python/libxml.py
python/libxml2-python-api.xml
python/tests/ctxterror.py
python/tests/nsdel.py
python/tests/reader2.py
python/tests/tstLastError.py
python/tests/validate.py
python/types.c
relaxng.c
result/HTML/758606.html
result/HTML/758606.html.err
result/HTML/758606.html.sax
result/HTML/758606_2.html
result/HTML/758606_2.html.err
result/HTML/758606_2.html.sax
result/HTML/chunked_attr.html [new file with mode: 0644]
result/HTML/chunked_attr.html.err [new file with mode: 0644]
result/HTML/chunked_attr.html.sax [new file with mode: 0644]
result/HTML/comments.html [new file with mode: 0644]
result/HTML/comments.html.err [new file with mode: 0644]
result/HTML/comments.html.sax [new file with mode: 0644]
result/HTML/comments2.html [new file with mode: 0644]
result/HTML/comments2.html.err [new file with mode: 0644]
result/HTML/comments2.html.sax [new file with mode: 0644]
result/HTML/doc3.htm
result/HTML/doc3.htm.err
result/HTML/doc3.htm.sax
result/HTML/wired.html
result/HTML/wired.html.err
result/HTML/wired.html.sax
result/XInclude/fallback3.xml [new file with mode: 0644]
result/XInclude/fallback3.xml.err [new file with mode: 0644]
result/XInclude/fallback3.xml.rdr [new file with mode: 0644]
result/XInclude/fallback4.xml [new file with mode: 0644]
result/XInclude/fallback4.xml.err [new file with mode: 0644]
result/XInclude/fallback4.xml.rdr [new file with mode: 0644]
result/XInclude/fallback5.xml [new file with mode: 0644]
result/XInclude/fallback5.xml.rdr [new file with mode: 0644]
result/XInclude/fallback6.xml [new file with mode: 0644]
result/XInclude/fallback6.xml.rdr [new file with mode: 0644]
result/XInclude/ns1.xml [new file with mode: 0644]
result/XInclude/ns1.xml.rdr [new file with mode: 0644]
result/att7.rde
result/ent6hex [new file with mode: 0644]
result/ent6hex.rde [new file with mode: 0644]
result/ent6hex.rdr [new file with mode: 0644]
result/ent6hex.sax [new file with mode: 0644]
result/ent6hex.sax2 [new file with mode: 0644]
result/ent9.rde
result/errors/754946.xml.ent [new file with mode: 0644]
result/errors/754947.xml.ent [new file with mode: 0644]
result/errors/754947.xml.err
result/errors/758588.xml.ent [new file with mode: 0644]
result/errors/759020.xml.ent [new file with mode: 0644]
result/errors/759398.xml.ent [new file with mode: 0644]
result/errors/759398.xml.err
result/errors/759398.xml.str
result/errors/759573-2.xml.ent [new file with mode: 0644]
result/errors/759573.xml.ent [new file with mode: 0644]
result/errors/759579.xml.ent [new file with mode: 0644]
result/errors/attr1.xml.ent [new file with mode: 0644]
result/errors/attr2.xml.ent [new file with mode: 0644]
result/errors/attr3.xml.ent [new file with mode: 0644]
result/errors/attr4.xml.ent [new file with mode: 0644]
result/errors/cdata.xml.ent [new file with mode: 0644]
result/errors/charref1.xml.ent [new file with mode: 0644]
result/errors/comment1.xml.ent [new file with mode: 0644]
result/errors/content1.xml.ent [new file with mode: 0644]
result/errors/extparsedent.xml.ent [new file with mode: 0644]
result/errors/name.xml.ent [new file with mode: 0644]
result/errors/name2.xml.ent [new file with mode: 0644]
result/errors/rec_ext_ent.xml [new file with mode: 0644]
result/errors/rec_ext_ent.xml.ent [new file with mode: 0644]
result/errors/rec_ext_ent.xml.err [new file with mode: 0644]
result/errors/rec_ext_ent.xml.str [new file with mode: 0644]
result/noent/ent2.sax2
result/noent/ent6hex [new file with mode: 0644]
result/noent/ent6hex.sax2 [new file with mode: 0644]
result/regexp/bug757711 [new file with mode: 0644]
result/regexp/bug757711.err [new file with mode: 0644]
result/regexp/bug783015 [new file with mode: 0644]
result/regexp/bug783015.err [new file with mode: 0644]
result/valid/REC-xml-19980210.xml
runtest.c
runxmlconf.c
schematron.c
test/HTML/chunked_attr.html [new file with mode: 0644]
test/HTML/comments.html [new file with mode: 0644]
test/HTML/comments2.html [new file with mode: 0644]
test/XInclude/docs/fallback3.xml [new file with mode: 0644]
test/XInclude/docs/fallback4.xml [new file with mode: 0644]
test/XInclude/docs/fallback5.xml [new file with mode: 0644]
test/XInclude/docs/fallback6.xml [new file with mode: 0644]
test/XInclude/docs/ns1.xml [new file with mode: 0644]
test/ent6hex [new file with mode: 0644]
test/errors/759398.xml
test/errors/rec_ext.ent [new file with mode: 0644]
test/errors/rec_ext_ent.xml [new file with mode: 0644]
test/regexp/bug757711 [new file with mode: 0644]
test/regexp/bug783015 [new file with mode: 0644]
test/relaxng/tutor11_1_3.xml
test/valid/REC-xml-19980210.xml
testapi.c
threads.c
tree.c
trio.c
trio.h
triodef.h
trionan.c
trionan.h
triop.h
triostr.c
triostr.h
uri.c
valid.c
win32/Makefile.msvc
win32/Readme.txt
win32/VC10/README.vc10
win32/configure.js
xinclude.c
xml2-config.in
xmlIO.c
xmlcatalog.c
xmllint.c
xmlmemory.c
xmlreader.c
xmlregexp.c
xmlsave.c
xmlschemas.c
xmlschemastypes.c
xmlstring.c
xpath.c
xpointer.c
xstc/Makefile.am
xstc/xstc.py

diff --git a/.gitattributes b/.gitattributes
new file mode 100644 (file)
index 0000000..a688634
--- /dev/null
@@ -0,0 +1,2 @@
+/result/** -text
+/test/** -text
diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..ad751e8
--- /dev/null
@@ -0,0 +1,127 @@
+*.exe
+*.o
+*.lo
+*.log
+*.pyc
+*.patch
+.deps
+.libs
+.memdump
+COPYING
+CVE-*
+INSTALL
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+bissect*
+compile
+config.guess
+config.h
+config.h.in
+config.h.in~
+config.log
+config.status
+config.sub
+configure
+dba100000.xml
+depcomp
+doc/Makefile
+doc/Makefile.in
+doc/devhelp/Makefile
+doc/devhelp/Makefile.in
+doc/examples/.deps
+doc/examples/Makefile
+doc/examples/Makefile.in
+doc/examples/io1
+doc/examples/io2
+doc/examples/parse1
+doc/examples/parse2
+doc/examples/parse3
+doc/examples/parse4
+doc/examples/reader1
+doc/examples/reader2
+doc/examples/reader3
+doc/examples/reader4
+doc/examples/testWriter
+doc/examples/tree1
+doc/examples/tree2
+doc/examples/xpath1
+doc/examples/xpath2
+example/.deps
+example/Makefile
+example/Makefile.in
+example/gjobread
+include/Makefile
+include/Makefile.in
+include/libxml/Makefile
+include/libxml/Makefile.in
+include/libxml/xmlversion.h
+install-sh
+libtool
+libxml-2.0-uninstalled.pc
+libxml-2.0.pc
+libxml2-config.cmake
+libxml2.la
+libxml2.spec
+list
+ltmain.sh
+log
+missing
+missing.lst
+m4
+python/.deps
+python/.libs
+python/Makefile
+python/Makefile.in
+python/gen_prog
+python/libxml2-export.c
+python/libxml2-py.c
+python/libxml2-py.h
+python/libxml2.py
+python/libxml2class.py
+python/libxml2class.txt
+python/libxml2mod.la
+python/setup.py
+python/tests/Makefile
+python/tests/Makefile.in
+python/tests/tmp.xml
+runsuite
+runtest
+runxmlconf
+runxmlconf.log
+stamp-h1
+tags
+test.out
+testAutomata
+testC14N
+testHTML
+testModule
+testReader
+testRegexp
+testRelax
+testSAX
+testSchemas
+testThreads
+testURI
+testXPath
+testapi
+testapi.c.new
+testchar
+testdict
+testdso.la
+testlimits
+testrecurse
+tmp
+tst.c
+tst
+xml2-config
+xml2Conf.sh
+xmlcatalog
+xmlconf
+xmllint
+xstc/*-test.py
+xstc/Makefile
+xstc/Makefile.in
+xstc/Tests
+xstc/xsts-*.tar.gz
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..e58ebd0
--- /dev/null
@@ -0,0 +1,277 @@
+.test:
+  # The image was generated with the following Dockerfile. It is also used
+  # for libxslt, that's why we need git and libgcrypt-dev.
+  #
+  # FROM ubuntu:20.04
+  # ENV DEBIAN_FRONTEND=noninteractive
+  # RUN apt-get update && \
+  #     apt-get upgrade -y && \
+  #     apt-get install -y --no-install-recommends \
+  #         curl git ca-certificates \
+  #         autoconf automake libtool pkg-config \
+  #         make gcc clang llvm \
+  #         zlib1g-dev liblzma-dev libgcrypt-dev \
+  #         python-dev python3-dev \
+  #         cmake
+  # WORKDIR /tests
+  # RUN curl https://www.w3.org/XML/Test/xmlts20080827.tar.gz |tar xz
+  image: registry.gitlab.gnome.org/gnome/libxml2
+  script:
+    - |
+      ln -s /tests/xmlconf
+      sh autogen.sh $CONFIG
+      make -j$(nproc) V=1 CFLAGS="$CFLAGS -Werror"
+      make check
+
+gcc:
+  extends: .test
+  variables:
+    CFLAGS: "-O2 -std=c89 -D_XOPEN_SOURCE=700"
+
+gcc:python3:
+  extends: .test
+  only:
+    - schedules
+  variables:
+    CONFIG: "--with-python=/usr/bin/python3"
+    CFLAGS: "-O2"
+
+clang:asan:
+  extends: .test
+  variables:
+    CONFIG: "--without-python"
+    CC: clang
+    CFLAGS: "-O2 -g -fno-omit-frame-pointer -fsanitize=address,undefined,unsigned-integer-overflow -fno-sanitize-recover=all -Wno-error=cast-align"
+    # LeakSanitizer requires SYS_CAP_PTRACE
+    ASAN_OPTIONS: "detect_leaks=0"
+    UBSAN_OPTIONS: "print_stacktrace=1"
+
+clang:msan:
+  extends: .test
+  only:
+    - schedules
+  variables:
+    CONFIG: "--without-python --without-zlib --without-lzma"
+    CC: clang
+    CFLAGS: "-O2 -g -fno-omit-frame-pointer -fsanitize=memory -Wno-error=cast-align"
+
+.cmake:linux:
+  image: registry.gitlab.gnome.org/gnome/libxml2
+  script:
+    - cmake -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBXML2_XMLCONF_WORKING_DIR=/tests -S . -B libxml2-build
+    - cmake --build libxml2-build --target install
+    - mkdir -p libxml2-install/share/libxml2
+    - cp Copyright libxml2-install/share/libxml2
+    - cd libxml2-build
+    - ctest -VV
+  after_script:
+    - cd libxml2-install
+    - tar -czf ../libxml2-$CI_COMMIT_SHORT_SHA-$CC-$SUFFIX.tar.gz *
+  artifacts:
+    paths:
+      - libxml2-$CI_COMMIT_SHORT_SHA-$CC-$SUFFIX.tar.gz
+    expire_in: 1 day
+
+cmake:linux:gcc:shared:
+  extends: .cmake:linux
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "ON"
+    CC: gcc
+    SUFFIX: shared
+
+cmake:linux:gcc:static:
+  extends: .cmake:linux
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "OFF"
+    CC: gcc
+    SUFFIX: static
+
+cmake:linux:clang:shared:
+  extends: .cmake:linux
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "ON"
+    CC: clang
+    SUFFIX: shared
+
+cmake:linux:clang:static:
+  extends: .cmake:linux
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "OFF"
+    CC: clang
+    SUFFIX: static
+
+.cmake:mingw:
+  tags:
+    - win32-ps
+  before_script:
+    - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
+    - $Env:Path="C:\msys64\$Env:MINGW_PATH\bin;C:\msys64\usr\bin;$Env:Path"
+    - pacman --noconfirm -Syu
+    - pacman --noconfirm -S
+        $Env:MINGW_PACKAGE_PREFIX-cmake
+        $Env:MINGW_PACKAGE_PREFIX-libiconv
+        $Env:MINGW_PACKAGE_PREFIX-ninja
+        $Env:MINGW_PACKAGE_PREFIX-python
+        $Env:MINGW_PACKAGE_PREFIX-python2
+        $Env:MINGW_PACKAGE_PREFIX-xz
+        $Env:MINGW_PACKAGE_PREFIX-zlib
+    - if (-not (Test-Path 7za.exe)) {
+        Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
+        cmake -E tar xf 7z1900-extra.7z 7za.exe
+      }
+    - if (-not (Test-Path libxml2-build/xmlconf)) {
+        Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz ;
+        .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
+      }
+  script:
+    - cmake -G Ninja -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B libxml2-build
+    - cmake --build libxml2-build --target install
+    - New-Item -ItemType Directory libxml2-install\share\libxml2
+    - Copy-Item Copyright libxml2-install\share\libxml2
+    - cd libxml2-build
+    - ctest -VV
+  after_script:
+    - .\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:MINGW_PACKAGE_PREFIX-$Env:SUFFIX.7z .\libxml2-install\*
+  cache:
+    key: "$MINGW_PACKAGE_PREFIX"
+    paths:
+      - libxml2-build/xmlconf/
+      - 7za.exe
+  artifacts:
+    paths:
+      - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:MINGW_PACKAGE_PREFIX-$Env:SUFFIX.7z
+    expire_in: 1 day
+
+cmake:mingw:w64-i686:shared:
+  extends: .cmake:mingw
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "ON"
+    MINGW_PACKAGE_PREFIX: mingw-w64-i686
+    MINGW_PATH: mingw32
+    SUFFIX: shared
+
+cmake:mingw:w64-i686:static:
+  extends: .cmake:mingw
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "OFF"
+    MINGW_PACKAGE_PREFIX: mingw-w64-i686
+    MINGW_PATH: mingw32
+    SUFFIX: static
+
+cmake:mingw:w64-x86_64:shared:
+  extends: .cmake:mingw
+  variables:
+    BUILD_SHARED_LIBS: "ON"
+    MINGW_PACKAGE_PREFIX: mingw-w64-x86_64
+    MINGW_PATH: mingw64
+    SUFFIX: shared
+
+cmake:mingw:w64-x86_64:static:
+  extends: .cmake:mingw
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "OFF"
+    MINGW_PACKAGE_PREFIX: mingw-w64-x86_64
+    MINGW_PATH: mingw64
+    SUFFIX: static
+
+.cmake:msvc:
+  tags:
+    - win32-ps
+  variables:
+    CMAKE_VERSION: 3.19.4
+  before_script:
+    - "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12"
+    - if (-not (Test-Path cmake-$Env:CMAKE_VERSION-win64-x64)) {
+        Invoke-WebRequest -Uri http://github.com/Kitware/CMake/releases/download/v$Env:CMAKE_VERSION/cmake-$Env:CMAKE_VERSION-win64-x64.zip -OutFile cmake-$Env:CMAKE_VERSION-win64-x64.zip ;
+        Expand-Archive cmake-$Env:CMAKE_VERSION-win64-x64.zip -DestinationPath .
+      }
+    - $Env:Path="$Env:CI_PROJECT_DIR\cmake-$Env:CMAKE_VERSION-win64-x64\bin;$Env:Path"
+    - if (-not (Test-Path 7za.exe)) {
+        Invoke-WebRequest -Uri https://www.7-zip.org/a/7z1900-extra.7z -OutFile 7z1900-extra.7z ;
+        cmake -E tar xf 7z1900-extra.7z 7za.exe
+      }
+    - if (-not (Test-Path libxml2-build/xmlconf)) {
+        Invoke-WebRequest -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz -OutFile xmlts20080827.tar.gz ;
+        .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
+      }
+  script:
+    - cmake -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DLIBXML2_WITH_ICONV=OFF -DLIBXML2_WITH_LZMA=OFF -DLIBXML2_WITH_PYTHON=OFF -DLIBXML2_WITH_ZLIB=OFF -S . -B libxml2-build
+    - cmake --build libxml2-build --config Debug --target install
+    - cmake --build libxml2-build --config Release --target install
+    - New-Item -ItemType Directory libxml2-install\share\libxml2
+    - Copy-Item Copyright libxml2-install\share\libxml2
+    - cd libxml2-build
+    - ctest -C Debug -VV
+    - ctest -C Release -VV
+  after_script:
+    - .\7za.exe a libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:CMAKE_GENERATOR_TOOLSET-$Env:CMAKE_GENERATOR_PLATFORM-$Env:SUFFIX.7z .\libxml2-install\*
+  cache:
+    key: "msvc"
+    paths:
+      - cmake-$Env:CMAKE_VERSION-win64-x64/
+      - libxml2-build/xmlconf/
+      - 7za.exe
+  artifacts:
+    paths:
+      - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:CMAKE_GENERATOR_TOOLSET-$Env:CMAKE_GENERATOR_PLATFORM-$Env:SUFFIX.7z
+    expire_in: 1 day
+
+.cmake:msvc:v141:
+  extends: .cmake:msvc
+  variables:
+    CMAKE_GENERATOR: Visual Studio 15 2017
+    CMAKE_GENERATOR_TOOLSET: v141
+
+.cmake:msvc:v141:x64:
+  extends: .cmake:msvc:v141
+  variables:
+    CMAKE_GENERATOR_PLATFORM: x64
+
+cmake:msvc:v141:x64:shared:
+  extends: .cmake:msvc:v141:x64
+  variables:
+    BUILD_SHARED_LIBS: "ON"
+    SUFFIX: shared
+
+cmake:msvc:v141:x64:static:
+  extends: .cmake:msvc:v141:x64
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "OFF"
+    SUFFIX: static
+
+.cmake:msvc:v141:x86:
+  extends: .cmake:msvc:v141
+  only:
+    - schedules
+  variables:
+    CMAKE_GENERATOR_PLATFORM: Win32
+
+cmake:msvc:v141:x86:shared:
+  extends: .cmake:msvc:v141:x86
+  only:
+    - schedules
+  variables:
+    BUILD_SHARED_LIBS: "ON"
+    SUFFIX: shared
+
+cmake:msvc:v141:x86:static:
+  extends: .cmake:msvc:v141:x86
+  variables:
+    BUILD_SHARED_LIBS: "OFF"
+    SUFFIX: static
diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..358e8cb
--- /dev/null
@@ -0,0 +1,23 @@
+language: c
+sudo: false
+addons:
+  apt:
+    packages:
+      # Some tests require the DTDs.
+      w3c-sgml-lib
+matrix:
+  include:
+    # Try to emulate a C89 compiler on a POSIX system by disabling as many
+    # GNU extensions as possible.
+    - compiler: gcc
+      env: CFLAGS="-O2 -std=c89 -D_XOPEN_SOURCE=700 -Werror -Wno-error=array-bounds"
+    # clang with AddressSanitizer and UndefinedBehaviorSanitizer.
+    - compiler: clang
+      sudo: required
+      dist: trusty
+      env: CONFIG="--without-python"
+           CFLAGS="-O2 -g -fno-omit-frame-pointer -fsanitize=address,undefined,unsigned-integer-overflow -fno-sanitize-recover=all -Werror -Wno-error=cast-align"
+           UBSAN_OPTIONS=print_stacktrace=1
+script: sh autogen.sh $CONFIG && make -j2 V=1 && make check
+git:
+  depth: 10
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a437717
--- /dev/null
@@ -0,0 +1,765 @@
+cmake_minimum_required(VERSION 3.15)
+
+project(libxml2 VERSION 2.9.10 LANGUAGES C)
+
+include(CheckCSourceCompiles)
+include(CheckFunctionExists)
+include(CheckIncludeFiles)
+include(CheckLibraryExists)
+include(CheckStructHasMember)
+include(CheckSymbolExists)
+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
+
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+set(LIBXML2_WITH_AUTOMATA ON)
+option(LIBXML2_WITH_C14N "Add the Canonicalization support" ON)
+option(LIBXML2_WITH_CATALOG "Add the Catalog support" ON)
+option(LIBXML2_WITH_DEBUG "Add the debugging module" ON)
+option(LIBXML2_WITH_DOCB "Add Docbook SGML support" ON)
+set(LIBXML2_WITH_EXPR ON)
+option(LIBXML2_WITH_FTP "Add the FTP support" ON)
+option(LIBXML2_WITH_HTML "Add the HTML support" ON)
+option(LIBXML2_WITH_HTTP "Add the HTTP support" ON)
+option(LIBXML2_WITH_ICONV "Add ICONV support" ON)
+option(LIBXML2_WITH_ICU "Add ICU support" OFF)
+option(LIBXML2_WITH_ISO8859X "Add ISO8859X support if no iconv" ON)
+option(LIBXML2_WITH_LEGACY "Add deprecated APIs for compatibility" ON)
+option(LIBXML2_WITH_LZMA "Use liblzma" ON)
+option(LIBXML2_WITH_MEM_DEBUG "Add the memory debugging module" OFF)
+option(LIBXML2_WITH_MODULES "Add the dynamic modules support" ON)
+option(LIBXML2_WITH_OUTPUT "Add the serialization support" ON)
+option(LIBXML2_WITH_PATTERN "Add the xmlPattern selection interface" ON)
+option(LIBXML2_WITH_PROGRAMS "Build programs" ON)
+option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" ON)
+option(LIBXML2_WITH_PYTHON "Build Python bindings" ON)
+option(LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON)
+option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" ON)
+option(LIBXML2_WITH_RUN_DEBUG "Add the runtime debugging module" OFF)
+option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" ON)
+option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON)
+option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON)
+option(LIBXML2_WITH_TESTS "Build tests" ON)
+option(LIBXML2_WITH_THREADS "Add multithread support" ON)
+option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF)
+option(LIBXML2_WITH_TREE "Add the DOM like tree manipulation APIs" ON)
+set(LIBXML2_WITH_TRIO OFF)
+set(LIBXML2_WITH_UNICODE ON)
+option(LIBXML2_WITH_VALID "Add the DTD validation support" ON)
+option(LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON)
+option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON)
+option(LIBXML2_WITH_XPATH "Add the XPATH support" ON)
+option(LIBXML2_WITH_XPTR "Add the XPointer support" ON)
+option(LIBXML2_WITH_ZLIB "Use libz" ON)
+set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite")
+
+if(LIBXML2_WITH_ICONV)
+       find_package(Iconv REQUIRED)
+endif()
+
+if(LIBXML2_WITH_ICU)
+       find_package(ICU REQUIRED COMPONENTS data i18n uc)
+endif()
+
+if(LIBXML2_WITH_LZMA)
+       find_package(LibLZMA REQUIRED)
+endif()
+
+if(LIBXML2_WITH_PYTHON)
+       check_include_files(unistd.h HAVE_UNISTD_H)
+       check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
+       if(HAVE_UNISTD_H AND HAVE_F_GETFL)
+               find_package(Python COMPONENTS Interpreter Development REQUIRED)
+       else()
+               find_package(Python2 COMPONENTS Interpreter Development REQUIRED)
+               add_library(Python::Python ALIAS Python2::Python)
+               set(Python_EXECUTABLE ${Python2_EXECUTABLE})
+               set(Python_SITEARCH ${Python2_SITEARCH})
+       endif()
+       set(LIBXML2_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+       find_package(Threads REQUIRED)
+endif()
+
+if(LIBXML2_WITH_ZLIB)
+       find_package(ZLIB REQUIRED)
+endif()
+
+foreach(VARIABLE IN ITEMS WITH_AUTOMATA WITH_C14N WITH_CATALOG WITH_DEBUG WITH_DOCB WITH_EXPR WITH_FTP WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LEGACY WITH_LZMA WITH_MEM_DEBUG WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_RUN_DEBUG WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_TREE WITH_TRIO WITH_UNICODE WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_ZLIB)
+       if(LIBXML2_${VARIABLE})
+               set(${VARIABLE} 1)
+       else()
+               set(${VARIABLE} 0)
+       endif()
+endforeach()
+
+set(LIBXML_MAJOR_VERSION ${PROJECT_VERSION_MAJOR})
+set(LIBXML_MINOR_VERSION ${PROJECT_VERSION_MINOR})
+set(LIBXML_MICRO_VERSION ${PROJECT_VERSION_PATCH})
+
+set(VERSION "${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}")
+set(LIBXML_VERSION ${LIBXML_MAJOR_VERSION}0${LIBXML_MINOR_VERSION}0${LIBXML_MICRO_VERSION})
+set(LIBXML_VERSION_STRING "${LIBXML_VERSION}")
+set(LIBXML_VERSION_EXTRA "")
+set(LIBXML_VERSION_NUMBER ${LIBXML_VERSION})
+
+set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}")
+
+set(PACKAGE "libxml2")
+set(PACKAGE_BUGREPORT "xml@gnome.org")
+set(PACKAGE_NAME "libxml2")
+set(PACKAGE_STRING "libxml2 ${VERSION}")
+set(PACKAGE_TARNAME "libxml2")
+set(PACKAGE_URL "http://www.xmlsoft.org/")
+set(PACKAGE_VERSION ${VERSION})
+
+if(LIBLZMA_FOUND)
+       list(APPEND CMAKE_REQUIRED_LIBRARIES LibLZMA::LibLZMA)
+endif()
+
+if(Threads_FOUND)
+       list(APPEND CMAKE_REQUIRED_LIBRARIES Threads::Threads)
+endif()
+
+if(ZLIB_FOUND)
+       list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB)
+endif()
+
+if(MSVC)
+       configure_file(include/win32config.h config.h COPYONLY)
+else()
+       check_c_source_compiles("
+               void __attribute__((destructor))
+               f(void) {}
+               int main(void) { return 0; }
+       " ATTRIBUTE_DESTRUCTOR)
+       check_c_source_compiles("
+               #include <netdb.h>
+               int main() { (void) gethostbyname((const char*) \"\"); return 0; }
+       " GETHOSTBYNAME_ARG_CAST_CONST)
+       if(NOT GETHOSTBYNAME_ARG_CAST_CONST)
+               set(GETHOSTBYNAME_ARG_CAST "(char *)")
+       else()
+               set(GETHOSTBYNAME_ARG_CAST "/**/")
+       endif()
+       check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
+       check_include_files(arpa/nameser.h HAVE_ARPA_NAMESER_H)
+       check_struct_has_member("struct sockaddr_storage" ss_family "sys/socket.h;sys/types.h" HAVE_SS_FAMILY)
+       check_struct_has_member("struct sockaddr_storage" __ss_family "sys/socket.h;sys/types.h" HAVE_BROKEN_SS_FAMILY)
+       if(HAVE_BROKEN_SS_FAMILY)
+               set(ss_family __ss_family)
+       endif()
+       check_function_exists(class HAVE_CLASS)
+       check_include_files(ctype.h HAVE_CTYPE_H)
+       check_include_files(dirent.h HAVE_DIRENT_H)
+       check_include_files(dlfcn.h HAVE_DLFCN_H)
+       check_library_exists(dl dlopen "" HAVE_DLOPEN)
+       check_include_files(dl.h HAVE_DL_H)
+       check_include_files(errno.h HAVE_ERRNO_H)
+       check_include_files(fcntl.h HAVE_FCNTL_H)
+       check_function_exists(finite HAVE_FINITE)
+       check_include_files(float.h HAVE_FLOAT_H)
+       check_function_exists(fpclass HAVE_FPCLASS)
+       check_function_exists(fprintf HAVE_FPRINTF)
+       check_function_exists(fp_class HAVE_FP_CLASS)
+       check_function_exists(ftime HAVE_FTIME)
+       check_function_exists(getaddrinfo HAVE_GETADDRINFO)
+       check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
+       check_include_files(inttypes.h HAVE_INTTYPES_H)
+       check_function_exists(isascii HAVE_ISASCII)
+       check_function_exists(isinf HAVE_ISINF)
+       check_function_exists(isnan HAVE_ISNAN)
+       check_function_exists(isnand HAVE_ISNAND)
+       check_library_exists(history append_history "" HAVE_LIBHISTORY)
+       check_library_exists(lzma lzma_code "" HAVE_LIBLZMA)
+       check_library_exists(pthread pthread_join "" HAVE_LIBPTHREAD)
+       check_library_exists(readline readline "" HAVE_LIBREADLINE)
+       check_library_exists(z gzread "" HAVE_LIBZ)
+       check_include_files(limits.h HAVE_LIMITS_H)
+       check_function_exists(localtime HAVE_LOCALTIME)
+       check_include_files(lzma.h HAVE_LZMA_H)
+       check_include_files(malloc.h HAVE_MALLOC_H)
+       check_include_files(math.h HAVE_MATH_H)
+       check_include_files(memory.h HAVE_MEMORY_H)
+       check_function_exists(mmap HAVE_MMAP)
+       check_function_exists(munmap HAVE_MUNMAP)
+       check_symbol_exists(DIR ndir.h HAVE_NDIR_H)
+       check_include_files(netdb.h HAVE_NETDB_H)
+       check_include_files(netinet/in.h HAVE_NETINET_IN_H)
+       check_include_files(poll.h HAVE_POLL_H)
+       check_function_exists(printf HAVE_PRINTF)
+       check_include_files(pthread.h HAVE_PTHREAD_H)
+       check_function_exists(putenv HAVE_PUTENV)
+       check_function_exists(rand HAVE_RAND)
+       check_function_exists(rand_r HAVE_RAND_R)
+       check_include_files(resolv.h HAVE_RESOLV_H)
+       check_library_exists(dld shl_load "" HAVE_SHLLOAD)
+       check_function_exists(signal HAVE_SIGNAL)
+       check_include_files(signal.h HAVE_SIGNAL_H)
+       check_function_exists(snprintf HAVE_SNPRINTF)
+       check_function_exists(sprintf HAVE_SPRINTF)
+       check_function_exists(srand HAVE_SRAND)
+       check_function_exists(sscanf HAVE_SSCANF)
+       check_function_exists(stat HAVE_STAT)
+       check_include_files(stdarg.h HAVE_STDARG_H)
+       check_include_files(stdint.h HAVE_STDINT_H)
+       check_include_files(stdlib.h HAVE_STDLIB_H)
+       check_function_exists(strftime HAVE_STRFTIME)
+       check_include_files(strings.h HAVE_STRINGS_H)
+       check_include_files(string.h HAVE_STRING_H)
+       check_symbol_exists(DIR sys/dir.h HAVE_SYS_DIR_H)
+       check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
+       check_symbol_exists(DIR sys/ndir.h HAVE_SYS_NDIR_H)
+       check_include_files(sys/select.h HAVE_SYS_SELECT_H)
+       check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
+       check_include_files(sys/stat.h HAVE_SYS_STAT_H)
+       check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
+       check_include_files(sys/time.h HAVE_SYS_TIME_H)
+       check_include_files(sys/types.h HAVE_SYS_TYPES_H)
+       check_function_exists(time HAVE_TIME)
+       check_include_files(time.h HAVE_TIME_H)
+       check_include_files(unistd.h HAVE_UNISTD_H)
+       check_function_exists(va_copy HAVE_VA_COPY)
+       check_function_exists(vfprintf HAVE_VFPRINTF)
+       check_function_exists(vsnprintf HAVE_VSNPRINTF)
+       check_function_exists(vsprintf HAVE_VSPRINTF)
+       check_function_exists(__va_copy HAVE___VA_COPY)
+       check_c_source_compiles("
+               #include <stdlib.h>
+               #include <iconv.h>
+               extern
+               #ifdef __cplusplus
+               \"C\"
+               #endif
+               #if defined(__STDC__) || defined(__cplusplus)
+               size_t iconv(iconv_t cd, char** inbuf, size_t* inbytesleft, char** outbuf, size_t* outbytesleft);
+               #else
+               size_t iconv();
+               #endif
+               int main() { return 0; }
+       " ICONV_CONST_TEST)
+       if(NOT ICONV_CONST_TEST)
+               set(ICONV_CONST "const")
+       endif()
+       set(LT_OBJDIR ".libs/")
+       check_c_source_compiles("
+               #include <sys/socket.h>
+               #include <sys/types.h>
+               int main() { (void) send(1, (const char*) \"\", 1, 1); return 0; }
+       " SEND_ARG2_CAST_CONST)
+       if(NOT SEND_ARG2_CAST_CONST)
+               set(SEND_ARG2_CAST "(char *)")
+       else()
+               set(SEND_ARG2_CAST "/**/")
+       endif()
+       check_include_files("float.h;stdarg.h;stdlib.h;string.h" STDC_HEADERS)
+       check_c_source_compiles("
+               #include <stdarg.h>
+               void a(va_list* ap) {};
+               int main() { va_list ap1, ap2; a(&ap1); ap2 = (va_list) ap1; return 0; }
+       " VA_LIST_IS_ARRAY_TEST)
+       if(VA_LIST_IS_ARRAY_TEST)
+               set(VA_LIST_IS_ARRAY FALSE)
+       else()
+               set(VA_LIST_IS_ARRAY TRUE)
+       endif()
+       check_c_source_compiles("
+               #include <stddef.h>
+               #include <sys/socket.h>
+               #include <sys/types.h>
+               int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; }
+       " XML_SOCKLEN_T_SOCKLEN_T)
+       if(XML_SOCKLEN_T_SOCKLEN_T)
+               set(XML_SOCKLEN_T socklen_t)
+       else()
+               check_c_source_compiles("
+                       #include <stddef.h>
+                       #include <sys/socket.h>
+                       #include <sys/types.h>
+                       int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; }
+               " XML_SOCKLEN_T_SIZE_T)
+               if(XML_SOCKLEN_T_SIZE_T)
+                       set(XML_SOCKLEN_T size_t)
+               else()
+                       check_c_source_compiles("
+                               #include <stddef.h>
+                               #include <sys/socket.h>
+                               #include <sys/types.h>
+                               int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; }
+                       " XML_SOCKLEN_T_INT)
+                       set(XML_SOCKLEN_T int)
+               endif()
+       endif()
+       configure_file(config.h.cmake.in config.h)
+endif()
+
+set(
+       LIBXML2_HDRS
+       include/libxml/c14n.h
+       include/libxml/catalog.h
+       include/libxml/chvalid.h
+       include/libxml/debugXML.h
+       include/libxml/dict.h
+       include/libxml/DOCBparser.h
+       include/libxml/encoding.h
+       include/libxml/entities.h
+       include/libxml/globals.h
+       include/libxml/hash.h
+       include/libxml/HTMLparser.h
+       include/libxml/HTMLtree.h
+       include/libxml/list.h
+       include/libxml/nanoftp.h
+       include/libxml/nanohttp.h
+       include/libxml/parser.h
+       include/libxml/parserInternals.h
+       include/libxml/pattern.h
+       include/libxml/relaxng.h
+       include/libxml/SAX.h
+       include/libxml/SAX2.h
+       include/libxml/schemasInternals.h
+       include/libxml/schematron.h
+       include/libxml/threads.h
+       include/libxml/tree.h
+       include/libxml/uri.h
+       include/libxml/valid.h
+       include/libxml/xinclude.h
+       include/libxml/xlink.h
+       include/libxml/xmlIO.h
+       include/libxml/xmlautomata.h
+       include/libxml/xmlerror.h
+       include/libxml/xmlexports.h
+       include/libxml/xmlmemory.h
+       include/libxml/xmlmodule.h
+       include/libxml/xmlreader.h
+       include/libxml/xmlregexp.h
+       include/libxml/xmlsave.h
+       include/libxml/xmlschemas.h
+       include/libxml/xmlschemastypes.h
+       include/libxml/xmlstring.h
+       include/libxml/xmlunicode.h
+       include/libxml/xmlwriter.h
+       include/libxml/xpath.h
+       include/libxml/xpathInternals.h
+       include/libxml/xpointer.h
+)
+
+set(
+       LIBXML2_SRCS
+       buf.c
+       c14n.c
+       catalog.c
+       chvalid.c
+       debugXML.c
+       dict.c
+       encoding.c
+       entities.c
+       error.c
+       globals.c
+       hash.c
+       HTMLparser.c
+       HTMLtree.c
+       legacy.c
+       list.c
+       nanoftp.c
+       nanohttp.c
+       parser.c
+       parserInternals.c
+       pattern.c
+       relaxng.c
+       SAX.c
+       SAX2.c
+       schematron.c
+       threads.c
+       tree.c
+       uri.c
+       valid.c
+       xinclude.c
+       xlink.c
+       xmlIO.c
+       xmlmemory.c
+       xmlmodule.c
+       xmlreader.c
+       xmlregexp.c
+       xmlsave.c
+       xmlschemas.c
+       xmlschemastypes.c
+       xmlstring.c
+       xmlunicode.c
+       xmlwriter.c
+       xpath.c
+       xpointer.c
+       xzlib.c
+)
+
+if(WIN32)
+       list(APPEND LIBXML2_SRCS win32/libxml2.rc)
+       file(
+               WRITE
+               ${CMAKE_CURRENT_BINARY_DIR}/rcVersion.h
+               "#define LIBXML_MAJOR_VERSION ${LIBXML_MAJOR_VERSION}\n"
+               "#define LIBXML_MINOR_VERSION ${LIBXML_MINOR_VERSION}\n"
+               "#define LIBXML_MICRO_VERSION ${LIBXML_MICRO_VERSION}\n"
+               "#define LIBXML_DOTTED_VERSION \"${VERSION}\"\n"
+       )
+endif()
+
+if(LIBXML2_WITH_SAX1)
+       list(APPEND LIBXML2_SRCS DOCBparser.c)
+endif()
+
+if(LIBXML2_WITH_TRIO)
+       list(APPEND LIBXML2_SRCS trio.c triostr.c)
+endif()
+
+add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS})
+
+if(NOT BUILD_SHARED_LIBS)
+       target_compile_definitions(LibXml2 INTERFACE LIBXML_STATIC)
+       set(XML_CFLAGS "-DLIBXML_STATIC")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+       target_compile_definitions(LibXml2 PRIVATE _REENTRANT)
+       if(WIN32)
+               target_compile_definitions(LibXml2 PRIVATE HAVE_WIN32_THREADS)
+       endif()
+endif()
+
+target_include_directories(
+       LibXml2
+       PUBLIC
+       $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
+       $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
+       $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}/libxml2>
+)
+
+if(HAVE_DLOPEN)
+       target_link_libraries(LibXml2 PRIVATE dl)
+       set(MODULE_PLATFORM_LIBS "-ldl")
+endif()
+
+if(HAVE_SHLLOAD)
+       target_link_libraries(LibXml2 PRIVATE dld)
+       set(MODULE_PLATFORM_LIBS "-ldld")
+endif()
+
+if(UNIX)
+       target_link_libraries(LibXml2 PRIVATE m)
+       set(M_LIBS "-lm")
+endif()
+
+if(WIN32)
+       target_link_libraries(LibXml2 PRIVATE ws2_32)
+       set(WIN32_EXTRA_LIBADD "-lws2_32")
+endif()
+
+if(LIBXML2_WITH_ICONV)
+       target_link_libraries(LibXml2 PUBLIC Iconv::Iconv)
+       if(NOT Iconv_IS_BUILT_IN)
+               set(ICONV_LIBS "-liconv")
+       endif()
+endif()
+
+if(LIBXML2_WITH_ICU)
+       target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc)
+       if(WIN32)
+               set(ICU_LIBS "-licudt -licuin -licuuc")
+       else()
+               set(ICU_LIBS "-licudata -licui18n -licuuc")
+       endif()
+endif()
+
+if(LIBXML2_WITH_LZMA)
+       target_link_libraries(LibXml2 PRIVATE LibLZMA::LibLZMA)
+       set(LZMA_LIBS "-llzma")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+       target_link_libraries(LibXml2 PRIVATE Threads::Threads)
+       set(THREAD_LIBS ${CMAKE_THREAD_LIBS_INIT})
+endif()
+
+if(LIBXML2_WITH_ZLIB)
+       target_link_libraries(LibXml2 PRIVATE ZLIB::ZLIB)
+       set(Z_LIBS "-lz")
+endif()
+
+set_target_properties(
+       LibXml2
+       PROPERTIES
+       IMPORT_PREFIX lib
+       OUTPUT_NAME xml2
+       POSITION_INDEPENDENT_CODE ON
+       PREFIX lib
+       VERSION ${PROJECT_VERSION}
+)
+
+if(MSVC)
+       if(BUILD_SHARED_LIBS)
+               set_target_properties(
+                       LibXml2
+                       PROPERTIES
+                       DEBUG_POSTFIX d
+               )
+       else()
+               set_target_properties(
+                       LibXml2
+                       PROPERTIES
+                       DEBUG_POSTFIX sd
+                       MINSIZEREL_POSTFIX s
+                       RELEASE_POSTFIX s
+                       RELWITHDEBINFO_POSTFIX s
+               )
+       endif()
+endif()
+
+install(FILES ${LIBXML2_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
+
+install(
+       TARGETS LibXml2
+       EXPORT LibXml2
+       ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development
+       LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT runtime NAMELINK_COMPONENT development
+       RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
+)
+
+if(MSVC AND BUILD_SHARED_LIBS)
+       install(FILES $<TARGET_PDB_FILE:LibXml2> DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
+endif()
+
+if(LIBXML2_WITH_PROGRAMS)
+       set(
+               PROGRAMS
+               xmlcatalog
+               xmllint
+       )
+       foreach(PROGRAM ${PROGRAMS})
+               add_executable(${PROGRAM} ${PROGRAM}.c)
+               target_link_libraries(${PROGRAM} LibXml2)
+               if(HAVE_LIBHISTORY)
+                       target_link_libraries(${PROGRAM} history)
+               endif()
+               if(HAVE_LIBREADLINE)
+                       target_link_libraries(${PROGRAM} readline)
+               endif()
+               install(TARGETS ${PROGRAM} EXPORT LibXml2 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT programs)
+       endforeach()
+endif()
+
+if(LIBXML2_WITH_TESTS)
+       enable_testing()
+       set(
+               TESTS
+               runxmlconf
+               runsuite
+               testapi
+               testAutomata
+               testC14N
+               testchar
+               testdict
+               testHTML
+               testModule
+               testlimits
+               testReader
+               testrecurse
+               testRegexp
+               testRelax
+               testSAX
+               testSchemas
+               testURI
+               testXPath
+       )
+       foreach(TEST ${TESTS})
+               add_executable(${TEST} ${TEST}.c)
+               target_link_libraries(${TEST} LibXml2)
+       endforeach()
+       if(EXISTS ${LIBXML2_XMLCONF_WORKING_DIR}/xmlconf/xmlconf.xml)
+               add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${LIBXML2_XMLCONF_WORKING_DIR})
+       endif()
+       if(NOT WIN32)
+               add_test(NAME testapi COMMAND testapi)
+       endif()
+       add_test(NAME testchar COMMAND testchar)
+       add_test(NAME testdict COMMAND testdict)
+       add_test(NAME testrecurse COMMAND testrecurse WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+       if(Threads_FOUND)
+               set(
+                       TESTS_THREADS
+                       runtest
+                       testThreads
+               )
+               foreach(TEST ${TESTS_THREADS})
+                       add_executable(${TEST} ${TEST}.c)
+                       if(WIN32)
+                               target_compile_definitions(${TEST} PRIVATE HAVE_WIN32_THREADS)
+                       endif()
+                       target_link_libraries(${TEST} LibXml2 Threads::Threads)
+               endforeach()
+               add_test(NAME runtest COMMAND runtest --out ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+               add_test(NAME testThreads COMMAND testThreads WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+       endif()
+endif()
+
+if(LIBXML2_WITH_PYTHON)
+       execute_process(
+               COMMAND
+               ${Python_EXECUTABLE}
+               ${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py
+               ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxml2-api.xml
+               ${CMAKE_CURRENT_SOURCE_DIR}/python/libxml2-python-api.xml
+               WORKING_DIRECTORY
+               ${CMAKE_CURRENT_BINARY_DIR}
+       )
+       file(READ python/libxml.py LIBXML_PY)
+       file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML_PY}")
+       file(READ ${CMAKE_CURRENT_BINARY_DIR}/libxml2class.py LIBXML2CLASS_PY)
+       file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in "${LIBXML2CLASS_PY}")
+       configure_file(${CMAKE_CURRENT_BINARY_DIR}/libxml2.py.in libxml2.py COPYONLY)
+       add_library(
+               LibXml2Mod
+               libxml2-py.c
+               libxml2-py.h
+               python/libxml.c
+               python/libxml_wrap.h
+               python/types.c
+       )
+       target_include_directories(
+               LibXml2Mod
+               PUBLIC
+               $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/python>
+       )
+       target_link_libraries(LibXml2Mod LibXml2 Python::Python)
+       set_target_properties(
+               LibXml2Mod
+               PROPERTIES
+               IMPORT_PREFIX lib
+               OUTPUT_NAME xml2mod
+               PREFIX lib
+               VERSION ${PROJECT_VERSION}
+       )
+       install(
+               TARGETS LibXml2Mod
+               ARCHIVE DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT development
+               LIBRARY DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime NAMELINK_COMPONENT development
+               RUNTIME DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime
+       )
+       if(MSVC AND BUILD_SHARED_LIBS)
+               install(FILES $<TARGET_PDB_FILE:LibXml2Mod> DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} CONFIGURATIONS Debug RelWithDebInfo COMPONENT debug)
+       endif()
+       install(FILES python/drv_libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime)
+       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime)
+endif()
+
+install(FILES libxml.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation)
+install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE)
+
+configure_package_config_file(
+       libxml2-config.cmake.cmake.in libxml2-config.cmake
+       INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+)
+
+install(
+       FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config.cmake
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+       COMPONENT development
+)
+
+write_basic_package_version_file(
+       ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
+       VERSION ${PROJECT_VERSION}
+       COMPATIBILITY ExactVersion
+)
+
+install(
+       FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2-config-version.cmake
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+       COMPONENT development
+)
+
+install(
+       EXPORT LibXml2
+       DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libxml2-${PROJECT_VERSION}
+       NAMESPACE LibXml2::
+       FILE libxml2-export.cmake
+       COMPONENT development
+)
+
+configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
+
+if(MSVC)
+       configure_file(include/libxml/xmlwin32version.h.in libxml/xmlwin32version.h)
+       install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlwin32version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
+endif()
+
+if(LIBXML2_WITH_PYTHON)
+       set(prefix "${CMAKE_INSTALL_PREFIX}")
+       configure_file(python/setup.py.in setup.py @ONLY)
+endif()
+
+set(XML_INCLUDEDIR "-I\${includedir}/libxml2")
+set(XML_LIBDIR "-L\${libdir}")
+set(XML_LIBS "-lxml2")
+set(XML_PRIVATE_LIBS "${Z_LIBS} ${LZMA_LIBS} ${THREAD_LIBS} ${ICONV_LIBS} ${ICU_LIBS} ${M_LIBS}")
+
+file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
+string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
+
+set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}")
+set(exec_prefix "\${prefix}")
+set(libdir "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
+set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development)
+
+set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..")
+configure_file(xml2-config.in xml2-config @ONLY)
+install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
+
+set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2")
+set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")
+configure_file(xml2Conf.sh.in xml2Conf.sh @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/xml2Conf.sh DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT development)
+
+set(CPACK_COMPONENT_DEVELOPMENT_DEPENDS runtime)
+set(CPACK_COMPONENT_PROGRAMS_DEPENDS runtime)
+set(CPACK_DEB_COMPONENT_INSTALL ON)
+set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
+set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_NAME "${PACKAGE_TARNAME}-dev")
+set(CPACK_DEBIAN_DEVELOPMENT_PACKAGE_SECTION "libdevel")
+set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${PACKAGE_URL})
+set(CPACK_DEBIAN_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
+set(CPACK_DEBIAN_PROGRAMS_PACKAGE_DEPENDS "${PACKAGE_TARNAME}")
+set(CPACK_DEBIAN_PROGRAMS_PACKAGE_NAME "${PACKAGE_TARNAME}-utils")
+set(CPACK_DEBIAN_PROGRAMS_PACKAGE_SECTION "utils")
+set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS "${PACKAGE_TARNAME}-utils")
+set(CPACK_DEBIAN_RUNTIME_PACKAGE_SECTION "libs")
+set(CPACK_NSIS_PACKAGE_NAME ${PACKAGE_STRING})
+set(CPACK_NSIS_URL_INFO_ABOUT ${PACKAGE_URL})
+set(CPACK_PACKAGE_CONTACT ${PACKAGE_BUGREPORT})
+set(CPACK_PACKAGE_DISPLAY_NAME ${PACKAGE_STRING})
+set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PACKAGE_TARNAME}-${PACKAGE_VERSION}")
+set(CPACK_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
+set(CPACK_PACKAGE_VERSION_MAJOR ${LIBXML_MAJOR_VERSION})
+set(CPACK_PACKAGE_VERSION_MINOR ${LIBXML_MINOR_VERSION})
+set(CPACK_PACKAGE_VERSION_PATCH ${LIBXML_MICRO_VERSION})
+set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/Copyright)
+set(CPACK_RPM_COMPONENT_INSTALL ON)
+set(CPACK_RPM_development_PACKAGE_NAME "${PACKAGE_NAME}-devel")
+set(CPACK_RPM_development_PACKAGE_REQUIRES "${PACKAGE_NAME}")
+set(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
+set(CPACK_RPM_PACKAGE_NAME ${PACKAGE_TARNAME})
+set(CPACK_RPM_PACKAGE_URL ${PACKAGE_URL})
+set(CPACK_RPM_programs_PACKAGE_NAME "${PACKAGE_NAME}-utils")
+set(CPACK_RPM_programs_PACKAGE_REQUIRES "${PACKAGE_NAME}")
+set(CPACK_RPM_runtime_PACKAGE_NAME "${PACKAGE_NAME}")
+set(CPACK_RPM_runtime_PACKAGE_SUGGESTS "${PACKAGE_NAME}-utils")
+
+include(CPack)
index b3f3fc1..2640670 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -379,7 +379,7 @@ Tue Aug 26 09:42:08 CEST 2008 Daniel Veillard <daniel@veillard.com>
        * test/schemas/regexp-char-ref_0.xml test/schemas/regexp-char-ref_0.xsd
          test/schemas/regexp-char-ref_1.xsd result/schemas/regexp-char-ref_0_0
          result/schemas/regexp-char-ref_1_0: Volker Grabsch also provided
-         regession tests for this
+         regression tests for this
 
 Tue Aug 26 09:25:39 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
@@ -475,7 +475,7 @@ Thu Jul 31 10:15:53 CEST 2008 Daniel Veillard <daniel@veillard.com>
        * include/libxml/xmlerror.h parser.c: clean up namespace errors
          checking and reporting, errors when a document is labelled
          as UTF-16 while it is parsed as UTF-8 and no encoding was given
-         explicitely.
+         explicitly.
        * result/errors/webdav.xml.*: some warnings are no recategorized
          as Namespace errors
 
@@ -663,7 +663,7 @@ Thu Apr  3 11:44:57 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
 Thu Apr  3 11:02:02 CEST 2008 Daniel Veillard <daniel@veillard.com>
 
-       * HTMLparser.c: apparently it's okay to forget the semicolumn after
+       * HTMLparser.c: apparently it's okay to forget the semicolon after
          entity refs in HTML, fixing char refs parsing accordingly based on
          T. Manske patch, this should fix #517653
 
@@ -787,7 +787,7 @@ Wed Mar 12 18:56:22 CET 2008 Daniel Veillard <daniel@veillard.com>
 
 Wed Mar 12 10:22:01 CET 2008 Daniel Veillard <daniel@veillard.com>
 
-       * python/types.c: fix a memory errro when using namespace nodes
+       * python/types.c: fix a memory error when using namespace nodes
          returned from XPath queries, should fix #521699
        * python/tests/Makefile.am python/tests/xpathns.py: add a specific
          regression test for it
@@ -917,7 +917,7 @@ Fri Jan 25 20:01:42 CET 2007 Rob Richards <rrichards@ctindustries.net>
 
 Thu Jan 24 15:37:04 CET 2008 Daniel Veillard <daniel@veillard.com>
 
-       * parser.c: fix a memeory leak in internal subset parsing with
+       * parser.c: fix a memory leak in internal subset parsing with
          a fix from Ashwin
        * test/errors/content1.xml result/errors/content1.xml*:
          add test to regressions
@@ -1230,7 +1230,7 @@ Thu May 10 01:52:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
 
        * list.c: applied patch to fix xmlListAppend() from 
          Georges-André SILBER
-       * valid.c: also fix the place wher it was called.
+       * valid.c: also fix the place where it was called.
 
 Wed May  2 18:47:33 CEST 2007 Daniel Veillard <daniel@veillard.com>
 
@@ -1424,7 +1424,7 @@ Thu Jan  4 18:27:49 CET 2007 Daniel Veillard <daniel@veillard.com>
          test/relaxng/empty1_0.xml test/relaxng/comps.rng
          test/relaxng/empty0.rng test/relaxng/empty0_0.xml
          test/relaxng/empty1_1.xml: tests which were apparently 
-         never commited to CVS
+         never committed to CVS
 
 Wed Jan  3 16:05:21 PST 2007 Aleksey Sanin <aleksey@aleksey.com>
 
@@ -1531,7 +1531,7 @@ Tue Oct 17 18:12:34 CEST 2006 Daniel Veillard <daniel@veillard.com>
        * HTMLparser.c: fixing HTML minimized attribute values to be generated
          internally if not present, fixes bug #332124
        * result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax 
-         result/HTML/wired.html.sax: this affects the SAX event strem for
+         result/HTML/wired.html.sax: this affects the SAX event stream for
          a few test cases
 
 Tue Oct 17 17:56:31 CEST 2006 Daniel Veillard <daniel@veillard.com>
@@ -1627,7 +1627,7 @@ Wed Oct 11 23:11:58 CEST 2006 Daniel Veillard <daniel@veillard.com>
 
 Wed Oct 11 18:40:00 CEST 2006 Daniel Veillard <daniel@veillard.com>
 
-       * valid.c: fixed a weird error where validity context whould not
+       * valid.c: fixed a weird error where validity context would not
          show up if warnings were disabled pointed out by Bob Stayton
        * xmlIO.c doc/generator.py: cleanup and fix to regenerate the docs
        * doc//* testapi.c: rebuilt the docs
@@ -1740,7 +1740,7 @@ Thu Aug 17 00:48:31 CEST 2006 Rob Richards <rrichards@ctindustries.net>
 Wed Aug 16 01:15:12 CEST 2006 Rob Richards <rrichards@ctindustries.net>
 
        * HTMLtree.c xmlsave.c: Add linefeeds to error messages allowing 
-         for consistant handling.
+         for consistent handling.
 
 Tue Aug 15 15:02:18 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
@@ -1857,7 +1857,7 @@ Mon Jun 26 16:22:50 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
          initialized to zero here; this could lead to the activation
          of the axis rewrite code in xmlXPathNodeCollectAndTest() when
          @rewriteType is randomly set to the value 1. A test
-         (hardcoding the intial value to 1) revealed that the
+         (hardcoding the initial value to 1) revealed that the
          resulting incorrect behaviour is similar to the behaviour
          as described by Arnold Hendriks on the mailing list; so I
          hope that will fix the issue.   
@@ -1912,7 +1912,7 @@ Fri Jun 16 21:37:44 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
          for my custom handling of ns-references in my DOM wrapper.
          Substituted code which created the XML namespace decl on
          the doc for a call to xmlTreeEnsureXMLDecl(). Removed
-         those nastly "warnigns" from the docs of the clone/adopt
+         those nasty "warnings" from the docs of the clone/adopt
          functions; they work fine on my side.
          
 Mon Jun 12 13:23:11 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
@@ -2033,7 +2033,7 @@ Tue May 30 11:21:34 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
 Mon May 29 18:06:17 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
        * xpath.c include/libxml/xpath.h: Added an XPath object cache.
-         It sits on an xmlXPathContext and need to be explicitely
+         It sits on an xmlXPathContext and need to be explicitly
          activated (or deactivated again) with
          xmlXPathContextSetObjectCache(). The cache consists of 5
          lists for node-set, string, number, boolean and misc XPath
@@ -2052,7 +2052,7 @@ Wed May 24 10:54:25 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
        * xpath.c: Removed a memcpy if xmlXPathNodeSetMerge(); it
          seems we really need to walk the whole list, since those
-         nastly namespace nodes need to be added with
+         nasty namespace nodes need to be added with
          xmlXPathNodeSetDupNs(); thus a pure memcpy is not possible.
          A flag on the node-set indicating if namespace nodes are in
          the set would help here; this is the 3rd flag which would
@@ -2063,7 +2063,7 @@ Wed May 24 10:54:25 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
          2) Of what type are the nodes in the set (or of mixed type)?
             This would allow for faster merging of node-sets.
          3) Are namespace nodes in the set?
-            This would allow to skipp all the namespace node specific
+            This would allow to skip all the namespace node specific
             special handling. Faster node-set merging if the first
             set is empty; just memcpy the set.
 
@@ -2485,7 +2485,7 @@ Mon Jan  9 15:33:16 CET 2006 Daniel Veillard <daniel@veillard.com>
 
 Thu Jan  5 16:25:06 CET 2006 Daniel Veillard <daniel@veillard.com>
 
-       * NEWS configure.in libxml.spec.in testapi.c doc/*: upated the news
+       * NEWS configure.in libxml.spec.in testapi.c doc/*: updated the news
          regenerated the docs, preparing for release of 2.6.23
        * pattern.c xmlschemas.c: fixed some comments
        
@@ -2520,7 +2520,7 @@ Wed Jan  4 18:07:47 CET 2006 Daniel Veillard <daniel@veillard.com>
 Wed Jan  4 15:00:51 CET 2006 Daniel Veillard <daniel@veillard.com>
 
        * SAX2.c: fix bug #324432 with <xml:foo/>
-       * test/ns7 resul//ns7*: added to the regression tests
+       * test/ns7 result/ns7*: added to the regression tests
 
 Wed Jan  4 10:53:56 CET 2006 Daniel Veillard <daniel@veillard.com>
 
@@ -2861,7 +2861,7 @@ Fri Oct 21 10:50:14 EDT 2005 Rob Richards <rrichards@ctindustries.net>
 
 Wed Oct 19 16:53:47 BST 2005 Daniel Veillard <daniel@veillard.com>
 
-       * xmlregexp.c: commiting a some fixes and debug done yesterday in
+       * xmlregexp.c: committing a some fixes and debug done yesterday in
          the London airport.
 
 Thu Oct 20 12:54:23 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
@@ -2932,7 +2932,7 @@ Fri Oct 14 16:21:22 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
          Allowed IDCs to resolve also to nodes of complex type with
          simple content.
          Added check for keyrefs with references to keyrefs.
-         IDC target-nodes were interferring with IDC node-tables,
+         IDC target-nodes were interfering with IDC node-tables,
          since they used one list of entries only. I separated this
          one big list into 3 lists: 1 for IDC node-table entries,
          1 for _duplicates_ of IDC node-table entries and 1 for
@@ -3053,7 +3053,7 @@ Mon Sep 12 21:00:53 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
        * xmlschemas.c include/libxml/schemasInternals.h
          include/libxml/xmlerror.h: Completion of the schema graph.
          Centralisation, more robustness of the schema document
-         aquisition story. Centralised and restructured component fixup.
+         acquisition story. Centralised and restructured component fixup.
          Fixed attribute derivation when 'prohibiting' attribute uses.
          Added warnings: when schema documents cannot be localized
          during imports; when we get duplicate and pointless attribute
@@ -3385,7 +3385,7 @@ Wed Aug 10 18:21:41 CEST 2005 Daniel Veillard <daniel@veillard.com>
          list values.
        * test/relaxng/307377* result/relaxng/307377* Makefile.am runtest.c:
          added examples to the regression tests, problem is that streaming
-         version gives slightly more informations.
+         version gives slightly more information.
 
 Wed Aug 10 15:25:53 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
@@ -3398,7 +3398,7 @@ Wed Aug 10 11:59:46 CEST 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
 Tue Aug  9 23:37:22 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
        * xmlregexp.c: fixed a determinism detection problem exposed by
-         ##other tests commited by Kasimier, also added a small speedup
+         ##other tests committed by Kasimier, also added a small speedup
          of determinism detection.
        * test/results/any6_2_0* any8_1_0* any7_1_2* any7_2_2*: added 
          the results to the regression tests now
@@ -3424,7 +3424,7 @@ Tue Aug  9 13:07:27 CEST 2005 Daniel Veillard <daniel@veillard.com>
        * result/schemas/any7* test/schemas/any7: completed the tests
          and added the results
        * result/schemas/any3_0_0.err result/schemas/any5_0_0.err
-         result/schemas/any5_1_0.err: this slightly chnages the output
+         result/schemas/any5_1_0.err: this slightly changes the output
          from 3 existing tests
 
 Mon Aug  8 22:33:08 CEST 2005 Daniel Veillard <daniel@veillard.com>
@@ -3468,7 +3468,7 @@ Mon Aug  8 01:41:53 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
 Sun Aug  7 12:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
-       * test/relaxng/docbook_0.xml: get rid of the dependancy on a locally
+       * test/relaxng/docbook_0.xml: get rid of the dependency on a locally
          installed DTD
        * uri.c include/libxml/uri.h xmlIO.c nanoftp.c nanohttp.c: try to
          cleanup the Path/URI conversion mess, needed fixing in various 
@@ -3522,7 +3522,7 @@ Sat Jul 30 17:26:58 EDT 2005 Daniel Veillard <daniel@veillard.com>
 
 Sat Jul 30 17:08:07 EDT 2005 Daniel Veillard <daniel@veillard.com>
 
-       * schematron.c xmllint.c include/libxml/schematron.h: commiting
+       * schematron.c xmllint.c include/libxml/schematron.h: committing
          work done on the plane last week-end
 
 Sat Jul 30 15:16:29 CEST 2005 Daniel Veillard <daniel@veillard.com>
@@ -4029,7 +4029,7 @@ Mon Jun 27 01:01:32 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
 Sun Jun 26 20:08:24 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
-       * include/libxml/valid.h valid.c: avoid name glob in agruments as
+       * include/libxml/valid.h valid.c: avoid name glob in arguments as
          it matches the glob() routine.
        * runtest.c Makefile.am: first steps toward a C regression test
          framework.
@@ -4463,7 +4463,7 @@ Fri Apr  1 16:07:59 CEST 2005 Daniel Veillard <daniel@veillard.com>
 
        * doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h 
          format to cope with gcc4 change of aliasing allowed scopes, had
-         to add extra informations to doc/libxml2-api.xml to separate
+         to add extra information to doc/libxml2-api.xml to separate
          the header from the c module source.
        * *.c: updated all c library files to add a #define bottom_xxx
          and reimport elfgcchack.h thereafter, and a bit of cleanups.
@@ -4955,9 +4955,9 @@ Fri Jan 28 18:37:18 CET 2005 Daniel Veillard <daniel@veillard.com>
 
 Fri Jan 28 16:51:47 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
-       * xmlschemas.c: Corrected an ambigious symbol-space for
+       * xmlschemas.c: Corrected an ambiguous symbol-space for
          local attribute declarations. IFDEFed more IDC code to
-         surpress compiler warnings.
+         suppress compiler warnings.
 
 Fri Jan 28 00:57:04 CET 2005 Daniel Veillard <daniel@veillard.com>
 
@@ -4978,7 +4978,7 @@ Thu Jan 27 13:39:04 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
          Added an initial skeleton for indentity-constraints. This is all
          defined out, since not complete, plus it needs support from other
          modules.
-         Added machanism to store element information for the
+         Added mechanism to store element information for the
          ancestor-or-self axis; this is needed for identity-constraints
          and should be helpful for a future streamable validation.
        * include/libxml/xmlerror.h: Added an error code for
@@ -5028,7 +5028,7 @@ Sun Jan 23 21:14:20 CET 2005 Daniel Veillard <daniel@veillard.com>
 
 Sun Jan 23 18:35:00 CET 2005 Daniel Veillard <daniel@veillard.com>
 
-       * parser.c: boosting common commnent parsing code, it was really
+       * parser.c: boosting common comment parsing code, it was really
          slow.
        * test/comment[3-5].xml result//comment[3-5].xml*: added sprecific
          regression tests
@@ -5179,7 +5179,7 @@ Sat Jan  8 23:04:10 CET 2005 Daniel Veillard <daniel@veillard.com>
 Fri Jan  7 14:54:51 CET 2005 Daniel Veillard <daniel@veillard.com>
 
        * TODO: small update
-       * xmlregexp.c: trying to add an API to get useful error informations
+       * xmlregexp.c: trying to add an API to get useful error information
          back from a failing regexp context.
 
 Thu Jan  6 17:35:41 HKT 2005 William Brack <wbrack@mmm.com.hk>
@@ -5280,7 +5280,7 @@ Sat Dec 25 18:10:02 HKT 2004 William Brack <wbrack@mmm.com.hk>
        
 Fri Dec 24 16:31:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
-       * python/generator.py: added most required entires to
+       * python/generator.py: added most required entries to
          foreign encoding table, plus some additional logic to
          assure only the 1st param uses the 't#' format.  Fixes
          bug #152286, but may still have some other UTF-16 problems.
@@ -5360,7 +5360,7 @@ Fri Nov 26 13:09:04 CET 2004 Kasimier Buchcik <libxml2-cvs@cazic.net>
          of elements for which a declaration existed were still processed
          by the wildcard mechanism (reported by philippe ventrillon to the
          mailing list).
-         Changed the import and include machanism to share dictionaries.
+         Changed the import and include mechanism to share dictionaries.
 
 Fri Nov 26 11:44:36 CET 2004 Daniel Veillard <daniel@veillard.com>
 
@@ -5640,7 +5640,7 @@ Tue Nov  2 15:49:34 CET 2004 Daniel Veillard <daniel@veillard.com>
        * SAX2.c nanoftp.c parser.c parserInternals.c tree.c xmlIO.c
          xmlstring.c: various API hardeing changes as a result of running
          the first set of automatic API regression tests.
-       * test/slashdot16.xml: apparently missing from CVS, commited it
+       * test/slashdot16.xml: apparently missing from CVS, committed it
 
 Mon Nov  1 15:54:18 CET 2004 Daniel Veillard <daniel@veillard.com>
 
@@ -5867,7 +5867,7 @@ Wed Sep 29 15:00:11 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net>
          model group "all".
        * test/schemas/bug152470_1.xsd: Removed an "abstract" attribute,
          which broke the test.
-       * xstc/xstc.py:  Workaround to accomodate case insensitive
+       * xstc/xstc.py:  Workaround to accommodate case insensitive
          test definitions in ms-test.def.xml (was missing in a previous
          commit).
 
@@ -5961,7 +5961,7 @@ Thu Sep 16 13:24:27 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net>
 
        * xmlschemas.c include/libxml/schemasInternals.h 
          test/schemas/bug152470_1.* result/schemas/bug152470_1_1*: 
-         Simpified attribute wildcard creation and assignment to get rid 
+         Simplified attribute wildcard creation and assignment to get rid 
          of memory leaks.
          Restructured the validation process.
          Restructured and expanded parsing of <attributeGroup>.
@@ -5978,7 +5978,7 @@ Thu Sep 16 13:24:27 CEST 2004 Kasimier Buchcik <libxml2-cvs@cazic.net>
          'anyType' using the short-hand form (see bug # 152470,
          submitted by Thilo Jeremias).
        * include/libxml/xmlschematypes.h: Cleaned up some comments.
-       * xstc/xstc.py: Workaround to accomodate case insensitive
+       * xstc/xstc.py: Workaround to accommodate case insensitive
          test definitions in ms-test.def.xml.
        * result/schemas/deter0_0_0.err result/schemas/ns0_0_2.err
          result/schemas/ns0_1_2.err: Adapted.
@@ -6321,7 +6321,7 @@ Sat Aug 14 13:18:57 CEST 2004 Daniel Veillard <daniel@veillard.com>
          to document xmlSchemasSetValidErrors() limitations, #141827
        * error.c: Add information in generic and structured error
          setter functions that this need to be done per thread #144308
-       * xmlsave.c: fixed bug whith missing NOTATION(s) serialization
+       * xmlsave.c: fixed bug with missing NOTATION(s) serialization
          bug #144162
        * doc/xmllint.xml: typo fix #144840
 
@@ -6691,7 +6691,7 @@ Tue Jun  8 21:27:03 HKT 2004 William Brack <wbrack@mmm.com.hk>
 Tue Jun  8 14:01:14 CEST 2004 Daniel Veillard <daniel@veillard.com>
 
        * parser.c xmlreader.c include/libxml/parser.h: fixed a serious
-         problem when substituing entities using the Reader, the entities
+         problem when substituting entities using the Reader, the entities
          content might be freed and if rereferenced would crash
        * Makefile.am test/* result/*: added a new test case and a new
          test operation for the reader with substitution of entities.
@@ -6847,7 +6847,7 @@ Sun May 16 03:06:31 CEST 2004 Daniel Veillard <daniel@veillard.com>
 Sat May 15 20:14:21 CEST 2004 Daniel Veillard <daniel@veillard.com>
 
        * doc/ChangeLog.awk doc/ChangeLog.xsl: first steps of a good
-         ChangeLog page generation. The awk shoudl escape characters
+         ChangeLog page generation. The awk should escape characters
          not okay in XML and the xslt should make links to functions
          or variables or bug reported in the entries.
 
@@ -7049,7 +7049,7 @@ Sun Apr 18 23:45:46 CEST 2004 Daniel Veillard <daniel@veillard.com>
 
 Sun Apr 18 22:51:43 CEST 2004 Daniel Veillard <daniel@veillard.com>
 
-       * xpath.c: relaxed id() to not check taht the name(s) passed
+       * xpath.c: relaxed id() to not check that the name(s) passed
          are actually NCName, decided this in agreement with Aleksey Sanin
          since existing specs like Visa3D broke that conformance checking
          and other tools seems to not implement it sigh...
@@ -7062,7 +7062,7 @@ Sun Apr 18 21:46:17 CEST 2004 Daniel Veillard <daniel@veillard.com>
        * xpath.c: work around Microsoft compiler NaN bug raise reported
          by Mark Vakoc
        * xmlschemas.c include/libxml/schemasInternals.h 
-         include/libxml/xmlerror.h: fixed a recusive extention schemas
+         include/libxml/xmlerror.h: fixed a recursive extension schemas
          compilation error raised by taihei goi
 
 Sun Apr 18 16:57:02 CEST 2004 Daniel Veillard <daniel@veillard.com>
@@ -7228,7 +7228,7 @@ Tue Mar 23 12:35:08 CET 2004 Daniel Veillard <daniel@veillard.com>
 
        * configure.in doc/* News: preparing 2.6.8 release, updated and rebuilt
          the docs.
-       * Makefile.am: use valgring fro the new Python based regression tests
+       * Makefile.am: use valgring for the new Python based regression tests
 
 Mon Mar 22 20:07:27 CET 2004 Daniel Veillard <daniel@veillard.com>
 
@@ -7292,7 +7292,7 @@ Wed Mar 10 17:22:48 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 Wed Mar 10 19:42:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
 
-       * doc/search.php: Minor change for later verson of php requiring
+       * doc/search.php: Minor change for later version of php requiring
          $HTTP_GET_VARS.
 
 Wed Mar 10 00:12:31 HKT 2004 William Brack <wbrack@mmm.com.hk>
@@ -7361,8 +7361,8 @@ Thu Mar  4 15:00:45 CET 2004 Daniel Veillard <daniel@veillard.com>
 
 Thu Mar  4 14:39:38 CET 2004 Daniel Veillard <daniel@veillard.com>
 
-       * Makefile.am tree.c xmlsave.c include/libxml/xmlsave.h: commiting
-         the new xmlsave module before the actuall big code change.
+       * Makefile.am tree.c xmlsave.c include/libxml/xmlsave.h: committing
+         the new xmlsave module before the actual big code change.
 
 Thu Mar  4 12:38:53 CET 2004 Daniel Veillard <daniel@veillard.com>
 
@@ -7872,7 +7872,7 @@ Mon Jan  5 20:47:07 MST 2004 John Fleck <jfleck@inkstain.net>
 
 Tue Jan  6 00:10:33 CET 2004 Daniel Veillard <daniel@veillard.com>
 
-       * rngparser.c: commiting the compact relax ng parser. It's not
+       * rngparser.c: committing the compact relax ng parser. It's not
          completely finished, it's not integrated but I want to save the
          current state
 
@@ -8026,7 +8026,7 @@ Wed Dec 24 00:29:30 CET 2003 Daniel Veillard <daniel@veillard.com>
 Tue Dec 23 15:14:37 HKT 2003 William Brack <wbrack@mmm.com.hk>
 
        * valid.c: fixed bug concerning validation using external
-         dtd of element with mutiple namespace declarations
+         dtd of element with multiple namespace declarations
          (Bug 129821)
 
 Tue Dec 23 11:41:42 HKT 2003 William Brack <wbrack@mmm.com.hk>
@@ -8407,7 +8407,7 @@ Thu Nov 20 12:54:30 CET 2003 Daniel Veillard <daniel@veillard.com>
        * doc/examples/*: added his test as the xmlWriter example
        * doc/html/ doc/*.html: this resulted in some improvements
        * include/libxml/hash.h: fixed an inclusion problem when
-         <libxml/hash.h> wasn't preceeded by <xml/parser.h>
+         <libxml/hash.h> wasn't preceded by <xml/parser.h>
 
 Wed Nov 19 17:19:35 CET 2003 Daniel Veillard <daniel@veillard.com>
 
@@ -8430,7 +8430,7 @@ Wed Nov 19 00:48:56 CET 2003 Daniel Veillard <daniel@veillard.com>
 Tue Nov 18 21:51:15 CET 2003 Daniel Veillard <daniel@veillard.com>
 
        * include/libxml/*.h include/libxml/*.h.in: modified the file
-         header to add more informations, painful...
+         header to add more information, painful...
        * genChRanges.py genUnicode.py: updated to generate said changes
          in headers
        * doc/apibuild.py: extract headers, add them to libxml2-api.xml
@@ -8572,7 +8572,7 @@ Wed Nov 12 01:38:16 CET 2003 Daniel Veillard <daniel@veillard.com>
          added autogeneration of a web page for the examples
        * doc/examples/example1.c doc/examples/.cvsignore
          doc/examples/examples.xml doc/examples/index.py: updated the
-         informations extracted, improved the format and indexing.
+         information extracted, improved the format and indexing.
 
 Tue Nov 11 22:08:59 CET 2003 Daniel Veillard <daniel@veillard.com>
 
@@ -8774,7 +8774,7 @@ Tue Oct 28 16:42:16 CET 2003 Daniel Veillard <daniel@veillard.com>
        * error.c valid.c include/libxml/xmlerror.h: fixing bug #125653
          sometimes the error handlers can get a parser context on DTD
          errors, and sometime they don't. So be very careful when trying
-         to grab those informations.
+         to grab those information.
 
 Tue Oct 28 15:26:18 CET 2003 Daniel Veillard <daniel@veillard.com>
 
@@ -8884,7 +8884,7 @@ Mon Oct 20 19:02:53 CEST 2003 Daniel Veillard <daniel@veillard.com>
        * python/tests/Makefile.am python/tests/reader7.py
          python/tests/walker.py: adding regression testing for the
          new xmlreader APIs, new APIs for reader creation, including
-         makeing reader "walker" operating on preparsed document trees.
+         making reader "walker" operating on preparsed document trees.
 
 Sun Oct 20 22:37:03 HKT 2003 William Brack <wbrack@mmm.com.hk>
 
@@ -9084,7 +9084,7 @@ Fri Oct 10 16:45:20 CEST 2003 Daniel Veillard <daniel@veillard.com>
 Fri Oct 10 16:19:17 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
        * include/libxml/tree.h: make room in Doc, Element, Attributes
-         for PSVI type informations.
+         for PSVI type information.
 
 Fri Oct 10 16:08:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
@@ -9251,7 +9251,7 @@ Fri Oct  3 00:19:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
          scrolling to see where thing broke wasn't pleasant
        * configure.in: some beta4 preparation, but not ready yet
        * error.c globals.c include/libxml/globals.h include/libxml/xmlerror.h:
-         new error handling code, last error informations are stored
+         new error handling code, last error information are stored
          in the parsing context or a global variable, new APIs to
          handle the xmlErrorPtr type.
        * parser.c parserInternals.c valid.c : started migrating to the
@@ -9261,7 +9261,7 @@ Fri Oct  3 00:19:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
        * parser.c: small potential buffer access problem in push code
          provided by Justin Fletcher
        * result/*.sax result/VC/PENesting* result/namespaces/*
-         result/valid/*.err: some error messages were sligthly changed.
+         result/valid/*.err: some error messages were slightly changed.
 
 Thu Oct  2 13:01:13 2003  Aleksey Sanin  <aleksey@aleksey.com>
 
@@ -9369,7 +9369,7 @@ Sun Sep 28 02:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com>
        * include/libxml/SAX.h include/libxml/parser.h: move the 
          SAXv1 block definitions to parser.h fixes bug #123380
        * xmlreader.c include/libxml/xmlreader.h: reinstanciate
-         the attribute and element pool borken 2 commits ago.
+         the attribute and element pool broken 2 commits ago.
          Start playing with an entry point to preserve a subtree.
        * entities.c: remove a warning.
 
@@ -9436,7 +9436,7 @@ Thu Sep 25 16:23:58 CEST 2003 Daniel Veillard <daniel@veillard.com>
          include/libxml/globals.h include/libxml/SAX.h: make sure the
          global variables for the default SAX handler are V1 ones to
          avoid ABI compat problems.
-       * xmlreader.c: cleanup of uneeded code
+       * xmlreader.c: cleanup of unneeded code
        * hash.c: fix a comment
 
 Thu Sep 25 14:16:51 CEST 2003 Daniel Veillard <daniel@veillard.com>
@@ -9734,7 +9734,7 @@ Sun Sep  7 11:11:45 CEST 2003 Daniel Veillard <daniel@veillard.com>
        * dict.c: allow to give -1 for undefined length in lookups
        * include/libxml/parser.h parser.c parserInternals.c testSAX.c:
          first round of work on the new SAX2 interfaces, the API
-         will change but commiting before changing for historical
+         will change but committing before changing for historical
          reference.
 
 Sat Sep  6 10:55:01 PTD 2003 William Brack <wbrack@mmm.com.hk>
@@ -10091,7 +10091,7 @@ Thu Aug  7 21:13:22 HKT 2003 William Brack <wbrack@mmm.com.hk>
 Wed Aug  6 12:32:11 HKT 2003 William Brack <wbrack@mmm.com.hk>
 
        * error.c trionan.[ch] testThreads.c python/generator.py:
-         further small changes to elminate most of the remaining
+         further small changes to eliminate most of the remaining
          warnings.
 
 Tue Aug  5 23:51:21 HKT 2003 William Brack <wbrack@mmm.com.hk>
@@ -10130,7 +10130,7 @@ Sun Aug  3 21:02:30 EDT 2003 Daniel Veillard <daniel@veillard.com>
        * valid.c: fixed another problem with namespaces on element
          in mixed content case
        * python/tests/reader2.py: updated the testcase with 
-         Bjorn Reese fix to reader for unsignificant white space
+         Bjorn Reese fix to reader for insignificant white space
        * parser.c HTMLparser.c: cleanup.
 
 Sun Aug  3 20:55:40 EDT 2003 Daniel Veillard <daniel@veillard.com>
@@ -10151,7 +10151,7 @@ Sun Aug  3 18:56:54 EDT 2003 Daniel Veillard <daniel@veillard.com>
 Fri Aug 1 23:55:23 HKT 2003 William Brack <wbrack@mmm.com.hk>
 
        Coninuing work on bug 118559
-       * DOCBparser.c: removed 2 unsed vars
+       * DOCBparser.c: removed 2 unused vars
        * xmlregexp.c: changed some numeric const to their enum symbols
        * xmlreader.c: changed one var define from int to enum
          (a little more to be done, awaiting co-ordination)
@@ -10318,7 +10318,7 @@ Thu Jul 10 16:02:47 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
 Tue Jul  8 16:02:19 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
-       * globals.c threads.c: fixes some problem when freeing unititialized
+       * globals.c threads.c: fixes some problem when freeing uninitialized
          mutexes
 
 Tue Jul  8 14:15:07 CEST 2003 Daniel Veillard <daniel@veillard.com>
@@ -10373,7 +10373,7 @@ Sat Jul  5 22:30:25 CEST 2003 Daniel Veillard <daniel@veillard.com>
 Sat Jul 5 00:51:30 HKT 2003 William Brack <wbrack@mmm.com.hk>
 
        Fixed problem with multi-threading, shown by the test program
-       testThreads.  After fix, ran mutiple tests on various speed
+       testThreads.  After fix, ran multiple tests on various speed
        machines (single and dual processor X86), which all seem okay.
 
        * catalog.c: added missing xmlRMutexUnlock in xmlLoadCatalog
@@ -10451,7 +10451,7 @@ Thu Jun  5 11:31:02 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
 Mon Jun  2 21:56:15 MVT 2003 Daniel Veillard <daniel@veillard.com>
 
-       * relaxng.c xmlschemas.c include/libxml/schemasInternals.h: commiting
+       * relaxng.c xmlschemas.c include/libxml/schemasInternals.h: committing
          some work done while in the Maldives (hence the timezone on the
          laptop !)
        * result/schemas/length3* test/schemas/deter0_*
@@ -11398,7 +11398,7 @@ Wed Feb 19 14:26:51 CET 2003 Daniel Veillard <daniel@veillard.com>
 
 Wed Feb 19 01:17:48 CET 2003 Daniel Veillard <daniel@veillard.com>
 
-       * relaxng.c: guess what ! Relax-NG bugfixing, what a surprize...
+       * relaxng.c: guess what ! Relax-NG bugfixing, what a surprise...
 
 Tue Feb 18 22:09:50 CET 2003 Daniel Veillard <daniel@veillard.com>
 
@@ -11929,10 +11929,10 @@ Mon Jan  6 14:06:07 CET 2003 Daniel Veillard <daniel@veillard.com>
 
        * configure.in NEWS: preparing 2.5.0 release
        * SAX.c: only warn in pedantic mode about namespace name 
-         brokeness
+         brokenness
        * globals.c: fix a doc generation problem
        * uri.c: fix #101520
-       * doc/*: updated and rebuilt the doc for the release, includuding
+       * doc/*: updated and rebuilt the doc for the release, including
          stylesheet update
        * python/Makefile.am: fix a filename bug
 
@@ -12092,7 +12092,7 @@ Sun Dec 29 12:13:18 CET 2002 Daniel Veillard <daniel@veillard.com>
 Sat Dec 28 23:49:12 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml:
-         extended the XmlTextReader API a bit, addding accessors for
+         extended the XmlTextReader API a bit, adding accessors for
          the current doc and node, and an entity substitution mode for
          the parser.
        * python/libxml.py python/libxml2class.txt: related updates
@@ -12479,7 +12479,7 @@ Sun Nov 17 10:25:43 CET 2002 Daniel Veillard <daniel@veillard.com>
 
 Sat Nov 16 16:30:25 CET 2002 Daniel Veillard <daniel@veillard.com>
 
-       * parser.c xpath.c: fixing #96925 wich was also dependent on the
+       * parser.c xpath.c: fixing #96925 which was also dependent on the
          processing of parsed entities, and XPath computation on sustitued
          entities.
        * testXPath.c: make sure entities are substituted.
@@ -12715,7 +12715,7 @@ Wed Oct 16 16:05:38 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
 Tue Oct 15 12:41:01 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
-       * README: updated the contact informations
+       * README: updated the contact information
 
 Tue Oct 15 10:35:57 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
@@ -13009,7 +13009,7 @@ Thu Sep  5 13:10:57 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
 Thu Sep  5 12:57:38 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
-       * valid.c: try to provide file and line informations, not all
+       * valid.c: try to provide file and line information, not all
          messages are covered, but it's a (good) start
 
 Thu Sep  5 12:49:35 CEST 2002 Daniel Veillard <daniel@veillard.com>
@@ -13060,7 +13060,7 @@ Wed Aug 28 13:44:54 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
 Sun Aug 25 16:38:05 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
-       * xmlIO.c: handle Windows sepecific file://localhost/ semantic ...
+       * xmlIO.c: handle Windows specific file://localhost/ semantic ...
 
 Thu Aug 22 22:03:19 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
@@ -13394,7 +13394,7 @@ Mon Jun 03 00:04:21 2002 Chema Celorio <chema@ximian.com>
 
        * tree.h: added xmlDocFormatDump which is just as xmlDocDump
          but with the format parameter
-       * tree.c: made xmlDocDump a wrapper arround xmlDocFormatDump
+       * tree.c: made xmlDocDump a wrapper around xmlDocFormatDump
 
 Fri May 31 12:16:48 2002  Aleksey Sanin  <aleksey@aleksey.com>
 
@@ -13499,13 +13499,13 @@ Wed May 15 00:25:34 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de>
 
 Tue May 14 13:00:48 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
-       * xpath.c: fixing an XPath function evalutation bug pointed out
+       * xpath.c: fixing an XPath function evaluation bug pointed out
          by Alexey Efimov where the context was lost when evaluating
          the function arguments
 
 Mon 13 May 2002 11:37:39 PM PDT Aleksey Sanin <aleksey@aleksey.com>
 
-       * xpath.c include/libxml/xpathInternals.h: maked xmlXPathNodeSetAddNs() 
+       * xpath.c include/libxml/xpathInternals.h: made xmlXPathNodeSetAddNs() 
          function public for XMLSec performance optimizations
 
 Mon May 13 12:32:22 CEST 2002 Daniel Veillard <daniel@veillard.com>
@@ -13542,7 +13542,7 @@ Wed 01 May 2002 11:29:27 AM PDT Aleksey Sanin <aleksey@aleksey.com>
        * include/libxml/xmlIO.h win32/dsp/libxml2.def.src
        win32/libxml2.def.src xmlIO.c: exported default
        'file:', 'http:' and 'ftp:' protocols input handlers 
-       and maked protocols comparisson case insensitive
+       and made protocols comparison case insensitive
 
 Tue Apr 30 16:29:05 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
@@ -13999,7 +13999,7 @@ Mon Mar 11 10:10:30 CET 2002 Daniel Veillard <daniel@veillard.com>
 Sun Mar 10 17:47:58 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * valid.c: applied patch from Dodji Seketeli fixing an
-         uninitailized variable in xmlValidGetValidElements()
+         uninitialized variable in xmlValidGetValidElements()
 
 Sat Mar  9 15:10:49 CET 2002 Daniel Veillard <daniel@veillard.com>
 
@@ -14139,12 +14139,12 @@ Fri Mar  1 17:12:15 CET 2002 Daniel Veillard <daniel@veillard.com>
 
 Fri Mar  1 13:56:12 CET 2002 Daniel Veillard <daniel@veillard.com>
 
-       * python/*: commiting some Python bindings work done while travelling
+       * python/*: committing some Python bindings work done while travelling
 
 Fri Mar  1 10:11:15 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * xmllint.c: close #72663 and #72658, don't memdump unless compiled
-         explicitely with memory debugging switched on
+         explicitly with memory debugging switched on
 
 Sat Feb 23 11:08:09 CET 2002 Daniel Veillard <daniel@veillard.com>
 
@@ -14496,7 +14496,7 @@ Sat Feb  2 11:25:51 CET 2002 Daniel Veillard <daniel@veillard.com>
 Sat Feb  2 10:13:52 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * configure.in libxml.spec.in python/Makefile.am python/TODO
-         python/generator.py python/libxml2class.txt: added more informations
+         python/generator.py python/libxml2class.txt: added more information
          in the libxml2-python package including docs. Slightly changed
          the class hierarchy
        * python/tests/*: added basic regression tests infrastructure too
@@ -14543,7 +14543,7 @@ Wed Jan 30 21:51:26 CET 2002 Daniel Veillard <daniel@veillard.com>
 Wed Jan 30 17:35:33 CET 2002 Daniel Veillard <daniel@veillard.com>
 
        * python/generator.py python/libxml.c python/libxml.py
-         python/libxml_wrap.h: commited early version of a python binding
+         python/libxml_wrap.h: committed early version of a python binding
          for private use only ATM
 
 Sat Jan 26 22:41:13 CET 2002 Daniel Veillard <daniel@veillard.com>
@@ -15441,7 +15441,7 @@ Thu Sep 20 15:54:29 CEST 2001 Daniel Veillard <daniel@veillard.com>
 Wed Sep 19 10:01:37 CEST 2001 Daniel Veillard <daniel@veillard.com>
 
        * Makefile.am libxml.spec.in: backing up non-documented changes
-         commited without review or aproval by Jens Finke <jens@gnome.org>
+         committed without review or approval by Jens Finke <jens@gnome.org>
        * HACKING: made 100% clear that no commit should be done directly
 
 Mon Sep 17 18:52:37 CEST 2001 Daniel Veillard <daniel@veillard.com>
@@ -15586,7 +15586,7 @@ Sat Aug 25 15:30:17 CEST 2001 Daniel Veillard <daniel@veillard.com>
 Thu Aug 23 23:16:32 CEST 2001 Daniel Veillard <daniel@veillard.com>
 
        * catalog.c xmlIO.c: started some serious testing and fixed
-         a few bug and optmization needs.
+         a few bug and optimization needs.
 
 Thu Aug 23 17:26:58 CEST 2001 Daniel Veillard <daniel@veillard.com>
 
@@ -15874,7 +15874,7 @@ Tue Jul 24 15:39:11 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
          this slightly
        * include/libxml/parser.h SAX.c parser.c parserInternals.c
          xmllint.c: make element content line number generation
-         optionnal to avoid breaking old apps added interface to switch
+         optional to avoid breaking old apps added interface to switch
 
 Tue Jul 24 15:06:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
@@ -16543,7 +16543,7 @@ Sun May 20 15:15:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 Sat May 19 17:11:15 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
-       * doc/xml.html: update with 2.3.9 informations
+       * doc/xml.html: update with 2.3.9 information
 
 Sat May 19 16:50:47 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
@@ -16738,7 +16738,7 @@ Sat Apr 28 18:54:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 Sat Apr 28 16:33:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
        * xpath.c: simple and efficient optimization, XPath functions
-         aways bind to the same code, cache this
+         always bind to the same code, cache this
        * TODO: updated (by saying some is obsolete)
 
 Sat Apr 28 14:23:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -16977,7 +16977,7 @@ Thu Apr 12 10:50:34 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 Wed Apr 11 16:37:50 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
        * tree.h: include xmlmemory.h this seems to havoid a nasty glibc
-         bug where the linktime verions of free() won't work ...
+         bug where the linktime versions of free() won't work ...
 
 Wed Apr 11 14:21:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
@@ -17376,7 +17376,7 @@ Thu Feb 15 15:57:14 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 Wed Feb 14 11:35:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
        * hash.[ch]: added Paolo Casarini patch to provide Delete from
-         hash functionnalities.
+         hash functionalities.
        * doc/html/* : rebuild the doc
 
 Tue Feb 13 18:01:48 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -17514,7 +17514,7 @@ Thu Jan 25 13:34:11 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 Wed Jan 24 20:27:28 COT 2001 Alejandro Forero <bachue@bachue.com>
 
-       * xmlIO.c (xmlFileOpen, xmlFileOpenW): Removed unnecesary checks.
+       * xmlIO.c (xmlFileOpen, xmlFileOpenW): Removed unnecessary checks.
 
        * xmlIO.c (xmlCheckFilename): Function added to know whether a given
          filename points to a valid file (not a directory).
@@ -17551,7 +17551,7 @@ Mon Jan 22 10:35:40 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
          of the data format with node set, as well as operators.
        * HTMLtree.c: added a newline at the end of the doctype output
          whe this one is not present initially.
-       * tree.c: make sure taht the parent and doc pointers are properly
+       * tree.c: make sure that the parent and doc pointers are properly
          set when copying attributes (lists).
 
 Sun Jan 21 10:47:38 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -17613,7 +17613,7 @@ Sat Jan  6 22:05:09 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 Sat Jan  6 19:13:27 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
-       * Makefile.am: applied patch fro make check from Martin Vidner
+       * Makefile.am: applied patch for make check from Martin Vidner
 
 Thu Jan  4 19:07:49 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
@@ -17667,7 +17667,7 @@ Wed Dec 27 12:35:49 CET 2000 Daniel Veillard <Daniel.Veillard@w3.org>
          of xmllint too when using --memory flag, added a memory test
          suite at the Makefile level.
        * xpathInternals.h xpath.[ch] xpointer.c: fixed problems
-         with namespace use when encountering QNames in XPath evalation,
+         with namespace use when encountering QNames in XPath evaluation,
          added xmlns() scheme in XPointer.
        * nanoftp.c : incorporated a fix
        * parser.c xmlIO.c: fixed problems raised with encoding when using
@@ -17892,7 +17892,7 @@ Sun Oct 22 13:59:50 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
        * valid.c: handling of blank nodes in DTd validation (raised
          by problems with a posteriori validation).
        * nanohttp.c: changing behaviour on HTTP write stuff.
-       * HTMLtree.c: forced body and html to be explicitely closed.
+       * HTMLtree.c: forced body and html to be explicitly closed.
        * xpath.h: exported more XPath functions.
 
 Sun Oct 15 22:28:32 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
@@ -18037,7 +18037,7 @@ Fri Oct  6 12:58:04 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
 
 Thu Oct  5 18:13:15 CEST 2000 Daniel Veillard <Daniel.Veillard@w3.org>
 
-       * debugXML.c testXPath.c xpath.[ch]: got pissed by some nastyness
+       * debugXML.c testXPath.c xpath.[ch]: got pissed by some nastiness
          in the XPath engine, rewrote large parts of it, now it's far
          cleaner and in sync with the REC not an old WD. Fixed a parsing
          problem in the interactive XML shell found when testing XPath.
@@ -18895,7 +18895,7 @@ Tue Dec 21 14:29:34 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
        * result/HTML/*.htm*: Updated the HTML examples regression tests output
        * SAX.c tree.c: fixed bug on defaulting namespaces on attributes
        * debugXML.c: fixed a bug on printing default namespaces.
-       * HTMLtree.c: fixed a problem when outputing XML parsed docs as HTML
+       * HTMLtree.c: fixed a problem when outputting XML parsed docs as HTML
 
 Mon Dec 20 16:20:55 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
 
@@ -18922,7 +18922,7 @@ Sat Dec 18 16:07:03 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
 Thu Dec 16 16:19:29 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
 
        * tree.c: fixed a bug introduced in 1.8.0 and breaking default
-         namespace recognition, and Dia as a resul :-(
+         namespace recognition, and Dia as a result :-(
        * encoding.c: closed bug #3950
 
 Wed Dec 15 19:22:23 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
@@ -18952,7 +18952,7 @@ Sun Dec 12 13:08:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
          buffers instead, this was really needed, validation was breaking
          in strange ways due to that. Added xmlParseStringPEReference()
          and other parsing from strings functions. Entities processing
-         modified again, but PERef are still not handled correcly but
+         modified again, but PERef are still not handled correctly but
          unless you're Eve Maller you won't notice :-)
        * HTMLparser.c: large changes toward reliability, and switched to
          lowercase internal tags, XHTML is lowercase, so it will help
@@ -19042,8 +19042,8 @@ Mon Oct 25 12:13:25 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
                    a new release out
        * HTMLparser.c: fixed auto-close bugs on list items, zeroing
                    some structures, comments before and after the
-                   main element, and other nastyness
-       * HTMLtree.c tree.c: accomodate the extended HTML supported         
+                   main element, and other nastiness
+       * HTMLtree.c tree.c: accommodate the extended HTML supported        
        * configure.in: pushing 1.7.4
        * test/ent8 and related outputs : added a new test for bug #2784
        * test/HTML/wired.html and related output: a nasty HTML example
@@ -19450,7 +19450,7 @@ Sun Jan 31 22:06:48 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
 
        * valid.[ch], tree.c, parser.c : more work toward full parsing
          of XML DTDs.
-       * README: added informations about mailing-list and on-line
+       * README: added information about mailing-list and on-line
          documentation
 
 1999-01-27  Raja R Harinath  <harinath@cs.umn.edu>
@@ -19535,7 +19535,7 @@ Thu Oct 29 00:48:45 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
 Wed Oct 28 17:56:35 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
-       * tree.[ch]: more cleanup on the API, made the tree mor conformant.
+       * tree.[ch]: more cleanup on the API, made the tree more conformant.
 
 Tue Oct 27 17:54:00 EST 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
@@ -19594,7 +19594,7 @@ Sat Oct 17 02:43:21 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 Tue Oct 13 21:46:57 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
        * tree.h, tree.c, parser.c: added prev and doc pointers to Node,
-         and changed NODEs contants for conformity with DOM Level 1
+         and changed NODEs constants for conformity with DOM Level 1
 
 Wed Oct  7 23:42:46 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
@@ -19631,7 +19631,7 @@ Mon Sep 21 20:11:13 EDT 1998 Daniel Veillard <Daniel.Veillard@w3.org>
 
 1998-08-20  Raja R Harinath  <harinath@cs.umn.edu>
 
-       * error.h: New file.  Contains prototyes from `error.c'.
+       * error.h: New file.  Contains prototypes from `error.c'.
 
 Thu Aug 13 19:02:34 1998  Tom Tromey  <tromey@cygnus.com>
 
@@ -19662,13 +19662,13 @@ Sun Jul 26 17:29:52 EDT 1998  Daniel Veillard <Daniel.Veillard@w3.org>
 Sun Jul 26 00:17:51 EDT 1998  Daniel Veillard <Daniel.Veillard@w3.org>
 
        * configure.in: added test for CPP
-       * AUTHORS, Changelog: the original ones didn't get commited but the
+       * AUTHORS, Changelog: the original ones didn't get committed but the
            glib ones instead, fixed.
        * Makefile.am: corrected an error in library naming
 
 Fri Jul 24 16:47:14 1998  Daniel Veillard <Daniel.Veillard@w3.org>
 
-       * integrated code developped at W3C
+       * integrated code developed at W3C
        * changed the original Copyright
        * migrated to automake
        * prefixed the filenames by xml_ to avoid filename clashes
index 7b6d689..b56363a 100644 (file)
@@ -69,7 +69,7 @@ static void htmlParseComment(htmlParserCtxtPtr ctxt);
 /**
  * htmlErrMemory:
  * @ctxt:  an HTML parser context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -296,7 +296,7 @@ htmlNodeInfoPop(htmlParserCtxtPtr ctxt)
 
 #define UPPER (toupper(*ctxt->input->cur))
 
-#define SKIP(val) ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val)
+#define SKIP(val) ctxt->input->cur += (val),ctxt->input->col+=(val)
 
 #define NXT(val) ctxt->input->cur[(val)]
 
@@ -330,7 +330,7 @@ htmlNodeInfoPop(htmlParserCtxtPtr ctxt)
     if (*(ctxt->input->cur) == '\n') {                                 \
        ctxt->input->line++; ctxt->input->col = 1;                      \
     } else ctxt->input->col++;                                         \
-    ctxt->token = 0; ctxt->input->cur += l; ctxt->nbChars++;           \
+    ctxt->token = 0; ctxt->input->cur += l;                            \
   } while (0)
 
 /************
@@ -414,6 +414,10 @@ htmlFindEncoding(xmlParserCtxtPtr ctxt) {
 
 static int
 htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
+    const unsigned char *cur;
+    unsigned char c;
+    unsigned int val;
+
     if (ctxt->instate == XML_PARSER_EOF)
        return(0);
 
@@ -421,99 +425,29 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
        *len = 0;
        return(ctxt->token);
     }
-    if (ctxt->charset == XML_CHAR_ENCODING_UTF8) {
-       /*
-        * We are supposed to handle UTF8, check it's valid
-        * From rfc2044: encoding of the Unicode values on UTF-8:
-        *
-        * UCS-4 range (hex.)           UTF-8 octet sequence (binary)
-        * 0000 0000-0000 007F   0xxxxxxx
-        * 0000 0080-0000 07FF   110xxxxx 10xxxxxx
-        * 0000 0800-0000 FFFF   1110xxxx 10xxxxxx 10xxxxxx
-        *
-        * Check for the 0x110000 limit too
-        */
-       const unsigned char *cur = ctxt->input->cur;
-       unsigned char c;
-       unsigned int val;
-
-       c = *cur;
-       if (c & 0x80) {
-           if (cur[1] == 0) {
-               xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
-                cur = ctxt->input->cur;
-            }
-           if ((cur[1] & 0xc0) != 0x80)
-               goto encoding_error;
-           if ((c & 0xe0) == 0xe0) {
+    if (ctxt->charset != XML_CHAR_ENCODING_UTF8) {
+        xmlChar * guess;
+        xmlCharEncodingHandlerPtr handler;
 
-               if (cur[2] == 0) {
-                   xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
-                    cur = ctxt->input->cur;
-                }
-               if ((cur[2] & 0xc0) != 0x80)
-                   goto encoding_error;
-               if ((c & 0xf0) == 0xf0) {
-                   if (cur[3] == 0) {
-                       xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
-                        cur = ctxt->input->cur;
-                    }
-                   if (((c & 0xf8) != 0xf0) ||
-                       ((cur[3] & 0xc0) != 0x80))
-                       goto encoding_error;
-                   /* 4-byte code */
-                   *len = 4;
-                   val = (cur[0] & 0x7) << 18;
-                   val |= (cur[1] & 0x3f) << 12;
-                   val |= (cur[2] & 0x3f) << 6;
-                   val |= cur[3] & 0x3f;
-               } else {
-                 /* 3-byte code */
-                   *len = 3;
-                   val = (cur[0] & 0xf) << 12;
-                   val |= (cur[1] & 0x3f) << 6;
-                   val |= cur[2] & 0x3f;
-               }
-           } else {
-             /* 2-byte code */
-               *len = 2;
-               val = (cur[0] & 0x1f) << 6;
-               val |= cur[1] & 0x3f;
-           }
-           if (!IS_CHAR(val)) {
-               htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                               "Char 0x%X out of allowed range\n", val);
-           }
-           return(val);
-       } else {
+        /*
+         * Assume it's a fixed length encoding (1) with
+         * a compatible encoding for the ASCII set, since
+         * HTML constructs only use < 128 chars
+         */
+        if ((int) *ctxt->input->cur < 0x80) {
+            *len = 1;
             if ((*ctxt->input->cur == 0) &&
                 (ctxt->input->cur < ctxt->input->end)) {
-                    htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                               "Char 0x%X out of allowed range\n", 0);
-                *len = 1;
+                htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                                "Char 0x%X out of allowed range\n", 0);
                 return(' ');
             }
-           /* 1-byte code */
-           *len = 1;
-           return((int) *ctxt->input->cur);
-       }
-    }
-    /*
-     * Assume it's a fixed length encoding (1) with
-     * a compatible encoding for the ASCII set, since
-     * XML constructs only use < 128 chars
-     */
-    *len = 1;
-    if ((int) *ctxt->input->cur < 0x80)
-       return((int) *ctxt->input->cur);
-
-    /*
-     * Humm this is bad, do an automatic flow conversion
-     */
-    {
-        xmlChar * guess;
-        xmlCharEncodingHandlerPtr handler;
+            return((int) *ctxt->input->cur);
+        }
 
+        /*
+         * Humm this is bad, do an automatic flow conversion
+         */
         guess = htmlFindEncoding(ctxt);
         if (guess == NULL) {
             xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
@@ -523,7 +457,12 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
             ctxt->input->encoding = guess;
             handler = xmlFindCharEncodingHandler((const char *) guess);
             if (handler != NULL) {
-                xmlSwitchToEncoding(ctxt, handler);
+                /*
+                 * Don't use UTF-8 encoder which isn't required and
+                 * can produce invalid UTF-8.
+                 */
+                if (!xmlStrEqual(BAD_CAST handler->name, BAD_CAST "UTF-8"))
+                    xmlSwitchToEncoding(ctxt, handler);
             } else {
                 htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
                              "Unsupported encoding %s", guess, NULL);
@@ -532,7 +471,86 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
         ctxt->charset = XML_CHAR_ENCODING_UTF8;
     }
 
-    return(xmlCurrentChar(ctxt, len));
+    /*
+     * We are supposed to handle UTF8, check it's valid
+     * From rfc2044: encoding of the Unicode values on UTF-8:
+     *
+     * UCS-4 range (hex.)           UTF-8 octet sequence (binary)
+     * 0000 0000-0000 007F   0xxxxxxx
+     * 0000 0080-0000 07FF   110xxxxx 10xxxxxx
+     * 0000 0800-0000 FFFF   1110xxxx 10xxxxxx 10xxxxxx
+     *
+     * Check for the 0x110000 limit too
+     */
+    cur = ctxt->input->cur;
+    c = *cur;
+    if (c & 0x80) {
+        if ((c & 0x40) == 0)
+            goto encoding_error;
+        if (cur[1] == 0) {
+            xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
+            cur = ctxt->input->cur;
+        }
+        if ((cur[1] & 0xc0) != 0x80)
+            goto encoding_error;
+        if ((c & 0xe0) == 0xe0) {
+
+            if (cur[2] == 0) {
+                xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
+                cur = ctxt->input->cur;
+            }
+            if ((cur[2] & 0xc0) != 0x80)
+                goto encoding_error;
+            if ((c & 0xf0) == 0xf0) {
+                if (cur[3] == 0) {
+                    xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
+                    cur = ctxt->input->cur;
+                }
+                if (((c & 0xf8) != 0xf0) ||
+                    ((cur[3] & 0xc0) != 0x80))
+                    goto encoding_error;
+                /* 4-byte code */
+                *len = 4;
+                val = (cur[0] & 0x7) << 18;
+                val |= (cur[1] & 0x3f) << 12;
+                val |= (cur[2] & 0x3f) << 6;
+                val |= cur[3] & 0x3f;
+                if (val < 0x10000)
+                    goto encoding_error;
+            } else {
+              /* 3-byte code */
+                *len = 3;
+                val = (cur[0] & 0xf) << 12;
+                val |= (cur[1] & 0x3f) << 6;
+                val |= cur[2] & 0x3f;
+                if (val < 0x800)
+                    goto encoding_error;
+            }
+        } else {
+          /* 2-byte code */
+            *len = 2;
+            val = (cur[0] & 0x1f) << 6;
+            val |= cur[1] & 0x3f;
+            if (val < 0x80)
+                goto encoding_error;
+        }
+        if (!IS_CHAR(val)) {
+            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                            "Char 0x%X out of allowed range\n", val);
+        }
+        return(val);
+    } else {
+        if ((*ctxt->input->cur == 0) &&
+            (ctxt->input->cur < ctxt->input->end)) {
+            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                            "Char 0x%X out of allowed range\n", 0);
+            *len = 1;
+            return(' ');
+        }
+        /* 1-byte code */
+        *len = 1;
+        return((int) *ctxt->input->cur);
+    }
 
 encoding_error:
     /*
@@ -557,7 +575,16 @@ encoding_error:
                     BAD_CAST buffer, NULL);
     }
 
-    ctxt->charset = XML_CHAR_ENCODING_8859_1;
+    /*
+     * Don't switch encodings twice. Note that if there's an encoder, we
+     * shouldn't receive invalid UTF-8 anyway.
+     *
+     * Note that if ctxt->input->buf == NULL, switching encodings is
+     * impossible, see Gitlab issue #34.
+     */
+    if ((ctxt->input->buf != NULL) &&
+        (ctxt->input->buf->encoder == NULL))
+        xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
     *len = 1;
     return((int) *ctxt->input->cur);
 }
@@ -584,7 +611,6 @@ htmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
                ctxt->input->line++; ctxt->input->col = 1;
            } else ctxt->input->col++;
            ctxt->input->cur++;
-           ctxt->nbChars++;
            if (*ctxt->input->cur == 0)
                xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
        }
@@ -1046,102 +1072,266 @@ html40ElementTable[] = {
 }
 };
 
+typedef struct {
+    const char *oldTag;
+    const char *newTag;
+} htmlStartCloseEntry;
+
 /*
  * start tags that imply the end of current element
  */
-static const char * const htmlStartClose[] = {
-"form",                "form", "p", "hr", "h1", "h2", "h3", "h4", "h5", "h6",
-               "dl", "ul", "ol", "menu", "dir", "address", "pre",
-               "listing", "xmp", "head", NULL,
-"head",                "p", NULL,
-"title",       "p", NULL,
-"body",                "head", "style", "link", "title", "p", NULL,
-"frameset",    "head", "style", "link", "title", "p", NULL,
-"li",          "p", "h1", "h2", "h3", "h4", "h5", "h6", "dl", "address",
-               "pre", "listing", "xmp", "head", "li", NULL,
-"hr",          "p", "head", NULL,
-"h1",          "p", "head", NULL,
-"h2",          "p", "head", NULL,
-"h3",          "p", "head", NULL,
-"h4",          "p", "head", NULL,
-"h5",          "p", "head", NULL,
-"h6",          "p", "head", NULL,
-"dir",         "p", "head", NULL,
-"address",     "p", "head", "ul", NULL,
-"pre",         "p", "head", "ul", NULL,
-"listing",     "p", "head", NULL,
-"xmp",         "p", "head", NULL,
-"blockquote",  "p", "head", NULL,
-"dl",          "p", "dt", "menu", "dir", "address", "pre", "listing",
-               "xmp", "head", NULL,
-"dt",          "p", "menu", "dir", "address", "pre", "listing", "xmp",
-                "head", "dd", NULL,
-"dd",          "p", "menu", "dir", "address", "pre", "listing", "xmp",
-                "head", "dt", NULL,
-"ul",          "p", "head", "ol", "menu", "dir", "address", "pre",
-               "listing", "xmp", NULL,
-"ol",          "p", "head", "ul", NULL,
-"menu",                "p", "head", "ul", NULL,
-"p",           "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", FONTSTYLE, NULL,
-"div",         "p", "head", NULL,
-"noscript",    "script", NULL,
-"center",      "font", "b", "i", "p", "head", NULL,
-"a",           "a", "head", NULL,
-"caption",     "p", NULL,
-"colgroup",    "caption", "colgroup", "col", "p", NULL,
-"col",         "caption", "col", "p", NULL,
-"table",       "p", "head", "h1", "h2", "h3", "h4", "h5", "h6", "pre",
-               "listing", "xmp", "a", NULL,
-"th",          "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL,
-"td",          "th", "td", "p", "span", "font", "a", "b", "i", "u", NULL,
-"tr",          "th", "td", "tr", "caption", "col", "colgroup", "p", NULL,
-"thead",       "caption", "col", "colgroup", NULL,
-"tfoot",       "th", "td", "tr", "caption", "col", "colgroup", "thead",
-               "tbody", "p", NULL,
-"tbody",       "th", "td", "tr", "caption", "col", "colgroup", "thead",
-               "tfoot", "tbody", "p", NULL,
-"optgroup",    "option", NULL,
-"option",      "option", NULL,
-"fieldset",    "legend", "p", "head", "h1", "h2", "h3", "h4", "h5", "h6",
-               "pre", "listing", "xmp", "a", NULL,
-/* most tags in in FONTSTYLE, PHRASE and SPECIAL should close <head> */
-"tt",          "head", NULL,
-"i",           "head", NULL,
-"b",           "head", NULL,
-"u",           "head", NULL,
-"s",           "head", NULL,
-"strike",      "head", NULL,
-"big",         "head", NULL,
-"small",       "head", NULL,
-
-"em",          "head", NULL,
-"strong",      "head", NULL,
-"dfn",         "head", NULL,
-"code",                "head", NULL,
-"samp",                "head", NULL,
-"kbd",         "head", NULL,
-"var",         "head", NULL,
-"cite",                "head", NULL,
-"abbr",                "head", NULL,
-"acronym",     "head", NULL,
-
-/* "a" */
-"img",         "head", NULL,
-/* "applet" */
-/* "embed" */
-/* "object" */
-"font",                "head", NULL,
-/* "basefont" */
-"br",          "head", NULL,
-/* "script" */
-"map",         "head", NULL,
-"q",           "head", NULL,
-"sub",         "head", NULL,
-"sup",         "head", NULL,
-"span",                "head", NULL,
-"bdo",         "head", NULL,
-"iframe",      "head", NULL,
-NULL
+static const htmlStartCloseEntry htmlStartClose[] = {
+    { "a", "a" },
+    { "a", "fieldset" },
+    { "a", "table" },
+    { "a", "td" },
+    { "a", "th" },
+    { "address", "dd" },
+    { "address", "dl" },
+    { "address", "dt" },
+    { "address", "form" },
+    { "address", "li" },
+    { "address", "ul" },
+    { "b", "center" },
+    { "b", "p" },
+    { "b", "td" },
+    { "b", "th" },
+    { "big", "p" },
+    { "caption", "col" },
+    { "caption", "colgroup" },
+    { "caption", "tbody" },
+    { "caption", "tfoot" },
+    { "caption", "thead" },
+    { "caption", "tr" },
+    { "col", "col" },
+    { "col", "colgroup" },
+    { "col", "tbody" },
+    { "col", "tfoot" },
+    { "col", "thead" },
+    { "col", "tr" },
+    { "colgroup", "colgroup" },
+    { "colgroup", "tbody" },
+    { "colgroup", "tfoot" },
+    { "colgroup", "thead" },
+    { "colgroup", "tr" },
+    { "dd", "dt" },
+    { "dir", "dd" },
+    { "dir", "dl" },
+    { "dir", "dt" },
+    { "dir", "form" },
+    { "dir", "ul" },
+    { "dl", "form" },
+    { "dl", "li" },
+    { "dt", "dd" },
+    { "dt", "dl" },
+    { "font", "center" },
+    { "font", "td" },
+    { "font", "th" },
+    { "form", "form" },
+    { "h1", "fieldset" },
+    { "h1", "form" },
+    { "h1", "li" },
+    { "h1", "p" },
+    { "h1", "table" },
+    { "h2", "fieldset" },
+    { "h2", "form" },
+    { "h2", "li" },
+    { "h2", "p" },
+    { "h2", "table" },
+    { "h3", "fieldset" },
+    { "h3", "form" },
+    { "h3", "li" },
+    { "h3", "p" },
+    { "h3", "table" },
+    { "h4", "fieldset" },
+    { "h4", "form" },
+    { "h4", "li" },
+    { "h4", "p" },
+    { "h4", "table" },
+    { "h5", "fieldset" },
+    { "h5", "form" },
+    { "h5", "li" },
+    { "h5", "p" },
+    { "h5", "table" },
+    { "h6", "fieldset" },
+    { "h6", "form" },
+    { "h6", "li" },
+    { "h6", "p" },
+    { "h6", "table" },
+    { "head", "a" },
+    { "head", "abbr" },
+    { "head", "acronym" },
+    { "head", "address" },
+    { "head", "b" },
+    { "head", "bdo" },
+    { "head", "big" },
+    { "head", "blockquote" },
+    { "head", "body" },
+    { "head", "br" },
+    { "head", "center" },
+    { "head", "cite" },
+    { "head", "code" },
+    { "head", "dd" },
+    { "head", "dfn" },
+    { "head", "dir" },
+    { "head", "div" },
+    { "head", "dl" },
+    { "head", "dt" },
+    { "head", "em" },
+    { "head", "fieldset" },
+    { "head", "font" },
+    { "head", "form" },
+    { "head", "frameset" },
+    { "head", "h1" },
+    { "head", "h2" },
+    { "head", "h3" },
+    { "head", "h4" },
+    { "head", "h5" },
+    { "head", "h6" },
+    { "head", "hr" },
+    { "head", "i" },
+    { "head", "iframe" },
+    { "head", "img" },
+    { "head", "kbd" },
+    { "head", "li" },
+    { "head", "listing" },
+    { "head", "map" },
+    { "head", "menu" },
+    { "head", "ol" },
+    { "head", "p" },
+    { "head", "pre" },
+    { "head", "q" },
+    { "head", "s" },
+    { "head", "samp" },
+    { "head", "small" },
+    { "head", "span" },
+    { "head", "strike" },
+    { "head", "strong" },
+    { "head", "sub" },
+    { "head", "sup" },
+    { "head", "table" },
+    { "head", "tt" },
+    { "head", "u" },
+    { "head", "ul" },
+    { "head", "var" },
+    { "head", "xmp" },
+    { "hr", "form" },
+    { "i", "center" },
+    { "i", "p" },
+    { "i", "td" },
+    { "i", "th" },
+    { "legend", "fieldset" },
+    { "li", "li" },
+    { "link", "body" },
+    { "link", "frameset" },
+    { "listing", "dd" },
+    { "listing", "dl" },
+    { "listing", "dt" },
+    { "listing", "fieldset" },
+    { "listing", "form" },
+    { "listing", "li" },
+    { "listing", "table" },
+    { "listing", "ul" },
+    { "menu", "dd" },
+    { "menu", "dl" },
+    { "menu", "dt" },
+    { "menu", "form" },
+    { "menu", "ul" },
+    { "ol", "form" },
+    { "ol", "ul" },
+    { "option", "optgroup" },
+    { "option", "option" },
+    { "p", "address" },
+    { "p", "blockquote" },
+    { "p", "body" },
+    { "p", "caption" },
+    { "p", "center" },
+    { "p", "col" },
+    { "p", "colgroup" },
+    { "p", "dd" },
+    { "p", "dir" },
+    { "p", "div" },
+    { "p", "dl" },
+    { "p", "dt" },
+    { "p", "fieldset" },
+    { "p", "form" },
+    { "p", "frameset" },
+    { "p", "h1" },
+    { "p", "h2" },
+    { "p", "h3" },
+    { "p", "h4" },
+    { "p", "h5" },
+    { "p", "h6" },
+    { "p", "head" },
+    { "p", "hr" },
+    { "p", "li" },
+    { "p", "listing" },
+    { "p", "menu" },
+    { "p", "ol" },
+    { "p", "p" },
+    { "p", "pre" },
+    { "p", "table" },
+    { "p", "tbody" },
+    { "p", "td" },
+    { "p", "tfoot" },
+    { "p", "th" },
+    { "p", "title" },
+    { "p", "tr" },
+    { "p", "ul" },
+    { "p", "xmp" },
+    { "pre", "dd" },
+    { "pre", "dl" },
+    { "pre", "dt" },
+    { "pre", "fieldset" },
+    { "pre", "form" },
+    { "pre", "li" },
+    { "pre", "table" },
+    { "pre", "ul" },
+    { "s", "p" },
+    { "script", "noscript" },
+    { "small", "p" },
+    { "span", "td" },
+    { "span", "th" },
+    { "strike", "p" },
+    { "style", "body" },
+    { "style", "frameset" },
+    { "tbody", "tbody" },
+    { "tbody", "tfoot" },
+    { "td", "tbody" },
+    { "td", "td" },
+    { "td", "tfoot" },
+    { "td", "th" },
+    { "td", "tr" },
+    { "tfoot", "tbody" },
+    { "th", "tbody" },
+    { "th", "td" },
+    { "th", "tfoot" },
+    { "th", "th" },
+    { "th", "tr" },
+    { "thead", "tbody" },
+    { "thead", "tfoot" },
+    { "title", "body" },
+    { "title", "frameset" },
+    { "tr", "tbody" },
+    { "tr", "tfoot" },
+    { "tr", "tr" },
+    { "tt", "p" },
+    { "u", "p" },
+    { "u", "td" },
+    { "u", "th" },
+    { "ul", "address" },
+    { "ul", "form" },
+    { "ul", "menu" },
+    { "ul", "ol" },
+    { "ul", "pre" },
+    { "xmp", "dd" },
+    { "xmp", "dl" },
+    { "xmp", "dt" },
+    { "xmp", "fieldset" },
+    { "xmp", "form" },
+    { "xmp", "li" },
+    { "xmp", "table" },
+    { "xmp", "ul" }
 };
 
 /*
@@ -1211,9 +1401,6 @@ static const elementPriority htmlEndPriority[] = {
     {NULL,    100} /* Default priority */
 };
 
-static const char** htmlStartCloseIndex[100];
-static int htmlStartCloseIndexinitialized = 0;
-
 /************************************************************************
  *                                                                     *
  *     functions to handle HTML specific data                  *
@@ -1223,24 +1410,18 @@ static int htmlStartCloseIndexinitialized = 0;
 /**
  * htmlInitAutoClose:
  *
- * Initialize the htmlStartCloseIndex for fast lookup of closing tags names.
- * This is not reentrant. Call xmlInitParser() once before processing in
- * case of use in multithreaded programs.
+ * This is a no-op now.
  */
 void
 htmlInitAutoClose(void) {
-    int indx, i = 0;
+}
 
-    if (htmlStartCloseIndexinitialized) return;
+static int
+htmlCompareTags(const void *key, const void *member) {
+    const xmlChar *tag = (const xmlChar *) key;
+    const htmlElemDesc *desc = (const htmlElemDesc *) member;
 
-    for (indx = 0;indx < 100;indx ++) htmlStartCloseIndex[indx] = NULL;
-    indx = 0;
-    while ((htmlStartClose[i] != NULL) && (indx < 100 - 1)) {
-        htmlStartCloseIndex[indx++] = (const char**) &htmlStartClose[i];
-       while (htmlStartClose[i] != NULL) i++;
-       i++;
-    }
-    htmlStartCloseIndexinitialized = 1;
+    return(xmlStrcasecmp(tag, BAD_CAST desc->name));
 }
 
 /**
@@ -1253,14 +1434,12 @@ htmlInitAutoClose(void) {
  */
 const htmlElemDesc *
 htmlTagLookup(const xmlChar *tag) {
-    unsigned int i;
+    if (tag == NULL)
+        return(NULL);
 
-    for (i = 0; i < (sizeof(html40ElementTable) /
-                     sizeof(html40ElementTable[0]));i++) {
-        if (!xmlStrcasecmp(tag, BAD_CAST html40ElementTable[i].name))
-           return((htmlElemDescPtr) &html40ElementTable[i]);
-    }
-    return(NULL);
+    return((const htmlElemDesc *) bsearch(tag, html40ElementTable,
+                sizeof(html40ElementTable) / sizeof(htmlElemDesc),
+                sizeof(htmlElemDesc), htmlCompareTags));
 }
 
 /**
@@ -1281,6 +1460,19 @@ htmlGetEndPriority (const xmlChar *name) {
 }
 
 
+static int
+htmlCompareStartClose(const void *vkey, const void *member) {
+    const htmlStartCloseEntry *key = (const htmlStartCloseEntry *) vkey;
+    const htmlStartCloseEntry *entry = (const htmlStartCloseEntry *) member;
+    int ret;
+
+    ret = strcmp(key->oldTag, entry->oldTag);
+    if (ret == 0)
+        ret = strcmp(key->newTag, entry->newTag);
+
+    return(ret);
+}
+
 /**
  * htmlCheckAutoClose:
  * @newtag:  The new tag name
@@ -1288,37 +1480,21 @@ htmlGetEndPriority (const xmlChar *name) {
  *
  * Checks whether the new tag is one of the registered valid tags for
  * closing old.
- * Initialize the htmlStartCloseIndex for fast lookup of closing tags names.
  *
  * Returns 0 if no, 1 if yes.
  */
 static int
 htmlCheckAutoClose(const xmlChar * newtag, const xmlChar * oldtag)
 {
-    int i, indx;
-    const char **closed = NULL;
-
-    if (htmlStartCloseIndexinitialized == 0)
-        htmlInitAutoClose();
-
-    /* inefficient, but not a big deal */
-    for (indx = 0; indx < 100; indx++) {
-        closed = htmlStartCloseIndex[indx];
-        if (closed == NULL)
-            return (0);
-        if (xmlStrEqual(BAD_CAST * closed, newtag))
-            break;
-    }
-
-    i = closed - htmlStartClose;
-    i++;
-    while (htmlStartClose[i] != NULL) {
-        if (xmlStrEqual(BAD_CAST htmlStartClose[i], oldtag)) {
-            return (1);
-        }
-        i++;
-    }
-    return (0);
+    htmlStartCloseEntry key;
+    void *res;
+
+    key.oldTag = (const char *) oldtag;
+    key.newTag = (const char *) newtag;
+    res = bsearch(&key, htmlStartClose,
+            sizeof(htmlStartClose) / sizeof(htmlStartCloseEntry),
+            sizeof(htmlStartCloseEntry), htmlCompareStartClose);
+    return(res != NULL);
 }
 
 /**
@@ -2482,7 +2658,6 @@ htmlParseName(htmlParserCtxtPtr ctxt) {
            count = in - ctxt->input->cur;
            ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
            ctxt->input->cur = in;
-           ctxt->nbChars += count;
            ctxt->input->col += count;
            return(ret);
        }
@@ -2789,47 +2964,39 @@ htmlParseAttValue(htmlParserCtxtPtr ctxt) {
 static xmlChar *
 htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
     size_t len = 0, startPosition = 0;
+    int err = 0;
+    int quote;
     xmlChar *ret = NULL;
 
-    if (CUR == '"') {
-        NEXT;
+    if ((CUR != '"') && (CUR != '\'')) {
+       htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
+                    "SystemLiteral \" or ' expected\n", NULL, NULL);
+        return(NULL);
+    }
+    quote = CUR;
+    NEXT;
 
-        if (CUR_PTR < BASE_PTR)
-            return(ret);
-        startPosition = CUR_PTR - BASE_PTR;
+    if (CUR_PTR < BASE_PTR)
+        return(ret);
+    startPosition = CUR_PTR - BASE_PTR;
 
-       while ((IS_CHAR_CH(CUR)) && (CUR != '"')) {
-           NEXT;
-           len++;
-       }
-       if (!IS_CHAR_CH(CUR)) {
-           htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
-                        "Unfinished SystemLiteral\n", NULL, NULL);
-       } else {
-           ret = xmlStrndup((BASE_PTR+startPosition), len);
-           NEXT;
+    while ((CUR != 0) && (CUR != quote)) {
+        /* TODO: Handle UTF-8 */
+        if (!IS_CHAR_CH(CUR)) {
+            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                            "Invalid char in SystemLiteral 0x%X\n", CUR);
+            err = 1;
         }
-    } else if (CUR == '\'') {
         NEXT;
-
-        if (CUR_PTR < BASE_PTR)
-            return(ret);
-        startPosition = CUR_PTR - BASE_PTR;
-
-       while ((IS_CHAR_CH(CUR)) && (CUR != '\'')) {
-           NEXT;
-           len++;
-       }
-       if (!IS_CHAR_CH(CUR)) {
-           htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
-                        "Unfinished SystemLiteral\n", NULL, NULL);
-       } else {
-           ret = xmlStrndup((BASE_PTR+startPosition), len);
-           NEXT;
-        }
+        len++;
+    }
+    if (CUR != quote) {
+        htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
+                     "Unfinished SystemLiteral\n", NULL, NULL);
     } else {
-       htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
-                    " or ' expected\n", NULL, NULL);
+        NEXT;
+        if (err == 0)
+            ret = xmlStrndup((BASE_PTR+startPosition), len);
     }
 
     return(ret);
@@ -2849,51 +3016,42 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
 static xmlChar *
 htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
     size_t len = 0, startPosition = 0;
+    int err = 0;
+    int quote;
     xmlChar *ret = NULL;
+
+    if ((CUR != '"') && (CUR != '\'')) {
+       htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
+                    "PubidLiteral \" or ' expected\n", NULL, NULL);
+        return(NULL);
+    }
+    quote = CUR;
+    NEXT;
+
     /*
      * Name ::= (Letter | '_') (NameChar)*
      */
-    if (CUR == '"') {
-        NEXT;
-
-        if (CUR_PTR < BASE_PTR)
-            return(ret);
-        startPosition = CUR_PTR - BASE_PTR;
-
-        while (IS_PUBIDCHAR_CH(CUR)) {
-            len++;
-            NEXT;
+    if (CUR_PTR < BASE_PTR)
+        return(ret);
+    startPosition = CUR_PTR - BASE_PTR;
+
+    while ((CUR != 0) && (CUR != quote)) {
+        if (!IS_PUBIDCHAR_CH(CUR)) {
+            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                            "Invalid char in PubidLiteral 0x%X\n", CUR);
+            err = 1;
         }
-
-       if (CUR != '"') {
-           htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
-                        "Unfinished PubidLiteral\n", NULL, NULL);
-       } else {
-           ret = xmlStrndup((BASE_PTR + startPosition), len);
-           NEXT;
-       }
-    } else if (CUR == '\'') {
+        len++;
         NEXT;
+    }
 
-        if (CUR_PTR < BASE_PTR)
-            return(ret);
-        startPosition = CUR_PTR - BASE_PTR;
-
-        while ((IS_PUBIDCHAR_CH(CUR)) && (CUR != '\'')){
-            len++;
-            NEXT;
-        }
-
-       if (CUR != '\'') {
-           htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
-                        "Unfinished PubidLiteral\n", NULL, NULL);
-       } else {
-           ret = xmlStrndup((BASE_PTR + startPosition), len);
-           NEXT;
-       }
+    if (CUR != '"') {
+        htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
+                     "Unfinished PubidLiteral\n", NULL, NULL);
     } else {
-       htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
-                    "PubidLiteral \" or ' expected\n", NULL, NULL);
+        NEXT;
+        if (err == 0)
+            ret = xmlStrndup((BASE_PTR + startPosition), len);
     }
 
     return(ret);
@@ -2928,7 +3086,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
 
     SHRINK;
     cur = CUR_CHAR(l);
-    while (IS_CHAR_CH(cur)) {
+    while (cur != 0) {
        if ((cur == '<') && (NXT(1) == '/')) {
             /*
              * One should break here, the specification is clear:
@@ -2959,7 +3117,12 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
                 }
             }
        }
-       COPY_BUF(l,buf,nbchar,cur);
+        if (IS_CHAR(cur)) {
+           COPY_BUF(l,buf,nbchar,cur);
+        } else {
+            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                            "Invalid char in CDATA 0x%X\n", cur);
+        }
        if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
             buf[nbchar] = 0;
            if (ctxt->sax->cdataBlock!= NULL) {
@@ -2977,14 +3140,6 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
        cur = CUR_CHAR(l);
     }
 
-    if ((!(IS_CHAR_CH(cur))) && (!((cur == 0) && (ctxt->progressive)))) {
-        htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                    "Invalid char in CDATA 0x%X\n", cur);
-        if (ctxt->input->cur < ctxt->input->end) {
-            NEXT;
-        }
-    }
-
     if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
         buf[nbchar] = 0;
        if (ctxt->sax->cdataBlock!= NULL) {
@@ -3232,7 +3387,7 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
            }
             SKIP_BLANKS;
            cur = CUR_CHAR(l);
-           while (IS_CHAR(cur) && (cur != '>')) {
+           while ((cur != 0) && (cur != '>')) {
                if (len + 5 >= size) {
                    xmlChar *tmp;
 
@@ -3251,7 +3406,13 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
                    GROW;
                    count = 0;
                }
-               COPY_BUF(l,buf,len,cur);
+                if (IS_CHAR(cur)) {
+                   COPY_BUF(l,buf,len,cur);
+                } else {
+                    htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                                    "Invalid char in processing instruction "
+                                    "0x%X\n", cur);
+                }
                NEXTL(l);
                cur = CUR_CHAR(l);
                if (cur == 0) {
@@ -3300,6 +3461,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
     int q, ql;
     int r, rl;
     int cur, l;
+    int next, nl;
     xmlParserInputState state;
 
     /*
@@ -3321,17 +3483,32 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
     len = 0;
     buf[len] = 0;
     q = CUR_CHAR(ql);
-    if (!IS_CHAR(q))
+    if (q == 0)
         goto unfinished;
     NEXTL(ql);
     r = CUR_CHAR(rl);
-    if (!IS_CHAR(r))
+    if (r == 0)
         goto unfinished;
     NEXTL(rl);
     cur = CUR_CHAR(l);
-    while (IS_CHAR(cur) &&
+    while ((cur != 0) &&
            ((cur != '>') ||
            (r != '-') || (q != '-'))) {
+       NEXTL(l);
+       next = CUR_CHAR(nl);
+       if (next == 0) {
+           SHRINK;
+           GROW;
+           next = CUR_CHAR(nl);
+       }
+
+       if ((q == '-') && (r == '-') && (cur == '!') && (next == '>')) {
+         htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
+                      "Comment incorrectly closed by '--!>'", NULL, NULL);
+         cur = '>';
+         break;
+       }
+
        if (len + 5 >= size) {
            xmlChar *tmp;
 
@@ -3345,21 +3522,22 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
            }
            buf = tmp;
        }
-       COPY_BUF(ql,buf,len,q);
+        if (IS_CHAR(q)) {
+           COPY_BUF(ql,buf,len,q);
+        } else {
+            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
+                            "Invalid char in comment 0x%X\n", q);
+        }
+
        q = r;
        ql = rl;
        r = cur;
        rl = l;
-       NEXTL(l);
-       cur = CUR_CHAR(l);
-       if (cur == 0) {
-           SHRINK;
-           GROW;
-           cur = CUR_CHAR(l);
-       }
+       cur = next;
+       l = nl;
     }
     buf[len] = 0;
-    if (IS_CHAR(cur)) {
+    if (cur == '>') {
         NEXT;
        if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
            (!ctxt->disableSAX))
@@ -3400,13 +3578,16 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) {
         ((NXT(2) == 'x') || NXT(2) == 'X')) {
        SKIP(3);
        while (CUR != ';') {
-           if ((CUR >= '0') && (CUR <= '9'))
-               val = val * 16 + (CUR - '0');
-           else if ((CUR >= 'a') && (CUR <= 'f'))
-               val = val * 16 + (CUR - 'a') + 10;
-           else if ((CUR >= 'A') && (CUR <= 'F'))
-               val = val * 16 + (CUR - 'A') + 10;
-           else {
+           if ((CUR >= '0') && (CUR <= '9')) {
+                if (val < 0x110000)
+                   val = val * 16 + (CUR - '0');
+            } else if ((CUR >= 'a') && (CUR <= 'f')) {
+                if (val < 0x110000)
+                   val = val * 16 + (CUR - 'a') + 10;
+            } else if ((CUR >= 'A') && (CUR <= 'F')) {
+                if (val < 0x110000)
+                   val = val * 16 + (CUR - 'A') + 10;
+            } else {
                htmlParseErr(ctxt, XML_ERR_INVALID_HEX_CHARREF,
                             "htmlParseCharRef: missing semicolon\n",
                             NULL, NULL);
@@ -3419,9 +3600,10 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) {
     } else if  ((CUR == '&') && (NXT(1) == '#')) {
        SKIP(2);
        while (CUR != ';') {
-           if ((CUR >= '0') && (CUR <= '9'))
-               val = val * 10 + (CUR - '0');
-           else {
+           if ((CUR >= '0') && (CUR <= '9')) {
+                if (val < 0x110000)
+                   val = val * 10 + (CUR - '0');
+            } else {
                htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF,
                             "htmlParseCharRef: missing semicolon\n",
                             NULL, NULL);
@@ -3440,6 +3622,9 @@ htmlParseCharRef(htmlParserCtxtPtr ctxt) {
      */
     if (IS_CHAR(val)) {
         return(val);
+    } else if (val >= 0x110000) {
+       htmlParseErr(ctxt, XML_ERR_INVALID_CHAR,
+                    "htmlParseCharRef: value too large\n", NULL, NULL);
     } else {
        htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
                        "htmlParseCharRef: invalid xmlChar value %d\n",
@@ -3499,9 +3684,12 @@ htmlParseDocTypeDecl(htmlParserCtxtPtr ctxt) {
     if (CUR != '>') {
        htmlParseErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED,
                     "DOCTYPE improperly terminated\n", NULL, NULL);
-        /* We shouldn't try to resynchronize ... */
+        /* Ignore bogus content */
+        while ((CUR != 0) && (CUR != '>'))
+            NEXT;
     }
-    NEXT;
+    if (CUR == '>')
+        NEXT;
 
     /*
      * Create or update the document accordingly to the DOCTYPE
@@ -3779,7 +3967,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
 
 
        /* Dump the bogus tag like browsers do */
-       while ((IS_CHAR_CH(CUR)) && (CUR != '>') &&
+       while ((CUR != 0) && (CUR != '>') &&
                (ctxt->instate != XML_PARSER_EOF))
            NEXT;
         return -1;
@@ -3835,11 +4023,9 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
      * (S Attribute)* S?
      */
     SKIP_BLANKS;
-    while ((IS_CHAR_CH(CUR)) &&
+    while ((CUR != 0) &&
            (CUR != '>') &&
           ((CUR != '/') || (NXT(1) != '>'))) {
-       long cons = ctxt->nbChars;
-
        GROW;
        attname = htmlParseAttribute(ctxt, &attvalue);
         if (attname != NULL) {
@@ -3898,7 +4084,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
                xmlFree(attvalue);
            /* Dump the bogus attribute string up to the next blank or
             * the end of the tag. */
-           while ((IS_CHAR_CH(CUR)) &&
+           while ((CUR != 0) &&
                   !(IS_BLANK_CH(CUR)) && (CUR != '>') &&
                   ((CUR != '/') || (NXT(1) != '>')))
                NEXT;
@@ -3906,12 +4092,6 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
 
 failed:
        SKIP_BLANKS;
-        if (cons == ctxt->nbChars) {
-           htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
-                        "htmlParseStartTag: problem parsing attributes\n",
-                        NULL, NULL);
-           break;
-       }
     }
 
     /*
@@ -3979,19 +4159,14 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
      * We should definitely be at the ending "S? '>'" part
      */
     SKIP_BLANKS;
-    if ((!IS_CHAR_CH(CUR)) || (CUR != '>')) {
+    if (CUR != '>') {
         htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
                     "End tag : expected '>'\n", NULL, NULL);
-       if (ctxt->recovery) {
-           /*
-            * We're not at the ending > !!
-            * Error, unless in recover mode where we search forwards
-            * until we find a >
-            */
-           while (CUR != '\0' && CUR != '>') NEXT;
-           NEXT;
-       }
-    } else
+        /* Skip to next '>' */
+        while ((CUR != 0) && (CUR != '>'))
+            NEXT;
+    }
+    if (CUR == '>')
         NEXT;
 
     /*
@@ -4032,12 +4207,10 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
      * With the exception that the autoclose may have popped stuff out
      * of the stack.
      */
-    if (!xmlStrEqual(name, ctxt->name)) {
-        if ((ctxt->name != NULL) && (!xmlStrEqual(ctxt->name, name))) {
-            htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
-                        "Opening and ending tag mismatch: %s and %s\n",
-                        name, ctxt->name);
-        }
+    if ((ctxt->name != NULL) && (!xmlStrEqual(ctxt->name, name))) {
+        htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
+                     "Opening and ending tag mismatch: %s and %s\n",
+                     name, ctxt->name);
     }
 
     /*
@@ -4152,8 +4325,6 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
     currentNode = xmlStrdup(ctxt->name);
     depth = ctxt->nameNr;
     while (1) {
-       long cons = ctxt->nbChars;
-
         GROW;
 
         if (ctxt->instate == XML_PARSER_EOF)
@@ -4181,7 +4352,7 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
                         "htmlParseStartTag: invalid element name\n",
                         NULL, NULL);
                /* Dump the bogus tag like browsers do */
-        while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
+                while ((CUR != 0) && (CUR != '>'))
                    NEXT;
 
                if (currentNode != NULL)
@@ -4273,15 +4444,6 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
            else {
                htmlParseCharData(ctxt);
            }
-
-           if (cons == ctxt->nbChars) {
-               if (ctxt->node != NULL) {
-                   htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
-                                "detected an error in element content\n",
-                                NULL, NULL);
-               }
-               break;
-           }
        }
         GROW;
     }
@@ -4396,7 +4558,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
      */
     currentNode = xmlStrdup(ctxt->name);
     depth = ctxt->nameNr;
-    while (IS_CHAR_CH(CUR)) {
+    while (CUR != 0) {
        oldptr = ctxt->input->cur;
        htmlParseContent(ctxt);
        if (oldptr==ctxt->input->cur) break;
@@ -4413,7 +4575,7 @@ htmlParseElement(htmlParserCtxtPtr ctxt) {
        node_info.node = ctxt->node;
        xmlParserAddNodeInfo(ctxt, &node_info);
     }
-    if (!IS_CHAR_CH(CUR)) {
+    if (CUR == 0) {
        htmlAutoCloseOnEnd(ctxt);
     }
 
@@ -4434,7 +4596,7 @@ htmlParserFinishElementParsing(htmlParserCtxtPtr ctxt) {
        xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
        htmlNodeInfoPop(ctxt);
     }
-    if (!IS_CHAR_CH(CUR)) {
+    if (CUR == 0) {
        htmlAutoCloseOnEnd(ctxt);
     }
 }
@@ -4552,8 +4714,6 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
     currentNode = xmlStrdup(ctxt->name);
     depth = ctxt->nameNr;
     while (1) {
-       long cons = ctxt->nbChars;
-
         GROW;
 
         if (ctxt->instate == XML_PARSER_EOF)
@@ -4583,7 +4743,7 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
                         "htmlParseStartTag: invalid element name\n",
                         NULL, NULL);
                /* Dump the bogus tag like browsers do */
-               while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
+               while ((CUR == 0) && (CUR != '>'))
                    NEXT;
 
                htmlParserFinishElementParsing(ctxt);
@@ -4687,15 +4847,6 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
            else {
                htmlParseCharData(ctxt);
            }
-
-           if (cons == ctxt->nbChars) {
-               if (ctxt->node != NULL) {
-                   htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
-                                "detected an error in element content\n",
-                                NULL, NULL);
-               }
-               break;
-           }
        }
         GROW;
     }
@@ -4959,7 +5110,6 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
     ctxt->vctxt.warning = xmlParserValidityWarning;
     ctxt->record_info = 0;
     ctxt->validate = 0;
-    ctxt->nbChars = 0;
     ctxt->checkIndex = 0;
     ctxt->catalogs = NULL;
     xmlInitNodeInfoSeq(&ctxt->node_seq);
@@ -5119,7 +5269,7 @@ htmlCreateDocParserCtxt(const xmlChar *cur, const char *encoding) {
  * @first:  the first char to lookup
  * @next:  the next char to lookup or zero
  * @third:  the next char to lookup or zero
- * @comment: flag to force checking inside comments
+ * @ignoreattrval: skip over attribute values
  *
  * Try to find if a sequence (first, next, third) or  just (first next) or
  * (first) is available in the input stream.
@@ -5133,13 +5283,11 @@ htmlCreateDocParserCtxt(const xmlChar *cur, const char *encoding) {
  */
 static int
 htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
-                        xmlChar next, xmlChar third, int iscomment,
-                        int ignoreattrval)
+                        xmlChar next, xmlChar third, int ignoreattrval)
 {
     int base, len;
     htmlParserInputPtr in;
     const xmlChar *buf;
-    int incomment = 0;
     int invalue = 0;
     char valdellim = 0x0;
 
@@ -5151,8 +5299,11 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
     if (base < 0)
         return (-1);
 
-    if (ctxt->checkIndex > base)
+    if (ctxt->checkIndex > base) {
         base = ctxt->checkIndex;
+        /* Abuse hasPErefs member to restore current state. */
+        invalue = ctxt->hasPErefs & 1 ? 1 : 0;
+    }
 
     if (in->buf == NULL) {
         buf = in->base;
@@ -5168,14 +5319,6 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
     else if (next)
         len--;
     for (; base < len; base++) {
-        if ((!incomment) && (base + 4 < len) && (!iscomment)) {
-            if ((buf[base] == '<') && (buf[base + 1] == '!') &&
-                (buf[base + 2] == '-') && (buf[base + 3] == '-')) {
-                incomment = 1;
-                /* do not increment past <! - some people use <!--> */
-                base += 2;
-            }
-        }
         if (ignoreattrval) {
             if (buf[base] == '"' || buf[base] == '\'') {
                 if (invalue) {
@@ -5192,16 +5335,6 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
                 continue;
             }
         }
-        if (incomment) {
-            if (base + 3 > len)
-                return (-1);
-            if ((buf[base] == '-') && (buf[base + 1] == '-') &&
-                (buf[base + 2] == '>')) {
-                incomment = 0;
-                base += 2;
-            }
-            continue;
-        }
         if (buf[base] == first) {
             if (third != 0) {
                 if ((buf[base + 1] != next) || (buf[base + 2] != third))
@@ -5228,8 +5361,12 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
             return (base - (in->cur - in->base));
         }
     }
-    if ((!incomment) && (!invalue))
-        ctxt->checkIndex = base;
+    ctxt->checkIndex = base;
+    /* Abuse hasPErefs member to track current state. */
+    if (invalue)
+        ctxt->hasPErefs |= 1;
+    else
+        ctxt->hasPErefs &= ~1;
 #ifdef DEBUG_PUSH
     if (next == 0)
         xmlGenericError(xmlGenericErrorContext,
@@ -5246,79 +5383,38 @@ htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
 }
 
 /**
- * htmlParseLookupChars:
+ * htmlParseLookupCommentEnd:
  * @ctxt: an HTML parser context
- * @stop: Array of chars, which stop the lookup.
- * @stopLen: Length of stop-Array
  *
- * Try to find if any char of the stop-Array is available in the input
- * stream.
+ * Try to find a comment end tag in the input stream
+ * The search includes "-->" as well as WHATWG-recommended incorrectly-closed tags.
+ * (See https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment)
  * This function has a side effect of (possibly) incrementing ctxt->checkIndex
  * to avoid rescanning sequences of bytes, it DOES change the state of the
  * parser, do not use liberally.
+ * This wraps to htmlParseLookupSequence()
  *
- * Returns the index to the current parsing point if a stopChar
- *      is available, -1 otherwise.
+ * Returns the index to the current parsing point if the full sequence is available, -1 otherwise.
  */
 static int
-htmlParseLookupChars(htmlParserCtxtPtr ctxt, const xmlChar * stop,
-                     int stopLen)
+htmlParseLookupCommentEnd(htmlParserCtxtPtr ctxt)
 {
-    int base, len;
-    htmlParserInputPtr in;
-    const xmlChar *buf;
-    int incomment = 0;
-    int i;
-
-    in = ctxt->input;
-    if (in == NULL)
-        return (-1);
-
-    base = in->cur - in->base;
-    if (base < 0)
-        return (-1);
-
-    if (ctxt->checkIndex > base)
-        base = ctxt->checkIndex;
-
-    if (in->buf == NULL) {
-        buf = in->base;
-        len = in->length;
-    } else {
-        buf = xmlBufContent(in->buf->buffer);
-        len = xmlBufUse(in->buf->buffer);
-    }
-
-    for (; base < len; base++) {
-        if (!incomment && (base + 4 < len)) {
-            if ((buf[base] == '<') && (buf[base + 1] == '!') &&
-                (buf[base + 2] == '-') && (buf[base + 3] == '-')) {
-                incomment = 1;
-                /* do not increment past <! - some people use <!--> */
-                base += 2;
-            }
-        }
-        if (incomment) {
-            if (base + 3 > len)
-                return (-1);
-            if ((buf[base] == '-') && (buf[base + 1] == '-') &&
-                (buf[base + 2] == '>')) {
-                incomment = 0;
-                base += 2;
-            }
-            continue;
-        }
-        for (i = 0; i < stopLen; ++i) {
-            if (buf[base] == stop[i]) {
-                ctxt->checkIndex = 0;
-                return (base - (in->cur - in->base));
-            }
-        }
+    int mark = 0;
+    int cur = CUR_PTR - BASE_PTR;
+
+    while (mark >= 0) {
+       mark = htmlParseLookupSequence(ctxt, '-', '-', 0, 0);
+       if ((mark < 0) ||
+           (NXT(mark+2) == '>') ||
+           ((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
+           return mark;
+       }
+       ctxt->checkIndex = cur + mark + 1;
     }
-    ctxt->checkIndex = base;
-    return (-1);
+    return mark;
 }
 
+
 /**
  * htmlParseTryOrFinish:
  * @ctxt:  an HTML parser context
@@ -5332,7 +5428,7 @@ static int
 htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
     int ret = 0;
     htmlParserInputPtr in;
-    int avail = 0;
+    ptrdiff_t avail = 0;
     xmlChar cur, next;
 
     htmlParserNodeInfo node_info;
@@ -5397,7 +5493,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
        if (in->buf == NULL)
            avail = in->length - (in->cur - in->base);
        else
-           avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+           avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+                    (in->cur - in->base);
        if ((avail == 0) && (terminate)) {
            htmlAutoCloseOnEnd(ctxt);
            if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) {
@@ -5411,6 +5508,12 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
        }
         if (avail < 1)
            goto done;
+        /*
+         * This is done to make progress and avoid an infinite loop
+         * if a parsing attempt was aborted by hitting a NUL byte. After
+         * changing htmlCurrentChar, this probably isn't necessary anymore.
+         * We should consider removing this check.
+         */
        cur = in->cur[0];
        if (cur == 0) {
            SKIP(1);
@@ -5433,7 +5536,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    if (in->buf == NULL)
                        avail = in->length - (in->cur - in->base);
                    else
-                       avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+                       avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+                                (in->cur - in->base);
                }
                if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
                    ctxt->sax->setDocumentLocator(ctxt->userData,
@@ -5450,7 +5554,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    (UPP(6) == 'Y') && (UPP(7) == 'P') &&
                    (UPP(8) == 'E')) {
                    if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5475,14 +5579,15 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                if (in->buf == NULL)
                    avail = in->length - (in->cur - in->base);
                else
-                   avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+                   avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+                            (in->cur - in->base);
                /*
                 * no chars in buffer
                 */
                if (avail < 1)
                    goto done;
                /*
-                * not enouth chars in buffer
+                * not enough chars in buffer
                 */
                if (avail < 2) {
                    if (!terminate)
@@ -5495,8 +5600,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                cur = in->cur[0];
                if ((cur == '<') && (next == '!') &&
                    (in->cur[2] == '-') && (in->cur[3] == '-')) {
-                   if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
+                   if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5506,7 +5610,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    ctxt->instate = XML_PARSER_MISC;
                } else if ((cur == '<') && (next == '?')) {
                    if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5520,7 +5624,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    (UPP(6) == 'Y') && (UPP(7) == 'P') &&
                    (UPP(8) == 'E')) {
                    if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5536,7 +5640,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                           (avail < 9)) {
                    goto done;
                } else {
-                   ctxt->instate = XML_PARSER_START_TAG;
+                   ctxt->instate = XML_PARSER_CONTENT;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
                            "HPP: entering START_TAG\n");
@@ -5548,15 +5652,15 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                if (in->buf == NULL)
                    avail = in->length - (in->cur - in->base);
                else
-                   avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+                   avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+                            (in->cur - in->base);
                if (avail < 2)
                    goto done;
                cur = in->cur[0];
                next = in->cur[1];
                if ((cur == '<') && (next == '!') &&
                    (in->cur[2] == '-') && (in->cur[3] == '-')) {
-                   if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
+                   if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5566,7 +5670,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    ctxt->instate = XML_PARSER_PROLOG;
                } else if ((cur == '<') && (next == '?')) {
                    if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5578,7 +5682,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                           (avail < 4)) {
                    goto done;
                } else {
-                   ctxt->instate = XML_PARSER_START_TAG;
+                   ctxt->instate = XML_PARSER_CONTENT;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
                            "HPP: entering START_TAG\n");
@@ -5589,7 +5693,8 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                if (in->buf == NULL)
                    avail = in->length - (in->cur - in->base);
                else
-                   avail = xmlBufUse(in->buf->buffer) - (in->cur - in->base);
+                   avail = (ptrdiff_t)xmlBufUse(in->buf->buffer) -
+                            (in->cur - in->base);
                if (avail < 1)
                    goto done;
                cur = in->cur[0];
@@ -5602,8 +5707,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                next = in->cur[1];
                if ((cur == '<') && (next == '!') &&
                    (in->cur[2] == '-') && (in->cur[3] == '-')) {
-                   if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '-', '-', '>', 1, 1) < 0))
+                   if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5613,7 +5717,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    ctxt->instate = XML_PARSER_EPILOG;
                } else if ((cur == '<') && (next == '?')) {
                    if ((!terminate) &&
-                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                       (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
                        goto done;
 #ifdef DEBUG_PUSH
                    xmlGenericError(xmlGenericErrorContext,
@@ -5648,7 +5752,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                if (avail < 1)
                    goto done;
                /*
-                * not enouth chars in buffer
+                * not enough chars in buffer
                 */
                if (avail < 2) {
                    if (!terminate)
@@ -5677,7 +5781,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    break;
                }
                if ((!terminate) &&
-                   (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                   (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
                    goto done;
 
                 /* Capture start position */
@@ -5769,7 +5873,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
            }
             case XML_PARSER_CONTENT: {
                xmlChar chr[2] = { 0, 0 };
-               long cons;
 
                 /*
                 * Handle preparsed entities and charRef
@@ -5814,7 +5917,6 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                    goto done;
                cur = in->cur[0];
                next = in->cur[1];
-               cons = ctxt->nbChars;
                if ((xmlStrEqual(ctxt->name, BAD_CAST"script")) ||
                    (xmlStrEqual(ctxt->name, BAD_CAST"style"))) {
                    /*
@@ -5824,7 +5926,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                        int idx;
                        xmlChar val;
 
-                       idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0, 0);
+                       idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0);
                        if (idx < 0)
                            goto done;
                        val = in->cur[idx + 2];
@@ -5851,7 +5953,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                        (UPP(6) == 'Y') && (UPP(7) == 'P') &&
                        (UPP(8) == 'E')) {
                        if ((!terminate) &&
-                           (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                           (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
                            goto done;
                        htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
                                     "Misplaced DOCTYPE declaration\n",
@@ -5859,9 +5961,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                        htmlParseDocTypeDecl(ctxt);
                    } else if ((cur == '<') && (next == '!') &&
                        (in->cur[2] == '-') && (in->cur[3] == '-')) {
-                       if ((!terminate) &&
-                           (htmlParseLookupSequence(
-                               ctxt, '-', '-', '>', 1, 1) < 0))
+                       if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
                            goto done;
 #ifdef DEBUG_PUSH
                        xmlGenericError(xmlGenericErrorContext,
@@ -5871,7 +5971,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                        ctxt->instate = XML_PARSER_CONTENT;
                    } else if ((cur == '<') && (next == '?')) {
                        if ((!terminate) &&
-                           (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                           (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
                            goto done;
 #ifdef DEBUG_PUSH
                        xmlGenericError(xmlGenericErrorContext,
@@ -5890,24 +5990,35 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
 #endif
                        break;
                    } else if (cur == '<') {
-                       ctxt->instate = XML_PARSER_START_TAG;
-                       ctxt->checkIndex = 0;
+                        if ((!terminate) && (next == 0))
+                            goto done;
+                        /*
+                         * Only switch to START_TAG if the next character
+                         * starts a valid name. Otherwise, htmlParseStartTag
+                         * might return without consuming all characters
+                         * up to the final '>'.
+                         */
+                        if ((IS_ASCII_LETTER(next)) ||
+                            (next == '_') || (next == ':') || (next == '.')) {
+                            ctxt->instate = XML_PARSER_START_TAG;
+                            ctxt->checkIndex = 0;
 #ifdef DEBUG_PUSH
-                       xmlGenericError(xmlGenericErrorContext,
-                               "HPP: entering START_TAG\n");
+                            xmlGenericError(xmlGenericErrorContext,
+                                    "HPP: entering START_TAG\n");
 #endif
+                        } else {
+                            htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
+                                         "htmlParseTryOrFinish: "
+                                         "invalid element name\n",
+                                         NULL, NULL);
+                            htmlCheckParagraph(ctxt);
+                            if ((ctxt->sax != NULL) &&
+                                (ctxt->sax->characters != NULL))
+                                ctxt->sax->characters(ctxt->userData,
+                                                      in->cur, 1);
+                            NEXT;
+                        }
                        break;
-                   } else if (cur == '&') {
-                       if ((!terminate) &&
-                           (htmlParseLookupChars(ctxt,
-                                                  BAD_CAST "; >/", 4) < 0))
-                           goto done;
-#ifdef DEBUG_PUSH
-                       xmlGenericError(xmlGenericErrorContext,
-                               "HPP: Parsing Reference\n");
-#endif
-                       /* TODO: check generation of subtrees if noent !!! */
-                       htmlParseReference(ctxt);
                    } else {
                        /*
                         * check that the text sequence is complete
@@ -5916,25 +6027,24 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                         * data detection.
                         */
                        if ((!terminate) &&
-                            (htmlParseLookupChars(ctxt, BAD_CAST "<&", 2) < 0))
+                            (htmlParseLookupSequence(ctxt, '<', 0, 0, 0) < 0))
                            goto done;
                        ctxt->checkIndex = 0;
 #ifdef DEBUG_PUSH
                        xmlGenericError(xmlGenericErrorContext,
                                "HPP: Parsing char data\n");
 #endif
-                       htmlParseCharData(ctxt);
+                        while ((ctxt->instate != XML_PARSER_EOF) &&
+                               (cur != '<') && (in->cur < in->end)) {
+                            if (cur == '&') {
+                               htmlParseReference(ctxt);
+                            } else {
+                               htmlParseCharData(ctxt);
+                            }
+                            cur = in->cur[0];
+                        }
                    }
                }
-               if (cons == ctxt->nbChars) {
-                   if (ctxt->node != NULL) {
-                       htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
-                                    "detected an error in element content\n",
-                                    NULL, NULL);
-                   }
-                   NEXT;
-                   break;
-               }
 
                break;
            }
@@ -5942,7 +6052,7 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
                if (avail < 2)
                    goto done;
                if ((!terminate) &&
-                   (htmlParseLookupSequence(ctxt, '>', 0, 0, 0, 1) < 0))
+                   (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
                    goto done;
                htmlParseEndTag(ctxt);
                if (ctxt->nameNr == 0) {
@@ -6124,12 +6234,12 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
        int res;
 
        res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
+        xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
        if (res < 0) {
            ctxt->errNo = XML_PARSER_EOF;
            ctxt->disableSAX = 1;
            return (XML_PARSER_EOF);
        }
-        xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
 #ifdef DEBUG_PUSH
        xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
 #endif
@@ -6148,12 +6258,12 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
                size_t current = ctxt->input->cur - ctxt->input->base;
 
                nbchars = xmlCharEncInput(in, terminate);
+               xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
                if (nbchars < 0) {
                    htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
                                 "encoder error\n", NULL, NULL);
                    return(XML_ERR_INVALID_ENCODING);
                }
-               xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
            }
        }
     }
@@ -6671,7 +6781,6 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt)
     ctxt->vctxt.error = xmlParserValidityError;
     ctxt->vctxt.warning = xmlParserValidityWarning;
     ctxt->record_info = 0;
-    ctxt->nbChars = 0;
     ctxt->checkIndex = 0;
     ctxt->inSubset = 0;
     ctxt->errNo = XML_ERR_OK;
index db63b37..24434d4 100644 (file)
@@ -226,7 +226,7 @@ found_head:
 found_meta:
     /*
      * Search and update all the remaining the meta elements carrying
-     * encoding informations
+     * encoding information
      */
     while (cur != NULL) {
        if ((cur->type == XML_ELEMENT_NODE) && (cur->name != NULL)) {
@@ -345,7 +345,7 @@ xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder);
  ************************************************************************/
 /**
  * htmlSaveErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -359,7 +359,7 @@ htmlSaveErrMemory(const char *extra)
  * htmlSaveErr:
  * @code:  the error number
  * @node:  the location of the error.
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -518,7 +518,7 @@ htmlNodeDumpFileFormat(FILE *out, xmlDocPtr doc,
     buf = xmlOutputBufferCreateFile(out, handler);
     if (buf == NULL) return(0);
 
-    htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
+    htmlNodeDumpFormatOutput(buf, doc, cur, NULL, format);
 
     ret = xmlOutputBufferClose(buf);
     return(ret);
@@ -670,13 +670,11 @@ htmlDtdDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
  * @buf:  the HTML buffer output
  * @doc:  the document
  * @cur:  the attribute pointer
- * @encoding:  the encoding string
  *
  * Dump an HTML attribute
  */
 static void
-htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
-                  const char *encoding ATTRIBUTE_UNUSED) {
+htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur) {
     xmlChar *value;
 
     /*
@@ -706,49 +704,22 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
                 (!xmlStrcasecmp(cur->name, BAD_CAST "src")) ||
                 ((!xmlStrcasecmp(cur->name, BAD_CAST "name")) &&
                  (!xmlStrcasecmp(cur->parent->name, BAD_CAST "a"))))) {
+               xmlChar *escaped;
                xmlChar *tmp = value;
-               /* xmlURIEscapeStr() escapes '"' so it can be safely used. */
-               xmlBufCCat(buf->buffer, "\"");
 
                while (IS_BLANK_CH(*tmp)) tmp++;
 
-               /* URI Escape everything, except server side includes. */
-               for ( ; ; ) {
-                   xmlChar *escaped;
-                   xmlChar endChar;
-                   xmlChar *end = NULL;
-                   xmlChar *start = (xmlChar *)xmlStrstr(tmp, BAD_CAST "<!--");
-                   if (start != NULL) {
-                       end = (xmlChar *)xmlStrstr(tmp, BAD_CAST "-->");
-                       if (end != NULL) {
-                           *start = '\0';
-                       }
-                   }
-
-                   /* Escape the whole string, or until start (set to '\0'). */
-                   escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+");
-                   if (escaped != NULL) {
-                       xmlBufCat(buf->buffer, escaped);
-                       xmlFree(escaped);
-                   } else {
-                       xmlBufCat(buf->buffer, tmp);
-                   }
-
-                   if (end == NULL) { /* Everything has been written. */
-                       break;
-                   }
-
-                   /* Do not escape anything within server side includes. */
-                   *start = '<'; /* Restore the first character of "<!--". */
-                   end += 3; /* strlen("-->") */
-                   endChar = *end;
-                   *end = '\0';
-                   xmlBufCat(buf->buffer, start);
-                   *end = endChar;
-                   tmp = end;
+               /*
+                * the < and > have already been escaped at the entity level
+                * And doing so here breaks server side includes
+                */
+               escaped = xmlURIEscapeStr(tmp, BAD_CAST"@/:=?;#%&,+<>");
+               if (escaped != NULL) {
+                   xmlBufWriteQuotedString(buf->buffer, escaped);
+                   xmlFree(escaped);
+               } else {
+                   xmlBufWriteQuotedString(buf->buffer, value);
                }
-
-               xmlBufCCat(buf->buffer, "\"");
            } else {
                xmlBufWriteQuotedString(buf->buffer, value);
            }
@@ -760,62 +731,21 @@ htmlAttrDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur,
 }
 
 /**
- * htmlAttrListDumpOutput:
- * @buf:  the HTML buffer output
- * @doc:  the document
- * @cur:  the first attribute pointer
- * @encoding:  the encoding string
- *
- * Dump a list of HTML attributes
- */
-static void
-htmlAttrListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlAttrPtr cur, const char *encoding) {
-    if (cur == NULL) {
-       return;
-    }
-    while (cur != NULL) {
-        htmlAttrDumpOutput(buf, doc, cur, encoding);
-       cur = cur->next;
-    }
-}
-
-
-
-/**
- * htmlNodeListDumpOutput:
- * @buf:  the HTML buffer output
- * @doc:  the document
- * @cur:  the first node
- * @encoding:  the encoding string
- * @format:  should formatting spaces been added
- *
- * Dump an HTML node list, recursive behaviour,children are printed too.
- */
-static void
-htmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
-                      xmlNodePtr cur, const char *encoding, int format) {
-    if (cur == NULL) {
-       return;
-    }
-    while (cur != NULL) {
-        htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
-       cur = cur->next;
-    }
-}
-
-/**
  * htmlNodeDumpFormatOutput:
  * @buf:  the HTML buffer output
  * @doc:  the document
  * @cur:  the current node
- * @encoding:  the encoding string
+ * @encoding:  the encoding string (unused)
  * @format:  should formatting spaces been added
  *
  * Dump an HTML node, recursive behaviour,children are printed too.
  */
 void
 htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
-                        xmlNodePtr cur, const char *encoding, int format) {
+                        xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
+                         int format) {
+    xmlNodePtr root;
+    xmlAttrPtr attr;
     const htmlElemDesc * info;
 
     xmlInitParser();
@@ -823,172 +753,199 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
     if ((cur == NULL) || (buf == NULL)) {
        return;
     }
-    /*
-     * Special cases.
-     */
-    if (cur->type == XML_DTD_NODE)
-       return;
-    if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
-        (cur->type == XML_DOCUMENT_NODE)){
-       htmlDocContentDumpOutput(buf, (xmlDocPtr) cur, encoding);
-       return;
-    }
-    if (cur->type == XML_ATTRIBUTE_NODE) {
-        htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur, encoding);
-       return;
-    }
-    if (cur->type == HTML_TEXT_NODE) {
-       if (cur->content != NULL) {
-           if (((cur->name == (const xmlChar *)xmlStringText) ||
-                (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
-               ((cur->parent == NULL) ||
-                ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
-                 (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
-               xmlChar *buffer;
-
-               buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
-               if (buffer != NULL) {
-                   xmlOutputBufferWriteString(buf, (const char *)buffer);
-                   xmlFree(buffer);
-               }
-           } else {
-               xmlOutputBufferWriteString(buf, (const char *)cur->content);
-           }
-       }
-       return;
-    }
-    if (cur->type == HTML_COMMENT_NODE) {
-       if (cur->content != NULL) {
-           xmlOutputBufferWriteString(buf, "<!--");
-           xmlOutputBufferWriteString(buf, (const char *)cur->content);
-           xmlOutputBufferWriteString(buf, "-->");
-       }
-       return;
-    }
-    if (cur->type == HTML_PI_NODE) {
-       if (cur->name == NULL)
-           return;
-       xmlOutputBufferWriteString(buf, "<?");
-       xmlOutputBufferWriteString(buf, (const char *)cur->name);
-       if (cur->content != NULL) {
-           xmlOutputBufferWriteString(buf, " ");
-           xmlOutputBufferWriteString(buf, (const char *)cur->content);
-       }
-       xmlOutputBufferWriteString(buf, ">");
-       return;
-    }
-    if (cur->type == HTML_ENTITY_REF_NODE) {
-        xmlOutputBufferWriteString(buf, "&");
-       xmlOutputBufferWriteString(buf, (const char *)cur->name);
-        xmlOutputBufferWriteString(buf, ";");
-       return;
-    }
-    if (cur->type == HTML_PRESERVE_NODE) {
-       if (cur->content != NULL) {
-           xmlOutputBufferWriteString(buf, (const char *)cur->content);
-       }
-       return;
-    }
 
-    /*
-     * Get specific HTML info for that node.
-     */
-    if (cur->ns == NULL)
-       info = htmlTagLookup(cur->name);
-    else
-       info = NULL;
+    root = cur;
+    while (1) {
+        switch (cur->type) {
+        case XML_HTML_DOCUMENT_NODE:
+        case XML_DOCUMENT_NODE:
+            if (((xmlDocPtr) cur)->intSubset != NULL) {
+                htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+            }
+            if (cur->children != NULL) {
+                cur = cur->children;
+                continue;
+            }
+            break;
 
-    xmlOutputBufferWriteString(buf, "<");
-    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-       xmlOutputBufferWriteString(buf, ":");
-    }
-    xmlOutputBufferWriteString(buf, (const char *)cur->name);
-    if (cur->nsDef)
-       xmlNsListDumpOutput(buf, cur->nsDef);
-    if (cur->properties != NULL)
-        htmlAttrListDumpOutput(buf, doc, cur->properties, encoding);
-
-    if ((info != NULL) && (info->empty)) {
-        xmlOutputBufferWriteString(buf, ">");
-       if ((format) && (!info->isinline) && (cur->next != NULL)) {
-           if ((cur->next->type != HTML_TEXT_NODE) &&
-               (cur->next->type != HTML_ENTITY_REF_NODE) &&
-               (cur->parent != NULL) &&
-               (cur->parent->name != NULL) &&
-               (cur->parent->name[0] != 'p')) /* p, pre, param */
-               xmlOutputBufferWriteString(buf, "\n");
-       }
-       return;
-    }
-    if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
-       (cur->children == NULL)) {
-        if ((info != NULL) && (info->saveEndTag != 0) &&
-           (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) &&
-           (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) {
-           xmlOutputBufferWriteString(buf, ">");
-       } else {
-           xmlOutputBufferWriteString(buf, "></");
+        case XML_ELEMENT_NODE:
+            /*
+             * Get specific HTML info for that node.
+             */
+            if (cur->ns == NULL)
+                info = htmlTagLookup(cur->name);
+            else
+                info = NULL;
+
+            xmlOutputBufferWriteString(buf, "<");
             if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
                 xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
                 xmlOutputBufferWriteString(buf, ":");
             }
-           xmlOutputBufferWriteString(buf, (const char *)cur->name);
-           xmlOutputBufferWriteString(buf, ">");
-       }
-       if ((format) && (cur->next != NULL) &&
-            (info != NULL) && (!info->isinline)) {
-           if ((cur->next->type != HTML_TEXT_NODE) &&
-               (cur->next->type != HTML_ENTITY_REF_NODE) &&
-               (cur->parent != NULL) &&
-               (cur->parent->name != NULL) &&
-               (cur->parent->name[0] != 'p')) /* p, pre, param */
-               xmlOutputBufferWriteString(buf, "\n");
-       }
-       return;
-    }
-    xmlOutputBufferWriteString(buf, ">");
-    if ((cur->type != XML_ELEMENT_NODE) &&
-       (cur->content != NULL)) {
-           /*
-            * Uses the OutputBuffer property to automatically convert
-            * invalids to charrefs
-            */
-
-            xmlOutputBufferWriteString(buf, (const char *) cur->content);
-    }
-    if (cur->children != NULL) {
-        if ((format) && (info != NULL) && (!info->isinline) &&
-           (cur->children->type != HTML_TEXT_NODE) &&
-           (cur->children->type != HTML_ENTITY_REF_NODE) &&
-           (cur->children != cur->last) &&
-           (cur->name != NULL) &&
-           (cur->name[0] != 'p')) /* p, pre, param */
-           xmlOutputBufferWriteString(buf, "\n");
-       htmlNodeListDumpOutput(buf, doc, cur->children, encoding, format);
-        if ((format) && (info != NULL) && (!info->isinline) &&
-           (cur->last->type != HTML_TEXT_NODE) &&
-           (cur->last->type != HTML_ENTITY_REF_NODE) &&
-           (cur->children != cur->last) &&
-           (cur->name != NULL) &&
-           (cur->name[0] != 'p')) /* p, pre, param */
-           xmlOutputBufferWriteString(buf, "\n");
-    }
-    xmlOutputBufferWriteString(buf, "</");
-    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-       xmlOutputBufferWriteString(buf, ":");
-    }
-    xmlOutputBufferWriteString(buf, (const char *)cur->name);
-    xmlOutputBufferWriteString(buf, ">");
-    if ((format) && (info != NULL) && (!info->isinline) &&
-       (cur->next != NULL)) {
-        if ((cur->next->type != HTML_TEXT_NODE) &&
-           (cur->next->type != HTML_ENTITY_REF_NODE) &&
-           (cur->parent != NULL) &&
-           (cur->parent->name != NULL) &&
-           (cur->parent->name[0] != 'p')) /* p, pre, param */
-           xmlOutputBufferWriteString(buf, "\n");
+            xmlOutputBufferWriteString(buf, (const char *)cur->name);
+            if (cur->nsDef)
+                xmlNsListDumpOutput(buf, cur->nsDef);
+            attr = cur->properties;
+            while (attr != NULL) {
+                htmlAttrDumpOutput(buf, doc, attr);
+                attr = attr->next;
+            }
+
+            if ((info != NULL) && (info->empty)) {
+                xmlOutputBufferWriteString(buf, ">");
+            } else if (cur->children == NULL) {
+                if ((info != NULL) && (info->saveEndTag != 0) &&
+                    (xmlStrcmp(BAD_CAST info->name, BAD_CAST "html")) &&
+                    (xmlStrcmp(BAD_CAST info->name, BAD_CAST "body"))) {
+                    xmlOutputBufferWriteString(buf, ">");
+                } else {
+                    xmlOutputBufferWriteString(buf, "></");
+                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                        xmlOutputBufferWriteString(buf,
+                                (const char *)cur->ns->prefix);
+                        xmlOutputBufferWriteString(buf, ":");
+                    }
+                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                    xmlOutputBufferWriteString(buf, ">");
+                }
+            } else {
+                xmlOutputBufferWriteString(buf, ">");
+                if ((format) && (info != NULL) && (!info->isinline) &&
+                    (cur->children->type != HTML_TEXT_NODE) &&
+                    (cur->children->type != HTML_ENTITY_REF_NODE) &&
+                    (cur->children != cur->last) &&
+                    (cur->name != NULL) &&
+                    (cur->name[0] != 'p')) /* p, pre, param */
+                    xmlOutputBufferWriteString(buf, "\n");
+                cur = cur->children;
+                continue;
+            }
+
+            if ((format) && (cur->next != NULL) &&
+                (info != NULL) && (!info->isinline)) {
+                if ((cur->next->type != HTML_TEXT_NODE) &&
+                    (cur->next->type != HTML_ENTITY_REF_NODE) &&
+                    (cur->parent != NULL) &&
+                    (cur->parent->name != NULL) &&
+                    (cur->parent->name[0] != 'p')) /* p, pre, param */
+                    xmlOutputBufferWriteString(buf, "\n");
+            }
+
+            break;
+
+        case XML_ATTRIBUTE_NODE:
+            htmlAttrDumpOutput(buf, doc, (xmlAttrPtr) cur);
+            break;
+
+        case HTML_TEXT_NODE:
+            if (cur->content == NULL)
+                break;
+            if (((cur->name == (const xmlChar *)xmlStringText) ||
+                 (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
+                ((cur->parent == NULL) ||
+                 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
+                  (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
+                xmlChar *buffer;
+
+                buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+                if (buffer != NULL) {
+                    xmlOutputBufferWriteString(buf, (const char *)buffer);
+                    xmlFree(buffer);
+                }
+            } else {
+                xmlOutputBufferWriteString(buf, (const char *)cur->content);
+            }
+            break;
+
+        case HTML_COMMENT_NODE:
+            if (cur->content != NULL) {
+                xmlOutputBufferWriteString(buf, "<!--");
+                xmlOutputBufferWriteString(buf, (const char *)cur->content);
+                xmlOutputBufferWriteString(buf, "-->");
+            }
+            break;
+
+        case HTML_PI_NODE:
+            if (cur->name != NULL) {
+                xmlOutputBufferWriteString(buf, "<?");
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                if (cur->content != NULL) {
+                    xmlOutputBufferWriteString(buf, " ");
+                    xmlOutputBufferWriteString(buf,
+                            (const char *)cur->content);
+                }
+                xmlOutputBufferWriteString(buf, ">");
+            }
+            break;
+
+        case HTML_ENTITY_REF_NODE:
+            xmlOutputBufferWriteString(buf, "&");
+            xmlOutputBufferWriteString(buf, (const char *)cur->name);
+            xmlOutputBufferWriteString(buf, ";");
+            break;
+
+        case HTML_PRESERVE_NODE:
+            if (cur->content != NULL) {
+                xmlOutputBufferWriteString(buf, (const char *)cur->content);
+            }
+            break;
+
+        default:
+            break;
+        }
+
+        while (1) {
+            if (cur == root)
+                return;
+            if (cur->next != NULL) {
+                cur = cur->next;
+                break;
+            }
+
+            /*
+             * The parent should never be NULL here but we want to handle
+             * corrupted documents gracefully.
+             */
+            if (cur->parent == NULL)
+                return;
+            cur = cur->parent;
+
+            if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+                (cur->type == XML_DOCUMENT_NODE)) {
+                xmlOutputBufferWriteString(buf, "\n");
+            } else {
+                if ((format) && (cur->ns == NULL))
+                    info = htmlTagLookup(cur->name);
+                else
+                    info = NULL;
+
+                if ((format) && (info != NULL) && (!info->isinline) &&
+                    (cur->last->type != HTML_TEXT_NODE) &&
+                    (cur->last->type != HTML_ENTITY_REF_NODE) &&
+                    (cur->children != cur->last) &&
+                    (cur->name != NULL) &&
+                    (cur->name[0] != 'p')) /* p, pre, param */
+                    xmlOutputBufferWriteString(buf, "\n");
+
+                xmlOutputBufferWriteString(buf, "</");
+                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                    xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
+                    xmlOutputBufferWriteString(buf, ":");
+                }
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                xmlOutputBufferWriteString(buf, ">");
+
+                if ((format) && (info != NULL) && (!info->isinline) &&
+                    (cur->next != NULL)) {
+                    if ((cur->next->type != HTML_TEXT_NODE) &&
+                        (cur->next->type != HTML_ENTITY_REF_NODE) &&
+                        (cur->parent != NULL) &&
+                        (cur->parent->name != NULL) &&
+                        (cur->parent->name[0] != 'p')) /* p, pre, param */
+                        xmlOutputBufferWriteString(buf, "\n");
+                }
+            }
+        }
     }
 }
 
@@ -997,63 +954,45 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
  * @buf:  the HTML buffer output
  * @doc:  the document
  * @cur:  the current node
- * @encoding:  the encoding string
+ * @encoding:  the encoding string (unused)
  *
  * Dump an HTML node, recursive behaviour,children are printed too,
  * and formatting returns/spaces are added.
  */
 void
 htmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
-                  xmlNodePtr cur, const char *encoding) {
-    htmlNodeDumpFormatOutput(buf, doc, cur, encoding, 1);
+                  xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED) {
+    htmlNodeDumpFormatOutput(buf, doc, cur, NULL, 1);
 }
 
 /**
  * htmlDocContentDumpFormatOutput:
  * @buf:  the HTML buffer output
  * @cur:  the document
- * @encoding:  the encoding string
+ * @encoding:  the encoding string (unused)
  * @format:  should formatting spaces been added
  *
  * Dump an HTML document.
  */
 void
 htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
-                              const char *encoding, int format) {
-    int type;
-
-    xmlInitParser();
-
-    if ((buf == NULL) || (cur == NULL))
-        return;
-
-    /*
-     * force to output the stuff as HTML, especially for entities
-     */
-    type = cur->type;
-    cur->type = XML_HTML_DOCUMENT_NODE;
-    if (cur->intSubset != NULL) {
-        htmlDtdDumpOutput(buf, cur, NULL);
-    }
-    if (cur->children != NULL) {
-        htmlNodeListDumpOutput(buf, cur, cur->children, encoding, format);
-    }
-    xmlOutputBufferWriteString(buf, "\n");
-    cur->type = (xmlElementType) type;
+                              const char *encoding ATTRIBUTE_UNUSED,
+                               int format) {
+    htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, format);
 }
 
 /**
  * htmlDocContentDumpOutput:
  * @buf:  the HTML buffer output
  * @cur:  the document
- * @encoding:  the encoding string
+ * @encoding:  the encoding string (unused)
  *
  * Dump an HTML document. Formatting return/spaces are added.
  */
 void
 htmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
-                        const char *encoding) {
-    htmlDocContentDumpFormatOutput(buf, cur, encoding, 1);
+                        const char *encoding ATTRIBUTE_UNUSED) {
+    htmlNodeDumpFormatOutput(buf, cur, (xmlNodePtr) cur, NULL, 1);
 }
 
 /************************************************************************
index fdf31f3..ac9211d 100644 (file)
@@ -1,61 +1,51 @@
-Extracted from the documentation:
-   http://xmlsoft.org/FAQ.html#Compilatio
-
 See also the generic INSTALL file for configure options
 
 Compilation
 
-   1.What is the process to compile libxml ? 
+  1. What is the process to compile libxml?
 
      As most UNIX libraries libxml follows the "standard":
 
-     gunzip -c xxx.tar.gz | tar xvf -
-
-     cd libxml-xxxx
+         gunzip -c xxx.tar.gz | tar xvf -
+         cd libxml-xxxx
 
-     ./configure --help
+         ./configure --help
 
      to see the options, then the compilation/installation proper
 
-     ./configure [possible options]
-
-     make
-
-     make install
+         ./configure [possible options]
+         make
+         make install
 
      At that point you may have to rerun ldconfig or similar utility to
      update your list of installed shared libs.
 
-     At this point you can check that the library is properly functionning
+     At this point you can check that the library is properly functioning
      by running
 
-     make tests
+         make check
+
+     Please report test failures to the mailing list or bug tracker.
 
-   2.What other libraries are needed to compile/install libxml ? 
+  2. What other libraries are needed to compile/install libxml?
 
-     Libxml does not requires any other library, the normal C ANSI API
-     should be sufficient (please report any violation to this rule you
-     may find).
+     Libxml does not require any other libraries. A platform with somewhat
+     recent POSIX support should be sufficient (please report any violation
+     to this rule you may find).
 
-     However if found at configuration time libxml will detect and use
+     However if found at configuration time, libxml will detect and use
      the following libs:
 
-         libz: a highly portable and available widely compression library 
-             http://www.info-zip.org/pub/infozip/zlib/
+         libz: a highly portable and widely available compression library
+             https://zlib.net/
+         liblzma: another compression library
+             https://tukaani.org/xz/
          iconv: a powerful character encoding conversion library. It's
-            included by default on recent glibc libraries, so it doesn't
-            need to be installed specifically on linux. It seems it's
-            now part of the official UNIX specification. Here is one
-            implementation of the library which source can be found here.
-             http://clisp.cons.org/~haible/packages-libiconv.html
-             ftp://ftp.ilog.fr/pub/Users/haible/gnu/
-
-   3.make tests may fail on some platforms 
-
-     Sometime the regression tests results don't completely match the
-     value produced by the parser, and the makefile uses diff to print
-     the delta. On some platforms the diff return breaks the compilation
-     process, if the diff is small this is probably not a serious problem
+             part of POSIX.1-2001, so it doesn't need to be installed
+             on modern UNIX-like systems, specifically on Linux.
+             https://www.gnu.org/software/libiconv/
+         ICU: Mainly used by Chromium on Windows. Unnecessary on most
+             systems.
 
 Daniel
 veillard@redhat.com
index 05d1671..a9284b9 100644 (file)
@@ -2,9 +2,9 @@
 
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
+SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
 
-DIST_SUBDIRS = include . doc example python xstc
+DIST_SUBDIRS = include . doc example fuzz python xstc
 
 AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
 
@@ -210,6 +210,7 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
            $(CHECKER) ./runxmlconf$(EXEEXT)
        @(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
            $(MAKE) tests ; fi)
+       @cd fuzz; $(MAKE) tests
 
 check: all runtests
 
@@ -906,19 +907,21 @@ Regexptests: testRegexp$(EXEEXT)
          if [ ! -d $$i ] ; then \
          if [ ! -f $(srcdir)/result/regexp/$$name ] ; then \
              echo New test file $$name ; \
-             $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name; \
+             $(CHECKER) $(top_builddir)/testRegexp -i $$i > $(srcdir)/result/regexp/$$name 2> $(srcdir)/result/regexp/$$name.err ; \
+             if [ ! -s "$(srcdir)/result/regexp/$$name.err" ] ; then rm $(srcdir)/result/regexp/$$name.err; fi ; \
              grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
          else \
-             log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i 2>&1 > result.$$name ; \
+             log=`$(CHECKER) $(top_builddir)/testRegexp -i $$i > result.$$name 2> error.$$name ; \
              grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
-             diff $(srcdir)/result/regexp/$$name result.$$name` ; \
-             if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
-             rm result.$$name ; \
+             diff $(srcdir)/result/regexp/$$name result.$$name ; \
+             if [ -s "$(srcdir)/result/regexp/$$name.err" -o -s "error.$$name" ] ; then diff $(srcdir)/result/regexp/$$name.err error.$$name ; fi` ; \
+             if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
+             rm result.$$name error.$$name ; \
          fi ; fi ; done)
 
 # Disabled for now
 Exptests: testRegexp$(EXEEXT)
-       @echo "## Formal expresssions regression tests"
+       @echo "## Formal expressions regression tests"
        -@(for i in $(srcdir)/test/expr/* ; do \
          name=`basename $$i`; \
          if [ ! -d $$i ] ; then \
@@ -1257,6 +1260,7 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml2.spec \
             dbgen.pl dbgenattr.pl regressions.py regressions.xml \
             README.tests Makefile.tests libxml2.syms timsort.h \
             README.zOS \
+            CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \
             $(CVS_EXTRA_DIST)
 
 
index 619cbfb..9f08dcf 100644 (file)
@@ -1,5 +1,5 @@
 #
-# You may have to ajust to call the right compiler, or other oprions
+# You may have to adjust to call the right compiler, or other options
 # for compiling and linking
 #
 
diff --git a/README b/README
index 5c7bddf..4957517 100644 (file)
--- a/README
+++ b/README
@@ -19,7 +19,7 @@ To assert build quality:
        There is 3 standalone tools runtest.c runsuite.c testapi.c, which
        should compile as part of the build or as any application would.
        Launch them from this directory to get results, runtest checks 
-       the proper functionning of libxml2 main APIs while testapi does
+       the proper functioning of libxml2 main APIs while testapi does
        a full coverage check. Report failures to the list.
 
 To report bugs, follow the instructions at: 
diff --git a/SAX2.c b/SAX2.c
index 5f141f9..99019a9 100644 (file)
--- a/SAX2.c
+++ b/SAX2.c
@@ -590,36 +590,6 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
     } else {
        ret = xmlGetDocEntity(ctxt->myDoc, name);
     }
-    if ((ret != NULL) &&
-       ((ctxt->validate) || (ctxt->replaceEntities)) &&
-       (ret->children == NULL) &&
-       (ret->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
-       int val;
-
-       /*
-        * for validation purposes we really need to fetch and
-        * parse the external entity
-        */
-       xmlNodePtr children;
-       unsigned long oldnbent = ctxt->nbentities;
-
-        val = xmlParseCtxtExternalEntity(ctxt, ret->URI,
-                                        ret->ExternalID, &children);
-       if (val == 0) {
-           xmlAddChildList((xmlNodePtr) ret, children);
-       } else {
-           xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_PROCESSING,
-                          "Failure to process entity %s\n", name, NULL);
-           ctxt->validate = 0;
-           return(NULL);
-       }
-       ret->owner = 1;
-       if (ret->checked == 0) {
-           ret->checked = (ctxt->nbentities - oldnbent + 1) * 2;
-           if ((ret->content != NULL) && (xmlStrchr(ret->content, '<')))
-               ret->checked |= 1;
-       }
-    }
     return(ret);
 }
 
@@ -1693,23 +1663,23 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
        }
     }
 
-    /*
-     * Insert all the defaulted attributes from the DTD especially namespaces
-     */
-    if ((!ctxt->html) &&
-       ((ctxt->myDoc->intSubset != NULL) ||
-        (ctxt->myDoc->extSubset != NULL))) {
-       xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
-    }
+    if (!ctxt->html) {
+        /*
+         * Insert all the defaulted attributes from the DTD especially
+         * namespaces
+         */
+        if ((ctxt->myDoc->intSubset != NULL) ||
+            (ctxt->myDoc->extSubset != NULL)) {
+            xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
+        }
 
-    /*
-     * process all the attributes whose name start with "xmlns"
-     */
-    if (atts != NULL) {
-        i = 0;
-       att = atts[i++];
-       value = atts[i++];
-       if (!ctxt->html) {
+        /*
+         * process all the attributes whose name start with "xmlns"
+         */
+        if (atts != NULL) {
+            i = 0;
+            att = atts[i++];
+            value = atts[i++];
            while ((att != NULL) && (value != NULL)) {
                if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
                    (att[3] == 'n') && (att[4] == 's'))
@@ -1718,30 +1688,30 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
                att = atts[i++];
                value = atts[i++];
            }
-       }
-    }
+        }
 
-    /*
-     * Search the namespace, note that since the attributes have been
-     * processed, the local namespaces are available.
-     */
-    ns = xmlSearchNs(ctxt->myDoc, ret, prefix);
-    if ((ns == NULL) && (parent != NULL))
-       ns = xmlSearchNs(ctxt->myDoc, parent, prefix);
-    if ((prefix != NULL) && (ns == NULL)) {
-       ns = xmlNewNs(ret, NULL, prefix);
-       xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
-                    "Namespace prefix %s is not defined\n",
-                    prefix, NULL);
-    }
+        /*
+         * Search the namespace, note that since the attributes have been
+         * processed, the local namespaces are available.
+         */
+        ns = xmlSearchNs(ctxt->myDoc, ret, prefix);
+        if ((ns == NULL) && (parent != NULL))
+            ns = xmlSearchNs(ctxt->myDoc, parent, prefix);
+        if ((prefix != NULL) && (ns == NULL)) {
+            ns = xmlNewNs(ret, NULL, prefix);
+            xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
+                         "Namespace prefix %s is not defined\n",
+                         prefix, NULL);
+        }
 
-    /*
-     * set the namespace node, making sure that if the default namespace
-     * is unbound on a parent we simply keep it NULL
-     */
-    if ((ns != NULL) && (ns->href != NULL) &&
-       ((ns->href[0] != 0) || (ns->prefix != NULL)))
-       xmlSetNs(ret, ns);
+        /*
+         * set the namespace node, making sure that if the default namespace
+         * is unbound on a parent we simply keep it NULL
+         */
+        if ((ns != NULL) && (ns->href != NULL) &&
+            ((ns->href[0] != 0) || (ns->prefix != NULL)))
+            xmlSetNs(ret, ns);
+    }
 
     /*
      * process all the other attributes
@@ -2203,7 +2173,7 @@ xmlSAX2AttributeNs(xmlParserCtxtPtr ctxt,
  *               attribute values.
  *
  * SAX2 callback when an element start has been detected by the parser.
- * It provides the namespace informations for the element, as well as
+ * It provides the namespace information for the element, as well as
  * the new namespace declarations on the element.
  */
 void
@@ -2456,7 +2426,7 @@ xmlSAX2StartElementNs(void *ctx,
  * @URI:  the element namespace name if available
  *
  * SAX2 callback when an element end has been detected by the parser.
- * It provides the namespace informations for the element.
+ * It provides the namespace information for the element.
  */
 void
 xmlSAX2EndElementNs(void *ctx,
@@ -2523,20 +2493,21 @@ xmlSAX2Reference(void *ctx, const xmlChar *name)
 }
 
 /**
- * xmlSAX2Characters:
+ * xmlSAX2Text:
  * @ctx: the user data (XML parser context)
  * @ch:  a xmlChar string
  * @len: the number of xmlChar
+ * @type: text or cdata
  *
- * receiving some chars from the parser.
+ * Append characters.
  */
-void
-xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
+static void
+xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
+            xmlElementType type)
 {
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlNodePtr lastChild;
 
-    if (ctx == NULL) return;
+    if (ctxt == NULL) return;
 #ifdef DEBUG_SAX
     xmlGenericError(xmlGenericErrorContext,
            "SAX.xmlSAX2Characters(%.30s, %d)\n", ch, len);
@@ -2565,7 +2536,10 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
      * elements. Use an attribute in the structure !!!
      */
     if (lastChild == NULL) {
-        lastChild = xmlSAX2TextNode(ctxt, ch, len);
+        if (type == XML_TEXT_NODE)
+            lastChild = xmlSAX2TextNode(ctxt, ch, len);
+        else
+            lastChild = xmlNewCDataBlock(ctxt->myDoc, ch, len);
        if (lastChild != NULL) {
            ctxt->node->children = lastChild;
            ctxt->node->last = lastChild;
@@ -2579,8 +2553,9 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
        }
     } else {
        int coalesceText = (lastChild != NULL) &&
-           (lastChild->type == XML_TEXT_NODE) &&
-           (lastChild->name == xmlStringText);
+           (lastChild->type == type) &&
+           ((type != XML_TEXT_NODE) ||
+             (lastChild->name == xmlStringText));
        if ((coalesceText) && (ctxt->nodemem != 0)) {
            /*
             * The whole point of maintaining nodelen and nodemem,
@@ -2637,7 +2612,10 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
            }
        } else {
            /* Mixed content, first time */
-           lastChild = xmlSAX2TextNode(ctxt, ch, len);
+            if (type == XML_TEXT_NODE)
+                lastChild = xmlSAX2TextNode(ctxt, ch, len);
+            else
+                lastChild = xmlNewCDataBlock(ctxt->myDoc, ch, len);
            if (lastChild != NULL) {
                xmlAddChild(ctxt->node, lastChild);
                if (ctxt->node->children != NULL) {
@@ -2650,6 +2628,20 @@ xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
 }
 
 /**
+ * xmlSAX2Characters:
+ * @ctx: the user data (XML parser context)
+ * @ch:  a xmlChar string
+ * @len: the number of xmlChar
+ *
+ * receiving some chars from the parser.
+ */
+void
+xmlSAX2Characters(void *ctx, const xmlChar *ch, int len)
+{
+    xmlSAX2Text((xmlParserCtxtPtr) ctx, ch, len, XML_TEXT_NODE);
+}
+
+/**
  * xmlSAX2IgnorableWhitespace:
  * @ctx: the user data (XML parser context)
  * @ch:  a xmlChar string
@@ -2805,27 +2797,7 @@ xmlSAX2Comment(void *ctx, const xmlChar *value)
 void
 xmlSAX2CDataBlock(void *ctx, const xmlChar *value, int len)
 {
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-    xmlNodePtr ret, lastChild;
-
-    if (ctx == NULL) return;
-#ifdef DEBUG_SAX
-    xmlGenericError(xmlGenericErrorContext,
-           "SAX.pcdata(%.10s, %d)\n", value, len);
-#endif
-    lastChild = xmlGetLastChild(ctxt->node);
-#ifdef DEBUG_SAX_TREE
-    xmlGenericError(xmlGenericErrorContext,
-           "add chars to %s \n", ctxt->node->name);
-#endif
-    if ((lastChild != NULL) &&
-        (lastChild->type == XML_CDATA_SECTION_NODE)) {
-       xmlTextConcat(lastChild, value, len);
-    } else {
-       ret = xmlNewCDataBlock(ctxt->myDoc, value, len);
-       if (xmlAddChild(ctxt->node, ret) == NULL)
-               xmlFreeNode(ret);
-    }
+    xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 }
 
 static int xmlSAX2DefaultVersionValue = 2;
diff --git a/TODO b/TODO
index 9c32224..94d34c8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -202,7 +202,7 @@ Done:
   by the XML parser, UTF-8 should be checked when there is no "encoding"
   declared !
 - Support for UTF-8 and UTF-16 encoding
-  => added some convertion routines provided by Martin Durst
+  => added some conversion routines provided by Martin Durst
      patched them, got fixes from @@@
      I plan to keep everything internally as UTF-8 (or ISO-Latin-X)
      this is slightly more costly but more compact, and recent processors
@@ -212,7 +212,7 @@ Done:
      is enabled, tested the ISO->UTF-8 stuff
 - External entities loading: 
    - allow override by client code
-   - make sure it is alled for all external entities referenced
+   - make sure it is called for all external entities referenced
   Done, client code should use xmlSetExternalEntityLoader() to set
   the default loading routine. It will be called each time an external
   entity entity resolution is triggered.
@@ -245,8 +245,8 @@ Done:
   most cases !
 
 - progressive reading. The entity support is a first step toward
-  asbtraction of an input stream. A large part of the context is still
-  located on the stack, moving to a state machine and putting everyting
+  abstraction of an input stream. A large part of the context is still
+  located on the stack, moving to a state machine and putting everything
   in the parsing context should provide an adequate solution.
   => Rather than progressive parsing, give more power to the SAX-like
      interface. Currently the DOM-like representation is built but
index 98a9ca8..ceac443 100644 (file)
@@ -79,7 +79,7 @@
  The template files used to generate all makefiles are only two:\r
  - libxml2.bkl      (the main one)\r
  - Bakefiles.bkgen\r
- All the other files can be dinamically regenerated.\r
+ All the other files can be dynamically regenerated.\r
 \r
 \r
 \r
diff --git a/buf.c b/buf.c
index d46da36..24368d3 100644 (file)
--- a/buf.c
+++ b/buf.c
@@ -83,7 +83,7 @@ struct _xmlBuf {
 
 /**
  * xmlBufMemoryError:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  * To be improved...
@@ -98,7 +98,7 @@ xmlBufMemoryError(xmlBufPtr buf, const char *extra)
 
 /**
  * xmlBufOverflowError:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a buffer overflow error
  * To be improved...
@@ -1233,10 +1233,12 @@ xmlBufBackToBuffer(xmlBufPtr buf) {
          * Keep the buffer but provide a truncated size value.
          */
         xmlBufOverflowError(buf, "Allocated size too big for xmlBuffer");
+        ret->use = (int) buf->use;
         ret->size = INT_MAX;
+    } else {
+        ret->use = (int) buf->use;
+        ret->size = (int) buf->size;
     }
-    ret->use = (int) buf->use;
-    ret->size = (int) buf->size;
     ret->alloc = buf->alloc;
     ret->content = buf->content;
     ret->contentIO = buf->contentIO;
@@ -1332,8 +1334,12 @@ xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input) {
 int
 xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
                       size_t base, size_t cur) {
-    if ((input == NULL) || (buf == NULL) || (buf->error))
+    if (input == NULL)
         return(-1);
+    if ((buf == NULL) || (buf->error)) {
+        input->base = input->cur = input->end = BAD_CAST "";
+        return(-1);
+    }
     CHECK_COMPAT(buf)
     input->base = &buf->content[base];
     input->cur = input->base + cur;
diff --git a/c14n.c b/c14n.c
index 5b3fbe7..3efcd92 100644 (file)
--- a/c14n.c
+++ b/c14n.c
@@ -132,7 +132,7 @@ static xmlChar *xmlC11NNormalizeString(const xmlChar * input,
 
 /**
  * xmlC14NErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of memory error
  */
@@ -147,7 +147,7 @@ xmlC14NErrMemory(const char *extra)
 
 /**
  * xmlC14NErrParam:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of param error
  */
@@ -162,7 +162,7 @@ xmlC14NErrParam(const char *extra)
 
 /**
  * xmlC14NErrInternal:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of internal error
  */
@@ -177,7 +177,7 @@ xmlC14NErrInternal(const char *extra)
 
 /**
  * xmlC14NErrInvalidNode:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of invalid node error
  */
@@ -192,7 +192,7 @@ xmlC14NErrInvalidNode(const char *node_type, const char *extra)
 
 /**
  * xmlC14NErrUnknownNode:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of unknown node error
  */
@@ -207,7 +207,7 @@ xmlC14NErrUnknownNode(int node_type, const char *extra)
 
 /**
  * xmlC14NErrRelativeNamespace:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of relative namespace error
  */
@@ -228,7 +228,7 @@ xmlC14NErrRelativeNamespace(const char *ns_uri)
  * @node:  the context node
  * @error:  the error code
  * @msg:  the message
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -2033,13 +2033,13 @@ xmlC14NDocDumpMemory(xmlDocPtr doc, xmlNodeSetPtr nodes,
     }
 
     ret = xmlBufUse(buf->buffer);
-    if (ret > 0) {
+    if (ret >= 0) {
         *doc_txt_ptr = xmlStrndup(xmlBufContent(buf->buffer), ret);
     }
     (void) xmlOutputBufferClose(buf);
 
-    if ((*doc_txt_ptr == NULL) && (ret > 0)) {
-        xmlC14NErrMemory("coping canonicalized document");
+    if ((*doc_txt_ptr == NULL) && (ret >= 0)) {
+        xmlC14NErrMemory("copying canonicalized document");
         return (-1);
     }
     return (ret);
index 7328fd3..effbb2e 100644 (file)
--- a/catalog.c
+++ b/catalog.c
@@ -216,7 +216,7 @@ static int xmlCatalogInitialized = 0;
 
 /**
  * xmlCatalogErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -234,7 +234,7 @@ xmlCatalogErrMemory(const char *extra)
  * @catal: the Catalog entry
  * @node: the context node
  * @msg:  the error message
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a catalog error
  */
@@ -924,7 +924,7 @@ xmlParseCatalogFile(const char *filename) {
     xmlBufResetInput(buf->buffer, inputStream);
 
     inputPush(ctxt, inputStream);
-    if ((ctxt->directory == NULL) && (directory == NULL))
+    if (ctxt->directory == NULL)
         directory = xmlParserGetDirectory(filename);
     if ((ctxt->directory == NULL) && (directory != NULL))
         ctxt->directory = directory;
@@ -2069,8 +2069,7 @@ xmlCatalogListXMLResolve(xmlCatalogEntryPtr catal, const xmlChar *pubID,
                ret = xmlCatalogXMLResolve(catal->children, pubID, sysID);
                if (ret != NULL) {
                    break;
-                } else if ((catal->children != NULL) &&
-                          (catal->children->depth > MAX_CATAL_DEPTH)) {
+                } else if (catal->children->depth > MAX_CATAL_DEPTH) {
                    ret = NULL;
                    break;
                }
@@ -2353,7 +2352,7 @@ xmlParseSGMLCatalog(xmlCatalogPtr catal, const xmlChar *value,
            xmlCatalogEntryType type = XML_CATA_NONE;
 
            cur = xmlParseSGMLCatalogName(cur, &name);
-           if (name == NULL) {
+           if (cur == NULL || name == NULL) {
                /* error */
                break;
            }
@@ -3254,6 +3253,7 @@ xmlLoadCatalogs(const char *pathss) {
            while ((*cur != 0) && (*cur != PATH_SEPARATOR) && (!xmlIsBlank_ch(*cur)))
                cur++;
            path = xmlStrndup((const xmlChar *)paths, cur - paths);
+           if (path != NULL) {
 #ifdef _WIN32
         iLen = strlen((const char*)path);
         for(i = 0; i < iLen; i++) {
@@ -3262,7 +3262,6 @@ xmlLoadCatalogs(const char *pathss) {
             }
         }
 #endif
-           if (path != NULL) {
                xmlLoadCatalog((const char *) path);
                xmlFree(path);
            }
@@ -3427,9 +3426,10 @@ xmlCatalogAdd(const xmlChar *type, const xmlChar *orig, const xmlChar *replace)
        (xmlStrEqual(type, BAD_CAST "catalog"))) {
        xmlDefaultCatalog = xmlCreateNewCatalog(XML_XML_CATALOG_TYPE,
                                          xmlCatalogDefaultPrefer);
-       xmlDefaultCatalog->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
+       if (xmlDefaultCatalog != NULL) {
+          xmlDefaultCatalog->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
                                    orig, NULL,  xmlCatalogDefaultPrefer, NULL);
-
+       }
        xmlRMutexUnlock(xmlCatalogMutex);
        return(0);
     }
diff --git a/config.h.cmake.in b/config.h.cmake.in
new file mode 100644 (file)
index 0000000..22b3c92
--- /dev/null
@@ -0,0 +1,288 @@
+/* config.h.  Generated from config.h.in by configure.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if __attribute__((destructor)) is accepted */
+#cmakedefine ATTRIBUTE_DESTRUCTOR 1
+
+/* Type cast for the gethostbyname() argument */
+#cmakedefine GETHOSTBYNAME_ARG_CAST @GETHOSTBYNAME_ARG_CAST@
+
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#cmakedefine HAVE_ARPA_INET_H 1
+
+/* Define to 1 if you have the <arpa/nameser.h> header file. */
+#cmakedefine HAVE_ARPA_NAMESER_H 1
+
+/* Whether struct sockaddr::__ss_family exists */
+#cmakedefine HAVE_BROKEN_SS_FAMILY 1
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#cmakedefine HAVE_CTYPE_H 1
+
+/* Define to 1 if you have the <dirent.h> header file. */
+#cmakedefine HAVE_DIRENT_H 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#cmakedefine HAVE_DLFCN_H 1
+
+/* Have dlopen based dso */
+#cmakedefine HAVE_DLOPEN 1
+
+/* Define to 1 if you have the <dl.h> header file. */
+#cmakedefine HAVE_DL_H 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#cmakedefine HAVE_ERRNO_H 1
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#cmakedefine HAVE_FCNTL_H 1
+
+/* Define to 1 if you have the <float.h> header file. */
+#cmakedefine HAVE_FLOAT_H 1
+
+/* Define to 1 if you have the `fprintf' function. */
+#cmakedefine HAVE_FPRINTF 1
+
+/* Define to 1 if you have the `ftime' function. */
+#cmakedefine HAVE_FTIME 1
+
+/* Define if getaddrinfo is there */
+#cmakedefine HAVE_GETADDRINFO 1
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#cmakedefine HAVE_GETTIMEOFDAY 1
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#cmakedefine HAVE_INTTYPES_H 1
+
+/* Define to 1 if you have the `isascii' function. */
+#cmakedefine HAVE_ISASCII 1
+
+/* Define if isinf is there */
+#cmakedefine HAVE_ISINF 1
+
+/* Define if isnan is there */
+#cmakedefine HAVE_ISNAN 1
+
+/* Define if history library is there (-lhistory) */
+#cmakedefine HAVE_LIBHISTORY 1
+
+/* Define if pthread library is there (-lpthread) */
+#cmakedefine HAVE_LIBPTHREAD 1
+
+/* Define if readline library is there (-lreadline) */
+#cmakedefine HAVE_LIBREADLINE 1
+
+/* Define to 1 if you have the <limits.h> header file. */
+#cmakedefine HAVE_LIMITS_H 1
+
+/* Define to 1 if you have the `localtime' function. */
+#cmakedefine HAVE_LOCALTIME 1
+
+/* Define to 1 if you have the <lzma.h> header file. */
+#cmakedefine HAVE_LZMA_H 1
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#cmakedefine HAVE_MALLOC_H 1
+
+/* Define to 1 if you have the <math.h> header file. */
+#cmakedefine HAVE_MATH_H 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#cmakedefine HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mmap' function. */
+#cmakedefine HAVE_MMAP 1
+
+/* Define to 1 if you have the `munmap' function. */
+#cmakedefine HAVE_MUNMAP 1
+
+/* mmap() is no good without munmap() */
+#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
+#  undef /**/ HAVE_MMAP
+#endif
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#cmakedefine HAVE_NDIR_H 1
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#cmakedefine HAVE_NETDB_H 1
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#cmakedefine HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <poll.h> header file. */
+#cmakedefine HAVE_POLL_H 1
+
+/* Define to 1 if you have the `printf' function. */
+#cmakedefine HAVE_PRINTF 1
+
+/* Define if <pthread.h> is there */
+#cmakedefine HAVE_PTHREAD_H 1
+
+/* Define to 1 if you have the `putenv' function. */
+#cmakedefine HAVE_PUTENV 1
+
+/* Define to 1 if you have the `rand' function. */
+#cmakedefine HAVE_RAND 1
+
+/* Define to 1 if you have the `rand_r' function. */
+#cmakedefine HAVE_RAND_R 1
+
+/* Define to 1 if you have the <resolv.h> header file. */
+#cmakedefine HAVE_RESOLV_H 1
+
+/* Have shl_load based dso */
+#cmakedefine HAVE_SHLLOAD 1
+
+/* Define to 1 if you have the `signal' function. */
+#cmakedefine HAVE_SIGNAL 1
+
+/* Define to 1 if you have the <signal.h> header file. */
+#cmakedefine HAVE_SIGNAL_H 1
+
+/* Define to 1 if you have the `snprintf' function. */
+#cmakedefine HAVE_SNPRINTF 1
+
+/* Define to 1 if you have the `sprintf' function. */
+#cmakedefine HAVE_SPRINTF 1
+
+/* Define to 1 if you have the `srand' function. */
+#cmakedefine HAVE_SRAND 1
+
+/* Define to 1 if you have the `sscanf' function. */
+#cmakedefine HAVE_SSCANF 1
+
+/* Define to 1 if you have the `stat' function. */
+#cmakedefine HAVE_STAT 1
+
+/* Define to 1 if you have the <stdarg.h> header file. */
+#cmakedefine HAVE_STDARG_H 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#cmakedefine HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#cmakedefine HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the `strftime' function. */
+#cmakedefine HAVE_STRFTIME 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#cmakedefine HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#cmakedefine HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+   */
+#cmakedefine HAVE_SYS_DIR_H 1
+
+/* Define to 1 if you have the <sys/mman.h> header file. */
+#cmakedefine HAVE_SYS_MMAN_H 1
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+   */
+#cmakedefine HAVE_SYS_NDIR_H 1
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#cmakedefine HAVE_SYS_SELECT_H 1
+
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#cmakedefine HAVE_SYS_SOCKET_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#cmakedefine HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/timeb.h> header file. */
+#cmakedefine HAVE_SYS_TIMEB_H 1
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#cmakedefine HAVE_SYS_TIME_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#cmakedefine HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the `time' function. */
+#cmakedefine HAVE_TIME 1
+
+/* Define to 1 if you have the <time.h> header file. */
+#cmakedefine HAVE_TIME_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#cmakedefine HAVE_UNISTD_H 1
+
+/* Whether va_copy() is available */
+#cmakedefine HAVE_VA_COPY 1
+
+/* Define to 1 if you have the `vfprintf' function. */
+#cmakedefine HAVE_VFPRINTF 1
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#cmakedefine HAVE_VSNPRINTF 1
+
+/* Define to 1 if you have the `vsprintf' function. */
+#cmakedefine HAVE_VSPRINTF 1
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#cmakedefine HAVE_ZLIB_H 1
+
+/* Whether __va_copy() is available */
+#cmakedefine HAVE___VA_COPY 1
+
+/* Define as const if the declaration of iconv() needs const. */
+#define ICONV_CONST @ICONV_CONST@
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#cmakedefine LT_OBJDIR "@LT_OBJDIR@"
+
+/* Name of package */
+#define PACKAGE "@PACKAGE@"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "@PACKAGE_NAME@"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "@PACKAGE_STRING@"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "@PACKAGE_TARNAME@"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "@PACKAGE_URL@"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "@PACKAGE_VERSION@"
+
+/* Type cast for the send() function 2nd arg */
+#cmakedefine SEND_ARG2_CAST @SEND_ARG2_CAST@
+
+/* Define to 1 if you have the ANSI C header files. */
+#cmakedefine STDC_HEADERS 1
+
+/* Support for IPv6 */
+#cmakedefine SUPPORT_IP6 1
+
+/* Define if va_list is an array type */
+#cmakedefine VA_LIST_IS_ARRAY 1
+
+/* Version number of package */
+#cmakedefine VERSION "@VERSION@"
+
+/* Determine what socket length (socklen_t) data type is */
+#cmakedefine XML_SOCKLEN_T @XML_SOCKLEN_T@
+
+/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>,
+   <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the
+   #define below would cause a syntax error. */
+#cmakedefine _UINT32_T @_UINT32_T@
+
+/* ss_family is not defined here, use __ss_family instead */
+#cmakedefine ss_family @ss_family@
+
+/* Define to the type of an unsigned integer type of width exactly 32 bits if
+   such a type exists and the standard includes do not define it. */
+#cmakedefine uint32_t @uint32_t@
index 07113a8..ab76a45 100644 (file)
@@ -1,15 +1,20 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.63])
-AC_INIT
+
+m4_define([MAJOR_VERSION], 2)
+m4_define([MINOR_VERSION], 9)
+m4_define([MICRO_VERSION], 11)
+
+AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
 AC_CONFIG_SRCDIR([entities.c])
 AC_CONFIG_HEADERS([config.h])
 AM_MAINTAINER_MODE([enable])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
 
-LIBXML_MAJOR_VERSION=2
-LIBXML_MINOR_VERSION=9
-LIBXML_MICRO_VERSION=10
+LIBXML_MAJOR_VERSION=MAJOR_VERSION
+LIBXML_MINOR_VERSION=MINOR_VERSION
+LIBXML_MICRO_VERSION=MICRO_VERSION
 LIBXML_MICRO_VERSION_SUFFIX=
 LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
 LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
@@ -50,7 +55,7 @@ AC_SUBST(LIBXML_VERSION_EXTRA)
 
 VERSION=${LIBXML_VERSION}
 
-AM_INIT_AUTOMAKE(libxml2, $VERSION)
+AM_INIT_AUTOMAKE([foreign])
 
 # Support silent build rules, requires at least automake-1.11. Disable
 # by either passing --disable-silent-rules to configure or passing V=1
@@ -641,6 +646,17 @@ else
       [Type cast for the send() function 2nd arg])
 fi
 
+dnl Checking whether __attribute__((destructor)) is accepted by the compiler
+AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
+AC_TRY_COMPILE2([
+void __attribute__((destructor))
+f(void) {}], [], [
+  AC_MSG_RESULT(yes)
+  AC_DEFINE([HAVE_ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])
+  AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [__attribute__((destructor))],[A form that will not confuse apibuild.py])],[
+  AC_MSG_RESULT(no)])
+
+
 dnl ***********************Checking for availability of IPv6*******************
 
 AC_MSG_CHECKING([whether to enable IPv6])
@@ -770,7 +786,7 @@ else
 
     # warnings we'd like to see
     EXTRA_CFLAGS="${EXTRA_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
-    # warnings we'd like to supress
+    # warnings we'd like to suppress
     EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-long-long -Wno-format-extra-args"
     case "${host}" in
           alpha*-*-linux* )
@@ -1503,8 +1519,8 @@ else
 
             AC_CHECK_HEADER(unicode/ucnv.h,
             AC_MSG_CHECKING(for icu)
-            AC_TRY_LINK([#include <unicode/ucnv.h>],[
-        UConverter *utf = ucnv_open("UTF-8", NULL);],[
+            AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unicode/ucnv.h>]], [[
+        UConverter *utf = ucnv_open("UTF-8", NULL);]])],[
                 AC_MSG_RESULT(yes)
                 have_libicu=yes],[
                 AC_MSG_RESULT(no)
@@ -1515,8 +1531,8 @@ else
                 LDFLAGS="${LDFLAGS} ${ICU_LIBS}"
                 LIBS="${LIBS} -licucore"
 
-                AC_TRY_LINK([#include <unicode/ucnv.h>],[
-        UConverter *utf = ucnv_open("UTF-8", NULL);],[
+                AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unicode/ucnv.h>]], [[
+        UConverter *utf = ucnv_open("UTF-8", NULL);]])],[
                     AC_MSG_RESULT(yes)
                     have_libicu=yes
                     ICU_LIBS="${ICU_LIBS} -licucore"
@@ -1655,7 +1671,7 @@ dnl  http://sourceforge.net/project/shownotes.php?release_id=24832
 dnl
 dnl Also *win32*config.h files redefine them for various MSC compilers.
 dnl
-dnl So do not redefine {v}snprintf to _{v}snprintf like follwing:
+dnl So do not redefine {v}snprintf to _{v}snprintf like following:
 dnl  AC_DEFINE([snprintf],[_snprintf],[Win32 Std C name mangling work-around])
 dnl  AC_DEFINE([vsnprintf],[_vsnprintf],[Win32 Std C name mangling work-around])
 dnl and do not redefine those functions is C-source files.
@@ -1704,7 +1720,7 @@ rm -f COPYING.LIB COPYING
 ln -s $srcdir/Copyright COPYING
 
 # keep on one line for cygwin c.f. #130896
-AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
+AC_CONFIG_FILES([libxml2.spec:libxml.spec.in Makefile include/Makefile include/libxml/Makefile doc/Makefile doc/examples/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
 AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
 AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
 AC_OUTPUT
index d855555..7a2ca47 100644 (file)
@@ -1342,7 +1342,7 @@ xmlCtxtDumpDTD(xmlDebugCtxtPtr ctxt, xmlDtdPtr dtd)
  * @output:  the FILE * for the output
  * @str:  the string
  *
- * Dumps informations about the string, shorten it if necessary
+ * Dumps information about the string, shorten it if necessary
  */
 void
 xmlDebugDumpString(FILE * output, const xmlChar * str)
@@ -2190,7 +2190,7 @@ xmlShellRegisterRootNamespaces(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
  * @node2:  unused
  *
  * Implements the XML shell function "grep"
- * dumps informations about the node (namespace, attributes, content).
+ * dumps information about the node (namespace, attributes, content).
  *
  * Returns 0
  */
@@ -2268,7 +2268,7 @@ xmlShellGrep(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
  * @node2:  unused
  *
  * Implements the XML shell function "dir"
- * dumps informations about the node (namespace, attributes, content).
+ * dumps information about the node (namespace, attributes, content).
  *
  * Returns 0
  */
@@ -2302,7 +2302,7 @@ xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
  * @node2:  unused
  *
  * Implements the XML shell function "dir"
- * dumps informations about the node (namespace, attributes, content).
+ * dumps information about the node (namespace, attributes, content).
  *
  * Returns 0
  */
@@ -2900,7 +2900,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
                  fprintf(ctxt->output, "\tbye          leave shell\n");
                  fprintf(ctxt->output, "\tcat [node]   display node or current node\n");
                  fprintf(ctxt->output, "\tcd [path]    change directory to path or to root\n");
-                 fprintf(ctxt->output, "\tdir [path]   dumps informations about the node (namespace, attributes, content)\n");
+                 fprintf(ctxt->output, "\tdir [path]   dumps information about the node (namespace, attributes, content)\n");
                  fprintf(ctxt->output, "\tdu [path]    show the structure of the subtree under path or the current node\n");
                  fprintf(ctxt->output, "\texit         leave shell\n");
                  fprintf(ctxt->output, "\thelp         display this help\n");
diff --git a/dict.c b/dict.c
index 336e046..90e4d81 100644 (file)
--- a/dict.c
+++ b/dict.c
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  * Author: daniel@veillard.com
@@ -452,7 +452,7 @@ xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) {
     unsigned long value = seed;
 
     if (name == NULL) return(0);
-    value = *name;
+    value += *name;
     value <<= 5;
     if (namelen > 10) {
         value += name[namelen - 1];
index 393cd18..e4c4c0e 100644 (file)
@@ -50,6 +50,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
@@ -85,8 +86,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>CVS</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a><br />
 </dd><dt>CWD</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPCwd">xmlNanoFTPCwd</a><br />
 </dd><dt>Cache</dt><dd><a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
-</dd><dt>Call</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
+</dd><dt>Call</dt><dd><a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
 <a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
 </dd><dt>Callback</dt><dd><a href="html/libxml-SAX.html#externalSubset">externalSubset</a><br />
 <a href="html/libxml-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a><br />
index b612643..23e1f44 100644 (file)
@@ -388,6 +388,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-HTMLparser.html#htmlIsAutoClosed">htmlIsAutoClosed</a><br />
 <a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
 <a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
 <a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
index c28458d..9780c17 100644 (file)
@@ -51,7 +51,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parserInternals.html#xmlSetEntityReferenceFunc">xmlSetEntityReferenceFunc</a><br />
 </dd><dt>bad</dt><dd><a href="html/libxml-parserInternals.html#XML_MAX_LOOKUP_LIMIT">XML_MAX_LOOKUP_LIMIT</a><br />
 </dd><dt>badly</dt><dd><a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
-</dd><dt>bahaviour</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderNormalization">xmlTextReaderNormalization</a><br />
 </dd><dt>balanced</dt><dd><a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
 <a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
 <a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
@@ -94,8 +93,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>basis</dt><dd><a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
 </dd><dt>bear</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 </dd><dt>becomes</dt><dd><a href="html/libxml-valid.html#xmlAddAttributeDecl">xmlAddAttributeDecl</a><br />
-</dd><dt>before</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
+</dd><dt>before</dt><dd><a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
 <a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
 <a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
 <a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
@@ -148,6 +146,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNodeGetSpacePreserve">xmlNodeGetSpacePreserve</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetSpacePreserve">xmlNodeSetSpacePreserve</a><br />
 <a href="html/libxml-SAX2.html#xmlSAX2ResolveEntity">xmlSAX2ResolveEntity</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderNormalization">xmlTextReaderNormalization</a><br />
 <a href="html/libxml-xmlreader.html#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a><br />
 <a href="html/libxml-xmlstring.html#xmlUTF8Strsize">xmlUTF8Strsize</a><br />
 </dd><dt>below</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
@@ -180,9 +179,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>bits</dt><dd><a href="html/libxml-tree.html#xmlGetLineNo">xmlGetLineNo</a><br />
 </dd><dt>blanks</dt><dd><a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
 <a href="html/libxml-parserInternals.html#xmlSkipBlankChars">xmlSkipBlankChars</a><br />
-</dd><dt>bloc</dt><dd><a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
-<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
-<a href="html/libxml-parser.html#xmlParseExternalEntity">xmlParseExternalEntity</a><br />
 </dd><dt>blockDefault</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION">XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION</a><br />
 <a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION">XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION</a><br />
 <a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION">XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION</a><br />
index 77330dd..054818c 100644 (file)
@@ -46,7 +46,9 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>caching:</dt><dd><a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
 </dd><dt>calculated</dt><dd><a href="html/libxml-xmlstring.html#xmlStrncatNew">xmlStrncatNew</a><br />
 </dd><dt>calculates</dt><dd><a href="html/libxml-xmlstring.html#xmlUTF8Size">xmlUTF8Size</a><br />
-</dd><dt>calling</dt><dd><a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
+</dd><dt>calling</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
+<a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
 <a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
 <a href="html/libxml-xmlIO.html#xmlCheckFilename">xmlCheckFilename</a><br />
@@ -320,8 +322,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xpathInternals.html#xmlXPathCeilingFunction">xmlXPathCeilingFunction</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathFloorFunction">xmlXPathFloorFunction</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathRoundFunction">xmlXPathRoundFunction</a><br />
-</dd><dt>closing</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a><br />
+</dd><dt>closing</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPFreeCtxt">xmlNanoFTPFreeCtxt</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
 </dd><dt>codes</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
@@ -438,6 +439,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>compiled-in</dt><dd><a href="html/libxml-xmlIO.html#xmlCleanupInputCallbacks">xmlCleanupInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlCleanupOutputCallbacks">xmlCleanupOutputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a><br />
 </dd><dt>compiling</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGNewDocParserCtxt">xmlRelaxNGNewDocParserCtxt</a><br />
@@ -681,8 +683,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xpathInternals.html#xmlXPathNodeSetContains">xmlXPathNodeSetContains</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
 <a href="html/libxml-xpointer.html#xmlXPtrNewContext">xmlXPtrNewContext</a><br />
-</dd><dt>content:</dt><dd><a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathEqualValues">xmlXPathEqualValues</a><br />
+</dd><dt>content:</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathEqualValues">xmlXPathEqualValues</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathNotEqualValues">xmlXPathNotEqualValues</a><br />
 </dd><dt>contentType</dt><dd><a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
 <a href="html/libxml-nanohttp.html#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a><br />
@@ -722,6 +723,8 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-nanoftp.html#xmlNanoFTPConnectTo">xmlNanoFTPConnectTo</a><br />
 <a href="html/libxml-SAX2.html#xmlSAX2ResolveEntity">xmlSAX2ResolveEntity</a><br />
 </dd><dt>conveniently</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
+</dd><dt>convention</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
 </dd><dt>conversion</dt><dd><a href="html/libxml-encoding.html#_uconv_t">_uconv_t</a><br />
 <a href="html/libxml-xpath.html#_xmlXPathType">_xmlXPathType</a><br />
 <a href="html/libxml-encoding.html#xmlCharEncOutFunc">xmlCharEncOutFunc</a><br />
index a01afa8..ae839a1 100644 (file)
@@ -154,6 +154,11 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlreader.html#xmlTextReaderStandalone">xmlTextReaderStandalone</a><br />
 <a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
+</dd><dt>declares</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
 </dd><dt>declaring</dt><dd><a href="html/libxml-valid.html#xmlGetID">xmlGetID</a><br />
 </dd><dt>decode</dt><dd><a href="html/libxml-parserInternals.html#xmlDecodeEntities">xmlDecodeEntities</a><br />
 </dd><dt>def</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeListDecl">xmlParseAttributeListDecl</a><br />
@@ -535,6 +540,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlLastElementChild">xmlLastElementChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNextElementSibling">xmlNextElementSibling</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseStartTag">xmlParseStartTag</a><br />
 <a href="html/libxml-tree.html#xmlPreviousElementSibling">xmlPreviousElementSibling</a><br />
index 235b553..2889dcf 100644 (file)
@@ -271,6 +271,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>escaped</dt><dd><a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
@@ -392,6 +393,10 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-pattern.html#xmlStreamPushNode">xmlStreamPushNode</a><br />
 </dd><dt>explicitly</dt><dd><a href="html/libxml-SAX2.html#xmlSAXDefaultVersion">xmlSAXDefaultVersion</a><br />
 </dd><dt>explored</dt><dd><a href="html/libxml-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a><br />
+</dd><dt>exportable</dt><dd><a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
+</dd><dt>exported</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
 </dd><dt>exposing</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a><br />
 </dd><dt>express</dt><dd><a href="html/libxml-tree.html#LIBXML2_NEW_BUFFER">LIBXML2_NEW_BUFFER</a><br />
 </dd><dt>expressing</dt><dd><a href="html/libxml-uri.html#xmlPathToURI">xmlPathToURI</a><br />
index 744bde8..87f54c0 100644 (file)
@@ -109,7 +109,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br />
 <a href="html/libxml-xmlschemas.html#xmlSchemaIsValid">xmlSchemaIsValid</a><br />
 </dd><dt>fashion</dt><dd><a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
-</dd><dt>fast</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 </dd><dt>faster</dt><dd><a href="html/libxml-HTMLparser.html#htmlNodeStatus">htmlNodeStatus</a><br />
 <a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br />
 </dd><dt>fatal</dt><dd><a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br />
@@ -386,7 +385,9 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlIO.html#xmlOutputMatchCallback">xmlOutputMatchCallback</a><br />
 <a href="html/libxml-xpath.html#xmlXPathNodeSetGetLength">xmlXPathNodeSetGetLength</a><br />
 <a href="html/libxml-xpath.html#xmlXPathNodeSetItem">xmlXPathNodeSetItem</a><br />
-</dd><dt>functions</dt><dd><a href="html/libxml-HTMLparser.html#htmlCtxtReadIO">htmlCtxtReadIO</a><br />
+</dd><dt>functions</dt><dd><a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
+<a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
+<a href="html/libxml-HTMLparser.html#htmlCtxtReadIO">htmlCtxtReadIO</a><br />
 <a href="html/libxml-HTMLparser.html#htmlReadIO">htmlReadIO</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
 <a href="html/libxml-parser.html#xmlCtxtReadIO">xmlCtxtReadIO</a><br />
index 0fb9d81..9afdf23 100644 (file)
@@ -324,7 +324,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-HTMLparser.html#htmlReadMemory">htmlReadMemory</a><br />
 </dd><dt>htmlStartClose</dt><dd><a href="html/libxml-HTMLparser.html#htmlAutoCloseTag">htmlAutoCloseTag</a><br />
 <a href="html/libxml-HTMLparser.html#htmlIsAutoClosed">htmlIsAutoClosed</a><br />
-</dd><dt>htmlStartCloseIndex</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 </dd><dt>http:</dt><dd><a href="html/libxml-xinclude.html#XINCLUDE_NS">XINCLUDE_NS</a><br />
 <a href="html/libxml-xinclude.html#XINCLUDE_OLD_NS">XINCLUDE_OLD_NS</a><br />
 <a href="html/libxml-SAX.html#getSystemId">getSystemId</a><br />
index d2dd069..ab3504f 100644 (file)
@@ -126,15 +126,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parser.html#xmlSAXParseMemory">xmlSAXParseMemory</a><br />
 <a href="html/libxml-parser.html#xmlSAXParseMemoryWithData">xmlSAXParseMemoryWithData</a><br />
 <a href="html/libxml-parser.html#xmlSAXUserParseMemory">xmlSAXUserParseMemory</a><br />
-</dd><dt>incase</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPClose">xmlNanoFTPClose</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPCloseConnection">xmlNanoFTPCloseConnection</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPCwd">xmlNanoFTPCwd</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPDele">xmlNanoFTPDele</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPGet">xmlNanoFTPGet</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPGetConnection">xmlNanoFTPGetConnection</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPList">xmlNanoFTPList</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPSave">xmlNanoHTTPSave</a><br />
 </dd><dt>incl</dt><dd><a href="html/libxml-schemasInternals.html#_xmlSchemaType">_xmlSchemaType</a><br />
 </dd><dt>include</dt><dd><a href="html/libxml-xinclude.html#XINCLUDE_NODE">XINCLUDE_NODE</a><br />
 <a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
@@ -156,6 +147,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlIO.html#xmlCleanupInputCallbacks">xmlCleanupInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlCleanupOutputCallbacks">xmlCleanupOutputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-xinclude.html#xmlXIncludeProcessFlags">xmlXIncludeProcessFlags</a><br />
 <a href="html/libxml-xinclude.html#xmlXIncludeProcessFlagsData">xmlXIncludeProcessFlagsData</a><br />
 <a href="html/libxml-xinclude.html#xmlXIncludeProcessTreeFlags">xmlXIncludeProcessTreeFlags</a><br />
@@ -283,59 +275,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parser.html#xmlParserFindNodeInfo">xmlParserFindNodeInfo</a><br />
 <a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
 <a href="html/libxml-xmlmemory.html#xmlReallocLoc">xmlReallocLoc</a><br />
-</dd><dt>information</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a><br />
-<a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpAttr">xmlDebugDumpAttr</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpAttrList">xmlDebugDumpAttrList</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpDTD">xmlDebugDumpDTD</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpDocument">xmlDebugDumpDocument</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpDocumentHead">xmlDebugDumpDocumentHead</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpEntities">xmlDebugDumpEntities</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpNode">xmlDebugDumpNode</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpNodeList">xmlDebugDumpNodeList</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpOneNode">xmlDebugDumpOneNode</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPUpdateURL">xmlNanoFTPUpdateURL</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethod">xmlNanoHTTPMethod</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPMethodRedir">xmlNanoHTTPMethodRedir</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPOpen">xmlNanoHTTPOpen</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPOpenRedir">xmlNanoHTTPOpenRedir</a><br />
-<a href="html/libxml-xmlreader.html#xmlNewTextReader">xmlNewTextReader</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGGetParserErrors">xmlRelaxNGGetParserErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaGetParserErrors">xmlSchemaGetParserErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidateSetFilename">xmlSchemaValidateSetFilename</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidateSetLocator">xmlSchemaValidateSetLocator</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a><br />
-<a href="html/libxml-xmlreader.html#xmlTextReaderByteConsumed">xmlTextReaderByteConsumed</a><br />
-<a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
-</dd><dt>informations</dt><dd><a href="html/libxml-tree.html#_xmlAttr">_xmlAttr</a><br />
-<a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
-<a href="html/libxml-tree.html#_xmlNode">_xmlNode</a><br />
-<a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
-<a href="html/libxml-parser.html#endElementNsSAX2Func">endElementNsSAX2Func</a><br />
-<a href="html/libxml-parser.html#startElementNsSAX2Func">startElementNsSAX2Func</a><br />
-<a href="html/libxml-debugXML.html#xmlDebugDumpString">xmlDebugDumpString</a><br />
-<a href="html/libxml-parserInternals.html#xmlErrMemory">xmlErrMemory</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPInit">xmlNanoFTPInit</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPProxy">xmlNanoFTPProxy</a><br />
-<a href="html/libxml-nanoftp.html#xmlNanoFTPScanProxy">xmlNanoFTPScanProxy</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPInit">xmlNanoHTTPInit</a><br />
-<a href="html/libxml-nanohttp.html#xmlNanoHTTPScanProxy">xmlNanoHTTPScanProxy</a><br />
-<a href="html/libxml-xmlerror.html#xmlParserPrintFileInfo">xmlParserPrintFileInfo</a><br />
-<a href="html/libxml-xmlregexp.html#xmlRegExecErrInfo">xmlRegExecErrInfo</a><br />
-<a href="html/libxml-xmlregexp.html#xmlRegExecNextValues">xmlRegExecNextValues</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGGetValidErrors">xmlRelaxNGGetValidErrors</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidErrors">xmlRelaxNGSetValidErrors</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxParserSetFlag">xmlRelaxParserSetFlag</a><br />
-<a href="html/libxml-SAX2.html#xmlSAX2EndElementNs">xmlSAX2EndElementNs</a><br />
-<a href="html/libxml-SAX2.html#xmlSAX2StartElementNs">xmlSAX2StartElementNs</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a><br />
-<a href="html/libxml-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a><br />
-<a href="html/libxml-debugXML.html#xmlShellDir">xmlShellDir</a><br />
-<a href="html/libxml-xinclude.html#xmlXIncludeProcessNode">xmlXIncludeProcessNode</a><br />
 </dd><dt>informative</dt><dd><a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
 </dd><dt>infos</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
 </dd><dt>inherited</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
index c50c345..b948d38 100644 (file)
@@ -319,8 +319,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>multiple</dt><dd><a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
 <a href="html/libxml-parserInternals.html#xmlStringCurrentChar">xmlStringCurrentChar</a><br />
 </dd><dt>multiply</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathMultValues">xmlXPathMultValues</a><br />
-</dd><dt>multithreaded</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
+</dd><dt>multithreaded</dt><dd><a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
 <a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
 <a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
 </dd><dt>mutex</dt><dd><a href="html/libxml-dict.html#xmlDictCleanup">xmlDictCleanup</a><br />
index d5d363b..449e0cb 100644 (file)
@@ -216,6 +216,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNodeListGetString">xmlNodeListGetString</a><br />
 <a href="html/libxml-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a><br />
 <a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
+</dd><dt>EOF</dt><dd><a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
 </dd><dt>ETag</dt><dd><a href="html/libxml-HTMLparser.html#htmlParseElement">htmlParseElement</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseElement">xmlParseElement</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseEndTag">xmlParseEndTag</a><br />
index f812bbc..0a30923 100644 (file)
@@ -41,7 +41,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>names</dt><dd><a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
 <a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
 <a href="html/libxml-schemasInternals.html#_xmlSchema">_xmlSchema</a><br />
-<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 <a href="html/libxml-parser.html#xmlGetFeaturesList">xmlGetFeaturesList</a><br />
 <a href="html/libxml-hash.html#xmlHashAddEntry">xmlHashAddEntry</a><br />
 <a href="html/libxml-hash.html#xmlHashScan3">xmlHashScan3</a><br />
@@ -156,6 +155,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>nice</dt><dd><a href="html/libxml-uri.html#xmlBuildRelativeURI">xmlBuildRelativeURI</a><br />
 </dd><dt>nillable</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_NILLABLE">XML_SCHEMAS_ELEM_NILLABLE</a><br />
 <a href="html/libxml-xmlregexp.html#xmlExpIsNillable">xmlExpIsNillable</a><br />
+</dd><dt>no-op</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 </dd><dt>nod</dt><dd><a href="html/libxml-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a><br />
 </dd><dt>node-</dt><dd><a href="html/libxml-tree.html#_xmlDOMWrapCtxt">_xmlDOMWrapCtxt</a><br />
 <a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
@@ -258,6 +258,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-hash.html#XML_CAST_FPTR">XML_CAST_FPTR</a><br />
 <a href="html/libxml-schemasInternals.html#_xmlSchema">_xmlSchema</a><br />
 <a href="html/libxml-schemasInternals.html#_xmlSchemaElement">_xmlSchemaElement</a><br />
+<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 <a href="html/libxml-parserInternals.html#xmlDecodeEntities">xmlDecodeEntities</a><br />
 <a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
 <a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
index 7f8efe4..6f376c8 100644 (file)
@@ -128,8 +128,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xpathInternals.html#xmlXPathNormalizeFunction">xmlXPathNormalizeFunction</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathStringLengthFunction">xmlXPathStringLengthFunction</a><br />
-</dd><dt>once</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
+</dd><dt>once</dt><dd><a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
 <a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans2">xmlAutomataNewOnceTrans2</a><br />
 <a href="html/libxml-threads.html#xmlCleanupThreads">xmlCleanupThreads</a><br />
 <a href="html/libxml-entities.html#xmlEncodeEntities">xmlEncodeEntities</a><br />
index 9f69008..59f5141 100644 (file)
@@ -166,6 +166,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>piece</dt><dd><a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
 </dd><dt>pieces</dt><dd><a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
@@ -417,8 +418,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parserInternals.html#xmlStringLenDecodeEntities">xmlStringLenDecodeEntities</a><br />
 <a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
 <a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
-</dd><dt>processed</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
-<a href="html/libxml-SAX.html#startDocument">startDocument</a><br />
+</dd><dt>processed</dt><dd><a href="html/libxml-SAX.html#startDocument">startDocument</a><br />
 <a href="html/libxml-parser.html#startDocumentSAXFunc">startDocumentSAXFunc</a><br />
 <a href="html/libxml-SAX.html#startElement">startElement</a><br />
 <a href="html/libxml-parser.html#startElementSAXFunc">startElementSAXFunc</a><br />
@@ -443,14 +443,15 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>produce</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
 <a href="html/libxml-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a><br />
 <a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
-</dd><dt>produced</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
+</dd><dt>produced</dt><dd><a href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a><br />
+<a href="html/libxml-encoding.html#isolat1ToUTF8">isolat1ToUTF8</a><br />
+<a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
 <a href="html/libxml-parserInternals.html#xmlCurrentChar">xmlCurrentChar</a><br />
 </dd><dt>producing</dt><dd><a href="html/libxml-xmlstring.html#xmlCheckUTF8">xmlCheckUTF8</a><br />
 </dd><dt>production:</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
 </dd><dt>productions</dt><dd><a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
 </dd><dt>program</dt><dd><a href="html/libxml-xpointer.html#xmlXPtrNewContext">xmlXPtrNewContext</a><br />
-</dd><dt>programs</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
+</dd><dt>programs</dt><dd><a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
 </dd><dt>progressed</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
 </dd><dt>progresses</dt><dd><a href="html/libxml-xmlregexp.html#xmlRegNewExecCtxt">xmlRegNewExecCtxt</a><br />
 </dd><dt>progressive</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
index a72cbfe..7bade6a 100644 (file)
@@ -228,8 +228,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-nanohttp.html#xmlNanoHTTPRedir">xmlNanoHTTPRedir</a><br />
 </dd><dt>redirection</dt><dd><a href="html/libxml-xmlIO.html#xmlCheckHTTPInput">xmlCheckHTTPInput</a><br />
 <a href="html/libxml-nanohttp.html#xmlNanoHTTPRedir">xmlNanoHTTPRedir</a><br />
-</dd><dt>reentrant</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-entities.html#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a><br />
+</dd><dt>reentrant</dt><dd><a href="html/libxml-entities.html#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a><br />
 <a href="html/libxml-entities.html#xmlEncodeSpecialChars">xmlEncodeSpecialChars</a><br />
 <a href="html/libxml-threads.html#xmlFreeRMutex">xmlFreeRMutex</a><br />
 <a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
@@ -272,6 +271,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-encoding.html#xmlGetCharEncodingHandler">xmlGetCharEncodingHandler</a><br />
 <a href="html/libxml-xmlerror.html#xmlGetLastError">xmlGetLastError</a><br />
 <a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
 <a href="html/libxml-xmlerror.html#xmlResetLastError">xmlResetLastError</a><br />
index c545f17..99626b4 100644 (file)
@@ -72,7 +72,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
 <a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
 <a href="html/libxml-nanohttp.html#xmlNanoHTTPFetch">xmlNanoHTTPFetch</a><br />
-<a href="html/libxml-xmlsave.html#xmlSaveTree">xmlSaveTree</a><br />
 <a href="html/libxml-debugXML.html#xmlShell">xmlShell</a><br />
 <a href="html/libxml-debugXML.html#xmlShellSave">xmlShellSave</a><br />
 </dd><dt>saved</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
@@ -215,6 +214,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
 <a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
 <a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
+<a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
 <a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
 <a href="html/libxml-parser.html#xmlParserAddNodeInfo">xmlParserAddNodeInfo</a><br />
 <a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
@@ -539,6 +539,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNodeAddContent">xmlNodeAddContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeAddContentLen">xmlNodeAddContentLen</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
@@ -942,6 +943,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNodeAddContent">xmlNodeAddContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeAddContentLen">xmlNodeAddContentLen</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
@@ -958,7 +960,8 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>switch</dt><dd><a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
 <a href="html/libxml-parserInternals.html#xmlParseReference">xmlParseReference</a><br />
 <a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
-</dd><dt>symbol</dt><dd><a href="html/libxml-xmlmodule.html#xmlModuleSymbol">xmlModuleSymbol</a><br />
+</dd><dt>symbol</dt><dd><a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
+<a href="html/libxml-xmlmodule.html#xmlModuleSymbol">xmlModuleSymbol</a><br />
 </dd><dt>synchronizing</dt><dd><a href="html/libxml-threads.html#xmlNewMutex">xmlNewMutex</a><br />
 <a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
 </dd><dt>syntax</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
index eaa24de..c37fe8f 100644 (file)
@@ -56,7 +56,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>tags</dt><dd><a href="html/libxml-HTMLparser.html#htmlAutoCloseTag">htmlAutoCloseTag</a><br />
 <a href="html/libxml-HTMLtree.html#htmlGetMetaEncoding">htmlGetMetaEncoding</a><br />
 <a href="html/libxml-HTMLparser.html#htmlHandleOmittedElem">htmlHandleOmittedElem</a><br />
-<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 <a href="html/libxml-HTMLparser.html#htmlIsAutoClosed">htmlIsAutoClosed</a><br />
 <a href="html/libxml-HTMLtree.html#htmlSetMetaEncoding">htmlSetMetaEncoding</a><br />
 </dd><dt>take</dt><dd><a href="html/libxml-threads.html#xmlLockLibrary">xmlLockLibrary</a><br />
@@ -250,9 +249,9 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parserInternals.html#xmlNamespaceParseNSDef">xmlNamespaceParseNSDef</a><br />
 <a href="html/libxml-parserInternals.html#xmlNamespaceParseQName">xmlNamespaceParseQName</a><br />
 <a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
 <a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
-<a href="html/libxml-xmlsave.html#xmlSaveTree">xmlSaveTree</a><br />
 <a href="html/libxml-tree.html#xmlSetTreeDoc">xmlSetTreeDoc</a><br />
 </dd><dt>total</dt><dd><a href="html/libxml-xmlIO.html#_xmlOutputBuffer">_xmlOutputBuffer</a><br />
 <a href="html/libxml-parser.html#xmlGetFeaturesList">xmlGetFeaturesList</a><br />
index e6e5958..f2927f8 100644 (file)
@@ -165,6 +165,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
 <a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
 </dd><dt>xmlEncodeSpecialChars</dt><dd><a href="html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a><br />
@@ -226,8 +227,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br />
 <a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br />
 <a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br />
-</dd><dt>xmlInitParser</dt><dd><a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
-<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
+</dd><dt>xmlInitParser</dt><dd><a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
 </dd><dt>xmlInitThreads</dt><dd><a href="html/libxml-threads.html#xmlInitThreads">xmlInitThreads</a><br />
 </dd><dt>xmlInitializeCatalog</dt><dd><a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
 </dd><dt>xmlInitializeGlobalState</dt><dd><a href="html/libxml-globals.html#xmlInitializeGlobalState">xmlInitializeGlobalState</a><br />
@@ -277,6 +277,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
 </dd><dt>xmlNewMutex</dt><dd><a href="html/libxml-threads.html#xmlNewMutex">xmlNewMutex</a><br />
 </dd><dt>xmlNewNode</dt><dd><a href="html/libxml-tree.html#xmlNewNodeEatName">xmlNewNodeEatName</a><br />
+</dd><dt>xmlNewProp</dt><dd><a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 </dd><dt>xmlNewTextChild</dt><dd><a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
 </dd><dt>xmlNewTextWriter</dt><dd><a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
index b4b7fc0..99c66da 100644 (file)
@@ -63,6 +63,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlDOMWrapCloneNode">xmlDOMWrapCloneNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
 <a href="html/libxml-xmlschemastypes.html#xmlSchemaGetBuiltInType">xmlSchemaGetBuiltInType</a><br />
 <a href="html/libxml-tree.html#xmlSearchNs">xmlSearchNs</a><br />
index 77ee452..b8a791b 100644 (file)
@@ -284,7 +284,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 </dd><dt>Initialization</dt><dd><a href="html/libxml-parser.html#xmlInitParser">xmlInitParser</a><br />
 </dd><dt>Initialize</dt><dd><a href="html/libxml-SAX2.html#docbDefaultSAXHandlerInit">docbDefaultSAXHandlerInit</a><br />
 <a href="html/libxml-SAX2.html#htmlDefaultSAXHandlerInit">htmlDefaultSAXHandlerInit</a><br />
-<a href="html/libxml-parserInternals.html#htmlInitAutoClose">htmlInitAutoClose</a><br />
 <a href="html/libxml-SAX.html#initdocbDefaultSAXHandler">initdocbDefaultSAXHandler</a><br />
 <a href="html/libxml-SAX.html#inithtmlDefaultSAXHandler">inithtmlDefaultSAXHandler</a><br />
 <a href="html/libxml-SAX.html#initxmlDefaultSAXHandler">initxmlDefaultSAXHandler</a><br />
index 30a6846..f7995fd 100644 (file)
@@ -217,6 +217,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlNewChild">xmlNewChild</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
 <a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
 <a href="html/libxml-xmlwriter.html#xmlNewTextWriterPushParser">xmlNewTextWriterPushParser</a><br />
index be524d9..39dd611 100644 (file)
@@ -211,6 +211,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-list.html#xmlListRemoveFirst">xmlListRemoveFirst</a><br />
 <a href="html/libxml-list.html#xmlListRemoveLast">xmlListRemoveLast</a><br />
 <a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-valid.html#xmlRemoveID">xmlRemoveID</a><br />
 <a href="html/libxml-valid.html#xmlRemoveRef">xmlRemoveRef</a><br />
 <a href="html/libxml-tree.html#xmlUnsetNsProp">xmlUnsetNsProp</a><br />
index 2432975..d9a1d49 100644 (file)
@@ -273,6 +273,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a><br />
 <a href="html/libxml-xmlwriter.html#xmlTextWriterStartElementNS">xmlTextWriterStartElementNS</a><br />
 <a href="html/libxml-xmlwriter.html#xmlTextWriterStartPI">xmlTextWriterStartPI</a><br />
+</dd><dt>Stops</dt><dd><a href="html/libxml-parserInternals.html#xmlParseContent">xmlParseContent</a><br />
 </dd><dt>StringType</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
 </dd><dt>Strings</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathStringLengthFunction">xmlXPathStringLengthFunction</a><br />
 <a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
index 1038288..03bccb8 100644 (file)
@@ -246,6 +246,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-chvalid.html#xmlIsPubidChar">xmlIsPubidChar</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a><br />
 <a href="html/libxml-tree.html#xmlNewDocNodeEatName">xmlNewDocNodeEatName</a><br />
+<a href="html/libxml-tree.html#xmlNewDocProp">xmlNewDocProp</a><br />
 <a href="html/libxml-tree.html#xmlNewNodeEatName">xmlNewNodeEatName</a><br />
 <a href="html/libxml-tree.html#xmlNewPI">xmlNewPI</a><br />
 <a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
index 3578056..6c58b2b 100644 (file)
@@ -796,6 +796,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a><br />
 <a href="html/libxml-parser.html#xmlSetFeature">xmlSetFeature</a><br />
 <a href="html/libxml-parser.html#xmlSetupParserForBuffer">xmlSetupParserForBuffer</a><br />
+<a href="html/libxml-parser.html#xmlStartTag">xmlStartTag</a><br />
 <a href="html/libxml-parser.html#xmlStopParser">xmlStopParser</a><br />
 <a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
 </p><h2><a name="parserInternals" id="parserInternals">Module parserInternals</a>:</h2><p><a href="html/libxml-parserInternals.html#INPUT_CHUNK">INPUT_CHUNK</a><br />
@@ -1809,6 +1810,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlIO.html#xmlParserInputBufferPush">xmlParserInputBufferPush</a><br />
 <a href="html/libxml-xmlIO.html#xmlParserInputBufferRead">xmlParserInputBufferRead</a><br />
 <a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a><br />
 <a href="html/libxml-xmlIO.html#xmlRegisterHTTPPostCallbacks">xmlRegisterHTTPPostCallbacks</a><br />
@@ -2633,6 +2635,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
 <a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
 <a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
 <a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
 </p><h2><a name="xmlmemory" id="xmlmemory">Module xmlmemory</a>:</h2><p><a href="html/libxml-xmlmemory.html#DEBUG_MEMORY">DEBUG_MEMORY</a><br />
 <a href="html/libxml-xmlmemory.html#xmlCleanupMemory">xmlCleanupMemory</a><br />
index 1af527a..75f583e 100644 (file)
@@ -138,6 +138,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-xmlexports.html#XMLCALL">XMLCALL</a><br />
 <a href="html/libxml-xmlexports.html#XMLCDECL">XMLCDECL</a><br />
 <a href="html/libxml-xmlexports.html#XMLPUBFUN">XMLPUBFUN</a><br />
+<a href="html/libxml-xmlexports.html#XMLPUBLIC">XMLPUBLIC</a><br />
 <a href="html/libxml-xmlexports.html#XMLPUBVAR">XMLPUBVAR</a><br />
 <a href="html/libxml-tree.html#XML_ATTRIBUTE_CDATA">XML_ATTRIBUTE_CDATA</a><br />
 <a href="html/libxml-tree.html#XML_ATTRIBUTE_DECL">XML_ATTRIBUTE_DECL</a><br />
@@ -2574,6 +2575,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-globals.html#xmlPedanticParserDefaultValue">xmlPedanticParserDefaultValue</a><br />
 <a href="html/libxml-parserInternals.html#xmlPopInput">xmlPopInput</a><br />
 <a href="html/libxml-xmlIO.html#xmlPopInputCallbacks">xmlPopInputCallbacks</a><br />
+<a href="html/libxml-xmlIO.html#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a><br />
 <a href="html/libxml-tree.html#xmlPreviousElementSibling">xmlPreviousElementSibling</a><br />
 <a href="html/libxml-uri.html#xmlPrintURI">xmlPrintURI</a><br />
 <a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
@@ -2913,6 +2915,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <a href="html/libxml-tree.html#xmlSplitQName2">xmlSplitQName2</a><br />
 <a href="html/libxml-tree.html#xmlSplitQName3">xmlSplitQName3</a><br />
 <a href="html/libxml-valid.html#xmlSprintfElementContent">xmlSprintfElementContent</a><br />
+<a href="html/libxml-parser.html#xmlStartTag">xmlStartTag</a><br />
 <a href="html/libxml-parser.html#xmlStopParser">xmlStopParser</a><br />
 <a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br />
 <a href="html/libxml-xmlstring.html#xmlStrPrintf">xmlStrPrintf</a><br />
index 95d7d04..18e8a9d 100755 (executable)
@@ -74,6 +74,7 @@ ignored_words = {
   "__declspec": (3, "Windows keyword"),
   "__stdcall": (0, "Windows keyword"),
   "ATTRIBUTE_UNUSED": (0, "macro keyword"),
+  "ATTRIBUTE_DESTRUCTOR": (0, "macro keyword"),
   "LIBEXSLT_PUBLIC": (0, "macro keyword"),
   "X_IN_Y": (5, "macro function builder"),
   "ATTRIBUTE_ALLOC_SIZE": (3, "macro for gcc checking extension"),
@@ -807,7 +808,7 @@ class CParser:
         return((args, desc))
 
      #
-     # Parse a comment block and merge the informations found in the
+     # Parse a comment block and merge the information found in the
      # parameters descriptions, finally returns a block as complete
      # as possible
      #
index 90f0d39..1076c38 100644 (file)
@@ -33,6 +33,6 @@
     <h2>
       <span class="refentrytitle">libxml2 API Modules</span>
     </h2>
-    <p><a href="libxml2-DOCBparser.html">DOCBparser</a> - old DocBook SGML parser<br/><a href="libxml2-HTMLparser.html">HTMLparser</a> - interface for an HTML 4.0 non-verifying parser<br/><a href="libxml2-HTMLtree.html">HTMLtree</a> - specific APIs to process HTML tree, especially serialization<br/><a href="libxml2-SAX.html">SAX</a> - Old SAX version 1 handler, deprecated<br/><a href="libxml2-SAX2.html">SAX2</a> - SAX2 parser interface used to build the DOM tree<br/><a href="libxml2-c14n.html">c14n</a> - Provide Canonical XML and Exclusive XML Canonicalization<br/><a href="libxml2-catalog.html">catalog</a> - interfaces to the Catalog handling system<br/><a href="libxml2-chvalid.html">chvalid</a> - Unicode character range checking<br/><a href="libxml2-debugXML.html">debugXML</a> - Tree debugging APIs<br/><a href="libxml2-dict.html">dict</a> - string dictionary<br/><a href="libxml2-encoding.html">encoding</a> - interface for the encoding conversion functions<br/><a href="libxml2-entities.html">entities</a> - interface for the XML entities handling<br/><a href="libxml2-globals.html">globals</a> - interface for all global variables of the library<br/><a href="libxml2-hash.html">hash</a> - Chained hash tables<br/><a href="libxml2-list.html">list</a> - lists interfaces<br/><a href="libxml2-nanoftp.html">nanoftp</a> - minimal FTP implementation<br/><a href="libxml2-nanohttp.html">nanohttp</a> - minimal HTTP implementation<br/><a href="libxml2-parser.html">parser</a> - the core parser module<br/><a href="libxml2-parserInternals.html">parserInternals</a> - internals routines and limits exported by the parser.<br/><a href="libxml2-pattern.html">pattern</a> - pattern expression handling<br/><a href="libxml2-relaxng.html">relaxng</a> - implementation of the Relax-NG validation<br/><a href="libxml2-schemasInternals.html">schemasInternals</a> - internal interfaces for XML Schemas<br/><a href="libxml2-schematron.html">schematron</a> - XML Schemastron implementation<br/><a href="libxml2-threads.html">threads</a> - interfaces for thread handling<br/><a href="libxml2-tree.html">tree</a> - interfaces for tree manipulation<br/><a href="libxml2-uri.html">uri</a> - library of generic URI related routines<br/><a href="libxml2-valid.html">valid</a> - The DTD validation<br/><a href="libxml2-xinclude.html">xinclude</a> - implementation of XInclude<br/><a href="libxml2-xlink.html">xlink</a> - unfinished XLink detection module<br/><a href="libxml2-xmlIO.html">xmlIO</a> - interface for the I/O interfaces used by the parser<br/><a href="libxml2-xmlautomata.html">xmlautomata</a> - API to build regexp automata<br/><a href="libxml2-xmlerror.html">xmlerror</a> - error handling<br/><a href="libxml2-xmlexports.html">xmlexports</a> - macros for marking symbols as exportable/importable.<br/><a href="libxml2-xmlmemory.html">xmlmemory</a> - interface for the memory allocator<br/><a href="libxml2-xmlmodule.html">xmlmodule</a> - dynamic module loading<br/><a href="libxml2-xmlreader.html">xmlreader</a> - the XMLReader implementation<br/><a href="libxml2-xmlregexp.html">xmlregexp</a> - regular expressions handling<br/><a href="libxml2-xmlsave.html">xmlsave</a> - the XML document serializer<br/><a href="libxml2-xmlschemas.html">xmlschemas</a> - incomplete XML Schemas structure implementation<br/><a href="libxml2-xmlschemastypes.html">xmlschemastypes</a> - implementation of XML Schema Datatypes<br/><a href="libxml2-xmlstring.html">xmlstring</a> - set of routines to process strings<br/><a href="libxml2-xmlunicode.html">xmlunicode</a> - Unicode character APIs<br/><a href="libxml2-xmlversion.html">xmlversion</a> - compile-time version informations<br/><a href="libxml2-xmlwriter.html">xmlwriter</a> - text writing API for XML<br/><a href="libxml2-xpath.html">xpath</a> - XML Path Language implementation<br/><a href="libxml2-xpathInternals.html">xpathInternals</a> - internal interfaces for XML Path Language implementation<br/><a href="libxml2-xpointer.html">xpointer</a> - API to handle XML Pointers<br/></p>
+    <p><a href="libxml2-DOCBparser.html">DOCBparser</a> - old DocBook SGML parser<br/><a href="libxml2-HTMLparser.html">HTMLparser</a> - interface for an HTML 4.0 non-verifying parser<br/><a href="libxml2-HTMLtree.html">HTMLtree</a> - specific APIs to process HTML tree, especially serialization<br/><a href="libxml2-SAX.html">SAX</a> - Old SAX version 1 handler, deprecated<br/><a href="libxml2-SAX2.html">SAX2</a> - SAX2 parser interface used to build the DOM tree<br/><a href="libxml2-c14n.html">c14n</a> - Provide Canonical XML and Exclusive XML Canonicalization<br/><a href="libxml2-catalog.html">catalog</a> - interfaces to the Catalog handling system<br/><a href="libxml2-chvalid.html">chvalid</a> - Unicode character range checking<br/><a href="libxml2-debugXML.html">debugXML</a> - Tree debugging APIs<br/><a href="libxml2-dict.html">dict</a> - string dictionary<br/><a href="libxml2-encoding.html">encoding</a> - interface for the encoding conversion functions<br/><a href="libxml2-entities.html">entities</a> - interface for the XML entities handling<br/><a href="libxml2-globals.html">globals</a> - interface for all global variables of the library<br/><a href="libxml2-hash.html">hash</a> - Chained hash tables<br/><a href="libxml2-list.html">list</a> - lists interfaces<br/><a href="libxml2-nanoftp.html">nanoftp</a> - minimal FTP implementation<br/><a href="libxml2-nanohttp.html">nanohttp</a> - minimal HTTP implementation<br/><a href="libxml2-parser.html">parser</a> - the core parser module<br/><a href="libxml2-parserInternals.html">parserInternals</a> - internals routines and limits exported by the parser.<br/><a href="libxml2-pattern.html">pattern</a> - pattern expression handling<br/><a href="libxml2-relaxng.html">relaxng</a> - implementation of the Relax-NG validation<br/><a href="libxml2-schemasInternals.html">schemasInternals</a> - internal interfaces for XML Schemas<br/><a href="libxml2-schematron.html">schematron</a> - XML Schemastron implementation<br/><a href="libxml2-threads.html">threads</a> - interfaces for thread handling<br/><a href="libxml2-tree.html">tree</a> - interfaces for tree manipulation<br/><a href="libxml2-uri.html">uri</a> - library of generic URI related routines<br/><a href="libxml2-valid.html">valid</a> - The DTD validation<br/><a href="libxml2-xinclude.html">xinclude</a> - implementation of XInclude<br/><a href="libxml2-xlink.html">xlink</a> - unfinished XLink detection module<br/><a href="libxml2-xmlIO.html">xmlIO</a> - interface for the I/O interfaces used by the parser<br/><a href="libxml2-xmlautomata.html">xmlautomata</a> - API to build regexp automata<br/><a href="libxml2-xmlerror.html">xmlerror</a> - error handling<br/><a href="libxml2-xmlexports.html">xmlexports</a> - macros for marking symbols as exportable/importable.<br/><a href="libxml2-xmlmemory.html">xmlmemory</a> - interface for the memory allocator<br/><a href="libxml2-xmlmodule.html">xmlmodule</a> - dynamic module loading<br/><a href="libxml2-xmlreader.html">xmlreader</a> - the XMLReader implementation<br/><a href="libxml2-xmlregexp.html">xmlregexp</a> - regular expressions handling<br/><a href="libxml2-xmlsave.html">xmlsave</a> - the XML document serializer<br/><a href="libxml2-xmlschemas.html">xmlschemas</a> - incomplete XML Schemas structure implementation<br/><a href="libxml2-xmlschemastypes.html">xmlschemastypes</a> - implementation of XML Schema Datatypes<br/><a href="libxml2-xmlstring.html">xmlstring</a> - set of routines to process strings<br/><a href="libxml2-xmlunicode.html">xmlunicode</a> - Unicode character APIs<br/><a href="libxml2-xmlversion.html">xmlversion</a> - compile-time version information<br/><a href="libxml2-xmlwriter.html">xmlwriter</a> - text writing API for XML<br/><a href="libxml2-xpath.html">xpath</a> - XML Path Language implementation<br/><a href="libxml2-xpathInternals.html">xpathInternals</a> - internal interfaces for XML Path Language implementation<br/><a href="libxml2-xpointer.html">xpointer</a> - API to handle XML Pointers<br/></p>
   </body>
 </html>
index f170340..ec5d113 100644 (file)
@@ -96,11 +96,11 @@ void        <a href="#htmlDocContentDumpOutput">htmlDocContentDumpOutput</a>        (<a href="
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlDocContentDumpFormatOutput"/>htmlDocContentDumpFormatOutput ()</h3><pre class="programlisting">void   htmlDocContentDumpFormatOutput  (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/>                                        <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br/>                                  const char * encoding, <br/>                                    int format)<br/>
 </pre><p>Dump an HTML document.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlDocContentDumpOutput"/>htmlDocContentDumpOutput ()</h3><pre class="programlisting">void       htmlDocContentDumpOutput        (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/>                                        <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br/>                                  const char * encoding)<br/>
 </pre><p>Dump an HTML document. Formatting return/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlDocDump"/>htmlDocDump ()</h3><pre class="programlisting">int  htmlDocDump                     (FILE * f, <br/>                                         <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br/>
 </pre><p>Dump an HTML document to an open FILE.</p>
@@ -144,11 +144,11 @@ void      <a href="#htmlDocContentDumpOutput">htmlDocContentDumpOutput</a>        (<a href="
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlNodeDumpFormatOutput"/>htmlNodeDumpFormatOutput ()</h3><pre class="programlisting">void       htmlNodeDumpFormatOutput        (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/>                                        <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                  <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br/>                                        const char * encoding, <br/>                                    int format)<br/>
 </pre><p>Dump an HTML node, recursive behaviour,children are printed too.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlNodeDumpOutput"/>htmlNodeDumpOutput ()</h3><pre class="programlisting">void   htmlNodeDumpOutput              (<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br/>                                        <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                  <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br/>                                        const char * encoding)<br/>
 </pre><p>Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlSaveFile"/>htmlSaveFile ()</h3><pre class="programlisting">int        htmlSaveFile                    (const char * filename, <br/>                                    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br/>
 </pre><p>Dump an HTML document to a file. If @filename is "-" the stdout file is used.</p>
index e80199e..627e55e 100644 (file)
@@ -130,7 +130,7 @@ void        <a href="#xmlSAX2EntityDecl">xmlSAX2EntityDecl</a>              (void * ctx, <br/>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSAX2EndElementNs"/>xmlSAX2EndElementNs ()</h3><pre class="programlisting">void xmlSAX2EndElementNs             (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/>                                   const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/>                                      const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI)<br/>
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p>
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSAX2EntityDecl"/>xmlSAX2EntityDecl ()</h3><pre class="programlisting">void     xmlSAX2EntityDecl               (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/>                                        int type, <br/>                                         const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br/>                                    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br/>                                    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br/>
@@ -226,7 +226,7 @@ void        <a href="#xmlSAX2EntityDecl">xmlSAX2EntityDecl</a>              (void * ctx, <br/>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSAX2StartElementNs"/>xmlSAX2StartElementNs ()</h3><pre class="programlisting">void     xmlSAX2StartElementNs           (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/>                                   const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/>                                      const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br/>                                         int nb_namespaces, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br/>                                         int nb_attributes, <br/>                                        int nb_defaulted, <br/>                                         const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** attributes)<br/>
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p>
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes.</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml2-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSAX2UnparsedEntityDecl"/>xmlSAX2UnparsedEntityDecl ()</h3><pre class="programlisting">void     xmlSAX2UnparsedEntityDecl       (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br/>                                    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br/>                                    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * notationName)<br/>
index 0eefb4e..8eb2e48 100644 (file)
@@ -152,7 +152,7 @@ void        <a href="#xmlShell">xmlShell</a>                        (<a href="libxml2-tree.html#xmlDocPtr">x
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>the indentation level.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlDebugDumpString"/>xmlDebugDumpString ()</h3><pre class="programlisting">void   xmlDebugDumpString              (FILE * output, <br/>                                    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str)<br/>
-</pre><p>Dumps informations about the string, shorten it if necessary</p>
+</pre><p>Dumps information about the string, shorten it if necessary</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlLsCountNode"/>xmlLsCountNode ()</h3><pre class="programlisting">int    xmlLsCountNode                  (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
@@ -176,7 +176,7 @@ void        <a href="#xmlShell">xmlShell</a>                        (<a href="libxml2-tree.html#xmlDocPtr">x
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlShellDir"/>xmlShellDir ()</h3><pre class="programlisting">int  xmlShellDir                     (<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br/>                                         char * arg, <br/>                                       <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br/>                                       <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br/>
-</pre><p>Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content).</p>
+</pre><p>Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlShellDu"/>xmlShellDu ()</h3><pre class="programlisting">int    xmlShellDu                      (<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br/>                                         char * arg, <br/>                                       <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br/>                                       <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br/>
index 0190bd3..23d1029 100644 (file)
@@ -146,11 +146,11 @@ const char *      <a href="#xmlGetCharEncodingName">xmlGetCharEncodingName</a>    (<a hr
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="UTF8Toisolat1"/>UTF8Toisolat1 ()</h3><pre class="programlisting">int      UTF8Toisolat1                   (unsigned char * out, <br/>                                      int * outlen, <br/>                                     const unsigned char * in, <br/>                                         int * inlen)<br/>
 </pre><p>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="isolat1ToUTF8"/>isolat1ToUTF8 ()</h3><pre class="programlisting">int      isolat1ToUTF8                   (unsigned char * out, <br/>                                      int * outlen, <br/>                                     const unsigned char * in, <br/>                                         int * inlen)<br/>
 </pre><p>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlAddEncodingAlias"/>xmlAddEncodingAlias ()</h3><pre class="programlisting">int  xmlAddEncodingAlias             (const char * name, <br/>                                        const char * alias)<br/>
 </pre><p>Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</p>
index 07e10f3..4713253 100644 (file)
@@ -98,16 +98,16 @@ void        <a href="#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a>              (void);
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the code number, or 0</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCleanup"/>xmlNanoFTPCleanup ()</h3><pre class="programlisting">void     xmlNanoFTPCleanup               (void)<br/>
-</pre><p>Cleanup the FTP protocol layer. This cleanup proxy informations.</p>
+</pre><p>Cleanup the FTP protocol layer. This cleanup proxy information.</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPClose"/>xmlNanoFTPClose ()</h3><pre class="programlisting">int  xmlNanoFTPClose                 (void * ctx)<br/>
 </pre><p>Close the connection and both control and transport</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCloseConnection"/>xmlNanoFTPCloseConnection ()</h3><pre class="programlisting">int      xmlNanoFTPCloseConnection       (void * ctx)<br/>
 </pre><p>Close the data connection from the server</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPConnect"/>xmlNanoFTPConnect ()</h3><pre class="programlisting">int      xmlNanoFTPConnect               (void * ctx)<br/>
 </pre><p>Tries to open a control connection</p>
@@ -119,11 +119,11 @@ void      <a href="#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a>              (void);
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPCwd"/>xmlNanoFTPCwd ()</h3><pre class="programlisting">int      xmlNanoFTPCwd                   (void * ctx, <br/>                                       const char * directory)<br/>
 </pre><p>Tries to change the remote directory</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPDele"/>xmlNanoFTPDele ()</h3><pre class="programlisting">int    xmlNanoFTPDele                  (void * ctx, <br/>                                       const char * file)<br/>
 </pre><p>Tries to delete an item (file or directory) from server</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPFreeCtxt"/>xmlNanoFTPFreeCtxt ()</h3><pre class="programlisting">void   xmlNanoFTPFreeCtxt              (void * ctx)<br/>
 </pre><p>Frees the context after closing the connection.</p>
@@ -131,11 +131,11 @@ void      <a href="#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a>              (void);
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGet"/>xmlNanoFTPGet ()</h3><pre class="programlisting">int      xmlNanoFTPGet                   (void * ctx, <br/>                                       <a href="libxml2-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, <br/>                                      void * userData, <br/>                                  const char * filename)<br/>
 </pre><p>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetConnection"/>xmlNanoFTPGetConnection ()</h3><pre class="programlisting"><a href="libxml2-nanoftp.html#SOCKET">SOCKET</a>     xmlNanoFTPGetConnection         (void * ctx)<br/>
 </pre><p>Try to open a data connection to the server. Currently only passive mode is supported.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPGetResponse"/>xmlNanoFTPGetResponse ()</h3><pre class="programlisting">int      xmlNanoFTPGetResponse           (void * ctx)<br/>
 </pre><p>Get the response from the FTP server after a command.</p>
@@ -146,12 +146,12 @@ void      <a href="#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a>              (void);
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve (or NULL if path is in context).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the socket for the data connection, or &lt;0 in case of error</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPInit"/>xmlNanoFTPInit ()</h3><pre class="programlisting">void   xmlNanoFTPInit                  (void)<br/>
-</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</p>
+</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPList"/>xmlNanoFTPList ()</h3><pre class="programlisting">int    xmlNanoFTPList                  (void * ctx, <br/>                                       <a href="libxml2-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br/>                                      void * userData, <br/>                                  const char * filename)<br/>
 </pre><p>Do a listing on the server. All files info are passed back in the callbacks.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPNewCtxt"/>xmlNanoFTPNewCtxt ()</h3><pre class="programlisting">void *   xmlNanoFTPNewCtxt               (const char * URL)<br/>
 </pre><p>Allocate and initialize a new FTP context.</p>
@@ -162,7 +162,7 @@ void        <a href="#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a>              (void);
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL to the resource</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context, or NULL</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPProxy"/>xmlNanoFTPProxy ()</h3><pre class="programlisting">void xmlNanoFTPProxy                 (const char * host, <br/>                                        int port, <br/>                                         const char * user, <br/>                                        const char * passwd, <br/>                                      int type)<br/>
-</pre><p>Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
+</pre><p>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>host</tt></i>:</span></td><td>the proxy host name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the proxy port</td></tr><tr><td><span class="term"><i><tt>user</tt></i>:</span></td><td>the proxy user name</td></tr><tr><td><span class="term"><i><tt>passwd</tt></i>:</span></td><td>the proxy password</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the type of proxy 1 for using SITE, 2 for USER a@b</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPQuit"/>xmlNanoFTPQuit ()</h3><pre class="programlisting">int    xmlNanoFTPQuit                  (void * ctx)<br/>
@@ -174,7 +174,7 @@ void        <a href="#xmlNanoFTPCleanup">xmlNanoFTPCleanup</a>              (void);
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the FTP context</td></tr><tr><td><span class="term"><i><tt>dest</tt></i>:</span></td><td>a buffer</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the buffer length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPScanProxy"/>xmlNanoFTPScanProxy ()</h3><pre class="programlisting">void xmlNanoFTPScanProxy             (const char * URL)<br/>
-</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoFTPUpdateURL"/>xmlNanoFTPUpdateURL ()</h3><pre class="programlisting">int  xmlNanoFTPUpdateURL             (void * ctx, <br/>                                       const char * URL)<br/>
index 075ae48..c771e09 100644 (file)
@@ -90,10 +90,10 @@ int <a href="#xmlNanoHTTPReturnCode">xmlNanoHTTPReturnCode</a>              (void * ctx);
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPFetch"/>xmlNanoHTTPFetch ()</h3><pre class="programlisting">int        xmlNanoHTTPFetch                (const char * URL, <br/>                                         const char * filename, <br/>                                    char ** contentType)<br/>
 </pre><p>This function try to fetch the indicated resource via HTTP GET and save it's content in the file.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPInit"/>xmlNanoHTTPInit ()</h3><pre class="programlisting">void xmlNanoHTTPInit                 (void)<br/>
-</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy informations</p>
+</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy information</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPMethod"/>xmlNanoHTTPMethod ()</h3><pre class="programlisting">void *   xmlNanoHTTPMethod               (const char * URL, <br/>                                         const char * method, <br/>                                      const char * input, <br/>                                       char ** contentType, <br/>                                      const char * headers, <br/>                                     int ilen)<br/>
@@ -130,10 +130,10 @@ int       <a href="#xmlNanoHTTPReturnCode">xmlNanoHTTPReturnCode</a>              (void * ctx);
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPSave"/>xmlNanoHTTPSave ()</h3><pre class="programlisting">int  xmlNanoHTTPSave                 (void * ctxt, <br/>                                      const char * filename)<br/>
 </pre><p>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNanoHTTPScanProxy"/>xmlNanoHTTPScanProxy ()</h3><pre class="programlisting">void       xmlNanoHTTPScanProxy            (const char * URL)<br/>
-</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div></div>
         <hr/>
       </div>
index 601c54d..8cd6a70 100644 (file)
@@ -55,6 +55,7 @@ typedef <a href="libxml2-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a> *
 typedef struct _xmlParserNodeInfoSeq <a href="#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>;
 typedef enum <a href="#xmlFeature">xmlFeature</a>;
 typedef enum <a href="#xmlParserMode">xmlParserMode</a>;
+typedef struct _xmlStartTag <a href="#xmlStartTag">xmlStartTag</a>;
 typedef enum <a href="#xmlParserOption">xmlParserOption</a>;
 typedef <a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> * <a href="#xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>;
 typedef struct _xmlParserNodeInfo <a href="#xmlParserNodeInfo">xmlParserNodeInfo</a>;
@@ -352,6 +353,12 @@ void       <a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>    (<a hr
 </pre><p/>
 </div>
         <hr/>
+        <div class="refsect2" lang="en"><h3><a name="xmlStartTag">Structure </a>xmlStartTag</h3><pre class="programlisting">struct _xmlStartTag {
+The content of this structure is not made public by the API.
+} xmlStartTag;
+</pre><p/>
+</div>
+        <hr/>
         <div class="refsect2" lang="en"><h3><a name="attributeDeclSAXFunc"/>Function type attributeDeclSAXFunc</h3><pre class="programlisting">void    attributeDeclSAXFunc            (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br/>                                    int type, <br/>                                         int def, <br/>                                  const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br/>                                        <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)<br/>
 </pre><p>An <a href="libxml2-SAX.html#attribute">attribute</a> definition has been parsed.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the name of the element</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the <a href="libxml2-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>def</tt></i>:</span></td><td>the type of default value</td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>:</span></td><td>the <a href="libxml2-SAX.html#attribute">attribute</a> default value</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>the tree of enumerated value set</td></tr></tbody></table></div></div>
@@ -381,7 +388,7 @@ void        <a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>    (<a hr
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="endElementNsSAX2Func"/>Function type endElementNsSAX2Func</h3><pre class="programlisting">void    endElementNsSAX2Func            (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/>                                   const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/>                                      const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI)<br/>
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p>
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="endElementSAXFunc"/>Function type endElementSAXFunc</h3><pre class="programlisting">void  endElementSAXFunc               (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br/>
@@ -457,7 +464,7 @@ void        <a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>    (<a hr
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="startElementNsSAX2Func"/>Function type startElementNsSAX2Func</h3><pre class="programlisting">void        startElementNsSAX2Func          (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localname, <br/>                                   const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br/>                                      const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br/>                                         int nb_namespaces, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br/>                                         int nb_attributes, <br/>                                        int nb_defaulted, <br/>                                         const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** attributes)<br/>
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p>
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes. The defaulted ones are at the end of the array</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml2-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="startElementSAXFunc"/>Function type startElementSAXFunc</h3><pre class="programlisting">void      startElementSAXFunc             (void * ctx, <br/>                                       const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** atts)<br/>
@@ -598,11 +605,11 @@ void      <a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>    (<a hr
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseBalancedChunkMemory"/>xmlParseBalancedChunkMemory ()</h3><pre class="programlisting">int  xmlParseBalancedChunkMemory     (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                  <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/>                                    void * user_data, <br/>                                         int depth, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string, <br/>                                      <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br/>
 </pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseBalancedChunkMemoryRecover"/>xmlParseBalancedChunkMemoryRecover ()</h3><pre class="programlisting">int    xmlParseBalancedChunkMemoryRecover      (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                          <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/>                                            void * user_data, <br/>                                                 int depth, <br/>                                                const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string, <br/>                                              <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br/>                                              int recover)<br/>
 </pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseChunk"/>xmlParseChunk ()</h3><pre class="programlisting">int      xmlParseChunk                   (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/>                                   const char * chunk, <br/>                                       int size, <br/>                                         int terminate)<br/>
 </pre><p>Parse a Chunk of memory</p>
@@ -634,7 +641,7 @@ void        <a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>    (<a hr
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseExternalEntity"/>xmlParseExternalEntity ()</h3><pre class="programlisting">int    xmlParseExternalEntity          (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                  <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/>                                    void * user_data, <br/>                                         int depth, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URL, <br/>                                         const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ID, <br/>                                  <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br/>
 </pre><p>Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseFile"/>xmlParseFile ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>        xmlParseFile            (const char * filename)<br/>
 </pre><p>parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
index 2fca6bd..989963d 100644 (file)
@@ -327,7 +327,7 @@ void        <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a>            (<a href="libxml2-tre
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>a free form C string describing the HTML document encoding, or NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new parser context or NULL</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="htmlInitAutoClose"/>htmlInitAutoClose ()</h3><pre class="programlisting">void     htmlInitAutoClose               (void)<br/>
-</pre><p>Initialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs.</p>
+</pre><p>This is a no-op now.</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="inputPop"/>inputPop ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>        inputPop        (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
@@ -392,7 +392,7 @@ void        <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a>            (<a href="libxml2-tre
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlErrMemory"/>xmlErrMemory ()</h3><pre class="programlisting">void       xmlErrMemory                    (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/>                                   const char * extra)<br/>
 </pre><p>Handle a redefinition of <a href="libxml2-SAX.html#attribute">attribute</a> error</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra informations</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra information</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlFreeInputStream"/>xmlFreeInputStream ()</h3><pre class="programlisting">void   xmlFreeInputStream              (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br/>
 </pre><p>Free up an input stream.</p>
@@ -471,7 +471,7 @@ void        <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a>            (<a href="libxml2-tre
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseContent"/>xmlParseContent ()</h3><pre class="programlisting">void xmlParseContent                 (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
-</pre><p>Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
+</pre><p>Parse a content sequence. Stops at EOF or '&lt;/'. [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParseDefaultDecl"/>xmlParseDefaultDecl ()</h3><pre class="programlisting">int  xmlParseDefaultDecl             (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/>                                   <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** value)<br/>
index 128ff3a..07aa9a3 100644 (file)
@@ -205,7 +205,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGGetValidErrors"/>xmlRelaxNGGetValidErrors ()</h3><pre class="programlisting">int        xmlRelaxNGGetValidErrors        (<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br/>                                         <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br/>                                    void ** ctx)<br/>
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGInitTypes"/>xmlRelaxNGInitTypes ()</h3><pre class="programlisting">int  xmlRelaxNGInitTypes             (void)<br/>
@@ -241,7 +241,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGSetValidErrors"/>xmlRelaxNGSetValidErrors ()</h3><pre class="programlisting">void       xmlRelaxNGSetValidErrors        (<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br/>                                   <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br/>                                      void * ctx)<br/>
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxNGSetValidStructuredErrors"/>xmlRelaxNGSetValidStructuredErrors ()</h3><pre class="programlisting">void   xmlRelaxNGSetValidStructuredErrors      (<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br/>                                            <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br/>                                                 void * ctx)<br/>
@@ -269,7 +269,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a document instance</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>an element instance</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if no validation problem was found or 0 if validating the element requires a full node, and -1 in case of error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRelaxParserSetFlag"/>xmlRelaxParserSetFlag ()</h3><pre class="programlisting">int      xmlRelaxParserSetFlag           (<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br/>                                  int flags)<br/>
-</pre><p>Semi private function used to pass informations to a parser context which are a combination of <a href="libxml2-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
+</pre><p>Semi private function used to pass information to a parser context which are a combination of <a href="libxml2-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a RelaxNG parser context</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of flags values</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if success and -1 in case of error</td></tr></tbody></table></div></div>
         <hr/>
       </div>
index 546844d..8d60f11 100644 (file)
@@ -326,7 +326,7 @@ void        <a href="#xmlFreeNsList">xmlFreeNsList</a>                      (<a href="libxml2-tree.html#xm
     struct _xmlDoc *   doc     : the containing document
     <a href="libxml2-tree.html#xmlNs">xmlNs</a> *      ns      : pointer to the associated namespace
     <a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a>  atype   : the <a href="libxml2-SAX.html#attribute">attribute</a> type if validating
-    void *     psvi    : for type/PSVI informations
+    void *     psvi    : for type/PSVI information
 } xmlAttr;
 </pre><p/>
 </div>
@@ -454,7 +454,7 @@ The content of this structure is not made public by the API.
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *       URL     : The URI for that document
     int        charset : Internal flag for charset handling, actually an <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a>
     struct _xmlDict *  dict    : dict used to allocate names or NULL
-    void *     psvi    : for type/PSVI informations
+    void *     psvi    : for type/PSVI information
     int        parseFlags      : set of <a href="libxml2-parser.html#xmlParserOption">xmlParserOption</a> used to parse the document
     int        properties      : set of <a href="libxml2-tree.html#xmlDocProperties">xmlDocProperties</a> for this document set at the end of parsing
 } xmlDoc;
@@ -665,7 +665,7 @@ The content of this structure is not made public by the API.
     <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *     content : the content
     struct _xmlAttr *  properties      : properties list
     <a href="libxml2-tree.html#xmlNs">xmlNs</a> *      nsDef   : namespace definitions on this node
-    void *     psvi    : for type/PSVI informations
+    void *     psvi    : for type/PSVI information
     unsigned short     line    : line number
     unsigned short     extra   : extra data for XPath/XSLT
 } xmlNode;
@@ -758,7 +758,7 @@ The content of this structure is not made public by the API.
     int        nameNr  : Depth of the parsing stack
     int        nameMax : Max depth of the parsing stack
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * *     nameTab : array of nodes
-    long       nbChars : number of <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> processed
+    long       nbChars : unused
     long       checkIndex      : used by progressive parsing lookup
     int        keepBlanks      : ugly but ...
     int        disableSAX      : SAX callbacks are disabled
@@ -794,7 +794,7 @@ The content of this structure is not made public by the API.
     int        nsMax   : the size of the arrays
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * *     nsTab   : the array of prefix/namespace name
     int *      attallocs       : which <a href="libxml2-SAX.html#attribute">attribute</a> were allocated
-    void * *   pushTab : array of data for push
+    <a href="libxml2-parser.html#xmlStartTag">xmlStartTag</a> *        pushTab : array of data for push
     <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>    attsDefault     : defaulted attributes if any
     <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>    attsSpecial     : non-CDATA attributes if any
     int        nsWellFormed    : is the document XML Namespace okay
@@ -803,7 +803,7 @@ The content of this structure is not made public by the API.
     int        freeElemsNr     : number of freed element nodes
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>      freeElems       : List of freed element nodes
     int        freeAttrsNr     : number of freed attributes nodes
-    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>      freeAttrs       : * the complete error informations for the last error. *
+    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>      freeAttrs       : * the complete error information for the last error. *
     <a href="libxml2-xmlerror.html#xmlError">xmlError</a>      lastError
     <a href="libxml2-parser.html#xmlParserMode">xmlParserMode</a>      parseMode       : the parser mode
     unsigned long      nbentities      : number of entities references
@@ -1317,7 +1317,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the target document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the processing instruction name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the PI content</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNewDocProp"/>xmlNewDocProp ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>    xmlNewDocProp           (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                  const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br/>
-</pre><p>Create a new property carried by a document.</p>
+</pre><p>Create a new property carried by a document. NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need entities support.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the <a href="libxml2-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>the value of the <a href="libxml2-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the <a href="libxml2-SAX.html#attribute">attribute</a></td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlNewDocRawNode"/>xmlNewDocRawNode ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>      xmlNewDocRawNode        (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/>                                  <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br/>                                     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/>                                        const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br/>
index 12a61d5..140fb40 100644 (file)
@@ -144,7 +144,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an XML document</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of <a href="libxml2-parser.html#xmlParserOption">xmlParserOption</a> used for parsing XML includes</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>application data that will be passed to the parser context in the _private field of the parser context(s)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlXIncludeProcessNode"/>xmlXIncludeProcessNode ()</h3><pre class="programlisting">int    xmlXIncludeProcessNode          (<a href="libxml2-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br/>                                   <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
-</pre><p>Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.</p>
+</pre><p>Implement the XInclude substitution for the given subtree reusing the information and data coming from the given context.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an existing XInclude context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node in an XML document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlXIncludeProcessTree"/>xmlXIncludeProcessTree ()</h3><pre class="programlisting">int    xmlXIncludeProcessTree          (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree)<br/>
index 91d0ea6..8597f4d 100644 (file)
@@ -47,6 +47,7 @@
 typedef int <a href="#xmlInputMatchCallback">xmlInputMatchCallback</a>         (char const * filename);
 void   <a href="#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a>      (void);
 int    <a href="#xmlFileClose">xmlFileClose</a>                        (void * context);
+int    <a href="#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a>              (void);
 typedef int <a href="#xmlOutputMatchCallback">xmlOutputMatchCallback</a>               (char const * filename);
 int    <a href="#xmlParserInputBufferPush">xmlParserInputBufferPush</a>        (<a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br/>                                       int len, <br/>                                  const char * buf);
 int    <a href="#xmlIOFTPRead">xmlIOFTPRead</a>                        (void * context, <br/>                                   char * buffer, <br/>                                    int len);
@@ -321,6 +322,10 @@ void *     <a href="#xmlIOHTTPOpenW">xmlIOHTTPOpenW</a>                    (const char * post_uri, <b
 </pre><p>Clear the top input callback from the input stack. this includes the compiled-in I/O.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of input callback registered or -1 in case of error.</td></tr></tbody></table></div></div>
         <hr/>
+        <div class="refsect2" lang="en"><h3><a name="xmlPopOutputCallbacks"/>xmlPopOutputCallbacks ()</h3><pre class="programlisting">int      xmlPopOutputCallbacks           (void)<br/>
+</pre><p>Remove the top output callbacks from the output stack. This includes the compiled-in I/O.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of output callback registered or -1 in case of error.</td></tr></tbody></table></div></div>
+        <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRegisterDefaultInputCallbacks"/>xmlRegisterDefaultInputCallbacks ()</h3><pre class="programlisting">void       xmlRegisterDefaultInputCallbacks        (void)<br/>
 </pre><p>Registers the default compiled-in I/O handlers.</p>
 </div>
index a663b0d..f6e5a01 100644 (file)
@@ -916,7 +916,7 @@ void        <a href="#xmlResetError">xmlResetError</a>                      (<a href="libxml2-xmlerror.htm
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParserPrintFileInfo"/>xmlParserPrintFileInfo ()</h3><pre class="programlisting">void   xmlParserPrintFileInfo          (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br/>
-</pre><p>Displays the associated file and line informations for the current input</p>
+</pre><p>Displays the associated file and line information for the current input</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlParserValidityError"/>xmlParserValidityError ()</h3><pre class="programlisting">void   xmlParserValidityError          (void * ctx, <br/>                                       const char * msg, <br/>                                         ... ...)<br/>
index a596490..2ac2daf 100644 (file)
     </h2>
     <p>xmlexports - macros for marking symbols as exportable/importable.</p>
     <p>macros for marking symbols as exportable/importable. </p>
-    <p>Author(s): Igor Zlatovic &lt;igor@zlatkovic.com&gt; </p>
+    <p>Author(s): </p>
     <div class="refsynopsisdiv">
       <h2>Synopsis</h2>
-      <pre class="synopsis">#define <a href="#XMLCALL">XMLCALL</a>;
+      <pre class="synopsis">#define <a href="#XMLCDECL">XMLCDECL</a>;
+#define <a href="#XMLPUBLIC">XMLPUBLIC</a>;
 #define <a href="#XMLPUBVAR">XMLPUBVAR</a>;
-#define <a href="#XMLCDECL">XMLCDECL</a>;
-#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
 #define <a href="#LIBXML_DLL_IMPORT">LIBXML_DLL_IMPORT</a>;
+#define <a href="#XMLCALL">XMLCALL</a>;
+#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
 </pre>
     </div>
     <div class="refsect1" lang="en">
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="XMLCALL">Macro </a>XMLCALL</h3><pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a>;
-</pre><p/>
+</pre><p>Macro which declares the calling convention for exported functions</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="XMLCDECL">Macro </a>XMLCDECL</h3><pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a>;
-</pre><p/>
+</pre><p>Macro which declares the calling convention for exported functions that use '...'.</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="XMLPUBFUN">Macro </a>XMLPUBFUN</h3><pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
-</pre><p/>
+</pre><p>Macro which declares an exportable function</p>
+</div>
+        <hr/>
+        <div class="refsect2" lang="en"><h3><a name="XMLPUBLIC">Macro </a>XMLPUBLIC</h3><pre class="programlisting">#define <a href="#XMLPUBLIC">XMLPUBLIC</a>;
+</pre><p>Macro which declares a public symbol</p>
 </div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="XMLPUBVAR">Macro </a>XMLPUBVAR</h3><pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a>;
-</pre><p/>
+</pre><p>Macro which declares an exportable variable</p>
 </div>
         <hr/>
       </div>
index e72c29d..a000d56 100644 (file)
@@ -464,7 +464,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libxml2-xmlreader.html#xmlReaderTypes">xmlReaderTypes</a> of the current node or -1 in case of error</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlTextReaderNormalization"/>xmlTextReaderNormalization ()</h3><pre class="programlisting">int    xmlTextReaderNormalization      (<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br/>
-</pre><p>The value indicating whether to normalize white space and <a href="libxml2-SAX.html#attribute">attribute</a> values. Since <a href="libxml2-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</p>
+</pre><p>The value indicating whether to normalize white space and <a href="libxml2-SAX.html#attribute">attribute</a> values. Since <a href="libxml2-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 or -1 in case of error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlTextReaderPrefix"/>xmlTextReaderPrefix ()</h3><pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *       xmlTextReaderPrefix     (<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br/>
index 4fc33c6..cf13627 100644 (file)
@@ -231,11 +231,11 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the expressions context</td></tr><tr><td><span class="term"><i><tt>exp</tt></i>:</span></td><td>the englobing expression</td></tr><tr><td><span class="term"><i><tt>sub</tt></i>:</span></td><td>the subexpression</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if true 0 if false and -1 in case of failure.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRegExecErrInfo"/>xmlRegExecErrInfo ()</h3><pre class="programlisting">int      xmlRegExecErrInfo               (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/>                                    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** string, <br/>                                     int * nbval, <br/>                                      int * nbneg, <br/>                                      <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br/>                                   int * terminal)<br/>
-</pre><p>Extract error informations from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context generating an error</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>return value for the error string</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRegExecNextValues"/>xmlRegExecNextValues ()</h3><pre class="programlisting">int        xmlRegExecNextValues            (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/>                                    int * nbval, <br/>                                      int * nbneg, <br/>                                      <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br/>                                   int * terminal)<br/>
-</pre><p>Extract informations from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlRegExecPushString"/>xmlRegExecPushString ()</h3><pre class="programlisting">int        xmlRegExecPushString            (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/>                                    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br/>                                       void * data)<br/>
index f006e3b..6e851de 100644 (file)
@@ -55,7 +55,7 @@ int   <a href="#xmlSaveSetAttrEscape">xmlSaveSetAttrEscape</a>                (<a href="libxml2-
 int    <a href="#xmlSaveFlush">xmlSaveFlush</a>                        (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt);
 long   <a href="#xmlSaveDoc">xmlSaveDoc</a>                    (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
 int    <a href="#xmlSaveSetEscape">xmlSaveSetEscape</a>                (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escape);
-long   <a href="#xmlSaveTree">xmlSaveTree</a>                  (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
+long   <a href="#xmlSaveTree">xmlSaveTree</a>                  (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur);
 </pre>
     </div>
     <div class="refsect1" lang="en">
@@ -123,9 +123,9 @@ The content of this structure is not made public by the API.
 </pre><p>Create a document saving context serializing to a file descriptor with the encoding and the options given</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>iowrite</tt></i>:</span></td><td>an I/O write function</td></tr><tr><td><span class="term"><i><tt>ioclose</tt></i>:</span></td><td>an I/O close function</td></tr><tr><td><span class="term"><i><tt>ioctx</tt></i>:</span></td><td>an I/O handler</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div></div>
         <hr/>
-        <div class="refsect2" lang="en"><h3><a name="xmlSaveTree"/>xmlSaveTree ()</h3><pre class="programlisting">long xmlSaveTree                     (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
+        <div class="refsect2" lang="en"><h3><a name="xmlSaveTree"/>xmlSaveTree ()</h3><pre class="programlisting">long xmlSaveTree                     (<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br/>                                    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br/>
 </pre><p>Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the top node of the subtree to save</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div></div>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div></div>
         <hr/>
       </div>
     </div>
index 140558b..4bac771 100644 (file)
@@ -193,7 +193,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityLocatorFunc"/>Function type xmlSchemaValidityLocatorFunc</h3><pre class="programlisting">int     xmlSchemaValidityLocatorFunc    (void * ctx, <br/>                                       const char ** file, <br/>                                       unsigned long * line)<br/>
-</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected</p>
+</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>user provided context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>returned file information</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>returned line information</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityWarningFunc"/>Function type xmlSchemaValidityWarningFunc</h3><pre class="programlisting">void    xmlSchemaValidityWarningFunc    (void * ctx, <br/>                                       const char * msg, <br/>                                         ... ...)<br/>
@@ -221,7 +221,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XMl-Schema parser context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaGetValidErrors"/>xmlSchemaGetValidErrors ()</h3><pre class="programlisting">int  xmlSchemaGetValidErrors         (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>                                   <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br/>                                        <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br/>                                   void ** ctx)<br/>
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XML-Schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaIsValid"/>xmlSchemaIsValid ()</h3><pre class="programlisting">int        xmlSchemaIsValid                (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
@@ -265,7 +265,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidErrors"/>xmlSchemaSetValidErrors ()</h3><pre class="programlisting">void xmlSchemaSetValidErrors         (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>                                   <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br/>                                  <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br/>                                     void * ctx)<br/>
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div></div>
         <hr/>
         <div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidOptions"/>xmlSchemaSetValidOptions ()</h3><pre class="programlisting">int        xmlSchemaSetValidOptions        (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/>                                   int options)<br/>
index 7b1d0e3..7e0965d 100644 (file)
@@ -2,7 +2,7 @@
 <html>
   <head>
     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
-    <title>xmlversion: compile-time version informations</title>
+    <title>xmlversion: compile-time version information</title>
     <meta name="generator" content="Libxml2 devhelp stylesheet"/>
     <link rel="start" href="index.html" title="libxml2 Reference Manual"/>
     <link rel="up" href="general.html" title="API"/>
@@ -38,8 +38,8 @@
     <h2>
       <span class="refentrytitle">xmlversion</span>
     </h2>
-    <p>xmlversion - compile-time version informations</p>
-    <p>compile-time version informations for the XML library </p>
+    <p>xmlversion - compile-time version information</p>
+    <p>compile-time version information for the XML library </p>
     <p>Author(s): Daniel Veillard </p>
     <div class="refsynopsisdiv">
       <h2>Synopsis</h2>
index 9be0e5a..da986e8 100644 (file)
@@ -218,8 +218,6 @@ The content of this structure is not made public by the API.
     unsigned long      opLimit
     unsigned long      opCount
     int        depth
-    int        maxDepth
-    int        maxParserDepth
 } xmlXPathContext;
 </pre><p/>
 </div>
index 2e8eab3..e929016 100644 (file)
     <function name="XMLCALL" link="libxml2-xmlexports.html#XMLCALL"/>
     <function name="XMLCDECL" link="libxml2-xmlexports.html#XMLCDECL"/>
     <function name="XMLPUBFUN" link="libxml2-xmlexports.html#XMLPUBFUN"/>
+    <function name="XMLPUBLIC" link="libxml2-xmlexports.html#XMLPUBLIC"/>
     <function name="XMLPUBVAR" link="libxml2-xmlexports.html#XMLPUBVAR"/>
     <function name="XML_CAST_FPTR" link="libxml2-hash.html#XML_CAST_FPTR"/>
     <function name="XML_CATALOGS_NAMESPACE" link="libxml2-catalog.html#XML_CATALOGS_NAMESPACE"/>
     <function name="xmlSchematronParserCtxt" link="libxml2-schematron.html#xmlSchematronParserCtxt"/>
     <function name="xmlSchematronValidCtxt" link="libxml2-schematron.html#xmlSchematronValidCtxt"/>
     <function name="xmlShellCtxt" link="libxml2-debugXML.html#xmlShellCtxt"/>
+    <function name="xmlStartTag" link="libxml2-parser.html#xmlStartTag"/>
     <function name="xmlStreamCtxt" link="libxml2-pattern.html#xmlStreamCtxt"/>
     <function name="xmlTextReader" link="libxml2-xmlreader.html#xmlTextReader"/>
     <function name="xmlTextWriter" link="libxml2-xmlwriter.html#xmlTextWriter"/>
     <function name="xmlPedanticParserDefault ()" link="libxml2-parser.html#xmlPedanticParserDefault"/>
     <function name="xmlPopInput ()" link="libxml2-parserInternals.html#xmlPopInput"/>
     <function name="xmlPopInputCallbacks ()" link="libxml2-xmlIO.html#xmlPopInputCallbacks"/>
+    <function name="xmlPopOutputCallbacks ()" link="libxml2-xmlIO.html#xmlPopOutputCallbacks"/>
     <function name="xmlPreviousElementSibling ()" link="libxml2-tree.html#xmlPreviousElementSibling"/>
     <function name="xmlPrintURI ()" link="libxml2-uri.html#xmlPrintURI"/>
     <function name="xmlPushInput ()" link="libxml2-parserInternals.html#xmlPushInput"/>
index cc791ed..4974187 100644 (file)
   </example>
   <example filename='reader1.c'>
     <synopsis>Parse an XML file with an xmlReader</synopsis>
-    <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
+    <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the information about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
     <usage>reader1 &lt;filename&gt;</usage>
     <test>reader1 test2.xml &gt; reader1.tmp &amp;&amp; diff reader1.tmp $(srcdir)/reader1.res</test>
     <author>Daniel Veillard</author>
index 9707759..f4ee119 100644 (file)
@@ -11,4 +11,4 @@ A:link, A:visited, A:active { text-decoration: underline }
     of the example:</p><ul><li><p><a href="#xmlWriter">xmlWriter</a> :</p><ul><li><a href="#testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</li></ul></li><li><p><a href="#InputOutput">InputOutput</a> :</p><ul><li><a href="#io1.c">io1.c</a>: Example of custom Input/Output</li><li><a href="#io2.c">io2.c</a>: Output to char buffer</li></ul></li><li><p><a href="#Tree">Tree</a> :</p><ul><li><a href="#tree1.c">tree1.c</a>: Navigates a tree to print element names</li><li><a href="#tree2.c">tree2.c</a>: Creates a tree</li></ul></li><li><p><a href="#XPath">XPath</a> :</p><ul><li><a href="#xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</li><li><a href="#xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</li></ul></li><li><p><a href="#Parsing">Parsing</a> :</p><ul><li><a href="#parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</li><li><a href="#parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</li><li><a href="#parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</li><li><a href="#parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</li></ul></li><li><p><a href="#xmlReader">xmlReader</a> :</p><ul><li><a href="#reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</li><li><a href="#reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</li><li><a href="#reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</li><li><a href="#reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</li></ul></li></ul><p> Getting the compilation options and libraries dependencies needed
 to generate binaries from the examples is best done on Linux/Unix by using
 the xml2-config script which should have been installed as part of <i>make
-install</i> step or when installing the libxml2 development package:</p><pre>gcc -o example `xml2-config --cflags` example.c `xml2-config --libs`</pre><h2><a name="InputOutput" id="InputOutput"></a>InputOutput Examples</h2><h3><a name="io1.c" href="io1.c" id="io1.c">io1.c</a>: Example of custom Input/Output</h3><p>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li><li><a href="../html/libxml-xmlIO.html">&lt;libxml/xmlIO.h&gt;</a></li><li><a href="../html/libxml-xinclude.html">&lt;libxml/xinclude.h&gt;</a></li><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 105: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 117: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 117: Function <a href="../html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> from xmlIO.h</li><li> line 124: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 134: Function <a href="../html/libxml-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a> from xinclude.h</li><li> line 143: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 149: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 154: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 158: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>io1</p><p>Author: Daniel Veillard</p><h3><a name="io2.c" href="io2.c" id="io2.c">io2.c</a>: Output to char buffer</h3><p>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 19: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 20: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 27: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 28: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li><li> line 30: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 36: Function <a href="../html/libxml-tree.html#xmlDocDumpFormatMemory">xmlDocDumpFormatMemory</a> from tree.h</li><li> line 43: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li></ul><p>Usage:</p><p>io2</p><p>Author: John Fleck</p><h2><a name="Parsing" id="Parsing"></a>Parsing Examples</h2><h3><a name="parse1.c" href="parse1.c" id="parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</h3><p>Demonstrate the use of xmlReadFile() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 24: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 26: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 31: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 45: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 50: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 54: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse1 test1.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse2.c" href="parse2.c" id="parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</h3><p>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 25: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 26: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a> from parser.h</li><li> line 35: Function <a href="../html/libxml-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> from parser.h</li><li> line 44: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 47: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 61: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 66: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 70: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse2 test2.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse3.c" href="parse3.c" id="parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</h3><p>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 27: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 33: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 38: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 49: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 54: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 58: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse3</p><p>Author: Daniel Veillard</p><h3><a name="parse4.c" href="parse4.c" id="parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</h3><p>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 45: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 47: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 67: Function <a href="../html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a> from parser.h</li><li> line 86: Function <a href="../html/libxml-parser.html#xmlParseChunk">xmlParseChunk</a> from parser.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 103: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 120: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 131: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 135: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse4 test3.xml</p><p>Author: Daniel Veillard</p><h2><a name="Tree" id="Tree"></a>Tree Examples</h2><h3><a name="tree1.c" href="tree1.c" id="tree1.c">tree1.c</a>: Navigates a tree to print element names</h3><p>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 67: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a> from tree.h</li></ul><p>Usage:</p><p>tree1 filename_or_URL</p><p>Author: Dodji Seketeli</p><h3><a name="tree2.c" href="tree2.c" id="tree2.c">tree2.c</a>: Creates a tree</h3><p>Shows how to create document, nodes and dump it to stdout or file.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 38: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 40: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 45: Function <a href="../html/libxml-tree.html#xmlCreateIntSubset">xmlCreateIntSubset</a> from tree.h</li><li> line 73: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlNewText">xmlNewText</a> from tree.h</li><li> line 77: Function <a href="../html/libxml-tree.html#xmlAddChild">xmlAddChild</a> from tree.h</li><li> line 87: Function <a href="../html/libxml-tree.html#xmlNewChild">xmlNewChild</a> from tree.h</li><li> line 88: Function <a href="../html/libxml-tree.html#xmlNewProp">xmlNewProp</a> from tree.h</li><li> line 95: Function <a href="../html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a> from tree.h</li></ul><p>Usage:</p><p>tree2 &lt;filename&gt;  -Default output: stdout</p><p>Author: Lucas Brasilino &lt;brasilino@recife.pe.gov.br&gt;</p><h2><a name="XPath" id="XPath"></a>XPath Examples</h2><h3><a name="xpath1.c" href="xpath1.c" id="xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</h3><p>Shows how to evaluate XPath expression and register known namespaces in XPath context.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li><li><a href="../html/libxml-xpath.html">&lt;libxml/xpath.h&gt;</a></li><li><a href="../html/libxml-xpathInternals.html">&lt;libxml/xpathInternals.h&gt;</a></li><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 39: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 101: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 117: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 129: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 130: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 156: Function <a href="../html/libxml-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li><li> line 180: Function <a href="../html/libxml-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li><li> line 186: Function <a href="../html/libxml-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li><li> line 206: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 218: Type <a href="../html/libxml-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li></ul><p>Usage:</p><p>xpath1 &lt;xml-file&gt; &lt;xpath-expr&gt; [&lt;known-ns-list&gt;]</p><p>Author: Aleksey Sanin</p><h3><a name="xpath2.c" href="xpath2.c" id="xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</h3><p>Shows how to make a full round-trip from a load/edit/save</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li><li><a href="../html/libxml-xpath.html">&lt;libxml/xpath.h&gt;</a></li><li><a href="../html/libxml-xpathInternals.html">&lt;libxml/xpathInternals.h&gt;</a></li><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 41: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 95: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 102: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 110: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 123: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 124: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 127: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 162: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li></ul><p>Usage:</p><p>xpath2 &lt;xml-file&gt; &lt;xpath-expr&gt; &lt;new-value&gt;</p><p>Author: Aleksey Sanin and Daniel Veillard</p><h2><a name="xmlReader" id="xmlReader"></a>xmlReader Examples</h2><h3><a name="reader1.c" href="reader1.c" id="reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the informations about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 29: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 33: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 36: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 39: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 44: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 59: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 67: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 69: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 89: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 98: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>reader1 &lt;filename&gt;</p><p>Author: Daniel Veillard</p><h3><a name="reader2.c" href="reader2.c" id="reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 30: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 34: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 41: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 45: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 60: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 68: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 76: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 81: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsValid">xmlTextReaderIsValid</a> from xmlreader.h</li><li> line 84: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader2 &lt;valid_xml_filename&gt;</p><p>Author: Daniel Veillard</p><h3><a name="reader3.c" href="reader3.c" id="reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</h3><p>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 32: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 43: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a> from xmlreader.h</li><li> line 52: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 66: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 96: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li></ul><p>Usage:</p><p>reader3</p><p>Author: Daniel Veillard</p><h3><a name="reader4.c" href="reader4.c" id="reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context.  (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 26: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 54: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 72: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 83: Function <a href="../html/libxml-xmlreader.html#xmlReaderNewFile">xmlReaderNewFile</a> from xmlreader.h</li><li> line 97: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 104: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader4 &lt;filename&gt; [ filename ... ]</p><p>Author: Graham Bennett</p><h2><a name="xmlWriter" id="xmlWriter"></a>xmlWriter Examples</h2><h3><a name="testWriter.c" href="testWriter.c" id="testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</h3><p>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</p><p>Includes:</p><ul><li><a href="../html/libxml-encoding.html">&lt;libxml/encoding.h&gt;</a></li><li><a href="../html/libxml-xmlwriter.html">&lt;libxml/xmlwriter.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 76: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li><li> line 341: Type <a href="../html/libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li><li> line 347: Function <a href="../html/libxml-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li><li> line 355: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li><li> line 613: Function <a href="../html/libxml-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li><li> line 632: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li><li> line 878: Type <a href="../html/libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li><li> line 880: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 885: Macro <a href="../html/libxml-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li><li> line 885: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 894: Function <a href="../html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li><li> line 901: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 904: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li><li> line 913: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li><li> line 925: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li><li> line 949: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li><li> line 959: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li><li> line 1073: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li><li> line 1096: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li><li> line 1103: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li><li> line 1111: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li><li> line 1121: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li><li> line 1127: Function <a href="../html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li><li> line 1129: Function <a href="../html/libxml-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li><li> line 1151: Type <a href="../html/libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li><li> line 1156: Function <a href="../html/libxml-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li></ul><p>Usage:</p><p>testWriter</p><p>Author: Alfred Mickautsch</p><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+install</i> step or when installing the libxml2 development package:</p><pre>gcc -o example `xml2-config --cflags` example.c `xml2-config --libs`</pre><h2><a name="InputOutput" id="InputOutput"></a>InputOutput Examples</h2><h3><a name="io1.c" href="io1.c" id="io1.c">io1.c</a>: Example of custom Input/Output</h3><p>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li><li><a href="../html/libxml-xmlIO.html">&lt;libxml/xmlIO.h&gt;</a></li><li><a href="../html/libxml-xinclude.html">&lt;libxml/xinclude.h&gt;</a></li><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 105: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 117: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 117: Function <a href="../html/libxml-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> from xmlIO.h</li><li> line 124: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 134: Function <a href="../html/libxml-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a> from xinclude.h</li><li> line 143: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 149: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 154: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 158: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>io1</p><p>Author: Daniel Veillard</p><h3><a name="io2.c" href="io2.c" id="io2.c">io2.c</a>: Output to char buffer</h3><p>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 19: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 20: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 27: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 28: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li><li> line 30: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 36: Function <a href="../html/libxml-tree.html#xmlDocDumpFormatMemory">xmlDocDumpFormatMemory</a> from tree.h</li><li> line 43: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li></ul><p>Usage:</p><p>io2</p><p>Author: John Fleck</p><h2><a name="Parsing" id="Parsing"></a>Parsing Examples</h2><h3><a name="parse1.c" href="parse1.c" id="parse1.c">parse1.c</a>: Parse an XML file to a tree and free it</h3><p>Demonstrate the use of xmlReadFile() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 24: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 26: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 31: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 45: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 50: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 54: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse1 test1.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse2.c" href="parse2.c" id="parse2.c">parse2.c</a>: Parse and validate an XML file to a tree and free the result</h3><p>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 25: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 26: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 29: Function <a href="../html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a> from parser.h</li><li> line 35: Function <a href="../html/libxml-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> from parser.h</li><li> line 44: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 47: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 61: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 66: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 70: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse2 test2.xml</p><p>Author: Daniel Veillard</p><h3><a name="parse3.c" href="parse3.c" id="parse3.c">parse3.c</a>: Parse an XML document in memory to a tree and free it</h3><p>Demonstrate the use of xmlReadMemory() to read an XML file into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 27: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 33: Function <a href="../html/libxml-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li><li> line 38: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 49: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 54: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 58: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse3</p><p>Author: Daniel Veillard</p><h3><a name="parse4.c" href="parse4.c" id="parse4.c">parse4.c</a>: Parse an XML document chunk by chunk to a tree and free it</h3><p>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and xmlFreeDoc() to free the resulting tree</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 45: Type <a href="../html/libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> from tree.h</li><li> line 47: Type <a href="../html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a> from tree.h</li><li> line 67: Function <a href="../html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a> from parser.h</li><li> line 86: Function <a href="../html/libxml-parser.html#xmlParseChunk">xmlParseChunk</a> from parser.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li><li> line 103: Function <a href="../html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li><li> line 120: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 131: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 135: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>parse4 test3.xml</p><p>Author: Daniel Veillard</p><h2><a name="Tree" id="Tree"></a>Tree Examples</h2><h3><a name="tree1.c" href="tree1.c" id="tree1.c">tree1.c</a>: Navigates a tree to print element names</h3><p>Parse a file to a tree, use xmlDocGetRootElement() to get the root element, then walk the document and print all the element name in document order.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 67: Function <a href="../html/libxml-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a> from tree.h</li></ul><p>Usage:</p><p>tree1 filename_or_URL</p><p>Author: Dodji Seketeli</p><h3><a name="tree2.c" href="tree2.c" id="tree2.c">tree2.c</a>: Creates a tree</h3><p>Shows how to create document, nodes and dump it to stdout or file.</p><p>Includes:</p><ul><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 38: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 40: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 45: Function <a href="../html/libxml-tree.html#xmlCreateIntSubset">xmlCreateIntSubset</a> from tree.h</li><li> line 73: Function <a href="../html/libxml-tree.html#xmlNewNode">xmlNewNode</a> from tree.h</li><li> line 74: Function <a href="../html/libxml-tree.html#xmlNewText">xmlNewText</a> from tree.h</li><li> line 77: Function <a href="../html/libxml-tree.html#xmlAddChild">xmlAddChild</a> from tree.h</li><li> line 87: Function <a href="../html/libxml-tree.html#xmlNewChild">xmlNewChild</a> from tree.h</li><li> line 88: Function <a href="../html/libxml-tree.html#xmlNewProp">xmlNewProp</a> from tree.h</li><li> line 95: Function <a href="../html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a> from tree.h</li></ul><p>Usage:</p><p>tree2 &lt;filename&gt;  -Default output: stdout</p><p>Author: Lucas Brasilino &lt;brasilino@recife.pe.gov.br&gt;</p><h2><a name="XPath" id="XPath"></a>XPath Examples</h2><h3><a name="xpath1.c" href="xpath1.c" id="xpath1.c">xpath1.c</a>: Evaluate XPath expression and prints result node set.</h3><p>Shows how to evaluate XPath expression and register known namespaces in XPath context.</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li><li><a href="../html/libxml-xpath.html">&lt;libxml/xpath.h&gt;</a></li><li><a href="../html/libxml-xpathInternals.html">&lt;libxml/xpathInternals.h&gt;</a></li><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 39: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 101: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 117: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 129: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 130: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 156: Function <a href="../html/libxml-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li><li> line 180: Function <a href="../html/libxml-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li><li> line 186: Function <a href="../html/libxml-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li><li> line 206: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 218: Type <a href="../html/libxml-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li></ul><p>Usage:</p><p>xpath1 &lt;xml-file&gt; &lt;xpath-expr&gt; [&lt;known-ns-list&gt;]</p><p>Author: Aleksey Sanin</p><h3><a name="xpath2.c" href="xpath2.c" id="xpath2.c">xpath2.c</a>: Load a document, locate subelements with XPath, modify said elements and save the resulting document.</h3><p>Shows how to make a full round-trip from a load/edit/save</p><p>Includes:</p><ul><li><a href="../html/libxml-parser.html">&lt;libxml/parser.h&gt;</a></li><li><a href="../html/libxml-xpath.html">&lt;libxml/xpath.h&gt;</a></li><li><a href="../html/libxml-xpathInternals.html">&lt;libxml/xpathInternals.h&gt;</a></li><li><a href="../html/libxml-tree.html">&lt;libxml/tree.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 41: Function <a href="../html/libxml-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li><li> line 87: Type <a href="../html/libxml-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li><li> line 88: Type <a href="../html/libxml-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li><li> line 95: Function <a href="../html/libxml-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li><li> line 102: Function <a href="../html/libxml-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li><li> line 110: Function <a href="../html/libxml-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li><li> line 123: Function <a href="../html/libxml-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li><li> line 124: Function <a href="../html/libxml-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li><li> line 127: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li><li> line 162: Function <a href="../html/libxml-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li></ul><p>Usage:</p><p>xpath2 &lt;xml-file&gt; &lt;xpath-expr&gt; &lt;new-value&gt;</p><p>Author: Aleksey Sanin and Daniel Veillard</p><h2><a name="xmlReader" id="xmlReader"></a>xmlReader Examples</h2><h3><a name="reader1.c" href="reader1.c" id="reader1.c">reader1.c</a>: Parse an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file and dump the information about the nodes found in the process. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 29: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 33: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 36: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 39: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 44: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 59: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 67: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 69: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 89: Macro <a href="../html/libxml-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li><li> line 94: Function <a href="../html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li><li> line 98: Function <a href="../html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li></ul><p>Usage:</p><p>reader1 &lt;filename&gt;</p><p>Author: Daniel Veillard</p><h3><a name="reader2.c" href="reader2.c" id="reader2.c">reader2.c</a>: Parse and validate an XML file with an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 30: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstName">xmlTextReaderConstName</a> from xmlreader.h</li><li> line 34: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderConstValue">xmlTextReaderConstValue</a> from xmlreader.h</li><li> line 37: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderNodeType">xmlTextReaderNodeType</a> from xmlreader.h</li><li> line 40: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsEmptyElement">xmlTextReaderIsEmptyElement</a> from xmlreader.h</li><li> line 41: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderHasValue">xmlTextReaderHasValue</a> from xmlreader.h</li><li> line 45: Function <a href="../html/libxml-xmlstring.html#xmlStrlen">xmlStrlen</a> from xmlstring.h</li><li> line 60: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 68: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 76: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 81: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderIsValid">xmlTextReaderIsValid</a> from xmlreader.h</li><li> line 84: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader2 &lt;valid_xml_filename&gt;</p><p>Author: Daniel Veillard</p><h3><a name="reader3.c" href="reader3.c" id="reader3.c">reader3.c</a>: Show how to extract subdocuments with xmlReader</h3><p>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 32: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 38: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 43: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a> from xmlreader.h</li><li> line 52: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 62: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 66: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li><li> line 96: Function <a href="../html/libxml-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li></ul><p>Usage:</p><p>reader3</p><p>Author: Daniel Veillard</p><h3><a name="reader4.c" href="reader4.c" id="reader4.c">reader4.c</a>: Parse multiple XML files reusing an xmlReader</h3><p>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context.  (Note that the XMLReader functions require libxml2 version later than 2.6.)</p><p>Includes:</p><ul><li><a href="../html/libxml-xmlreader.html">&lt;libxml/xmlreader.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 26: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li><li> line 54: Type <a href="../html/libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> from xmlreader.h</li><li> line 72: Function <a href="../html/libxml-xmlreader.html#xmlReaderForFile">xmlReaderForFile</a> from xmlreader.h</li><li> line 83: Function <a href="../html/libxml-xmlreader.html#xmlReaderNewFile">xmlReaderNewFile</a> from xmlreader.h</li><li> line 97: Function <a href="../html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a> from xmlreader.h</li><li> line 104: Function <a href="../html/libxml-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li></ul><p>Usage:</p><p>reader4 &lt;filename&gt; [ filename ... ]</p><p>Author: Graham Bennett</p><h2><a name="xmlWriter" id="xmlWriter"></a>xmlWriter Examples</h2><h3><a name="testWriter.c" href="testWriter.c" id="testWriter.c">testWriter.c</a>: use various APIs for the xmlWriter</h3><p>tests a number of APIs for the xmlWriter, especially the various methods to write to a filename, to a memory buffer, to a new document, or to a subtree. It shows how to do encoding string conversions too. The resulting documents are then serialized.</p><p>Includes:</p><ul><li><a href="../html/libxml-encoding.html">&lt;libxml/encoding.h&gt;</a></li><li><a href="../html/libxml-xmlwriter.html">&lt;libxml/xmlwriter.h&gt;</a></li></ul><p>Uses:</p><ul><li> line 76: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li><li> line 341: Type <a href="../html/libxml-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li><li> line 347: Function <a href="../html/libxml-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li><li> line 355: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li><li> line 613: Function <a href="../html/libxml-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li><li> line 632: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li><li> line 878: Type <a href="../html/libxml-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li><li> line 880: Type <a href="../html/libxml-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li><li> line 885: Macro <a href="../html/libxml-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li><li> line 885: Function <a href="../html/libxml-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li><li> line 894: Function <a href="../html/libxml-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li><li> line 901: Function <a href="../html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li><li> line 904: Function <a href="../html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li><li> line 913: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li><li> line 925: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li><li> line 949: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li><li> line 959: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li><li> line 1073: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li><li> line 1096: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li><li> line 1103: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li><li> line 1111: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li><li> line 1121: Function <a href="../html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li><li> line 1127: Function <a href="../html/libxml-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li><li> line 1129: Function <a href="../html/libxml-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li><li> line 1151: Type <a href="../html/libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li><li> line 1156: Function <a href="../html/libxml-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li></ul><p>Usage:</p><p>testWriter</p><p>Author: Alfred Mickautsch</p><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index e8a005a..7651609 100644 (file)
@@ -2,7 +2,7 @@
  * section: xmlReader
  * synopsis: Parse an XML file with an xmlReader
  * purpose: Demonstrate the use of xmlReaderForFile() to parse an XML file
- *          and dump the informations about the nodes found in the process.
+ *          and dump the information about the nodes found in the process.
  *          (Note that the XMLReader functions require libxml2 version later
  *          than 2.6.)
  * usage: reader1 <filename>
index 82e8d3a..67be4ab 100644 (file)
@@ -89,7 +89,7 @@ testXmlwriterFilename(const char *uri)
         return;
     }
 
-    /* Start an element named "EXAMPLE". Since thist is the first
+    /* Start an element named "EXAMPLE". Since this is the first
      * element, this will be the root element of the document. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE");
     if (rc < 0) {
@@ -368,7 +368,7 @@ testXmlwriterMemory(const char *file)
         return;
     }
 
-    /* Start an element named "EXAMPLE". Since thist is the first
+    /* Start an element named "EXAMPLE". Since this is the first
      * element, this will be the root element of the document. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE");
     if (rc < 0) {
@@ -644,7 +644,7 @@ testXmlwriterDoc(const char *file)
         return;
     }
 
-    /* Start an element named "EXAMPLE". Since thist is the first
+    /* Start an element named "EXAMPLE". Since this is the first
      * element, this will be the root element of the document. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "EXAMPLE");
     if (rc < 0) {
index af4a7b3..14a909c 100644 (file)
@@ -76,7 +76,7 @@ vocabulary. Here are a few tips:</p>
   <li>use significant words for the element and attributes names.</li>
   <li>do not use attributes for general textual content, attributes
     will be modified by the parser before reaching the application,
-    spaces and line informations will be modified.</li>
+    spaces and line information will be modified.</li>
   <li>use single elements for every string that might be subject to
     localization. The canonical way to localize XML content is to use
     siblings element carrying different xml:lang attributes like in the
index a869493..56abee3 100644 (file)
@@ -10,4 +10,4 @@ A:link, A:visited, A:active { text-decoration: underline }
 </style><style type="text/css">
       div.deprecated pre.programlisting {border-style: double;border-color:red}
       pre.programlisting {border-style: double;background: #EECFA1}
-    </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version informations</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+    </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version information</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index a869493..56abee3 100644 (file)
@@ -10,4 +10,4 @@ A:link, A:visited, A:active { text-decoration: underline }
 </style><style type="text/css">
       div.deprecated pre.programlisting {border-style: double;border-color:red}
       pre.programlisting {border-style: double;background: #EECFA1}
-    </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version informations</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+    </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version information</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index 1bbec8c..8d99092 100644 (file)
@@ -36,9 +36,9 @@ A:link, A:visited, A:active { text-decoration: underline }
 <h3><a name="HTML_TEXT_NODE" id="HTML_TEXT_NODE"></a>Macro: HTML_TEXT_NODE</h3><pre>#define HTML_TEXT_NODE</pre><p>Macro. A text node in a HTML document is really implemented the same way as a text node in an XML document.</p>
 <h3><a name="htmlDocContentDumpFormatOutput" id="htmlDocContentDumpFormatOutput"></a>Function: htmlDocContentDumpFormatOutput</h3><pre class="programlisting">void     htmlDocContentDumpFormatOutput  (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br />                                  const char * encoding, <br />                                   int format)<br />
 </pre><p>Dump an HTML document.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlDocContentDumpOutput" id="htmlDocContentDumpOutput"></a>Function: htmlDocContentDumpOutput</h3><pre class="programlisting">void      htmlDocContentDumpOutput        (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br />                                  const char * encoding)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlDocContentDumpOutput" id="htmlDocContentDumpOutput"></a>Function: htmlDocContentDumpOutput</h3><pre class="programlisting">void     htmlDocContentDumpOutput        (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br />                                  const char * encoding)<br />
 </pre><p>Dump an HTML document. Formatting return/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div><h3><a name="htmlDocDump" id="htmlDocDump"></a>Function: htmlDocDump</h3><pre class="programlisting">int     htmlDocDump                     (FILE * f, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div><h3><a name="htmlDocDump" id="htmlDocDump"></a>Function: htmlDocDump</h3><pre class="programlisting">int    htmlDocDump                     (FILE * f, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
 </pre><p>Dump an HTML document to an open FILE.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>f</tt></i>:</span></td><td>the FILE*</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="htmlDocDumpMemory" id="htmlDocDumpMemory"></a>Function: htmlDocDumpMemory</h3><pre class="programlisting">void htmlDocDumpMemory               (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br />                                  <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** mem, <br />                                      int * size)<br />
 </pre><p>Dump an HTML document in memory and return the <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * and it's size. It's up to the caller to free the memory.</p>
@@ -60,9 +60,9 @@ A:link, A:visited, A:active { text-decoration: underline }
 </pre><p>Dump an HTML node, recursive behaviour,children are printed too. TODO: if encoding == NULL try to save in the doc encoding</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>the FILE pointer</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the document encoding</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="htmlNodeDumpFormatOutput" id="htmlNodeDumpFormatOutput"></a>Function: htmlNodeDumpFormatOutput</h3><pre class="programlisting">void        htmlNodeDumpFormatOutput        (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />                                        const char * encoding, <br />                                   int format)<br />
 </pre><p>Dump an HTML node, recursive behaviour,children are printed too.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlNodeDumpOutput" id="htmlNodeDumpOutput"></a>Function: htmlNodeDumpOutput</h3><pre class="programlisting">void       htmlNodeDumpOutput              (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />                                        const char * encoding)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr><tr><td><span class="term"><i><tt>format</tt></i>:</span></td><td>should formatting spaces been added</td></tr></tbody></table></div><h3><a name="htmlNodeDumpOutput" id="htmlNodeDumpOutput"></a>Function: htmlNodeDumpOutput</h3><pre class="programlisting">void      htmlNodeDumpOutput              (<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> buf, <br />                                        <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br />                                        const char * encoding)<br />
 </pre><p>Dump an HTML node, recursive behaviour,children are printed too, and formatting returns/spaces are added.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string</td></tr></tbody></table></div><h3><a name="htmlSaveFile" id="htmlSaveFile"></a>Function: htmlSaveFile</h3><pre class="programlisting">int htmlSaveFile                    (const char * filename, <br />                                   <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the HTML buffer output</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the current node</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding string (unused)</td></tr></tbody></table></div><h3><a name="htmlSaveFile" id="htmlSaveFile"></a>Function: htmlSaveFile</h3><pre class="programlisting">int        htmlSaveFile                    (const char * filename, <br />                                   <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur)<br />
 </pre><p>Dump an HTML document to a file. If @filename is "-" the stdout file is used.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename (or URL)</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of failure.</td></tr></tbody></table></div><h3><a name="htmlSaveFileEnc" id="htmlSaveFileEnc"></a>Function: htmlSaveFileEnc</h3><pre class="programlisting">int     htmlSaveFileEnc                 (const char * filename, <br />                                   <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> cur, <br />                                  const char * encoding)<br />
 </pre><p>Dump an HTML document to a file using a given encoding and formatting returns/spaces are added.</p>
index bdcb11d..7a15a18 100644 (file)
@@ -70,7 +70,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><h3><a name="xmlSAX2EndElement" id="xmlSAX2EndElement"></a>Function: xmlSAX2EndElement</h3><pre class="programlisting">void    xmlSAX2EndElement               (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)<br />
 </pre><p>called when the end of an element has been detected.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div><h3><a name="xmlSAX2EndElementNs" id="xmlSAX2EndElementNs"></a>Function: xmlSAX2EndElementNs</h3><pre class="programlisting">void    xmlSAX2EndElementNs             (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br />                                   const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI)<br />
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p>
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div><h3><a name="xmlSAX2EntityDecl" id="xmlSAX2EntityDecl"></a>Function: xmlSAX2EntityDecl</h3><pre class="programlisting">void   xmlSAX2EntityDecl               (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        int type, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br />                                    <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
 </pre><p>An entity definition has been parsed</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the entity name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the entity type</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the entity value (without processing).</td></tr></tbody></table></div><h3><a name="xmlSAX2ExternalSubset" id="xmlSAX2ExternalSubset"></a>Function: xmlSAX2ExternalSubset</h3><pre class="programlisting">void xmlSAX2ExternalSubset           (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br />                                  const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * SystemID)<br />
@@ -118,7 +118,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><h3><a name="xmlSAX2StartElement" id="xmlSAX2StartElement"></a>Function: xmlSAX2StartElement</h3><pre class="programlisting">void      xmlSAX2StartElement             (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** atts)<br />
 </pre><p>called when an opening tag has been processed.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div><h3><a name="xmlSAX2StartElementNs" id="xmlSAX2StartElementNs"></a>Function: xmlSAX2StartElementNs</h3><pre class="programlisting">void    xmlSAX2StartElementNs           (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br />                                   const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI, <br />                                         int nb_namespaces, <br />                                       const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br />                                         int nb_attributes, <br />                                       int nb_defaulted, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** attributes)<br />
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p>
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes.</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div><h3><a name="xmlSAX2UnparsedEntityDecl" id="xmlSAX2UnparsedEntityDecl"></a>Function: xmlSAX2UnparsedEntityDecl</h3><pre class="programlisting">void       xmlSAX2UnparsedEntityDecl       (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * systemId, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * notationName)<br />
 </pre><p>What to do when an unparsed entity declaration is parsed</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The name of the entity</td></tr><tr><td><span class="term"><i><tt>publicId</tt></i>:</span></td><td>The public ID of the entity</td></tr><tr><td><span class="term"><i><tt>systemId</tt></i>:</span></td><td>The system ID of the entity</td></tr><tr><td><span class="term"><i><tt>notationName</tt></i>:</span></td><td>the name of the notation</td></tr></tbody></table></div><h3><a name="xmlSAXDefaultVersion" id="xmlSAXDefaultVersion"></a>Function: xmlSAXDefaultVersion</h3><pre class="programlisting">int        xmlSAXDefaultVersion            (int version)<br />
index 6b5f0e0..2a3fa5f 100644 (file)
@@ -78,7 +78,7 @@ char *        <a href="#xmlShellReadlineFunc">xmlShellReadlineFunc</a>                (char * prompt)
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node list</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>the indentation level.</td></tr></tbody></table></div><h3><a name="xmlDebugDumpOneNode" id="xmlDebugDumpOneNode"></a>Function: xmlDebugDumpOneNode</h3><pre class="programlisting">void    xmlDebugDumpOneNode             (FILE * output, <br />                                   <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br />                                       int depth)<br />
 </pre><p>Dumps debug information for the element node, it is not recursive</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>the indentation level.</td></tr></tbody></table></div><h3><a name="xmlDebugDumpString" id="xmlDebugDumpString"></a>Function: xmlDebugDumpString</h3><pre class="programlisting">void    xmlDebugDumpString              (FILE * output, <br />                                   const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * str)<br />
-</pre><p>Dumps informations about the string, shorten it if necessary</p>
+</pre><p>Dumps information about the string, shorten it if necessary</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>output</tt></i>:</span></td><td>the FILE * for the output</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string</td></tr></tbody></table></div><h3><a name="xmlLsCountNode" id="xmlLsCountNode"></a>Function: xmlLsCountNode</h3><pre class="programlisting">int xmlLsCountNode                  (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
 </pre><p>Count the children of @node.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the node to count</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of children of @node.</td></tr></tbody></table></div><h3><a name="xmlLsOneNode" id="xmlLsOneNode"></a>Function: xmlLsOneNode</h3><pre class="programlisting">void      xmlLsOneNode                    (FILE * output, <br />                                   <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
@@ -93,7 +93,7 @@ char *        <a href="#xmlShellReadlineFunc">xmlShellReadlineFunc</a>                (char * prompt)
 int    xmlShellCmd                     (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br />                                         char * arg, <br />                                      <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br />                                       <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)
 </pre><p>This is a generic signature for the XML shell functions.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>a string argument</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a first node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>a second node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an int, negative returns indicating errors.</td></tr></tbody></table></div><br />
 <h3><a name="xmlShellDir" id="xmlShellDir"></a>Function: xmlShellDir</h3><pre class="programlisting">int       xmlShellDir                     (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br />                                         char * arg, <br />                                      <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br />                                       <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br />
-</pre><p>Implements the XML shell function "dir" dumps informations about the node (namespace, attributes, content).</p>
+</pre><p>Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0</td></tr></tbody></table></div><h3><a name="xmlShellDu" id="xmlShellDu"></a>Function: xmlShellDu</h3><pre class="programlisting">int    xmlShellDu                      (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br />                                         char * arg, <br />                                      <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br />                                       <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br />
 </pre><p>Implements the XML shell function "du" show the structure of the subtree under node @tree If @tree is null, the command works on the current node.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the shell context</td></tr><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>a node defining a subtree</td></tr><tr><td><span class="term"><i><tt>node2</tt></i>:</span></td><td>unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlShellList" id="xmlShellList"></a>Function: xmlShellList</h3><pre class="programlisting">int    xmlShellList                    (<a href="libxml-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br />                                         char * arg, <br />                                      <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br />                                       <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br />
index 0315764..e56ed39 100644 (file)
@@ -83,9 +83,9 @@ int   <a href="#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a>      (unsigned
     <a href="libxml-encoding.html#uconv_t">uconv_t</a> *       uconv_out
 }</pre><h3><a name="UTF8Toisolat1" id="UTF8Toisolat1"></a>Function: UTF8Toisolat1</h3><pre class="programlisting">int  UTF8Toisolat1                   (unsigned char * out, <br />                                     int * outlen, <br />                                    const unsigned char * in, <br />                                        int * inlen)<br />
 </pre><p>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div><h3><a name="isolat1ToUTF8" id="isolat1ToUTF8"></a>Function: isolat1ToUTF8</h3><pre class="programlisting">int       isolat1ToUTF8                   (unsigned char * out, <br />                                     int * outlen, <br />                                    const unsigned char * in, <br />                                        int * inlen)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of UTF-8 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div><h3><a name="isolat1ToUTF8" id="isolat1ToUTF8"></a>Function: isolat1ToUTF8</h3><pre class="programlisting">int       isolat1ToUTF8                   (unsigned char * out, <br />                                     int * outlen, <br />                                    const unsigned char * in, <br />                                        int * inlen)<br />
 </pre><p>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td></tr></tbody></table></div><h3><a name="xmlAddEncodingAlias" id="xmlAddEncodingAlias"></a>Function: xmlAddEncodingAlias</h3><pre class="programlisting">int    xmlAddEncodingAlias             (const char * name, <br />                                       const char * alias)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>out</tt></i>:</span></td><td>a pointer to an array of bytes to store the result</td></tr><tr><td><span class="term"><i><tt>outlen</tt></i>:</span></td><td>the length of @out</td></tr><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a pointer to an array of ISO Latin 1 chars</td></tr><tr><td><span class="term"><i><tt>inlen</tt></i>:</span></td><td>the length of @in</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.</td></tr></tbody></table></div><h3><a name="xmlAddEncodingAlias" id="xmlAddEncodingAlias"></a>Function: xmlAddEncodingAlias</h3><pre class="programlisting">int    xmlAddEncodingAlias             (const char * name, <br />                                       const char * alias)<br />
 </pre><p>Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the encoding name as parsed, in UTF-8 format (ASCII actually)</td></tr><tr><td><span class="term"><i><tt>alias</tt></i>:</span></td><td>the alias name as parsed, in UTF-8 format (ASCII actually)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlCharEncCloseFunc" id="xmlCharEncCloseFunc"></a>Function: xmlCharEncCloseFunc</h3><pre class="programlisting">int        xmlCharEncCloseFunc             (<a href="libxml-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> * handler)<br />
 </pre><p>Generic front-end for encoding handler close function</p>
index a869493..56abee3 100644 (file)
@@ -10,4 +10,4 @@ A:link, A:visited, A:active { text-decoration: underline }
 </style><style type="text/css">
       div.deprecated pre.programlisting {border-style: double;border-color:red}
       pre.programlisting {border-style: double;background: #EECFA1}
-    </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version informations</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+    </style><title>Reference Manual for libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Reference Manual for libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><h2>Table of Contents</h2><ul><li><a href="libxml-DOCBparser.html">DOCBparser</a>: old DocBook SGML parser</li><li><a href="libxml-HTMLparser.html">HTMLparser</a>: interface for an HTML 4.0 non-verifying parser</li><li><a href="libxml-HTMLtree.html">HTMLtree</a>: specific APIs to process HTML tree, especially serialization</li><li><a href="libxml-SAX.html">SAX</a>: Old SAX version 1 handler, deprecated</li><li><a href="libxml-SAX2.html">SAX2</a>: SAX2 parser interface used to build the DOM tree</li><li><a href="libxml-c14n.html">c14n</a>: Provide Canonical XML and Exclusive XML Canonicalization</li><li><a href="libxml-catalog.html">catalog</a>: interfaces to the Catalog handling system</li><li><a href="libxml-chvalid.html">chvalid</a>: Unicode character range checking</li><li><a href="libxml-debugXML.html">debugXML</a>: Tree debugging APIs</li><li><a href="libxml-dict.html">dict</a>: string dictionary</li><li><a href="libxml-encoding.html">encoding</a>: interface for the encoding conversion functions</li><li><a href="libxml-entities.html">entities</a>: interface for the XML entities handling</li><li><a href="libxml-globals.html">globals</a>: interface for all global variables of the library</li><li><a href="libxml-hash.html">hash</a>: Chained hash tables</li><li><a href="libxml-list.html">list</a>: lists interfaces</li><li><a href="libxml-nanoftp.html">nanoftp</a>: minimal FTP implementation</li><li><a href="libxml-nanohttp.html">nanohttp</a>: minimal HTTP implementation</li><li><a href="libxml-parser.html">parser</a>: the core parser module</li><li><a href="libxml-parserInternals.html">parserInternals</a>: internals routines and limits exported by the parser.</li><li><a href="libxml-pattern.html">pattern</a>: pattern expression handling</li><li><a href="libxml-relaxng.html">relaxng</a>: implementation of the Relax-NG validation</li><li><a href="libxml-schemasInternals.html">schemasInternals</a>: internal interfaces for XML Schemas</li><li><a href="libxml-schematron.html">schematron</a>: XML Schemastron implementation</li><li><a href="libxml-threads.html">threads</a>: interfaces for thread handling</li><li><a href="libxml-tree.html">tree</a>: interfaces for tree manipulation</li><li><a href="libxml-uri.html">uri</a>: library of generic URI related routines</li><li><a href="libxml-valid.html">valid</a>: The DTD validation</li><li><a href="libxml-xinclude.html">xinclude</a>: implementation of XInclude</li><li><a href="libxml-xlink.html">xlink</a>: unfinished XLink detection module</li><li><a href="libxml-xmlIO.html">xmlIO</a>: interface for the I/O interfaces used by the parser</li><li><a href="libxml-xmlautomata.html">xmlautomata</a>: API to build regexp automata</li><li><a href="libxml-xmlerror.html">xmlerror</a>: error handling</li><li><a href="libxml-xmlexports.html">xmlexports</a>: macros for marking symbols as exportable/importable.</li><li><a href="libxml-xmlmemory.html">xmlmemory</a>: interface for the memory allocator</li><li><a href="libxml-xmlmodule.html">xmlmodule</a>: dynamic module loading</li><li><a href="libxml-xmlreader.html">xmlreader</a>: the XMLReader implementation</li><li><a href="libxml-xmlregexp.html">xmlregexp</a>: regular expressions handling</li><li><a href="libxml-xmlsave.html">xmlsave</a>: the XML document serializer</li><li><a href="libxml-xmlschemas.html">xmlschemas</a>: incomplete XML Schemas structure implementation</li><li><a href="libxml-xmlschemastypes.html">xmlschemastypes</a>: implementation of XML Schema Datatypes</li><li><a href="libxml-xmlstring.html">xmlstring</a>: set of routines to process strings</li><li><a href="libxml-xmlunicode.html">xmlunicode</a>: Unicode character APIs</li><li><a href="libxml-xmlversion.html">xmlversion</a>: compile-time version information</li><li><a href="libxml-xmlwriter.html">xmlwriter</a>: text writing API for XML</li><li><a href="libxml-xpath.html">xpath</a>: XML Path Language implementation</li><li><a href="libxml-xpathInternals.html">xpathInternals</a>: internal interfaces for XML Path Language implementation</li><li><a href="libxml-xpointer.html">xpointer</a>: API to handle XML Pointers</li></ul><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index 3e3ac62..d389630 100644 (file)
@@ -50,45 +50,45 @@ void        ftpListCallback                 (void * userData, <br />                                         const char * filename, <br
 <h3><a name="xmlNanoFTPCheckResponse" id="xmlNanoFTPCheckResponse"></a>Function: xmlNanoFTPCheckResponse</h3><pre class="programlisting">int   xmlNanoFTPCheckResponse         (void * ctx)<br />
 </pre><p>Check if there is a response from the FTP server after a command.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the code number, or 0</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCleanup" id="xmlNanoFTPCleanup"></a>Function: xmlNanoFTPCleanup</h3><pre class="programlisting">void      xmlNanoFTPCleanup               (void)<br />
-</pre><p>Cleanup the FTP protocol layer. This cleanup proxy informations.</p>
+</pre><p>Cleanup the FTP protocol layer. This cleanup proxy information.</p>
 <h3><a name="xmlNanoFTPClose" id="xmlNanoFTPClose"></a>Function: xmlNanoFTPClose</h3><pre class="programlisting">int   xmlNanoFTPClose                 (void * ctx)<br />
 </pre><p>Close the connection and both control and transport</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCloseConnection" id="xmlNanoFTPCloseConnection"></a>Function: xmlNanoFTPCloseConnection</h3><pre class="programlisting">int     xmlNanoFTPCloseConnection       (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCloseConnection" id="xmlNanoFTPCloseConnection"></a>Function: xmlNanoFTPCloseConnection</h3><pre class="programlisting">int    xmlNanoFTPCloseConnection       (void * ctx)<br />
 </pre><p>Close the data connection from the server</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnect" id="xmlNanoFTPConnect"></a>Function: xmlNanoFTPConnect</h3><pre class="programlisting">int     xmlNanoFTPConnect               (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnect" id="xmlNanoFTPConnect"></a>Function: xmlNanoFTPConnect</h3><pre class="programlisting">int    xmlNanoFTPConnect               (void * ctx)<br />
 </pre><p>Tries to open a control connection</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPConnectTo" id="xmlNanoFTPConnectTo"></a>Function: xmlNanoFTPConnectTo</h3><pre class="programlisting">void *   xmlNanoFTPConnectTo             (const char * server, <br />                                     int port)<br />
 </pre><p>Tries to open a control connection to the given server/port</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>server</tt></i>:</span></td><td>an FTP server name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the port (use 21 if 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an fTP context or NULL if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPCwd" id="xmlNanoFTPCwd"></a>Function: xmlNanoFTPCwd</h3><pre class="programlisting">int      xmlNanoFTPCwd                   (void * ctx, <br />                                      const char * directory)<br />
 </pre><p>Tries to change the remote directory</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPDele" id="xmlNanoFTPDele"></a>Function: xmlNanoFTPDele</h3><pre class="programlisting">int  xmlNanoFTPDele                  (void * ctx, <br />                                      const char * file)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>directory</tt></i>:</span></td><td>a directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if CWD worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPDele" id="xmlNanoFTPDele"></a>Function: xmlNanoFTPDele</h3><pre class="programlisting">int xmlNanoFTPDele                  (void * ctx, <br />                                      const char * file)<br />
 </pre><p>Tries to delete an item (file or directory) from server</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPFreeCtxt" id="xmlNanoFTPFreeCtxt"></a>Function: xmlNanoFTPFreeCtxt</h3><pre class="programlisting">void xmlNanoFTPFreeCtxt              (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>a file or directory on the server</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 1 if DELE worked, 0 if it failed</td></tr></tbody></table></div><h3><a name="xmlNanoFTPFreeCtxt" id="xmlNanoFTPFreeCtxt"></a>Function: xmlNanoFTPFreeCtxt</h3><pre class="programlisting">void        xmlNanoFTPFreeCtxt              (void * ctx)<br />
 </pre><p>Frees the context after closing the connection.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGet" id="xmlNanoFTPGet"></a>Function: xmlNanoFTPGet</h3><pre class="programlisting">int     xmlNanoFTPGet                   (void * ctx, <br />                                      <a href="libxml-nanoftp.html#ftpDataCallback">ftpDataCallback</a> callback, <br />                                      void * userData, <br />                                         const char * filename)<br />
 </pre><p>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetConnection" id="xmlNanoFTPGetConnection"></a>Function: xmlNanoFTPGetConnection</h3><pre class="programlisting"><a href="libxml-nanoftp.html#SOCKET">SOCKET</a>  xmlNanoFTPGetConnection         (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetConnection" id="xmlNanoFTPGetConnection"></a>Function: xmlNanoFTPGetConnection</h3><pre class="programlisting"><a href="libxml-nanoftp.html#SOCKET">SOCKET</a> xmlNanoFTPGetConnection         (void * ctx)<br />
 </pre><p>Try to open a data connection to the server. Currently only passive mode is supported.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetResponse" id="xmlNanoFTPGetResponse"></a>Function: xmlNanoFTPGetResponse</h3><pre class="programlisting">int xmlNanoFTPGetResponse           (void * ctx)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetResponse" id="xmlNanoFTPGetResponse"></a>Function: xmlNanoFTPGetResponse</h3><pre class="programlisting">int        xmlNanoFTPGetResponse           (void * ctx)<br />
 </pre><p>Get the response from the FTP server after a command.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the code number</td></tr></tbody></table></div><h3><a name="xmlNanoFTPGetSocket" id="xmlNanoFTPGetSocket"></a>Function: xmlNanoFTPGetSocket</h3><pre class="programlisting"><a href="libxml-nanoftp.html#SOCKET">SOCKET</a>   xmlNanoFTPGetSocket             (void * ctx, <br />                                      const char * filename)<br />
 </pre><p>Initiate fetch of the given file from the server.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the file to retrieve (or NULL if path is in context).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the socket for the data connection, or &lt;0 in case of error</td></tr></tbody></table></div><h3><a name="xmlNanoFTPInit" id="xmlNanoFTPInit"></a>Function: xmlNanoFTPInit</h3><pre class="programlisting">void    xmlNanoFTPInit                  (void)<br />
-</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</p>
+</pre><p>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</p>
 <h3><a name="xmlNanoFTPList" id="xmlNanoFTPList"></a>Function: xmlNanoFTPList</h3><pre class="programlisting">int      xmlNanoFTPList                  (void * ctx, <br />                                      <a href="libxml-nanoftp.html#ftpListCallback">ftpListCallback</a> callback, <br />                                      void * userData, <br />                                         const char * filename)<br />
 </pre><p>Do a listing on the server. All files info are passed back in the callbacks.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 incase of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPNewCtxt" id="xmlNanoFTPNewCtxt"></a>Function: xmlNanoFTPNewCtxt</h3><pre class="programlisting">void *   xmlNanoFTPNewCtxt               (const char * URL)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>callback</tt></i>:</span></td><td>the user callback</td></tr><tr><td><span class="term"><i><tt>userData</tt></i>:</span></td><td>the user callback data</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>optional files to list</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPNewCtxt" id="xmlNanoFTPNewCtxt"></a>Function: xmlNanoFTPNewCtxt</h3><pre class="programlisting">void *  xmlNanoFTPNewCtxt               (const char * URL)<br />
 </pre><p>Allocate and initialize a new FTP context.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL used to initialize the context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlNanoFTPOpen" id="xmlNanoFTPOpen"></a>Function: xmlNanoFTPOpen</h3><pre class="programlisting">void *  xmlNanoFTPOpen                  (const char * URL)<br />
 </pre><p>Start to fetch the given ftp:// resource</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL to the resource</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an FTP context, or NULL</td></tr></tbody></table></div><h3><a name="xmlNanoFTPProxy" id="xmlNanoFTPProxy"></a>Function: xmlNanoFTPProxy</h3><pre class="programlisting">void xmlNanoFTPProxy                 (const char * host, <br />                                       int port, <br />                                        const char * user, <br />                                       const char * passwd, <br />                                     int type)<br />
-</pre><p>Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
+</pre><p>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>host</tt></i>:</span></td><td>the proxy host name</td></tr><tr><td><span class="term"><i><tt>port</tt></i>:</span></td><td>the proxy port</td></tr><tr><td><span class="term"><i><tt>user</tt></i>:</span></td><td>the proxy user name</td></tr><tr><td><span class="term"><i><tt>passwd</tt></i>:</span></td><td>the proxy password</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the type of proxy 1 for using SITE, 2 for USER a@b</td></tr></tbody></table></div><h3><a name="xmlNanoFTPQuit" id="xmlNanoFTPQuit"></a>Function: xmlNanoFTPQuit</h3><pre class="programlisting">int     xmlNanoFTPQuit                  (void * ctx)<br />
 </pre><p>Send a QUIT command to the server</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlNanoFTPRead" id="xmlNanoFTPRead"></a>Function: xmlNanoFTPRead</h3><pre class="programlisting">int     xmlNanoFTPRead                  (void * ctx, <br />                                      void * dest, <br />                                     int len)<br />
 </pre><p>This function tries to read @len bytes from the existing FTP connection and saves them in @dest. This is a blocking call.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the FTP context</td></tr><tr><td><span class="term"><i><tt>dest</tt></i>:</span></td><td>a buffer</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>the buffer length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.</td></tr></tbody></table></div><h3><a name="xmlNanoFTPScanProxy" id="xmlNanoFTPScanProxy"></a>Function: xmlNanoFTPScanProxy</h3><pre class="programlisting">void    xmlNanoFTPScanProxy             (const char * URL)<br />
-</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+</pre><p>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div><h3><a name="xmlNanoFTPUpdateURL" id="xmlNanoFTPUpdateURL"></a>Function: xmlNanoFTPUpdateURL</h3><pre class="programlisting">int       xmlNanoFTPUpdateURL             (void * ctx, <br />                                      const char * URL)<br />
 </pre><p>Update an FTP context by parsing the URL and finding new path it indicates. If there is an error in the protocol, hostname, port or other information, the error is raised. It indicates a new connection has to be established.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an FTP context</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL used to update the context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if Ok, -1 in case of error (other host).</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index f507c14..28fcb20 100644 (file)
@@ -40,8 +40,8 @@ A:link, A:visited, A:active { text-decoration: underline }
 </pre><p>Provides the specified encoding if specified in the HTTP headers.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the specified encoding or NULL if not available</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPFetch" id="xmlNanoHTTPFetch"></a>Function: xmlNanoHTTPFetch</h3><pre class="programlisting">int      xmlNanoHTTPFetch                (const char * URL, <br />                                        const char * filename, <br />                                   char ** contentType)<br />
 </pre><p>This function try to fetch the indicated resource via HTTP GET and save it's content in the file.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPInit" id="xmlNanoHTTPInit"></a>Function: xmlNanoHTTPInit</h3><pre class="programlisting">void    xmlNanoHTTPInit                 (void)<br />
-</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy informations</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>if available the Content-Type information will be returned at that location</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPInit" id="xmlNanoHTTPInit"></a>Function: xmlNanoHTTPInit</h3><pre class="programlisting">void   xmlNanoHTTPInit                 (void)<br />
+</pre><p>Initialize the HTTP protocol layer. Currently it just checks for proxy information</p>
 <h3><a name="xmlNanoHTTPMethod" id="xmlNanoHTTPMethod"></a>Function: xmlNanoHTTPMethod</h3><pre class="programlisting">void *  xmlNanoHTTPMethod               (const char * URL, <br />                                        const char * method, <br />                                     const char * input, <br />                                      char ** contentType, <br />                                     const char * headers, <br />                                    int ilen)<br />
 </pre><p>This function try to open a connection to the indicated resource via HTTP using the given @method, adding the given extra headers and the input buffer for the request content.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The URL to load</td></tr><tr><td><span class="term"><i><tt>method</tt></i>:</span></td><td>the HTTP method to use</td></tr><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>the input string if any</td></tr><tr><td><span class="term"><i><tt>contentType</tt></i>:</span></td><td>the Content-Type information IN and OUT</td></tr><tr><td><span class="term"><i><tt>headers</tt></i>:</span></td><td>the extra headers</td></tr><tr><td><span class="term"><i><tt>ilen</tt></i>:</span></td><td>input length</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL in case of failure, otherwise a request handler. The contentType, if provided must be freed by the caller</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPMethodRedir" id="xmlNanoHTTPMethodRedir"></a>Function: xmlNanoHTTPMethodRedir</h3><pre class="programlisting">void *   xmlNanoHTTPMethodRedir          (const char * URL, <br />                                        const char * method, <br />                                     const char * input, <br />                                      char ** contentType, <br />                                     char ** redir, <br />                                   const char * headers, <br />                                    int ilen)<br />
@@ -60,6 +60,6 @@ A:link, A:visited, A:active { text-decoration: underline }
 </pre><p>Get the latest HTTP return code received</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the HTTP return code for the request.</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPSave" id="xmlNanoHTTPSave"></a>Function: xmlNanoHTTPSave</h3><pre class="programlisting">int   xmlNanoHTTPSave                 (void * ctxt, <br />                                     const char * filename)<br />
 </pre><p>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 incase of success.</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPScanProxy" id="xmlNanoHTTPScanProxy"></a>Function: xmlNanoHTTPScanProxy</h3><pre class="programlisting">void        xmlNanoHTTPScanProxy            (const char * URL)<br />
-</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the HTTP context</td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename where the content should be saved</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 in case of success.</td></tr></tbody></table></div><h3><a name="xmlNanoHTTPScanProxy" id="xmlNanoHTTPScanProxy"></a>Function: xmlNanoHTTPScanProxy</h3><pre class="programlisting">void       xmlNanoHTTPScanProxy            (const char * URL)<br />
+</pre><p>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>The proxy URL used to initialize the proxy context</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index d1c320e..ea9ae26 100644 (file)
@@ -20,6 +20,8 @@ A:link, A:visited, A:active { text-decoration: underline }
 </pre><pre class="programlisting">Enum <a href="#xmlParserOption">xmlParserOption</a>
 </pre><pre class="programlisting">Structure <a href="#xmlSAXHandlerV1">xmlSAXHandlerV1</a><br />struct _xmlSAXHandlerV1
 </pre><pre class="programlisting">Typedef <a href="libxml-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> * <a name="xmlSAXHandlerV1Ptr" id="xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>
+</pre><pre class="programlisting">Structure <a href="#xmlStartTag">xmlStartTag</a><br />struct _xmlStartTag
+The content of this structure is not made public by the API.
 </pre><pre class="programlisting">Function type: <a href="#attributeDeclSAXFunc">attributeDeclSAXFunc</a>
 void   <a href="#attributeDeclSAXFunc">attributeDeclSAXFunc</a>                (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * elem, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br />                                    int type, <br />                                        int def, <br />                                         const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br />                                        <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)
 </pre>
@@ -320,6 +322,8 @@ void        <a href="#xmlParserInputDeallocate">xmlParserInputDeallocate</a>        (<a href="
     <a href="libxml-parser.html#cdataBlockSAXFunc">cdataBlockSAXFunc</a>       cdataBlock
     <a href="libxml-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a>       externalSubset
     unsigned int       initialized
+}</pre><h3><a name="xmlStartTag" id="xmlStartTag">Structure xmlStartTag</a></h3><pre class="programlisting">Structure xmlStartTag<br />struct _xmlStartTag {
+The content of this structure is not made public by the API.
 }</pre><h3><a name="attributeDeclSAXFunc" id="attributeDeclSAXFunc"></a>Function type: attributeDeclSAXFunc</h3><pre class="programlisting">Function type: attributeDeclSAXFunc
 void   attributeDeclSAXFunc            (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * elem, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br />                                    int type, <br />                                        int def, <br />                                         const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br />                                        <a href="libxml-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)
 </pre><p>An <a href="libxml-SAX.html#attribute">attribute</a> definition has been parsed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td>the name of the element</td></tr><tr><td><span class="term"><i><tt>fullname</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>def</tt></i>:</span></td><td>the type of default value</td></tr><tr><td><span class="term"><i><tt>defaultValue</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> default value</td></tr><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>the tree of enumerated value set</td></tr></tbody></table></div><br />
@@ -343,7 +347,7 @@ void        endDocumentSAXFunc              (void * ctx)
 </pre><p>Called when the document end has been detected.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><br />
 <h3><a name="endElementNsSAX2Func" id="endElementNsSAX2Func"></a>Function type: endElementNsSAX2Func</h3><pre class="programlisting">Function type: endElementNsSAX2Func
 void   endElementNsSAX2Func            (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br />                                   const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI)
-</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div><br />
+</pre><p>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr></tbody></table></div><br />
 <h3><a name="endElementSAXFunc" id="endElementSAXFunc"></a>Function type: endElementSAXFunc</h3><pre class="programlisting">Function type: endElementSAXFunc
 void   endElementSAXFunc               (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)
 </pre><p>Called when the end of an element has been detected.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name</td></tr></tbody></table></div><br />
@@ -400,7 +404,7 @@ void        startDocumentSAXFunc            (void * ctx)
 </pre><p>Called when the document start being processed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr></tbody></table></div><br />
 <h3><a name="startElementNsSAX2Func" id="startElementNsSAX2Func"></a>Function type: startElementNsSAX2Func</h3><pre class="programlisting">Function type: startElementNsSAX2Func
 void   startElementNsSAX2Func          (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * localname, <br />                                   const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI, <br />                                         int nb_namespaces, <br />                                       const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** namespaces, <br />                                         int nb_attributes, <br />                                       int nb_defaulted, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** attributes)
-</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes. The defaulted ones are at the end of the array</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div><br />
+</pre><p>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>localname</tt></i>:</span></td><td>the local name of the element</td></tr><tr><td><span class="term"><i><tt>prefix</tt></i>:</span></td><td>the element namespace prefix if available</td></tr><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the element namespace name if available</td></tr><tr><td><span class="term"><i><tt>nb_namespaces</tt></i>:</span></td><td>number of namespace definitions on that node</td></tr><tr><td><span class="term"><i><tt>namespaces</tt></i>:</span></td><td>pointer to the array of prefix/URI pairs namespace definitions</td></tr><tr><td><span class="term"><i><tt>nb_attributes</tt></i>:</span></td><td>the number of attributes on that node</td></tr><tr><td><span class="term"><i><tt>nb_defaulted</tt></i>:</span></td><td>the number of defaulted attributes. The defaulted ones are at the end of the array</td></tr><tr><td><span class="term"><i><tt>attributes</tt></i>:</span></td><td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml-SAX.html#attribute">attribute</a> values.</td></tr></tbody></table></div><br />
 <h3><a name="startElementSAXFunc" id="startElementSAXFunc"></a>Function type: startElementSAXFunc</h3><pre class="programlisting">Function type: startElementSAXFunc
 void   startElementSAXFunc             (void * ctx, <br />                                      const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** atts)
 </pre><p>Called when an opening tag has been processed.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the user data (XML parser context)</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>The element name, including namespace prefix</td></tr><tr><td><span class="term"><i><tt>atts</tt></i>:</span></td><td>An array of name/value attributes pairs, NULL terminated</td></tr></tbody></table></div><br />
@@ -473,9 +477,9 @@ void        warningSAXFunc                  (void * ctx, <br />                                      const char * msg, <br />                                        ...
 </pre><p>Allocate and initialize a new parser context.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> or NULL</td></tr></tbody></table></div><h3><a name="xmlParseBalancedChunkMemory" id="xmlParseBalancedChunkMemory"></a>Function: xmlParseBalancedChunkMemory</h3><pre class="programlisting">int xmlParseBalancedChunkMemory     (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br />                                    void * user_data, <br />                                        int depth, <br />                                       const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string, <br />                                      <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
 </pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseBalancedChunkMemoryRecover" id="xmlParseBalancedChunkMemoryRecover"></a>Function: xmlParseBalancedChunkMemoryRecover</h3><pre class="programlisting">int  xmlParseBalancedChunkMemoryRecover      (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                          <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br />                                            void * user_data, <br />                                                int depth, <br />                                               const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string, <br />                                              <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br />                                              int recover)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseBalancedChunkMemoryRecover" id="xmlParseBalancedChunkMemoryRecover"></a>Function: xmlParseBalancedChunkMemoryRecover</h3><pre class="programlisting">int      xmlParseBalancedChunkMemoryRecover      (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                          <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br />                                            void * user_data, <br />                                                int depth, <br />                                               const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * string, <br />                                              <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br />                                              int recover)<br />
 </pre><p>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div><h3><a name="xmlParseChunk" id="xmlParseChunk"></a>Function: xmlParseChunk</h3><pre class="programlisting">int   xmlParseChunk                   (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />                                   const char * chunk, <br />                                      int size, <br />                                        int terminate)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to (must not be NULL)</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>the input string in UTF8 or ISO-Latin (zero terminated)</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>recover</tt></i>:</span></td><td>return nodes even if the data is broken (use 0)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.</td></tr></tbody></table></div><h3><a name="xmlParseChunk" id="xmlParseChunk"></a>Function: xmlParseChunk</h3><pre class="programlisting">int       xmlParseChunk                   (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />                                   const char * chunk, <br />                                      int size, <br />                                        int terminate)<br />
 </pre><p>Parse a Chunk of memory</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>chunk</tt></i>:</span></td><td>an char array</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>the size in byte of the chunk</td></tr><tr><td><span class="term"><i><tt>terminate</tt></i>:</span></td><td>last chunk indicator</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>zero if no error, the <a href="libxml-xmlerror.html#xmlParserErrors">xmlParserErrors</a> otherwise.</td></tr></tbody></table></div><h3><a name="xmlParseCtxtExternalEntity" id="xmlParseCtxtExternalEntity"></a>Function: xmlParseCtxtExternalEntity</h3><pre class="programlisting">int    xmlParseCtxtExternalEntity      (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctx, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URL, <br />                                         const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ID, <br />                                  <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
 </pre><p>Parse an external general entity within an existing parsing context An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
@@ -491,7 +495,7 @@ void        warningSAXFunc                  (void * ctx, <br />                                      const char * msg, <br />                                        ...
 </pre><p>parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0, -1 in case of error. the parser context is augmented as a result of the parsing.</td></tr></tbody></table></div><h3><a name="xmlParseExternalEntity" id="xmlParseExternalEntity"></a>Function: xmlParseExternalEntity</h3><pre class="programlisting">int  xmlParseExternalEntity          (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br />                                    void * user_data, <br />                                        int depth, <br />                                       const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URL, <br />                                         const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ID, <br />                                  <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
 </pre><p>Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler bloc (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseFile" id="xmlParseFile"></a>Function: xmlParseFile</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a>      xmlParseFile            (const char * filename)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document the chunk pertains to</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>the SAX handler block (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>The user data returned on SAX callbacks (possibly NULL)</td></tr><tr><td><span class="term"><i><tt>depth</tt></i>:</span></td><td>Used for loop detection, use 0</td></tr><tr><td><span class="term"><i><tt>URL</tt></i>:</span></td><td>the URL for the entity to load</td></tr><tr><td><span class="term"><i><tt>ID</tt></i>:</span></td><td>the System ID for the entity to load</td></tr><tr><td><span class="term"><i><tt>lst</tt></i>:</span></td><td>the return value for the set of parsed nodes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise</td></tr></tbody></table></div><h3><a name="xmlParseFile" id="xmlParseFile"></a>Function: xmlParseFile</h3><pre class="programlisting"><a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a>     xmlParseFile            (const char * filename)<br />
 </pre><p>parse an XML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the resulting document tree if the file was wellformed, NULL otherwise.</td></tr></tbody></table></div><h3><a name="xmlParseInNodeContext" id="xmlParseInNodeContext"></a>Function: xmlParseInNodeContext</h3><pre class="programlisting"><a href="libxml-xmlerror.html#xmlParserErrors">xmlParserErrors</a>       xmlParseInNodeContext   (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br />                                       const char * data, <br />                                       int datalen, <br />                                     int options, <br />                                     <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br />
 </pre><p>Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node. The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
index 357803e..a56f142 100644 (file)
@@ -139,7 +139,7 @@ void        <a href="#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a>            (<a href="lib
 <h3><a name="htmlCreateFileParserCtxt" id="htmlCreateFileParserCtxt"></a>Function: htmlCreateFileParserCtxt</h3><pre class="programlisting"><a href="libxml-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a>   htmlCreateFileParserCtxt        (const char * filename, <br />                                                   const char * encoding)<br />
 </pre><p>Create a parser context for a file content. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>the filename</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>a free form C string describing the HTML document encoding, or NULL</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new parser context or NULL</td></tr></tbody></table></div><h3><a name="htmlInitAutoClose" id="htmlInitAutoClose"></a>Function: htmlInitAutoClose</h3><pre class="programlisting">void htmlInitAutoClose               (void)<br />
-</pre><p>Initialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs.</p>
+</pre><p>This is a no-op now.</p>
 <h3><a name="inputPop" id="inputPop"></a>Function: inputPop</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> inputPop        (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
 </pre><p>Pops the top parser input from the input stack</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the input just removed</td></tr></tbody></table></div><h3><a name="inputPush" id="inputPush"></a>Function: inputPush</h3><pre class="programlisting">int      inputPush                       (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />                                   <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value)<br />
@@ -175,7 +175,7 @@ void        xmlEntityReferenceFunc          (<a href="libxml-tree.html#xmlEntityPtr">xmlEntityP
 </pre><p>Callback function used when one needs to be able to track back the provenance of a chunk of nodes inherited from an entity replacement.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ent</tt></i>:</span></td><td>the entity</td></tr><tr><td><span class="term"><i><tt>firstNode</tt></i>:</span></td><td>the fist node in the chunk</td></tr><tr><td><span class="term"><i><tt>lastNode</tt></i>:</span></td><td>the last nod in the chunk</td></tr></tbody></table></div><br />
 <h3><a name="xmlErrMemory" id="xmlErrMemory"></a>Function: xmlErrMemory</h3><pre class="programlisting">void   xmlErrMemory                    (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />                                   const char * extra)<br />
 </pre><p>Handle a redefinition of <a href="libxml-SAX.html#attribute">attribute</a> error</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra informations</td></tr></tbody></table></div><h3><a name="xmlFreeInputStream" id="xmlFreeInputStream"></a>Function: xmlFreeInputStream</h3><pre class="programlisting">void        xmlFreeInputStream              (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>extra</tt></i>:</span></td><td>extra information</td></tr></tbody></table></div><h3><a name="xmlFreeInputStream" id="xmlFreeInputStream"></a>Function: xmlFreeInputStream</h3><pre class="programlisting">void xmlFreeInputStream              (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
 </pre><p>Free up an input stream.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a></td></tr></tbody></table></div><h3><a name="xmlHandleEntity" id="xmlHandleEntity"></a>Function: xmlHandleEntity</h3><pre class="programlisting">void     xmlHandleEntity                 (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />                                   <a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> entity)<br />
 </pre><p>Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point.</p>
@@ -214,7 +214,7 @@ void        xmlEntityReferenceFunc          (<a href="libxml-tree.html#xmlEntityPtr">xmlEntityP
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the value parsed (as an int), 0 in case of error</td></tr></tbody></table></div><h3><a name="xmlParseComment" id="xmlParseComment"></a>Function: xmlParseComment</h3><pre class="programlisting">void xmlParseComment                 (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
 </pre><p>Skip an XML (SGML) <a href="libxml-SAX.html#comment">comment</a> &lt;!-- .... --&gt; The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '&lt;!--' ((Char - '-') | ('-' (Char - '-')))* '--&gt;'</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div><h3><a name="xmlParseContent" id="xmlParseContent"></a>Function: xmlParseContent</h3><pre class="programlisting">void      xmlParseContent                 (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
-</pre><p>Parse a content: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
+</pre><p>Parse a content sequence. Stops at EOF or '&lt;/'. [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr></tbody></table></div><h3><a name="xmlParseDefaultDecl" id="xmlParseDefaultDecl"></a>Function: xmlParseDefaultDecl</h3><pre class="programlisting">int   xmlParseDefaultDecl             (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br />                                   <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** value)<br />
 </pre><p>Parse an <a href="libxml-SAX.html#attribute">attribute</a> default declaration [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) [ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the <a href="libxml-SAX.html#attribute">attribute</a> must be specified for all elements of the type in the attribute-list declaration. [ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared <a href="libxml-SAX.html#attribute">attribute</a> type c.f. xmlValidateAttributeDecl() [ VC: Fixed Attribute Default ] if an <a href="libxml-SAX.html#attribute">attribute</a> has a default value declared with the #FIXED keyword, instances of that <a href="libxml-SAX.html#attribute">attribute</a> must match the default value. [ WFC: No &lt; in Attribute Values ] handled in xmlParseAttValue()</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>Receive a possible fixed default value for the <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>XML_ATTRIBUTE_NONE, XML_ATTRIBUTE_REQUIRED, <a href="libxml-tree.html#XML_ATTRIBUTE_IMPLIED">XML_ATTRIBUTE_IMPLIED</a> or XML_ATTRIBUTE_FIXED.</td></tr></tbody></table></div><h3><a name="xmlParseDocTypeDecl" id="xmlParseDocTypeDecl"></a>Function: xmlParseDocTypeDecl</h3><pre class="programlisting">void    xmlParseDocTypeDecl             (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
index 2834110..a55c897 100644 (file)
@@ -120,7 +120,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr></tbody></table></div><h3><a name="xmlRelaxNGGetParserErrors" id="xmlRelaxNGGetParserErrors"></a>Function: xmlRelaxNGGetParserErrors</h3><pre class="programlisting">int xmlRelaxNGGetParserErrors       (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br />                                  <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br />                                         <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br />                                    void ** ctx)<br />
 </pre><p>Get the callback information used to handle errors for a validation context</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise.</td></tr></tbody></table></div><h3><a name="xmlRelaxNGGetValidErrors" id="xmlRelaxNGGetValidErrors"></a>Function: xmlRelaxNGGetValidErrors</h3><pre class="programlisting">int    xmlRelaxNGGetValidErrors        (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br />                                    <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> * err, <br />                                         <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> * warn, <br />                                    void ** ctx)<br />
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlRelaxNGInitTypes" id="xmlRelaxNGInitTypes"></a>Function: xmlRelaxNGInitTypes</h3><pre class="programlisting">int       xmlRelaxNGInitTypes             (void)<br />
 </pre><p>Initialize the default type libraries.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRelaxNGNewDocParserCtxt" id="xmlRelaxNGNewDocParserCtxt"></a>Function: xmlRelaxNGNewDocParserCtxt</h3><pre class="programlisting"><a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a>     xmlRelaxNGNewDocParserCtxt      (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
@@ -138,7 +138,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div><h3><a name="xmlRelaxNGSetParserStructuredErrors" id="xmlRelaxNGSetParserStructuredErrors"></a>Function: xmlRelaxNGSetParserStructuredErrors</h3><pre class="programlisting">void       xmlRelaxNGSetParserStructuredErrors     (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br />                                          <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br />                                                 void * ctx)<br />
 </pre><p>Set the callback functions used to handle errors for a parsing context</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div><h3><a name="xmlRelaxNGSetValidErrors" id="xmlRelaxNGSetValidErrors"></a>Function: xmlRelaxNGSetValidErrors</h3><pre class="programlisting">void       xmlRelaxNGSetValidErrors        (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br />                                    <a href="libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br />                                   <a href="libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br />                                      void * ctx)<br />
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlRelaxNGSetValidStructuredErrors" id="xmlRelaxNGSetValidStructuredErrors"></a>Function: xmlRelaxNGSetValidStructuredErrors</h3><pre class="programlisting">void      xmlRelaxNGSetValidStructuredErrors      (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br />                                            <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br />                                                 void * ctx)<br />
 </pre><p>Set the structured error callback</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a Relax-NG validation context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlRelaxNGValidateDoc" id="xmlRelaxNGValidateDoc"></a>Function: xmlRelaxNGValidateDoc</h3><pre class="programlisting">int      xmlRelaxNGValidateDoc           (<a href="libxml-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br />                                    <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
@@ -158,5 +158,5 @@ void        xmlRelaxNGValidityErrorFunc     (void * ctx, <br />                                      const char * msg, <br
 void   xmlRelaxNGValidityWarningFunc   (void * ctx, <br />                                      const char * msg, <br />                                        ... ...)
 </pre><p>Signature of a warning callback from a Relax-NG validation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div><br />
 <h3><a name="xmlRelaxParserSetFlag" id="xmlRelaxParserSetFlag"></a>Function: xmlRelaxParserSetFlag</h3><pre class="programlisting">int xmlRelaxParserSetFlag           (<a href="libxml-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br />                                  int flags)<br />
-</pre><p>Semi private function used to pass informations to a parser context which are a combination of <a href="libxml-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
+</pre><p>Semi private function used to pass information to a parser context which are a combination of <a href="libxml-relaxng.html#xmlRelaxNGParserFlag">xmlRelaxNGParserFlag</a> .</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a RelaxNG parser context</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of flags values</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if success and -1 in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index e78af7b..d6120bc 100644 (file)
@@ -253,7 +253,7 @@ The content of this structure is not made public by the API.
     struct _xmlDoc *   doc     : the containing document
     <a href="libxml-tree.html#xmlNs">xmlNs</a> *       ns      : pointer to the associated namespace
     <a href="libxml-tree.html#xmlAttributeType">xmlAttributeType</a>   atype   : the <a href="libxml-SAX.html#attribute">attribute</a> type if validating
-    void *     psvi    : for type/PSVI informations
+    void *     psvi    : for type/PSVI information
 }</pre><h3><a name="xmlAttribute" id="xmlAttribute">Structure xmlAttribute</a></h3><pre class="programlisting">Structure xmlAttribute<br />struct _xmlAttribute {
     void *     _private        : application data
     <a href="libxml-tree.html#xmlElementType">xmlElementType</a>       type    : XML_ATTRIBUTE_DECL, must be second !
@@ -334,7 +334,7 @@ The content of this structure is not made public by the API.
     const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *        URL     : The URI for that document
     int        charset : Internal flag for charset handling, act
     struct _xmlDict *  dict    : dict used to allocate names or NULL
-    void *     psvi    : for type/PSVI informations
+    void *     psvi    : for type/PSVI information
     int        parseFlags      : set of <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a> used to parse th
     int        properties      : set of <a href="libxml-tree.html#xmlDocProperties">xmlDocProperties</a> for this docume
 }</pre><h3>Enum <a name="xmlDocProperties" id="xmlDocProperties">xmlDocProperties</a></h3><pre class="programlisting">Enum xmlDocProperties {
@@ -474,7 +474,7 @@ The content of this structure is not made public by the API.
     <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *      content : the content
     struct _xmlAttr *  properties      : properties list
     <a href="libxml-tree.html#xmlNs">xmlNs</a> *       nsDef   : namespace definitions on this node
-    void *     psvi    : for type/PSVI informations
+    void *     psvi    : for type/PSVI information
     unsigned short     line    : line number
     unsigned short     extra   : extra data for XPath/XSLT
 }</pre><h3><a name="xmlNotation" id="xmlNotation">Structure xmlNotation</a></h3><pre class="programlisting">Structure xmlNotation<br />struct _xmlNotation {
@@ -531,7 +531,7 @@ The content of this structure is not made public by the API.
     int        nameNr  : Depth of the parsing stack
     int        nameMax : Max depth of the parsing stack
     const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * *      nameTab : array of nodes
-    long       nbChars : number of <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> processed
+    long       nbChars : unused
     long       checkIndex      : used by progressive parsing lookup
     int        keepBlanks      : ugly but ...
     int        disableSAX      : SAX callbacks are disabled
@@ -567,7 +567,7 @@ The content of this structure is not made public by the API.
     int        nsMax   : the size of the arrays
     const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * *      nsTab   : the array of prefix/namespace name
     int *      attallocs       : which <a href="libxml-SAX.html#attribute">attribute</a> were allocated
-    void * *   pushTab : array of data for push
+    <a href="libxml-parser.html#xmlStartTag">xmlStartTag</a> * pushTab : array of data for push
     <a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>     attsDefault     : defaulted attributes if any
     <a href="libxml-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>     attsSpecial     : non-CDATA attributes if any
     int        nsWellFormed    : is the document XML Namespace okay
@@ -576,7 +576,7 @@ The content of this structure is not made public by the API.
     int        freeElemsNr     : number of freed element nodes
     <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>       freeElems       : List of freed element nodes
     int        freeAttrsNr     : number of freed attributes nodes
-    <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a>       freeAttrs       : * the complete error informations for th
+    <a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a>       freeAttrs       : * the complete error information for the
     <a href="libxml-xmlerror.html#xmlError">xmlError</a>       lastError
     <a href="libxml-parser.html#xmlParserMode">xmlParserMode</a>       parseMode       : the parser mode
     unsigned long      nbentities      : number of entities references
@@ -851,7 +851,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td>namespace if any</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the node name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the XML text content if any</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div><h3><a name="xmlNewDocPI" id="xmlNewDocPI"></a>Function: xmlNewDocPI</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>       xmlNewDocPI             (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
 </pre><p>Creation of a processing instruction element.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the target document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the processing instruction name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the PI content</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div><h3><a name="xmlNewDocProp" id="xmlNewDocProp"></a>Function: xmlNewDocProp</h3><pre class="programlisting"><a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a>     xmlNewDocProp           (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value)<br />
-</pre><p>Create a new property carried by a document.</p>
+</pre><p>Create a new property carried by a document. NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need entities support.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the name of the <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>the value of the <a href="libxml-SAX.html#attribute">attribute</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the <a href="libxml-SAX.html#attribute">attribute</a></td></tr></tbody></table></div><h3><a name="xmlNewDocRawNode" id="xmlNewDocRawNode"></a>Function: xmlNewDocRawNode</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>      xmlNewDocRawNode        (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  <a href="libxml-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br />                                     const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
 </pre><p>Creation of a new node element within a document. @ns and @content are optional (NULL).</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>the document</td></tr><tr><td><span class="term"><i><tt>ns</tt></i>:</span></td><td>namespace if any</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the node name</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the text content if any</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the new node object.</td></tr></tbody></table></div><h3><a name="xmlNewDocText" id="xmlNewDocText"></a>Function: xmlNewDocText</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a>     xmlNewDocText           (const <a href="libxml-tree.html#xmlDoc">xmlDoc</a> * doc, <br />                                        const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
index 5fcf09b..1da2774 100644 (file)
@@ -47,7 +47,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an XML document</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a> used for parsing XML includes</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessFlagsData" id="xmlXIncludeProcessFlagsData"></a>Function: xmlXIncludeProcessFlagsData</h3><pre class="programlisting">int  xmlXIncludeProcessFlagsData     (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br />                                  int flags, <br />                                       void * data)<br />
 </pre><p>Implement the XInclude substitution on the XML document @doc</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>an XML document</td></tr><tr><td><span class="term"><i><tt>flags</tt></i>:</span></td><td>a set of <a href="libxml-parser.html#xmlParserOption">xmlParserOption</a> used for parsing XML includes</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>application data that will be passed to the parser context in the _private field of the parser context(s)</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessNode" id="xmlXIncludeProcessNode"></a>Function: xmlXIncludeProcessNode</h3><pre class="programlisting">int      xmlXIncludeProcessNode          (<a href="libxml-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br />                                   <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
-</pre><p>Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.</p>
+</pre><p>Implement the XInclude substitution for the given subtree reusing the information and data coming from the given context.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>an existing XInclude context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>a node in an XML document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessTree" id="xmlXIncludeProcessTree"></a>Function: xmlXIncludeProcessTree</h3><pre class="programlisting">int  xmlXIncludeProcessTree          (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> tree)<br />
 </pre><p>Implement the XInclude substitution for the given subtree</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>tree</tt></i>:</span></td><td>a node in an XML document</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if no substitution were done, -1 if some processing failed or the number of substitutions done.</td></tr></tbody></table></div><h3><a name="xmlXIncludeProcessTreeFlags" id="xmlXIncludeProcessTreeFlags"></a>Function: xmlXIncludeProcessTreeFlags</h3><pre class="programlisting">int xmlXIncludeProcessTreeFlags     (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br />                                       int flags)<br />
index a3118df..f3e5753 100644 (file)
@@ -79,6 +79,7 @@ int   <a href="#xmlOutputWriteCallback">xmlOutputWriteCallback</a>            (void * contex
 <pre class="programlisting">int        <a href="#xmlParserInputBufferPush">xmlParserInputBufferPush</a>        (<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br />                                       int len, <br />                                         const char * buf)</pre>
 <pre class="programlisting">int        <a href="#xmlParserInputBufferRead">xmlParserInputBufferRead</a>        (<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br />                                       int len)</pre>
 <pre class="programlisting">int        <a href="#xmlPopInputCallbacks">xmlPopInputCallbacks</a>                (void)</pre>
+<pre class="programlisting">int        <a href="#xmlPopOutputCallbacks">xmlPopOutputCallbacks</a>              (void)</pre>
 <pre class="programlisting">void       <a href="#xmlRegisterDefaultInputCallbacks">xmlRegisterDefaultInputCallbacks</a>        (void)</pre>
 <pre class="programlisting">void       <a href="#xmlRegisterDefaultOutputCallbacks">xmlRegisterDefaultOutputCallbacks</a>      (void)</pre>
 <pre class="programlisting">void       <a href="#xmlRegisterHTTPPostCallbacks">xmlRegisterHTTPPostCallbacks</a>        (void)</pre>
@@ -199,7 +200,9 @@ int xmlOutputWriteCallback          (void * context, <br />                                  const char * buffer, <b
 </pre><p>Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>a buffered parser input</td></tr><tr><td><span class="term"><i><tt>len</tt></i>:</span></td><td>indicative value of the amount of chars to read</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of chars read and stored in the buffer, or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlPopInputCallbacks" id="xmlPopInputCallbacks"></a>Function: xmlPopInputCallbacks</h3><pre class="programlisting">int xmlPopInputCallbacks            (void)<br />
 </pre><p>Clear the top input callback from the input stack. this includes the compiled-in I/O.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of input callback registered or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegisterDefaultInputCallbacks" id="xmlRegisterDefaultInputCallbacks"></a>Function: xmlRegisterDefaultInputCallbacks</h3><pre class="programlisting">void      xmlRegisterDefaultInputCallbacks        (void)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of input callback registered or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlPopOutputCallbacks" id="xmlPopOutputCallbacks"></a>Function: xmlPopOutputCallbacks</h3><pre class="programlisting">int        xmlPopOutputCallbacks           (void)<br />
+</pre><p>Remove the top output callbacks from the output stack. This includes the compiled-in I/O.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of output callback registered or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegisterDefaultInputCallbacks" id="xmlRegisterDefaultInputCallbacks"></a>Function: xmlRegisterDefaultInputCallbacks</h3><pre class="programlisting">void     xmlRegisterDefaultInputCallbacks        (void)<br />
 </pre><p>Registers the default compiled-in I/O handlers.</p>
 <h3><a name="xmlRegisterDefaultOutputCallbacks" id="xmlRegisterDefaultOutputCallbacks"></a>Function: xmlRegisterDefaultOutputCallbacks</h3><pre class="programlisting">void    xmlRegisterDefaultOutputCallbacks       (void)<br />
 </pre><p>Registers the default compiled-in I/O handlers.</p>
index 1b418a3..5858f63 100644 (file)
@@ -844,7 +844,7 @@ void        xmlGenericErrorFunc             (void * ctx, <br />                                      const char * msg, <br />
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message to display/transmit</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra parameters for the message display</td></tr></tbody></table></div><h3><a name="xmlParserPrintFileContext" id="xmlParserPrintFileContext"></a>Function: xmlParserPrintFileContext</h3><pre class="programlisting">void        xmlParserPrintFileContext       (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
 </pre><p>Displays current context within the input content for error tracking</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div><h3><a name="xmlParserPrintFileInfo" id="xmlParserPrintFileInfo"></a>Function: xmlParserPrintFileInfo</h3><pre class="programlisting">void  xmlParserPrintFileInfo          (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
-</pre><p>Displays the associated file and line informations for the current input</p>
+</pre><p>Displays the associated file and line information for the current input</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td>an <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input</td></tr></tbody></table></div><h3><a name="xmlParserValidityError" id="xmlParserValidityError"></a>Function: xmlParserValidityError</h3><pre class="programlisting">void  xmlParserValidityError          (void * ctx, <br />                                      const char * msg, <br />                                        ... ...)<br />
 </pre><p>Display and format an validity error messages, gives file, line, position and extra parameters.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>an XML parser context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message to display/transmit</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra parameters for the message display</td></tr></tbody></table></div><h3><a name="xmlParserValidityWarning" id="xmlParserValidityWarning"></a>Function: xmlParserValidityWarning</h3><pre class="programlisting">void   xmlParserValidityWarning        (void * ctx, <br />                                      const char * msg, <br />                                        ... ...)<br />
index a5a4d75..a0f2aae 100644 (file)
@@ -10,10 +10,11 @@ A:link, A:visited, A:active { text-decoration: underline }
 </style><style type="text/css">
       div.deprecated pre.programlisting {border-style: double;border-color:red}
       pre.programlisting {border-style: double;background: #EECFA1}
-    </style><title>Module xmlexports from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlexports from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlerror.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlerror.html">xmlerror</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlmemory.html">xmlmemory</a></th><td><a accesskey="n" href="libxml-xmlmemory.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>macros for marking symbols as exportable/importable. </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBXML_DLL_IMPORT">LIBXML_DLL_IMPORT</a></pre><pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a></pre><pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a></pre><pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a></pre><pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a></pre><h2>Description</h2>
+    </style><title>Module xmlexports from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlexports from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlerror.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlerror.html">xmlerror</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlmemory.html">xmlmemory</a></th><td><a accesskey="n" href="libxml-xmlmemory.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>macros for marking symbols as exportable/importable. </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#LIBXML_DLL_IMPORT">LIBXML_DLL_IMPORT</a></pre><pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a></pre><pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a></pre><pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a></pre><pre class="programlisting">#define <a href="#XMLPUBLIC">XMLPUBLIC</a></pre><pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a></pre><h2>Description</h2>
 <h3><a name="LIBXML_DLL_IMPORT" id="LIBXML_DLL_IMPORT"></a>Macro: LIBXML_DLL_IMPORT</h3><pre>#define LIBXML_DLL_IMPORT</pre><p></p>
-<h3><a name="XMLCALL" id="XMLCALL"></a>Macro: XMLCALL</h3><pre>#define XMLCALL</pre><p></p>
-<h3><a name="XMLCDECL" id="XMLCDECL"></a>Macro: XMLCDECL</h3><pre>#define XMLCDECL</pre><p></p>
-<h3><a name="XMLPUBFUN" id="XMLPUBFUN"></a>Macro: XMLPUBFUN</h3><pre>#define XMLPUBFUN</pre><p></p>
-<h3><a name="XMLPUBVAR" id="XMLPUBVAR"></a>Macro: XMLPUBVAR</h3><pre>#define XMLPUBVAR</pre><p></p>
+<h3><a name="XMLCALL" id="XMLCALL"></a>Macro: XMLCALL</h3><pre>#define XMLCALL</pre><p>Macro which declares the calling convention for exported functions</p>
+<h3><a name="XMLCDECL" id="XMLCDECL"></a>Macro: XMLCDECL</h3><pre>#define XMLCDECL</pre><p>Macro which declares the calling convention for exported functions that use '...'.</p>
+<h3><a name="XMLPUBFUN" id="XMLPUBFUN"></a>Macro: XMLPUBFUN</h3><pre>#define XMLPUBFUN</pre><p>Macro which declares an exportable function</p>
+<h3><a name="XMLPUBLIC" id="XMLPUBLIC"></a>Macro: XMLPUBLIC</h3><pre>#define XMLPUBLIC</pre><p>Macro which declares a public symbol</p>
+<h3><a name="XMLPUBVAR" id="XMLPUBVAR"></a>Macro: XMLPUBVAR</h3><pre>#define XMLPUBVAR</pre><p>Macro which declares an exportable variable</p>
 <p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index bb1debc..138b6ae 100644 (file)
@@ -280,7 +280,7 @@ void        xmlTextReaderErrorFunc          (void * arg, <br />                                      const char * msg, <br />
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the node was read successfully, 0 if there is no more nodes to read, or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderNodeType" id="xmlTextReaderNodeType"></a>Function: xmlTextReaderNodeType</h3><pre class="programlisting">int     xmlTextReaderNodeType           (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
 </pre><p>Get the node type of the current node Reference: http://www.gnu.org/software/dotgnu/pnetlib-doc/System/Xml/XmlNodeType.html</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlReaderTypes">xmlReaderTypes</a> of the current node or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderNormalization" id="xmlTextReaderNormalization"></a>Function: xmlTextReaderNormalization</h3><pre class="programlisting">int      xmlTextReaderNormalization      (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
-</pre><p>The value indicating whether to normalize white space and <a href="libxml-SAX.html#attribute">attribute</a> values. Since <a href="libxml-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</p>
+</pre><p>The value indicating whether to normalize white space and <a href="libxml-SAX.html#attribute">attribute</a> values. Since <a href="libxml-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlTextReaderPrefix" id="xmlTextReaderPrefix"></a>Function: xmlTextReaderPrefix</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> *        xmlTextReaderPrefix     (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
 </pre><p>A shorthand <a href="libxml-SAX.html#reference">reference</a> to the namespace associated with the node.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>reader</tt></i>:</span></td><td>the <a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> used</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the prefix or NULL if not available, if non NULL it need to be freed by the caller.</td></tr></tbody></table></div><h3><a name="xmlTextReaderPreserve" id="xmlTextReaderPreserve"></a>Function: xmlTextReaderPreserve</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlTextReaderPreserve   (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
index 99b7636..7300e5b 100644 (file)
@@ -119,9 +119,9 @@ The content of this structure is not made public by the API.
 void   xmlRegExecCallbacks             (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * token, <br />                                       void * transdata, <br />                                        void * inputdata)
 </pre><p>Callback function when doing a transition in the automata</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>the regular expression context</td></tr><tr><td><span class="term"><i><tt>token</tt></i>:</span></td><td>the current token string</td></tr><tr><td><span class="term"><i><tt>transdata</tt></i>:</span></td><td>transition data</td></tr><tr><td><span class="term"><i><tt>inputdata</tt></i>:</span></td><td>input data</td></tr></tbody></table></div><br />
 <h3><a name="xmlRegExecErrInfo" id="xmlRegExecErrInfo"></a>Function: xmlRegExecErrInfo</h3><pre class="programlisting">int     xmlRegExecErrInfo               (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** string, <br />                                     int * nbval, <br />                                     int * nbneg, <br />                                     <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** values, <br />                                   int * terminal)<br />
-</pre><p>Extract error informations from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context generating an error</td></tr><tr><td><span class="term"><i><tt>string</tt></i>:</span></td><td>return value for the error string</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegExecNextValues" id="xmlRegExecNextValues"></a>Function: xmlRegExecNextValues</h3><pre class="programlisting">int   xmlRegExecNextValues            (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br />                                    int * nbval, <br />                                     int * nbneg, <br />                                     <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> ** values, <br />                                   int * terminal)<br />
-</pre><p>Extract informations from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
+</pre><p>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context</td></tr><tr><td><span class="term"><i><tt>nbval</tt></i>:</span></td><td>pointer to the number of accepted values IN/OUT</td></tr><tr><td><span class="term"><i><tt>nbneg</tt></i>:</span></td><td>return number of negative transitions</td></tr><tr><td><span class="term"><i><tt>values</tt></i>:</span></td><td>pointer to the array of acceptable values</td></tr><tr><td><span class="term"><i><tt>terminal</tt></i>:</span></td><td>return value if this was a terminal state</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>will be freed with the @exec context and don't need to be deallocated. Returns: 0 in case of success or -1 in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegExecPushString" id="xmlRegExecPushString"></a>Function: xmlRegExecPushString</h3><pre class="programlisting">int    xmlRegExecPushString            (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value, <br />                                       void * data)<br />
 </pre><p>Push one input token in the execution context</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td>a regexp execution context or NULL to indicate the end</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>a string token input</td></tr><tr><td><span class="term"><i><tt>data</tt></i>:</span></td><td>data associated to the token to reuse in callbacks</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the regexp reached a final state, 0 if non-final, and a negative value in case of error.</td></tr></tbody></table></div><h3><a name="xmlRegExecPushString2" id="xmlRegExecPushString2"></a>Function: xmlRegExecPushString2</h3><pre class="programlisting">int       xmlRegExecPushString2           (<a href="libxml-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br />                                    const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value, <br />                                       const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value2, <br />                                      void * data)<br />
index c3bea9f..2435000 100644 (file)
@@ -23,7 +23,7 @@ The content of this structure is not made public by the API.
 <pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>    <a href="#xmlSaveToFd">xmlSaveToFd</a>          (int fd, <br />                                  const char * encoding, <br />                                   int options)</pre>
 <pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>    <a href="#xmlSaveToFilename">xmlSaveToFilename</a>      (const char * filename, <br />                                   const char * encoding, <br />                                   int options)</pre>
 <pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>    <a href="#xmlSaveToIO">xmlSaveToIO</a>          (<a href="libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a> iowrite, <br />                                   <a href="libxml-xmlIO.html#xmlOutputCloseCallback">xmlOutputCloseCallback</a> ioclose, <br />                                   void * ioctx, <br />                                    const char * encoding, <br />                                   int options)</pre>
-<pre class="programlisting">long       <a href="#xmlSaveTree">xmlSaveTree</a>                  (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br />                                    <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)</pre>
+<pre class="programlisting">long       <a href="#xmlSaveTree">xmlSaveTree</a>                  (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br />                                    <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur)</pre>
 <h2>Description</h2>
 <h3><a name="xmlSaveCtxt" id="xmlSaveCtxt">Structure xmlSaveCtxt</a></h3><pre class="programlisting">Structure xmlSaveCtxt<br />struct _xmlSaveCtxt {
 The content of this structure is not made public by the API.
@@ -55,6 +55,6 @@ The content of this structure is not made public by the API.
 </pre><p>Create a document saving context serializing to a filename or possibly to an URL (but this is less reliable) with the encoding and the options given.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td>a file name or an URL</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSaveToIO" id="xmlSaveToIO"></a>Function: xmlSaveToIO</h3><pre class="programlisting"><a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>       xmlSaveToIO             (<a href="libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a> iowrite, <br />                                   <a href="libxml-xmlIO.html#xmlOutputCloseCallback">xmlOutputCloseCallback</a> ioclose, <br />                                   void * ioctx, <br />                                    const char * encoding, <br />                                   int options)<br />
 </pre><p>Create a document saving context serializing to a file descriptor with the encoding and the options given</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iowrite</tt></i>:</span></td><td>an I/O write function</td></tr><tr><td><span class="term"><i><tt>ioclose</tt></i>:</span></td><td>an I/O close function</td></tr><tr><td><span class="term"><i><tt>ioctx</tt></i>:</span></td><td>an I/O handler</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSaveTree" id="xmlSaveTree"></a>Function: xmlSaveTree</h3><pre class="programlisting">long        xmlSaveTree                     (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br />                                    <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>iowrite</tt></i>:</span></td><td>an I/O write function</td></tr><tr><td><span class="term"><i><tt>ioclose</tt></i>:</span></td><td>an I/O close function</td></tr><tr><td><span class="term"><i><tt>ioctx</tt></i>:</span></td><td>an I/O handler</td></tr><tr><td><span class="term"><i><tt>encoding</tt></i>:</span></td><td>the encoding name to use or NULL</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a set of xmlSaveOptions</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new serialization context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSaveTree" id="xmlSaveTree"></a>Function: xmlSaveTree</h3><pre class="programlisting">long        xmlSaveTree                     (<a href="libxml-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br />                                    <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br />
 </pre><p>Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the top node of the subtree to save</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a document saving context</td></tr><tr><td><span class="term"><i><tt>cur</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the number of byte written or -1 in case of error</td></tr></tbody></table></div><p><a href="../bugs.html">Daniel Veillard</a></p></td></tr></table></td></tr></table></td></tr></table></td></tr></table></td></tr></table></body></html>
index 3729afb..5f2e1df 100644 (file)
@@ -130,7 +130,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr></tbody></table></div><h3><a name="xmlSchemaGetParserErrors" id="xmlSchemaGetParserErrors"></a>Function: xmlSchemaGetParserErrors</h3><pre class="programlisting">int    xmlSchemaGetParserErrors        (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br />                                         <a href="libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br />                                        <a href="libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br />                                   void ** ctx)<br />
 </pre><p>Get the callback information used to handle errors for a parser context</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XMl-Schema parser context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of failure, 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlSchemaGetValidErrors" id="xmlSchemaGetValidErrors"></a>Function: xmlSchemaGetValidErrors</h3><pre class="programlisting">int  xmlSchemaGetValidErrors         (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />                                   <a href="libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> * err, <br />                                        <a href="libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> * warn, <br />                                   void ** ctx)<br />
-</pre><p>Get the error and warning callback informations</p>
+</pre><p>Get the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a XML-Schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function result</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function result</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context result</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error and 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlSchemaIsValid" id="xmlSchemaIsValid"></a>Function: xmlSchemaIsValid</h3><pre class="programlisting">int      xmlSchemaIsValid                (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
 </pre><p>Check if any error was detected during validation.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>the schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid so far, 0 if errors were detected, and -1 in case of internal error.</td></tr></tbody></table></div><h3><a name="xmlSchemaNewDocParserCtxt" id="xmlSchemaNewDocParserCtxt"></a>Function: xmlSchemaNewDocParserCtxt</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a>      xmlSchemaNewDocParserCtxt       (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
@@ -152,7 +152,7 @@ The content of this structure is not made public by the API.
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error callback</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning callback</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>contextual data for the callbacks</td></tr></tbody></table></div><h3><a name="xmlSchemaSetParserStructuredErrors" id="xmlSchemaSetParserStructuredErrors"></a>Function: xmlSchemaSetParserStructuredErrors</h3><pre class="programlisting">void    xmlSchemaSetParserStructuredErrors      (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br />                                                 <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br />                                                 void * ctx)<br />
 </pre><p>Set the structured error callback</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema parser context</td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td>the structured error function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlSchemaSetValidErrors" id="xmlSchemaSetValidErrors"></a>Function: xmlSchemaSetValidErrors</h3><pre class="programlisting">void     xmlSchemaSetValidErrors         (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />                                   <a href="libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br />                                  <a href="libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br />                                     void * ctx)<br />
-</pre><p>Set the error and warning callback informations</p>
+</pre><p>Set the error and warning callback information</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td>the error function</td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td>the warning function</td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the functions context</td></tr></tbody></table></div><h3><a name="xmlSchemaSetValidOptions" id="xmlSchemaSetValidOptions"></a>Function: xmlSchemaSetValidOptions</h3><pre class="programlisting">int       xmlSchemaSetValidOptions        (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />                                   int options)<br />
 </pre><p>Sets the options to be used during the validation.</p>
 <div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td>a schema validation context</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a combination of <a href="libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of an API error.</td></tr></tbody></table></div><h3><a name="xmlSchemaSetValidStructuredErrors" id="xmlSchemaSetValidStructuredErrors"></a>Function: xmlSchemaSetValidStructuredErrors</h3><pre class="programlisting">void        xmlSchemaSetValidStructuredErrors       (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br />                                           <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br />                                                 void * ctx)<br />
@@ -178,7 +178,7 @@ void        xmlSchemaValidityErrorFunc      (void * ctx, <br />                                      const char * msg, <br /
 </pre><p>Signature of an error callback from an XSD validation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div><br />
 <h3><a name="xmlSchemaValidityLocatorFunc" id="xmlSchemaValidityLocatorFunc"></a>Function type: xmlSchemaValidityLocatorFunc</h3><pre class="programlisting">Function type: xmlSchemaValidityLocatorFunc
 int    xmlSchemaValidityLocatorFunc    (void * ctx, <br />                                      const char ** file, <br />                                      unsigned long * line)
-</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>user provided context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>returned file information</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>returned line information</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error</td></tr></tbody></table></div><br />
+</pre><p>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>user provided context</td></tr><tr><td><span class="term"><i><tt>file</tt></i>:</span></td><td>returned file information</td></tr><tr><td><span class="term"><i><tt>line</tt></i>:</span></td><td>returned line information</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success and -1 in case of error</td></tr></tbody></table></div><br />
 <h3><a name="xmlSchemaValidityWarningFunc" id="xmlSchemaValidityWarningFunc"></a>Function type: xmlSchemaValidityWarningFunc</h3><pre class="programlisting">Function type: xmlSchemaValidityWarningFunc
 void   xmlSchemaValidityWarningFunc    (void * ctx, <br />                                      const char * msg, <br />                                        ... ...)
 </pre><p>Signature of a warning callback from an XSD validation</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td>the validation context</td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td>the message</td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td>extra arguments</td></tr></tbody></table></div><br />
index 8690468..d60f08e 100644 (file)
@@ -10,7 +10,7 @@ A:link, A:visited, A:active { text-decoration: underline }
 </style><style type="text/css">
       div.deprecated pre.programlisting {border-style: double;border-color:red}
       pre.programlisting {border-style: double;background: #EECFA1}
-    </style><title>Module xmlversion from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlversion from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlunicode.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlunicode.html">xmlunicode</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlwriter.html">xmlwriter</a></th><td><a accesskey="n" href="libxml-xmlwriter.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>compile-time version informations for the XML library </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#ATTRIBUTE_UNUSED">ATTRIBUTE_UNUSED</a></pre><pre class="programlisting">#define <a href="#DEBUG_MEMORY_LOCATION">DEBUG_MEMORY_LOCATION</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_ALLOC_SIZE">LIBXML_ATTR_ALLOC_SIZE</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_FORMAT">LIBXML_ATTR_FORMAT</a></pre><pre class="programlisting">#define <a href="#LIBXML_AUTOMATA_ENABLED">LIBXML_AUTOMATA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_C14N_ENABLED">LIBXML_C14N_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_CATALOG_ENABLED">LIBXML_CATALOG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_ENABLED">LIBXML_DEBUG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_RUNTIME">LIBXML_DEBUG_RUNTIME</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOCB_ENABLED">LIBXML_DOCB_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOTTED_VERSION">LIBXML_DOTTED_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_EXPR_ENABLED">LIBXML_EXPR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTTP_ENABLED">LIBXML_HTTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICONV_ENABLED">LIBXML_ICONV_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICU_ENABLED">LIBXML_ICU_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ISO8859X_ENABLED">LIBXML_ISO8859X_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LZMA_ENABLED">LIBXML_LZMA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_OUTPUT_ENABLED">LIBXML_OUTPUT_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PATTERN_ENABLED">LIBXML_PATTERN_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_READER_ENABLED">LIBXML_READER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_REGEXP_ENABLED">LIBXML_REGEXP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMAS_ENABLED">LIBXML_SCHEMAS_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ALLOC_ENABLED">LIBXML_THREAD_ALLOC_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ENABLED">LIBXML_THREAD_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TREE_ENABLED">LIBXML_TREE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VALID_ENABLED">LIBXML_VALID_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION">LIBXML_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_STRING">LIBXML_VERSION_STRING</a></pre><pre class="programlisting">#define <a href="#LIBXML_WRITER_ENABLED">LIBXML_WRITER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XINCLUDE_ENABLED">LIBXML_XINCLUDE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPATH_ENABLED">LIBXML_XPATH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPTR_ENABLED">LIBXML_XPTR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a></pre><pre class="programlisting">#define <a href="#WITHOUT_TRIO">WITHOUT_TRIO</a></pre><pre class="programlisting">#define <a href="#WITH_TRIO">WITH_TRIO</a></pre><pre class="programlisting">void      <a href="#xmlCheckVersion">xmlCheckVersion</a>                  (int version)</pre>
+    </style><title>Module xmlversion from libxml2</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="../epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="../gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="../w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="../redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="../Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1></h1><h2>Module xmlversion from libxml2</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="../search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a style="font-weight:bold" href="../index.html">Main Menu</a></li><li><a style="font-weight:bold" href="../docs.html">Developer Menu</a></li><li><a style="font-weight:bold" href="../examples/index.html">Code Examples</a></li><li><a style="font-weight:bold" href="index.html">API Menu</a></li><li><a href="libxml-parser.html">Parser API</a></li><li><a href="libxml-tree.html">Tree API</a></li><li><a href="libxml-xmlreader.html">Reader API</a></li><li><a href="../guidelines.html">XML Guidelines</a></li><li><a href="../ChangeLog.html">ChangeLog</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>API Indexes</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="../APIchunk0.html">Alphabetic</a></li><li><a href="../APIconstructors.html">Constructors</a></li><li><a href="../APIfunctions.html">Functions/Types</a></li><li><a href="../APIfiles.html">Modules</a></li><li><a href="../APIsymbols.html">Symbols</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="libxml-xmlunicode.html"><img src="left.png" width="24" height="24" border="0" alt="Prev" /></a></td><th align="left"><a href="libxml-xmlunicode.html">xmlunicode</a></th><td><a accesskey="u" href="index.html"><img src="up.png" width="24" height="24" border="0" alt="Up" /></a></td><th align="left"><a href="index.html">API documentation</a></th><td><a accesskey="h" href="../index.html"><img src="home.png" width="24" height="24" border="0" alt="Home" /></a></td><th align="center"><a href="../index.html">The XML C parser and toolkit of Gnome</a></th><th align="right"><a href="libxml-xmlwriter.html">xmlwriter</a></th><td><a accesskey="n" href="libxml-xmlwriter.html"><img src="right.png" width="24" height="24" border="0" alt="Next" /></a></td></tr></table><p>compile-time version information for the XML library </p><h2>Table of Contents</h2><pre class="programlisting">#define <a href="#ATTRIBUTE_UNUSED">ATTRIBUTE_UNUSED</a></pre><pre class="programlisting">#define <a href="#DEBUG_MEMORY_LOCATION">DEBUG_MEMORY_LOCATION</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_ALLOC_SIZE">LIBXML_ATTR_ALLOC_SIZE</a></pre><pre class="programlisting">#define <a href="#LIBXML_ATTR_FORMAT">LIBXML_ATTR_FORMAT</a></pre><pre class="programlisting">#define <a href="#LIBXML_AUTOMATA_ENABLED">LIBXML_AUTOMATA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_C14N_ENABLED">LIBXML_C14N_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_CATALOG_ENABLED">LIBXML_CATALOG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_ENABLED">LIBXML_DEBUG_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DEBUG_RUNTIME">LIBXML_DEBUG_RUNTIME</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOCB_ENABLED">LIBXML_DOCB_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_DOTTED_VERSION">LIBXML_DOTTED_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_EXPR_ENABLED">LIBXML_EXPR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_HTTP_ENABLED">LIBXML_HTTP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICONV_ENABLED">LIBXML_ICONV_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ICU_ENABLED">LIBXML_ICU_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ISO8859X_ENABLED">LIBXML_ISO8859X_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_LZMA_ENABLED">LIBXML_LZMA_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_OUTPUT_ENABLED">LIBXML_OUTPUT_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PATTERN_ENABLED">LIBXML_PATTERN_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_READER_ENABLED">LIBXML_READER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_REGEXP_ENABLED">LIBXML_REGEXP_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMAS_ENABLED">LIBXML_SCHEMAS_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ALLOC_ENABLED">LIBXML_THREAD_ALLOC_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_THREAD_ENABLED">LIBXML_THREAD_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_TREE_ENABLED">LIBXML_TREE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VALID_ENABLED">LIBXML_VALID_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION">LIBXML_VERSION</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a></pre><pre class="programlisting">#define <a href="#LIBXML_VERSION_STRING">LIBXML_VERSION_STRING</a></pre><pre class="programlisting">#define <a href="#LIBXML_WRITER_ENABLED">LIBXML_WRITER_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XINCLUDE_ENABLED">LIBXML_XINCLUDE_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPATH_ENABLED">LIBXML_XPATH_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_XPTR_ENABLED">LIBXML_XPTR_ENABLED</a></pre><pre class="programlisting">#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a></pre><pre class="programlisting">#define <a href="#WITHOUT_TRIO">WITHOUT_TRIO</a></pre><pre class="programlisting">#define <a href="#WITH_TRIO">WITH_TRIO</a></pre><pre class="programlisting">void       <a href="#xmlCheckVersion">xmlCheckVersion</a>                  (int version)</pre>
 <h2>Description</h2>
 <h3><a name="ATTRIBUTE_UNUSED" id="ATTRIBUTE_UNUSED"></a>Macro: ATTRIBUTE_UNUSED</h3><pre>#define ATTRIBUTE_UNUSED</pre><p>Macro used to signal to GCC unused function parameters</p>
 <h3><a name="DEBUG_MEMORY_LOCATION" id="DEBUG_MEMORY_LOCATION"></a>Macro: DEBUG_MEMORY_LOCATION</h3><pre>#define DEBUG_MEMORY_LOCATION</pre><p>Whether the memory debugging is configured in</p>
index 5bdd564..7820307 100644 (file)
@@ -147,8 +147,6 @@ The content of this structure is not made public by the API.
     unsigned long      opLimit
     unsigned long      opCount
     int        depth
-    int        maxDepth
-    int        maxParserDepth
 }</pre><h3>Enum <a name="xmlXPathError" id="xmlXPathError">xmlXPathError</a></h3><pre class="programlisting">Enum xmlXPathError {
     <a name="XPATH_EXPRESSION_OK" id="XPATH_EXPRESSION_OK">XPATH_EXPRESSION_OK</a> = 0
     <a name="XPATH_NUMBER_ERROR" id="XPATH_NUMBER_ERROR">XPATH_NUMBER_ERROR</a> = 1
index 006b4bf..d26d4d8 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<book xmlns="http://www.devhelp.net/book" title="Gnome XML Library Reference Manual " link="index.html" author="" name="libxml">
+<book xmlns="http://www.devhelp.net/book" title="Gnome XML Library Reference Manual " link="index.html" version="2" author="" name="libxml">
   <chapters>
     <sub name="Libxml Programming Notes" link="ch01.html">
       <sub name="testOOMlib" link="libxml-testOOMlib.html"/>
index 77f9692..e254dc4 100755 (executable)
@@ -28,7 +28,7 @@
 #    Bye
 #
 # Then run the script in the doc subdir, it will create the symbols and
-# word tables and populate them with informations extracted from 
+# word tables and populate them with information extracted from 
 # the libxml2-api.xml API description, and make them accessible read-only
 # by nobody@loaclhost the user expected to be Apache's one
 #
@@ -1177,7 +1177,7 @@ def analyzeAPITop():
     try:
        doc = loadAPI(API)
        ret = analyzeAPI(doc)
-       print "Analyzed %d blocs" % (ret)
+       print "Analyzed %d blocks" % (ret)
        doc.freeDoc()
     except:
        print "Failed to parse and analyze %s" % (API)
index f264a29..c31b6a7 100644 (file)
      <exports symbol='xmlParserNodeInfoSeq' type='typedef'/>
      <exports symbol='xmlFeature' type='typedef'/>
      <exports symbol='xmlParserMode' type='typedef'/>
+     <exports symbol='xmlStartTag' type='typedef'/>
      <exports symbol='xmlParserOption' type='typedef'/>
      <exports symbol='xmlSAXHandlerV1Ptr' type='typedef'/>
      <exports symbol='xmlParserNodeInfo' type='typedef'/>
      <exports symbol='xmlInputMatchCallback' type='function'/>
      <exports symbol='xmlRegisterDefaultOutputCallbacks' type='function'/>
      <exports symbol='xmlFileClose' type='function'/>
+     <exports symbol='xmlPopOutputCallbacks' type='function'/>
      <exports symbol='xmlOutputMatchCallback' type='function'/>
      <exports symbol='xmlParserInputBufferPush' type='function'/>
      <exports symbol='xmlIOFTPRead' type='function'/>
     <file name='xmlexports'>
      <summary>macros for marking symbols as exportable/importable.</summary>
      <description>macros for marking symbols as exportable/importable. </description>
-     <author>Igor Zlatovic &lt;igor@zlatkovic.com&gt; </author>
-     <exports symbol='XMLCALL' type='macro'/>
-     <exports symbol='XMLPUBVAR' type='macro'/>
      <exports symbol='XMLCDECL' type='macro'/>
-     <exports symbol='XMLPUBFUN' type='macro'/>
+     <exports symbol='XMLPUBLIC' type='macro'/>
+     <exports symbol='XMLPUBVAR' type='macro'/>
      <exports symbol='LIBXML_DLL_IMPORT' type='macro'/>
+     <exports symbol='XMLCALL' type='macro'/>
+     <exports symbol='XMLPUBFUN' type='macro'/>
     </file>
     <file name='xmlmemory'>
      <summary>interface for the memory allocator</summary>
      <exports symbol='xmlUCSIsCatMe' type='function'/>
     </file>
     <file name='xmlversion'>
-     <summary>compile-time version informations</summary>
-     <description>compile-time version informations for the XML library </description>
+     <summary>compile-time version information</summary>
+     <description>compile-time version information for the XML library </description>
      <author>Daniel Veillard </author>
      <exports symbol='LIBXML_VERSION_EXTRA' type='macro'/>
      <exports symbol='LIBXML_MODULES_ENABLED' type='macro'/>
       <info>Macro defining &quot;xpointer&quot;</info>
     </macro>
     <macro name='XMLCALL' file='xmlexports'>
+      <info>Macro which declares the calling convention for exported functions</info>
     </macro>
     <macro name='XMLCDECL' file='xmlexports'>
+      <info>Macro which declares the calling convention for exported functions that use &apos;...&apos;.</info>
     </macro>
     <macro name='XMLPUBFUN' file='xmlexports'>
+      <info>Macro which declares an exportable function</info>
+    </macro>
+    <macro name='XMLPUBLIC' file='xmlexports'>
+      <info>Macro which declares a public symbol</info>
     </macro>
     <macro name='XMLPUBVAR' file='xmlexports'>
+      <info>Macro which declares an exportable variable</info>
     </macro>
     <macro name='XML_CAST_FPTR' file='hash'>
       <info>Macro to do a casting from an object pointer to a function pointer without encountering a warning from gcc  #define XML_CAST_FPTR(fptr) (*(void **)(&amp;fptr)) This macro violated ISO C aliasing rules (gcc4 on s390 broke) so it is disabled now</info>
@@ -5994,7 +6003,7 @@ if necessary or NULL'/>
       <field name='doc' type='struct _xmlDoc *' info=' the containing document'/>
       <field name='ns' type='xmlNs *' info=' pointer to the associated namespace'/>
       <field name='atype' type='xmlAttributeType' info=' the attribute type if validating'/>
-      <field name='psvi' type='void *' info=' for type/PSVI informations'/>
+      <field name='psvi' type='void *' info=' for type/PSVI information'/>
     </struct>
     <typedef name='xmlAttrPtr' file='tree' type='xmlAttr *'/>
     <struct name='xmlAttribute' file='tree' type='struct _xmlAttribute'>
@@ -6119,7 +6128,7 @@ standalone attribute was specified'/>
       <field name='charset' type='int' info=' Internal flag for charset handling,
 actually an xmlCharEncoding'/>
       <field name='dict' type='struct _xmlDict *' info=' dict used to allocate names or NULL'/>
-      <field name='psvi' type='void *' info=' for type/PSVI informations'/>
+      <field name='psvi' type='void *' info=' for type/PSVI information'/>
       <field name='parseFlags' type='int' info=' set of xmlParserOption used to parse the
 document'/>
       <field name='properties' type='int' info=' set of xmlDocProperties for this document
@@ -6316,7 +6325,7 @@ set at the end of parsing'/>
       <field name='content' type='xmlChar *' info=' the content'/>
       <field name='properties' type='struct _xmlAttr *' info=' properties list'/>
       <field name='nsDef' type='xmlNs *' info=' namespace definitions on this node'/>
-      <field name='psvi' type='void *' info=' for type/PSVI informations'/>
+      <field name='psvi' type='void *' info=' for type/PSVI information'/>
       <field name='line' type='unsigned short' info=' line number'/>
       <field name='extra' type='unsigned short' info=' extra data for XPath/XSLT'/>
     </struct>
@@ -6393,7 +6402,7 @@ set at the end of parsing'/>
       <field name='nameNr' type='int' info=' Depth of the parsing stack'/>
       <field name='nameMax' type='int' info=' Max depth of the parsing stack'/>
       <field name='nameTab' type='const xmlChar * *' info=' array of nodes'/>
-      <field name='nbChars' type='long' info=' number of xmlChar processed'/>
+      <field name='nbChars' type='long' info=' unused'/>
       <field name='checkIndex' type='long' info=' used by progressive parsing lookup'/>
       <field name='keepBlanks' type='int' info=' ugly but ...'/>
       <field name='disableSAX' type='int' info=' SAX callbacks are disabled'/>
@@ -6432,7 +6441,7 @@ actually an xmlCharEncoding'/>
       <field name='nsMax' type='int' info=' the size of the arrays'/>
       <field name='nsTab' type='const xmlChar * *' info=' the array of prefix/namespace name'/>
       <field name='attallocs' type='int *' info=' which attribute were allocated'/>
-      <field name='pushTab' type='void * *' info=' array of data for push'/>
+      <field name='pushTab' type='xmlStartTag *' info=' array of data for push'/>
       <field name='attsDefault' type='xmlHashTablePtr' info=' defaulted attributes if any'/>
       <field name='attsSpecial' type='xmlHashTablePtr' info=' non-CDATA attributes if any'/>
       <field name='nsWellFormed' type='int' info=' is the document XML Namespace okay'/>
@@ -6442,7 +6451,7 @@ actually an xmlCharEncoding'/>
       <field name='freeElemsNr' type='int' info=' number of freed element nodes'/>
       <field name='freeElems' type='xmlNodePtr' info=' List of freed element nodes'/>
       <field name='freeAttrsNr' type='int' info=' number of freed attributes nodes'/>
-      <field name='freeAttrs' type='xmlAttrPtr' info='* the complete error informations for the last error.
+      <field name='freeAttrs' type='xmlAttrPtr' info='* the complete error information for the last error.
 *'/>
       <field name='lastError' type='xmlError' info=''/>
       <field name='parseMode' type='xmlParserMode' info=' the parser mode'/>
@@ -6836,6 +6845,7 @@ Could we use @subtypes for this?'/>
       <field name='input' type='xmlShellReadlineFunc' info=''/>
     </struct>
     <typedef name='xmlShellCtxtPtr' file='debugXML' type='xmlShellCtxt *'/>
+    <struct name='xmlStartTag' file='parser' type='struct _xmlStartTag'/>
     <struct name='xmlStreamCtxt' file='pattern' type='struct _xmlStreamCtxt'/>
     <typedef name='xmlStreamCtxtPtr' file='pattern' type='xmlStreamCtxt *'/>
     <struct name='xmlTextReader' file='xmlreader' type='struct _xmlTextReader'/>
@@ -6935,8 +6945,6 @@ Could we use @subtypes for this?'/>
       <field name='opLimit' type='unsigned long' info=''/>
       <field name='opCount' type='unsigned long' info=''/>
       <field name='depth' type='int' info=''/>
-      <field name='maxDepth' type='int' info=''/>
-      <field name='maxParserDepth' type='int' info=''/>
     </struct>
     <typedef name='xmlXPathContextPtr' file='xpath' type='xmlXPathContext *'/>
     <typedef name='xmlXPathError' file='xpath' type='enum'/>
@@ -7044,7 +7052,7 @@ Could we use @subtypes for this?'/>
     <function name='UTF8Toisolat1' file='encoding' module='encoding'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
       <info>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</info>
-      <return type='int' info='the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.'/>
+      <return type='int' info='the number of bytes written if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.'/>
       <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
       <arg name='outlen' type='int *' info='the length of @out'/>
       <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
@@ -7260,7 +7268,7 @@ Could we use @subtypes for this?'/>
       <arg name='name' type='const xmlChar *' info='The element name'/>
     </function>
     <functype name='endElementNsSAX2Func' file='parser' module='parser'>
-      <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</info>
+      <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='localname' type='const xmlChar *' info='the local name of the element'/>
@@ -7553,7 +7561,7 @@ Could we use @subtypes for this?'/>
       <return type='void'/>
       <arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
       <arg name='cur' type='xmlDocPtr' info='the document'/>
-      <arg name='encoding' type='const char *' info='the encoding string'/>
+      <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
       <arg name='format' type='int' info='should formatting spaces been added'/>
     </function>
     <function name='htmlDocContentDumpOutput' file='HTMLtree' module='HTMLtree'>
@@ -7562,7 +7570,7 @@ Could we use @subtypes for this?'/>
       <return type='void'/>
       <arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
       <arg name='cur' type='xmlDocPtr' info='the document'/>
-      <arg name='encoding' type='const char *' info='the encoding string'/>
+      <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
     </function>
     <function name='htmlDocDump' file='HTMLtree' module='HTMLtree'>
       <cond>defined(LIBXML_HTML_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
@@ -7644,7 +7652,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='htmlInitAutoClose' file='parserInternals' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Initialize the htmlStartCloseIndex for fast lookup of closing tags names. This is not reentrant. Call xmlInitParser() once before processing in case of use in multithreaded programs.</info>
+      <info>This is a no-op now.</info>
       <return type='void'/>
     </function>
     <function name='htmlIsAutoClosed' file='HTMLparser' module='HTMLparser'>
@@ -7718,7 +7726,7 @@ Could we use @subtypes for this?'/>
       <arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='cur' type='xmlNodePtr' info='the current node'/>
-      <arg name='encoding' type='const char *' info='the encoding string'/>
+      <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
       <arg name='format' type='int' info='should formatting spaces been added'/>
     </function>
     <function name='htmlNodeDumpOutput' file='HTMLtree' module='HTMLtree'>
@@ -7728,7 +7736,7 @@ Could we use @subtypes for this?'/>
       <arg name='buf' type='xmlOutputBufferPtr' info='the HTML buffer output'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='cur' type='xmlNodePtr' info='the current node'/>
-      <arg name='encoding' type='const char *' info='the encoding string'/>
+      <arg name='encoding' type='const char *' info='the encoding string (unused)'/>
     </function>
     <function name='htmlNodeStatus' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
@@ -7967,7 +7975,7 @@ Could we use @subtypes for this?'/>
     </functype>
     <function name='isolat1ToUTF8' file='encoding' module='encoding'>
       <info>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</info>
-      <return type='int' info='the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.'/>
+      <return type='int' info='the number of bytes written if success, or -1 otherwise The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictable. The value of @outlen after return is the number of octets produced.'/>
       <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
       <arg name='outlen' type='int *' info='the length of @out'/>
       <arg name='in' type='const unsigned char *' info='a pointer to an array of ISO Latin 1 chars'/>
@@ -8103,7 +8111,7 @@ Could we use @subtypes for this?'/>
       <arg name='atts' type='const xmlChar **' info='An array of name/value attributes pairs, NULL terminated'/>
     </function>
     <functype name='startElementNsSAX2Func' file='parser' module='parser'>
-      <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</info>
+      <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='localname' type='const xmlChar *' info='the local name of the element'/>
@@ -9470,7 +9478,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlDebugDumpString' file='debugXML' module='debugXML'>
       <cond>defined(LIBXML_DEBUG_ENABLED)</cond>
-      <info>Dumps informations about the string, shorten it if necessary</info>
+      <info>Dumps information about the string, shorten it if necessary</info>
       <return type='void'/>
       <arg name='output' type='FILE *' info='the FILE * for the output'/>
       <arg name='str' type='const xmlChar *' info='the string'/>
@@ -9755,7 +9763,7 @@ Could we use @subtypes for this?'/>
       <info>Handle a redefinition of attribute error</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-      <arg name='extra' type='const char *' info='extra informations'/>
+      <arg name='extra' type='const char *' info='extra information'/>
     </function>
     <function name='xmlExpCtxtNbCons' file='xmlregexp' module='xmlregexp'>
       <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
@@ -11157,19 +11165,19 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlNanoFTPCleanup' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Cleanup the FTP protocol layer. This cleanup proxy informations.</info>
+      <info>Cleanup the FTP protocol layer. This cleanup proxy information.</info>
       <return type='void'/>
     </function>
     <function name='xmlNanoFTPClose' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Close the connection and both control and transport</info>
-      <return type='int' info='-1 incase of error, 0 otherwise'/>
+      <return type='int' info='-1 in case of error, 0 otherwise'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
     </function>
     <function name='xmlNanoFTPCloseConnection' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Close the data connection from the server</info>
-      <return type='int' info='-1 incase of error, 0 otherwise'/>
+      <return type='int' info='-1 in case of error, 0 otherwise'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
     </function>
     <function name='xmlNanoFTPConnect' file='nanoftp' module='nanoftp'>
@@ -11188,14 +11196,14 @@ Could we use @subtypes for this?'/>
     <function name='xmlNanoFTPCwd' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Tries to change the remote directory</info>
-      <return type='int' info='-1 incase of error, 1 if CWD worked, 0 if it failed'/>
+      <return type='int' info='-1 in case of error, 1 if CWD worked, 0 if it failed'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
       <arg name='directory' type='const char *' info='a directory on the server'/>
     </function>
     <function name='xmlNanoFTPDele' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Tries to delete an item (file or directory) from server</info>
-      <return type='int' info='-1 incase of error, 1 if DELE worked, 0 if it failed'/>
+      <return type='int' info='-1 in case of error, 1 if DELE worked, 0 if it failed'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
       <arg name='file' type='const char *' info='a file or directory on the server'/>
     </function>
@@ -11208,7 +11216,7 @@ Could we use @subtypes for this?'/>
     <function name='xmlNanoFTPGet' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</info>
-      <return type='int' info='-1 incase of error, 0 otherwise'/>
+      <return type='int' info='-1 in case of error, 0 otherwise'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
       <arg name='callback' type='ftpDataCallback' info='the user callback'/>
       <arg name='userData' type='void *' info='the user callback data'/>
@@ -11217,7 +11225,7 @@ Could we use @subtypes for this?'/>
     <function name='xmlNanoFTPGetConnection' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Try to open a data connection to the server. Currently only passive mode is supported.</info>
-      <return type='SOCKET' info='-1 incase of error, 0 otherwise'/>
+      <return type='SOCKET' info='-1 in case of error, 0 otherwise'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
     </function>
     <function name='xmlNanoFTPGetResponse' file='nanoftp' module='nanoftp'>
@@ -11235,13 +11243,13 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlNanoFTPInit' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Initialize the FTP protocol layer. Currently it just checks for proxy informations, and get the hostname</info>
+      <info>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</info>
       <return type='void'/>
     </function>
     <function name='xmlNanoFTPList' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
       <info>Do a listing on the server. All files info are passed back in the callbacks.</info>
-      <return type='int' info='-1 incase of error, 0 otherwise'/>
+      <return type='int' info='-1 in case of error, 0 otherwise'/>
       <arg name='ctx' type='void *' info='an FTP context'/>
       <arg name='callback' type='ftpListCallback' info='the user callback'/>
       <arg name='userData' type='void *' info='the user callback data'/>
@@ -11261,7 +11269,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlNanoFTPProxy' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Setup the FTP proxy informations. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</info>
+      <info>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</info>
       <return type='void'/>
       <arg name='host' type='const char *' info='the proxy host name'/>
       <arg name='port' type='int' info='the proxy port'/>
@@ -11285,7 +11293,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlNanoFTPScanProxy' file='nanoftp' module='nanoftp'>
       <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy informations.</info>
+      <info>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</info>
       <return type='void'/>
       <arg name='URL' type='const char *' info='The proxy URL used to initialize the proxy context'/>
     </function>
@@ -11328,14 +11336,14 @@ Could we use @subtypes for this?'/>
     <function name='xmlNanoHTTPFetch' file='nanohttp' module='nanohttp'>
       <cond>defined(LIBXML_HTTP_ENABLED)</cond>
       <info>This function try to fetch the indicated resource via HTTP GET and save it&apos;s content in the file.</info>
-      <return type='int' info='-1 in case of failure, 0 incase of success. The contentType, if provided must be freed by the caller'/>
+      <return type='int' info='-1 in case of failure, 0 in case of success. The contentType, if provided must be freed by the caller'/>
       <arg name='URL' type='const char *' info='The URL to load'/>
       <arg name='filename' type='const char *' info='the filename where the content should be saved'/>
       <arg name='contentType' type='char **' info='if available the Content-Type information will be returned at that location'/>
     </function>
     <function name='xmlNanoHTTPInit' file='nanohttp' module='nanohttp'>
       <cond>defined(LIBXML_HTTP_ENABLED)</cond>
-      <info>Initialize the HTTP protocol layer. Currently it just checks for proxy informations</info>
+      <info>Initialize the HTTP protocol layer. Currently it just checks for proxy information</info>
       <return type='void'/>
     </function>
     <function name='xmlNanoHTTPMethod' file='nanohttp' module='nanohttp'>
@@ -11405,13 +11413,13 @@ Could we use @subtypes for this?'/>
     <function name='xmlNanoHTTPSave' file='nanohttp' module='nanohttp'>
       <cond>defined(LIBXML_HTTP_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
       <info>This function saves the output of the HTTP transaction to a file It closes and free the context at the end</info>
-      <return type='int' info='-1 in case of failure, 0 incase of success.'/>
+      <return type='int' info='-1 in case of failure, 0 in case of success.'/>
       <arg name='ctxt' type='void *' info='the HTTP context'/>
       <arg name='filename' type='const char *' info='the filename where the content should be saved'/>
     </function>
     <function name='xmlNanoHTTPScanProxy' file='nanohttp' module='nanohttp'>
       <cond>defined(LIBXML_HTTP_ENABLED)</cond>
-      <info>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy informations.</info>
+      <info>(Re)Initialize the HTTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like http://myproxy/ or http://myproxy:3128/ A NULL URL cleans up proxy information.</info>
       <return type='void'/>
       <arg name='URL' type='const char *' info='The proxy URL used to initialize the proxy context'/>
     </function>
@@ -11508,7 +11516,7 @@ Could we use @subtypes for this?'/>
       <arg name='content' type='const xmlChar *' info='the PI content'/>
     </function>
     <function name='xmlNewDocProp' file='tree' module='tree'>
-      <info>Create a new property carried by a document.</info>
+      <info>Create a new property carried by a document. NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity references, but XML special chars need to be escaped first by using xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don&apos;t need entities support.</info>
       <return type='xmlAttrPtr' info='a pointer to the attribute'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='name' type='const xmlChar *' info='the name of the attribute'/>
@@ -12046,8 +12054,8 @@ Could we use @subtypes for this?'/>
       <cond>defined(LIBXML_SAX1_ENABLED)</cond>
       <info>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar:  [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
       <return type='int' info='0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise'/>
-      <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to'/>
-      <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler bloc (possibly NULL)'/>
+      <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to (must not be NULL)'/>
+      <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block (possibly NULL)'/>
       <arg name='user_data' type='void *' info='The user data returned on SAX callbacks (possibly NULL)'/>
       <arg name='depth' type='int' info='Used for loop detection, use 0'/>
       <arg name='string' type='const xmlChar *' info='the input string in UTF8 or ISO-Latin (zero terminated)'/>
@@ -12057,8 +12065,8 @@ Could we use @subtypes for this?'/>
       <cond>defined(LIBXML_SAX1_ENABLED)</cond>
       <info>Parse a well-balanced chunk of an XML document called by the parser The allowed sequence for the Well Balanced Chunk is the one defined by the content production in the XML grammar:  [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
       <return type='int' info='0 if the chunk is well balanced, -1 in case of args problem and the parser error code otherwise  In case recover is set to 1, the nodelist will not be empty even if the parsed chunk is not well balanced, assuming the parsing succeeded to some extent.'/>
-      <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to'/>
-      <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler bloc (possibly NULL)'/>
+      <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to (must not be NULL)'/>
+      <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block (possibly NULL)'/>
       <arg name='user_data' type='void *' info='The user data returned on SAX callbacks (possibly NULL)'/>
       <arg name='depth' type='int' info='Used for loop detection, use 0'/>
       <arg name='string' type='const xmlChar *' info='the input string in UTF8 or ISO-Latin (zero terminated)'/>
@@ -12107,7 +12115,7 @@ Could we use @subtypes for this?'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
     <function name='xmlParseContent' file='parserInternals' module='parser'>
-      <info>Parse a content:  [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
+      <info>Parse a content sequence. Stops at EOF or &apos;&lt;/&apos;.  [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
@@ -12236,7 +12244,7 @@ Could we use @subtypes for this?'/>
       <info>Parse an external general entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.  [78] extParsedEnt ::= TextDecl? content</info>
       <return type='int' info='0 if the entity is well formed, -1 in case of args problem and the parser error code otherwise'/>
       <arg name='doc' type='xmlDocPtr' info='the document the chunk pertains to'/>
-      <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler bloc (possibly NULL)'/>
+      <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block (possibly NULL)'/>
       <arg name='user_data' type='void *' info='The user data returned on SAX callbacks (possibly NULL)'/>
       <arg name='depth' type='int' info='Used for loop detection, use 0'/>
       <arg name='URL' type='const xmlChar *' info='the URL for the entity to load'/>
@@ -12538,7 +12546,7 @@ Could we use @subtypes for this?'/>
       <arg name='input' type='xmlParserInputPtr' info='an xmlParserInputPtr input'/>
     </function>
     <function name='xmlParserPrintFileInfo' file='xmlerror' module='error'>
-      <info>Displays the associated file and line informations for the current input</info>
+      <info>Displays the associated file and line information for the current input</info>
       <return type='void'/>
       <arg name='input' type='xmlParserInputPtr' info='an xmlParserInputPtr input'/>
     </function>
@@ -12628,6 +12636,11 @@ Could we use @subtypes for this?'/>
       <info>Clear the top input callback from the input stack. this includes the compiled-in I/O.</info>
       <return type='int' info='the number of input callback registered or -1 in case of error.'/>
     </function>
+    <function name='xmlPopOutputCallbacks' file='xmlIO' module='xmlIO'>
+      <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
+      <info>Remove the top output callbacks from the output stack. This includes the compiled-in I/O.</info>
+      <return type='int' info='the number of output callback registered or -1 in case of error.'/>
+    </function>
     <function name='xmlPreviousElementSibling' file='tree' module='tree'>
       <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Finds the first closest previous sibling of the node which is an element node. Note the handling of entities references is different than in the W3C DOM element traversal spec since we don&apos;t have back reference from entities content to entities references.</info>
@@ -12861,7 +12874,7 @@ Could we use @subtypes for this?'/>
     </functype>
     <function name='xmlRegExecErrInfo' file='xmlregexp' module='xmlregexp'>
       <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
-      <info>Extract error informations from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
+      <info>Extract error information from the regexp execution, the parameter @string will be updated with the value pushed and not accepted, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
       <return type='int' info='will be freed with the @exec context and don&apos;t need to be deallocated.  Returns: 0 in case of success or -1 in case of error.'/>
       <arg name='exec' type='xmlRegExecCtxtPtr' info='a regexp execution context generating an error'/>
       <arg name='string' type='const xmlChar **' info='return value for the error string'/>
@@ -12872,7 +12885,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlRegExecNextValues' file='xmlregexp' module='xmlregexp'>
       <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
-      <info>Extract informations from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
+      <info>Extract information from the regexp execution, the parameter @values must point to an array of @nbval string pointers on return nbval will contain the number of possible strings in that state and the @values array will be updated with them. The string values</info>
       <return type='int' info='will be freed with the @exec context and don&apos;t need to be deallocated.  Returns: 0 in case of success or -1 in case of error.'/>
       <arg name='exec' type='xmlRegExecCtxtPtr' info='a regexp execution context'/>
       <arg name='nbval' type='int *' info='pointer to the number of accepted values IN/OUT'/>
@@ -13037,7 +13050,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlRelaxNGGetValidErrors' file='relaxng' module='relaxng'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info>Get the error and warning callback informations</info>
+      <info>Get the error and warning callback information</info>
       <return type='int' info='-1 in case of error and 0 otherwise'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
       <arg name='err' type='xmlRelaxNGValidityErrorFunc *' info='the error function result'/>
@@ -13099,7 +13112,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlRelaxNGSetValidErrors' file='relaxng' module='relaxng'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info>Set the error and warning callback informations</info>
+      <info>Set the error and warning callback information</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
       <arg name='err' type='xmlRelaxNGValidityErrorFunc' info='the error function'/>
@@ -13171,7 +13184,7 @@ Could we use @subtypes for this?'/>
     </functype>
     <function name='xmlRelaxParserSetFlag' file='relaxng' module='relaxng'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info>Semi private function used to pass informations to a parser context which are a combination of xmlRelaxNGParserFlag .</info>
+      <info>Semi private function used to pass information to a parser context which are a combination of xmlRelaxNGParserFlag .</info>
       <return type='int' info='0 if success and -1 in case of error'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a RelaxNG parser context'/>
       <arg name='flags' type='int' info='a set of flags values'/>
@@ -13261,7 +13274,7 @@ Could we use @subtypes for this?'/>
       <arg name='name' type='const xmlChar *' info='The element name'/>
     </function>
     <function name='xmlSAX2EndElementNs' file='SAX2' module='SAX2'>
-      <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace informations for the element.</info>
+      <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='localname' type='const xmlChar *' info='the local name of the element'/>
@@ -13414,7 +13427,7 @@ Could we use @subtypes for this?'/>
       <arg name='atts' type='const xmlChar **' info='An array of name/value attributes pairs, NULL terminated'/>
     </function>
     <function name='xmlSAX2StartElementNs' file='SAX2' module='SAX2'>
-      <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace informations for the element, as well as the new namespace declarations on the element.</info>
+      <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='localname' type='const xmlChar *' info='the local name of the element'/>
@@ -13644,7 +13657,7 @@ Could we use @subtypes for this?'/>
       <info>Save a subtree starting at the node parameter to a saving context TODO: The function is not fully implemented yet as it does not return the byte count but 0 instead</info>
       <return type='long' info='the number of byte written or -1 in case of error'/>
       <arg name='ctxt' type='xmlSaveCtxtPtr' info='a document saving context'/>
-      <arg name='node' type='xmlNodePtr' info='the top node of the subtree to save'/>
+      <arg name='cur' type='xmlNodePtr' info=''/>
     </function>
     <function name='xmlSaveUri' file='uri' module='uri'>
       <info>Save the URI as an escaped string</info>
@@ -13805,7 +13818,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlSchemaGetValidErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info>Get the error and warning callback informations</info>
+      <info>Get the error and warning callback information</info>
       <return type='int' info='-1 in case of error and 0 otherwise'/>
       <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a XML-Schema validation context'/>
       <arg name='err' type='xmlSchemaValidityErrorFunc *' info='the error function result'/>
@@ -13920,7 +13933,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlSchemaSetValidErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info>Set the error and warning callback informations</info>
+      <info>Set the error and warning callback information</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
       <arg name='err' type='xmlSchemaValidityErrorFunc' info='the error function'/>
@@ -14087,7 +14100,7 @@ Could we use @subtypes for this?'/>
     </functype>
     <functype name='xmlSchemaValidityLocatorFunc' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
-      <info>A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected</info>
+      <info>A schemas validation locator, a callback called by the validator. This is used when file or node information are not available to find out what file and line number are affected</info>
       <return type='int' info='0 in case of success and -1 in case of error'/>
       <arg name='ctx' type='void *' info='user provided context'/>
       <arg name='file' type='const char **' info='returned file information'/>
@@ -14355,7 +14368,7 @@ Could we use @subtypes for this?'/>
     </functype>
     <function name='xmlShellDir' file='debugXML' module='debugXML'>
       <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;dir&quot; dumps informations about the node (namespace, attributes, content).</info>
+      <info>Implements the XML shell function &quot;dir&quot; dumps information about the node (namespace, attributes, content).</info>
       <return type='int' info='0'/>
       <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
       <arg name='arg' type='char *' info='unused'/>
@@ -15043,7 +15056,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlTextReaderNormalization' file='xmlreader' module='xmlreader'>
       <cond>defined(LIBXML_READER_ENABLED)</cond>
-      <info>The value indicating whether to normalize white space and attribute values. Since attribute value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken bahaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</info>
+      <info>The value indicating whether to normalize white space and attribute values. Since attribute value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</info>
       <return type='int' info='1 or -1 in case of error.'/>
       <arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
     </function>
@@ -17270,7 +17283,7 @@ Could we use @subtypes for this?'/>
     </function>
     <function name='xmlXIncludeProcessNode' file='xinclude' module='xinclude'>
       <cond>defined(LIBXML_XINCLUDE_ENABLED)</cond>
-      <info>Implement the XInclude substitution for the given subtree reusing the informations and data coming from the given context.</info>
+      <info>Implement the XInclude substitution for the given subtree reusing the information and data coming from the given context.</info>
       <return type='int' info='0 if no substitution were done, -1 if some processing failed or the number of substitutions done.'/>
       <arg name='ctxt' type='xmlXIncludeCtxtPtr' info='an existing XInclude context'/>
       <arg name='node' type='xmlNodePtr' info='a node in an XML document'/>
index ade2ab7..2829aac 100644 (file)
     <reference name='XMLCALL' href='html/libxml-xmlexports.html#XMLCALL'/>
     <reference name='XMLCDECL' href='html/libxml-xmlexports.html#XMLCDECL'/>
     <reference name='XMLPUBFUN' href='html/libxml-xmlexports.html#XMLPUBFUN'/>
+    <reference name='XMLPUBLIC' href='html/libxml-xmlexports.html#XMLPUBLIC'/>
     <reference name='XMLPUBVAR' href='html/libxml-xmlexports.html#XMLPUBVAR'/>
     <reference name='XML_ATTRIBUTE_CDATA' href='html/libxml-tree.html#XML_ATTRIBUTE_CDATA'/>
     <reference name='XML_ATTRIBUTE_DECL' href='html/libxml-tree.html#XML_ATTRIBUTE_DECL'/>
     <reference name='xmlPedanticParserDefaultValue' href='html/libxml-globals.html#xmlPedanticParserDefaultValue'/>
     <reference name='xmlPopInput' href='html/libxml-parserInternals.html#xmlPopInput'/>
     <reference name='xmlPopInputCallbacks' href='html/libxml-xmlIO.html#xmlPopInputCallbacks'/>
+    <reference name='xmlPopOutputCallbacks' href='html/libxml-xmlIO.html#xmlPopOutputCallbacks'/>
     <reference name='xmlPreviousElementSibling' href='html/libxml-tree.html#xmlPreviousElementSibling'/>
     <reference name='xmlPrintURI' href='html/libxml-uri.html#xmlPrintURI'/>
     <reference name='xmlPushInput' href='html/libxml-parserInternals.html#xmlPushInput'/>
     <reference name='xmlSplitQName2' href='html/libxml-tree.html#xmlSplitQName2'/>
     <reference name='xmlSplitQName3' href='html/libxml-tree.html#xmlSplitQName3'/>
     <reference name='xmlSprintfElementContent' href='html/libxml-valid.html#xmlSprintfElementContent'/>
+    <reference name='xmlStartTag' href='html/libxml-parser.html#xmlStartTag'/>
     <reference name='xmlStopParser' href='html/libxml-parser.html#xmlStopParser'/>
     <reference name='xmlStrEqual' href='html/libxml-xmlstring.html#xmlStrEqual'/>
     <reference name='xmlStrPrintf' href='html/libxml-xmlstring.html#xmlStrPrintf'/>
       <ref name='XMLCALL'/>
       <ref name='XMLCDECL'/>
       <ref name='XMLPUBFUN'/>
+      <ref name='XMLPUBLIC'/>
       <ref name='XMLPUBVAR'/>
       <ref name='XML_ATTRIBUTE_CDATA'/>
       <ref name='XML_ATTRIBUTE_DECL'/>
       <ref name='xmlPedanticParserDefaultValue'/>
       <ref name='xmlPopInput'/>
       <ref name='xmlPopInputCallbacks'/>
+      <ref name='xmlPopOutputCallbacks'/>
       <ref name='xmlPreviousElementSibling'/>
       <ref name='xmlPrintURI'/>
       <ref name='xmlPushInput'/>
       <ref name='xmlSplitQName2'/>
       <ref name='xmlSplitQName3'/>
       <ref name='xmlSprintfElementContent'/>
+      <ref name='xmlStartTag'/>
       <ref name='xmlStopParser'/>
       <ref name='xmlStrEqual'/>
       <ref name='xmlStrPrintf'/>
       <ref name='xmlSetExternalEntityLoader'/>
       <ref name='xmlSetFeature'/>
       <ref name='xmlSetupParserForBuffer'/>
+      <ref name='xmlStartTag'/>
       <ref name='xmlStopParser'/>
       <ref name='xmlSubstituteEntitiesDefault'/>
     </file>
       <ref name='xmlParserInputBufferPush'/>
       <ref name='xmlParserInputBufferRead'/>
       <ref name='xmlPopInputCallbacks'/>
+      <ref name='xmlPopOutputCallbacks'/>
       <ref name='xmlRegisterDefaultInputCallbacks'/>
       <ref name='xmlRegisterDefaultOutputCallbacks'/>
       <ref name='xmlRegisterHTTPPostCallbacks'/>
       <ref name='XMLCALL'/>
       <ref name='XMLCDECL'/>
       <ref name='XMLPUBFUN'/>
+      <ref name='XMLPUBLIC'/>
       <ref name='XMLPUBVAR'/>
     </file>
     <file name='xmlmemory'>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlNodeSetContentLen'/>
           <ref name='xmlParseAttValue'/>
           <ref name='_xmlXPathContext'/>
         </word>
         <word name='Call'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlInitParser'/>
           <ref name='xmlXPathOrderDocElems'/>
         </word>
           <ref name='xmlStringGetNodeList'/>
           <ref name='xmlStringLenGetNodeList'/>
         </word>
+        <word name='EOF'>
+          <ref name='xmlParseContent'/>
+        </word>
         <word name='ETag'>
           <ref name='htmlParseElement'/>
           <ref name='xmlParseElement'/>
         <word name='Initialize'>
           <ref name='docbDefaultSAXHandlerInit'/>
           <ref name='htmlDefaultSAXHandlerInit'/>
-          <ref name='htmlInitAutoClose'/>
           <ref name='initdocbDefaultSAXHandler'/>
           <ref name='inithtmlDefaultSAXHandler'/>
           <ref name='initxmlDefaultSAXHandler'/>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNewTextChild'/>
           <ref name='xmlNewTextWriter'/>
           <ref name='xmlNewTextWriterPushParser'/>
           <ref name='xmlListRemoveFirst'/>
           <ref name='xmlListRemoveLast'/>
           <ref name='xmlParserHandleReference'/>
+          <ref name='xmlPopOutputCallbacks'/>
           <ref name='xmlRemoveID'/>
           <ref name='xmlRemoveRef'/>
           <ref name='xmlUnsetNsProp'/>
           <ref name='xmlTextWriterStartElementNS'/>
           <ref name='xmlTextWriterStartPI'/>
         </word>
+        <word name='Stops'>
+          <ref name='xmlParseContent'/>
+        </word>
         <word name='StringType'>
           <ref name='xmlParseAttributeType'/>
         </word>
           <ref name='xmlIsPubidChar'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNewNodeEatName'/>
           <ref name='xmlNewPI'/>
           <ref name='xmlNewTextChild'/>
           <ref name='htmlIsAutoClosed'/>
           <ref name='xmlCatalogAdd'/>
           <ref name='xmlNewChild'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlNodeSetContentLen'/>
           <ref name='xmlParseURIRaw'/>
         <word name='badly'>
           <ref name='xmlParseExternalID'/>
         </word>
-        <word name='bahaviour'>
-          <ref name='xmlTextReaderNormalization'/>
-        </word>
         <word name='balanced'>
           <ref name='xmlParseBalancedChunkMemory'/>
           <ref name='xmlParseBalancedChunkMemoryRecover'/>
           <ref name='xmlAddAttributeDecl'/>
         </word>
         <word name='before'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlBuildRelativeURI'/>
           <ref name='xmlCatalogAdd'/>
           <ref name='xmlCleanupParser'/>
           <ref name='xmlNodeGetSpacePreserve'/>
           <ref name='xmlNodeSetSpacePreserve'/>
           <ref name='xmlSAX2ResolveEntity'/>
+          <ref name='xmlTextReaderNormalization'/>
           <ref name='xmlTextReaderSetParserProp'/>
           <ref name='xmlUTF8Strsize'/>
         </word>
           <ref name='xmlKeepBlanksDefault'/>
           <ref name='xmlSkipBlankChars'/>
         </word>
-        <word name='bloc'>
-          <ref name='xmlParseBalancedChunkMemory'/>
-          <ref name='xmlParseBalancedChunkMemoryRecover'/>
-          <ref name='xmlParseExternalEntity'/>
-        </word>
         <word name='blockDefault'>
           <ref name='XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION'/>
           <ref name='XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION'/>
           <ref name='xmlUTF8Size'/>
         </word>
         <word name='calling'>
+          <ref name='XMLCALL'/>
+          <ref name='XMLCDECL'/>
           <ref name='_xmlXPathContext'/>
           <ref name='xmlBuildRelativeURI'/>
           <ref name='xmlC14NDocDumpMemory'/>
           <ref name='xmlXPathRoundFunction'/>
         </word>
         <word name='closing'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlNanoFTPFreeCtxt'/>
           <ref name='xmlParseElementChildrenContentDecl'/>
           <ref name='xmlParseStartTag'/>
           <ref name='xmlCleanupInputCallbacks'/>
           <ref name='xmlCleanupOutputCallbacks'/>
           <ref name='xmlPopInputCallbacks'/>
+          <ref name='xmlPopOutputCallbacks'/>
           <ref name='xmlRegisterDefaultInputCallbacks'/>
           <ref name='xmlRegisterDefaultOutputCallbacks'/>
         </word>
           <ref name='xmlXPtrNewContext'/>
         </word>
         <word name='content:'>
-          <ref name='xmlParseContent'/>
           <ref name='xmlXPathEqualValues'/>
           <ref name='xmlXPathNotEqualValues'/>
         </word>
         <word name='conveniently'>
           <ref name='xmlCurrentChar'/>
         </word>
+        <word name='convention'>
+          <ref name='XMLCALL'/>
+          <ref name='XMLCDECL'/>
+        </word>
         <word name='conversion'>
           <ref name='_uconv_t'/>
           <ref name='_xmlXPathType'/>
           <ref name='xmlValidCtxtNormalizeAttributeValue'/>
           <ref name='xmlValidNormalizeAttributeValue'/>
         </word>
+        <word name='declares'>
+          <ref name='XMLCALL'/>
+          <ref name='XMLCDECL'/>
+          <ref name='XMLPUBFUN'/>
+          <ref name='XMLPUBLIC'/>
+          <ref name='XMLPUBVAR'/>
+        </word>
         <word name='declaring'>
           <ref name='xmlGetID'/>
         </word>
           <ref name='xmlLastElementChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNextElementSibling'/>
           <ref name='xmlParseStartTag'/>
           <ref name='xmlPreviousElementSibling'/>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNewTextChild'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlNodeSetContentLen'/>
         <word name='explored'>
           <ref name='xmlXPathAxisFunc'/>
         </word>
+        <word name='exportable'>
+          <ref name='XMLPUBFUN'/>
+          <ref name='XMLPUBVAR'/>
+        </word>
+        <word name='exported'>
+          <ref name='XMLCALL'/>
+          <ref name='XMLCDECL'/>
+        </word>
         <word name='exposing'>
           <ref name='xmlTextReaderRead'/>
         </word>
         <word name='fashion'>
           <ref name='xmlNewRMutex'/>
         </word>
-        <word name='fast'>
-          <ref name='htmlInitAutoClose'/>
-        </word>
         <word name='faster'>
           <ref name='htmlNodeStatus'/>
           <ref name='xmlStrEqual'/>
           <ref name='xmlXPathNodeSetItem'/>
         </word>
         <word name='functions'>
+          <ref name='XMLCALL'/>
+          <ref name='XMLCDECL'/>
           <ref name='htmlCtxtReadIO'/>
           <ref name='htmlReadIO'/>
           <ref name='xmlC14NDocDumpMemory'/>
           <ref name='htmlAutoCloseTag'/>
           <ref name='htmlIsAutoClosed'/>
         </word>
-        <word name='htmlStartCloseIndex'>
-          <ref name='htmlInitAutoClose'/>
-        </word>
         <word name='http:'>
           <ref name='XINCLUDE_NS'/>
           <ref name='XINCLUDE_OLD_NS'/>
           <ref name='xmlSAXParseMemoryWithData'/>
           <ref name='xmlSAXUserParseMemory'/>
         </word>
-        <word name='incase'>
-          <ref name='xmlNanoFTPClose'/>
-          <ref name='xmlNanoFTPCloseConnection'/>
-          <ref name='xmlNanoFTPCwd'/>
-          <ref name='xmlNanoFTPDele'/>
-          <ref name='xmlNanoFTPGet'/>
-          <ref name='xmlNanoFTPGetConnection'/>
-          <ref name='xmlNanoFTPList'/>
-          <ref name='xmlNanoHTTPFetch'/>
-          <ref name='xmlNanoHTTPSave'/>
-        </word>
         <word name='incl'>
           <ref name='_xmlSchemaType'/>
         </word>
           <ref name='xmlCleanupInputCallbacks'/>
           <ref name='xmlCleanupOutputCallbacks'/>
           <ref name='xmlPopInputCallbacks'/>
+          <ref name='xmlPopOutputCallbacks'/>
           <ref name='xmlXIncludeProcessFlags'/>
           <ref name='xmlXIncludeProcessFlagsData'/>
           <ref name='xmlXIncludeProcessTreeFlags'/>
           <ref name='xmlParserFindNodeInfoIndex'/>
           <ref name='xmlReallocLoc'/>
         </word>
-        <word name='information'>
-          <ref name='LIBXML_VERSION_EXTRA'/>
-          <ref name='_xmlError'/>
-          <ref name='xmlDebugDumpAttr'/>
-          <ref name='xmlDebugDumpAttrList'/>
-          <ref name='xmlDebugDumpDTD'/>
-          <ref name='xmlDebugDumpDocument'/>
-          <ref name='xmlDebugDumpDocumentHead'/>
-          <ref name='xmlDebugDumpEntities'/>
-          <ref name='xmlDebugDumpNode'/>
-          <ref name='xmlDebugDumpNodeList'/>
-          <ref name='xmlDebugDumpOneNode'/>
-          <ref name='xmlNanoFTPUpdateURL'/>
-          <ref name='xmlNanoHTTPFetch'/>
-          <ref name='xmlNanoHTTPMethod'/>
-          <ref name='xmlNanoHTTPMethodRedir'/>
-          <ref name='xmlNanoHTTPOpen'/>
-          <ref name='xmlNanoHTTPOpenRedir'/>
-          <ref name='xmlNewTextReader'/>
-          <ref name='xmlRelaxNGGetParserErrors'/>
-          <ref name='xmlSchemaGetParserErrors'/>
-          <ref name='xmlSchemaValidateSetFilename'/>
-          <ref name='xmlSchemaValidateSetLocator'/>
-          <ref name='xmlSchemaValidateStream'/>
-          <ref name='xmlSchemaValidityLocatorFunc'/>
-          <ref name='xmlTextReaderByteConsumed'/>
-          <ref name='xmlXPathOrderDocElems'/>
-        </word>
-        <word name='informations'>
-          <ref name='_xmlAttr'/>
-          <ref name='_xmlDoc'/>
-          <ref name='_xmlNode'/>
-          <ref name='_xmlParserCtxt'/>
-          <ref name='endElementNsSAX2Func'/>
-          <ref name='startElementNsSAX2Func'/>
-          <ref name='xmlDebugDumpString'/>
-          <ref name='xmlErrMemory'/>
-          <ref name='xmlNanoFTPCleanup'/>
-          <ref name='xmlNanoFTPInit'/>
-          <ref name='xmlNanoFTPProxy'/>
-          <ref name='xmlNanoFTPScanProxy'/>
-          <ref name='xmlNanoHTTPInit'/>
-          <ref name='xmlNanoHTTPScanProxy'/>
-          <ref name='xmlParserPrintFileInfo'/>
-          <ref name='xmlRegExecErrInfo'/>
-          <ref name='xmlRegExecNextValues'/>
-          <ref name='xmlRelaxNGGetValidErrors'/>
-          <ref name='xmlRelaxNGSetValidErrors'/>
-          <ref name='xmlRelaxParserSetFlag'/>
-          <ref name='xmlSAX2EndElementNs'/>
-          <ref name='xmlSAX2StartElementNs'/>
-          <ref name='xmlSchemaGetValidErrors'/>
-          <ref name='xmlSchemaSetValidErrors'/>
-          <ref name='xmlSchemaValidityLocatorFunc'/>
-          <ref name='xmlShellDir'/>
-          <ref name='xmlXIncludeProcessNode'/>
-        </word>
         <word name='informative'>
           <ref name='_xmlError'/>
         </word>
           <ref name='xmlXPathMultValues'/>
         </word>
         <word name='multithreaded'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlCleanupParser'/>
           <ref name='xmlCleanupThreads'/>
           <ref name='xmlInitParser'/>
           <ref name='_xmlDoc'/>
           <ref name='_xmlParserCtxt'/>
           <ref name='_xmlSchema'/>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlGetFeaturesList'/>
           <ref name='xmlHashAddEntry'/>
           <ref name='xmlHashScan3'/>
           <ref name='XML_SCHEMAS_ELEM_NILLABLE'/>
           <ref name='xmlExpIsNillable'/>
         </word>
+        <word name='no-op'>
+          <ref name='htmlInitAutoClose'/>
+        </word>
         <word name='nod'>
           <ref name='xmlEntityReferenceFunc'/>
         </word>
           <ref name='XML_CAST_FPTR'/>
           <ref name='_xmlSchema'/>
           <ref name='_xmlSchemaElement'/>
+          <ref name='htmlInitAutoClose'/>
           <ref name='xmlDecodeEntities'/>
           <ref name='xmlParserHandleReference'/>
           <ref name='xmlScanName'/>
           <ref name='xmlXPathStringLengthFunction'/>
         </word>
         <word name='once'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlAutomataNewOnceTrans'/>
           <ref name='xmlAutomataNewOnceTrans2'/>
           <ref name='xmlCleanupThreads'/>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlNodeSetContentLen'/>
         </word>
           <ref name='xmlValidNormalizeAttributeValue'/>
         </word>
         <word name='processed'>
-          <ref name='_xmlParserCtxt'/>
           <ref name='startDocument'/>
           <ref name='startDocumentSAXFunc'/>
           <ref name='startElement'/>
           <ref name='xmlStringLenGetNodeList'/>
         </word>
         <word name='produced'>
+          <ref name='UTF8Toisolat1'/>
+          <ref name='isolat1ToUTF8'/>
           <ref name='xmlCharEncodingOutputFunc'/>
           <ref name='xmlCurrentChar'/>
         </word>
           <ref name='xmlXPtrNewContext'/>
         </word>
         <word name='programs'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlInitParser'/>
         </word>
         <word name='progressed'>
           <ref name='xmlNanoHTTPRedir'/>
         </word>
         <word name='reentrant'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlEncodeEntitiesReentrant'/>
           <ref name='xmlEncodeSpecialChars'/>
           <ref name='xmlFreeRMutex'/>
           <ref name='xmlGetCharEncodingHandler'/>
           <ref name='xmlGetLastError'/>
           <ref name='xmlPopInputCallbacks'/>
+          <ref name='xmlPopOutputCallbacks'/>
           <ref name='xmlRegisterInputCallbacks'/>
           <ref name='xmlRegisterOutputCallbacks'/>
           <ref name='xmlResetLastError'/>
           <ref name='xmlGcMemGet'/>
           <ref name='xmlMemGet'/>
           <ref name='xmlNanoHTTPFetch'/>
-          <ref name='xmlSaveTree'/>
           <ref name='xmlShell'/>
           <ref name='xmlShellSave'/>
         </word>
           <ref name='xmlParseAttValue'/>
           <ref name='xmlParseBalancedChunkMemory'/>
           <ref name='xmlParseBalancedChunkMemoryRecover'/>
+          <ref name='xmlParseContent'/>
           <ref name='xmlParseInNodeContext'/>
           <ref name='xmlParserAddNodeInfo'/>
           <ref name='xmlParserFindNodeInfoIndex'/>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNodeAddContent'/>
           <ref name='xmlNodeAddContentLen'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNodeAddContent'/>
           <ref name='xmlNodeAddContentLen'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlPushInput'/>
         </word>
         <word name='symbol'>
+          <ref name='XMLPUBLIC'/>
           <ref name='xmlModuleSymbol'/>
         </word>
         <word name='synchronizing'>
           <ref name='htmlAutoCloseTag'/>
           <ref name='htmlGetMetaEncoding'/>
           <ref name='htmlHandleOmittedElem'/>
-          <ref name='htmlInitAutoClose'/>
           <ref name='htmlIsAutoClosed'/>
           <ref name='htmlSetMetaEncoding'/>
         </word>
           <ref name='xmlNamespaceParseNSDef'/>
           <ref name='xmlNamespaceParseQName'/>
           <ref name='xmlPopInputCallbacks'/>
+          <ref name='xmlPopOutputCallbacks'/>
           <ref name='xmlPushInput'/>
           <ref name='xmlReconciliateNs'/>
-          <ref name='xmlSaveTree'/>
           <ref name='xmlSetTreeDoc'/>
         </word>
         <word name='total'>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNodeSetContent'/>
           <ref name='xmlNodeSetContentLen'/>
         </word>
           <ref name='xmlSaveFormatFileEnc'/>
         </word>
         <word name='xmlInitParser'>
-          <ref name='htmlInitAutoClose'/>
           <ref name='xmlCleanupParser'/>
         </word>
         <word name='xmlInitThreads'>
         <word name='xmlNewNode'>
           <ref name='xmlNewNodeEatName'/>
         </word>
+        <word name='xmlNewProp'>
+          <ref name='xmlNewDocProp'/>
+        </word>
         <word name='xmlNewTextChild'>
           <ref name='xmlNewChild'/>
           <ref name='xmlNewTextChild'/>
           <ref name='xmlDOMWrapCloneNode'/>
           <ref name='xmlNewDocNode'/>
           <ref name='xmlNewDocNodeEatName'/>
+          <ref name='xmlNewDocProp'/>
           <ref name='xmlNewTextChild'/>
           <ref name='xmlSchemaGetBuiltInType'/>
           <ref name='xmlSearchNs'/>
index 07f9708..300bfec 100644 (file)
   </vendor>
   <product id="libxml2">
     <name>libxml2</name>
-    <version>v2.9.9</version>
-    <last-release> Jan 03 2019</last-release>
+    <version>v2.9.10</version>
+    <last-release> Oct 30 2019</last-release>
     <info-url>http://xmlsoft.org/</info-url>
-    <changes>   - Security:
-  CVE-2018-9251 CVE-2018-14567 Fix infinite loop in LZMA decompression (Nick Wellnhofer),
-  CVE-2018-14404 Fix nullptr deref with XPath logic ops (Nick Wellnhofer),
-  
-   - Documentation:
-  reader: Fix documentation comment (Mohammed Sadiq)
+    <changes>   - Documentation:
+  Fix a few more typos ("fonction") (Nick Wellnhofer),
+  Large batch of typo fixes (Jared Yanovich),
+  Fix typos: tree: move{ -&gt; s}, reconcil{i -&gt; }ed, h{o -&gt; e}ld by... (Jan Pokorný),
+  Fix typo: xpath: simpli{ -&gt; fi}ed (Jan Pokorný),
+  Doc: do not mislead towards "infeasible" scenario wrt. xmlBufNodeDump (Jan Pokorný),
+  Fix comments in test code (zhouzhongyuan),
+  fix comment in testReader.c (zhouzhongyuan)
   
    - Portability:
-  Fix MSVC build with lzma (Nick Wellnhofer),
-  Variables need 'extern' in static lib on Cygwin (Michael Haubenwallner),
-  Really declare dllexport/dllimport for Cygwin (Michael Haubenwallner),
-  Merge branch 'patch-2' into 'master' (Nick Wellnhofer),
-  Change dir to $THEDIR after ACLOCAL_PATH check autoreconf creates aclocal.m4 in $srcdir (Vitaly Buka),
-  Improve error message if pkg.m4 couldn't be found (Nick Wellnhofer),
-  NaN and Inf fixes for pre-C99 compilers (Nick Wellnhofer)
+  Fix some release issues on Fedora 30 (Daniel Veillard),
+  Fix exponent digits when running tests under old MSVC (Daniel Richard G),
+  Work around buggy ceil() function on AIX (Daniel Richard G),
+  Don't call printf with NULL string in runtest.c (Daniel Richard G),
+  Switched from unsigned long to ptrdiff_t in parser.c (Stephen Chenney),
+  timsort.h: support older GCCs (Jérôme Duval),
+  Make configure.ac work with older pkg-config (Nick Wellnhofer),
+  Stop defining _REENTRANT on some Win32 platforms (Nick Wellnhofer),
+  Fix nanohttp.c on MinGW (Nick Wellnhofer),
+  Fix Windows compiler warning in testC14N.c (Nick Wellnhofer),
+  Merge testThreadsWin32.c into testThreads.c (Nick Wellnhofer),
+  Fix Python bindings under Windows (Nick Wellnhofer)
   
    - Bug Fixes:
-  Revert "Support xmlTextReaderNextSibling w/o preparsed doc" (Nick Wellnhofer),
-  Fix building relative URIs (Thomas Holder),
-  Problem with data in interleave in RelaxNG validation (Nikolai Weibull),
-  Fix memory leak in xmlSwitchInputEncodingInt error path (Nick Wellnhofer),
-  Set doc on element obtained from freeElems (Nick Wellnhofer),
-  Fix HTML serialization with UTF-8 encoding (Nick Wellnhofer),
-  Use actual doc in xmlTextReaderRead*Xml (Nick Wellnhofer),
-  Unlink node before freeing it in xmlSAX2StartElement (Nick Wellnhofer),
-  Check return value of nodePush in xmlSAX2StartElement (Nick Wellnhofer),
-  Free input buffer in xmlHaltParser (Nick Wellnhofer),
-  Reset HTML parser input pointers on encoding failure (Nick Wellnhofer),
-  Don't run icu_parse_test if EUC-JP is unsupported (Nick Wellnhofer),
-  Fix xmlSchemaValidCtxtPtr reuse memory leak (Greg Hildstrom),
-  Fix xmlTextReaderNext with preparsed document (Felix Bünemann),
-  Remove stray character from comment (Nick Wellnhofer),
-  Remove a misleading line from xmlCharEncOutput (Andrey Bienkowski),
-  HTML noscript should not close p (Daniel Veillard),
-  Don't change context node in xmlXPathRoot (Nick Wellnhofer),
-  Stop using XPATH_OP_RESET (Nick Wellnhofer),
-  Revert "Change calls to xmlCharEncInput to set flush false" (Nick Wellnhofer)
+  Another fix for conditional sections at end of document (Nick Wellnhofer),
+  Fix for conditional sections at end of document (Nick Wellnhofer),
+  Make sure that Python tests exit with error code (Nick Wellnhofer),
+  Audit memory error handling in xpath.c (Nick Wellnhofer),
+  Fix error code in xmlTextWriterStartDocument (Nick Wellnhofer),
+  Fix integer overflow when counting written bytes (Nick Wellnhofer),
+  Fix uninitialized memory access in HTML parser (Nick Wellnhofer),
+  Fix memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),
+  Disallow conditional sections in internal subset (Nick Wellnhofer),
+  Fix use-after-free in xmlTextReaderFreeNodeList (Nick Wellnhofer),
+  Fix Regextests (Nick Wellnhofer),
+  Fix empty branch in regex (Nick Wellnhofer),
+  Fix integer overflow in entity recursion check (Nick Wellnhofer),
+  Don't read external entities or XIncludes from stdin (Nick Wellnhofer),
+  Fix Schema determinism check of ##other namespaces (Nick Wellnhofer),
+  Fix potential null deref in xmlSchemaIDCFillNodeTables (zhouzhongyuan),
+  Fix potential memory leak in xmlBufBackToBuffer (Nick Wellnhofer),
+  Fix error message when processing XIncludes with fallbacks (Nick Wellnhofer),
+  Fix memory leak in xmlRegEpxFromParse (zhouzhongyuan),
+  14:00 is a valid timezone for xs:dateTime (Nick Wellnhofer),
+  Fix memory leak in xmlParseBalancedChunkMemoryRecover (Zhipeng Xie),
+  Fix potential null deref in xmlRelaxNGParsePatterns (Nick Wellnhofer),
+  Misleading error message with xs:{min|max}Inclusive (bettermanzzy),
+  Fix memory leak in xmlXIncludeLoadTxt (Wang Kirin),
+  Partial fix for comparison of xs:durations (Nick Wellnhofer),
+  Fix null deref in xmlreader buffer (zhouzhongyuan),
+  Fix unability to RelaxNG-validate grammar with choice-based name class (Jan Pokorný),
+  Fix unability to validate ambiguously constructed interleave for RelaxNG (Jan Pokorný),
+  Fix possible null dereference in xmlXPathIdFunction (zhouzhongyuan),
+  fix memory leak in xmlAllocOutputBuffer (zhouzhongyuan),
+  Fix unsigned int overflow (Jens Eggerstedt),
+  dict.h: gcc 2.95 doesn't allow multiple storage classes (Nick Wellnhofer),
+  Fix another code path in xmlParseQName (Nick Wellnhofer),
+  Make sure that xmlParseQName returns NULL in error case (Nick Wellnhofer),
+  Fix build without reader but with pattern (Nick Wellnhofer),
+  Fix memory leak in xmlAllocOutputBufferInternal error path (Nick Wellnhofer),
+  Fix unsigned integer overflow (Nick Wellnhofer),
+  Fix return value of xmlOutputBufferWrite (Nick Wellnhofer),
+  Fix parser termination from "Double hyphen within comment" error (David Warring),
+  Fix call stack overflow in xmlFreePattern (Nick Wellnhofer),
+  Fix null deref in previous commit (Nick Wellnhofer),
+  Fix memory leaks in xmlXPathParseNameComplex error paths (Nick Wellnhofer),
+  Check for integer overflow in xmlXPtrEvalChildSeq (Nick Wellnhofer),
+  Fix xmllint dump of XPath namespace nodes (Nick Wellnhofer),
+  Fix float casts in xmlXPathSubstringFunction (Nick Wellnhofer),
+  Fix null deref in xmlregexp error path (Nick Wellnhofer),
+  Fix null pointer dereference in xmlTextReaderReadOuterXml (Nick Wellnhofer),
+  Fix memory leaks in xmlParseStartTag2 error paths (Nick Wellnhofer),
+  Fix memory leak in xmlSAX2StartElement (Nick Wellnhofer),
+  Fix commit "Memory leak in xmlFreeID (xmlreader.c)" (Nick Wellnhofer),
+  Fix NULL pointer deref in xmlTextReaderValidateEntity (Nick Wellnhofer),
+  Memory leak in xmlFreeTextReader (Nick Wellnhofer),
+  Memory leak in xmlFreeID (xmlreader.c) (Nick Wellnhofer)
   
    - Improvements:
-  Fix "Problem with data in interleave in RelaxNG validation" (Nikolai Weibull),
-  cleanup: remove some unreachable code (Thomas Holder),
-  add --relative to testURI (Thomas Holder),
-  Remove redefined starts and defines inside include elements (Nikolai Weibull),
-  Allow choice within choice in nameClass in RELAX NG (Nikolai Weibull),
-  Look inside divs for starts and defines inside include (Nikolai Weibull),
-  Add compile and libxml2-config.cmake to .gitignore (Nikolai Weibull),
-  Stop using doc-&gt;charset outside parser code (Nick Wellnhofer),
-  Add newlines to 'xmllint --xpath' output (Nick Wellnhofer),
-  Don't include SAX.h from globals.h (Nick Wellnhofer),
-  Support xmlTextReaderNextSibling w/o preparsed doc (Felix Bünemann),
-  Don't instruct user to run make when autogen.sh failed (林博仁(Buo-ren Lin)),
-  Run Travis ASan tests with "sudo: required" (Nick Wellnhofer),
-  Improve restoring of context size and position (Nick Wellnhofer),
-  Simplify and harden nodeset filtering (Nick Wellnhofer),
-  Avoid unnecessary backups of the context node (Nick Wellnhofer),
-  Fix inconsistency in xmlXPathIsInf (Nick Wellnhofer)
+  Run XML conformance tests under CI (Nick Wellnhofer),
+  Update GitLab CI config (Nick Wellnhofer),
+  Propagate memory errors in valuePush (Nick Wellnhofer),
+  Propagate memory errors in xmlXPathCompExprAdd (Nick Wellnhofer),
+  Make xmlFreeDocElementContent non-recursive (Nick Wellnhofer),
+  Enable continuous integration via GitLab CI (Nick Wellnhofer),
+  Avoid ignored attribute warnings under GCC (Nick Wellnhofer),
+  Make xmlDumpElementContent non-recursive (Nick Wellnhofer),
+  Make apibuild.py ignore ATTRIBUTE_NO_SANITIZE (Nick Wellnhofer),
+  Mark xmlExp* symbols as removed (Nick Wellnhofer),
+  Make xmlParseConditionalSections non-recursive (Nick Wellnhofer),
+  Adjust expected error in Python tests (Nick Wellnhofer),
+  Make xmlTextReaderFreeNodeList non-recursive (Nick Wellnhofer),
+  Make xmlFreeNodeList non-recursive (Nick Wellnhofer),
+  Make xmlParseContent and xmlParseElement non-recursive (Nick Wellnhofer),
+  Remove executable bit from non-executable files (Nick Wellnhofer),
+  Fix expected output of test/schemas/any4 (Nick Wellnhofer),
+  Optimize build instructions in README (zhouzhongyuan),
+  xml2-config.in: Output CFLAGS and LIBS on the same line (Hugh McMaster),
+  xml2-config: Add a --dynamic switch to print only shared libraries (Hugh McMaster),
+  Annotate functions with __attribute__((no_sanitize)) (Nick Wellnhofer),
+  Fix warnings when compiling without reader or push parser (Nick Wellnhofer),
+  Remove unused member `doc` in xmlSaveCtxt (Nick Wellnhofer),
+  Limit recursion depth in xmlXPathCompOpEvalPredicate (Nick Wellnhofer),
+  Remove -Wno-array-bounds (Nick Wellnhofer),
+  Remove unreachable code in xmlXPathCountFunction (Nick Wellnhofer),
+  Improve XPath predicate and filter evaluation (Nick Wellnhofer),
+  Limit recursion depth in xmlXPathOptimizeExpression (Nick Wellnhofer),
+  Disable hash randomization when fuzzing (Nick Wellnhofer),
+  Optional recursion limit when parsing XPath expressions (Nick Wellnhofer),
+  Optional recursion limit when evaluating XPath expressions (Nick Wellnhofer),
+  Use break statements in xmlXPathCompOpEval (Nick Wellnhofer),
+  Optional XPath operation limit (Nick Wellnhofer),
+  Fix compilation with --with-minimum (Nick Wellnhofer),
+  Check XPath stack after calling functions (Nick Wellnhofer),
+  Remove debug printf in xmlreader.c (Nick Wellnhofer),
+  Always define LIBXML_THREAD_ENABLED when enabled (Michael Haubenwallner),
+  Regenerate NEWS (Nick Wellnhofer),
+  Change git repo URL (Nick Wellnhofer),
+  Change bug tracker URL (Nick Wellnhofer),
+  Remove outdated HTML file (Nick Wellnhofer),
+  Fix unused function warning in testapi.c (Nick Wellnhofer),
+  Add some generated test files to .gitignore (Nick Wellnhofer),
+  Remove unneeded function pointer casts (Nick Wellnhofer),
+  Fix -Wcast-function-type warnings (GCC 8) (Nick Wellnhofer),
+  Fix -Wformat-truncation warnings (GCC 8) (Nick Wellnhofer)
   
    - Cleanups:
+  Rebuild docs (Nick Wellnhofer),
+  Disable xmlExp regex code (Nick Wellnhofer),
+  Remove redundant code in xmlRelaxNGValidateState (Nick Wellnhofer),
+  Remove redundant code in xmlXPathCompRelationalExpr (Nick Wellnhofer)
   
 
 </changes>
index 434a09e..f2ac51a 100644 (file)
@@ -8,7 +8,259 @@ H2 {font-family: Verdana,Arial,Helvetica}
 H3 {font-family: Verdana,Arial,Helvetica}
 A:link, A:visited, A:active { text-decoration: underline }
 </style><title>Releases</title></head><body bgcolor="#8b7765" text="#000000" link="#a06060" vlink="#000000"><table border="0" width="100%" cellpadding="5" cellspacing="0" align="center"><tr><td width="120"><a href="http://swpat.ffii.org/"><img src="epatents.png" alt="Action against software patents" /></a></td><td width="180"><a href="http://www.gnome.org/"><img src="gnome2.png" alt="Gnome2 Logo" /></a><a href="http://www.w3.org/Status"><img src="w3c.png" alt="W3C Logo" /></a><a href="http://www.redhat.com/"><img src="redhat.gif" alt="Red Hat Logo" /></a><div align="left"><a href="http://xmlsoft.org/"><img src="Libxml2-Logo-180x168.gif" alt="Made with Libxml2 Logo" /></a></div></td><td><table border="0" width="90%" cellpadding="2" cellspacing="0" align="center" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3" bgcolor="#fffacd"><tr><td align="center"><h1>The XML C parser and toolkit of Gnome</h1><h2>Releases</h2></td></tr></table></td></tr></table></td></tr></table><table border="0" cellpadding="4" cellspacing="0" width="100%" align="center"><tr><td bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="2" width="100%"><tr><td valign="top" width="200" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Main Menu</b></center></td></tr><tr><td bgcolor="#fffacd"><form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><input name="query" type="text" size="20" value="" /><input name="submit" type="submit" value="Search ..." /></form><ul><li><a href="index.html">Home</a></li><li><a href="html/index.html">Reference Manual</a></li><li><a href="intro.html">Introduction</a></li><li><a href="FAQ.html">FAQ</a></li><li><a href="docs.html" style="font-weight:bold">Developer Menu</a></li><li><a href="bugs.html">Reporting bugs and getting help</a></li><li><a href="help.html">How to help</a></li><li><a href="downloads.html">Downloads</a></li><li><a href="news.html">Releases</a></li><li><a href="XMLinfo.html">XML</a></li><li><a href="XSLT.html">XSLT</a></li><li><a href="xmldtd.html">Validation &amp; DTDs</a></li><li><a href="encoding.html">Encodings support</a></li><li><a href="catalog.html">Catalog support</a></li><li><a href="namespaces.html">Namespaces</a></li><li><a href="contribs.html">Contributions</a></li><li><a href="examples/index.html" style="font-weight:bold">Code Examples</a></li><li><a href="html/index.html" style="font-weight:bold">API Menu</a></li><li><a href="guidelines.html">XML Guidelines</a></li><li><a href="ChangeLog.html">Recent Changes</a></li></ul></td></tr></table><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td colspan="1" bgcolor="#eecfa1" align="center"><center><b>Related links</b></center></td></tr><tr><td bgcolor="#fffacd"><ul><li><a href="http://mail.gnome.org/archives/xml/">Mail archive</a></li><li><a href="http://xmlsoft.org/XSLT/">XSLT libxslt</a></li><li><a href="http://phd.cs.unibo.it/gdome2/">DOM gdome2</a></li><li><a href="http://www.aleksey.com/xmlsec/">XML-DSig xmlsec</a></li><li><a href="ftp://xmlsoft.org/">FTP</a></li><li><a href="http://www.zlatkovic.com/projects/libxml/">Windows binaries</a></li><li><a href="http://opencsw.org/packages/libxml2">Solaris binaries</a></li><li><a href="http://www.explain.com.au/oss/libxml2xslt.html">MacOsX binaries</a></li><li><a href="http://lxml.de/">lxml Python bindings</a></li><li><a href="http://cpan.uwinnipeg.ca/dist/XML-LibXML">Perl bindings</a></li><li><a href="http://libxmlplusplus.sourceforge.net/">C++ bindings</a></li><li><a href="http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4">PHP bindings</a></li><li><a href="http://sourceforge.net/projects/libxml2-pas/">Pascal bindings</a></li><li><a href="http://libxml.rubyforge.org/">Ruby bindings</a></li><li><a href="http://tclxml.sourceforge.net/">Tcl bindings</a></li><li><a href="https://gitlab.gnome.org/GNOME/libxml2/issues">Bug Tracker</a></li></ul></td></tr></table></td></tr></table></td><td valign="top" bgcolor="#8b7765"><table border="0" cellspacing="0" cellpadding="1" width="100%"><tr><td><table border="0" cellspacing="0" cellpadding="1" width="100%" bgcolor="#000000"><tr><td><table border="0" cellpadding="3" cellspacing="1" width="100%"><tr><td bgcolor="#fffacd"><p>The <a href="ChangeLog.html">change log</a> describes the recents commits
-to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p><p>Here is the list of public releases:</p><h3>v2.9.10: Oct 30 2019</h3><ul>
+to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p><p>Here is the list of public releases:</p><h3>v2.9.11: May 13 2021</h3><ul>
+  <li>Security:<br />
+  Patch for security issue CVE-2021-3541 (Daniel Veillard)<br />
+  </li>
+
+  <li>Documentation:<br />
+  Clarify xmlNewDocProp documentation (Nick Wellnhofer)<br />
+  </li>
+
+  <li>Portability:<br />
+  CMake: Only add postfixes if MSVC (Christopher Degawa),<br />
+  Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer),<br />
+  Use CMake PROJECT_VERSION (Markus Rickert),<br />
+  Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson),<br />
+  Add CI for CMake on MSVC (Markus Rickert),<br />
+  Update minimum required CMake version (Markus Rickert),<br />
+  Add variables for configured options to CMake config files (Markus Rickert),<br />
+  Check if variables exist when defining targets (Markus Rickert),<br />
+  Check if target exists when reading target properties (Markus Rickert),<br />
+  Add xmlcatalog target and definition to config files (Markus Rickert),<br />
+  Remove include directories for link-only dependencies (Markus Rickert),<br />
+  Fix ICU build in CMake (Markus Rickert),<br />
+  Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert),<br />
+  Update CMake config files (Markus Rickert),<br />
+  Add xmlcatalog and xmllint to CMake export (Markus Rickert),<br />
+  Simplify xmlexports.h (Nick Wellnhofer),<br />
+  Require dependencies based on enabled CMake options (Markus Rickert),<br />
+  Use NAMELINK_COMPONENT in CMake install (Markus Rickert),<br />
+  Add CMake files to EXTRA_DIST (Markus Rickert),<br />
+  Add missing compile definition for static builds to CMake (Markus Rickert),<br />
+  Add CI for CMake on Linux and MinGW (Markus Rickert),<br />
+  Fix variable name in win32/configure.js (Nick Wellnhofer),<br />
+  Fix version parsing in win32/configure.js (Nick Wellnhofer),<br />
+  Fix autotools warnings (Nick Wellnhofer),<br />
+  Update config.h.cmake.in (Markus Rickert),<br />
+  win32: allow passing *FLAGS on command line (Michael Stahl),<br />
+  Configure file xmlwin32version.h.in on MSVC (Markus Rickert),<br />
+  List headers individually (Markus Rickert),<br />
+  Add CMake build files (Markus Rickert),<br />
+  Parenthesize Py&lt;type&gt;_Check() in ifs (Miro Hrončok),<br />
+  Minor fixes to configure.js (Nick Wellnhofer)<br />
+  </li>
+
+  <li>Bug Fixes:<br />
+  Fix null deref in legacy SAX1 parser (Nick Wellnhofer),<br />
+  Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer),<br />
+  Fix line numbers in error messages for mismatched tags (Nick Wellnhofer),<br />
+  Fix htmlTagLookup (Nick Wellnhofer),<br />
+  Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer),<br />
+  Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer),<br />
+  Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer),<br />
+  Validate UTF8 in xmlEncodeEntities (Joel Hockey),<br />
+  Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer),<br />
+  Allow FP division by zero in xmlXPathInit (Nick Wellnhofer),<br />
+  Fix xmlGetNodePath with invalid node types (Nick Wellnhofer),<br />
+  Fix exponential behavior with recursive entities (Nick Wellnhofer),<br />
+  Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer),<br />
+  Fix slow parsing of HTML with encoding errors (Nick Wellnhofer),<br />
+  Fix null deref introduced with previous commit (Nick Wellnhofer),<br />
+  Check for invalid redeclarations of predefined entities (Nick Wellnhofer),<br />
+  Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate),<br />
+  parser.c: shrink the input buffer when appropriate (Mike Dalessio),<br />
+  Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer),<br />
+  Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer),<br />
+  Fix timeout when handling recursive entities (Nick Wellnhofer),<br />
+  Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer),<br />
+  Fix null deref in xmlStringGetNodeList (Nick Wellnhofer),<br />
+  use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio),<br />
+  htmlParseComment: treat `--!&gt;` as if it closed the comment (Mike Dalessio),<br />
+  Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer),<br />
+  encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni),<br />
+  xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet-&gt;val" (Xiaoming Ni),<br />
+  Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer),<br />
+  Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer),<br />
+  Avoid quadratic checking of identity-constraints (Michael Matz),<br />
+  Fix building with ICU 68. (Frederik Seiffert),<br />
+  Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner),<br />
+  Fix xmlURIEscape memory leaks. (Elliott Hughes),<br />
+  Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer),<br />
+  Fix caret in regexp character group (Nick Wellnhofer),<br />
+  parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio),<br />
+  Fix memory leaks in XPointer string-range function (Nick Wellnhofer),<br />
+  Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer),<br />
+  Fix SEGV in xmlSAXParseFileWithData (yanjinjq),<br />
+  Fix null deref in XPointer expression error path (Nick Wellnhofer),<br />
+  Don't call xmlXPathInit directly (Nick Wellnhofer),<br />
+  Fix cleanup of attributes in XML reader (Nick Wellnhofer),<br />
+  Fix double free in XML reader with XIncludes (Nick Wellnhofer),<br />
+  Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer),<br />
+  Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer),<br />
+  Fix error reporting with xi:fallback (Nick Wellnhofer),<br />
+  Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer),<br />
+  Fix corner case with empty xi:fallback (Nick Wellnhofer),<br />
+  Fix XInclude regression introduced with recent commit (Nick Wellnhofer),<br />
+  Fix memory leak in runtest.c (Nick Wellnhofer),<br />
+  Make "xmllint --push --recovery" work (Nick Wellnhofer),<br />
+  Revert "Do not URI escape in server side includes" (Nick Wellnhofer),<br />
+  Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer),<br />
+  Stop counting nbChars in parser context (Nick Wellnhofer),<br />
+  Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer),<br />
+  Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer),<br />
+  Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer),<br />
+  Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer),<br />
+  Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer),<br />
+  Check for custom free function in global destructor (Nick Wellnhofer),<br />
+  Fix integer overflow when comparing schema dates (Nick Wellnhofer),<br />
+  Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer),<br />
+  Don't try to handle namespaces when building HTML documents (Nick Wellnhofer),<br />
+  Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br />
+  Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer),<br />
+  Reset XML parser input before reporting errors (David Kilzer),<br />
+  Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer),<br />
+  Fix HTML push parser lookahead (Nick Wellnhofer),<br />
+  Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer),<br />
+  Fix UTF-8 decoder in HTML parser (Nick Wellnhofer),<br />
+  Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer),<br />
+  Reset HTML parser input before reporting error (Nick Wellnhofer),<br />
+  Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br />
+  Fix regression introduced with 477c7f6a (Nick Wellnhofer),<br />
+  Fix quadratic runtime in HTML parser (Nick Wellnhofer),<br />
+  Reset HTML parser input before reporting encoding error (Nick Wellnhofer),<br />
+  Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer),<br />
+  Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer),<br />
+  Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer),<br />
+  Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer),<br />
+  Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer),<br />
+  Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),<br />
+  Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer),<br />
+  Fix integer overflow in htmlParseCharRef (Nick Wellnhofer),<br />
+  Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer),<br />
+  Fix return value of xmlCharEncOutput (Nick Wellnhofer),<br />
+  Never expand parameter entities in text declaration (Nick Wellnhofer),<br />
+  Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer),<br />
+  Fix use-after-free with validating reader (Nick Wellnhofer),<br />
+  xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer),<br />
+  Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer),<br />
+  Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer),<br />
+  Make schema validation fail with multiple top-level elements (Nick Wellnhofer),<br />
+  Call xmlCleanupParser on ELF destruction (Samuel Thibault),<br />
+  Fix copying of entities in xmlParseReference (Nick Wellnhofer),<br />
+  Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie),<br />
+  Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz),<br />
+  Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz),<br />
+  Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz),<br />
+  Fix integer overflow in xmlBufferResize (Nick Wellnhofer),<br />
+  Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer),<br />
+  Remove useless comparisons (Nick Wellnhofer),<br />
+  Fix overflow check in xmlNodeDump (Nick Wellnhofer),<br />
+  Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie),<br />
+  Fix freeing of nested documents (Nick Wellnhofer),<br />
+  Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer),<br />
+  Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer),<br />
+  Fix xml2-config error code (Nick Wellnhofer),<br />
+  Fix memory leak in error path of XPath expr parser (Nick Wellnhofer),<br />
+  Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer),<br />
+  Null pointer handling in catalog.c (raniervf),<br />
+  xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin)<br />
+  </li>
+
+  <li>Improvements:<br />
+  Store per-element parser state in a struct (Nick Wellnhofer),<br />
+  update for xsd:language type check (PaulHiggs),<br />
+  Update INSTALL.libxml2 (Nick Wellnhofer),<br />
+  Fix include order in c14n.h (Nick Wellnhofer),<br />
+  Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer),<br />
+  Speed up htmlCheckAutoClose (Nick Wellnhofer),<br />
+  Speed up htmlTagLookup (Nick Wellnhofer),<br />
+  Stop checking attributes for UTF-8 validity (Nick Wellnhofer),<br />
+  Reduce some fuzzer timeouts (Nick Wellnhofer),<br />
+  Only run a few CI tests unless scheduled (Nick Wellnhofer),<br />
+  Improve fuzzer stability (Nick Wellnhofer),<br />
+  Check for feature flags in fuzzer tests (Nick Wellnhofer),<br />
+  Another attempt at improving fuzzer stability (Nick Wellnhofer),<br />
+  Revert "Improve HTML fuzzer stability" (Nick Wellnhofer),<br />
+  Add charset names to fuzzing dictionaries (Nick Wellnhofer),<br />
+  Improve HTML fuzzer stability (Nick Wellnhofer),<br />
+  Add CI for MSVC x86 (Markus Rickert),<br />
+  Add a flag to not output anything when xmllint succeeded (hhb),<br />
+  Speed up HTML fuzzer (Nick Wellnhofer),<br />
+  Remove unused encoding parameter of HTML output functions (Nick Wellnhofer),<br />
+  Handle malloc failures in fuzzing code (Nick Wellnhofer),<br />
+  add test coverage for incorrectly-closed comments (Mike Dalessio),<br />
+  Enforce maximum length of fuzz input (Nick Wellnhofer),<br />
+  Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer),<br />
+  Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner),<br />
+  Add CI test for Python 3 (Nick Wellnhofer),<br />
+  Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer),<br />
+  Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer),<br />
+  Allow port numbers up to INT_MAX (Nick Wellnhofer),<br />
+  Handle dumps of corrupted documents more gracefully (Nick Wellnhofer),<br />
+  Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer),<br />
+  Hardcode maximum XPath recursion depth (Nick Wellnhofer),<br />
+  Pass URL of main entity in XML fuzzer (Nick Wellnhofer),<br />
+  Consolidate seed corpus generation (Nick Wellnhofer),<br />
+  Test fuzz targets with dummy driver (Nick Wellnhofer),<br />
+  Fix regression introduced with commit d88df4b (Nick Wellnhofer),<br />
+  Fix regression introduced with commit 74dcc10b (Nick Wellnhofer),<br />
+  Add TODO comment in xinclude.c (Nick Wellnhofer),<br />
+  Stop using maxParserDepth in xpath.c (Nick Wellnhofer),<br />
+  Remove dead code in xinclude.c (Nick Wellnhofer),<br />
+  Don't add formatting newlines to XInclude nodes (Nick Wellnhofer),<br />
+  Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer),<br />
+  Remove unneeded progress checks in HTML parser (Nick Wellnhofer),<br />
+  Use strcmp when fuzzing (Nick Wellnhofer),<br />
+  Fix XPath fuzzer (Nick Wellnhofer),<br />
+  Fuzz XInclude engine (Nick Wellnhofer),<br />
+  Add XPath and XPointer fuzzer (Nick Wellnhofer),<br />
+  Update fuzzing code (Nick Wellnhofer),<br />
+  More *NodeDumpOutput fixes (Nick Wellnhofer),<br />
+  Fix *NodeDumpOutput functions (Nick Wellnhofer),<br />
+  Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer),<br />
+  Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer),<br />
+  Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer),<br />
+  Fix .gitattributes (Nick Wellnhofer),<br />
+  Rework control flow in htmlCurrentChar (Nick Wellnhofer),<br />
+  Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer),<br />
+  Remove misleading comments in xpath.c (Nick Wellnhofer),<br />
+  Update to Devhelp index file format version 2 (Andre Klapper),<br />
+  Set project language to C (Markus Rickert),<br />
+  Add variable for working directory of XML Conformance Test Suite (Markus Rickert),<br />
+  Add additional tests and XML Conformance Test Suite (Markus Rickert),<br />
+  Add command line option for temp directory in runtest (Markus Rickert),<br />
+  Ensure LF line endings for test files (Markus Rickert),<br />
+  Enable runtests and testThreads (Markus Rickert),<br />
+  Limit regexp nesting depth (Nick Wellnhofer),<br />
+  Fix return values and documentation in encoding.c (Nick Wellnhofer),<br />
+  Add regexp regression tests (David Kilzer),<br />
+  Report error for invalid regexp quantifiers (Nick Wellnhofer),<br />
+  Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner),<br />
+  Copy xs:duration parser from libexslt (Nick Wellnhofer),<br />
+  Fuzz target for XML Schemas (Nick Wellnhofer),<br />
+  Move entity recorder to fuzz.c (Nick Wellnhofer),<br />
+  Fuzz target for HTML parser (Nick Wellnhofer),<br />
+  Update GitLab CI container (Nick Wellnhofer),<br />
+  Add options file for xml fuzzer (Nick Wellnhofer),<br />
+  Add a couple of libFuzzer targets (Nick Wellnhofer),<br />
+  Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng),<br />
+  Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz),<br />
+  Fix typos (Nick Wellnhofer),<br />
+  Disable LeakSanitizer (Nick Wellnhofer),<br />
+  Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer),<br />
+  Add test case for recursive external parsed entities (Nick Wellnhofer),<br />
+  Enable error tests with entity substitution (Nick Wellnhofer),<br />
+  Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer),<br />
+  Merge code paths loading external entities (Nick Wellnhofer),<br />
+  Copy some XMLReader option flags to parser context (Nick Wellnhofer),<br />
+  Add xmlPopOutputCallbacks (Nick Wellnhofer),<br />
+  Updated Python test reader2.py (Pieter van Oostrum),<br />
+  Updated python/tests/tstLastError.py (Pieter van Oostrum),<br />
+  Use random seed in xmlDictComputeFastKey (Ranier Vilela),<br />
+  Enable more undefined behavior sanitizers (Nick Wellnhofer)<br />
+  </li>
+</ul><h3>v2.9.10: Oct 30 2019</h3><ul>
   <li>Documentation:<br />
   Fix a few more typos ("fonction") (Nick Wellnhofer),<br />
   Large batch of typo fixes (Jared Yanovich),<br />
@@ -258,7 +510,7 @@ to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p><p
   </li>
 </ul><h3>2.9.7: Nov 02 2017</h3><ul>
   <li>Documentation:<br />
-  xmlcatalog: refresh man page wrt. quering system catalog easily (Jan Pokorný)<br />
+  xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný)<br />
   </li>
 
   <li>Portability:<br />
@@ -589,7 +841,7 @@ to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p><p
   <li>Improvements:<br />
   Reuse xmlHaltParser() where it makes sense (Daniel Veillard),<br />
   xmlStopParser reset errNo (Daniel Veillard),<br />
-  Reenable xz support by default (Daniel Veillard),<br />
+  Re-enable xz support by default (Daniel Veillard),<br />
   Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard),<br />
   Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance),<br />
   Regression test for bug #695699 (Nick Wellnhofer),<br />
@@ -972,7 +1224,7 @@ Gansterer),<br />
     Harden the buffer code and make it more compatible (Daniel Veillard),<br />
     More cleanups for input/buffers code (Daniel Veillard),<br />
     Cleanup function xmlBufResetInput(),<br /> to set input from Buffer (Daniel Veillard)
-    Swicth the test program for characters to new input buffers (Daniel Veillard),<br />
+    Switch the test program for characters to new input buffers (Daniel Veillard),<br />
     Convert the HTML tree module to the new buffers (Daniel Veillard),<br />
     Convert of the HTML parser to new input buffers (Daniel Veillard),<br />
     Convert the writer to new output buffer and save APIs (Daniel Veillard),<br />
@@ -1069,7 +1321,7 @@ Gansterer),<br />
     Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
     Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
     xmlParseNodeInContext problems with an empty document (Tim Elliott),
-    HTML element position is not detected propperly (Pavel Andrejs),
+    HTML element position is not detected properly (Pavel Andrejs),
     Fix an off by one pointer access (Jüri Aedla),
     Try to fix a problem with entities in SAX mode (Daniel Veillard),
     Fix a crash with xmllint --path on empty results (Daniel Veillard),
@@ -1097,7 +1349,7 @@ Gansterer),<br />
     Small fix for previous commit (Daniel Veillard),
     Fix a potential freeing error in XPath (Daniel Veillard),
     Fix a potential memory access error (Daniel Veillard),
-    Reactivate the shared library versionning script (Daniel Veillard)
+    Reactivate the shared library versioning script (Daniel Veillard)
   </li>
 
   <li>Improvements:
@@ -1276,7 +1528,7 @@ Gansterer),<br />
     Problem with extern extern in header (Daniel Veillard),
     Add -lnetwork for compiling on Haiku (Scott McCreary),
     Runtest portability patch for Solaris (Tim Rice),
-    Small patch to accomodate the Haiku OS (Scott McCreary),
+    Small patch to accommodate the Haiku OS (Scott McCreary),
     584605 package VxWorks folder in the distribution (Daniel Veillard),
     574017 Realloc too expensive on most platform (Daniel Veillard),
     Fix windows build (Rob Richards),
@@ -1306,7 +1558,7 @@ Gansterer),<br />
     558452 RNG compilation of optional multiple child (Daniel Veillard),
     579746 XSD validation not correct / nilable groups (Daniel Veillard),
     502960 provide namespace stack when parsing entity (Daniel Veillard),
-    566012 part 2 fix regresion tests and push mode (Daniel Veillard),
+    566012 part 2 fix regression tests and push mode (Daniel Veillard),
     566012 autodetected encoding and encoding conflict (Daniel Veillard),
     584220 xpointer(/) and xinclude problems (Daniel Veillard),
     587663 Incorrect Attribute-Value Normalization (Daniel Veillard),
@@ -1424,14 +1676,14 @@ Gansterer),<br />
       parsing and validation fixes based on the W3C regression tests, reader
       tree skipping function fix (Ashwin), Schemas regexps escaping fix
       (Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown
-      when encoder cant serialize characters on output</li>
+      when encoder can't serialize characters on output</li>
   <li>Code cleanup: compilation fix without the reader, without the output
       (Robert Schwebel), python whitespace (Martin), many space/tabs cleanups,
       serious cleanup of the entity handling code</li>
   <li>Improvement: switch parser to XML-1.0 5th edition, add parsing flags
       for old versions, switch URI parsing to RFC 3986,
       add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
-      new hashing functions for dictionnaries (based on Stefan Behnel work),
+      new hashing functions for dictionaries (based on Stefan Behnel work),
       improve handling of misplaced html/head/body in HTML parser, better
       regression test tools and code coverage display, better algorithms
       to detect various versions of the billion laughts attacks, make
@@ -1485,7 +1737,7 @@ Gansterer),<br />
       </li>
   <li>Code cleanup: fix open() call third argument, regexp cut'n paste
       copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder),
-      some make distcheck realted fixes (John Carr)</li>
+      some make distcheck related fixes (John Carr)</li>
   <li>Improvements: HTTP Header: includes port number (William Brack),
       testURI --debug option, </li>
 </ul><h3>2.6.30: Aug 23 2007</h3><ul>
@@ -1572,13 +1824,13 @@ Gansterer),<br />
   <li>bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
       attribute (Kasimier), crash when using the recover mode, 
       xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
-      missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
+      missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
       (Kasimier), warning on entities processing, XHTML script and style
       serialization (Kasimier), python generator for long types, bug in
       xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
       allocation bug (Marton Illes), error message end of line (Rob Richards),
       fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
-      crasher, parser safety patch (Ben Darnell), _private context propagation
+      crash, parser safety patch (Ben Darnell), _private context propagation
       when parsing entities (with Michael Day), fix entities behaviour when 
       using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity
       context, arg error in SAX callback (Mike Hommey), fix mixed-content
@@ -1707,7 +1959,7 @@ Gansterer),<br />
     Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:
     namespace ahndling in Schemas (Kasimier), empty model group in Schemas
     (Kasimier), wildcard in Schemas (Kasimier), URI composition (William),
-    xs:anyType in Schemas (Kasimier), Python resolver emmitting error
+    xs:anyType in Schemas (Kasimier), Python resolver emitting error
     messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to
     fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob
     Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8
@@ -1731,7 +1983,7 @@ Gansterer),<br />
   <li>build fixes: Windows build (Rob Richards), Mingw compilation (Igor
     Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and
     andriy@google.com), use gcc weak references to pthread to avoid the
-    pthread dependancy on Linux, compilation problem (Steve Nairn), compiling
+    pthread dependency on Linux, compilation problem (Steve Nairn), compiling
     of subset (Morten Welinder), IPv6/ss_family compilation (William Brack),
     compilation when disabling parts of the library, standalone test
     distribution.</li>
@@ -1770,7 +2022,7 @@ Gansterer),<br />
     Linux/ELF/gcc4</li>
   <li>bug fixes: schemas type decimal fixups (William Brack), xmmlint return
     code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY
-    Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin),
+    Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin),
     segfault in Schemas (Kasimier Buchcik), Schemas attribute validation
     (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards),
     HTML serialization of name attribute on a elements, Python error handlers
@@ -1787,7 +2039,7 @@ Gansterer),<br />
     Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
     some gcc4 fixes, HP-UX portability fixes (Rick Jones).</li>
   <li>bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
-    xmlreader stopping on non-fatal errors, thread support for dictionnaries
+    xmlreader stopping on non-fatal errors, thread support for dictionaries
     reference counting (Gary Coady), internal subset and push problem, URL
     saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
     fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
@@ -1838,7 +2090,7 @@ Gansterer),<br />
   <li>bug fixes: problem with XML::Libxml reported by Petr Pajas,  encoding
     conversion functions return values, UTF-8 bug affecting XPath reported by
     Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
-  <li>documentation: fix to xmllint man page, some API function descritpion
+  <li>documentation: fix to xmllint man page, some API function description
     were updated.</li>
   <li>improvements: DTD validation APIs provided at the Python level (Brent
     Hendricks)</li>
@@ -1964,12 +2216,12 @@ Gansterer),<br />
     William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with
     William), Relax-NG name classes compares (William), XInclude duplicate
     fallback (William), external DTD encoding detection (William), a DTD
-    validation bug (William), xmlReader Close() fix, recusive extention
+    validation bug (William), xmlReader Close() fix, recursive extension
     schemas</li>
   <li>improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting
     save optimization, better handle IIS broken HTTP redirect  behaviour (Ian
     Hummel), HTML parser frameset (James Bursa), libxml2-python RPM
-    dependancy, XML Schemas union support (Kasimier Buchcik), warning removal
+    dependency, XML Schemas union support (Kasimier Buchcik), warning removal
     clanup (William), keep ChangeLog compressed when installing from RPMs</li>
   <li>documentation: examples and xmlDocDumpMemory docs (John Fleck), new
     example (load, xpath, modify, save), xmlCatalogDump() comments,</li>
@@ -2014,7 +2266,7 @@ Gansterer),<br />
     William) reported by Yuuichi Teranishi</li>
   <li>bugfixes: make test and path issues, xmlWriter attribute serialization
     (William Brack), xmlWriter indentation (William), schemas validation
-    (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg
+    (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
     Paraschenko), XInclude empty fallback (William), HTML warnings (William),
     XPointer in XInclude (William), Python namespace serialization,
     isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
@@ -2030,10 +2282,10 @@ Gansterer),<br />
   <li>Windows compilation: mingw, msys (Mikhail Grushinskiy), function
     prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_
   patch</li>
-  <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offest in
+  <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in
     input.</li>
 </ul><h3>2.6.5: Jan 25 2004</h3><ul>
-  <li>Bugfixes: dictionnaries for schemas (William Brack), regexp segfault
+  <li>Bugfixes: dictionaries for schemas (William Brack), regexp segfault
     (William), xs:all problem (William), a number of XPointer bugfixes
     (William), xmllint error go to stderr, DTD validation problem with
     namespace, memory leak (William), SAX1 cleanup and minimal options fixes
@@ -2807,7 +3059,7 @@ it's actually not compiled in by default. The real fixes are:
     also contains numerous fixes and enhancements:
     <ul>
       <li>added xmlStopParser() to stop parsing</li>
-      <li>improved a lot parsing speed when there is large CDATA blocs</li>
+      <li>improved a lot parsing speed when there is large CDATA blocks</li>
       <li>includes XPath patches provided by Picdar Technology</li>
       <li>tried to fix as much as possible DTD validation and namespace
         related problems</li>
index fd52966..f41f141 100644 (file)
@@ -43,14 +43,14 @@ or libxslt wrappers or bindings:</p><ul>
   <li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a> is
     an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and
     libxslt as part of GNU ClasspathX project.</li>
-  <li>Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for
+  <li>Patrick McPhee provides Rexx bindings for libxml2 and libxslt, look for
     <a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li>
   <li><a href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>
     provides <a href="http://www.satimage.fr/software/en/downloads_osaxen.html">XMLLib
     osax</a>. This is an osax for Mac OS X with a set of commands to
     implement in AppleScript the XML DOM, XPATH and XSLT. Also includes
     commands for Property-lists (Apple's fast lookup table XML format.)</li>
-  <li>Francesco Montorsi developped <a href="https://sourceforge.net/project/showfiles.php?group_id=51305&amp;package_id=45182">wxXml2</a>
+  <li>Francesco Montorsi developed <a href="https://sourceforge.net/project/showfiles.php?group_id=51305&amp;package_id=45182">wxXml2</a>
     wrappers that interface libxml2, allowing wxWidgets applications to
     load/save/edit XML instances.</li>
 </ul><p>The distribution includes a set of Python bindings, which are guaranteed
index eeb049d..a52202a 100644 (file)
   <release version="2.9.8">
     <symbol file="hash">xmlHashDefaultDeallocator</symbol>
   </release>
+  <release version="2.9.11">
+    <symbol file="xmlIO">xmlPopOutputCallbacks</symbol>
+  </release>
 </symbols>
index 1b59f90..92360d8 100644 (file)
@@ -709,6 +709,261 @@ to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p>
 
 <p>Here is the list of public releases:</p>
 
+<h3>v2.9.11: May 13 2021</h3>
+<ul>
+  <li>Security:<br/>
+  Patch for security issue CVE-2021-3541 (Daniel Veillard)<br/>
+  </li>
+
+  <li>Documentation:<br/>
+  Clarify xmlNewDocProp documentation (Nick Wellnhofer)<br/>
+  </li>
+
+  <li>Portability:<br/>
+  CMake: Only add postfixes if MSVC (Christopher Degawa),<br/>
+  Fix XPath NaN/Inf for older GCC versions (Nick Wellnhofer),<br/>
+  Use CMake PROJECT_VERSION (Markus Rickert),<br/>
+  Fix warnings in libxml.m4 with autoconf 2.70+. (Simon Josefsson),<br/>
+  Add CI for CMake on MSVC (Markus Rickert),<br/>
+  Update minimum required CMake version (Markus Rickert),<br/>
+  Add variables for configured options to CMake config files (Markus Rickert),<br/>
+  Check if variables exist when defining targets (Markus Rickert),<br/>
+  Check if target exists when reading target properties (Markus Rickert),<br/>
+  Add xmlcatalog target and definition to config files (Markus Rickert),<br/>
+  Remove include directories for link-only dependencies (Markus Rickert),<br/>
+  Fix ICU build in CMake (Markus Rickert),<br/>
+  Configure pkgconfig, xml2-config, and xml2Conf.sh file (Markus Rickert),<br/>
+  Update CMake config files (Markus Rickert),<br/>
+  Add xmlcatalog and xmllint to CMake export (Markus Rickert),<br/>
+  Simplify xmlexports.h (Nick Wellnhofer),<br/>
+  Require dependencies based on enabled CMake options (Markus Rickert),<br/>
+  Use NAMELINK_COMPONENT in CMake install (Markus Rickert),<br/>
+  Add CMake files to EXTRA_DIST (Markus Rickert),<br/>
+  Add missing compile definition for static builds to CMake (Markus Rickert),<br/>
+  Add CI for CMake on Linux and MinGW (Markus Rickert),<br/>
+  Fix variable name in win32/configure.js (Nick Wellnhofer),<br/>
+  Fix version parsing in win32/configure.js (Nick Wellnhofer),<br/>
+  Fix autotools warnings (Nick Wellnhofer),<br/>
+  Update config.h.cmake.in (Markus Rickert),<br/>
+  win32: allow passing *FLAGS on command line (Michael Stahl),<br/>
+  Configure file xmlwin32version.h.in on MSVC (Markus Rickert),<br/>
+  List headers individually (Markus Rickert),<br/>
+  Add CMake build files (Markus Rickert),<br/>
+  Parenthesize Py&lt;type&gt;_Check() in ifs (Miro Hrončok),<br/>
+  Minor fixes to configure.js (Nick Wellnhofer)<br/>
+  </li>
+
+  <li>Bug Fixes:<br/>
+  Fix null deref in legacy SAX1 parser (Nick Wellnhofer),<br/>
+  Fix handling of unexpected EOF in xmlParseContent (Nick Wellnhofer),<br/>
+  Fix line numbers in error messages for mismatched tags (Nick Wellnhofer),<br/>
+  Fix htmlTagLookup (Nick Wellnhofer),<br/>
+  Propagate error in xmlParseElementChildrenContentDeclPriv (Nick Wellnhofer),<br/>
+  Fix user-after-free with `xmllint --xinclude --dropdtd` (Nick Wellnhofer),<br/>
+  Fix dangling pointer with `xmllint --dropdtd` (Nick Wellnhofer),<br/>
+  Validate UTF8 in xmlEncodeEntities (Joel Hockey),<br/>
+  Fix use-after-free with `xmllint --html --push` (Nick Wellnhofer),<br/>
+  Allow FP division by zero in xmlXPathInit (Nick Wellnhofer),<br/>
+  Fix xmlGetNodePath with invalid node types (Nick Wellnhofer),<br/>
+  Fix exponential behavior with recursive entities (Nick Wellnhofer),<br/>
+  Fix quadratic behavior when looking up xml:* attributes (Nick Wellnhofer),<br/>
+  Fix slow parsing of HTML with encoding errors (Nick Wellnhofer),<br/>
+  Fix null deref introduced with previous commit (Nick Wellnhofer),<br/>
+  Check for invalid redeclarations of predefined entities (Nick Wellnhofer),<br/>
+  Add the copy of type from original xmlDoc in xmlCopyDoc() (SVGAnimate),<br/>
+  parser.c: shrink the input buffer when appropriate (Mike Dalessio),<br/>
+  Fix infinite loop in HTML parser introduced with recent commits (Nick Wellnhofer),<br/>
+  Fix quadratic runtime when parsing CDATA sections (Nick Wellnhofer),<br/>
+  Fix timeout when handling recursive entities (Nick Wellnhofer),<br/>
+  Fix memory leak in xmlParseElementMixedContentDecl (Nick Wellnhofer),<br/>
+  Fix null deref in xmlStringGetNodeList (Nick Wellnhofer),<br/>
+  use new htmlParseLookupCommentEnd to find comment ends (Mike Dalessio),<br/>
+  htmlParseComment: treat `--!&gt;` as if it closed the comment (Mike Dalessio),<br/>
+  Fix integer overflow in xmlSchemaGetParticleTotalRangeMin (Nick Wellnhofer),<br/>
+  encoding: fix memleak in xmlRegisterCharEncodingHandler() (Xiaoming Ni),<br/>
+  xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet-&gt;val" (Xiaoming Ni),<br/>
+  Fix null pointer deref in xmlXPtrRangeInsideFunction (Nick Wellnhofer),<br/>
+  Fix quadratic runtime in HTML push parser with null bytes (Nick Wellnhofer),<br/>
+  Avoid quadratic checking of identity-constraints (Michael Matz),<br/>
+  Fix building with ICU 68. (Frederik Seiffert),<br/>
+  Convert python/libxml.c to PY_SSIZE_T_CLEAN (Victor Stinner),<br/>
+  Fix xmlURIEscape memory leaks. (Elliott Hughes),<br/>
+  Avoid call stack overflow with XML reader and recursive XIncludes (Nick Wellnhofer),<br/>
+  Fix caret in regexp character group (Nick Wellnhofer),<br/>
+  parser.c: xmlParseCharData peek behavior fixed wrt newlines (Mike Dalessio),<br/>
+  Fix memory leaks in XPointer string-range function (Nick Wellnhofer),<br/>
+  Fix use-after-free when XIncluding text from Reader (Nick Wellnhofer),<br/>
+  Fix SEGV in xmlSAXParseFileWithData (yanjinjq),<br/>
+  Fix null deref in XPointer expression error path (Nick Wellnhofer),<br/>
+  Don't call xmlXPathInit directly (Nick Wellnhofer),<br/>
+  Fix cleanup of attributes in XML reader (Nick Wellnhofer),<br/>
+  Fix double free in XML reader with XIncludes (Nick Wellnhofer),<br/>
+  Fix memory leak in xmlXIncludeAddNode error paths (Nick Wellnhofer),<br/>
+  Revert "Fix quadratic runtime in xi:fallback processing" (Nick Wellnhofer),<br/>
+  Fix error reporting with xi:fallback (Nick Wellnhofer),<br/>
+  Fix quadratic runtime in xi:fallback processing (Nick Wellnhofer),<br/>
+  Fix corner case with empty xi:fallback (Nick Wellnhofer),<br/>
+  Fix XInclude regression introduced with recent commit (Nick Wellnhofer),<br/>
+  Fix memory leak in runtest.c (Nick Wellnhofer),<br/>
+  Make "xmllint --push --recovery" work (Nick Wellnhofer),<br/>
+  Revert "Do not URI escape in server side includes" (Nick Wellnhofer),<br/>
+  Fix column number accounting in xmlParse*NameAndCompare (Nick Wellnhofer),<br/>
+  Stop counting nbChars in parser context (Nick Wellnhofer),<br/>
+  Fix out-of-bounds read with 'xmllint --htmlout' (Nick Wellnhofer),<br/>
+  Fix exponential runtime and memory in xi:fallback processing (Nick Wellnhofer),<br/>
+  Don't process siblings of root in xmlXIncludeProcess (Nick Wellnhofer),<br/>
+  Don't recurse into xi:include children in xmlXIncludeDoProcess (Nick Wellnhofer),<br/>
+  Fix memory leak in xmlXIncludeIncludeNode error paths (Nick Wellnhofer),<br/>
+  Check for custom free function in global destructor (Nick Wellnhofer),<br/>
+  Fix integer overflow when comparing schema dates (Nick Wellnhofer),<br/>
+  Fix exponential runtime in xmlFARecurseDeterminism (Nick Wellnhofer),<br/>
+  Don't try to handle namespaces when building HTML documents (Nick Wellnhofer),<br/>
+  Fix several quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br/>
+  Fix quadratic runtime when push parsing HTML start tags (Nick Wellnhofer),<br/>
+  Reset XML parser input before reporting errors (David Kilzer),<br/>
+  Fix quadratic runtime when push parsing HTML entity refs (Nick Wellnhofer),<br/>
+  Fix HTML push parser lookahead (Nick Wellnhofer),<br/>
+  Make htmlCurrentChar always translate U+0000 (Nick Wellnhofer),<br/>
+  Fix UTF-8 decoder in HTML parser (Nick Wellnhofer),<br/>
+  Fix quadratic runtime when parsing HTML script content (Nick Wellnhofer),<br/>
+  Reset HTML parser input before reporting error (Nick Wellnhofer),<br/>
+  Fix more quadratic runtime issues in HTML push parser (Nick Wellnhofer),<br/>
+  Fix regression introduced with 477c7f6a (Nick Wellnhofer),<br/>
+  Fix quadratic runtime in HTML parser (Nick Wellnhofer),<br/>
+  Reset HTML parser input before reporting encoding error (Nick Wellnhofer),<br/>
+  Fix integer overflow in xmlFAParseQuantExact (Nick Wellnhofer),<br/>
+  Fix return value of xmlC14NDocDumpMemory (Nick Wellnhofer),<br/>
+  Don't follow next pointer on documents in xmlXPathRunStreamEval (Nick Wellnhofer),<br/>
+  Fix integer overflow in _xmlSchemaParseGYear (Nick Wellnhofer),<br/>
+  Fix integer overflow when parsing {min,max}Occurs (Nick Wellnhofer),<br/>
+  Fix another memory leak in xmlSchemaValAtomicType (Nick Wellnhofer),<br/>
+  Fix unsigned integer overflow in htmlParseTryOrFinish (Nick Wellnhofer),<br/>
+  Fix integer overflow in htmlParseCharRef (Nick Wellnhofer),<br/>
+  Fix undefined behavior in UTF16LEToUTF8 (Nick Wellnhofer),<br/>
+  Fix return value of xmlCharEncOutput (Nick Wellnhofer),<br/>
+  Never expand parameter entities in text declaration (Nick Wellnhofer),<br/>
+  Fix undefined behavior in xmlXPathTryStreamCompile (Nick Wellnhofer),<br/>
+  Fix use-after-free with validating reader (Nick Wellnhofer),<br/>
+  xmlParseBalancedChunkMemory must not be called with NULL doc (Nick Wellnhofer),<br/>
+  Revert "Fix memory leak in xmlParseBalancedChunkMemoryRecover" (Nick Wellnhofer),<br/>
+  Fix memory leak in xmlXIncludeLoadDoc error path (Nick Wellnhofer),<br/>
+  Make schema validation fail with multiple top-level elements (Nick Wellnhofer),<br/>
+  Call xmlCleanupParser on ELF destruction (Samuel Thibault),<br/>
+  Fix copying of entities in xmlParseReference (Nick Wellnhofer),<br/>
+  Fix memory leak in xmlSchemaValidateStream (Zhipeng Xie),<br/>
+  Fix xmlSchemaGetCanonValue formatting for date and dateTime (Kevin Puetz),<br/>
+  Fix memory leak when shared libxml.dll is unloaded (Kevin Puetz),<br/>
+  Fix potentially-uninitialized critical section in Win32 DLL builds (Kevin Puetz),<br/>
+  Fix integer overflow in xmlBufferResize (Nick Wellnhofer),<br/>
+  Check for overflow when allocating two-dimensional arrays (Nick Wellnhofer),<br/>
+  Remove useless comparisons (Nick Wellnhofer),<br/>
+  Fix overflow check in xmlNodeDump (Nick Wellnhofer),<br/>
+  Fix infinite loop in xmlStringLenDecodeEntities (Zhipeng Xie),<br/>
+  Fix freeing of nested documents (Nick Wellnhofer),<br/>
+  Fix more memory leaks in error paths of XPath parser (Nick Wellnhofer),<br/>
+  Fix memory leaks of encoding handlers in xmlsave.c (Nick Wellnhofer),<br/>
+  Fix xml2-config error code (Nick Wellnhofer),<br/>
+  Fix memory leak in error path of XPath expr parser (Nick Wellnhofer),<br/>
+  Fix overflow handling in xmlBufBackToBuffer (Nick Wellnhofer),<br/>
+  Null pointer handling in catalog.c (raniervf),<br/>
+  xml2-config.in: fix regressions introduced by commit 2f2bf4b2c (Dmitry V. Levin)<br/>
+  </li>
+
+  <li>Improvements:<br/>
+  Store per-element parser state in a struct (Nick Wellnhofer),<br/>
+  update for xsd:language type check (PaulHiggs),<br/>
+  Update INSTALL.libxml2 (Nick Wellnhofer),<br/>
+  Fix include order in c14n.h (Nick Wellnhofer),<br/>
+  Fix duplicate xmlStrEqual calls in htmlParseEndTag (Nick Wellnhofer),<br/>
+  Speed up htmlCheckAutoClose (Nick Wellnhofer),<br/>
+  Speed up htmlTagLookup (Nick Wellnhofer),<br/>
+  Stop checking attributes for UTF-8 validity (Nick Wellnhofer),<br/>
+  Reduce some fuzzer timeouts (Nick Wellnhofer),<br/>
+  Only run a few CI tests unless scheduled (Nick Wellnhofer),<br/>
+  Improve fuzzer stability (Nick Wellnhofer),<br/>
+  Check for feature flags in fuzzer tests (Nick Wellnhofer),<br/>
+  Another attempt at improving fuzzer stability (Nick Wellnhofer),<br/>
+  Revert "Improve HTML fuzzer stability" (Nick Wellnhofer),<br/>
+  Add charset names to fuzzing dictionaries (Nick Wellnhofer),<br/>
+  Improve HTML fuzzer stability (Nick Wellnhofer),<br/>
+  Add CI for MSVC x86 (Markus Rickert),<br/>
+  Add a flag to not output anything when xmllint succeeded (hhb),<br/>
+  Speed up HTML fuzzer (Nick Wellnhofer),<br/>
+  Remove unused encoding parameter of HTML output functions (Nick Wellnhofer),<br/>
+  Handle malloc failures in fuzzing code (Nick Wellnhofer),<br/>
+  add test coverage for incorrectly-closed comments (Mike Dalessio),<br/>
+  Enforce maximum length of fuzz input (Nick Wellnhofer),<br/>
+  Remove temporary members from struct _xmlXPathContext (Nick Wellnhofer),<br/>
+  Build the Python extension with PY_SSIZE_T_CLEAN (Victor Stinner),<br/>
+  Add CI test for Python 3 (Nick Wellnhofer),<br/>
+  Add fuzzing dictionaries to EXTRA_DIST (Nick Wellnhofer),<br/>
+  Add 'fuzz' subdirectory to DIST_SUBDIRS (Nick Wellnhofer),<br/>
+  Allow port numbers up to INT_MAX (Nick Wellnhofer),<br/>
+  Handle dumps of corrupted documents more gracefully (Nick Wellnhofer),<br/>
+  Limit size of free lists in XML reader when fuzzing (Nick Wellnhofer),<br/>
+  Hardcode maximum XPath recursion depth (Nick Wellnhofer),<br/>
+  Pass URL of main entity in XML fuzzer (Nick Wellnhofer),<br/>
+  Consolidate seed corpus generation (Nick Wellnhofer),<br/>
+  Test fuzz targets with dummy driver (Nick Wellnhofer),<br/>
+  Fix regression introduced with commit d88df4b (Nick Wellnhofer),<br/>
+  Fix regression introduced with commit 74dcc10b (Nick Wellnhofer),<br/>
+  Add TODO comment in xinclude.c (Nick Wellnhofer),<br/>
+  Stop using maxParserDepth in xpath.c (Nick Wellnhofer),<br/>
+  Remove dead code in xinclude.c (Nick Wellnhofer),<br/>
+  Don't add formatting newlines to XInclude nodes (Nick Wellnhofer),<br/>
+  Don't use SAX1 if all element handlers are NULL (Nick Wellnhofer),<br/>
+  Remove unneeded progress checks in HTML parser (Nick Wellnhofer),<br/>
+  Use strcmp when fuzzing (Nick Wellnhofer),<br/>
+  Fix XPath fuzzer (Nick Wellnhofer),<br/>
+  Fuzz XInclude engine (Nick Wellnhofer),<br/>
+  Add XPath and XPointer fuzzer (Nick Wellnhofer),<br/>
+  Update fuzzing code (Nick Wellnhofer),<br/>
+  More *NodeDumpOutput fixes (Nick Wellnhofer),<br/>
+  Fix *NodeDumpOutput functions (Nick Wellnhofer),<br/>
+  Make xmlNodeDumpOutputInternal non-recursive (Nick Wellnhofer),<br/>
+  Make xhtmlNodeDumpOutput non-recursive (Nick Wellnhofer),<br/>
+  Make htmlNodeDumpFormatOutput non-recursive (Nick Wellnhofer),<br/>
+  Fix .gitattributes (Nick Wellnhofer),<br/>
+  Rework control flow in htmlCurrentChar (Nick Wellnhofer),<br/>
+  Make 'xmllint --html --push -' read from stdin (Nick Wellnhofer),<br/>
+  Remove misleading comments in xpath.c (Nick Wellnhofer),<br/>
+  Update to Devhelp index file format version 2 (Andre Klapper),<br/>
+  Set project language to C (Markus Rickert),<br/>
+  Add variable for working directory of XML Conformance Test Suite (Markus Rickert),<br/>
+  Add additional tests and XML Conformance Test Suite (Markus Rickert),<br/>
+  Add command line option for temp directory in runtest (Markus Rickert),<br/>
+  Ensure LF line endings for test files (Markus Rickert),<br/>
+  Enable runtests and testThreads (Markus Rickert),<br/>
+  Limit regexp nesting depth (Nick Wellnhofer),<br/>
+  Fix return values and documentation in encoding.c (Nick Wellnhofer),<br/>
+  Add regexp regression tests (David Kilzer),<br/>
+  Report error for invalid regexp quantifiers (Nick Wellnhofer),<br/>
+  Fix rebuilding docs, by hiding __attribute__((...)) behind a macro. (Martin Vidner),<br/>
+  Copy xs:duration parser from libexslt (Nick Wellnhofer),<br/>
+  Fuzz target for XML Schemas (Nick Wellnhofer),<br/>
+  Move entity recorder to fuzz.c (Nick Wellnhofer),<br/>
+  Fuzz target for HTML parser (Nick Wellnhofer),<br/>
+  Update GitLab CI container (Nick Wellnhofer),<br/>
+  Add options file for xml fuzzer (Nick Wellnhofer),<br/>
+  Add a couple of libFuzzer targets (Nick Wellnhofer),<br/>
+  Guard new calls to xmlValidatePopElement in xml_reader.c (Daniel Cheng),<br/>
+  Add LIBXML_VALID_ENABLED to xmlreader (Łukasz Wojniłowicz),<br/>
+  Fix typos (Nick Wellnhofer),<br/>
+  Disable LeakSanitizer (Nick Wellnhofer),<br/>
+  Stop calling SAX getEntity handler from XMLReader (Nick Wellnhofer),<br/>
+  Add test case for recursive external parsed entities (Nick Wellnhofer),<br/>
+  Enable error tests with entity substitution (Nick Wellnhofer),<br/>
+  Don't load external entity from xmlSAX2GetEntity (Nick Wellnhofer),<br/>
+  Merge code paths loading external entities (Nick Wellnhofer),<br/>
+  Copy some XMLReader option flags to parser context (Nick Wellnhofer),<br/>
+  Add xmlPopOutputCallbacks (Nick Wellnhofer),<br/>
+  Updated Python test reader2.py (Pieter van Oostrum),<br/>
+  Updated python/tests/tstLastError.py (Pieter van Oostrum),<br/>
+  Use random seed in xmlDictComputeFastKey (Ranier Vilela),<br/>
+  Enable more undefined behavior sanitizers (Nick Wellnhofer)<br/>
+  </li>
+</ul>
+
 <h3>v2.9.10: Oct 30 2019</h3>
 <ul>
   <li>Documentation:<br/>
@@ -967,7 +1222,7 @@ to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p>
 <h3>2.9.7: Nov 02 2017</h3>
 <ul>
   <li>Documentation:<br/>
-  xmlcatalog: refresh man page wrt. quering system catalog easily (Jan Pokorný)<br/>
+  xmlcatalog: refresh man page wrt. querying system catalog easily (Jan Pokorný)<br/>
   </li>
 
   <li>Portability:<br/>
@@ -1306,7 +1561,7 @@ to the <a href="https://gitlab.gnome.org/GNOME/libxml2">GIT</a> code base.</p>
   <li>Improvements:<br/>
   Reuse xmlHaltParser() where it makes sense (Daniel Veillard),<br/>
   xmlStopParser reset errNo (Daniel Veillard),<br/>
-  Reenable xz support by default (Daniel Veillard),<br/>
+  Re-enable xz support by default (Daniel Veillard),<br/>
   Recover unescaped less-than character in HTML recovery parsing (Daniel Veillard),<br/>
   Allow HTML serializer to output HTML5 DOCTYPE (Shaun McCance),<br/>
   Regression test for bug #695699 (Nick Wellnhofer),<br/>
@@ -1695,7 +1950,7 @@ Gansterer),<br/>
     Harden the buffer code and make it more compatible (Daniel Veillard),<br/>
     More cleanups for input/buffers code (Daniel Veillard),<br/>
     Cleanup function xmlBufResetInput(),<br/> to set input from Buffer (Daniel Veillard)
-    Swicth the test program for characters to new input buffers (Daniel Veillard),<br/>
+    Switch the test program for characters to new input buffers (Daniel Veillard),<br/>
     Convert the HTML tree module to the new buffers (Daniel Veillard),<br/>
     Convert of the HTML parser to new input buffers (Daniel Veillard),<br/>
     Convert the writer to new output buffer and save APIs (Daniel Veillard),<br/>
@@ -1794,7 +2049,7 @@ Gansterer),<br/>
     Avoid memory leak if xmlParserInputBufferCreateIO fails (Lin Yi-Li),
     Prevent an infinite loop when dumping a node with encoding problems (Timothy Elliott),
     xmlParseNodeInContext problems with an empty document (Tim Elliott),
-    HTML element position is not detected propperly (Pavel Andrejs),
+    HTML element position is not detected properly (Pavel Andrejs),
     Fix an off by one pointer access (Jüri Aedla),
     Try to fix a problem with entities in SAX mode (Daniel Veillard),
     Fix a crash with xmllint --path on empty results (Daniel Veillard),
@@ -1822,7 +2077,7 @@ Gansterer),<br/>
     Small fix for previous commit (Daniel Veillard),
     Fix a potential freeing error in XPath (Daniel Veillard),
     Fix a potential memory access error (Daniel Veillard),
-    Reactivate the shared library versionning script (Daniel Veillard)
+    Reactivate the shared library versioning script (Daniel Veillard)
   </li>
 
   <li>Improvements:
@@ -2011,7 +2266,7 @@ Gansterer),<br/>
     Problem with extern extern in header (Daniel Veillard),
     Add -lnetwork for compiling on Haiku (Scott McCreary),
     Runtest portability patch for Solaris (Tim Rice),
-    Small patch to accomodate the Haiku OS (Scott McCreary),
+    Small patch to accommodate the Haiku OS (Scott McCreary),
     584605 package VxWorks folder in the distribution (Daniel Veillard),
     574017 Realloc too expensive on most platform (Daniel Veillard),
     Fix windows build (Rob Richards),
@@ -2041,7 +2296,7 @@ Gansterer),<br/>
     558452 RNG compilation of optional multiple child (Daniel Veillard),
     579746 XSD validation not correct / nilable groups (Daniel Veillard),
     502960 provide namespace stack when parsing entity (Daniel Veillard),
-    566012 part 2 fix regresion tests and push mode (Daniel Veillard),
+    566012 part 2 fix regression tests and push mode (Daniel Veillard),
     566012 autodetected encoding and encoding conflict (Daniel Veillard),
     584220 xpointer(/) and xinclude problems (Daniel Veillard),
     587663 Incorrect Attribute-Value Normalization (Daniel Veillard),
@@ -2169,14 +2424,14 @@ Gansterer),<br/>
       parsing and validation fixes based on the W3C regression tests, reader
       tree skipping function fix (Ashwin), Schemas regexps escaping fix
       (Volker Grabsch), handling of entity push errors (Ashwin), fix a slowdown
-      when encoder cant serialize characters on output</li>
+      when encoder can't serialize characters on output</li>
   <li>Code cleanup: compilation fix without the reader, without the output
       (Robert Schwebel), python whitespace (Martin), many space/tabs cleanups,
       serious cleanup of the entity handling code</li>
   <li>Improvement: switch parser to XML-1.0 5th edition, add parsing flags
       for old versions, switch URI parsing to RFC 3986,
       add xmlSchemaValidCtxtGetParserCtxt (Holger Kaelberer),
-      new hashing functions for dictionnaries (based on Stefan Behnel work),
+      new hashing functions for dictionaries (based on Stefan Behnel work),
       improve handling of misplaced html/head/body in HTML parser, better
       regression test tools and code coverage display, better algorithms
       to detect various versions of the billion laughts attacks, make
@@ -2235,7 +2490,7 @@ Gansterer),<br/>
       </li>
   <li>Code cleanup: fix open() call third argument, regexp cut'n paste
       copy error, unused variable in __xmlGlobalInitMutexLock (Hannes Eder),
-      some make distcheck realted fixes (John Carr)</li>
+      some make distcheck related fixes (John Carr)</li>
   <li>Improvements: HTTP Header: includes port number (William Brack),
       testURI --debug option, </li>
 </ul>
@@ -2331,13 +2586,13 @@ Gansterer),<br/>
   <li>bug fix: xmlGetNodePath fix (Kasimier), xmlDOMWrapAdoptNode and
       attribute (Kasimier), crash when using the recover mode, 
       xmlXPathEvalExpr problem (Kasimier), xmlXPathCompExprAdd bug (Kasimier),
-      missing destry in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
+      missing destroy in xmlFreeRMutex (Andrew Nosenko), XML Schemas fixes
       (Kasimier), warning on entities processing, XHTML script and style
       serialization (Kasimier), python generator for long types, bug in
       xmlSchemaClearValidCtxt (Bertrand Fritsch), xmlSchemaXPathEvaluate
       allocation bug (Marton Illes), error message end of line (Rob Richards),
       fix attribute serialization in writer (Rob Richards), PHP4 DTD validation
-      crasher, parser safety patch (Ben Darnell), _private context propagation
+      crash, parser safety patch (Ben Darnell), _private context propagation
       when parsing entities (with Michael Day), fix entities behaviour when 
       using SAX, URI to file path fix (Mikhail Zabaluev), disappearing validity
       context, arg error in SAX callback (Mike Hommey), fix mixed-content
@@ -2484,7 +2739,7 @@ Gansterer),<br/>
     Anatolij), xmlSchemaPSimpleTypeErr error report (Kasimier Buchcik), xml:
     namespace ahndling in Schemas (Kasimier), empty model group in Schemas
     (Kasimier), wildcard in Schemas (Kasimier), URI composition (William),
-    xs:anyType in Schemas (Kasimier), Python resolver emmitting error
+    xs:anyType in Schemas (Kasimier), Python resolver emitting error
     messages directly, Python xmlAttr.parent (Jakub Piotr Clapa), trying to
     fix the file path/URI conversion, xmlTextReaderGetAttribute fix (Rob
     Richards), xmlSchemaFreeAnnot memleak (Kasimier), HTML UTF-8
@@ -2511,7 +2766,7 @@ Gansterer),<br/>
   <li>build fixes: Windows build (Rob Richards), Mingw compilation (Igor
     Zlatkovic), Windows Makefile (Igor), gcc warnings (Kasimier and
     andriy@google.com), use gcc weak references to pthread to avoid the
-    pthread dependancy on Linux, compilation problem (Steve Nairn), compiling
+    pthread dependency on Linux, compilation problem (Steve Nairn), compiling
     of subset (Morten Welinder), IPv6/ss_family compilation (William Brack),
     compilation when disabling parts of the library, standalone test
     distribution.</li>
@@ -2553,7 +2808,7 @@ Gansterer),<br/>
     Linux/ELF/gcc4</li>
   <li>bug fixes: schemas type decimal fixups (William Brack), xmmlint return
     code (Gerry Murphy), small schemas fixes (Matthew Burgess and GUY
-    Fabrice), workaround "DAV:" namespace brokeness in c14n (Aleksey Sanin),
+    Fabrice), workaround "DAV:" namespace brokenness in c14n (Aleksey Sanin),
     segfault in Schemas (Kasimier Buchcik), Schemas attribute validation
     (Kasimier), Prop related functions and xmlNewNodeEatName (Rob Richards),
     HTML serialization of name attribute on a elements, Python error handlers
@@ -2573,7 +2828,7 @@ Gansterer),<br/>
     Bakefile support (Francesco Montorsi), Windows compilation (Joel Reed),
     some gcc4 fixes, HP-UX portability fixes (Rick Jones).</li>
   <li>bug fixes: xmlSchemaElementDump namespace (Kasimier Buchcik), push and
-    xmlreader stopping on non-fatal errors, thread support for dictionnaries
+    xmlreader stopping on non-fatal errors, thread support for dictionaries
     reference counting (Gary Coady), internal subset and push problem, URL
     saved in xmlCopyDoc, various schemas bug fixes (Kasimier), Python paths
     fixup (Stephane Bidoul), xmlGetNodePath and namespaces, xmlSetNsProp fix
@@ -2630,7 +2885,7 @@ Gansterer),<br/>
   <li>bug fixes: problem with XML::Libxml reported by Petr Pajas,  encoding
     conversion functions return values, UTF-8 bug affecting XPath reported by
     Markus Bertheau, catalog problem with NULL entries (William Brack)</li>
-  <li>documentation: fix to xmllint man page, some API function descritpion
+  <li>documentation: fix to xmllint man page, some API function description
     were updated.</li>
   <li>improvements: DTD validation APIs provided at the Python level (Brent
     Hendricks)</li>
@@ -2777,12 +3032,12 @@ Gansterer),<br/>
     William), xmlUriEscape (Mark Vakoc), a Relax-NG notAllowed problem (with
     William), Relax-NG name classes compares (William), XInclude duplicate
     fallback (William), external DTD encoding detection (William), a DTD
-    validation bug (William), xmlReader Close() fix, recusive extention
+    validation bug (William), xmlReader Close() fix, recursive extension
     schemas</li>
   <li>improvements: use xmlRead* APIs in test tools (Mark Vakoc), indenting
     save optimization, better handle IIS broken HTTP redirect  behaviour (Ian
     Hummel), HTML parser frameset (James Bursa), libxml2-python RPM
-    dependancy, XML Schemas union support (Kasimier Buchcik), warning removal
+    dependency, XML Schemas union support (Kasimier Buchcik), warning removal
     clanup (William), keep ChangeLog compressed when installing from RPMs</li>
   <li>documentation: examples and xmlDocDumpMemory docs (John Fleck), new
     example (load, xpath, modify, save), xmlCatalogDump() comments,</li>
@@ -2836,7 +3091,7 @@ Gansterer),<br/>
     William) reported by Yuuichi Teranishi</li>
   <li>bugfixes: make test and path issues, xmlWriter attribute serialization
     (William Brack), xmlWriter indentation (William), schemas validation
-    (Eric Haszlakiewicz), XInclude dictionnaries issues (William and Oleg
+    (Eric Haszlakiewicz), XInclude dictionaries issues (William and Oleg
     Paraschenko), XInclude empty fallback (William), HTML warnings (William),
     XPointer in XInclude (William), Python namespace serialization,
     isolat1ToUTF8 bound error (Alfred Mickautsch), output of parameter
@@ -2852,13 +3107,13 @@ Gansterer),<br/>
   <li>Windows compilation: mingw, msys (Mikhail Grushinskiy), function
     prototype (Cameron Johnson), MSVC6 compiler warnings, _WINSOCKAPI_
   patch</li>
-  <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offest in
+  <li>Parsers: added xmlByteConsumed(ctxt) API to get the byte offset in
     input.</li>
 </ul>
 
 <h3>2.6.5: Jan 25 2004</h3>
 <ul>
-  <li>Bugfixes: dictionnaries for schemas (William Brack), regexp segfault
+  <li>Bugfixes: dictionaries for schemas (William Brack), regexp segfault
     (William), xs:all problem (William), a number of XPointer bugfixes
     (William), xmllint error go to stderr, DTD validation problem with
     namespace, memory leak (William), SAX1 cleanup and minimal options fixes
@@ -3890,7 +4145,7 @@ it's actually not compiled in by default. The real fixes are:
     also contains numerous fixes and enhancements:
     <ul>
       <li>added xmlStopParser() to stop parsing</li>
-      <li>improved a lot parsing speed when there is large CDATA blocs</li>
+      <li>improved a lot parsing speed when there is large CDATA blocks</li>
       <li>includes XPath patches provided by Picdar Technology</li>
       <li>tried to fix as much as possible DTD validation and namespace
         related problems</li>
@@ -4189,7 +4444,7 @@ or libxslt wrappers or bindings:</p>
   <li><a href="http://savannah.gnu.org/projects/classpathx/">LibxmlJ</a> is
     an effort to create a 100% JAXP-compatible Java wrapper for libxml2 and
     libxslt as part of GNU ClasspathX project.</li>
-  <li>Patrick McPhee provides Rexx bindings fof libxml2 and libxslt, look for
+  <li>Patrick McPhee provides Rexx bindings for libxml2 and libxslt, look for
     <a href="http://www.interlog.com/~ptjm/software.html">RexxXML</a>.</li>
   <li><a
     href="http://www.satimage.fr/software/en/xml_suite.html">Satimage</a>
@@ -4198,7 +4453,7 @@ or libxslt wrappers or bindings:</p>
     osax</a>. This is an osax for Mac OS X with a set of commands to
     implement in AppleScript the XML DOM, XPATH and XSLT. Also includes
     commands for Property-lists (Apple's fast lookup table XML format.)</li>
-  <li>Francesco Montorsi developped <a
+  <li>Francesco Montorsi developed <a
     href="https://sourceforge.net/project/showfiles.php?group_id=51305&amp;package_id=45182">wxXml2</a>
     wrappers that interface libxml2, allowing wxWidgets applications to
     load/save/edit XML instances.</li>
index 354e5bd..6b4db47 100644 (file)
@@ -35,9 +35,9 @@ examples using both C and the Python bindings:</p>
 <ul>
   <li><a href="#Introducti">Introduction: why a new API</a></li>
   <li><a href="#Walking">Walking a simple tree</a></li>
-  <li><a href="#Extracting">Extracting informations for the current
+  <li><a href="#Extracting">Extracting information for the current
   node</a></li>
-  <li><a href="#Extracting1">Extracting informations for the
+  <li><a href="#Extracting1">Extracting information for the
   attributes</a></li>
   <li><a href="#Validating">Validating a document</a></li>
   <li><a href="#Entities">Entities substitution</a></li>
index ad4d8a6..cdff6ae 100644 (file)
@@ -76,7 +76,7 @@ static int xmlLittleEndian = 1;
 
 /**
  * xmlEncodingErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -170,7 +170,7 @@ closeIcuConverter(uconv_t *conv)
  * Returns 0 if success, or -1 otherwise
  * The value of @inlen after return is the number of octets consumed
  *     if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 static int
 asciiToUTF8(unsigned char* out, int *outlen,
@@ -217,7 +217,7 @@ asciiToUTF8(unsigned char* out, int *outlen,
  * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
  * The value of @inlen after return is the number of octets consumed
  *     if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 static int
 UTF8Toascii(unsigned char* out, int *outlen,
@@ -301,7 +301,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
  * Returns the number of bytes written if success, or -1 otherwise
  * The value of @inlen after return is the number of octets consumed
  *     if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 int
 isolat1ToUTF8(unsigned char* out, int *outlen,
@@ -373,6 +373,11 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
     if (len < 0)
        return(-1);
 
+    /*
+     * FIXME: Conversion functions must assure valid UTF-8, so we have
+     * to check for UTF-8 validity. Preferably, this converter shouldn't
+     * be used at all.
+     */
     memcpy(out, inb, len);
 
     *outlen = len;
@@ -396,7 +401,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
            or -1 otherwise
  * The value of @inlen after return is the number of octets consumed
  *     if the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 int
 UTF8Toisolat1(unsigned char* out, int *outlen,
@@ -496,13 +501,18 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
 {
     unsigned char* outstart = out;
     const unsigned char* processed = inb;
-    unsigned char* outend = out + *outlen;
+    unsigned char* outend;
     unsigned short* in = (unsigned short*) inb;
     unsigned short* inend;
     unsigned int c, d, inlen;
     unsigned char *tmp;
     int bits;
 
+    if (*outlen == 0) {
+        *inlenb = 0;
+        return(0);
+    }
+    outend = out + *outlen;
     if ((*inlenb % 2) == 1)
         (*inlenb)--;
     inlen = *inlenb / 2;
@@ -1483,16 +1493,25 @@ xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) {
     if ((handler == NULL) || (handlers == NULL)) {
         xmlEncodingErr(XML_I18N_NO_HANDLER,
                "xmlRegisterCharEncodingHandler: NULL handler !\n", NULL);
-       return;
+        goto free_handler;
     }
 
     if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS) {
         xmlEncodingErr(XML_I18N_EXCESS_HANDLER,
        "xmlRegisterCharEncodingHandler: Too many handler registered, see %s\n",
                       "MAX_ENCODING_HANDLERS");
-       return;
+        goto free_handler;
     }
     handlers[nbCharEncodingHandler++] = handler;
+    return;
+
+free_handler:
+    if (handler != NULL) {
+        if (handler->name != NULL) {
+            xmlFree(handler->name);
+        }
+        xmlFree(handler);
+    }
 }
 
 /**
@@ -1784,7 +1803,7 @@ xmlFindCharEncodingHandler(const char *name) {
  * @cd:                iconv converter data structure
  * @out:  a pointer to an array of bytes to store the result
  * @outlen:  the length of @out
- * @in:  a pointer to an array of ISO Latin 1 chars
+ * @in:  a pointer to an array of input bytes
  * @inlen:  the length of @in
  *
  * Returns 0 if success, or
@@ -1795,7 +1814,7 @@ xmlFindCharEncodingHandler(const char *name) {
  *
  * The value of @inlen after return is the number of octets consumed
  *     as the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 static int
 xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
@@ -1851,7 +1870,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
  * @toUnicode : non-zero if toUnicode. 0 otherwise.
  * @out:  a pointer to an array of bytes to store the result
  * @outlen:  the length of @out
- * @in:  a pointer to an array of ISO Latin 1 chars
+ * @in:  a pointer to an array of input bytes
  * @inlen:  the length of @in
  * @flush: if true, indicates end of input
  *
@@ -1863,7 +1882,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
  *
  * The value of @inlen after return is the number of octets consumed
  *     as the return value is positive, else unpredictable.
- * The value of @outlen after return is the number of octets consumed.
+ * The value of @outlen after return is the number of octets produced.
  */
 static int
 xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
@@ -1912,6 +1931,25 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
  *                                                                     *
  ************************************************************************/
 
+/**
+ * xmlEncInputChunk:
+ * @handler:  encoding handler
+ * @out:  a pointer to an array of bytes to store the result
+ * @outlen:  the length of @out
+ * @in:  a pointer to an array of input bytes
+ * @inlen:  the length of @in
+ * @flush:  flush (ICU-related)
+ *
+ * Returns 0 if success, or
+ *     -1 by lack of space, or
+ *     -2 if the transcoding fails (for *in is not valid utf8 string or
+ *        the result of transformation can't fit into the encoding we want), or
+ *     -3 if there the last byte can't form a single output char.
+ *
+ * The value of @inlen after return is the number of octets consumed
+ *     as the return value is 0, else unpredictable.
+ * The value of @outlen after return is the number of octets produced.
+ */
 static int
 xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
                  int *outlen, const unsigned char *in, int *inlen, int flush) {
@@ -1920,6 +1958,8 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
 
     if (handler->input != NULL) {
         ret = handler->input(out, outlen, in, inlen);
+        if (ret > 0)
+           ret = 0;
     }
 #ifdef LIBXML_ICONV_ENABLED
     else if (handler->iconv_in != NULL) {
@@ -1941,7 +1981,25 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
     return(ret);
 }
 
-/* Returns -4 if no output function was found. */
+/**
+ * xmlEncOutputChunk:
+ * @handler:  encoding handler
+ * @out:  a pointer to an array of bytes to store the result
+ * @outlen:  the length of @out
+ * @in:  a pointer to an array of input bytes
+ * @inlen:  the length of @in
+ *
+ * Returns 0 if success, or
+ *     -1 by lack of space, or
+ *     -2 if the transcoding fails (for *in is not valid utf8 string or
+ *        the result of transformation can't fit into the encoding we want), or
+ *     -3 if there the last byte can't form a single output char.
+ *     -4 if no output function was found.
+ *
+ * The value of @inlen after return is the number of octets consumed
+ *     as the return value is 0, else unpredictable.
+ * The value of @outlen after return is the number of octets produced.
+ */
 static int
 xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
                   int *outlen, const unsigned char *in, int *inlen) {
@@ -1949,6 +2007,8 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
 
     if (handler->output != NULL) {
         ret = handler->output(out, outlen, in, inlen);
+        if (ret > 0)
+           ret = 0;
     }
 #ifdef LIBXML_ICONV_ENABLED
     else if (handler->iconv_out != NULL) {
@@ -1958,7 +2018,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
 #ifdef LIBXML_ICU_ENABLED
     else if (handler->uconv_out != NULL) {
         ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen,
-                              TRUE);
+                              1);
     }
 #endif /* LIBXML_ICU_ENABLED */
     else {
@@ -2054,7 +2114,7 @@ xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
      */
     if (ret == -3) ret = 0;
     if (ret == -1) ret = 0;
-    return(ret);
+    return(written ? written : ret);
 }
 
 /**
@@ -2184,7 +2244,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
      */
     if (ret == -3) ret = 0;
     if (ret == -1) ret = 0;
-    return(ret);
+    return(c_out ? c_out : ret);
 }
 
 /**
@@ -2394,7 +2454,7 @@ xmlCharEncOutput(xmlOutputBufferPtr output, int init)
 {
     int ret;
     size_t written;
-    size_t writtentot = 0;
+    int writtentot = 0;
     size_t toconv;
     int c_in;
     int c_out;
@@ -2427,7 +2487,7 @@ retry:
        xmlGenericError(xmlGenericErrorContext,
                "initialized encoder\n");
 #endif
-        return(0);
+        return(c_out);
     }
 
     /*
@@ -2540,7 +2600,7 @@ retry:
             goto retry;
        }
     }
-    return(ret);
+    return(writtentot ? writtentot : ret);
 }
 #endif
 
@@ -2705,7 +2765,7 @@ retry:
             goto retry;
        }
     }
-    return(ret);
+    return(writtentot ? writtentot : ret);
 }
 
 /**
index d575e9d..1a8f86f 100644 (file)
@@ -71,7 +71,7 @@ static xmlEntity xmlEntityApos = {
 
 /**
  * xmlEntitiesErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -210,7 +210,7 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
          const xmlChar *content) {
     xmlDictPtr dict = NULL;
     xmlEntitiesTablePtr table = NULL;
-    xmlEntityPtr ret;
+    xmlEntityPtr ret, predef;
 
     if (name == NULL)
        return(NULL);
@@ -223,6 +223,44 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
         case XML_INTERNAL_GENERAL_ENTITY:
         case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
         case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
+            predef = xmlGetPredefinedEntity(name);
+            if (predef != NULL) {
+                int valid = 0;
+
+                /* 4.6 Predefined Entities */
+                if ((type == XML_INTERNAL_GENERAL_ENTITY) &&
+                    (content != NULL)) {
+                    int c = predef->content[0];
+
+                    if (((content[0] == c) && (content[1] == 0)) &&
+                        ((c == '>') || (c == '\'') || (c == '"'))) {
+                        valid = 1;
+                    } else if ((content[0] == '&') && (content[1] == '#')) {
+                        if (content[2] == 'x') {
+                            xmlChar *hex = BAD_CAST "0123456789ABCDEF";
+                            xmlChar ref[] = "00;";
+
+                            ref[0] = hex[c / 16 % 16];
+                            ref[1] = hex[c % 16];
+                            if (xmlStrcasecmp(&content[3], ref) == 0)
+                                valid = 1;
+                        } else {
+                            xmlChar ref[] = "00;";
+
+                            ref[0] = '0' + c / 10 % 10;
+                            ref[1] = '0' + c % 10;
+                            if (xmlStrEqual(&content[2], ref))
+                                valid = 1;
+                        }
+                    }
+                }
+                if (!valid) {
+                    xmlEntitiesErr(XML_ERR_ENTITY_PROCESSING,
+                            "xmlAddEntity: invalid redeclaration of predefined"
+                            " entity");
+                    return(NULL);
+                }
+            }
            if (dtd->entities == NULL)
                dtd->entities = xmlHashCreateDict(0, dict);
            table = dtd->entities;
@@ -666,11 +704,25 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
            } else {
                /*
                 * We assume we have UTF-8 input.
+                * It must match either:
+                *   110xxxxx 10xxxxxx
+                *   1110xxxx 10xxxxxx 10xxxxxx
+                *   11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+                * That is:
+                *   cur[0] is 11xxxxxx
+                *   cur[1] is 10xxxxxx
+                *   cur[2] is 10xxxxxx if cur[0] is 111xxxxx
+                *   cur[3] is 10xxxxxx if cur[0] is 1111xxxx
+                *   cur[0] is not 11111xxx
                 */
                char buf[11], *ptr;
                int val = 0, l = 1;
 
-               if (*cur < 0xC0) {
+               if (((cur[0] & 0xC0) != 0xC0) ||
+                   ((cur[1] & 0xC0) != 0x80) ||
+                   (((cur[0] & 0xE0) == 0xE0) && ((cur[2] & 0xC0) != 0x80)) ||
+                   (((cur[0] & 0xF0) == 0xF0) && ((cur[3] & 0xC0) != 0x80)) ||
+                   (((cur[0] & 0xF8) == 0xF8))) {
                    xmlEntitiesErr(XML_CHECK_NOT_UTF8,
                            "xmlEncodeEntities: input not UTF-8");
                    if (doc != NULL)
diff --git a/error.c b/error.c
index b7d5b36..9ff1c2b 100644 (file)
--- a/error.c
+++ b/error.c
@@ -146,7 +146,7 @@ xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
  * xmlParserPrintFileInfo:
  * @input:  an xmlParserInputPtr input
  *
- * Displays the associated file and line informations for the current input
+ * Displays the associated file and line information for the current input
  */
 
 void
@@ -557,6 +557,7 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
         * of the usual "base" (doc->URL) for the node (bug 152623).
         */
         xmlNodePtr prev = baseptr;
+        char *href = NULL;
        int inclcount = 0;
        while (prev != NULL) {
            if (prev->prev == NULL)
@@ -564,21 +565,20 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
            else {
                prev = prev->prev;
                if (prev->type == XML_XINCLUDE_START) {
-                   if (--inclcount < 0)
-                       break;
+                   if (inclcount > 0) {
+                        --inclcount;
+                    } else {
+                        href = (char *) xmlGetProp(prev, BAD_CAST "href");
+                        if (href != NULL)
+                           break;
+                    }
                } else if (prev->type == XML_XINCLUDE_END)
                    inclcount++;
            }
        }
-       if (prev != NULL) {
-           if (prev->type == XML_XINCLUDE_START) {
-               prev->type = XML_ELEMENT_NODE;
-               to->file = (char *) xmlGetProp(prev, BAD_CAST "href");
-               prev->type = XML_XINCLUDE_START;
-           } else {
-               to->file = (char *) xmlGetProp(prev, BAD_CAST "href");
-           }
-       } else
+        if (href != NULL)
+            to->file = href;
+       else
 #endif
            to->file = (char *) xmlStrdup(baseptr->doc->URL);
        if ((to->file == NULL) && (node != NULL) && (node->doc != NULL)) {
@@ -643,7 +643,7 @@ __xmlRaiseError(xmlStructuredErrorFunc schannel,
  * @domain: where the error comes from
  * @code: the error code
  * @node: the context node
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
diff --git a/fuzz/.gitignore b/fuzz/.gitignore
new file mode 100644 (file)
index 0000000..02c74b1
--- /dev/null
@@ -0,0 +1,13 @@
+corpus/
+genSeed
+html
+regexp
+schema
+seed/html*
+seed/schema*
+seed/xml*
+seed/xpath*
+testFuzzer
+uri
+xml
+xpath
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
new file mode 100644 (file)
index 0000000..7d38347
--- /dev/null
@@ -0,0 +1,140 @@
+AUTOMAKE_OPTIONS = -Wno-syntax
+EXTRA_PROGRAMS = genSeed html regexp schema uri xml xpath
+check_PROGRAMS = testFuzzer
+EXTRA_DIST = html.dict regexp.dict schema.dict xml.dict xpath.dict \
+            seed/uri
+CLEANFILES = $(EXTRA_PROGRAMS)
+AM_CPPFLAGS = -I$(top_srcdir)/include
+DEPENDENCIES = $(top_builddir)/libxml2.la
+LDADD = $(STATIC_BINARIES) $(top_builddir)/libxml2.la $(THREAD_LIBS) $(Z_LIBS) $(LZMA_LIBS) $(ICONV_LIBS) $(M_LIBS) $(WIN32_EXTRA_LIBADD)
+
+XML_MAX_LEN = 80000
+# Single quotes to avoid wildcard expansion by the shell
+XML_SEED_CORPUS_SRC = \
+    '$(top_srcdir)/test/*' \
+    '$(top_srcdir)/test/errors/*.xml' \
+    '$(top_srcdir)/test/errors10/*.xml' \
+    '$(top_srcdir)/test/namespaces/*' \
+    '$(top_srcdir)/test/valid/*.xml' \
+    '$(top_srcdir)/test/VC/*' \
+    '$(top_srcdir)/test/VCM/*' \
+    '$(top_srcdir)/test/XInclude/docs/*' \
+    '$(top_srcdir)/test/xmlid/*'
+
+testFuzzer_SOURCES = testFuzzer.c fuzz.c
+
+.PHONY: tests corpus clean-corpus
+
+corpus: seed/html.stamp seed/schema.stamp seed/xml.stamp seed/xpath.stamp
+
+tests: testFuzzer$(EXEEXT) corpus
+       @echo "## Running fuzzer tests"
+       @./testFuzzer$(EXEEXT)
+
+clean-corpus:
+       rm -rf seed/html.stamp seed/html
+       rm -rf seed/schema.stamp seed/schema
+       rm -rf seed/xml.stamp seed/xml
+       rm -rf seed/xpath.stamp seed/xpath
+
+# Seed corpus
+
+genSeed_SOURCES = genSeed.c fuzz.c
+
+# XML fuzzer
+
+seed/xml.stamp: genSeed$(EXEEXT)
+       @mkdir -p seed/xml
+       @./genSeed$(EXEEXT) xml $(XML_SEED_CORPUS_SRC)
+       @touch seed/xml.stamp
+
+xml_SOURCES = xml.c fuzz.c
+xml_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-xml: xml$(EXEEXT) seed/xml.stamp
+       @mkdir -p corpus/xml
+       ./xml$(EXEEXT) \
+           -dict=xml.dict \
+           -max_len=$(XML_MAX_LEN) \
+           -timeout=20 \
+           corpus/xml seed/xml
+
+# HTML fuzzer
+
+seed/html.stamp: genSeed$(EXEEXT)
+       @mkdir -p seed/html
+       @./genSeed$(EXEEXT) html '$(top_srcdir)/test/HTML/*'
+       @touch seed/html.stamp
+
+html_SOURCES = html.c fuzz.c
+html_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-html: html$(EXEEXT) seed/html.stamp
+       @mkdir -p corpus/html
+       ./html$(EXEEXT) \
+           -dict=html.dict \
+           -max_len=1000000 \
+           -timeout=10 \
+           corpus/html seed/html
+
+# Regexp fuzzer
+
+regexp_SOURCES = regexp.c fuzz.c
+regexp_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-regexp: regexp$(EXEEXT)
+       @mkdir -p corpus/regexp
+       ./regexp$(EXEEXT) \
+           -dict=regexp.dict \
+           -max_len=200 \
+           -timeout=5 \
+           corpus/regexp $(srcdir)/seed/regexp
+
+# URI fuzzer
+
+uri_SOURCES = uri.c fuzz.c
+uri_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-uri: uri$(EXEEXT)
+       @mkdir -p corpus/uri
+       ./uri$(EXEEXT) \
+           -max_len=10000 \
+           -timeout=2 \
+           corpus/uri $(srcdir)/seed/uri
+
+# XML Schema fuzzer
+
+seed/schema.stamp: genSeed$(EXEEXT)
+       @mkdir -p seed/schema
+       @./genSeed$(EXEEXT) schema '$(top_srcdir)/test/schemas/*.xsd'
+       @touch seed/schema.stamp
+
+schema_SOURCES = schema.c fuzz.c
+schema_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-schema: schema$(EXEEXT) seed/schema.stamp
+       @mkdir -p corpus/schema
+       ./schema$(EXEEXT) \
+           -dict=schema.dict \
+           -max_len=$(XML_MAX_LEN) \
+           -timeout=20 \
+           corpus/schema seed/schema
+
+# XPath fuzzer
+
+seed/xpath.stamp: genSeed$(EXEEXT)
+       @mkdir -p seed/xpath
+       @./genSeed$(EXEEXT) xpath "$(top_builddir)/test/XPath"
+       @touch seed/xpath.stamp
+
+xpath_SOURCES = xpath.c fuzz.c
+xpath_LDFLAGS = -fsanitize=fuzzer
+
+fuzz-xpath: xpath$(EXEEXT) seed/xpath.stamp
+       @mkdir -p corpus/xpath
+       ./xpath$(EXEEXT) \
+           -dict=xpath.dict \
+           -max_len=10000 \
+           -timeout=20 \
+           corpus/xpath seed/xpath
+
diff --git a/fuzz/README b/fuzz/README
new file mode 100644 (file)
index 0000000..f675ad8
--- /dev/null
@@ -0,0 +1,19 @@
+libFuzzer instructions for libxml2
+==================================
+
+Set compiler and options:
+
+    export CC=clang
+    export CFLAGS="-g -fsanitize=fuzzer-no-link,address,undefined \
+        -fno-sanitize-recover=all \
+        -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
+
+Build libxml2 with instrumentation:
+
+    ./configure --without-python
+    make
+
+Run fuzzers:
+
+    make -C fuzz fuzz-xml
+
diff --git a/fuzz/fuzz.c b/fuzz/fuzz.c
new file mode 100644 (file)
index 0000000..212136a
--- /dev/null
@@ -0,0 +1,355 @@
+/*
+ * fuzz.c: Common functions for fuzzing.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include <libxml/hash.h>
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/tree.h>
+#include <libxml/xmlIO.h>
+#include "fuzz.h"
+
+typedef struct {
+    const char *data;
+    size_t size;
+} xmlFuzzEntityInfo;
+
+/* Single static instance for now */
+static struct {
+    /* Original data */
+    const char *data;
+    size_t size;
+
+    /* Remaining data */
+    const char *ptr;
+    size_t remaining;
+
+    /* Buffer for unescaped strings */
+    char *outBuf;
+    char *outPtr; /* Free space at end of buffer */
+
+    xmlHashTablePtr entities; /* Maps URLs to xmlFuzzEntityInfos */
+
+    /* The first entity is the main entity. */
+    const char *mainUrl;
+    xmlFuzzEntityInfo *mainEntity;
+} fuzzData;
+
+/**
+ * xmlFuzzErrorFunc:
+ *
+ * An error function that simply discards all errors.
+ */
+void
+xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
+                 ...) {
+}
+
+/**
+ * xmlFuzzDataInit:
+ *
+ * Initialize fuzz data provider.
+ */
+void
+xmlFuzzDataInit(const char *data, size_t size) {
+    fuzzData.data = data;
+    fuzzData.size = size;
+    fuzzData.ptr = data;
+    fuzzData.remaining = size;
+
+    fuzzData.outBuf = xmlMalloc(size + 1);
+    fuzzData.outPtr = fuzzData.outBuf;
+
+    fuzzData.entities = xmlHashCreate(8);
+    fuzzData.mainUrl = NULL;
+    fuzzData.mainEntity = NULL;
+}
+
+/**
+ * xmlFuzzDataFree:
+ *
+ * Cleanup fuzz data provider.
+ */
+void
+xmlFuzzDataCleanup(void) {
+    xmlFree(fuzzData.outBuf);
+    xmlHashFree(fuzzData.entities, xmlHashDefaultDeallocator);
+}
+
+/**
+ * xmlFuzzReadInt:
+ * @size:  size of string in bytes
+ *
+ * Read an integer from the fuzz data.
+ */
+int
+xmlFuzzReadInt() {
+    int ret;
+
+    if (fuzzData.remaining < sizeof(int))
+        return(0);
+    memcpy(&ret, fuzzData.ptr, sizeof(int));
+    fuzzData.ptr += sizeof(int);
+    fuzzData.remaining -= sizeof(int);
+
+    return ret;
+}
+
+/**
+ * xmlFuzzReadRemaining:
+ * @size:  size of string in bytes
+ *
+ * Read remaining bytes from fuzz data.
+ */
+const char *
+xmlFuzzReadRemaining(size_t *size) {
+    const char *ret = fuzzData.ptr;
+
+    *size = fuzzData.remaining;
+    fuzzData.ptr += fuzzData.remaining;
+    fuzzData.remaining = 0;
+
+    return(ret);
+}
+
+/*
+ * xmlFuzzWriteString:
+ * @out:  output file
+ * @str:  string to write
+ *
+ * Write a random-length string to file in a format similar to
+ * FuzzedDataProvider. Backslash followed by newline marks the end of the
+ * string. Two backslashes are used to escape a backslash.
+ */
+void
+xmlFuzzWriteString(FILE *out, const char *str) {
+    for (; *str; str++) {
+        int c = (unsigned char) *str;
+        putc(c, out);
+        if (c == '\\')
+            putc(c, out);
+    }
+    putc('\\', out);
+    putc('\n', out);
+}
+
+/**
+ * xmlFuzzReadString:
+ * @size:  size of string in bytes
+ *
+ * Read a random-length string from the fuzz data.
+ *
+ * The format is similar to libFuzzer's FuzzedDataProvider but treats
+ * backslash followed by newline as end of string. This makes the fuzz data
+ * more readable. A backslash character is escaped with another backslash.
+ *
+ * Returns a zero-terminated string or NULL if the fuzz data is exhausted.
+ */
+const char *
+xmlFuzzReadString(size_t *size) {
+    const char *out = fuzzData.outPtr;
+
+    while (fuzzData.remaining > 0) {
+        int c = *fuzzData.ptr++;
+        fuzzData.remaining--;
+
+        if ((c == '\\') && (fuzzData.remaining > 0)) {
+            int c2 = *fuzzData.ptr;
+
+            if (c2 == '\n') {
+                fuzzData.ptr++;
+                fuzzData.remaining--;
+                *size = fuzzData.outPtr - out;
+                *fuzzData.outPtr++ = '\0';
+                return(out);
+            }
+            if (c2 == '\\') {
+                fuzzData.ptr++;
+                fuzzData.remaining--;
+            }
+        }
+
+        *fuzzData.outPtr++ = c;
+    }
+
+    if (fuzzData.outPtr > out) {
+        *size = fuzzData.outPtr - out;
+        *fuzzData.outPtr++ = '\0';
+        return(out);
+    }
+
+    return(NULL);
+}
+
+/**
+ * xmlFuzzReadEntities:
+ *
+ * Read entities like the main XML file, external DTDs, external parsed
+ * entities from fuzz data.
+ */
+void
+xmlFuzzReadEntities(void) {
+    size_t num = 0;
+
+    while (1) {
+        const char *url, *entity;
+        size_t urlSize, entitySize;
+        xmlFuzzEntityInfo *entityInfo;
+        
+        url = xmlFuzzReadString(&urlSize);
+        if (url == NULL) break;
+
+        entity = xmlFuzzReadString(&entitySize);
+        if (entity == NULL) break;
+
+        if (xmlHashLookup(fuzzData.entities, (xmlChar *)url) == NULL) {
+            entityInfo = xmlMalloc(sizeof(xmlFuzzEntityInfo));
+            if (entityInfo == NULL)
+                break;
+            entityInfo->data = entity;
+            entityInfo->size = entitySize;
+
+            xmlHashAddEntry(fuzzData.entities, (xmlChar *)url, entityInfo);
+
+            if (num == 0) {
+                fuzzData.mainUrl = url;
+                fuzzData.mainEntity = entityInfo;
+            }
+
+            num++;
+        }
+    }
+}
+
+/**
+ * xmlFuzzMainUrl:
+ *
+ * Returns the main URL.
+ */
+const char *
+xmlFuzzMainUrl(void) {
+    return(fuzzData.mainUrl);
+}
+
+/**
+ * xmlFuzzMainEntity:
+ * @size:  size of the main entity in bytes
+ *
+ * Returns the main entity.
+ */
+const char *
+xmlFuzzMainEntity(size_t *size) {
+    if (fuzzData.mainEntity == NULL)
+        return(NULL);
+    *size = fuzzData.mainEntity->size;
+    return(fuzzData.mainEntity->data);
+}
+
+/**
+ * xmlFuzzEntityLoader:
+ *
+ * The entity loader for fuzz data.
+ */
+xmlParserInputPtr
+xmlFuzzEntityLoader(const char *URL, const char *ID ATTRIBUTE_UNUSED,
+                    xmlParserCtxtPtr ctxt) {
+    xmlParserInputPtr input;
+    xmlFuzzEntityInfo *entity;
+
+    if (URL == NULL)
+        return(NULL);
+    entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
+    if (entity == NULL)
+        return(NULL);
+
+    input = xmlNewInputStream(ctxt);
+    input->filename = NULL;
+    input->buf = xmlParserInputBufferCreateMem(entity->data, entity->size,
+                                               XML_CHAR_ENCODING_NONE);
+    if (input->buf == NULL) {
+        xmlFreeInputStream(input);
+        return(NULL);
+    }
+    input->base = input->cur = xmlBufContent(input->buf->buffer);
+    input->end = input->base + entity->size;
+
+    return input;
+}
+
+/**
+ * xmlFuzzExtractStrings:
+ *
+ * Extract C strings from input data. Use exact-size allocations to detect
+ * potential memory errors.
+ */
+size_t
+xmlFuzzExtractStrings(const char *data, size_t size, char **strings,
+                      size_t numStrings) {
+    const char *start = data;
+    const char *end = data + size;
+    size_t i = 0, ret;
+
+    while (i < numStrings) {
+        size_t strSize = end - start;
+        const char *zero = memchr(start, 0, strSize);
+
+        if (zero != NULL)
+            strSize = zero - start;
+
+        strings[i] = xmlMalloc(strSize + 1);
+        memcpy(strings[i], start, strSize);
+        strings[i][strSize] = '\0';
+
+        i++;
+        if (zero != NULL)
+            start = zero + 1;
+        else
+            break;
+    }
+
+    ret = i;
+
+    while (i < numStrings) {
+        strings[i] = NULL;
+        i++;
+    }
+
+    return(ret);
+}
+
+char *
+xmlSlurpFile(const char *path, size_t *sizeRet) {
+    FILE *file;
+    struct stat statbuf;
+    char *data;
+    size_t size;
+
+    if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+        return(NULL);
+    size = statbuf.st_size;
+    file = fopen(path, "rb");
+    if (file == NULL)
+        return(NULL);
+    data = xmlMalloc(size + 1);
+    if (data != NULL) {
+        if (fread(data, 1, size, file) != size) {
+            xmlFree(data);
+            data = NULL;
+        } else {
+            data[size] = 0;
+            if (sizeRet != NULL)
+                *sizeRet = size;
+        }
+    }
+    fclose(file);
+
+    return(data);
+}
+
diff --git a/fuzz/fuzz.h b/fuzz/fuzz.h
new file mode 100644 (file)
index 0000000..a51b398
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * fuzz.h: Common functions and macros for fuzzing.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#ifndef __XML_FUZZERCOMMON_H__
+#define __XML_FUZZERCOMMON_H__
+
+#include <stddef.h>
+#include <stdio.h>
+#include <libxml/parser.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
+  #define HAVE_HTML_FUZZER
+#endif
+#if defined(LIBXML_REGEXP_ENABLED)
+  #define HAVE_REGEXP_FUZZER
+#endif
+#if defined(LIBXML_SCHEMAS_ENABLED)
+  #define HAVE_SCHEMA_FUZZER
+#endif
+#if 1
+  #define HAVE_URI_FUZZER
+#endif
+#if defined(LIBXML_OUTPUT_ENABLED) && \
+    defined(LIBXML_READER_ENABLED) && \
+    defined(LIBXML_XINCLUDE_ENABLED)
+  #define HAVE_XML_FUZZER
+#endif
+#if defined(LIBXML_XPATH_ENABLED)
+  #define HAVE_XPATH_FUZZER
+#endif
+
+int
+LLVMFuzzerInitialize(int *argc, char ***argv);
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size);
+
+void
+xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
+                 ...);
+
+void
+xmlFuzzDataInit(const char *data, size_t size);
+
+void
+xmlFuzzDataCleanup(void);
+
+int
+xmlFuzzReadInt(void);
+
+const char *
+xmlFuzzReadRemaining(size_t *size);
+
+void
+xmlFuzzWriteString(FILE *out, const char *str);
+
+const char *
+xmlFuzzReadString(size_t *size);
+
+void
+xmlFuzzReadEntities(void);
+
+const char *
+xmlFuzzMainUrl(void);
+
+const char *
+xmlFuzzMainEntity(size_t *size);
+
+xmlParserInputPtr
+xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
+
+size_t
+xmlFuzzExtractStrings(const char *data, size_t size, char **strings,
+                      size_t numStrings);
+
+char *
+xmlSlurpFile(const char *path, size_t *size);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __XML_FUZZERCOMMON_H__ */
+
diff --git a/fuzz/genSeed.c b/fuzz/genSeed.c
new file mode 100644 (file)
index 0000000..2f03802
--- /dev/null
@@ -0,0 +1,427 @@
+/*
+ * xmlSeed.c: Generate the XML seed corpus for fuzzing.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <glob.h>
+#include <libgen.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+#include <direct.h>
+#else
+#include <unistd.h>
+#endif
+
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/HTMLparser.h>
+#include <libxml/xinclude.h>
+#include <libxml/xmlschemas.h>
+#include "fuzz.h"
+
+#define PATH_SIZE 500
+#define SEED_BUF_SIZE 16384
+#define EXPR_SIZE 4500
+
+typedef int
+(*fileFunc)(const char *base, FILE *out);
+
+typedef int
+(*mainFunc)(const char *arg);
+
+static struct {
+    FILE *out;
+    xmlHashTablePtr entities; /* Maps URLs to xmlFuzzEntityInfos */
+    xmlExternalEntityLoader oldLoader;
+    fileFunc processFile;
+    const char *fuzzer;
+    int counter;
+    char cwd[PATH_SIZE];
+} globalData;
+
+/*
+ * A custom entity loader that writes all external DTDs or entities to a
+ * single file in the format expected by xmlFuzzEntityLoader.
+ */
+static xmlParserInputPtr
+fuzzEntityRecorder(const char *URL, const char *ID,
+                      xmlParserCtxtPtr ctxt) {
+    xmlParserInputPtr in;
+    static const int chunkSize = 16384;
+    int len;
+
+    in = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
+    if (in == NULL)
+        return(NULL);
+
+    if (globalData.entities == NULL) {
+        globalData.entities = xmlHashCreate(4);
+    } else if (xmlHashLookup(globalData.entities,
+                             (const xmlChar *) URL) != NULL) {
+        return(in);
+    }
+
+    do {
+        len = xmlParserInputBufferGrow(in->buf, chunkSize);
+        if (len < 0) {
+            fprintf(stderr, "Error reading %s\n", URL);
+            xmlFreeInputStream(in);
+            return(NULL);
+        }
+    } while (len > 0);
+
+    xmlFuzzWriteString(globalData.out, URL);
+    xmlFuzzWriteString(globalData.out,
+                       (char *) xmlBufContent(in->buf->buffer));
+
+    xmlFreeInputStream(in);
+
+    xmlHashAddEntry(globalData.entities, (const xmlChar *) URL, NULL);
+
+    return(xmlNoNetExternalEntityLoader(URL, ID, ctxt));
+}
+
+static void
+fuzzRecorderInit(FILE *out) {
+    globalData.out = out;
+    globalData.entities = xmlHashCreate(8);
+    globalData.oldLoader = xmlGetExternalEntityLoader();
+    xmlSetExternalEntityLoader(fuzzEntityRecorder);
+}
+
+static void
+fuzzRecorderCleanup() {
+    xmlSetExternalEntityLoader(globalData.oldLoader);
+    xmlHashFree(globalData.entities, xmlHashDefaultDeallocator);
+    globalData.out = NULL;
+    globalData.entities = NULL;
+    globalData.oldLoader = NULL;
+}
+
+#ifdef HAVE_XML_FUZZER
+static int
+processXml(const char *docFile, FILE *out) {
+    int opts = XML_PARSE_NOENT | XML_PARSE_DTDLOAD;
+    xmlDocPtr doc;
+
+    fwrite(&opts, sizeof(opts), 1, out);
+
+    fuzzRecorderInit(out);
+
+    doc = xmlReadFile(docFile, NULL, opts);
+    xmlXIncludeProcessFlags(doc, opts);
+    xmlFreeDoc(doc);
+
+    fuzzRecorderCleanup();
+
+    return(0);
+}
+#endif
+
+#ifdef HAVE_HTML_FUZZER
+static int
+processHtml(const char *docFile, FILE *out) {
+    char buf[SEED_BUF_SIZE];
+    FILE *file;
+    size_t size;
+    int opts = 0;
+
+    fwrite(&opts, sizeof(opts), 1, out);
+
+    /* Copy file */
+    file = fopen(docFile, "rb");
+    if (file == NULL) {
+        fprintf(stderr, "couldn't open %s\n", docFile);
+        return(0);
+    }
+    do {
+        size = fread(buf, 1, SEED_BUF_SIZE, file);
+        if (size > 0)
+            fwrite(buf, 1, size, out);
+    } while (size == SEED_BUF_SIZE);
+    fclose(file);
+
+    return(0);
+}
+#endif
+
+#ifdef HAVE_SCHEMA_FUZZER
+static int
+processSchema(const char *docFile, FILE *out) {
+    xmlSchemaPtr schema;
+    xmlSchemaParserCtxtPtr pctxt;
+
+    fuzzRecorderInit(out);
+
+    pctxt = xmlSchemaNewParserCtxt(docFile);
+    xmlSchemaSetParserErrors(pctxt, xmlFuzzErrorFunc, xmlFuzzErrorFunc, NULL);
+    schema = xmlSchemaParse(pctxt);
+    xmlSchemaFreeParserCtxt(pctxt);
+    xmlSchemaFree(schema);
+
+    fuzzRecorderCleanup();
+
+    return(0);
+}
+#endif
+
+static int
+processPattern(const char *pattern) {
+    glob_t globbuf;
+    int ret = 0;
+    int res, i;
+
+    res = glob(pattern, 0, NULL, &globbuf);
+    if (res == GLOB_NOMATCH)
+        return(0);
+    if (res != 0) {
+        fprintf(stderr, "couldn't match pattern %s\n", pattern);
+        return(-1);
+    }
+
+    for (i = 0; i < globbuf.gl_pathc; i++) {
+        struct stat statbuf;
+        char outPath[PATH_SIZE];
+        char *dirBuf = NULL;
+        char *baseBuf = NULL;
+        const char *path, *dir, *base;
+        FILE *out = NULL;
+        int dirChanged = 0;
+        size_t size;
+
+        path = globbuf.gl_pathv[i];
+
+        if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+            continue;
+
+        dirBuf = (char *) xmlCharStrdup(path);
+        baseBuf = (char *) xmlCharStrdup(path);
+        if ((dirBuf == NULL) || (baseBuf == NULL)) {
+            fprintf(stderr, "memory allocation failed\n");
+            ret = -1;
+            goto error;
+        }
+        dir = dirname(dirBuf);
+        base = basename(baseBuf);
+
+        size = snprintf(outPath, sizeof(outPath), "seed/%s/%s",
+                        globalData.fuzzer, base);
+        if (size >= PATH_SIZE) {
+            fprintf(stderr, "creating path failed\n");
+            ret = -1;
+            goto error;
+        }
+        out = fopen(outPath, "wb");
+        if (out == NULL) {
+            fprintf(stderr, "couldn't open %s for writing\n", outPath);
+            ret = -1;
+            goto error;
+        }
+        if (chdir(dir) != 0) {
+            fprintf(stderr, "couldn't chdir to %s\n", dir);
+            ret = -1;
+            goto error;
+        }
+        dirChanged = 1;
+        if (globalData.processFile(base, out) != 0)
+            ret = -1;
+
+error:
+        if (out != NULL)
+            fclose(out);
+        xmlFree(dirBuf);
+        xmlFree(baseBuf);
+        if ((dirChanged) && (chdir(globalData.cwd) != 0)) {
+            fprintf(stderr, "couldn't chdir to %s\n", globalData.cwd);
+            ret = -1;
+            break;
+        }
+    }
+
+    globfree(&globbuf);
+    return(ret);
+}
+
+#ifdef HAVE_XPATH_FUZZER
+static int
+processXPath(const char *testDir, const char *prefix, const char *name,
+             const char *data, const char *subdir, int xptr) {
+    char pattern[PATH_SIZE];
+    glob_t globbuf;
+    size_t i, size;
+    int ret = 0, res;
+
+    size = snprintf(pattern, sizeof(pattern), "%s/%s/%s*",
+                    testDir, subdir, prefix);
+    if (size >= PATH_SIZE)
+        return(-1);
+    res = glob(pattern, 0, NULL, &globbuf);
+    if (res == GLOB_NOMATCH)
+        return(0);
+    if (res != 0) {
+        fprintf(stderr, "couldn't match pattern %s\n", pattern);
+        return(-1);
+    }
+
+    for (i = 0; i < globbuf.gl_pathc; i++) {
+        char *path = globbuf.gl_pathv[i];
+        struct stat statbuf;
+        FILE *in;
+        char expr[EXPR_SIZE];
+
+        if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+            continue;
+
+        in = fopen(path, "rb");
+        if (in == NULL) {
+            ret = -1;
+            continue;
+        }
+
+        while (fgets(expr, EXPR_SIZE, in) > 0) {
+            char outPath[PATH_SIZE];
+            FILE *out;
+            int j;
+
+            for (j = 0; expr[j] != 0; j++)
+                if (expr[j] == '\r' || expr[j] == '\n')
+                    break;
+            expr[j] = 0;
+
+            size = snprintf(outPath, sizeof(outPath), "seed/xpath/%s-%d",
+                            name, globalData.counter);
+            if (size >= PATH_SIZE) {
+                ret = -1;
+                continue;
+            }
+            out = fopen(outPath, "wb");
+            if (out == NULL) {
+                ret = -1;
+                continue;
+            }
+
+            if (xptr) {
+                xmlFuzzWriteString(out, expr);
+            } else {
+                char xptrExpr[EXPR_SIZE+100];
+
+                /* Wrap XPath expressions as XPointer */
+                snprintf(xptrExpr, sizeof(xptrExpr), "xpointer(%s)", expr);
+                xmlFuzzWriteString(out, xptrExpr);
+            }
+
+            xmlFuzzWriteString(out, data);
+
+            fclose(out);
+            globalData.counter++;
+        }
+
+        fclose(in);
+    }
+
+    globfree(&globbuf);
+
+    return(ret);
+}
+
+int
+processXPathDir(const char *testDir) {
+    char pattern[PATH_SIZE];
+    glob_t globbuf;
+    size_t i, size;
+    int ret = 0;
+
+    globalData.counter = 1;
+    if (processXPath(testDir, "", "expr", "<d></d>", "expr", 0) != 0)
+        ret = -1;
+
+    size = snprintf(pattern, sizeof(pattern), "%s/docs/*", testDir);
+    if (size >= PATH_SIZE)
+        return(1);
+    if (glob(pattern, 0, NULL, &globbuf) != 0)
+        return(1);
+
+    for (i = 0; i < globbuf.gl_pathc; i++) {
+        char *path = globbuf.gl_pathv[i];
+        char *data;
+        const char *docFile;
+
+        data = xmlSlurpFile(path, NULL);
+        if (data == NULL) {
+            ret = -1;
+            continue;
+        }
+        docFile = basename(path);
+
+        globalData.counter = 1;
+        if (processXPath(testDir, docFile, docFile, data, "tests", 0) != 0)
+            ret = -1;
+        if (processXPath(testDir, docFile, docFile, data, "xptr", 1) != 0)
+            ret = -1;
+
+        xmlFree(data);
+    }
+
+    globfree(&globbuf);
+
+    return(ret);
+}
+#endif
+
+int
+main(int argc, const char **argv) {
+    mainFunc processArg = NULL;
+    const char *fuzzer;
+    int ret = 0;
+    int xpath = 0;
+    int i;
+
+    if (argc < 3) {
+        fprintf(stderr, "usage: seed [FUZZER] [PATTERN...]\n");
+        return(1);
+    }
+
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+    fuzzer = argv[1];
+    if (strcmp(fuzzer, "html") == 0) {
+#ifdef HAVE_HTML_FUZZER
+        processArg = processPattern;
+        globalData.processFile = processHtml;
+#endif
+    } else if (strcmp(fuzzer, "schema") == 0) {
+#ifdef HAVE_SCHEMA_FUZZER
+        processArg = processPattern;
+        globalData.processFile = processSchema;
+#endif
+    } else if (strcmp(fuzzer, "xml") == 0) {
+#ifdef HAVE_XML_FUZZER
+        processArg = processPattern;
+        globalData.processFile = processXml;
+#endif
+    } else if (strcmp(fuzzer, "xpath") == 0) {
+#ifdef HAVE_XPATH_FUZZER
+        processArg = processXPathDir;
+#endif
+    } else {
+        fprintf(stderr, "unknown fuzzer %s\n", fuzzer);
+        return(1);
+    }
+    globalData.fuzzer = fuzzer;
+
+    if (getcwd(globalData.cwd, PATH_SIZE) == NULL) {
+        fprintf(stderr, "couldn't get current directory\n");
+        return(1);
+    }
+
+    if (processArg != NULL)
+        for (i = 2; i < argc; i++)
+            processArg(argv[i]);
+
+    return(ret);
+}
+
diff --git a/fuzz/html.c b/fuzz/html.c
new file mode 100644 (file)
index 0000000..116b3df
--- /dev/null
@@ -0,0 +1,82 @@
+/*
+ * html.c: a libFuzzer target to test several HTML parser interfaces.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/HTMLparser.h>
+#include <libxml/HTMLtree.h>
+#include <libxml/catalog.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+                     char ***argv ATTRIBUTE_UNUSED) {
+    xmlInitParser();
+#ifdef LIBXML_CATALOG_ENABLED
+    xmlInitializeCatalog();
+#endif
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+    return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+    static const size_t maxChunkSize = 128;
+    htmlDocPtr doc;
+    htmlParserCtxtPtr ctxt;
+    xmlOutputBufferPtr out;
+    const char *docBuffer;
+    size_t docSize, consumed, chunkSize;
+    int opts, outSize;
+
+    xmlFuzzDataInit(data, size);
+    opts = xmlFuzzReadInt();
+
+    docBuffer = xmlFuzzReadRemaining(&docSize);
+    if (docBuffer == NULL) {
+        xmlFuzzDataCleanup();
+        return(0);
+    }
+
+    /* Pull parser */
+
+    doc = htmlReadMemory(docBuffer, docSize, NULL, NULL, opts);
+
+    /*
+     * Also test the serializer. Call htmlDocContentDumpOutput with our
+     * own buffer to avoid encoding the output. The HTML encoding is
+     * excruciatingly slow (see htmlEntityValueLookup).
+     */
+    out = xmlAllocOutputBuffer(NULL);
+    htmlDocContentDumpOutput(out, doc, NULL);
+    xmlOutputBufferClose(out);
+
+    xmlFreeDoc(doc);
+
+    /* Push parser */
+
+    ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL,
+                                    XML_CHAR_ENCODING_NONE);
+    htmlCtxtUseOptions(ctxt, opts);
+
+    for (consumed = 0; consumed < docSize; consumed += chunkSize) {
+        chunkSize = docSize - consumed;
+        if (chunkSize > maxChunkSize)
+            chunkSize = maxChunkSize;
+        htmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
+    }
+
+    htmlParseChunk(ctxt, NULL, 0, 1);
+    xmlFreeDoc(ctxt->myDoc);
+    htmlFreeParserCtxt(ctxt);
+
+    /* Cleanup */
+
+    xmlFuzzDataCleanup();
+    xmlResetLastError();
+
+    return(0);
+}
+
diff --git a/fuzz/html.dict b/fuzz/html.dict
new file mode 100644 (file)
index 0000000..80444c2
--- /dev/null
@@ -0,0 +1,124 @@
+elem_a="<a></a>"
+elem_abbr="<abbr></abbr>"
+elem_acronym="<acronym></acronym>"
+elem_address="<address></address>"
+elem_applet="<applet></applet>"
+elem_area="<area>"
+elem_b="<b></b>"
+elem_base="<base>"
+elem_basefont="<basefont>"
+elem_bdo="<bdo></bdo>"
+elem_big="<big></big>"
+elem_blockquote="<blockquote></blockquote>"
+elem_body="<body></body>"
+elem_br="<br>"
+elem_button="<button></button>"
+elem_caption="<caption></caption>"
+elem_center="<center></center>"
+elem_cite="<cite></cite>"
+elem_code="<code></code>"
+elem_col="<col>"
+elem_colgroup="<colgroup></colgroup>"
+elem_dd="<dd></dd>"
+elem_del="<del></del>"
+elem_dfn="<dfn></dfn>"
+elem_dir="<dir></dir>"
+elem_div="<div></div>"
+elem_dl="<dl></dl>"
+elem_dt="<dt></dt>"
+elem_em="<em></em>"
+elem_embed="<embed></embed>"
+elem_fieldset="<fieldset></fieldset>"
+elem_font="<font></font>"
+elem_form="<form></form>"
+elem_frame="<frame>"
+elem_frameset="<frameset></frameset>"
+elem_h1="<h1></h1>"
+elem_h2="<h2></h2>"
+elem_h3="<h3></h3>"
+elem_h4="<h4></h4>"
+elem_h5="<h5></h5>"
+elem_h6="<h6></h6>"
+elem_head="<head></head>"
+elem_hr="<hr>"
+elem_html="<html></html>"
+elem_i="<i></i>"
+elem_iframe="<iframe></iframe>"
+elem_img="<img>"
+elem_input="<input>"
+elem_ins="<ins></ins>"
+elem_isindex="<isindex>"
+elem_kbd="<kbd></kbd>"
+elem_label="<label></label>"
+elem_legend="<legend></legend>"
+elem_li="<li></li>"
+elem_link="<link>"
+elem_map="<map></map>"
+elem_menu="<menu></menu>"
+elem_meta="<meta>"
+elem_noframes="<noframes></noframes>"
+elem_noscript="<noscript></noscript>"
+elem_object="<object></object>"
+elem_ol="<ol></ol>"
+elem_optgroup="<optgroup></optgroup>"
+elem_option="<option></option>"
+elem_p="<p></p>"
+elem_param="<param>"
+elem_pre="<pre></pre>"
+elem_q="<q></q>"
+elem_s="<s></s>"
+elem_samp="<samp></samp>"
+elem_script="<script></script>"
+elem_select="<select></select>"
+elem_small="<small></small>"
+elem_span="<span></span>"
+elem_strike="<strike></strike>"
+elem_strong="<strong></strong>"
+elem_style="<style></style>"
+elem_sub="<sub></sub>"
+elem_sup="<sup></sup>"
+elem_table="<table></table>"
+elem_tbody="<tbody></tbody>"
+elem_td="<td></td>"
+elem_textarea="<textarea></textarea>"
+elem_tfoot="<tfoot></tfoot>"
+elem_th="<th></th>"
+elem_thead="<thead></thead>"
+elem_title="<title></title>"
+elem_tr="<tr></tr>"
+elem_tt="<tt></tt>"
+elem_u="<u></u>"
+elem_ul="<ul></ul>"
+elem_var="<var></var>"
+
+attr_id=" id=\"\""
+attr_style=" style=\"\""
+
+comment="<!-- -->"
+
+doctype="<!DOCTYPE d>"
+doctype_system="<!DOCTYPE s SYSTEM \"u\">"
+doctype_public="<!DOCTYPE p PUBLIC \"i\" \"u\">"
+
+pi="<?a?>"
+
+ref_lt="&lt;"
+ref_gt="&gt;"
+ref_amp="&amp;"
+ref_apos="&apos;"
+ref_quot="&quot;"
+ref_dec="&#9;"
+ref_hex="&#xA;"
+
+cs_utf8="UTF-8"
+cs_utf16="UTF-16"
+cs_utf16le="UTF-16LE"
+cs_utf16be="UTF-16BE"
+cs_ucs2="UCS-2"
+cs_ucs4="UCS-4"
+cs_latin1="ISO-8859-1"
+cs_ascii="ASCII"
+cs_ebcdic="EBCDIC"
+cs_iso2022jp="ISO-2022-JP"
+cs_shift_jis="SHIFT_JIS"
+cs_euc_jp="EUC-JP"
diff --git a/fuzz/html.options b/fuzz/html.options
new file mode 100644 (file)
index 0000000..1c63f53
--- /dev/null
@@ -0,0 +1,2 @@
+[libfuzzer]
+timeout = 10
diff --git a/fuzz/regexp.c b/fuzz/regexp.c
new file mode 100644 (file)
index 0000000..af1210a
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * regexp.c: a libFuzzer target to test the regexp module.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/xmlregexp.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+                     char ***argv ATTRIBUTE_UNUSED) {
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+    return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+    xmlRegexpPtr regexp;
+    char *str[2] = { NULL, NULL };
+    size_t numStrings;
+
+    if (size > 200)
+        return(0);
+
+    numStrings = xmlFuzzExtractStrings(data, size, str, 2);
+
+    /* CUR_SCHAR doesn't handle invalid UTF-8 and may cause infinite loops. */
+    if (xmlCheckUTF8(BAD_CAST str[0]) != 0) {
+        regexp = xmlRegexpCompile(BAD_CAST str[0]);
+        /* xmlRegexpExec has pathological performance in too many cases. */
+#if 0
+        if ((regexp != NULL) && (numStrings >= 2)) {
+            xmlRegexpExec(regexp, BAD_CAST str[1]);
+        }
+#endif
+        xmlRegFreeRegexp(regexp);
+    }
+
+    xmlFree(str[0]);
+    xmlFree(str[1]);
+    xmlResetLastError();
+
+    return 0;
+}
+
diff --git a/fuzz/regexp.dict b/fuzz/regexp.dict
new file mode 100644 (file)
index 0000000..30d666d
--- /dev/null
@@ -0,0 +1,155 @@
+quant_any="*"
+quant_opt="?"
+quant_some="+"
+quant_num="{1,2}"
+
+dot="."
+branch="|a"
+parens="()"
+parens_inner=")("
+pos_group="[a]"
+neg_group="[^a]"
+class_subtraction="[a-[b]]"
+
+esc_space="\\s"
+esc_initial="\\i"
+esc_name="\\c"
+esc_digit="\\d"
+esc_word="\\w"
+
+cat_letter="\\p{L}"
+cat_mark="\\p{M}"
+cat_number="\\p{N}"
+cat_punct="\\p{P}"
+cat_sym="\\p{S}"
+cat_sep="\\p{Z}"
+cat_other="\\p{C}"
+
+block_aegean_numbers="\\p{IsAegeanNumbers}"
+block_alphabetic_presentation_forms="\\p{IsAlphabeticPresentationForms}"
+block_arabic="\\p{IsArabic}"
+block_arabic_presentation_forms_a="\\p{IsArabicPresentationFormsA}"
+block_arabic_presentation_forms_b="\\p{IsArabicPresentationFormsB}"
+block_armenian="\\p{IsArmenian}"
+block_arrows="\\p{IsArrows}"
+block_basic_latin="\\p{IsBasicLatin}"
+block_bengali="\\p{IsBengali}"
+block_block_elements="\\p{IsBlockElements}"
+block_bopomofo="\\p{IsBopomofo}"
+block_bopomofo_extended="\\p{IsBopomofoExtended}"
+block_box_drawing="\\p{IsBoxDrawing}"
+block_braille_patterns="\\p{IsBraillePatterns}"
+block_buhid="\\p{IsBuhid}"
+block_byzantine_musical_symbols="\\p{IsByzantineMusicalSymbols}"
+block_c_j_k_compatibility="\\p{IsCJKCompatibility}"
+block_c_j_k_compatibility_forms="\\p{IsCJKCompatibilityForms}"
+block_c_j_k_compatibility_ideographs="\\p{IsCJKCompatibilityIdeographs}"
+block_c_j_k_compatibility_ideographs_supplement="\\p{IsCJKCompatibilityIdeographsSupplement}"
+block_c_j_k_radicals_supplement="\\p{IsCJKRadicalsSupplement}"
+block_c_j_k_symbolsand_punctuation="\\p{IsCJKSymbolsandPunctuation}"
+block_c_j_k_unified_ideographs="\\p{IsCJKUnifiedIdeographs}"
+block_c_j_k_unified_ideographs_extension_a="\\p{IsCJKUnifiedIdeographsExtensionA}"
+block_cjk_unified_ideographs_extension_b="\\p{IsCJKUnifiedIdeographsExtensionB}"
+block_cherokee="\\p{IsCherokee}"
+block_combining_diacritical_marks="\\p{IsCombiningDiacriticalMarks}"
+block_combining_diacritical_marksfor_symbols="\\p{IsCombiningDiacriticalMarksforSymbols}"
+block_combining_half_marks="\\p{IsCombiningHalfMarks}"
+block_combining_marksfor_symbols="\\p{IsCombiningMarksforSymbols}"
+block_control_pictures="\\p{IsControlPictures}"
+block_currency_symbols="\\p{IsCurrencySymbols}"
+block_cypriot_syllabary="\\p{IsCypriotSyllabary}"
+block_cyrillic="\\p{IsCyrillic}"
+block_cyrillic_supplement="\\p{IsCyrillicSupplement}"
+block_deseret="\\p{IsDeseret}"
+block_devanagari="\\p{IsDevanagari}"
+block_dingbats="\\p{IsDingbats}"
+block_enclosed_alphanumerics="\\p{IsEnclosedAlphanumerics}"
+block_enclosed_cjk_lettersand_months="\\p{IsEnclosedCJKLettersandMonths}"
+block_ethiopic="\\p{IsEthiopic}"
+block_general_punctuation="\\p{IsGeneralPunctuation}"
+block_geometric_shapes="\\p{IsGeometricShapes}"
+block_georgian="\\p{IsGeorgian}"
+block_gothic="\\p{IsGothic}"
+block_greek="\\p{IsGreek}"
+block_greek_extended="\\p{IsGreekExtended}"
+block_greekand_coptic="\\p{IsGreekandCoptic}"
+block_gujarati="\\p{IsGujarati}"
+block_gurmukhi="\\p{IsGurmukhi}"
+block_halfwidthand_fullwidth_forms="\\p{IsHalfwidthandFullwidthForms}"
+block_hangul_compatibility_jamo="\\p{IsHangulCompatibilityJamo}"
+block_hangul_jamo="\\p{IsHangulJamo}"
+block_hangul_syllables="\\p{IsHangulSyllables}"
+block_hanunoo="\\p{IsHanunoo}"
+block_hebrew="\\p{IsHebrew}"
+block_high_private_use_surrogates="\\p{IsHighPrivateUseSurrogates}"
+block_high_surrogates="\\p{IsHighSurrogates}"
+block_hiragana="\\p{IsHiragana}"
+block_ipa_extensions="\\p{IsIPAExtensions}"
+block_ideographic_description_characters="\\p{IsIdeographicDescriptionCharacters}"
+block_kanbun="\\p{IsKanbun}"
+block_kangxi_radicals="\\p{IsKangxiRadicals}"
+block_kannada="\\p{IsKannada}"
+block_katakana="\\p{IsKatakana}"
+block_katakana_phonetic_extensions="\\p{IsKatakanaPhoneticExtensions}"
+block_khmer="\\p{IsKhmer}"
+block_khmer_symbols="\\p{IsKhmerSymbols}"
+block_lao="\\p{IsLao}"
+block_latin1Supplement="\\p{IsLatin1Supplement}"
+block_latin_extended_a="\\p{IsLatinExtendedA}"
+block_latin_extended_b="\\p{IsLatinExtendedB}"
+block_latin_extended_additional="\\p{IsLatinExtendedAdditional}"
+block_letterlike_symbols="\\p{IsLetterlikeSymbols}"
+block_limbu="\\p{IsLimbu}"
+block_linear_b_ideograms="\\p{IsLinearBIdeograms}"
+block_linear_b_syllabary="\\p{IsLinearBSyllabary}"
+block_low_surrogates="\\p{IsLowSurrogates}"
+block_malayalam="\\p{IsMalayalam}"
+block_mathematical_alphanumeric_symbols="\\p{IsMathematicalAlphanumericSymbols}"
+block_mathematical_operators="\\p{IsMathematicalOperators}"
+block_miscellaneous_mathematical_symbols_a="\\p{IsMiscellaneousMathematicalSymbolsA}"
+block_miscellaneous_mathematical_symbols_b="\\p{IsMiscellaneousMathematicalSymbolsB}"
+block_miscellaneous_symbols="\\p{IsMiscellaneousSymbols}"
+block_miscellaneous_symbolsand_arrows="\\p{IsMiscellaneousSymbolsandArrows}"
+block_miscellaneous_technical="\\p{IsMiscellaneousTechnical}"
+block_mongolian="\\p{IsMongolian}"
+block_musical_symbols="\\p{IsMusicalSymbols}"
+block_myanmar="\\p{IsMyanmar}"
+block_number_forms="\\p{IsNumberForms}"
+block_ogham="\\p{IsOgham}"
+block_old_italic="\\p{IsOldItalic}"
+block_optical_character_recognition="\\p{IsOpticalCharacterRecognition}"
+block_oriya="\\p{IsOriya}"
+block_osmanya="\\p{IsOsmanya}"
+block_phonetic_extensions="\\p{IsPhoneticExtensions}"
+block_private_use="\\p{IsPrivateUse}"
+block_private_use_area="\\p{IsPrivateUseArea}"
+block_runic="\\p{IsRunic}"
+block_shavian="\\p{IsShavian}"
+block_sinhala="\\p{IsSinhala}"
+block_small_form_variants="\\p{IsSmallFormVariants}"
+block_spacing_modifier_letters="\\p{IsSpacingModifierLetters}"
+block_specials="\\p{IsSpecials}"
+block_superscriptsand_subscripts="\\p{IsSuperscriptsandSubscripts}"
+block_supplemental_arrows_a="\\p{IsSupplementalArrowsA}"
+block_supplemental_arrows_b="\\p{IsSupplementalArrowsB}"
+block_supplemental_mathematical_operators="\\p{IsSupplementalMathematicalOperators}"
+block_supplementary_private_use_area_a="\\p{IsSupplementaryPrivateUseAreaA}"
+block_supplementary_private_use_area_b="\\p{IsSupplementaryPrivateUseAreaB}"
+block_syriac="\\p{IsSyriac}"
+block_tagalog="\\p{IsTagalog}"
+block_tagbanwa="\\p{IsTagbanwa}"
+block_tags="\\p{IsTags}"
+block_tai_le="\\p{IsTaiLe}"
+block_tai_xuan_jing_symbols="\\p{IsTaiXuanJingSymbols}"
+block_tamil="\\p{IsTamil}"
+block_telugu="\\p{IsTelugu}"
+block_thaana="\\p{IsThaana}"
+block_thai="\\p{IsThai}"
+block_tibetan="\\p{IsTibetan}"
+block_ugaritic="\\p{IsUgaritic}"
+block_unified_canadian_aboriginal_syllabics="\\p{IsUnifiedCanadianAboriginalSyllabics}"
+block_variation_selectors="\\p{IsVariationSelectors}"
+block_variation_selectors_supplement="\\p{IsVariationSelectorsSupplement}"
+block_yi_radicals="\\p{IsYiRadicals}"
+block_yi_syllables="\\p{IsYiSyllables}"
+block_yijing_hexagram_symbols="\\p{IsYijingHexagramSymbols}"
diff --git a/fuzz/regexp.options b/fuzz/regexp.options
new file mode 100644 (file)
index 0000000..ea2a7a2
--- /dev/null
@@ -0,0 +1,2 @@
+[libfuzzer]
+timeout = 5
diff --git a/fuzz/schema.c b/fuzz/schema.c
new file mode 100644 (file)
index 0000000..689bffe
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * schema.c: a libFuzzer target to test the XML Schema processor.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/catalog.h>
+#include <libxml/xmlschemas.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+                     char ***argv ATTRIBUTE_UNUSED) {
+    xmlInitParser();
+#ifdef LIBXML_CATALOG_ENABLED
+    xmlInitializeCatalog();
+#endif
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
+
+    return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+    xmlSchemaParserCtxtPtr pctxt;
+
+    if (size > 50000)
+        return(0);
+
+    xmlFuzzDataInit(data, size);
+    xmlFuzzReadEntities();
+
+    pctxt = xmlSchemaNewParserCtxt(xmlFuzzMainUrl());
+    xmlSchemaSetParserErrors(pctxt, xmlFuzzErrorFunc, xmlFuzzErrorFunc, NULL);
+    xmlSchemaFree(xmlSchemaParse(pctxt));
+    xmlSchemaFreeParserCtxt(pctxt);
+
+    xmlFuzzDataCleanup();
+    xmlResetLastError();
+
+    return(0);
+}
+
diff --git a/fuzz/schema.dict b/fuzz/schema.dict
new file mode 100644 (file)
index 0000000..9a8fd38
--- /dev/null
@@ -0,0 +1,55 @@
+# TODO: Add more language elements
+
+xs_annotation="<xs:annotation></xs:annotation>"
+
+xs_attribute="<xs:attribute name='a'></xs:attribute>"
+xs_attribute_required="<xs:attribute name='a' use='required'></xs:attribute>"
+xs_element="<xs:element name='e'></xs:element>"
+
+# Primitive datatypes
+type_string=" type='xs:string'"
+type_boolean=" type='xs:boolean'"
+type_decimal=" type='xs:decimal'"
+type_float=" type='xs:float'"
+type_double=" type='xs:double'"
+type_date_time=" type='xs:dateTime'"
+type_time=" type='xs:time'"
+type_date=" type='xs:date'"
+type_g_year_month=" type='xs:gYearMonth'"
+type_g_year=" type='xs:gYear'"
+type_g_month_day=" type='xs:gMonthDay'"
+type_g_day=" type='xs:gDay'"
+type_g_month=" type='xs:gMonth'"
+type_hex_binary=" type='xs:hexBinary'"
+type_base64_binary=" type='xs:base64Binary'"
+type_any_uri=" type='xs:anyURI'"
+type_qname=" type='xs:QName'"
+type_notation=" type='xs:NOTATION'"
+
+# Occurs
+occurs_min=" minOccurs='1'"
+occurs_max=" maxOccurs='9'"
+occurs_max_unbounded=" maxOccurs='unbounded'"
+
+# Simple type
+xs_restriction_integer="<xs:simpleType><xs:restriction base='xs:integer'></xs:restriction></xs:simpleType>"
+xs_restriction_string="<xs:simpleType><xs:restriction base='xs:string'></xs:restriction></xs:simpleType>"
+xs_list="<xs:simpleType><xs:list></xs:list></xs:simpleType>"
+xs_union="<xs:simpleType><xs:union></xs:union></xs:simpleType>"
+
+# Restrictions
+xs_min_exclusive="<xs:minExclusive value='0'/>"
+xs_min_inclusive="<xs:minInclusive value='0'/>"
+xs_max_exclusive="<xs:maxExclusive value='9'/>"
+xs_max_inclusive="<xs:maxInclusive value='9'/>"
+xs_total_digits="<xs:totalDigits value='3'/>"
+xs_fraction_digits="<xs:fractionDigits value='3'/>"
+xs_length="<xs:length value='3'/>"
+xs_min_length="<xs:minLength value='3'/>"
+xs_max_length="<xs:maxLength value='3'/>"
+xs_enumeration="<xs:enumeration value='a'/>"
+xs_white_space_collapse="<xs:whiteSpace value='collapse'/>"
+xs_white_space_preserve="<xs:whiteSpace value='preserve'/>"
+xs_white_space_replace="<xs:whiteSpace value='replace'/>"
+xs_pattern="<xs:pattern value='a'/>"
+
diff --git a/fuzz/schema.options b/fuzz/schema.options
new file mode 100644 (file)
index 0000000..e5d3bbe
--- /dev/null
@@ -0,0 +1,2 @@
+[libfuzzer]
+timeout = 20
diff --git a/fuzz/seed/regexp/branch-1 b/fuzz/seed/regexp/branch-1
new file mode 100644 (file)
index 0000000..ded775e
Binary files /dev/null and b/fuzz/seed/regexp/branch-1 differ
diff --git a/fuzz/seed/regexp/branch-10 b/fuzz/seed/regexp/branch-10
new file mode 100644 (file)
index 0000000..6700d77
Binary files /dev/null and b/fuzz/seed/regexp/branch-10 differ
diff --git a/fuzz/seed/regexp/branch-11 b/fuzz/seed/regexp/branch-11
new file mode 100644 (file)
index 0000000..d83f918
Binary files /dev/null and b/fuzz/seed/regexp/branch-11 differ
diff --git a/fuzz/seed/regexp/branch-12 b/fuzz/seed/regexp/branch-12
new file mode 100644 (file)
index 0000000..b44dba5
Binary files /dev/null and b/fuzz/seed/regexp/branch-12 differ
diff --git a/fuzz/seed/regexp/branch-13 b/fuzz/seed/regexp/branch-13
new file mode 100644 (file)
index 0000000..64e50a0
Binary files /dev/null and b/fuzz/seed/regexp/branch-13 differ
diff --git a/fuzz/seed/regexp/branch-2 b/fuzz/seed/regexp/branch-2
new file mode 100644 (file)
index 0000000..8293d81
Binary files /dev/null and b/fuzz/seed/regexp/branch-2 differ
diff --git a/fuzz/seed/regexp/branch-3 b/fuzz/seed/regexp/branch-3
new file mode 100644 (file)
index 0000000..696af9b
Binary files /dev/null and b/fuzz/seed/regexp/branch-3 differ
diff --git a/fuzz/seed/regexp/branch-4 b/fuzz/seed/regexp/branch-4
new file mode 100644 (file)
index 0000000..8317998
Binary files /dev/null and b/fuzz/seed/regexp/branch-4 differ
diff --git a/fuzz/seed/regexp/branch-5 b/fuzz/seed/regexp/branch-5
new file mode 100644 (file)
index 0000000..6b6db8b
Binary files /dev/null and b/fuzz/seed/regexp/branch-5 differ
diff --git a/fuzz/seed/regexp/branch-6 b/fuzz/seed/regexp/branch-6
new file mode 100644 (file)
index 0000000..4f47790
Binary files /dev/null and b/fuzz/seed/regexp/branch-6 differ
diff --git a/fuzz/seed/regexp/branch-7 b/fuzz/seed/regexp/branch-7
new file mode 100644 (file)
index 0000000..6334f72
Binary files /dev/null and b/fuzz/seed/regexp/branch-7 differ
diff --git a/fuzz/seed/regexp/branch-8 b/fuzz/seed/regexp/branch-8
new file mode 100644 (file)
index 0000000..f77a8f4
Binary files /dev/null and b/fuzz/seed/regexp/branch-8 differ
diff --git a/fuzz/seed/regexp/branch-9 b/fuzz/seed/regexp/branch-9
new file mode 100644 (file)
index 0000000..acd0eec
Binary files /dev/null and b/fuzz/seed/regexp/branch-9 differ
diff --git a/fuzz/seed/regexp/bug316338-1 b/fuzz/seed/regexp/bug316338-1
new file mode 100644 (file)
index 0000000..9f0a504
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-1 differ
diff --git a/fuzz/seed/regexp/bug316338-10 b/fuzz/seed/regexp/bug316338-10
new file mode 100644 (file)
index 0000000..60685bb
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-10 differ
diff --git a/fuzz/seed/regexp/bug316338-11 b/fuzz/seed/regexp/bug316338-11
new file mode 100644 (file)
index 0000000..72a7956
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-11 differ
diff --git a/fuzz/seed/regexp/bug316338-12 b/fuzz/seed/regexp/bug316338-12
new file mode 100644 (file)
index 0000000..85416ee
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-12 differ
diff --git a/fuzz/seed/regexp/bug316338-13 b/fuzz/seed/regexp/bug316338-13
new file mode 100644 (file)
index 0000000..c91d4fe
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-13 differ
diff --git a/fuzz/seed/regexp/bug316338-14 b/fuzz/seed/regexp/bug316338-14
new file mode 100644 (file)
index 0000000..a164b42
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-14 differ
diff --git a/fuzz/seed/regexp/bug316338-15 b/fuzz/seed/regexp/bug316338-15
new file mode 100644 (file)
index 0000000..750c76d
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-15 differ
diff --git a/fuzz/seed/regexp/bug316338-16 b/fuzz/seed/regexp/bug316338-16
new file mode 100644 (file)
index 0000000..23c5d23
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-16 differ
diff --git a/fuzz/seed/regexp/bug316338-2 b/fuzz/seed/regexp/bug316338-2
new file mode 100644 (file)
index 0000000..5468d06
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-2 differ
diff --git a/fuzz/seed/regexp/bug316338-3 b/fuzz/seed/regexp/bug316338-3
new file mode 100644 (file)
index 0000000..76e1e0b
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-3 differ
diff --git a/fuzz/seed/regexp/bug316338-4 b/fuzz/seed/regexp/bug316338-4
new file mode 100644 (file)
index 0000000..e0f65a4
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-4 differ
diff --git a/fuzz/seed/regexp/bug316338-5 b/fuzz/seed/regexp/bug316338-5
new file mode 100644 (file)
index 0000000..fcfaa97
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-5 differ
diff --git a/fuzz/seed/regexp/bug316338-6 b/fuzz/seed/regexp/bug316338-6
new file mode 100644 (file)
index 0000000..ce00a15
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-6 differ
diff --git a/fuzz/seed/regexp/bug316338-7 b/fuzz/seed/regexp/bug316338-7
new file mode 100644 (file)
index 0000000..127fe1f
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-7 differ
diff --git a/fuzz/seed/regexp/bug316338-8 b/fuzz/seed/regexp/bug316338-8
new file mode 100644 (file)
index 0000000..fe8bb8b
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-8 differ
diff --git a/fuzz/seed/regexp/bug316338-9 b/fuzz/seed/regexp/bug316338-9
new file mode 100644 (file)
index 0000000..3d56e5d
Binary files /dev/null and b/fuzz/seed/regexp/bug316338-9 differ
diff --git a/fuzz/seed/regexp/bug420596-1 b/fuzz/seed/regexp/bug420596-1
new file mode 100644 (file)
index 0000000..4426933
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-1 differ
diff --git a/fuzz/seed/regexp/bug420596-2 b/fuzz/seed/regexp/bug420596-2
new file mode 100644 (file)
index 0000000..474d2b6
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-2 differ
diff --git a/fuzz/seed/regexp/bug420596-3 b/fuzz/seed/regexp/bug420596-3
new file mode 100644 (file)
index 0000000..09c75cb
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-3 differ
diff --git a/fuzz/seed/regexp/bug420596-4 b/fuzz/seed/regexp/bug420596-4
new file mode 100644 (file)
index 0000000..65d561e
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-4 differ
diff --git a/fuzz/seed/regexp/bug420596-5 b/fuzz/seed/regexp/bug420596-5
new file mode 100644 (file)
index 0000000..b678580
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-5 differ
diff --git a/fuzz/seed/regexp/bug420596-6 b/fuzz/seed/regexp/bug420596-6
new file mode 100644 (file)
index 0000000..3a05d82
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-6 differ
diff --git a/fuzz/seed/regexp/bug420596-7 b/fuzz/seed/regexp/bug420596-7
new file mode 100644 (file)
index 0000000..88e1660
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-7 differ
diff --git a/fuzz/seed/regexp/bug420596-8 b/fuzz/seed/regexp/bug420596-8
new file mode 100644 (file)
index 0000000..4575a92
Binary files /dev/null and b/fuzz/seed/regexp/bug420596-8 differ
diff --git a/fuzz/seed/regexp/content-1 b/fuzz/seed/regexp/content-1
new file mode 100644 (file)
index 0000000..5acbf86
Binary files /dev/null and b/fuzz/seed/regexp/content-1 differ
diff --git a/fuzz/seed/regexp/content-10 b/fuzz/seed/regexp/content-10
new file mode 100644 (file)
index 0000000..f131454
Binary files /dev/null and b/fuzz/seed/regexp/content-10 differ
diff --git a/fuzz/seed/regexp/content-2 b/fuzz/seed/regexp/content-2
new file mode 100644 (file)
index 0000000..4e6b663
Binary files /dev/null and b/fuzz/seed/regexp/content-2 differ
diff --git a/fuzz/seed/regexp/content-3 b/fuzz/seed/regexp/content-3
new file mode 100644 (file)
index 0000000..b13fc8d
Binary files /dev/null and b/fuzz/seed/regexp/content-3 differ
diff --git a/fuzz/seed/regexp/content-4 b/fuzz/seed/regexp/content-4
new file mode 100644 (file)
index 0000000..47c5d6d
Binary files /dev/null and b/fuzz/seed/regexp/content-4 differ
diff --git a/fuzz/seed/regexp/content-5 b/fuzz/seed/regexp/content-5
new file mode 100644 (file)
index 0000000..f93860e
Binary files /dev/null and b/fuzz/seed/regexp/content-5 differ
diff --git a/fuzz/seed/regexp/content-6 b/fuzz/seed/regexp/content-6
new file mode 100644 (file)
index 0000000..e5c6e14
Binary files /dev/null and b/fuzz/seed/regexp/content-6 differ
diff --git a/fuzz/seed/regexp/content-7 b/fuzz/seed/regexp/content-7
new file mode 100644 (file)
index 0000000..4868dd2
Binary files /dev/null and b/fuzz/seed/regexp/content-7 differ
diff --git a/fuzz/seed/regexp/content-8 b/fuzz/seed/regexp/content-8
new file mode 100644 (file)
index 0000000..a3a87d0
Binary files /dev/null and b/fuzz/seed/regexp/content-8 differ
diff --git a/fuzz/seed/regexp/content-9 b/fuzz/seed/regexp/content-9
new file mode 100644 (file)
index 0000000..91f0d9e
Binary files /dev/null and b/fuzz/seed/regexp/content-9 differ
diff --git a/fuzz/seed/regexp/hard-1 b/fuzz/seed/regexp/hard-1
new file mode 100644 (file)
index 0000000..ba00382
Binary files /dev/null and b/fuzz/seed/regexp/hard-1 differ
diff --git a/fuzz/seed/regexp/hard-10 b/fuzz/seed/regexp/hard-10
new file mode 100644 (file)
index 0000000..7db28fa
Binary files /dev/null and b/fuzz/seed/regexp/hard-10 differ
diff --git a/fuzz/seed/regexp/hard-2 b/fuzz/seed/regexp/hard-2
new file mode 100644 (file)
index 0000000..ed38b91
Binary files /dev/null and b/fuzz/seed/regexp/hard-2 differ
diff --git a/fuzz/seed/regexp/hard-3 b/fuzz/seed/regexp/hard-3
new file mode 100644 (file)
index 0000000..7b16da0
Binary files /dev/null and b/fuzz/seed/regexp/hard-3 differ
diff --git a/fuzz/seed/regexp/hard-4 b/fuzz/seed/regexp/hard-4
new file mode 100644 (file)
index 0000000..2ece886
Binary files /dev/null and b/fuzz/seed/regexp/hard-4 differ
diff --git a/fuzz/seed/regexp/hard-5 b/fuzz/seed/regexp/hard-5
new file mode 100644 (file)
index 0000000..870a3ec
Binary files /dev/null and b/fuzz/seed/regexp/hard-5 differ
diff --git a/fuzz/seed/regexp/hard-6 b/fuzz/seed/regexp/hard-6
new file mode 100644 (file)
index 0000000..06aa7d0
Binary files /dev/null and b/fuzz/seed/regexp/hard-6 differ
diff --git a/fuzz/seed/regexp/hard-7 b/fuzz/seed/regexp/hard-7
new file mode 100644 (file)
index 0000000..50a9ec3
Binary files /dev/null and b/fuzz/seed/regexp/hard-7 differ
diff --git a/fuzz/seed/regexp/hard-8 b/fuzz/seed/regexp/hard-8
new file mode 100644 (file)
index 0000000..0991129
Binary files /dev/null and b/fuzz/seed/regexp/hard-8 differ
diff --git a/fuzz/seed/regexp/hard-9 b/fuzz/seed/regexp/hard-9
new file mode 100644 (file)
index 0000000..5bd1d89
Binary files /dev/null and b/fuzz/seed/regexp/hard-9 differ
diff --git a/fuzz/seed/regexp/ncname-1 b/fuzz/seed/regexp/ncname-1
new file mode 100644 (file)
index 0000000..608eb9a
Binary files /dev/null and b/fuzz/seed/regexp/ncname-1 differ
diff --git a/fuzz/seed/regexp/ncname-2 b/fuzz/seed/regexp/ncname-2
new file mode 100644 (file)
index 0000000..cfb9b96
Binary files /dev/null and b/fuzz/seed/regexp/ncname-2 differ
diff --git a/fuzz/seed/regexp/ncname-3 b/fuzz/seed/regexp/ncname-3
new file mode 100644 (file)
index 0000000..07a6a08
Binary files /dev/null and b/fuzz/seed/regexp/ncname-3 differ
diff --git a/fuzz/seed/regexp/ncname-4 b/fuzz/seed/regexp/ncname-4
new file mode 100644 (file)
index 0000000..87e937f
Binary files /dev/null and b/fuzz/seed/regexp/ncname-4 differ
diff --git a/fuzz/seed/regexp/ncname-5 b/fuzz/seed/regexp/ncname-5
new file mode 100644 (file)
index 0000000..ad29456
Binary files /dev/null and b/fuzz/seed/regexp/ncname-5 differ
diff --git a/fuzz/seed/regexp/ranges-1 b/fuzz/seed/regexp/ranges-1
new file mode 100644 (file)
index 0000000..71448f2
Binary files /dev/null and b/fuzz/seed/regexp/ranges-1 differ
diff --git a/fuzz/seed/regexp/ranges-10 b/fuzz/seed/regexp/ranges-10
new file mode 100644 (file)
index 0000000..91aed3c
Binary files /dev/null and b/fuzz/seed/regexp/ranges-10 differ
diff --git a/fuzz/seed/regexp/ranges-11 b/fuzz/seed/regexp/ranges-11
new file mode 100644 (file)
index 0000000..76eb5de
Binary files /dev/null and b/fuzz/seed/regexp/ranges-11 differ
diff --git a/fuzz/seed/regexp/ranges-12 b/fuzz/seed/regexp/ranges-12
new file mode 100644 (file)
index 0000000..9c3bc66
Binary files /dev/null and b/fuzz/seed/regexp/ranges-12 differ
diff --git a/fuzz/seed/regexp/ranges-2 b/fuzz/seed/regexp/ranges-2
new file mode 100644 (file)
index 0000000..9369f7a
Binary files /dev/null and b/fuzz/seed/regexp/ranges-2 differ
diff --git a/fuzz/seed/regexp/ranges-3 b/fuzz/seed/regexp/ranges-3
new file mode 100644 (file)
index 0000000..58a3a08
Binary files /dev/null and b/fuzz/seed/regexp/ranges-3 differ
diff --git a/fuzz/seed/regexp/ranges-4 b/fuzz/seed/regexp/ranges-4
new file mode 100644 (file)
index 0000000..da7e9da
Binary files /dev/null and b/fuzz/seed/regexp/ranges-4 differ
diff --git a/fuzz/seed/regexp/ranges-5 b/fuzz/seed/regexp/ranges-5
new file mode 100644 (file)
index 0000000..83ad4a8
Binary files /dev/null and b/fuzz/seed/regexp/ranges-5 differ
diff --git a/fuzz/seed/regexp/ranges-6 b/fuzz/seed/regexp/ranges-6
new file mode 100644 (file)
index 0000000..3bc9758
Binary files /dev/null and b/fuzz/seed/regexp/ranges-6 differ
diff --git a/fuzz/seed/regexp/ranges-7 b/fuzz/seed/regexp/ranges-7
new file mode 100644 (file)
index 0000000..fa89038
Binary files /dev/null and b/fuzz/seed/regexp/ranges-7 differ
diff --git a/fuzz/seed/regexp/ranges-8 b/fuzz/seed/regexp/ranges-8
new file mode 100644 (file)
index 0000000..96f0bb6
Binary files /dev/null and b/fuzz/seed/regexp/ranges-8 differ
diff --git a/fuzz/seed/regexp/ranges-9 b/fuzz/seed/regexp/ranges-9
new file mode 100644 (file)
index 0000000..8e3fc43
Binary files /dev/null and b/fuzz/seed/regexp/ranges-9 differ
diff --git a/fuzz/seed/regexp/ranges2-1 b/fuzz/seed/regexp/ranges2-1
new file mode 100644 (file)
index 0000000..044a8eb
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-1 differ
diff --git a/fuzz/seed/regexp/ranges2-10 b/fuzz/seed/regexp/ranges2-10
new file mode 100644 (file)
index 0000000..19e2aa2
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-10 differ
diff --git a/fuzz/seed/regexp/ranges2-11 b/fuzz/seed/regexp/ranges2-11
new file mode 100644 (file)
index 0000000..89be181
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-11 differ
diff --git a/fuzz/seed/regexp/ranges2-12 b/fuzz/seed/regexp/ranges2-12
new file mode 100644 (file)
index 0000000..42ebdd3
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-12 differ
diff --git a/fuzz/seed/regexp/ranges2-2 b/fuzz/seed/regexp/ranges2-2
new file mode 100644 (file)
index 0000000..026f7b8
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-2 differ
diff --git a/fuzz/seed/regexp/ranges2-3 b/fuzz/seed/regexp/ranges2-3
new file mode 100644 (file)
index 0000000..83e78a9
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-3 differ
diff --git a/fuzz/seed/regexp/ranges2-4 b/fuzz/seed/regexp/ranges2-4
new file mode 100644 (file)
index 0000000..847b4e8
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-4 differ
diff --git a/fuzz/seed/regexp/ranges2-5 b/fuzz/seed/regexp/ranges2-5
new file mode 100644 (file)
index 0000000..349168d
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-5 differ
diff --git a/fuzz/seed/regexp/ranges2-6 b/fuzz/seed/regexp/ranges2-6
new file mode 100644 (file)
index 0000000..5d2a407
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-6 differ
diff --git a/fuzz/seed/regexp/ranges2-7 b/fuzz/seed/regexp/ranges2-7
new file mode 100644 (file)
index 0000000..74fbafb
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-7 differ
diff --git a/fuzz/seed/regexp/ranges2-8 b/fuzz/seed/regexp/ranges2-8
new file mode 100644 (file)
index 0000000..125bfa9
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-8 differ
diff --git a/fuzz/seed/regexp/ranges2-9 b/fuzz/seed/regexp/ranges2-9
new file mode 100644 (file)
index 0000000..f2cf128
Binary files /dev/null and b/fuzz/seed/regexp/ranges2-9 differ
diff --git a/fuzz/seed/regexp/xpath-1 b/fuzz/seed/regexp/xpath-1
new file mode 100644 (file)
index 0000000..3bc1792
Binary files /dev/null and b/fuzz/seed/regexp/xpath-1 differ
diff --git a/fuzz/seed/regexp/xpath-10 b/fuzz/seed/regexp/xpath-10
new file mode 100644 (file)
index 0000000..e4f4b0c
Binary files /dev/null and b/fuzz/seed/regexp/xpath-10 differ
diff --git a/fuzz/seed/regexp/xpath-11 b/fuzz/seed/regexp/xpath-11
new file mode 100644 (file)
index 0000000..318e0cc
Binary files /dev/null and b/fuzz/seed/regexp/xpath-11 differ
diff --git a/fuzz/seed/regexp/xpath-12 b/fuzz/seed/regexp/xpath-12
new file mode 100644 (file)
index 0000000..f204295
Binary files /dev/null and b/fuzz/seed/regexp/xpath-12 differ
diff --git a/fuzz/seed/regexp/xpath-13 b/fuzz/seed/regexp/xpath-13
new file mode 100644 (file)
index 0000000..70fccd5
Binary files /dev/null and b/fuzz/seed/regexp/xpath-13 differ
diff --git a/fuzz/seed/regexp/xpath-14 b/fuzz/seed/regexp/xpath-14
new file mode 100644 (file)
index 0000000..357ce2b
Binary files /dev/null and b/fuzz/seed/regexp/xpath-14 differ
diff --git a/fuzz/seed/regexp/xpath-15 b/fuzz/seed/regexp/xpath-15
new file mode 100644 (file)
index 0000000..2a10a83
Binary files /dev/null and b/fuzz/seed/regexp/xpath-15 differ
diff --git a/fuzz/seed/regexp/xpath-16 b/fuzz/seed/regexp/xpath-16
new file mode 100644 (file)
index 0000000..1f3089f
Binary files /dev/null and b/fuzz/seed/regexp/xpath-16 differ
diff --git a/fuzz/seed/regexp/xpath-17 b/fuzz/seed/regexp/xpath-17
new file mode 100644 (file)
index 0000000..a9d542f
Binary files /dev/null and b/fuzz/seed/regexp/xpath-17 differ
diff --git a/fuzz/seed/regexp/xpath-18 b/fuzz/seed/regexp/xpath-18
new file mode 100644 (file)
index 0000000..651eb9d
Binary files /dev/null and b/fuzz/seed/regexp/xpath-18 differ
diff --git a/fuzz/seed/regexp/xpath-19 b/fuzz/seed/regexp/xpath-19
new file mode 100644 (file)
index 0000000..fefea8f
Binary files /dev/null and b/fuzz/seed/regexp/xpath-19 differ
diff --git a/fuzz/seed/regexp/xpath-2 b/fuzz/seed/regexp/xpath-2
new file mode 100644 (file)
index 0000000..81e5fba
Binary files /dev/null and b/fuzz/seed/regexp/xpath-2 differ
diff --git a/fuzz/seed/regexp/xpath-20 b/fuzz/seed/regexp/xpath-20
new file mode 100644 (file)
index 0000000..1f3089f
Binary files /dev/null and b/fuzz/seed/regexp/xpath-20 differ
diff --git a/fuzz/seed/regexp/xpath-21 b/fuzz/seed/regexp/xpath-21
new file mode 100644 (file)
index 0000000..706a702
Binary files /dev/null and b/fuzz/seed/regexp/xpath-21 differ
diff --git a/fuzz/seed/regexp/xpath-22 b/fuzz/seed/regexp/xpath-22
new file mode 100644 (file)
index 0000000..a246f84
Binary files /dev/null and b/fuzz/seed/regexp/xpath-22 differ
diff --git a/fuzz/seed/regexp/xpath-23 b/fuzz/seed/regexp/xpath-23
new file mode 100644 (file)
index 0000000..02753be
Binary files /dev/null and b/fuzz/seed/regexp/xpath-23 differ
diff --git a/fuzz/seed/regexp/xpath-24 b/fuzz/seed/regexp/xpath-24
new file mode 100644 (file)
index 0000000..331105c
Binary files /dev/null and b/fuzz/seed/regexp/xpath-24 differ
diff --git a/fuzz/seed/regexp/xpath-25 b/fuzz/seed/regexp/xpath-25
new file mode 100644 (file)
index 0000000..ce3da44
Binary files /dev/null and b/fuzz/seed/regexp/xpath-25 differ
diff --git a/fuzz/seed/regexp/xpath-26 b/fuzz/seed/regexp/xpath-26
new file mode 100644 (file)
index 0000000..b3bf8c2
Binary files /dev/null and b/fuzz/seed/regexp/xpath-26 differ
diff --git a/fuzz/seed/regexp/xpath-27 b/fuzz/seed/regexp/xpath-27
new file mode 100644 (file)
index 0000000..74bbe46
Binary files /dev/null and b/fuzz/seed/regexp/xpath-27 differ
diff --git a/fuzz/seed/regexp/xpath-28 b/fuzz/seed/regexp/xpath-28
new file mode 100644 (file)
index 0000000..b38a709
Binary files /dev/null and b/fuzz/seed/regexp/xpath-28 differ
diff --git a/fuzz/seed/regexp/xpath-29 b/fuzz/seed/regexp/xpath-29
new file mode 100644 (file)
index 0000000..104d4e5
Binary files /dev/null and b/fuzz/seed/regexp/xpath-29 differ
diff --git a/fuzz/seed/regexp/xpath-3 b/fuzz/seed/regexp/xpath-3
new file mode 100644 (file)
index 0000000..6d7be85
Binary files /dev/null and b/fuzz/seed/regexp/xpath-3 differ
diff --git a/fuzz/seed/regexp/xpath-30 b/fuzz/seed/regexp/xpath-30
new file mode 100644 (file)
index 0000000..b681ff1
Binary files /dev/null and b/fuzz/seed/regexp/xpath-30 differ
diff --git a/fuzz/seed/regexp/xpath-31 b/fuzz/seed/regexp/xpath-31
new file mode 100644 (file)
index 0000000..cd87b0e
Binary files /dev/null and b/fuzz/seed/regexp/xpath-31 differ
diff --git a/fuzz/seed/regexp/xpath-32 b/fuzz/seed/regexp/xpath-32
new file mode 100644 (file)
index 0000000..c5cac32
Binary files /dev/null and b/fuzz/seed/regexp/xpath-32 differ
diff --git a/fuzz/seed/regexp/xpath-33 b/fuzz/seed/regexp/xpath-33
new file mode 100644 (file)
index 0000000..89e3fcd
Binary files /dev/null and b/fuzz/seed/regexp/xpath-33 differ
diff --git a/fuzz/seed/regexp/xpath-34 b/fuzz/seed/regexp/xpath-34
new file mode 100644 (file)
index 0000000..b65a3d6
Binary files /dev/null and b/fuzz/seed/regexp/xpath-34 differ
diff --git a/fuzz/seed/regexp/xpath-35 b/fuzz/seed/regexp/xpath-35
new file mode 100644 (file)
index 0000000..252a70c
Binary files /dev/null and b/fuzz/seed/regexp/xpath-35 differ
diff --git a/fuzz/seed/regexp/xpath-4 b/fuzz/seed/regexp/xpath-4
new file mode 100644 (file)
index 0000000..30718c5
Binary files /dev/null and b/fuzz/seed/regexp/xpath-4 differ
diff --git a/fuzz/seed/regexp/xpath-5 b/fuzz/seed/regexp/xpath-5
new file mode 100644 (file)
index 0000000..06ad88e
Binary files /dev/null and b/fuzz/seed/regexp/xpath-5 differ
diff --git a/fuzz/seed/regexp/xpath-6 b/fuzz/seed/regexp/xpath-6
new file mode 100644 (file)
index 0000000..6678772
Binary files /dev/null and b/fuzz/seed/regexp/xpath-6 differ
diff --git a/fuzz/seed/regexp/xpath-7 b/fuzz/seed/regexp/xpath-7
new file mode 100644 (file)
index 0000000..e69ad85
Binary files /dev/null and b/fuzz/seed/regexp/xpath-7 differ
diff --git a/fuzz/seed/regexp/xpath-8 b/fuzz/seed/regexp/xpath-8
new file mode 100644 (file)
index 0000000..a8120cc
Binary files /dev/null and b/fuzz/seed/regexp/xpath-8 differ
diff --git a/fuzz/seed/regexp/xpath-9 b/fuzz/seed/regexp/xpath-9
new file mode 100644 (file)
index 0000000..c037ce7
Binary files /dev/null and b/fuzz/seed/regexp/xpath-9 differ
diff --git a/fuzz/seed/uri/dot b/fuzz/seed/uri/dot
new file mode 100644 (file)
index 0000000..945c9b4
--- /dev/null
@@ -0,0 +1 @@
+.
\ No newline at end of file
diff --git a/fuzz/seed/uri/full b/fuzz/seed/uri/full
new file mode 100644 (file)
index 0000000..808e58a
Binary files /dev/null and b/fuzz/seed/uri/full differ
diff --git a/fuzz/testFuzzer.c b/fuzz/testFuzzer.c
new file mode 100644 (file)
index 0000000..b0c7ffb
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * testFuzzer.c: Test program for the custom entity loader used to fuzz
+ * with multiple inputs.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <string.h>
+#include <glob.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlstring.h>
+#include "fuzz.h"
+
+#ifdef HAVE_HTML_FUZZER
+  #define LLVMFuzzerInitialize fuzzHtmlInit
+  #define LLVMFuzzerTestOneInput fuzzHtml
+  #include "html.c"
+  #undef LLVMFuzzerInitialize
+  #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_REGEXP_FUZZER
+  #define LLVMFuzzerInitialize fuzzRegexpInit
+  #define LLVMFuzzerTestOneInput fuzzRegexp
+  #include "regexp.c"
+  #undef LLVMFuzzerInitialize
+  #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_SCHEMA_FUZZER
+  #define LLVMFuzzerInitialize fuzzSchemaInit
+  #define LLVMFuzzerTestOneInput fuzzSchema
+  #include "schema.c"
+  #undef LLVMFuzzerInitialize
+  #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_URI_FUZZER
+  #define LLVMFuzzerInitialize fuzzUriInit
+  #define LLVMFuzzerTestOneInput fuzzUri
+  #include "uri.c"
+  #undef LLVMFuzzerInitialize
+  #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_XML_FUZZER
+  #define LLVMFuzzerInitialize fuzzXmlInit
+  #define LLVMFuzzerTestOneInput fuzzXml
+  #include "xml.c"
+  #undef LLVMFuzzerInitialize
+  #undef LLVMFuzzerTestOneInput
+#endif
+
+#ifdef HAVE_XPATH_FUZZER
+  #define LLVMFuzzerInitialize fuzzXPathInit
+  #define LLVMFuzzerTestOneInput fuzzXPath
+  #include "xpath.c"
+  #undef LLVMFuzzerInitialize
+  #undef LLVMFuzzerTestOneInput
+#endif
+
+typedef int
+(*initFunc)(int *argc, char ***argv);
+typedef int
+(*fuzzFunc)(const char *data, size_t size);
+
+int numInputs;
+
+static int
+testFuzzer(initFunc init, fuzzFunc fuzz, const char *pattern) {
+    glob_t globbuf;
+    int ret = -1;
+    int i;
+
+    if (glob(pattern, 0, NULL, &globbuf) != 0) {
+        fprintf(stderr, "pattern %s matches no files\n", pattern);
+        return(-1);
+    }
+
+    if (init != NULL)
+        init(NULL, NULL);
+
+    for (i = 0; i < globbuf.gl_pathc; i++) {
+        const char *path = globbuf.gl_pathv[i];
+        char *data;
+        size_t size;
+
+        data = xmlSlurpFile(path, &size);
+        if (data == NULL) {
+            fprintf(stderr, "couldn't read %s\n", path);
+            goto error;
+        }
+        fuzz(data, size);
+        xmlFree(data);
+
+        numInputs++;
+    }
+
+    ret = 0;
+error:
+    globfree(&globbuf);
+    return(ret);
+}
+
+#ifdef HAVE_XML_FUZZER
+static int
+testEntityLoader() {
+    static const char data[] =
+        "doc.xml\\\n"
+        "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
+        "<doc>&ent;</doc>\\\n"
+        "doc.dtd\\\n"
+        "<!ELEMENT doc (#PCDATA)>\n"
+        "<!ENTITY ent SYSTEM \"ent.txt\">\\\n"
+        "ent.txt\\\n"
+        "Hello, world!\\\n";
+    static xmlChar expected[] =
+        "<?xml version=\"1.0\"?>\n"
+        "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
+        "<doc>Hello, world!</doc>\n";
+    const char *docBuffer;
+    size_t docSize;
+    xmlDocPtr doc;
+    xmlChar *out;
+    int ret = 0;
+
+    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
+
+    xmlFuzzDataInit(data, sizeof(data) - 1);
+    xmlFuzzReadEntities();
+    docBuffer = xmlFuzzMainEntity(&docSize);
+    doc = xmlReadMemory(docBuffer, docSize, NULL, NULL,
+                        XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+
+    xmlDocDumpMemory(doc, &out, NULL);
+    if (xmlStrcmp(out, expected) != 0) {
+        fprintf(stderr, "Expected:\n%sGot:\n%s", expected, out);
+        ret = 1;
+    }
+
+    xmlFree(out);
+    xmlFreeDoc(doc);
+    xmlFuzzDataCleanup();
+
+    return(ret);
+}
+#endif
+
+int
+main() {
+    int ret = 0;
+
+#ifdef HAVE_XML_FUZZER
+    if (testEntityLoader() != 0)
+        ret = 1;
+#endif
+#ifdef HAVE_HTML_FUZZER
+    if (testFuzzer(fuzzHtmlInit, fuzzHtml, "seed/html/*") != 0)
+        ret = 1;
+#endif
+#ifdef HAVE_REGEXP_FUZZER
+    if (testFuzzer(fuzzRegexpInit, fuzzRegexp, "seed/regexp/*") != 0)
+        ret = 1;
+#endif
+#ifdef HAVE_SCHEMA_FUZZER
+    if (testFuzzer(fuzzSchemaInit, fuzzSchema, "seed/schema/*") != 0)
+        ret = 1;
+#endif
+#ifdef HAVE_URI_FUZZER
+    if (testFuzzer(NULL, fuzzUri, "seed/uri/*") != 0)
+        ret = 1;
+#endif
+#ifdef HAVE_XML_FUZZER
+    if (testFuzzer(fuzzXmlInit, fuzzXml, "seed/xml/*") != 0)
+        ret = 1;
+#endif
+#ifdef HAVE_XPATH_FUZZER
+    if (testFuzzer(fuzzXPathInit, fuzzXPath, "seed/xpath/*") != 0)
+        ret = 1;
+#endif
+
+    if (ret == 0)
+        printf("Successfully tested %d inputs\n", numInputs);
+
+    return(ret);
+}
+
diff --git a/fuzz/uri.c b/fuzz/uri.c
new file mode 100644 (file)
index 0000000..5e4c099
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * uri.c: a libFuzzer target to test the URI module.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/uri.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+    xmlURIPtr uri;
+    char *str[2] = { NULL, NULL };
+    size_t numStrings;
+
+    if (size > 10000)
+        return(0);
+
+    numStrings = xmlFuzzExtractStrings(data, size, str, 2);
+
+    uri = xmlParseURI(str[0]);
+    xmlFree(xmlSaveUri(uri));
+    xmlFreeURI(uri);
+
+    uri = xmlParseURIRaw(str[0], 1);
+    xmlFree(xmlSaveUri(uri));
+    xmlFreeURI(uri);
+
+    xmlFree(xmlURIUnescapeString(str[0], -1, NULL));
+    xmlFree(xmlURIEscape(BAD_CAST str[0]));
+    xmlFree(xmlCanonicPath(BAD_CAST str[0]));
+    xmlFree(xmlPathToURI(BAD_CAST str[0]));
+
+    if (numStrings >= 2) {
+        xmlFree(xmlBuildURI(BAD_CAST str[1], BAD_CAST str[0]));
+        xmlFree(xmlBuildRelativeURI(BAD_CAST str[1], BAD_CAST str[0]));
+        xmlFree(xmlURIEscapeStr(BAD_CAST str[0], BAD_CAST str[1]));
+    }
+
+    /* Modifies string, so must come last. */
+    xmlNormalizeURIPath(str[0]);
+
+    xmlFree(str[0]);
+    xmlFree(str[1]);
+
+    return 0;
+}
+
diff --git a/fuzz/uri.options b/fuzz/uri.options
new file mode 100644 (file)
index 0000000..0676c65
--- /dev/null
@@ -0,0 +1,2 @@
+[libfuzzer]
+timeout = 2
diff --git a/fuzz/xml.c b/fuzz/xml.c
new file mode 100644 (file)
index 0000000..8b4c4ef
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+ * xml.c: a libFuzzer target to test several XML parser interfaces.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/catalog.h>
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/xmlerror.h>
+#include <libxml/xinclude.h>
+#include <libxml/xmlreader.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+                     char ***argv ATTRIBUTE_UNUSED) {
+    xmlInitParser();
+#ifdef LIBXML_CATALOG_ENABLED
+    xmlInitializeCatalog();
+#endif
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
+
+    return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+    static const size_t maxChunkSize = 128;
+    xmlDocPtr doc;
+    xmlParserCtxtPtr ctxt;
+    xmlTextReaderPtr reader;
+    xmlChar *out;
+    const char *docBuffer, *docUrl;
+    size_t maxSize, docSize, consumed, chunkSize;
+    int opts, outSize;
+
+    xmlFuzzDataInit(data, size);
+    opts = xmlFuzzReadInt();
+
+    /* Lower maximum size when processing entities for now. */
+    maxSize = opts & XML_PARSE_NOENT ? 50000 : 500000;
+    if (size > maxSize)
+        goto exit;
+
+    xmlFuzzReadEntities();
+    docBuffer = xmlFuzzMainEntity(&docSize);
+    docUrl = xmlFuzzMainUrl();
+    if (docBuffer == NULL)
+        goto exit;
+
+    /* Pull parser */
+
+    doc = xmlReadMemory(docBuffer, docSize, docUrl, NULL, opts);
+    if (opts & XML_PARSE_XINCLUDE)
+        xmlXIncludeProcessFlags(doc, opts);
+    /* Also test the serializer. */
+    xmlDocDumpMemory(doc, &out, &outSize);
+    xmlFree(out);
+    xmlFreeDoc(doc);
+
+    /* Push parser */
+
+    ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
+    if (ctxt == NULL)
+        goto exit;
+    xmlCtxtUseOptions(ctxt, opts);
+
+    for (consumed = 0; consumed < docSize; consumed += chunkSize) {
+        chunkSize = docSize - consumed;
+        if (chunkSize > maxChunkSize)
+            chunkSize = maxChunkSize;
+        xmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
+    }
+
+    xmlParseChunk(ctxt, NULL, 0, 1);
+    if (opts & XML_PARSE_XINCLUDE)
+        xmlXIncludeProcessFlags(ctxt->myDoc, opts);
+    xmlFreeDoc(ctxt->myDoc);
+    xmlFreeParserCtxt(ctxt);
+
+    /* Reader */
+
+    reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
+    if (reader == NULL)
+        goto exit;
+    while (xmlTextReaderRead(reader) == 1) {
+        if (xmlTextReaderNodeType(reader) == XML_ELEMENT_NODE) {
+            int i, n = xmlTextReaderAttributeCount(reader);
+            for (i=0; i<n; i++) {
+                xmlTextReaderMoveToAttributeNo(reader, i);
+                while (xmlTextReaderReadAttributeValue(reader) == 1);
+            }
+        }
+    }
+    xmlFreeTextReader(reader);
+
+exit:
+    xmlFuzzDataCleanup();
+    xmlResetLastError();
+    return(0);
+}
+
diff --git a/fuzz/xml.dict b/fuzz/xml.dict
new file mode 100644 (file)
index 0000000..a539e6a
--- /dev/null
@@ -0,0 +1,89 @@
+xml_decl="<?xml version='1.0'?>"
+xml_decl_latin1="<?xml version='1.0' encoding='ISO-8859-1'?>"
+
+elem_start_end="<a></a>"
+elem_empty="<a/>"
+elem_ns_start_end="<a:a xmlns:a='a'></a:a>"
+elem_ns_empty="<a:a xmlns:a='a'/>"
+
+attr=" a='a'"
+
+ns_decl=" xmlns:a='a'"
+ns_default=" xmlns='a'"
+ns_prefix="a:"
+
+cdata_section="<![CDATA[ ]]>"
+
+comment="<!-- -->"
+
+pi="<?a?>"
+
+elem_decl_any="<!ELEMENT a ANY>"
+elem_decl_empty="<!ELEMENT a EMPTY>"
+elem_decl_children="<!ELEMENT a (a)>"
+elem_decl_mixed="<!ELEMENT a (#PCDATA|a)>"
+elem_children_choice="|a"
+elem_children_seq=",a"
+elem_children_sub_choice="|(a)"
+elem_children_sub_seq=",(a)"
+elem_quant_any="*"
+elem_quant_opt="?"
+elem_quant_some="+"
+
+attlist_decl_cdata_req="<!ATTLIST a a CDATA #REQUIRED>"
+attlist_decl_cdata_imp="<!ATTLIST a a CDATA #IMPLIED>"
+attlist_decl_cdata_def="<!ATTLIST a a CDATA 'a'>"
+attlist_decl_cdata_fix="<!ATTLIST a a CDATA #FIXED 'a'>"
+attlist_decl_id="<!ATTLIST a a ID #IMPLIED>"
+attlist_decl_idref="<!ATTLIST a a IDREF #IMPLIED>"
+attlist_decl_idrefs="<!ATTLIST a a IDREFS #IMPLIED>"
+attlist_decl_entity="<!ATTLIST a a ENTITY #IMPLIED>"
+attlist_decl_entities="<!ATTLIST a a ENTITIES #IMPLIED>"
+attlist_decl_nmtoken="<!ATTLIST a a NMTOKEN #IMPLIED>"
+attlist_decl_nmtokens="<!ATTLIST a a NMTOKENS #IMPLIED>"
+attlist_decl_enum="<!ATTLIST a a (a) #IMPLIED>"
+attlist_decl_notation="<!ATTLIST a a NOTATION (a) #IMPLIED>"
+
+include_sect="<![INCLUDE[ ]]>"
+ignore_sect="<![IGNORE[ ]]>"
+
+ge_decl="<!ENTITY a 'a'>"
+ge_decl_system="<!ENTITY a SYSTEM 'a'>"
+ge_decl_system_ndata="<!ENTITY a SYSTEM 'a' NDATA a>"
+ge_decl_public="<!ENTITY a PUBLIC 'a' 'a'>"
+ge_decl_public_ndata="<!ENTITY a PUBLIC 'a' 'a' NDATA a>"
+
+pe_decl="<!ENTITY % a 'a'>"
+pe_decl_system="<!ENTITY % a SYSTEM 'a'>"
+pe_decl_public="<!ENTITY % a PUBLIC 'a' 'a'>"
+
+char_ref_dec="&#60;"
+char_ref_hex="&#x3c;"
+char_ref_quoted="&#38;#60;"
+
+ge_ref_lt="&lt;"
+ge_ref_gt="&gt;"
+ge_ref_amp="&amp;"
+ge_ref_apos="&apos;"
+ge_ref_quot="&quot;"
+ge_ref="&a;"
+ge_ref_quoted="&#38;a;"
+
+pe_ref="%a;"
+pe_ref_quoted="&#37;a;"
+
+notation_decl_public="<!NOTATION a PUBLIC 'a'>"
+notation_decl_system="<!NOTATION a SYSTEM 'a'>"
+
+cs_utf8="UTF-8"
+cs_utf16="UTF-16"
+cs_utf16le="UTF-16LE"
+cs_utf16be="UTF-16BE"
+cs_ucs2="UCS-2"
+cs_ucs4="UCS-4"
+cs_latin1="ISO-8859-1"
+cs_ascii="ASCII"
+cs_ebcdic="EBCDIC"
+cs_iso2022jp="ISO-2022-JP"
+cs_shift_jis="SHIFT_JIS"
+cs_euc_jp="EUC-JP"
diff --git a/fuzz/xml.options b/fuzz/xml.options
new file mode 100644 (file)
index 0000000..e5d3bbe
--- /dev/null
@@ -0,0 +1,2 @@
+[libfuzzer]
+timeout = 20
diff --git a/fuzz/xpath.c b/fuzz/xpath.c
new file mode 100644 (file)
index 0000000..47652bd
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * xpath.c: a libFuzzer target to test XPath and XPointer expressions.
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <libxml/parser.h>
+#include <libxml/xpointer.h>
+#include "fuzz.h"
+
+int
+LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
+                     char ***argv ATTRIBUTE_UNUSED) {
+    xmlInitParser();
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+
+    return 0;
+}
+
+int
+LLVMFuzzerTestOneInput(const char *data, size_t size) {
+    xmlDocPtr doc;
+    const char *expr, *xml;
+    size_t exprSize, xmlSize;
+
+    if (size > 10000)
+        return(0);
+
+    xmlFuzzDataInit(data, size);
+
+    expr = xmlFuzzReadString(&exprSize);
+    xml = xmlFuzzReadString(&xmlSize);
+
+    /* Recovery mode allows more input to be fuzzed. */
+    doc = xmlReadMemory(xml, xmlSize, NULL, NULL, XML_PARSE_RECOVER);
+    if (doc != NULL) {
+        xmlXPathContextPtr xpctxt = xmlXPathNewContext(doc);
+
+        /* Operation limit to avoid timeout */
+        xpctxt->opLimit = 500000;
+
+        xmlXPathFreeObject(xmlXPtrEval(BAD_CAST expr, xpctxt));
+        xmlXPathFreeContext(xpctxt);
+    }
+    xmlFreeDoc(doc);
+
+    xmlFuzzDataCleanup();
+    xmlResetLastError();
+
+    return(0);
+}
+
diff --git a/fuzz/xpath.dict b/fuzz/xpath.dict
new file mode 100644 (file)
index 0000000..4fe375f
--- /dev/null
@@ -0,0 +1,94 @@
+# XML
+
+elem_a="<a></a>"
+elem_b="<b></b>"
+elem_c="<c></c>"
+elem_d="<d></d>"
+elem_empty="<a/>"
+elem_ns_a="<a:a xmlns:a='a'></a:a>"
+elem_ns_b="<b:b xmlns:b='b'></b:b>"
+
+attr_a=" a='a'"
+attr_b=" b='b'"
+
+ns_decl=" xmlns:a='a'"
+ns_default=" xmlns='a'"
+ns_prefix_a="a:"
+ns_prefix_b="b:"
+
+cdata_section="<![CDATA[ ]]>"
+
+comment="<!-- -->"
+
+pi="<?a?>"
+
+# XPath
+
+axis_ancestor="ancestor::"
+axis_ancestor_or_self="ancestor-or-self::"
+axis_attribute="attribute::"
+axis_attribute_abbrev="@"
+axis_child="child::"
+axis_descendant="descendant::"
+axis_descendant_or_self="descendant-or-self::"
+axis_following="following::"
+axis_following_sibling="following-sibling::"
+axis_namespace="namespace::"
+axis_parent="parent::"
+axis_preceding="preceding::"
+axis_preceding_siblings="preceding-sibling::"
+axis_self="self::"
+
+node_test_ns="a:"
+
+val_num="=(1.0)"
+val_str_sq="=('a')"
+val_str_dq="=(\"a\")"
+val_node_set="=(*)"
+val_elem="=(b)"
+
+step_root="/"
+step_descendant="//"
+step_any="//*"
+step_any_l="*//"
+step_elem="//b"
+step_ns_elem="//a:a"
+step_comment="//comment()"
+step_node="//node()"
+step_node_l="node()//"
+step_pi="//processing-instruction()"
+step_text="//text()"
+step_parent="../"
+
+op_plus="+1"
+op_minus=" - 1"
+op_neg="-"
+op_mul="*1"
+op_div=" div 1"
+op_mod=" mod 1"
+op_and=" and 1"
+op_or=" or 1"
+op_ne="!=1"
+op_lt="<1"
+op_gt=">1"
+op_le="<=1"
+op_ge=">=1"
+op_predicate_num="[1]"
+op_predicate_last="[last()]"
+op_predicate_str="['a']"
+op_predicate="[1=1]"
+op_arg_num=",1"
+op_arg_str=",'a'"
+op_arg_node=",*"
+op_union="|//b"
+
+var_num="=$f"
+var_bool="=$b"
+var_str="=$s"
+var_node_set="=$n"
+
+# Unicode
+
+utf8_2="\xC3\x84"
+utf8_3="\xE2\x80\x9C"
+utf8_4="\xF0\x9F\x98\x80"
diff --git a/fuzz/xpath.options b/fuzz/xpath.options
new file mode 100644 (file)
index 0000000..e5d3bbe
--- /dev/null
@@ -0,0 +1,2 @@
+[libfuzzer]
+timeout = 20
index b763300..b6cd866 100755 (executable)
@@ -120,7 +120,7 @@ skipped_functions = [
 "xmlRegisterInputCallbacks", "xmlReaderForIO",
 "xmlOutputBufferCreateIO", "xmlRegisterOutputCallbacks",
 "xmlSaveToIO", "xmlIOHTTPOpenW",
-# library state cleanup, generate false leak informations and other
+# library state cleanup, generate false leak information and other
 # troubles, heavillyb tested otherwise.
 "xmlCleanupParser", "xmlRelaxNGCleanupTypes", "xmlSetListDoc",
 "xmlSetTreeDoc", "xmlUnlinkNode",
@@ -676,7 +676,7 @@ def generate_test(module, node):
 
     #
     # check we know how to handle the args and return values
-    # and store the informations for the generation
+    # and store the information for the generation
     #
     try:
        args = node.xpathEval("arg")
index 7bf985f..0c0bdb4 100644 (file)
--- a/globals.c
+++ b/globals.c
@@ -215,7 +215,7 @@ int oldXMLWDcompatibility = 0; /* DEPRECATED */
 /**
  * xmlParserDebugEntities:
  *
- * Global setting, asking the parser to print out debugging informations.
+ * Global setting, asking the parser to print out debugging information.
  * while handling entities.
  * Disabled by default
  */
diff --git a/hash.c b/hash.c
index a83d979..afa094e 100644 (file)
--- a/hash.c
+++ b/hash.c
@@ -11,7 +11,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  * Author: breese@users.sourceforge.net
index d74847d..af93de6 100644 (file)
  */
 #ifndef __XML_C14N_H__
 #define __XML_C14N_H__
+
+#include <libxml/xmlversion.h>
+
 #ifdef LIBXML_C14N_ENABLED
 #ifdef LIBXML_OUTPUT_ENABLED
 
+#include <libxml/tree.h>
+#include <libxml/xpath.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
-#include <libxml/xmlversion.h>
-#include <libxml/tree.h>
-#include <libxml/xpath.h>
-
 /*
  * XML Canonicalization
  * http://www.w3.org/TR/xml-c14n
index c295554..0ba1c38 100644 (file)
@@ -79,7 +79,7 @@ struct _xmlParserInput {
 /**
  * xmlParserNodeInfo:
  *
- * The parser can be asked to collect Node informations, i.e. at what
+ * The parser can be asked to collect Node information, i.e. at what
  * place in the file they were detected.
  * NOTE: This is off by default and not very well tested.
  */
@@ -169,6 +169,8 @@ typedef enum {
     XML_PARSE_READER = 5
 } xmlParserMode;
 
+typedef struct _xmlStartTag xmlStartTag;
+
 /**
  * xmlParserCtxt:
  *
@@ -231,7 +233,7 @@ struct _xmlParserCtxt {
     int                nameMax;       /* Max depth of the parsing stack */
     const xmlChar *   *nameTab;       /* array of nodes */
 
-    long               nbChars;       /* number of xmlChar processed */
+    long               nbChars;       /* unused */
     long            checkIndex;       /* used by progressive parsing lookup */
     int             keepBlanks;       /* ugly but ... */
     int             disableSAX;       /* SAX callbacks are disabled */
@@ -280,7 +282,7 @@ struct _xmlParserCtxt {
     int                nsMax;         /* the size of the arrays */
     const xmlChar *   *nsTab;         /* the array of prefix/namespace name */
     int               *attallocs;     /* which attribute were allocated */
-    void *            *pushTab;       /* array of data for push */
+    xmlStartTag       *pushTab;       /* array of data for push */
     xmlHashTablePtr    attsDefault;   /* defaulted attributes if any */
     xmlHashTablePtr    attsSpecial;   /* non-CDATA attributes if any */
     int                nsWellFormed;  /* is the document XML Namespace okay */
@@ -296,7 +298,7 @@ struct _xmlParserCtxt {
     xmlAttrPtr        freeAttrs;    /* List of freed attributes nodes */
 
     /*
-     * the complete error informations for the last error.
+     * the complete error information for the last error.
      */
     xmlError          lastError;
     xmlParserMode     parseMode;    /* the parser mode */
@@ -329,7 +331,7 @@ struct _xmlSAXLocator {
  * xmlSAXHandler:
  *
  * A SAX handler is bunch of callbacks called by the parser when processing
- * of the input generate data or structure informations.
+ * of the input generate data or structure information.
  */
 
 /**
@@ -685,7 +687,7 @@ typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
  *               attribute values.
  *
  * SAX2 callback when an element start has been detected by the parser.
- * It provides the namespace informations for the element, as well as
+ * It provides the namespace information for the element, as well as
  * the new namespace declarations on the element.
  */
 
@@ -707,7 +709,7 @@ typedef void (*startElementNsSAX2Func) (void *ctx,
  * @URI:  the element namespace name if available
  *
  * SAX2 callback when an element end has been detected by the parser.
- * It provides the namespace informations for the element.
+ * It provides the namespace information for the element.
  */
 
 typedef void (*endElementNsSAX2Func)   (void *ctx,
index 6cfd731..1e79be9 100644 (file)
@@ -443,7 +443,7 @@ struct _xmlAttr {
     struct _xmlDoc  *doc;      /* the containing document */
     xmlNs           *ns;        /* pointer to the associated namespace */
     xmlAttributeType atype;     /* the attribute type if validating */
-    void            *psvi;     /* for type/PSVI informations */
+    void            *psvi;     /* for type/PSVI information */
 };
 
 /**
@@ -502,7 +502,7 @@ struct _xmlNode {
     xmlChar         *content;   /* the content */
     struct _xmlAttr *properties;/* properties list */
     xmlNs           *nsDef;     /* namespace definitions on this node */
-    void            *psvi;     /* for type/PSVI informations */
+    void            *psvi;     /* for type/PSVI information */
     unsigned short   line;     /* line number */
     unsigned short   extra;    /* extra data for XPath/XSLT */
 };
@@ -578,7 +578,7 @@ struct _xmlDoc {
     int             charset;    /* Internal flag for charset handling,
                                   actually an xmlCharEncoding */
     struct _xmlDict *dict;      /* dict used to allocate names or NULL */
-    void           *psvi;      /* for type/PSVI informations */
+    void           *psvi;      /* for type/PSVI information */
     int             parseFlags;        /* set of xmlParserOption used to parse the
                                   document */
     int             properties;        /* set of xmlDocProperties for this document
index 8690d66..095b2f5 100644 (file)
@@ -217,6 +217,8 @@ xmlParserInputBufferPtr
  */
 XMLPUBFUN void XMLCALL
        xmlCleanupOutputCallbacks               (void);
+XMLPUBFUN int XMLCALL
+       xmlPopOutputCallbacks                   (void);
 XMLPUBFUN void XMLCALL
        xmlRegisterDefaultOutputCallbacks(void);
 XMLPUBFUN xmlOutputBufferPtr XMLCALL
index f03af0d..aceede5 100644 (file)
@@ -3,43 +3,46 @@
  * Description: macros for marking symbols as exportable/importable.
  *
  * Copy: See Copyright for the status of this software.
- *
- * Author: Igor Zlatovic <igor@zlatkovic.com>
  */
 
 #ifndef __XML_EXPORTS_H__
 #define __XML_EXPORTS_H__
 
-/**
- * XMLPUBFUN, XMLPUBVAR, XMLCALL
- *
- * Macros which declare an exportable function, an exportable variable and
- * the calling convention used for functions.
- *
- * Please use an extra block for every platform/compiler combination when
- * modifying this, rather than overlong #ifdef lines. This helps
- * readability as well as the fact that different compilers on the same
- * platform might need different definitions.
- */
+#if defined(_WIN32) || defined(__CYGWIN__)
+/** DOC_DISABLE */
+
+#ifdef LIBXML_STATIC
+  #define XMLPUBLIC
+#elif defined(IN_LIBXML)
+  #define XMLPUBLIC __declspec(dllexport)
+#else
+  #define XMLPUBLIC __declspec(dllimport)
+#endif
+
+#if defined(LIBXML_FASTCALL)
+  #define XMLCALL __fastcall
+#else
+  #define XMLCALL __cdecl
+#endif
+#define XMLCDECL __cdecl
+
+/** DOC_ENABLE */
+#else /* not Windows */
 
 /**
- * XMLPUBFUN:
- *
- * Macros which declare an exportable function
- */
-#define XMLPUBFUN
-/**
- * XMLPUBVAR:
+ * XMLPUBLIC:
  *
- * Macros which declare an exportable variable
+ * Macro which declares a public symbol
  */
-#define XMLPUBVAR extern
+#define XMLPUBLIC
+
 /**
  * XMLCALL:
  *
- * Macros which declare the called convention for exported functions
+ * Macro which declares the calling convention for exported functions
  */
 #define XMLCALL
+
 /**
  * XMLCDECL:
  *
  */
 #define XMLCDECL
 
-/** DOC_DISABLE */
-
-/* Windows platform with MS compiler */
-#if defined(_WIN32) && defined(_MSC_VER)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport)
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #if defined(LIBXML_FASTCALL)
-    #define XMLCALL __fastcall
-  #else
-    #define XMLCALL __cdecl
-  #endif
-  #define XMLCDECL __cdecl
-#endif
+#endif /* platform switch */
 
-/* Windows platform with Borland compiler */
-#if defined(_WIN32) && defined(__BORLANDC__)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport) extern
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #define XMLCALL __cdecl
-  #define XMLCDECL __cdecl
-#endif
-
-/* Windows platform with GNU compiler (Mingw) */
-#if defined(_WIN32) && defined(__MINGW32__)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  /*
-   * if defined(IN_LIBXML) this raises problems on mingw with msys
-   * _imp__xmlFree listed as missing. Try to workaround the problem
-   * by also making that declaration when compiling client code.
-   */
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport) extern
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #define XMLCALL __cdecl
-  #define XMLCDECL __cdecl
-#endif
+/*
+ * XMLPUBFUN:
+ *
+ * Macro which declares an exportable function
+ */
+#define XMLPUBFUN XMLPUBLIC
 
-/* Cygwin platform (does not define _WIN32), GNU compiler */
-#if defined(__CYGWIN__)
-  #undef XMLPUBFUN
-  #undef XMLPUBVAR
-  #undef XMLCALL
-  #undef XMLCDECL
-  #if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
-    #define XMLPUBFUN __declspec(dllexport)
-    #define XMLPUBVAR __declspec(dllexport)
-  #else
-    #define XMLPUBFUN
-    #if !defined(LIBXML_STATIC)
-      #define XMLPUBVAR __declspec(dllimport) extern
-    #else
-      #define XMLPUBVAR extern
-    #endif
-  #endif
-  #define XMLCALL __cdecl
-  #define XMLCDECL __cdecl
-#endif
+/**
+ * XMLPUBVAR:
+ *
+ * Macro which declares an exportable variable
+ */
+#define XMLPUBVAR XMLPUBLIC extern
 
 /* Compatibility */
 #if !defined(LIBXML_DLL_IMPORT)
index 97930c7..b90e9d1 100644 (file)
@@ -122,7 +122,7 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
  * @line: returned line information
  *
  * A schemas validation locator, a callback called by the validator.
- * This is used when file or node informations are not available
+ * This is used when file or node information are not available
  * to find out what file and line number are affected
  *
  * Returns: 0 in case of success and -1 in case of error
index 964f10d..c995fe5 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Summary: compile-time version informations
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information
+ * Description: compile-time version information for the XML library
  *
  * Copy: See Copyright for the status of this software.
  *
index e0f2b38..c6bc8b8 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Summary: compile-time version informations on Windows
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information on Windows
+ * Description: compile-time version information for the XML library
  *              when compiled on the Windows platform
  *
  * Copy: See Copyright for the status of this software.
index 2176ad1..90e97ef 100644 (file)
@@ -1,6 +1,6 @@
 /*
- * Summary: compile-time version informations on Windows
- * Description: compile-time version informations for the XML library
+ * Summary: compile-time version information on Windows
+ * Description: compile-time version information for the XML library
  *              when compiled on the Windows platform
  *
  * Copy: See Copyright for the status of this software.
index 4ef3909..539593f 100644 (file)
@@ -359,8 +359,6 @@ struct _xmlXPathContext {
     unsigned long opLimit;
     unsigned long opCount;
     int depth;
-    int maxDepth;
-    int maxParserDepth;
 };
 
 /*
@@ -373,7 +371,7 @@ typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
 /**
  * xmlXPathParserContext:
  *
- * An XPath parser context. It contains pure parsing informations,
+ * An XPath parser context. It contains pure parsing information,
  * an xmlXPathContext, and the stack of objects.
  */
 struct _xmlXPathParserContext {
index 2d7a6f5..09de9fe 100644 (file)
--- a/libxml.m4
+++ b/libxml.m4
@@ -1,4 +1,6 @@
 # Configure paths for LIBXML2
+# Simon Josefsson 2020-02-12
+# Fix autoconf 2.70+ warnings
 # Mike Hommey 2004-06-19
 # use CPPFLAGS instead of CFLAGS
 # Toshio Kuratomi 2001-04-21
@@ -58,7 +60,8 @@ dnl Now check if the installed libxml is sufficiently new.
 dnl (Also sanity checks the results of xml2-config to some extent)
 dnl
       rm -f conf.xmltest
-      AC_TRY_RUN([
+      AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -128,12 +131,12 @@ main()
         printf("*** being found. The easiest way to fix this is to remove the old version\n");
         printf("*** of LIBXML, but you can also set the XML2_CONFIG environment to point to the\n");
         printf("*** correct copy of xml2-config. (In this case, you will have to\n");
-        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
+        printf("*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf\n");
         printf("*** so that the correct libraries are found at run-time))\n");
     }
   return 1;
 }
-],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
+]])],, no_xml=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
        CPPFLAGS="$ac_save_CPPFLAGS"
        LIBS="$ac_save_LIBS"
      fi
@@ -156,10 +159,11 @@ main()
           echo "*** Could not run libxml test program, checking why..."
           CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS"
           LIBS="$LIBS $XML_LIBS"
-          AC_TRY_LINK([
+         AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM([[
 #include <libxml/xmlversion.h>
 #include <stdio.h>
-],      [ LIBXML_TEST_VERSION; return 0;],
+]],    [[ LIBXML_TEST_VERSION; return 0;]])],
         [ echo "*** The test program compiled, but did not run. This usually means"
           echo "*** that the run-time linker is not finding LIBXML or finding the wrong"
           echo "*** version of LIBXML. If it is not finding LIBXML, you'll need to set your"
diff --git a/libxml2-config.cmake.cmake.in b/libxml2-config.cmake.cmake.in
new file mode 100644 (file)
index 0000000..27586aa
--- /dev/null
@@ -0,0 +1,136 @@
+# libxml2-config.cmake
+# --------------------
+#
+# Libxml2 cmake module.
+# This module sets the following variables:
+#
+# ::
+#
+#   LIBXML2_INCLUDE_DIR        - Directory where LibXml2 headers are located.
+#   LIBXML2_INCLUDE_DIRS       - list of the include directories needed to use LibXml2.
+#   LIBXML2_LIBRARY            - path to the LibXml2 library.
+#   LIBXML2_LIBRARIES          - xml2 libraries to link against.
+#   LIBXML2_DEFINITIONS        - the compiler switches required for using LibXml2.
+#   LIBXML2_VERSION_MAJOR      - The major version of libxml2.
+#   LIBXML2_VERSION_MINOR      - The minor version of libxml2.
+#   LIBXML2_VERSION_PATCH      - The patch version of libxml2.
+#   LIBXML2_VERSION_STRING     - version number as a string (ex: "2.3.4")
+#   LIBXML2_MODULES            - whether libxml2 has dso support
+#   LIBXML2_XMLLINT_EXECUTABLE - path to the XML checking tool xmllint coming with LibXml2
+
+include("${CMAKE_CURRENT_LIST_DIR}/libxml2-export.cmake")
+
+@PACKAGE_INIT@
+
+set(LIBXML2_VERSION_MAJOR  @LIBXML_MAJOR_VERSION@)
+set(LIBXML2_VERSION_MINOR  @LIBXML_MINOR_VERSION@)
+set(LIBXML2_VERSION_PATCH  @LIBXML_MICRO_VERSION@)
+set(LIBXML2_VERSION_STRING "@VERSION@")
+set(LIBXML2_INSTALL_PREFIX ${PACKAGE_PREFIX_DIR})
+set(LIBXML2_INCLUDE_DIR    ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@/libxml2)
+set(LIBXML2_LIBRARY_DIR    ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@)
+
+macro(select_library_location target basename)
+  if(TARGET ${target})
+    foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB)
+      get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG)
+      get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL)
+      get_target_property(${basename}_${property}_RELEASE ${target} ${property}_RELEASE)
+      get_target_property(${basename}_${property}_RELWITHDEBINFO ${target} ${property}_RELWITHDEBINFO)
+
+      if(${basename}_${property}_DEBUG AND ${basename}_${property}_RELEASE)
+        set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELEASE})
+      elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_RELWITHDEBINFO)
+        set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELWITHDEBINFO})
+      elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_MINSIZEREL)
+        set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_MINSIZEREL})
+      elseif(${basename}_${property}_RELEASE)
+        set(${basename}_LIBRARY ${${basename}_${property}_RELEASE})
+      elseif(${basename}_${property}_RELWITHDEBINFO)
+        set(${basename}_LIBRARY ${${basename}_${property}_RELWITHDEBINFO})
+      elseif(${basename}_${property}_MINSIZEREL)
+        set(${basename}_LIBRARY ${${basename}_${property}_MINSIZEREL})
+      elseif(${basename}_${property}_DEBUG)
+        set(${basename}_LIBRARY ${${basename}_${property}_DEBUG})
+      endif()
+    endforeach()
+  endif()
+endmacro()
+
+macro(select_executable_location target basename)
+  if(TARGET ${target})
+    get_target_property(${basename}_IMPORTED_LOCATION_DEBUG ${target} IMPORTED_LOCATION_DEBUG)
+    get_target_property(${basename}_IMPORTED_LOCATION_MINSIZEREL ${target} IMPORTED_LOCATION_MINSIZEREL)
+    get_target_property(${basename}_IMPORTED_LOCATION_RELEASE ${target} IMPORTED_LOCATION_RELEASE)
+    get_target_property(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO ${target} IMPORTED_LOCATION_RELWITHDEBINFO)
+
+    if(${basename}_IMPORTED_LOCATION_RELEASE)
+      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELEASE})
+    elseif(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO)
+      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELWITHDEBINFO})
+    elseif(${basename}_IMPORTED_LOCATION_MINSIZEREL)
+      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_MINSIZEREL})
+    elseif(${basename}_IMPORTED_LOCATION_DEBUG)
+      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_DEBUG})
+    endif()
+  endif()
+endmacro()
+
+select_library_location(LibXml2::LibXml2 LIBXML2)
+select_executable_location(LibXml2::xmlcatalog LIBXML2_XMLCATALOG)
+select_executable_location(LibXml2::xmllint LIBXML2_XMLLINT)
+
+set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
+set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
+
+include(CMakeFindDependencyMacro)
+
+set(LIBXML2_SHARED @BUILD_SHARED_LIBS@)
+set(LIBXML2_WITH_ICONV @LIBXML2_WITH_ICONV@)
+set(LIBXML2_WITH_THREADS @LIBXML2_WITH_THREADS@)
+set(LIBXML2_WITH_ICU @LIBXML2_WITH_ICU@)
+set(LIBXML2_WITH_LZMA @LIBXML2_WITH_LZMA@)
+set(LIBXML2_WITH_ZLIB @LIBXML2_WITH_ZLIB@)
+
+if(LIBXML2_WITH_ICONV)
+  find_dependency(Iconv)
+  list(APPEND LIBXML2_LIBRARIES    ${Iconv_LIBRARIES})
+  list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
+endif()
+
+if(NOT LIBXML2_SHARED)
+  set(LIBXML2_DEFINITIONS -DLIBXML_STATIC)
+
+  if(LIBXML2_WITH_THREADS)
+    find_dependency(Threads)
+    list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+  endif()
+
+  if(LIBXML2_WITH_ICU)
+    find_dependency(ICU COMPONENTS data i18n uc)
+    list(APPEND LIBXML2_LIBRARIES    ${ICU_LIBRARIES})
+  endif()
+
+  if(LIBXML2_WITH_LZMA)
+    find_dependency(LibLZMA)
+    list(APPEND LIBXML2_LIBRARIES    ${LIBLZMA_LIBRARIES})
+  endif()
+
+  if(LIBXML2_WITH_ZLIB)
+    find_dependency(ZLIB)
+    list(APPEND LIBXML2_LIBRARIES    ${ZLIB_LIBRARIES})
+  endif()
+
+  if(UNIX)
+    list(APPEND LIBXML2_LIBRARIES m)
+  endif()
+
+  if(WIN32)
+    list(APPEND LIBXML2_LIBRARIES ws2_32)
+  endif()
+endif()
+
+# whether libxml2 has dso support
+set(LIBXML2_MODULES @LIBXML2_WITH_MODULES@)
+
+mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
index 6b16fc2..4989690 100644 (file)
@@ -2,17 +2,26 @@
 # --------------------
 #
 # Libxml2 cmake module.
-# THis module sets the following variables:
+# This module sets the following variables:
 #
 # ::
 #
-#   LIBXML2_INCLUDE_DIRS      - Directory where libxml2 headers are located.
-#   LIBXML2_LIBRARIES         - xml2 libraries to link against.
-#   LIBXML2_VERSION_MAJOR     - The major version of libxml2.
-#   LIBXML2_VERSION_MINOR     - The minor version of libxml2.
-#   LIBXML2_VERSION_PATCH     - The patch version of libxml2.
-#   LIBXML2_VERSION_STRING    - version number as a string (ex: "2.3.4")
-#   LIBXML2_MODULES           - whether libxml2 as dso support
+#   LIBXML2_INCLUDE_DIR        - Directory where LibXml2 headers are located.
+#   LIBXML2_INCLUDE_DIRS       - list of the include directories needed to use LibXml2.
+#   LIBXML2_LIBRARY            - path to the LibXml2 library.
+#   LIBXML2_LIBRARIES          - xml2 libraries to link against.
+#   LIBXML2_DEFINITIONS        - the compiler switches required for using LibXml2.
+#   LIBXML2_VERSION_MAJOR      - The major version of libxml2.
+#   LIBXML2_VERSION_MINOR      - The minor version of libxml2.
+#   LIBXML2_VERSION_PATCH      - The patch version of libxml2.
+#   LIBXML2_VERSION_STRING     - version number as a string (ex: "2.3.4")
+#   LIBXML2_MODULES            - whether libxml2 has dso support
+#   LIBXML2_XMLLINT_EXECUTABLE - path to the XML checking tool xmllint coming with LibXml2
+#
+# The following targets are defined:
+#
+#   LibXml2::LibXml2          - the LibXml2 library
+#   LibXml2::xmllint          - the xmllint command-line executable
 
 get_filename_component(_libxml2_rootdir ${CMAKE_CURRENT_LIST_DIR}/../../../ ABSOLUTE)
 
@@ -20,31 +29,87 @@ set(LIBXML2_VERSION_MAJOR  @LIBXML_MAJOR_VERSION@)
 set(LIBXML2_VERSION_MINOR  @LIBXML_MINOR_VERSION@)
 set(LIBXML2_VERSION_MICRO  @LIBXML_MICRO_VERSION@)
 set(LIBXML2_VERSION_STRING "@VERSION@")
+set(LIBXML2_DEFINITIONS    "@XML_CFLAGS@")
 set(LIBXML2_INSTALL_PREFIX ${_libxml2_rootdir})
-set(LIBXML2_INCLUDE_DIRS   ${_libxml2_rootdir}/include ${_libxml2_rootdir}/include/libxml2)
+set(LIBXML2_INCLUDE_DIR    ${_libxml2_rootdir}/include/libxml2)
 set(LIBXML2_LIBRARY_DIR    ${_libxml2_rootdir}/lib)
-set(LIBXML2_LIBRARIES      -L${LIBXML2_LIBRARY_DIR} -lxml2)
 
-if(@WITH_THREADS@)
-  find_package(Threads REQUIRED)
-  list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+find_library(LIBXML2_LIBRARY NAMES xml2 HINTS ${LIBXML2_LIBRARY_DIR} NO_DEFAULT_PATH)
+find_program(LIBXML2_XMLCATALOG_EXECUTABLE NAMES xmlcatalog HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
+find_program(LIBXML2_XMLLINT_EXECUTABLE NAMES xmllint HINTS ${_libxml2_rootdir}/bin NO_DEFAULT_PATH)
+
+set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
+set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR})
+unset(LIBXML2_INTERFACE_LINK_LIBRARIES)
+
+include(CMakeFindDependencyMacro)
+
+set(LIBXML2_WITH_ICONV @WITH_ICONV@)
+set(LIBXML2_WITH_THREADS @WITH_THREADS@)
+set(LIBXML2_WITH_ICU @WITH_ICU@)
+set(LIBXML2_WITH_LZMA @WITH_LZMA@)
+set(LIBXML2_WITH_ZLIB @WITH_ZLIB@)
+
+if(LIBXML2_WITH_ICONV)
+  find_dependency(Iconv)
+  list(APPEND LIBXML2_LIBRARIES    ${Iconv_LIBRARIES})
+  list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "Iconv::Iconv")
+endif()
+
+if(LIBXML2_WITH_THREADS)
+  find_dependency(Threads)
+  list(APPEND LIBXML2_LIBRARIES    ${CMAKE_THREAD_LIBS_INIT})
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>")
+endif()
+
+if(LIBXML2_WITH_ICU)
+  find_dependency(ICU COMPONENTS data i18n uc)
+  list(APPEND LIBXML2_LIBRARIES    ${ICU_LIBRARIES})
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ICU::data>;\$<LINK_ONLY:ICU::i18n>;\$<LINK_ONLY:ICU::uc>")
 endif()
 
-if(@WITH_LZMA@)
-  find_package(LibLZMA REQUIRED)
+if(LIBXML2_WITH_LZMA)
+  find_dependency(LibLZMA)
   list(APPEND LIBXML2_LIBRARIES    ${LIBLZMA_LIBRARIES})
-  list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS})
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:LibLZMA::LibLZMA>")
 endif()
 
-if(@WITH_ZLIB@)
-  find_package(ZLIB REQUIRED)
+if(LIBXML2_WITH_ZLIB)
+  find_dependency(ZLIB)
   list(APPEND LIBXML2_LIBRARIES    ${ZLIB_LIBRARIES})
-  list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ZLIB::ZLIB>")
 endif()
 
-list(APPEND LIBXML2_LIBRARIES @ICU_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@)
+if(UNIX)
+  list(APPEND LIBXML2_LIBRARIES    m)
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:m>")
+endif()
+
+if(WIN32)
+  list(APPEND LIBXML2_LIBRARIES    ws2_32)
+  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>")
+endif()
 
 # whether libxml2 has dso support
 set(LIBXML2_MODULES @WITH_MODULES@)
 
-mark_as_advanced( LIBXML2_INCLUDE_DIRS LIBXML2_LIBRARIES )
+mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
+
+if(NOT TARGET LibXml2::LibXml2 AND DEFINED LIBXML2_LIBRARY AND DEFINED LIBXML2_INCLUDE_DIRS)
+  add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
+  set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
+  set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}")
+  set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}")
+  set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBXML2_INTERFACE_LINK_LIBRARIES}")
+endif()
+
+if(NOT TARGET LibXml2::xmlcatalog AND DEFINED LIBXML2_XMLCATALOG_EXECUTABLE)
+  add_executable(LibXml2::xmlcatalog IMPORTED)
+  set_target_properties(LibXml2::xmlcatalog PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLCATALOG_EXECUTABLE}")
+endif()
+
+if(NOT TARGET LibXml2::xmllint AND DEFINED LIBXML2_XMLLINT_EXECUTABLE)
+  add_executable(LibXml2::xmllint IMPORTED)
+  set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
+endif()
index c17d3d9..33bc112 100644 (file)
@@ -2286,3 +2286,10 @@ LIBXML2_2.9.8 {
   xmlHashDefaultDeallocator;
 } LIBXML2_2.9.1;
 
+LIBXML2_2.9.11 {
+    global:
+
+# xmlIO
+  xmlPopOutputCallbacks;
+} LIBXML2_2.9.8;
+
diff --git a/list.c b/list.c
index 24da6b1..2020715 100644 (file)
--- a/list.c
+++ b/list.c
@@ -9,7 +9,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  * Author: Gary.Pennington@uk.sun.com
index 54fa026..18c1ce4 100644 (file)
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -158,7 +158,7 @@ int have_ipv6(void) {
 
 /**
  * xmlFTPErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -172,7 +172,7 @@ xmlFTPErrMemory(const char *extra)
  * xmlNanoFTPInit:
  *
  * Initialize the FTP protocol layer.
- * Currently it just checks for proxy informations,
+ * Currently it just checks for proxy information,
  * and get the hostname
  */
 
@@ -218,7 +218,7 @@ xmlNanoFTPInit(void) {
 /**
  * xmlNanoFTPCleanup:
  *
- * Cleanup the FTP protocol layer. This cleanup proxy informations.
+ * Cleanup the FTP protocol layer. This cleanup proxy information.
  */
 
 void
@@ -250,7 +250,7 @@ xmlNanoFTPCleanup(void) {
  * @passwd:  the proxy password
  * @type:  the type of proxy 1 for using SITE, 2 for USER a@b
  *
- * Setup the FTP proxy informations.
+ * Setup the FTP proxy information.
  * This can also be done by using ftp_proxy ftp_proxy_user and
  * ftp_proxy_password environment variables.
  */
@@ -412,7 +412,7 @@ xmlNanoFTPUpdateURL(void *ctx, const char *URL) {
  * (Re)Initialize the FTP Proxy context by parsing the URL and finding
  * the protocol host port it indicates.
  * Should be like ftp://myproxy/ or ftp://myproxy:3128/
- * A NULL URL cleans up proxy informations.
+ * A NULL URL cleans up proxy information.
  */
 
 void
@@ -1251,8 +1251,7 @@ xmlNanoFTPConnectTo(const char *server, int port) {
        xmlNanoFTPFreeCtxt(ctxt);
        return(NULL);
     }
-    if (port != 0)
-       ctxt->port = port;
+    ctxt->port = port;
     res = xmlNanoFTPConnect(ctxt);
     if (res < 0) {
        xmlNanoFTPFreeCtxt(ctxt);
@@ -1268,7 +1267,7 @@ xmlNanoFTPConnectTo(const char *server, int port) {
  *
  * Tries to change the remote directory
  *
- * Returns -1 incase of error, 1 if CWD worked, 0 if it failed
+ * Returns -1 in case of error, 1 if CWD worked, 0 if it failed
  */
 
 int
@@ -1317,7 +1316,7 @@ xmlNanoFTPCwd(void *ctx, const char *directory) {
  *
  * Tries to delete an item (file or directory) from server
  *
- * Returns -1 incase of error, 1 if DELE worked, 0 if it failed
+ * Returns -1 in case of error, 1 if DELE worked, 0 if it failed
  */
 
 int
@@ -1367,7 +1366,7 @@ xmlNanoFTPDele(void *ctx, const char *file) {
  * Try to open a data connection to the server. Currently only
  * passive mode is supported.
  *
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
  */
 
 SOCKET
@@ -1540,7 +1539,7 @@ xmlNanoFTPGetConnection(void *ctx) {
  *
  * Close the data connection from the server
  *
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
  */
 
 int
@@ -1591,7 +1590,7 @@ xmlNanoFTPCloseConnection(void *ctx) {
  *
  * Parse at most one entry from the listing.
  *
- * Returns -1 incase of error, the length of data parsed otherwise
+ * Returns -1 in case of error, the length of data parsed otherwise
  */
 
 static int
@@ -1719,7 +1718,7 @@ xmlNanoFTPParseList(const char *list, ftpListCallback callback, void *userData)
  * Do a listing on the server. All files info are passed back
  * in the callbacks.
  *
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
  */
 
 int
@@ -1894,7 +1893,7 @@ xmlNanoFTPGetSocket(void *ctx, const char *filename) {
  * Fetch the given file from the server. All data are passed back
  * in the callbacks. The last callback has a size of 0 block.
  *
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
  */
 
 int
@@ -2024,7 +2023,7 @@ xmlNanoFTPOpen(const char *URL) {
  *
  * Close the connection and both control and transport
  *
- * Returns -1 incase of error, 0 otherwise
+ * Returns -1 in case of error, 0 otherwise
  */
 
 int
index 018b7e1..8e840f5 100644 (file)
@@ -160,7 +160,7 @@ static int xmlNanoHTTPFetchContent( void * ctx, char ** ptr, int * len );
 
 /**
  * xmlHTTPErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -213,7 +213,7 @@ int have_ipv6(void) {
  * xmlNanoHTTPInit:
  *
  * Initialize the HTTP protocol layer.
- * Currently it just checks for proxy informations
+ * Currently it just checks for proxy information
  */
 
 void
@@ -344,7 +344,7 @@ xmlNanoHTTPScanURL(xmlNanoHTTPCtxtPtr ctxt, const char *URL) {
  * (Re)Initialize the HTTP Proxy context by parsing the URL and finding
  * the protocol host port it indicates.
  * Should be like http://myproxy/ or http://myproxy:3128/
- * A NULL URL cleans up proxy informations.
+ * A NULL URL cleans up proxy information.
  */
 
 void
@@ -650,7 +650,7 @@ xmlNanoHTTPRecv(xmlNanoHTTPCtxtPtr ctxt)
  * @ctxt:  an HTTP context
  *
  * Read one line in the HTTP server output, usually for extracting
- * the HTTP protocol informations from the answer header.
+ * the HTTP protocol information from the answer header.
  *
  * Returns a newly allocated string with a copy of the line, or NULL
  *         which indicate the end of the input.
@@ -693,7 +693,7 @@ xmlNanoHTTPReadLine(xmlNanoHTTPCtxtPtr ctxt) {
  * @ctxt:  an HTTP context
  * @line:  an HTTP header line
  *
- * Try to extract useful informations from the server answer.
+ * Try to extract useful information from the server answer.
  * We currently parse and process:
  *  - The HTTP revision/ return code
  *  - The Content-Type, Mime-Type and charset used
@@ -1625,7 +1625,7 @@ xmlNanoHTTPMethod(const char *URL, const char *method, const char *input,
  * This function try to fetch the indicated resource via HTTP GET
  * and save it's content in the file.
  *
- * Returns -1 in case of failure, 0 incase of success. The contentType,
+ * Returns -1 in case of failure, 0 in case of success. The contentType,
  *     if provided must be freed by the caller
  */
 int
@@ -1675,7 +1675,7 @@ xmlNanoHTTPFetch(const char *URL, const char *filename, char **contentType) {
  * This function saves the output of the HTTP transaction to a file
  * It closes and free the context at the end
  *
- * Returns -1 in case of failure, 0 incase of success.
+ * Returns -1 in case of failure, 0 in case of success.
  */
 int
 xmlNanoHTTPSave(void *ctxt, const char *filename) {
index 6e11f7e..5b37b0b 100644 (file)
@@ -18,6 +18,6 @@ XSLT:
             - constants at the XPAth level
           - provide more info on compiled expressions
             - dependances w.r.t. variables (which ones)
-            - dependancy on the current node
-            - dependancy on the current document
+            - dependency on the current node
+            - dependency on the current document
   - do not use _private but other fields in the node structures.
index 8af38b4..1b92473 100644 (file)
@@ -8,7 +8,7 @@
 ---     Author: Patrick Monnerat <pm@datasphere.ch>, DATASPHERE S.A.
 -->
 <ccsid_mibenum>
-        <assoc ccsid="0"><!-- Curent job's CCSID. --></assoc>
+        <assoc ccsid="0"><!-- Current job's CCSID. --></assoc>
         <assoc ccsid="37" mibenum="2028"><!-- EBCDIC-US -->
                 <alias>EBCDIC</alias>
         </assoc>
index 1dab819..698ec5a 100644 (file)
@@ -33,7 +33,7 @@
 
       * XML_CATALOG_PI:
       *
-      * The specific XML Catalog Processing Instuction name.
+      * The specific XML Catalog Processing Instruction name.
 
      d XML_CATALOG_PI  c                   'oasis-xml-catalog'
 
index fa48d4f..c6b17a1 100644 (file)
@@ -70,7 +70,7 @@
 
       * xmlParserNodeInfo:
       *
-      * The parser can be asked to collect Node informations, i.e. at what
+      * The parser can be asked to collect Node information, i.e. at what
       * place in the file they were detected.
       * NOTE: This is off by default and not very well tested.
 
      d  freeAttrsNr                        like(xmlCint)                        # free attr. nodes
      d  freeAttrs                          like(xmlAttrPtr)                     Free attr noes list
       *
-      * the complete error informations for the last error.
+      * the complete error information for the last error.
       *
      d  lastError                          likeds(xmlError)
      d  parseMode                          like(xmlParserMode)                  The parser mode
       * xmlSAXHandler:
       *
       * A SAX handler is bunch of callbacks called by the parser when
-      * processing of the input generate data or structure informations.
+      * processing of the input generate data or structure information.
 
       * resolveEntitySAXFunc:
       * @ctx:  the user data (XML parser context)
       *                  (localname/prefix/URI/value/end) attribute values.
       *
       * SAX2 callback when an element start has been detected by the parser.
-      * It provides the namespace informations for the element, as well as
+      * It provides the namespace information for the element, as well as
       * the new namespace declarations on the element.
 
      d startElementNsSAX2Func...
       * @URI:  the element namespace name if available
       *
       * SAX2 callback when an element end has been detected by the parser.
-      * It provides the namespace informations for the element.
+      * It provides the namespace information for the element.
 
      d endElementNsSAX2Func...
      d                 s               *   based(######typedef######)
 
       * xmlFeature:
       *
-      * Used to examine the existance of features that can be enabled
+      * Used to examine the existence of features that can be enabled
       * or disabled at compile-time.
       * They used to be called XML_FEATURE_xxx but this clashed with Expat
 
index 765ed00..6429eb2 100644 (file)
 
       * XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
       *
-      * The attribute wildcard has been already builded.
+      * The attribute wildcard has been already built.
 
      d XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED...
      d                 c                   X'0001'
 
       * XML_SCHEMAS_ATTRGROUP_GLOBAL:
       *
-      * The attribute wildcard has been already builded.
+      * The attribute wildcard has been already built.
 
      d XML_SCHEMAS_ATTRGROUP_GLOBAL...
      d                 c                   X'0002'
 
       * XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
       *
-      * disallowed substitutions: "substituion"
+      * disallowed substitutions: "substitution"
 
      d XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION...
      d                 c                   X'00002000'
index 6512778..3e78182 100644 (file)
       * xmlDocProperty
       *
       * Set of properties of the document as found by the parser
-      * Some of them are linked to similary named xmlParserOption
+      * Some of them are linked to similarly named xmlParserOption
 
      d xmlDocProperties...
      d                 s                   based(######typedef######)
index 6c0afcc..d0e6f74 100644 (file)
@@ -18,7 +18,7 @@
       * @filename: the filename or URI
       *
       * Callback used in the I/O Input API to detect if the current handler
-      * can provide input fonctionnalities for this resource.
+      * can provide input functionalities for this resource.
       *
       * Returns 1 if yes and 0 if another Input module should be used
 
@@ -70,7 +70,7 @@
       * @filename: the filename or URI
       *
       * Callback used in the I/O Output API to detect if the current handler
-      * can provide output fonctionnalities for this resource.
+      * can provide output functionalities for this resource.
       *
       * Returns 1 if yes and 0 if another Output module should be used
 
index 48a23bf..3440dc1 100644 (file)
@@ -1,4 +1,4 @@
-      * Eqivalent of C data types.
+      * Equivalent of C data types.
       *
       * Copy: See Copyright for the status of this software.
       *
index 9a6fd10..d76ad4b 100644 (file)
@@ -8,7 +8,7 @@
       /if not defined(XML_EXPORTS_H__)
       /define XML_EXPORTS_H__
 
-      * The definition in the original C header file are not appliable to
+      * The definition in the original C header file are not applicable to
       * ILE/RPG.
       * Therefore this file is intentionally empty.
 
index f34ddcd..f453bd2 100644 (file)
       * @line: returned line information
       *
       * A schemas validation locator, a callback called by the validator.
-      * This is used when file or node informations are not available
+      * This is used when file or node information are not available
       * to find out what file and line number are affected
       *
       * Returns: 0 in case of success and -1 in case of error
index 955599e..94a3910 100644 (file)
@@ -1,5 +1,5 @@
-      * Summary: compile-time version informations
-      * Description: compile-time version informations for the XML library
+      * Summary: compile-time version information
+      * Description: compile-time version information for the XML library
       *
       * Copy: See Copyright for the status of this software.
       *
index 6e591ee..e1e15d6 100644 (file)
 
       * xmlXPathParserContext:
       *
-      * An XPath parser context. It contains pure parsing informations,
+      * An XPath parser context. It contains pure parsing information,
       * an xmlXPathContext, and the stack of objects.
 
      d xmlXPathParserContext...
index ad4cc5d..a2f2399 100644 (file)
@@ -19,7 +19,7 @@
 
 
 /**
-***     ILE/RPG cannot directly derefence a pointer and has no macros.
+***     ILE/RPG cannot directly dereference a pointer and has no macros.
 ***     The following additional procedures supply these functions.
 ***     In addition, the following code is adjusted for threads control at
 ***             compile time via the C macros.
index d8016d7..8e572d4 100644 (file)
@@ -1,5 +1,5 @@
 /**
-***     Additional delarations for ILE/RPG support.
+***     Additional declarations for ILE/RPG support.
 ***
 ***     See Copyright for the status of this software.
 ***
index bae6187..ea71b15 100644 (file)
@@ -33,7 +33,7 @@ xmlZapDict(xmlDictPtr * dict)
 
 /**
 ***     Support for inline conversion from/to UTF-8.
-***     This is targetted to function parameter encoding conversion.
+***     This is targeted to function parameter encoding conversion.
 ***     Method is:
 ***     -       Convert string from/to UTF-8.
 ***     -       Keep it in a dictionary.
index d1c3196..c9312fa 100644 (file)
--- a/parser.c
+++ b/parser.c
 #include "buf.h"
 #include "enc.h"
 
+struct _xmlStartTag {
+    const xmlChar *prefix;
+    const xmlChar *URI;
+    int line;
+    int nsNr;
+};
+
 static void
 xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info);
 
@@ -133,6 +140,7 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
                      xmlEntityPtr ent, size_t replacement)
 {
     size_t consumed = 0;
+    int i;
 
     if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
         return (0);
@@ -170,6 +178,28 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
            rep = NULL;
        }
     }
+
+    /*
+     * Prevent entity exponential check, not just replacement while
+     * parsing the DTD
+     * The check is potentially costly so do that only once in a thousand
+     */
+    if ((ctxt->instate == XML_PARSER_DTD) && (ctxt->nbentities > 10000) &&
+        (ctxt->nbentities % 1024 == 0)) {
+       for (i = 0;i < ctxt->inputNr;i++) {
+           consumed += ctxt->inputTab[i]->consumed +
+                      (ctxt->inputTab[i]->cur - ctxt->inputTab[i]->base);
+       }
+       if (ctxt->nbentities > consumed * XML_PARSER_NON_LINEAR) {
+           xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+           ctxt->instate = XML_PARSER_EOF;
+           return (1);
+       }
+       consumed = 0;
+    }
+
+
+
     if (replacement != 0) {
        if (replacement < XML_MAX_TEXT_LENGTH)
            return(0);
@@ -1073,11 +1103,15 @@ xmlHasFeature(xmlFeature feature)
  */
 static void
 xmlDetectSAX2(xmlParserCtxtPtr ctxt) {
+    xmlSAXHandlerPtr sax;
     if (ctxt == NULL) return;
+    sax = ctxt->sax;
 #ifdef LIBXML_SAX1_ENABLED
-    if ((ctxt->sax) &&  (ctxt->sax->initialized == XML_SAX2_MAGIC) &&
-        ((ctxt->sax->startElementNs != NULL) ||
-         (ctxt->sax->endElementNs != NULL))) ctxt->sax2 = 1;
+    if ((sax) &&  (sax->initialized == XML_SAX2_MAGIC) &&
+        ((sax->startElementNs != NULL) ||
+         (sax->endElementNs != NULL) ||
+         ((sax->startElement == NULL) && (sax->endElement == NULL))))
+        ctxt->sax2 = 1;
 #else
     ctxt->sax2 = 1;
 #endif /* LIBXML_SAX1_ENABLED */
@@ -1834,6 +1868,8 @@ nodePop(xmlParserCtxtPtr ctxt)
  * @value:  the element name
  * @prefix:  the element prefix
  * @URI:  the element namespace name
+ * @line:  the current line number for error messages
+ * @nsNr:  the number of namespaces pushed on the namespace table
  *
  * Pushes a new element name/prefix/URL on top of the name stack
  *
@@ -1841,11 +1877,13 @@ nodePop(xmlParserCtxtPtr ctxt)
  */
 static int
 nameNsPush(xmlParserCtxtPtr ctxt, const xmlChar * value,
-           const xmlChar *prefix, const xmlChar *URI, int nsNr)
+           const xmlChar *prefix, const xmlChar *URI, int line, int nsNr)
 {
+    xmlStartTag *tag;
+
     if (ctxt->nameNr >= ctxt->nameMax) {
         const xmlChar * *tmp;
-        void **tmp2;
+        xmlStartTag *tmp2;
         ctxt->nameMax *= 2;
         tmp = (const xmlChar * *) xmlRealloc((xmlChar * *)ctxt->nameTab,
                                     ctxt->nameMax *
@@ -1855,8 +1893,8 @@ nameNsPush(xmlParserCtxtPtr ctxt, const xmlChar * value,
            goto mem_error;
         }
        ctxt->nameTab = tmp;
-        tmp2 = (void **) xmlRealloc((void * *)ctxt->pushTab,
-                                    ctxt->nameMax * 3 *
+        tmp2 = (xmlStartTag *) xmlRealloc((void * *)ctxt->pushTab,
+                                    ctxt->nameMax *
                                     sizeof(ctxt->pushTab[0]));
         if (tmp2 == NULL) {
            ctxt->nameMax /= 2;
@@ -1864,16 +1902,18 @@ nameNsPush(xmlParserCtxtPtr ctxt, const xmlChar * value,
         }
        ctxt->pushTab = tmp2;
     } else if (ctxt->pushTab == NULL) {
-        ctxt->pushTab = (void **) xmlMalloc(ctxt->nameMax * 3 *
+        ctxt->pushTab = (xmlStartTag *) xmlMalloc(ctxt->nameMax *
                                             sizeof(ctxt->pushTab[0]));
         if (ctxt->pushTab == NULL)
             goto mem_error;
     }
     ctxt->nameTab[ctxt->nameNr] = value;
     ctxt->name = value;
-    ctxt->pushTab[ctxt->nameNr * 3] = (void *) prefix;
-    ctxt->pushTab[ctxt->nameNr * 3 + 1] = (void *) URI;
-    ctxt->pushTab[ctxt->nameNr * 3 + 2] = (void *) (ptrdiff_t) nsNr;
+    tag = &ctxt->pushTab[ctxt->nameNr];
+    tag->prefix = prefix;
+    tag->URI = URI;
+    tag->line = line;
+    tag->nsNr = nsNr;
     return (ctxt->nameNr++);
 mem_error:
     xmlErrMemory(ctxt, NULL);
@@ -2055,7 +2095,7 @@ static int spacePop(xmlParserCtxtPtr ctxt) {
     ((unsigned char *) s)[ 9 ] == c10 )
 
 #define SKIP(val) do {                                                 \
-    ctxt->nbChars += (val),ctxt->input->cur += (val),ctxt->input->col+=(val);                  \
+    ctxt->input->cur += (val),ctxt->input->col+=(val);                 \
     if (*ctxt->input->cur == 0)                                                \
         xmlParserInputGrow(ctxt->input, INPUT_CHUNK);                  \
   } while (0)
@@ -2066,7 +2106,6 @@ static int spacePop(xmlParserCtxtPtr ctxt) {
        if (*(ctxt->input->cur) == '\n') {                              \
        ctxt->input->line++; ctxt->input->col = 1;                      \
        } else ctxt->input->col++;                                      \
-       ctxt->nbChars++;                                                \
        ctxt->input->cur++;                                             \
     }                                                                  \
     if (*ctxt->input->cur == 0)                                                \
@@ -2119,7 +2158,6 @@ static void xmlGROW (xmlParserCtxtPtr ctxt) {
 #define NEXT1 {                                                                \
        ctxt->input->col++;                                             \
        ctxt->input->cur++;                                             \
-       ctxt->nbChars++;                                                \
        if (*ctxt->input->cur == 0)                                     \
            xmlParserInputGrow(ctxt->input, INPUT_CHUNK);               \
     }
@@ -2156,7 +2194,7 @@ xmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
      * It's Okay to use CUR/NEXT here since all the blanks are on
      * the ASCII range.
      */
-    if ((ctxt->inputNr == 1) && (ctxt->instate != XML_PARSER_DTD)) {
+    if (ctxt->instate != XML_PARSER_DTD) {
        const xmlChar *cur;
        /*
         * if we are in the document content, go really fast
@@ -2332,7 +2370,6 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) {
        if (RAW == ';') {
            /* on purpose to avoid reentrancy problems with NEXT and SKIP */
            ctxt->input->col++;
-           ctxt->nbChars ++;
            ctxt->input->cur++;
        }
     } else if  ((RAW == '&') && (NXT(1) == '#')) {
@@ -2361,7 +2398,6 @@ xmlParseCharRef(xmlParserCtxtPtr ctxt) {
        if (RAW == ';') {
            /* on purpose to avoid reentrancy problems with NEXT and SKIP */
            ctxt->input->col++;
-           ctxt->nbChars ++;
            ctxt->input->cur++;
        }
     } else {
@@ -2646,7 +2682,8 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
     else
         c = 0;
     while ((c != 0) && (c != end) && /* non input consuming loop */
-          (c != end2) && (c != end3)) {
+           (c != end2) && (c != end3) &&
+           (ctxt->instate != XML_PARSER_EOF)) {
 
        if (c == 0) break;
         if ((c == '&') && (str[1] == '#')) {
@@ -2683,8 +2720,10 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
                rep = xmlStringDecodeEntities(ctxt, ent->content, what,
                                              0, 0, 0);
                ctxt->depth--;
-               if (rep == NULL)
+               if (rep == NULL) {
+                    ent->content[0] = 0;
                     goto int_error;
+                }
 
                 current = rep;
                 while (*current != 0) { /* non input consuming loop */
@@ -2739,8 +2778,11 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
                rep = xmlStringDecodeEntities(ctxt, ent->content, what,
                                              0, 0, 0);
                ctxt->depth--;
-               if (rep == NULL)
+               if (rep == NULL) {
+                    if (ent->content != NULL)
+                        ent->content[0] = 0;
                     goto int_error;
+                }
                 current = rep;
                 while (*current != 0) { /* non input consuming loop */
                     buffer[nbchars++] = *current++;
@@ -3332,7 +3374,6 @@ xmlParseName(xmlParserCtxtPtr ctxt) {
             }
            ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
            ctxt->input->cur = in;
-           ctxt->nbChars += count;
            ctxt->input->col += count;
            if (ret == NULL)
                xmlErrMemory(ctxt, NULL);
@@ -3455,7 +3496,6 @@ xmlParseNCName(xmlParserCtxtPtr ctxt) {
             }
            ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
            ctxt->input->cur = in;
-           ctxt->nbChars += count;
            ctxt->input->col += count;
            if (ret == NULL) {
                xmlErrMemory(ctxt, NULL);
@@ -3492,10 +3532,10 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
     while (*in != 0 && *in == *cmp) {
        ++in;
        ++cmp;
-       ctxt->input->col++;
     }
     if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
        /* success */
+       ctxt->input->col += in - ctxt->input->cur;
        ctxt->input->cur = in;
        return (const xmlChar*) 1;
     }
@@ -3911,7 +3951,6 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
                            "AttValue length too long\n");
             goto mem_error;
         }
-       if (c == 0) break;
        if (c == '&') {
            in_space = 0;
            if (NXT(1) == '#') {
@@ -4206,6 +4245,7 @@ xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) {
        }
        count++;
        if (count > 50) {
+           SHRINK;
            GROW;
            count = 0;
             if (ctxt->instate == XML_PARSER_EOF) {
@@ -4293,6 +4333,7 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
        buf[len++] = cur;
        count++;
        if (count > 50) {
+           SHRINK;
            GROW;
            count = 0;
             if (ctxt->instate == XML_PARSER_EOF) {
@@ -4508,7 +4549,7 @@ get_more:
             if (ctxt->instate == XML_PARSER_EOF)
                return;
            in = ctxt->input->cur;
-       } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09));
+       } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
        nbchar = 0;
     }
     ctxt->input->line = line;
@@ -4573,6 +4614,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt, int cdata) {
        }
        count++;
        if (count > 50) {
+           SHRINK;
            GROW;
            count = 0;
             if (ctxt->instate == XML_PARSER_EOF)
@@ -4778,6 +4820,7 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf,
 
        count++;
        if (count > 50) {
+           SHRINK;
            GROW;
            count = 0;
             if (ctxt->instate == XML_PARSER_EOF) {
@@ -4989,7 +5032,7 @@ get_more:
            ctxt->input->col++;
            goto get_more;
        }
-    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09));
+    } while (((*in >= 0x20) && (*in <= 0x7F)) || (*in == 0x09) || (*in == 0x0a));
     xmlParseCommentComplex(ctxt, buf, len, size);
     ctxt->instate = state;
     return;
@@ -5053,7 +5096,7 @@ xmlParsePITarget(xmlParserCtxtPtr ctxt) {
  * <?oasis-xml-catalog catalog="http://example.com/catalog.xml"?>
  *
  * Occurs only if allowed by the user and if happening in the Misc
- * part of the document before any doctype informations
+ * part of the document before any doctype information
  * This will add the given catalog to the parsing context in order
  * to be used if there is a resolution need further down in the document
  */
@@ -5188,6 +5231,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
                }
                count++;
                if (count > 50) {
+                   SHRINK;
                    GROW;
                     if (ctxt->instate == XML_PARSER_EOF) {
                         xmlFree(buf);
@@ -6084,14 +6128,20 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
            NEXT;
            if (elem == NULL) {
                ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
-               if (ret == NULL) return(NULL);
+               if (ret == NULL) {
+                   xmlFreeDocElementContent(ctxt->myDoc, cur);
+                    return(NULL);
+                }
                ret->c1 = cur;
                if (cur != NULL)
                    cur->parent = ret;
                cur = ret;
            } else {
                n = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_OR);
-               if (n == NULL) return(NULL);
+               if (n == NULL) {
+                   xmlFreeDocElementContent(ctxt->myDoc, ret);
+                    return(NULL);
+                }
                n->c1 = xmlNewDocElementContent(ctxt->myDoc, elem, XML_ELEMENT_CONTENT_ELEMENT);
                if (n->c1 != NULL)
                    n->c1->parent = n;
@@ -6194,6 +6244,8 @@ xmlParseElementChildrenContentDeclPriv(xmlParserCtxtPtr ctxt, int inputchk,
        SKIP_BLANKS;
         cur = ret = xmlParseElementChildrenContentDeclPriv(ctxt, inputid,
                                                            depth + 1);
+        if (cur == NULL)
+            return(NULL);
        SKIP_BLANKS;
        GROW;
     } else {
@@ -6327,6 +6379,11 @@ xmlParseElementChildrenContentDeclPriv(xmlParserCtxtPtr ctxt, int inputchk,
            SKIP_BLANKS;
            last = xmlParseElementChildrenContentDeclPriv(ctxt, inputid,
                                                           depth + 1);
+            if (last == NULL) {
+               if (ret != NULL)
+                   xmlFreeDocElementContent(ctxt->myDoc, ret);
+               return(NULL);
+            }
            SKIP_BLANKS;
        } else {
            elem = xmlParseName(ctxt);
@@ -6852,6 +6909,7 @@ void
 xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
     xmlChar *version;
     const xmlChar *encoding;
+    int oldstate;
 
     /*
      * We know that '<?xml' is here.
@@ -6863,6 +6921,10 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
        return;
     }
 
+    /* Avoid expansion of parameter entities when skipping blanks. */
+    oldstate = ctxt->instate;
+    ctxt->instate = XML_PARSER_START;
+
     if (SKIP_BLANKS == 0) {
        xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
                       "Space needed after '<?xml'\n");
@@ -6890,6 +6952,7 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
        /*
         * The XML REC instructs us to stop parsing right here
         */
+        ctxt->instate = oldstate;
         return;
     }
     if ((encoding == NULL) && (ctxt->errNo == XML_ERR_OK)) {
@@ -6909,6 +6972,8 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) {
        MOVETO_ENDTAG(CUR_PTR);
        NEXT;
     }
+
+    ctxt->instate = oldstate;
 }
 
 /**
@@ -7146,6 +7211,7 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
            ent->checked |= 1;
        if (ret == XML_ERR_ENTITY_LOOP) {
            xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+            xmlHaltParser(ctxt);
            xmlFreeNodeList(list);
            return;
        }
@@ -7159,42 +7225,38 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
             (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY))&&
                (ent->children == NULL)) {
                ent->children = list;
-               if (ctxt->replaceEntities) {
-                   /*
-                    * Prune it directly in the generated document
-                    * except for single text nodes.
-                    */
-                   if (((list->type == XML_TEXT_NODE) &&
-                        (list->next == NULL)) ||
-                       (ctxt->parseMode == XML_PARSE_READER)) {
-                       list->parent = (xmlNodePtr) ent;
-                       list = NULL;
-                       ent->owner = 1;
-                   } else {
-                       ent->owner = 0;
-                       while (list != NULL) {
-                           list->parent = (xmlNodePtr) ctxt->node;
-                           list->doc = ctxt->myDoc;
-                           if (list->next == NULL)
-                               ent->last = list;
-                           list = list->next;
-                       }
-                       list = ent->children;
+                /*
+                 * Prune it directly in the generated document
+                 * except for single text nodes.
+                 */
+                if ((ctxt->replaceEntities == 0) ||
+                    (ctxt->parseMode == XML_PARSE_READER) ||
+                    ((list->type == XML_TEXT_NODE) &&
+                     (list->next == NULL))) {
+                    ent->owner = 1;
+                    while (list != NULL) {
+                        list->parent = (xmlNodePtr) ent;
+                        xmlSetTreeDoc(list, ent->doc);
+                        if (list->next == NULL)
+                            ent->last = list;
+                        list = list->next;
+                    }
+                    list = NULL;
+                } else {
+                    ent->owner = 0;
+                    while (list != NULL) {
+                        list->parent = (xmlNodePtr) ctxt->node;
+                        list->doc = ctxt->myDoc;
+                        if (list->next == NULL)
+                            ent->last = list;
+                        list = list->next;
+                    }
+                    list = ent->children;
 #ifdef LIBXML_LEGACY_ENABLED
-                       if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
-                         xmlAddEntityReference(ent, list, NULL);
+                    if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
+                        xmlAddEntityReference(ent, list, NULL);
 #endif /* LIBXML_LEGACY_ENABLED */
-                   }
-               } else {
-                   ent->owner = 1;
-                   while (list != NULL) {
-                       list->parent = (xmlNodePtr) ent;
-                       xmlSetTreeDoc(list, ent->doc);
-                       if (list->next == NULL)
-                           ent->last = list;
-                       list = list->next;
-                   }
-               }
+                }
            } else {
                xmlFreeNodeList(list);
                list = NULL;
@@ -7924,6 +7986,9 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt)
             xmlChar start[4];
             xmlCharEncoding enc;
 
+           if (xmlParserEntityCheck(ctxt, 0, entity, 0))
+               return;
+
            if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
                ((ctxt->options & XML_PARSE_NOENT) == 0) &&
                ((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
@@ -8629,7 +8694,7 @@ xmlParseEndTag1(xmlParserCtxtPtr ctxt, int line) {
      *
      */
     if (name != (xmlChar*)1) {
-        if (name == NULL) name = BAD_CAST "unparseable";
+        if (name == NULL) name = BAD_CAST "unparsable";
         xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
                     "Opening and ending tag mismatch: %s line %d and %s\n",
                                ctxt->name, line, name);
@@ -8822,6 +8887,7 @@ xmlParseQNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *name,
        }
        if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
            /* success */
+            ctxt->input->col += in - ctxt->input->cur;
            ctxt->input->cur = in;
            return((const xmlChar*) 1);
        }
@@ -9622,10 +9688,8 @@ done:
  */
 
 static void
-xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix,
-                const xmlChar *URI, int line, int nsNr, int tlen) {
+xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlStartTag *tag) {
     const xmlChar *name;
-    size_t curLength;
 
     GROW;
     if ((RAW != '<') || (NXT(1) != '/')) {
@@ -9634,24 +9698,10 @@ xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix,
     }
     SKIP(2);
 
-    curLength = ctxt->input->end - ctxt->input->cur;
-    if ((tlen > 0) && (curLength >= (size_t)tlen) &&
-        (xmlStrncmp(ctxt->input->cur, ctxt->name, tlen) == 0)) {
-        if ((curLength >= (size_t)(tlen + 1)) &&
-           (ctxt->input->cur[tlen] == '>')) {
-           ctxt->input->cur += tlen + 1;
-           ctxt->input->col += tlen + 1;
-           goto done;
-       }
-       ctxt->input->cur += tlen;
-       ctxt->input->col += tlen;
-       name = (xmlChar*)1;
-    } else {
-       if (prefix == NULL)
-           name = xmlParseNameAndCompare(ctxt, ctxt->name);
-       else
-           name = xmlParseQNameAndCompare(ctxt, ctxt->name, prefix);
-    }
+    if (tag->prefix == NULL)
+        name = xmlParseNameAndCompare(ctxt, ctxt->name);
+    else
+        name = xmlParseQNameAndCompare(ctxt, ctxt->name, tag->prefix);
 
     /*
      * We should definitely be at the ending "S? '>'" part
@@ -9672,26 +9722,23 @@ xmlParseEndTag2(xmlParserCtxtPtr ctxt, const xmlChar *prefix,
      *
      */
     if (name != (xmlChar*)1) {
-        if (name == NULL) name = BAD_CAST "unparseable";
-        if ((line == 0) && (ctxt->node != NULL))
-            line = ctxt->node->line;
+        if (name == NULL) name = BAD_CAST "unparsable";
         xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
                     "Opening and ending tag mismatch: %s line %d and %s\n",
-                               ctxt->name, line, name);
+                               ctxt->name, tag->line, name);
     }
 
     /*
      * SAX: End of Tag
      */
-done:
     if ((ctxt->sax != NULL) && (ctxt->sax->endElementNs != NULL) &&
        (!ctxt->disableSAX))
-       ctxt->sax->endElementNs(ctxt->userData, ctxt->name, prefix, URI);
+       ctxt->sax->endElementNs(ctxt->userData, ctxt->name, tag->prefix,
+                                tag->URI);
 
     spacePop(ctxt);
-    if (nsNr != 0)
-       nsPop(ctxt, nsNr);
-    return;
+    if (tag->nsNr != 0)
+       nsPop(ctxt, tag->nsNr);
 }
 
 /**
@@ -9773,6 +9820,7 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
        sl = l;
        count++;
        if (count > 50) {
+           SHRINK;
            GROW;
             if (ctxt->instate == XML_PARSER_EOF) {
                xmlFree(buf);
@@ -9806,16 +9854,15 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
 }
 
 /**
- * xmlParseContent:
+ * xmlParseContentInternal:
  * @ctxt:  an XML parser context
  *
- * Parse a content:
- *
- * [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
+ * Parse a content sequence. Stops at EOF or '</'. Leaves checking of
+ * unexpected EOF to the caller.
  */
 
-void
-xmlParseContent(xmlParserCtxtPtr ctxt) {
+static void
+xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
     int nameNr = ctxt->nameNr;
 
     GROW;
@@ -9891,6 +9938,30 @@ xmlParseContent(xmlParserCtxtPtr ctxt) {
 }
 
 /**
+ * xmlParseContent:
+ * @ctxt:  an XML parser context
+ *
+ * Parse a content sequence. Stops at EOF or '</'.
+ *
+ * [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*
+ */
+
+void
+xmlParseContent(xmlParserCtxtPtr ctxt) {
+    int nameNr = ctxt->nameNr;
+
+    xmlParseContentInternal(ctxt);
+
+    if ((ctxt->instate != XML_PARSER_EOF) && (ctxt->nameNr > nameNr)) {
+        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
+        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
+        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
+                "Premature end of data in tag %s line %d\n",
+               name, line, NULL);
+    }
+}
+
+/**
  * xmlParseElement:
  * @ctxt:  an XML parser context
  *
@@ -9908,9 +9979,20 @@ void
 xmlParseElement(xmlParserCtxtPtr ctxt) {
     if (xmlParseElementStart(ctxt) != 0)
         return;
-    xmlParseContent(ctxt);
+
+    xmlParseContentInternal(ctxt);
     if (ctxt->instate == XML_PARSER_EOF)
        return;
+
+    if (CUR == 0) {
+        const xmlChar *name = ctxt->nameTab[ctxt->nameNr - 1];
+        int line = ctxt->pushTab[ctxt->nameNr - 1].line;
+        xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_TAG_NOT_FINISHED,
+                "Premature end of data in tag %s line %d\n",
+               name, line, NULL);
+        return;
+    }
+
     xmlParseElementEnd(ctxt);
 }
 
@@ -9969,12 +10051,7 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) {
        spacePop(ctxt);
         return(-1);
     }
-    if (ctxt->sax2)
-        nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr);
-#ifdef LIBXML_SAX1_ENABLED
-    else
-        namePush(ctxt, name);
-#endif /* LIBXML_SAX1_ENABLED */
+    nameNsPush(ctxt, name, prefix, URI, line, ctxt->nsNr - nsNr);
     ret = ctxt->node;
 
 #ifdef LIBXML_VALID_ENABLED
@@ -10067,10 +10144,7 @@ xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
      * parse the end of tag: '</' should be here.
      */
     if (ctxt->sax2) {
-        const xmlChar *prefix = ctxt->pushTab[ctxt->nameNr * 3 - 3];
-        const xmlChar *URI = ctxt->pushTab[ctxt->nameNr * 3 - 2];
-        int nsNr = (ptrdiff_t) ctxt->pushTab[ctxt->nameNr * 3 - 1];
-       xmlParseEndTag2(ctxt, prefix, URI, 0, nsNr, 0);
+       xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
        namePop(ctxt);
     }
 #ifdef LIBXML_SAX1_ENABLED
@@ -11345,6 +11419,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
                const xmlChar *name;
                const xmlChar *prefix = NULL;
                const xmlChar *URI = NULL;
+                int line = ctxt->input->line;
                int nsNr = ctxt->nsNr;
 
                if ((avail < 2) && (ctxt->inputNr == 1))
@@ -11442,12 +11517,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
                    nodePop(ctxt);
                    spacePop(ctxt);
                }
-               if (ctxt->sax2)
-                   nameNsPush(ctxt, name, prefix, URI, ctxt->nsNr - nsNr);
-#ifdef LIBXML_SAX1_ENABLED
-               else
-                   namePush(ctxt, name);
-#endif /* LIBXML_SAX1_ENABLED */
+                nameNsPush(ctxt, name, prefix, URI, line, ctxt->nsNr - nsNr);
 
                ctxt->instate = XML_PARSER_CONTENT;
                 ctxt->progressive = 1;
@@ -11564,11 +11634,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
                    }
                }
                if (ctxt->sax2) {
-                   xmlParseEndTag2(ctxt,
-                           (void *) ctxt->pushTab[ctxt->nameNr * 3 - 3],
-                           (void *) ctxt->pushTab[ctxt->nameNr * 3 - 2], 0,
-                           (int) (ptrdiff_t)
-                                ctxt->pushTab[ctxt->nameNr * 3 - 1], 0);
+                   xmlParseEndTag2(ctxt, &ctxt->pushTab[ctxt->nameNr - 1]);
                    nameNsPop(ctxt);
                }
 #ifdef LIBXML_SAX1_ENABLED
@@ -12230,12 +12296,12 @@ xmldecl_done:
             }
         }
        res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
+        xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
        if (res < 0) {
            ctxt->errNo = XML_PARSER_EOF;
            xmlHaltParser(ctxt);
            return (XML_PARSER_EOF);
        }
-        xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
 #ifdef DEBUG_PUSH
        xmlGenericError(xmlGenericErrorContext, "PP: pushed %d\n", size);
 #endif
@@ -12250,6 +12316,7 @@ xmldecl_done:
                size_t current = ctxt->input->cur - ctxt->input->base;
 
                nbchars = xmlCharEncInput(in, terminate);
+               xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
                if (nbchars < 0) {
                    /* TODO 2.6.0 */
                    xmlGenericError(xmlGenericErrorContext,
@@ -12257,7 +12324,6 @@ xmldecl_done:
                     xmlHaltParser(ctxt);
                    return(XML_ERR_INVALID_ENCODING);
                }
-               xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
            }
        }
     }
@@ -12895,196 +12961,28 @@ xmlParseDTD(const xmlChar *ExternalID, const xmlChar *SystemID) {
 int
 xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
                       const xmlChar *ID, xmlNodePtr *lst) {
-    xmlParserCtxtPtr ctxt;
-    xmlDocPtr newDoc;
-    xmlNodePtr newRoot;
-    xmlSAXHandlerPtr oldsax = NULL;
-    int ret = 0;
-    xmlChar start[4];
-    xmlCharEncoding enc;
+    void *userData;
 
     if (ctx == NULL) return(-1);
-
-    if (((ctx->depth > 40) && ((ctx->options & XML_PARSE_HUGE) == 0)) ||
-        (ctx->depth > 1024)) {
-       return(XML_ERR_ENTITY_LOOP);
-    }
-
-    if (lst != NULL)
-        *lst = NULL;
-    if ((URL == NULL) && (ID == NULL))
-       return(-1);
-    if (ctx->myDoc == NULL) /* @@ relax but check for dereferences */
-       return(-1);
-
-    ctxt = xmlCreateEntityParserCtxtInternal(URL, ID, NULL, ctx);
-    if (ctxt == NULL) {
-       return(-1);
-    }
-
-    oldsax = ctxt->sax;
-    ctxt->sax = ctx->sax;
-    xmlDetectSAX2(ctxt);
-    newDoc = xmlNewDoc(BAD_CAST "1.0");
-    if (newDoc == NULL) {
-       xmlFreeParserCtxt(ctxt);
-       return(-1);
-    }
-    newDoc->properties = XML_DOC_INTERNAL;
-    if (ctx->myDoc->dict) {
-       newDoc->dict = ctx->myDoc->dict;
-       xmlDictReference(newDoc->dict);
-    }
-    if (ctx->myDoc != NULL) {
-       newDoc->intSubset = ctx->myDoc->intSubset;
-       newDoc->extSubset = ctx->myDoc->extSubset;
-    }
-    if (ctx->myDoc->URL != NULL) {
-       newDoc->URL = xmlStrdup(ctx->myDoc->URL);
-    }
-    newRoot = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL);
-    if (newRoot == NULL) {
-       ctxt->sax = oldsax;
-       xmlFreeParserCtxt(ctxt);
-       newDoc->intSubset = NULL;
-       newDoc->extSubset = NULL;
-        xmlFreeDoc(newDoc);
-       return(-1);
-    }
-    xmlAddChild((xmlNodePtr) newDoc, newRoot);
-    nodePush(ctxt, newDoc->children);
-    if (ctx->myDoc == NULL) {
-       ctxt->myDoc = newDoc;
-    } else {
-       ctxt->myDoc = ctx->myDoc;
-       newDoc->children->doc = ctx->myDoc;
-    }
-
-    /*
-     * Get the 4 first bytes and decode the charset
-     * if enc != XML_CHAR_ENCODING_NONE
-     * plug some encoding conversion routines.
-     */
-    GROW
-    if ((ctxt->input->end - ctxt->input->cur) >= 4) {
-       start[0] = RAW;
-       start[1] = NXT(1);
-       start[2] = NXT(2);
-       start[3] = NXT(3);
-       enc = xmlDetectCharEncoding(start, 4);
-       if (enc != XML_CHAR_ENCODING_NONE) {
-           xmlSwitchEncoding(ctxt, enc);
-       }
-    }
-
     /*
-     * Parse a possible text declaration first
-     */
-    if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
-       xmlParseTextDecl(ctxt);
-       /*
-        * An XML-1.0 document can't reference an entity not XML-1.0
-        */
-       if ((xmlStrEqual(ctx->version, BAD_CAST "1.0")) &&
-           (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
-           xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
-                          "Version mismatch between document and entity\n");
-       }
-    }
-
-    /*
-     * If the user provided its own SAX callbacks then reuse the
-     * useData callback field, otherwise the expected setup in a
+     * If the user provided their own SAX callbacks, then reuse the
+     * userData callback field, otherwise the expected setup in a
      * DOM builder is to have userData == ctxt
      */
     if (ctx->userData == ctx)
-        ctxt->userData = ctxt;
+        userData = NULL;
     else
-        ctxt->userData = ctx->userData;
-
-    /*
-     * Doing validity checking on chunk doesn't make sense
-     */
-    ctxt->instate = XML_PARSER_CONTENT;
-    ctxt->validate = ctx->validate;
-    ctxt->valid = ctx->valid;
-    ctxt->loadsubset = ctx->loadsubset;
-    ctxt->depth = ctx->depth + 1;
-    ctxt->replaceEntities = ctx->replaceEntities;
-    if (ctxt->validate) {
-       ctxt->vctxt.error = ctx->vctxt.error;
-       ctxt->vctxt.warning = ctx->vctxt.warning;
-    } else {
-       ctxt->vctxt.error = NULL;
-       ctxt->vctxt.warning = NULL;
-    }
-    ctxt->vctxt.nodeTab = NULL;
-    ctxt->vctxt.nodeNr = 0;
-    ctxt->vctxt.nodeMax = 0;
-    ctxt->vctxt.node = NULL;
-    if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
-    ctxt->dict = ctx->dict;
-    ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
-    ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
-    ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
-    ctxt->dictNames = ctx->dictNames;
-    ctxt->attsDefault = ctx->attsDefault;
-    ctxt->attsSpecial = ctx->attsSpecial;
-    ctxt->linenumbers = ctx->linenumbers;
-
-    xmlParseContent(ctxt);
-
-    ctx->validate = ctxt->validate;
-    ctx->valid = ctxt->valid;
-    if ((RAW == '<') && (NXT(1) == '/')) {
-       xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
-    } else if (RAW != 0) {
-       xmlFatalErr(ctxt, XML_ERR_EXTRA_CONTENT, NULL);
-    }
-    if (ctxt->node != newDoc->children) {
-       xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
-    }
-
-    if (!ctxt->wellFormed) {
-        if (ctxt->errNo == 0)
-           ret = 1;
-       else
-           ret = ctxt->errNo;
-    } else {
-       if (lst != NULL) {
-           xmlNodePtr cur;
-
-           /*
-            * Return the newly created nodeset after unlinking it from
-            * they pseudo parent.
-            */
-           cur = newDoc->children->children;
-           *lst = cur;
-           while (cur != NULL) {
-               cur->parent = NULL;
-               cur = cur->next;
-           }
-            newDoc->children->children = NULL;
-       }
-       ret = 0;
-    }
-    ctxt->sax = oldsax;
-    ctxt->dict = NULL;
-    ctxt->attsDefault = NULL;
-    ctxt->attsSpecial = NULL;
-    xmlFreeParserCtxt(ctxt);
-    newDoc->intSubset = NULL;
-    newDoc->extSubset = NULL;
-    xmlFreeDoc(newDoc);
-
-    return(ret);
+        userData = ctx->userData;
+    return xmlParseExternalEntityPrivate(ctx->myDoc, ctx, ctx->sax,
+                                         userData, ctx->depth + 1,
+                                         URL, ID, lst);
 }
 
 /**
  * xmlParseExternalEntityPrivate:
  * @doc:  the document the chunk pertains to
  * @oldctxt:  the previous parser context if available
- * @sax:  the SAX handler bloc (possibly NULL)
+ * @sax:  the SAX handler block (possibly NULL)
  * @user_data:  The user data returned on SAX callbacks (possibly NULL)
  * @depth:  Used for loop detection, use 0
  * @URL:  the URL for the entity to load
@@ -13127,25 +13025,6 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
     ctxt = xmlCreateEntityParserCtxtInternal(URL, ID, NULL, oldctxt);
     if (ctxt == NULL) return(XML_WAR_UNDECLARED_ENTITY);
     ctxt->userData = ctxt;
-    if (oldctxt != NULL) {
-       ctxt->_private = oldctxt->_private;
-       ctxt->loadsubset = oldctxt->loadsubset;
-       ctxt->validate = oldctxt->validate;
-       ctxt->external = oldctxt->external;
-       ctxt->record_info = oldctxt->record_info;
-       ctxt->node_seq.maximum = oldctxt->node_seq.maximum;
-       ctxt->node_seq.length = oldctxt->node_seq.length;
-       ctxt->node_seq.buffer = oldctxt->node_seq.buffer;
-    } else {
-       /*
-        * Doing validity checking on chunk without context
-        * doesn't make sense
-        */
-       ctxt->_private = NULL;
-       ctxt->validate = 0;
-       ctxt->external = 2;
-       ctxt->loadsubset = 0;
-    }
     if (sax != NULL) {
        oldsax = ctxt->sax;
         ctxt->sax = sax;
@@ -13155,28 +13034,25 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
     xmlDetectSAX2(ctxt);
     newDoc = xmlNewDoc(BAD_CAST "1.0");
     if (newDoc == NULL) {
-       ctxt->node_seq.maximum = 0;
-       ctxt->node_seq.length = 0;
-       ctxt->node_seq.buffer = NULL;
        xmlFreeParserCtxt(ctxt);
        return(XML_ERR_INTERNAL_ERROR);
     }
     newDoc->properties = XML_DOC_INTERNAL;
-    newDoc->intSubset = doc->intSubset;
-    newDoc->extSubset = doc->extSubset;
-    newDoc->dict = doc->dict;
-    xmlDictReference(newDoc->dict);
-
-    if (doc->URL != NULL) {
-       newDoc->URL = xmlStrdup(doc->URL);
+    if (doc) {
+        newDoc->intSubset = doc->intSubset;
+        newDoc->extSubset = doc->extSubset;
+        if (doc->dict) {
+            newDoc->dict = doc->dict;
+            xmlDictReference(newDoc->dict);
+        }
+        if (doc->URL != NULL) {
+            newDoc->URL = xmlStrdup(doc->URL);
+        }
     }
     newRoot = xmlNewDocNode(newDoc, NULL, BAD_CAST "pseudoroot", NULL);
     if (newRoot == NULL) {
        if (sax != NULL)
            ctxt->sax = oldsax;
-       ctxt->node_seq.maximum = 0;
-       ctxt->node_seq.length = 0;
-       ctxt->node_seq.buffer = NULL;
        xmlFreeParserCtxt(ctxt);
        newDoc->intSubset = NULL;
        newDoc->extSubset = NULL;
@@ -13185,8 +13061,12 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
     }
     xmlAddChild((xmlNodePtr) newDoc, newRoot);
     nodePush(ctxt, newDoc->children);
-    ctxt->myDoc = doc;
-    newRoot->doc = doc;
+    if (doc == NULL) {
+        ctxt->myDoc = newDoc;
+    } else {
+        ctxt->myDoc = doc;
+        newRoot->doc = doc;
+    }
 
     /*
      * Get the 4 first bytes and decode the charset
@@ -13210,10 +13090,53 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
      */
     if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
        xmlParseTextDecl(ctxt);
+        /*
+         * An XML-1.0 document can't reference an entity not XML-1.0
+         */
+        if ((xmlStrEqual(oldctxt->version, BAD_CAST "1.0")) &&
+            (!xmlStrEqual(ctxt->input->version, BAD_CAST "1.0"))) {
+            xmlFatalErrMsg(ctxt, XML_ERR_VERSION_MISMATCH,
+                           "Version mismatch between document and entity\n");
+        }
     }
 
     ctxt->instate = XML_PARSER_CONTENT;
     ctxt->depth = depth;
+    if (oldctxt != NULL) {
+       ctxt->_private = oldctxt->_private;
+       ctxt->loadsubset = oldctxt->loadsubset;
+       ctxt->validate = oldctxt->validate;
+       ctxt->valid = oldctxt->valid;
+       ctxt->replaceEntities = oldctxt->replaceEntities;
+        if (oldctxt->validate) {
+            ctxt->vctxt.error = oldctxt->vctxt.error;
+            ctxt->vctxt.warning = oldctxt->vctxt.warning;
+            ctxt->vctxt.userData = oldctxt->vctxt.userData;
+        }
+       ctxt->external = oldctxt->external;
+        if (ctxt->dict) xmlDictFree(ctxt->dict);
+        ctxt->dict = oldctxt->dict;
+        ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
+        ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
+        ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
+        ctxt->dictNames = oldctxt->dictNames;
+        ctxt->attsDefault = oldctxt->attsDefault;
+        ctxt->attsSpecial = oldctxt->attsSpecial;
+        ctxt->linenumbers = oldctxt->linenumbers;
+       ctxt->record_info = oldctxt->record_info;
+       ctxt->node_seq.maximum = oldctxt->node_seq.maximum;
+       ctxt->node_seq.length = oldctxt->node_seq.length;
+       ctxt->node_seq.buffer = oldctxt->node_seq.buffer;
+    } else {
+       /*
+        * Doing validity checking on chunk without context
+        * doesn't make sense
+        */
+       ctxt->_private = NULL;
+       ctxt->validate = 0;
+       ctxt->external = 2;
+       ctxt->loadsubset = 0;
+    }
 
     xmlParseContent(ctxt);
 
@@ -13273,6 +13196,11 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
     if (sax != NULL)
        ctxt->sax = oldsax;
     if (oldctxt != NULL) {
+        ctxt->dict = NULL;
+        ctxt->attsDefault = NULL;
+        ctxt->attsSpecial = NULL;
+        oldctxt->validate = ctxt->validate;
+        oldctxt->valid = ctxt->valid;
         oldctxt->node_seq.maximum = ctxt->node_seq.maximum;
         oldctxt->node_seq.length = ctxt->node_seq.length;
         oldctxt->node_seq.buffer = ctxt->node_seq.buffer;
@@ -13292,7 +13220,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
 /**
  * xmlParseExternalEntity:
  * @doc:  the document the chunk pertains to
- * @sax:  the SAX handler bloc (possibly NULL)
+ * @sax:  the SAX handler block (possibly NULL)
  * @user_data:  The user data returned on SAX callbacks (possibly NULL)
  * @depth:  Used for loop detection, use 0
  * @URL:  the URL for the entity to load
@@ -13318,8 +13246,8 @@ xmlParseExternalEntity(xmlDocPtr doc, xmlSAXHandlerPtr sax, void *user_data,
 
 /**
  * xmlParseBalancedChunkMemory:
- * @doc:  the document the chunk pertains to
- * @sax:  the SAX handler bloc (possibly NULL)
+ * @doc:  the document the chunk pertains to (must not be NULL)
+ * @sax:  the SAX handler block (possibly NULL)
  * @user_data:  The user data returned on SAX callbacks (possibly NULL)
  * @depth:  Used for loop detection, use 0
  * @string:  the input string in UTF8 or ISO-Latin (zero terminated)
@@ -13770,8 +13698,8 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
 #ifdef LIBXML_SAX1_ENABLED
 /**
  * xmlParseBalancedChunkMemoryRecover:
- * @doc:  the document the chunk pertains to
- * @sax:  the SAX handler bloc (possibly NULL)
+ * @doc:  the document the chunk pertains to (must not be NULL)
+ * @sax:  the SAX handler block (possibly NULL)
  * @user_data:  The user data returned on SAX callbacks (possibly NULL)
  * @depth:  Used for loop detection, use 0
  * @string:  the input string in UTF8 or ISO-Latin (zero terminated)
@@ -13842,6 +13770,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
     } else {
        xmlCtxtUseOptionsInternal(ctxt, XML_PARSE_NODICT, NULL);
     }
+    /* doc == NULL is only supported for historic reasons */
     if (doc != NULL) {
        newDoc->intSubset = doc->intSubset;
        newDoc->extSubset = doc->extSubset;
@@ -13858,6 +13787,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
     }
     xmlAddChild((xmlNodePtr) newDoc, newRoot);
     nodePush(ctxt, newRoot);
+    /* doc == NULL is only supported for historic reasons */
     if (doc == NULL) {
        ctxt->myDoc = newDoc;
     } else {
@@ -13927,8 +13857,8 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
     xmlFreeParserCtxt(ctxt);
     newDoc->intSubset = NULL;
     newDoc->extSubset = NULL;
-    if(doc != NULL)
-       newDoc->oldNs = NULL;
+    /* This leaks the namespace list if doc == NULL */
+    newDoc->oldNs = NULL;
     xmlFreeDoc(newDoc);
 
     return(ret);
@@ -14210,7 +14140,7 @@ xmlSAXParseFileWithData(xmlSAXHandlerPtr sax, const char *filename,
 
     if ((ctxt->wellFormed) || recovery) {
         ret = ctxt->myDoc;
-       if (ret != NULL) {
+       if ((ret != NULL) && (ctxt->input->buf != NULL)) {
            if (ctxt->input->buf->compressed > 0)
                ret->compression = 9;
            else
@@ -14741,6 +14671,10 @@ xmlInitParser(void) {
     if (xmlParserInitialized != 0)
        return;
 
+#if defined(_WIN32) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+       atexit(xmlCleanupParser);
+#endif
+
 #ifdef LIBXML_THREAD_ENABLED
     __xmlGlobalInitMutexLock();
     if (xmlParserInitialized == 0) {
@@ -14819,6 +14753,20 @@ xmlCleanupParser(void) {
     xmlParserInitialized = 0;
 }
 
+#if defined(HAVE_ATTRIBUTE_DESTRUCTOR) && !defined(LIBXML_STATIC) && \
+    !defined(_WIN32)
+static void
+ATTRIBUTE_DESTRUCTOR
+xmlDestructor(void) {
+    /*
+     * Calling custom deallocation functions in a destructor can cause
+     * problems, for example with Nokogiri.
+     */
+    if (xmlFree == free)
+        xmlCleanupParser();
+}
+#endif
+
 /************************************************************************
  *                                                                     *
  *     New set (2.6.0) of simpler and more flexible APIs               *
@@ -14907,7 +14855,6 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt)
     ctxt->vctxt.warning = xmlParserValidityWarning;
 #endif
     ctxt->record_info = 0;
-    ctxt->nbChars = 0;
     ctxt->checkIndex = 0;
     ctxt->inSubset = 0;
     ctxt->errNo = XML_ERR_OK;
index b00cd08..cbcfde0 100644 (file)
@@ -105,7 +105,7 @@ xmlCheckVersion(int version) {
 /**
  * xmlErrMemory:
  * @ctxt:  an XML parser context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -165,7 +165,7 @@ __xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr,
  * xmlErrInternal:
  * @ctxt:  an XML parser context
  * @msg:  the error message
- * @str:  error informations
+ * @str:  error information
  *
  * Handle an internal error
  */
@@ -519,8 +519,6 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
         } else
             /* 1-byte code */
             ctxt->input->cur++;
-
-        ctxt->nbChars++;
     } else {
         /*
          * Assume it's a fixed length encoding (1) with
@@ -533,7 +531,6 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
         } else
             ctxt->input->col++;
         ctxt->input->cur++;
-        ctxt->nbChars++;
     }
     if (*ctxt->input->cur == 0)
         xmlParserInputGrow(ctxt->input, INPUT_CHUNK);
@@ -677,7 +674,6 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
            }
            if (*ctxt->input->cur == 0xD) {
                if (ctxt->input->cur[1] == 0xA) {
-                   ctxt->nbChars++;
                    ctxt->input->cur++;
                }
                return(0xA);
@@ -693,7 +689,6 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
     *len = 1;
     if (*ctxt->input->cur == 0xD) {
        if (ctxt->input->cur[1] == 0xA) {
-           ctxt->nbChars++;
            ctxt->input->cur++;
        }
        return(0xA);
@@ -1158,6 +1153,11 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
              * Note: this is a bit dangerous, but that's what it
              * takes to use nearly compatible signature for different
              * encodings.
+             *
+             * FIXME: Encoders might buffer partial byte sequences, so
+             * this probably can't work. We should return an error and
+             * make sure that callers never try to switch the encoding
+             * twice.
              */
             xmlCharEncCloseFunc(input->buf->encoder);
             input->buf->encoder = handler;
@@ -1748,7 +1748,6 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
         ctxt->options |= XML_PARSE_NOENT;
     }
     ctxt->record_info = 0;
-    ctxt->nbChars = 0;
     ctxt->checkIndex = 0;
     ctxt->inSubset = 0;
     ctxt->errNo = XML_ERR_OK;
@@ -1877,7 +1876,7 @@ xmlNewParserCtxt(void)
 
 /************************************************************************
  *                                                                     *
- *             Handling of node informations                           *
+ *             Handling of node information                            *
  *                                                                     *
  ************************************************************************/
 
index c0cb3ad..59d45e0 100755 (executable)
@@ -393,7 +393,7 @@ def print_function_wrapper(name, output, export, include):
                 format_args = format_args + ", &%s" % (arg[0])
             if f == 's#':
                 format_args = format_args + ", &py_buffsize%d" % num_bufs
-                c_args = c_args + "    int py_buffsize%d;\n" % num_bufs
+                c_args = c_args + "    Py_ssize_t  py_buffsize%d;\n" % num_bufs
                 num_bufs = num_bufs + 1
             if c_call != "":
                 c_call = c_call + ", "
@@ -555,6 +555,7 @@ def buildStubs():
     export.write("/* Generated */\n\n")
     wrapper = open("libxml2-py.c", "w")
     wrapper.write("/* Generated */\n\n")
+    wrapper.write("#define PY_SSIZE_T_CLEAN\n")
     wrapper.write("#include <Python.h>\n")
     wrapper.write("#include <libxml/xmlversion.h>\n")
     wrapper.write("#include <libxml/tree.h>\n")
index bc676c4..3b66bd6 100644 (file)
@@ -11,6 +11,7 @@
  *
  * daniel@veillard.com
  */
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <fileobject.h>
 /* #include "config.h" */
@@ -294,7 +295,7 @@ xmlPythonFileReadRaw (void * context, char * buffer, int len) {
        lenread = PyBytes_Size(ret);
        data = PyBytes_AsString(ret);
 #ifdef PyUnicode_Check
-    } else if PyUnicode_Check (ret) {
+    } else if (PyUnicode_Check (ret)) {
 #if PY_VERSION_HEX >= 0x03030000
         Py_ssize_t size;
        const char *tmp;
@@ -359,7 +360,7 @@ xmlPythonFileRead (void * context, char * buffer, int len) {
        lenread = PyBytes_Size(ret);
        data = PyBytes_AsString(ret);
 #ifdef PyUnicode_Check
-    } else if PyUnicode_Check (ret) {
+    } else if (PyUnicode_Check (ret)) {
 #if PY_VERSION_HEX >= 0x03030000
         Py_ssize_t size;
        const char *tmp;
@@ -1048,10 +1049,10 @@ pythonCharacters(void *user_data, const xmlChar * ch, int len)
     if (type != 0) {
         if (type == 1)
             result = PyObject_CallMethod(handler, (char *) "characters",
-                                         (char *) "s#", ch, len);
+                                         (char *) "s#", ch, (Py_ssize_t)len);
         else if (type == 2)
             result = PyObject_CallMethod(handler, (char *) "data",
-                                         (char *) "s#", ch, len);
+                                         (char *) "s#", ch, (Py_ssize_t)len);
         if (PyErr_Occurred())
             PyErr_Print();
         Py_XDECREF(result);
@@ -1078,11 +1079,11 @@ pythonIgnorableWhitespace(void *user_data, const xmlChar * ch, int len)
             result =
                 PyObject_CallMethod(handler,
                                     (char *) "ignorableWhitespace",
-                                    (char *) "s#", ch, len);
+                                    (char *) "s#", ch, (Py_ssize_t)len);
         else if (type == 2)
             result =
                 PyObject_CallMethod(handler, (char *) "data",
-                                    (char *) "s#", ch, len);
+                                    (char *) "s#", ch, (Py_ssize_t)len);
         Py_XDECREF(result);
     }
 }
@@ -1223,11 +1224,11 @@ pythonCdataBlock(void *user_data, const xmlChar * ch, int len)
         if (type == 1)
             result =
                 PyObject_CallMethod(handler, (char *) "cdataBlock",
-                                    (char *) "s#", ch, len);
+                                    (char *) "s#", ch, (Py_ssize_t)len);
         else if (type == 2)
             result =
                 PyObject_CallMethod(handler, (char *) "cdata",
-                                    (char *) "s#", ch, len);
+                                    (char *) "s#", ch, (Py_ssize_t)len);
         if (PyErr_Occurred())
             PyErr_Print();
         Py_XDECREF(result);
index 2466cc9..1e458d1 100644 (file)
@@ -392,7 +392,7 @@ class xmlCore:
         last = property(get_last, None, None, "Last sibling node")
         next = property(get_next, None, None, "Next sibling node")
         prev = property(get_prev, None, None, "Previous sibling node")
-        properties = property(get_properties, None, None, "List of properies")
+        properties = property(get_properties, None, None, "List of properties")
         content = property(get_content, None, None, "Content of this node")
         name = property(get_name, None, None, "Node name")
         type = property(get_type, None, None, "Node type")
index 032b44b..e84faad 100644 (file)
       <info>Create a libxml2 output buffer from a Python file</info>
       <return type='xmlOutputBufferPtr' info="the output buffer"/>
       <arg name='file' type='pythonObject' info='the Python file'/>
-      <arg name='encoding' type='xmlChar *' info='an optionnal encoding'/>
+      <arg name='encoding' type='xmlChar *' info='an optional encoding'/>
     </function>
     <function name='xmlCreateInputBuffer' file='python'>
       <info>Create a libxml2 input buffer from a Python file</info>
       <return type='xmlParserInputBufferPtr' info="the input buffer"/>
       <arg name='file' type='pythonObject' info='the Python file'/>
-      <arg name='encoding' type='xmlChar *' info='an optionnal encoding'/>
+      <arg name='encoding' type='xmlChar *' info='an optional encoding'/>
     </function>
     <function name='xmlSetEntityLoader' file='python'>
       <info>Set the entity resolver as a python function</info>
index 416e384..ac64624 100755 (executable)
@@ -10,7 +10,7 @@ import libxml2
 libxml2.debugMemory(1)
 
 expect="""--> (3) xmlns: URI foo is not absolute
---> (4) Opening and ending tag mismatch: x line 0 and y
+--> (4) Opening and ending tag mismatch: x line 1 and y
 """
 
 err=""
index 079399a..8558248 100755 (executable)
@@ -42,7 +42,7 @@ checkNamespaceDefs(node, 0)
 ns.freeNsList()
 doc.freeDoc()
 
-# Remove a namespace refered to by a child
+# Remove a namespace referred to by a child
 doc = libxml2.newDoc("1.0")
 root = doc.newChild(None, "root", None)
 namespace = root.newNs("http://example.com/sample", "s")
index 8570575..b50180d 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/python -u
+# -*- coding: utf-8 -*-
 #
 # this tests the DTD validation with the XmlTextReader interface
 #
@@ -16,44 +17,131 @@ except:
 # Memory debug specific
 libxml2.debugMemory(1)
 
-err=""
-expect="""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute version
+err = ""
+dir_prefix = "../../test/valid/"
+# This dictionary reflects the contents of the files
+# ../../test/valid/*.xml.err that are not empty, except that
+# the file paths in the messages start with ../../test/
+
+expect = {
+    '766956':
+"""../../test/valid/dtds/766956.dtd:2: parser error : PEReference: expecting ';'
+%ä%ent;
+   ^
+../../test/valid/dtds/766956.dtd:2: parser error : Content error in the external subset
+%ä%ent;
+        ^
+Entity: line 1: 
+value
+^
+""",
+    '781333':
+"""../../test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got 
+<a/>
+    ^
+../../test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child
+
+^
+""",
+    'cond_sect2':
+"""../../test/valid/dtds/cond_sect2.dtd:15: parser error : All markup of the conditional section is not in the same entity
+    %ent;
+         ^
+Entity: line 1: 
+]]>
+^
+../../test/valid/dtds/cond_sect2.dtd:17: parser error : Content error in the external subset
+
+^
+""",
+    'rss':
+"""../../test/valid/rss.xml:177: element rss: validity error : Element rss does not carry attribute version
 </rss>
       ^
-../../test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined
+""",
+    't8':
+"""../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot; %defmiddle; %deftest;
+         ^
+Entity: line 1: 
+&lt;!ELEMENT root (middle) >
+^
+../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot; %defmiddle; %deftest;
+                     ^
+Entity: line 1: 
+&lt;!ELEMENT middle (test) >
+^
+../../test/valid/t8.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot; %defmiddle; %deftest;
+                               ^
+Entity: line 1: 
+&lt;!ELEMENT test (#PCDATA) >
+^
+""",
+    't8a':
+"""../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot;%defmiddle;%deftest;
+         ^
+Entity: line 1: 
+&lt;!ELEMENT root (middle) >
+^
+../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot;%defmiddle;%deftest;
+                    ^
+Entity: line 1: 
+&lt;!ELEMENT middle (test) >
+^
+../../test/valid/t8a.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%defroot;%defmiddle;%deftest;
+                             ^
+Entity: line 1: 
+&lt;!ELEMENT test (#PCDATA) >
+^
+""",
+    'xlink':
+"""../../test/valid/xlink.xml:450: element termdef: validity error : ID dt-arc already defined
        <p><termdef id="dt-arc" term="Arc">An <ter
                                          ^
-../../test/valid/xlink.xml:530: validity error : attribute def line 199 references an unknown ID "dt-xlg"
+validity error : attribute def line 199 references an unknown ID "dt-xlg"
+""",
+}
+
+# Add prefix_dir and extension to the keys
+expect = {"{}{}.xml".format(dir_prefix, key): val for key, val in expect.items()}
 
-^
-"""
 def callback(ctx, str):
     global err
     err = err + "%s" % (str)
 libxml2.registerErrorHandler(callback, "")
 
-valid_files = glob.glob("../../test/valid/*.x*")
+parsing_error_files = ["766956", "cond_sect2", "t8", "t8a"]
+expect_parsing_error = ["{}{}.xml".format(dir_prefix, f) for f in parsing_error_files]
+
+valid_files = glob.glob(dir_prefix + "*.x*")
 valid_files.sort()
 for file in valid_files:
-    if file.find("t8") != -1:
-        continue
-    if file == "../../test/valid/rss.xml":
-        continue
-    if file == "../../test/valid/xlink.xml":
-        continue
+    err = ""
     reader = libxml2.newTextReaderFilename(file)
     #print "%s:" % (file)
     reader.SetParserProp(libxml2.PARSER_VALIDATE, 1)
     ret = reader.Read()
     while ret == 1:
         ret = reader.Read()
-    if ret != 0:
+    if ret != 0 and file not in expect_parsing_error:
         print("Error parsing and validating %s" % (file))
-       #sys.exit(1)
-
-if err != expect:
-    print(err)
-
+        #sys.exit(1)
+    if (err):
+        if not(file in expect and err == expect[file]):
+            print("Error: ", err)
+            if file in expect:
+                print("Expected: ", expect[file])
 #
 # another separate test based on Stephane Bidoul one
 #
index 81d0acc..36ffe5f 100755 (executable)
@@ -25,7 +25,10 @@ class TestCase(unittest.TestCase):
         when the exception is raised, check the libxml2.lastError for
         expected values."""
         # disable the default error handler
-        libxml2.registerErrorHandler(None,None)
+        def noerr(ctx, str):
+            pass
+        # None is not acceptable as function.
+        libxml2.registerErrorHandler(noerr,None)
         try:
             f(*args)
         except exc:
@@ -40,12 +43,12 @@ class TestCase(unittest.TestCase):
                 print("file =",e.file())
                 print("line =",e.line())
                 print()
-            self.failUnlessEqual(domain,e.domain())
-            self.failUnlessEqual(code,e.code())
-            self.failUnlessEqual(message,e.message())
-            self.failUnlessEqual(level,e.level())
-            self.failUnlessEqual(file,e.file())
-            self.failUnlessEqual(line,e.line())
+            self.assertEqual(domain,e.domain())
+            self.assertEqual(code,e.code())
+            self.assertEqual(message,e.message())
+            self.assertEqual(level,e.level())
+            self.assertEqual(file,e.file())
+            self.assertEqual(line,e.line())
         else:
             self.fail("exception %s should have been raised" % exc)
 
@@ -68,8 +71,8 @@ class TestCase(unittest.TestCase):
                         (s,len(s),"dummy.xml",None,0),
                         libxml2.treeError,
                         domain=libxml2.XML_FROM_PARSER,
-                        code=libxml2.XML_ERR_LTSLASH_REQUIRED,
-                        message='EndTag: \'</\' not found\n',
+                        code=libxml2.XML_ERR_TAG_NOT_FINISHED,
+                        message='Premature end of data in tag x line 1\n',
                         level=libxml2.XML_ERR_FATAL,
                         file='dummy.xml',
                         line=3)
index 16c0386..cec9cb0 100755 (executable)
@@ -36,7 +36,7 @@ while i > 0:
         sys.exit(1)
     i = i - 1
 
-#desactivate error messages from the validation
+#deactivate error messages from the validation
 def noerr(ctx, str):
     pass
 
index c2bafeb..ed284ec 100644 (file)
@@ -602,16 +602,16 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
     if (obj == NULL) {
         return (NULL);
     }
-    if PyFloat_Check (obj) {
+    if (PyFloat_Check (obj)) {
         ret = xmlXPathNewFloat((double) PyFloat_AS_DOUBLE(obj));
-    } else if PyLong_Check(obj) {
+    } else if (PyLong_Check(obj)) {
 #ifdef PyLong_AS_LONG
         ret = xmlXPathNewFloat((double) PyLong_AS_LONG(obj));
 #else
         ret = xmlXPathNewFloat((double) PyInt_AS_LONG(obj));
 #endif
 #ifdef PyBool_Check
-    } else if PyBool_Check (obj) {
+    } else if (PyBool_Check (obj)) {
 
         if (obj == Py_True) {
           ret = xmlXPathNewBoolean(1);
@@ -620,14 +620,14 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
           ret = xmlXPathNewBoolean(0);
         }
 #endif
-    } else if PyBytes_Check (obj) {
+    } else if (PyBytes_Check (obj)) {
         xmlChar *str;
 
         str = xmlStrndup((const xmlChar *) PyBytes_AS_STRING(obj),
                          PyBytes_GET_SIZE(obj));
         ret = xmlXPathWrapString(str);
 #ifdef PyUnicode_Check
-    } else if PyUnicode_Check (obj) {
+    } else if (PyUnicode_Check (obj)) {
 #if PY_VERSION_HEX >= 0x03030000
         xmlChar *str;
        const char *tmp;
@@ -650,7 +650,7 @@ libxml_xmlXPathObjectPtrConvert(PyObject *obj)
        ret = xmlXPathWrapString(str);
 #endif
 #endif
-    } else if PyList_Check (obj) {
+    } else if (PyList_Check (obj)) {
         int i;
         PyObject *node;
         xmlNodePtr cur;
index 13fd954..0ceecb5 100644 (file)
--- a/relaxng.c
+++ b/relaxng.c
@@ -430,7 +430,7 @@ struct _xmlRelaxNGDocument {
 /**
  * xmlRngPErrMemory:
  * @ctxt:  an Relax-NG parser context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -465,7 +465,7 @@ xmlRngPErrMemory(xmlRelaxNGParserCtxtPtr ctxt, const char *extra)
 /**
  * xmlRngVErrMemory:
  * @ctxt:  a Relax-NG validation context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -1409,7 +1409,7 @@ xmlRelaxNGFreeValidState(xmlRelaxNGValidCtxtPtr ctxt,
  * @ctxt: a RelaxNG parser context
  * @flags: a set of flags values
  *
- * Semi private function used to pass informations to a parser context
+ * Semi private function used to pass information to a parser context
  * which are a combination of xmlRelaxNGParserFlag .
  *
  * Returns 0 if success and -1 in case of error
@@ -8165,7 +8165,7 @@ xmlRelaxNGElemPop(xmlRelaxNGValidCtxtPtr ctxt)
  @ @inputdata:  callback data, the Relax NG validation context
  *
  * Handle the callback and if needed validate the element children.
- * some of the in/out informations are passed via the context in @inputdata.
+ * some of the in/out information are passed via the context in @inputdata.
  */
 static void
 xmlRelaxNGValidateProgressiveCallback(xmlRegExecCtxtPtr exec
@@ -11000,7 +11000,7 @@ xmlRelaxNGFreeValidCtxt(xmlRelaxNGValidCtxtPtr ctxt)
  * @warn: the warning function
  * @ctx: the functions context
  *
- * Set the error and warning callback informations
+ * Set the error and warning callback information
  */
 void
 xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
@@ -11042,7 +11042,7 @@ xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
  * @warn: the warning function result
  * @ctx: the functions context result
  *
- * Get the error and warning callback informations
+ * Get the error and warning callback information
  *
  * Returns -1 in case of error and 0 otherwise
  */
index 4f21f62..3974ca9 100644 (file)
@@ -1,2 +1,2 @@
-<!DOCTYPE >
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
 
index 060433a..bcb253e 100644 (file)
@@ -1,16 +1,7 @@
-./test/HTML/758606.html:1: HTML parser error : Comment not terminated 
-<!--
+./test/HTML/758606.html:1: HTML parser error : Invalid char in comment 0xC
 <!--\f<!doctype
-    ^
-./test/HTML/758606.html:1: HTML parser error : Invalid char in CDATA 0xC
-<!--\f<!doctype
-    ^
-./test/HTML/758606.html:1: HTML parser error : Misplaced DOCTYPE declaration
-<!--\f<!doctype
-     ^
-./test/HTML/758606.html:2: HTML parser error : htmlParseDocTypeDecl : no DOCTYPE name !
-
-^
-./test/HTML/758606.html:2: HTML parser error : DOCTYPE improperly terminated
+       ^
+./test/HTML/758606.html:2: HTML parser error : Comment not terminated 
+<!--<!doctyp
 
 ^
index d44a5cf..a21a9f8 100644 (file)
@@ -1,10 +1,6 @@
 SAX.setDocumentLocator()
 SAX.startDocument()
+SAX.error: Invalid char in comment 0xC
 SAX.error: Comment not terminated 
-<!--
-SAX.error: Invalid char in CDATA 0xC
-SAX.error: Misplaced DOCTYPE declaration
-SAX.error: htmlParseDocTypeDecl : no DOCTYPE name !
-SAX.error: DOCTYPE improperly terminated
-SAX.internalSubset((null), , )
+<!--<!doctyp
 SAX.endDocument()
index 273816a..3974ca9 100644 (file)
@@ -1,2 +1,2 @@
-<!DOCTYPE >
-<html><body><p>&#145;</p></body></html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+
index 4be039f..88bcde6 100644 (file)
@@ -1,16 +1,7 @@
-./test/HTML/758606_2.html:1: HTML parser error : Comment not terminated 
-<!--
-<!--\f\91<!dOctYPE
-    ^
-./test/HTML/758606_2.html:1: HTML parser error : Invalid char in CDATA 0xC
-<!--\f\91<!dOctYPE
-    ^
-./test/HTML/758606_2.html:1: HTML parser error : Misplaced DOCTYPE declaration
+./test/HTML/758606_2.html:1: HTML parser error : Invalid char in comment 0xC
 \91<!dOctYPE
-  ^
-./test/HTML/758606_2.html:2: HTML parser error : htmlParseDocTypeDecl : no DOCTYPE name !
-
-^
-./test/HTML/758606_2.html:2: HTML parser error : DOCTYPE improperly terminated
+   ^
+./test/HTML/758606_2.html:2: HTML parser error : Comment not terminated 
+<!--\91<!dOctYP
 
 ^
index 80ff3d7..8a46d9c 100644 (file)
@@ -1,17 +1,6 @@
 SAX.setDocumentLocator()
 SAX.startDocument()
+SAX.error: Invalid char in comment 0xC
 SAX.error: Comment not terminated 
-<!--
-SAX.error: Invalid char in CDATA 0xC
-SAX.startElement(html)
-SAX.startElement(body)
-SAX.startElement(p)
-SAX.characters(&#145;, 2)
-SAX.error: Misplaced DOCTYPE declaration
-SAX.error: htmlParseDocTypeDecl : no DOCTYPE name !
-SAX.error: DOCTYPE improperly terminated
-SAX.internalSubset((null), , )
-SAX.endElement(p)
-SAX.endElement(body)
-SAX.endElement(html)
+<!--\91<!dOctYP
 SAX.endDocument()
diff --git a/result/HTML/chunked_attr.html b/result/HTML/chunked_attr.html
new file mode 100644 (file)
index 0000000..2fd71a6
--- /dev/null
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<!--
+This tests internal state tracking of the push parser and assumes a chunk
+size of 4096 (or a divisor of 4096) and an initial chunk of size 4.
+Make sure that the first '<' in the attribute value ends up near
+offset 4100.
+-->
+<body>
+<p>
+Filler bytes follow:
+
+      100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+     1000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+     2000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+xxx
+</p>
+<div fill1="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" onmouseover="x&lt;b&gt;text&lt;/b&gt;x" fill2="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill3="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill4="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill5="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789" fill6="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789">
+</div>
+</body>
+</html>
diff --git a/result/HTML/chunked_attr.html.err b/result/HTML/chunked_attr.html.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/HTML/chunked_attr.html.sax b/result/HTML/chunked_attr.html.sax
new file mode 100644 (file)
index 0000000..5f9e970
--- /dev/null
@@ -0,0 +1,41 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+, 1)
+SAX.comment(
+This tests internal state tracking of the push parser and assumes a chunk
+size of 4096 (or a divisor of 4096) and an initial chunk of size 4.
+Make sure that the first '<' in the attribute value ends up near
+offset 4100.
+)
+SAX.characters(
+, 1)
+SAX.startElement(body)
+SAX.characters(
+, 1)
+SAX.startElement(p)
+SAX.characters(
+Filler bytes follow:
+
+      1, 1000)
+SAX.characters(89 123456789 123456789
+      1, 1000)
+SAX.characters(89 123456789 123456789
+      1, 827)
+SAX.endElement(p)
+SAX.characters(
+, 1)
+SAX.startElement(div, fill1='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', onmouseover='x&lt;b&gt;text&lt;/b&gt;x', fill2='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill3='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill4='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill5='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789', fill6='123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789')
+SAX.characters(
+, 1)
+SAX.endElement(div)
+SAX.characters(
+, 1)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
diff --git a/result/HTML/comments.html b/result/HTML/comments.html
new file mode 100644 (file)
index 0000000..973050c
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+  <body>
+    <div>
+      <h3>
+        <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+          Incorrectly closed comment
+        </a>
+      </h3>
+      <div>
+        <!--incorrectly closed comment--><span id="under-test">whatwg guidance is that this should be a DOM node</span><!--correctly closed comment-->
+      </div>
+    </div>
+  </body>
+</html>
diff --git a/result/HTML/comments.html.err b/result/HTML/comments.html.err
new file mode 100644 (file)
index 0000000..5bb3dee
--- /dev/null
@@ -0,0 +1,3 @@
+./test/HTML/comments.html:10: HTML parser error : Comment incorrectly closed by '--!>'
+        <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is
+                                         ^
diff --git a/result/HTML/comments.html.sax b/result/HTML/comments.html.sax
new file mode 100644 (file)
index 0000000..ee8fcd7
--- /dev/null
@@ -0,0 +1,46 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+  , 3)
+SAX.startElement(body)
+SAX.characters(
+    , 5)
+SAX.startElement(div)
+SAX.characters(
+      , 7)
+SAX.startElement(h3)
+SAX.characters(
+        , 9)
+SAX.startElement(a, href='https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment')
+SAX.characters(
+          Incorrectly closed , 46)
+SAX.endElement(a)
+SAX.characters(
+      , 7)
+SAX.endElement(h3)
+SAX.characters(
+      , 7)
+SAX.startElement(div)
+SAX.characters(
+        , 9)
+SAX.error: Comment incorrectly closed by '--!>'SAX.comment(incorrectly closed comment)
+SAX.startElement(span, id='under-test')
+SAX.characters(whatwg guidance is that this s, 49)
+SAX.endElement(span)
+SAX.comment(correctly closed comment)
+SAX.characters(
+      , 7)
+SAX.endElement(div)
+SAX.characters(
+    , 5)
+SAX.endElement(div)
+SAX.characters(
+  , 3)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
diff --git a/result/HTML/comments2.html b/result/HTML/comments2.html
new file mode 100644 (file)
index 0000000..eb077ac
--- /dev/null
@@ -0,0 +1,15 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+  <body>
+    <div>
+      <h3>
+        <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+          Incorrectly closed comment without a correctly closed comment
+        </a>
+      </h3>
+      <div>
+        <!--incorrectly closed comment--><span id="under-test">whatwg guidance is that this should be a DOM node</span>
+      </div>
+    </div>
+  </body>
+</html>
diff --git a/result/HTML/comments2.html.err b/result/HTML/comments2.html.err
new file mode 100644 (file)
index 0000000..8d1f592
--- /dev/null
@@ -0,0 +1,3 @@
+./test/HTML/comments2.html:10: HTML parser error : Comment incorrectly closed by '--!>'
+        <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is
+                                         ^
diff --git a/result/HTML/comments2.html.sax b/result/HTML/comments2.html.sax
new file mode 100644 (file)
index 0000000..d694f04
--- /dev/null
@@ -0,0 +1,45 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+  , 3)
+SAX.startElement(body)
+SAX.characters(
+    , 5)
+SAX.startElement(div)
+SAX.characters(
+      , 7)
+SAX.startElement(h3)
+SAX.characters(
+        , 9)
+SAX.startElement(a, href='https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment')
+SAX.characters(
+          Incorrectly closed , 81)
+SAX.endElement(a)
+SAX.characters(
+      , 7)
+SAX.endElement(h3)
+SAX.characters(
+      , 7)
+SAX.startElement(div)
+SAX.characters(
+        , 9)
+SAX.error: Comment incorrectly closed by '--!>'SAX.comment(incorrectly closed comment)
+SAX.startElement(span, id='under-test')
+SAX.characters(whatwg guidance is that this s, 49)
+SAX.endElement(span)
+SAX.characters(
+      , 7)
+SAX.endElement(div)
+SAX.characters(
+    , 5)
+SAX.endElement(div)
+SAX.characters(
+  , 3)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
index e9d5e44..2cc68b9 100644 (file)
@@ -521,7 +521,6 @@ eval("page" + id + " = window.open(URL, '" + id + "', 'toolbars=0, scrollbars=0,
                                                        document.write("ype=js&size=100x90&url=http://www.goto.com/");\r
                                                        document.write("d/search/ssn/&target=_blank&Partner=SSN8042");\r
                                                        document.write("DF8478957377>");\r
-                                                       document.write("RIPT>");\r
                                                        } else {\r
                                                        document.write("<A TARGET=_blank ");\r
                                                        document.write("HREF=http://www.goto.com/d/search/ssn/?from");\r
index cdf715a..5e2491d 100644 (file)
@@ -46,9 +46,9 @@ om/ad_static.asp?pid=2097&sid=1881&asid=7708"></a></IFRAME></CENTER></LI></FONT>
 ./test/HTML/doc3.htm:803: HTML parser error : End tag : expected '>'
                                                        document.write("DF8478957377></SC");
                                                                                         ^
-./test/HTML/doc3.htm:803: HTML parser error : Unexpected end tag : sc
-                                                       document.write("DF8478957377></SC");
-                                                                                        ^
+./test/HTML/doc3.htm:804: HTML parser error : Unexpected end tag : sc
+                                                       document.write("RIPT>");
+                                                                            ^
 ./test/HTML/doc3.htm:811: HTML parser error : Unexpected end tag : a
                                                        document.write("ype=gif&size=100x90></A>");
                                                                                                ^
index fb33cf2..9237ad3 100644 (file)
@@ -2700,7 +2700,8 @@ SAX.cdata(");
 SAX.error: End tag : expected '>'
 SAX.error: Unexpected end tag : sc
 SAX.cdata(");\r
-                                                       document.write("RI, 361)
+                                                       } else {\r
+                                                       d, 328)
 SAX.error: Unexpected end tag : a
 SAX.cdata(");\r
                                                        }\r
index 74d366e..3da303f 100644 (file)
@@ -462,13 +462,13 @@ or <a href="/news/pointcast/0,1366,,00.html">PointCast</a></font><br>
 
 <font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/school/0,1383,,00.html">Making the Grade</a></b></font><br><font size="2" face="Arial, Helvetica, sans-serif"><font size="1" face="Arial, Geneva, sans-serif" color="#000000">Reading, writing, and ROM.  <br><i>Sponsored by <a href="http://r.hotwired.com/r/wn_sch_r_nav_uop/http://ads25.focalink.com/SmartBanner/page?12630.53" style="text-decoration:none"><font color="#000000">U of Phoenix</font></a></i></font><br><br> 
 
-<font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/infostructure/0,1377,,00.html">Infostructure</a></b></font><br><font size="1" face="Arial, Helvetica, sans-serif" color="#000000">An IS/IT resource <br><i>Sponsored by <a href="http://r.wired.com/r/wn_is_r_ssec/http://ad.doubleclick.net/clk;653163;3599571;s?http://www.sprintbiz.com/s%0Aervlet/appservlet?from=/wired/sprint/&amp;template=/security/security.html&amp;SITE=%0Awired.com&amp;BANNER=Sprint" style="text-decoration:none"><font color="#000000">Sprint</font></a></i></font></font><br><br> 
+<font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/infostructure/0,1377,,00.html">Infostructure</a></b></font><br><font size="1" face="Arial, Helvetica, sans-serif" color="#000000">An IS/IT resource <br><i>Sponsored by <a href="http://r.wired.com/r/wn_is_r_ssec/http://ad.doubleclick.net/clk;653163;3599571;s?http://www.sprintbiz.com/s%0Aervlet/appservlet?from=/wired/sprint/&amp;template=/security/security.html&amp;SITE=%0Awired.com&amp;BANNER=Sprint" style="text-decoration:none"><font color="#000000">Sprint</font></a></i></font><br><br> 
 
 <font size="2" face="Arial,Helvetica, sans-serif"><b><a href="/news/y2k/0,1360,,00.html">Y2K Watch</a></b></font><br><font size="2" face="Arial, Helvetica, sans-serif"><font size="1" face="Arial, Geneva, sans-serif" color="#000000">Tick... Tick... Tick...</font><br><br> 
 
 <font face="Arial, Helvetica, sans-serif" size="2"><b><i><a href="/news/special_reports/1,1293,,00.html">More Hoo-Ha</a></i></b></font><br>&nbsp;<br>
 
-</font></font></font></font></font></font></font></font>
+</font></font></font></font></font></font></font></font></font>
 </td>
 </tr>
 <!-- start of Gen News -->
index 70db11b..116bbd2 100644 (file)
@@ -244,6 +244,9 @@ com&BANNER=Sprint" style="text-decoration:none"><font color="#000000">Sprint</a>
 ./test/HTML/wired.html:414: HTML parser error : Opening and ending tag mismatch: td and font
 </td>
      ^
+./test/HTML/wired.html:414: HTML parser error : Opening and ending tag mismatch: td and font
+</td>
+     ^
 ./test/HTML/wired.html:432: HTML parser error : htmlParseEntityRef: expecting ';'
 href="http://www.lycos.com/news/flash/hitlerbunker.html?v=wn1015&lpv=1">Lycos</a
                                                                     ^
index d5b1629..bb78765 100644 (file)
@@ -1962,7 +1962,6 @@ SAX.endElement(a)
 SAX.endElement(i)
 SAX.error: End tag : expected '>'
 SAX.endElement(font)
-SAX.endElement(font)
 SAX.startElement(br)
 SAX.endElement(br)
 SAX.startElement(br)
@@ -2023,6 +2022,8 @@ SAX.error: Opening and ending tag mismatch: td and font
 SAX.endElement(font)
 SAX.error: Opening and ending tag mismatch: td and font
 SAX.endElement(font)
+SAX.error: Opening and ending tag mismatch: td and font
+SAX.endElement(font)
 SAX.endElement(td)
 SAX.characters(
 , 1)
diff --git a/result/XInclude/fallback3.xml b/result/XInclude/fallback3.xml
new file mode 100644 (file)
index 0000000..b423551
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<a>
+    <doc xml:base="../ents/something.xml">
+<p>something</p>
+<p>really</p>
+<p>simple</p>
+</doc>
+</a>
diff --git a/result/XInclude/fallback3.xml.err b/result/XInclude/fallback3.xml.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/XInclude/fallback3.xml.rdr b/result/XInclude/fallback3.xml.rdr
new file mode 100644 (file)
index 0000000..aa2f137
--- /dev/null
@@ -0,0 +1,25 @@
+0 1 a 0 0
+1 14 #text 0 1 
+    
+1 1 doc 0 0
+2 14 #text 0 1 
+
+2 1 p 0 0
+3 3 #text 0 1 something
+2 15 p 0 0
+2 14 #text 0 1 
+
+2 1 p 0 0
+3 3 #text 0 1 really
+2 15 p 0 0
+2 14 #text 0 1 
+
+2 1 p 0 0
+3 3 #text 0 1 simple
+2 15 p 0 0
+2 14 #text 0 1 
+
+1 15 doc 0 0
+1 14 #text 0 1 
+
+0 15 a 0 0
diff --git a/result/XInclude/fallback4.xml b/result/XInclude/fallback4.xml
new file mode 100644 (file)
index 0000000..9883fd5
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<a>
+    
+            <doc xml:base="../ents/something.xml">
+<p>something</p>
+<p>really</p>
+<p>simple</p>
+</doc>
+        
+</a>
diff --git a/result/XInclude/fallback4.xml.err b/result/XInclude/fallback4.xml.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/XInclude/fallback4.xml.rdr b/result/XInclude/fallback4.xml.rdr
new file mode 100644 (file)
index 0000000..628b951
--- /dev/null
@@ -0,0 +1,29 @@
+0 1 a 0 0
+1 14 #text 0 1 
+    
+1 14 #text 0 1 
+            
+1 1 doc 0 0
+2 14 #text 0 1 
+
+2 1 p 0 0
+3 3 #text 0 1 something
+2 15 p 0 0
+2 14 #text 0 1 
+
+2 1 p 0 0
+3 3 #text 0 1 really
+2 15 p 0 0
+2 14 #text 0 1 
+
+2 1 p 0 0
+3 3 #text 0 1 simple
+2 15 p 0 0
+2 14 #text 0 1 
+
+1 15 doc 0 0
+1 14 #text 0 1 
+        
+1 14 #text 0 1 
+
+0 15 a 0 0
diff --git a/result/XInclude/fallback5.xml b/result/XInclude/fallback5.xml
new file mode 100644 (file)
index 0000000..0ba503d
--- /dev/null
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<a>
+   <elem/>
+   
+     <elem/>
+     
+       <elem/>
+       
+         <elem/>
+         
+           <elem/>
+           
+             <elem/>
+             
+               <elem/>
+               
+                 <elem/>
+                 
+                   <elem/>
+                   
+                     <elem/>
+                     
+                       <elem/>
+                       
+                         <elem/>
+                         
+                           <elem/>
+                           
+                             <elem/>
+                             
+                               <elem/>
+                               
+                                 <elem/>
+                                
+                              
+                            
+                          
+                        
+                      
+                    
+                  
+                
+              
+            
+          
+        
+      
+    
+  
+</a>
diff --git a/result/XInclude/fallback5.xml.rdr b/result/XInclude/fallback5.xml.rdr
new file mode 100644 (file)
index 0000000..0e1dab7
--- /dev/null
@@ -0,0 +1,116 @@
+0 1 a 0 0
+1 14 #text 0 1 
+1 14 #text 0 1 
+   
+1 1 elem 1 0
+1 14 #text 0 1 
+   
+1 14 #text 0 1 
+     
+1 1 elem 1 0
+1 14 #text 0 1 
+     
+1 14 #text 0 1 
+       
+1 1 elem 1 0
+1 14 #text 0 1 
+       
+1 14 #text 0 1 
+         
+1 1 elem 1 0
+1 14 #text 0 1 
+         
+1 14 #text 0 1 
+           
+1 1 elem 1 0
+1 14 #text 0 1 
+           
+1 14 #text 0 1 
+             
+1 1 elem 1 0
+1 14 #text 0 1 
+             
+1 14 #text 0 1 
+               
+1 1 elem 1 0
+1 14 #text 0 1 
+               
+1 14 #text 0 1 
+                 
+1 1 elem 1 0
+1 14 #text 0 1 
+                 
+1 14 #text 0 1 
+                   
+1 1 elem 1 0
+1 14 #text 0 1 
+                   
+1 14 #text 0 1 
+                     
+1 1 elem 1 0
+1 14 #text 0 1 
+                     
+1 14 #text 0 1 
+                       
+1 1 elem 1 0
+1 14 #text 0 1 
+                       
+1 14 #text 0 1 
+                         
+1 1 elem 1 0
+1 14 #text 0 1 
+                         
+1 14 #text 0 1 
+                           
+1 1 elem 1 0
+1 14 #text 0 1 
+                           
+1 14 #text 0 1 
+                             
+1 1 elem 1 0
+1 14 #text 0 1 
+                             
+1 14 #text 0 1 
+                               
+1 1 elem 1 0
+1 14 #text 0 1 
+                               
+1 14 #text 0 1 
+                                 
+1 1 elem 1 0
+1 14 #text 0 1 
+                                
+1 14 #text 0 1 
+                              
+1 14 #text 0 1 
+                            
+1 14 #text 0 1 
+                          
+1 14 #text 0 1 
+                        
+1 14 #text 0 1 
+                      
+1 14 #text 0 1 
+                    
+1 14 #text 0 1 
+                  
+1 14 #text 0 1 
+                
+1 14 #text 0 1 
+              
+1 14 #text 0 1 
+            
+1 14 #text 0 1 
+          
+1 14 #text 0 1 
+        
+1 14 #text 0 1 
+      
+1 14 #text 0 1 
+    
+1 14 #text 0 1 
+  
+1 14 #text 0 1 
+
+0 15 a 0 0
diff --git a/result/XInclude/fallback6.xml b/result/XInclude/fallback6.xml
new file mode 100644 (file)
index 0000000..2b5d411
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0"?>
diff --git a/result/XInclude/fallback6.xml.rdr b/result/XInclude/fallback6.xml.rdr
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/XInclude/ns1.xml b/result/XInclude/ns1.xml
new file mode 100644 (file)
index 0000000..ab41fb7
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<doc xmlns:xi="http://www.w3.org/2001/XInclude">
+    <ns:elem xmlns:ns="urn:foo" xml:id="a"/>
+    <elem xmlns:ns="urn:foo">
+        <ns:elem xml:id="a"/>
+    </elem>
+    
+            <ns:elem xmlns:ns="urn:bar"/>
+        
+</doc>
diff --git a/result/XInclude/ns1.xml.rdr b/result/XInclude/ns1.xml.rdr
new file mode 100644 (file)
index 0000000..f23702f
--- /dev/null
@@ -0,0 +1,23 @@
+0 1 doc 0 0
+1 14 #text 0 1 
+    
+1 1 ns:elem 1 0
+1 14 #text 0 1 
+    
+1 1 elem 0 0
+2 14 #text 0 1 
+        
+2 1 ns:elem 1 0
+2 14 #text 0 1 
+    
+1 15 elem 0 0
+1 14 #text 0 1 
+    
+1 14 #text 0 1 
+            
+1 1 ns:elem 1 0
+1 14 #text 0 1 
+        
+1 14 #text 0 1 
+
+0 15 doc 0 0
index afcef5f..6079637 100644 (file)
@@ -5,8 +5,7 @@
 1 1 test 1 0
 1 14 #text 0 1 
     
-1 1 test 0 0
-1 15 test 0 0
+1 1 test 1 0
 1 14 #text 0 1 
 
 0 15 x 0 0
diff --git a/result/ent6hex b/result/ent6hex
new file mode 100644 (file)
index 0000000..6d59df9
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY lt "&#x26;#x3c;">
+<!ENTITY gt "&#x26;#x3E;">
+<!ENTITY amp "&#x26;#x26;">
+<!ENTITY apos "&#x26;#x27;">
+<!ENTITY quot "&#x26;#x22;">
+]>
+<doc/>
diff --git a/result/ent6hex.rde b/result/ent6hex.rde
new file mode 100644 (file)
index 0000000..9b0a34d
--- /dev/null
@@ -0,0 +1,2 @@
+0 10 doc 0 0
+0 1 doc 1 0
diff --git a/result/ent6hex.rdr b/result/ent6hex.rdr
new file mode 100644 (file)
index 0000000..9b0a34d
--- /dev/null
@@ -0,0 +1,2 @@
+0 10 doc 0 0
+0 1 doc 1 0
diff --git a/result/ent6hex.sax b/result/ent6hex.sax
new file mode 100644 (file)
index 0000000..df844cd
--- /dev/null
@@ -0,0 +1,17 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, , )
+SAX.entityDecl(lt, 1, (null), (null), &#x3c;)
+SAX.getEntity(lt)
+SAX.entityDecl(gt, 1, (null), (null), &#x3E;)
+SAX.getEntity(gt)
+SAX.entityDecl(amp, 1, (null), (null), &#x26;)
+SAX.getEntity(amp)
+SAX.entityDecl(apos, 1, (null), (null), &#x27;)
+SAX.getEntity(apos)
+SAX.entityDecl(quot, 1, (null), (null), &#x22;)
+SAX.getEntity(quot)
+SAX.externalSubset(doc, , )
+SAX.startElement(doc)
+SAX.endElement(doc)
+SAX.endDocument()
diff --git a/result/ent6hex.sax2 b/result/ent6hex.sax2
new file mode 100644 (file)
index 0000000..6c9df2e
--- /dev/null
@@ -0,0 +1,17 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, , )
+SAX.entityDecl(lt, 1, (null), (null), &#x3c;)
+SAX.getEntity(lt)
+SAX.entityDecl(gt, 1, (null), (null), &#x3E;)
+SAX.getEntity(gt)
+SAX.entityDecl(amp, 1, (null), (null), &#x26;)
+SAX.getEntity(amp)
+SAX.entityDecl(apos, 1, (null), (null), &#x27;)
+SAX.getEntity(apos)
+SAX.entityDecl(quot, 1, (null), (null), &#x22;)
+SAX.getEntity(quot)
+SAX.externalSubset(doc, , )
+SAX.startElementNs(doc, NULL, NULL, 0, 0, 0)
+SAX.endElementNs(doc, NULL, NULL)
+SAX.endDocument()
index 38b9f43..2206146 100644 (file)
@@ -12,8 +12,7 @@
 2 1 c 0 0
 2 15 c 0 0
 2 3 #text 0 1 ,
-2 1 d 0 0
-2 15 d 0 0
+2 1 d 1 0
 1 15 ent 0 0
 1 14 #text 0 1 
    
 2 1 c 0 0
 2 15 c 0 0
 2 3 #text 0 1 ,
-2 1 d 0 0
-2 15 d 0 0
+2 1 d 1 0
 1 15 ent 0 0
 1 14 #text 0 1 
 
diff --git a/result/errors/754946.xml.ent b/result/errors/754946.xml.ent
new file mode 100644 (file)
index 0000000..be77781
--- /dev/null
@@ -0,0 +1,20 @@
+./test/errors/754946.xml:3: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+  %SYSTEM;
+          ^
+Entity: line 1: 
+A<lbbbbbbbbbbbbbbbbbbb_
+^
+./test/errors/754946.xml:4: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+  <![
+  ^
+./test/errors/754946.xml:4: parser error : DOCTYPE improperly terminated
+  <![
+  ^
+./test/errors/754946.xml:4: parser error : StartTag: invalid element name
+  <![
+   ^
+./test/errors/754946.xml:4: parser error : Extra content at the end of the document
+  <![
+   ^
diff --git a/result/errors/754947.xml.ent b/result/errors/754947.xml.ent
new file mode 100644 (file)
index 0000000..f45cb5a
--- /dev/null
@@ -0,0 +1,7 @@
+./test/errors/754947.xml:1: parser error : Input is not proper UTF-8, indicate encoding !
+Bytes: 0xEE 0x5D 0x5D 0x3E
+<d><![CDATA[0000000000000î]]>
+                         ^
+./test/errors/754947.xml:1: parser error : Premature end of data in tag d line 1
+<d><![CDATA[0000000000000î]]>
+                             ^
index 51e9b4e..f45cb5a 100644 (file)
@@ -2,6 +2,6 @@
 Bytes: 0xEE 0x5D 0x5D 0x3E
 <d><![CDATA[0000000000000î]]>
                          ^
-./test/errors/754947.xml:1: parser error : EndTag: '</' not found
+./test/errors/754947.xml:1: parser error : Premature end of data in tag d line 1
 <d><![CDATA[0000000000000î]]>
                              ^
diff --git a/result/errors/758588.xml.ent b/result/errors/758588.xml.ent
new file mode 100644 (file)
index 0000000..dfa59bc
--- /dev/null
@@ -0,0 +1,9 @@
+./test/errors/758588.xml:1: namespace error : Namespace prefix a-340282366920938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867209384634725979468672093846347259794686720938463472597946867261d on a is not defined
+63472597946867209384634725979468672093846347259794686720938463472597946867261d:a
+                                                                               ^
+./test/errors/758588.xml:1: parser error : expected '>'
+2597946867209384634725979468672093846347259794686720938463472597946867261d:a></a
+                                                                               ^
+./test/errors/758588.xml:1: parser error : Opening and ending tag mismatch: a line 1 and a
+2597946867209384634725979468672093846347259794686720938463472597946867261d:a></a
+                                                                               ^
diff --git a/result/errors/759020.xml.ent b/result/errors/759020.xml.ent
new file mode 100644 (file)
index 0000000..a0d3051
--- /dev/null
@@ -0,0 +1,6 @@
+./test/errors/759020.xml:3: namespace warning : xmlns: URI 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 is not absolute
+0000000000000000000000000000000000000000000000000000000000000000000000000000000'
+                                                                               ^
+./test/errors/759020.xml:46: parser error : Couldn't find end of Start Tag s00 line 2
+                                                                   
+                                                                   ^
diff --git a/result/errors/759398.xml.ent b/result/errors/759398.xml.ent
new file mode 100644 (file)
index 0000000..f6036a3
--- /dev/null
@@ -0,0 +1,12 @@
+./test/errors/759398.xml:210: parser error : StartTag: invalid element name
+need to worry about parsers whi<! don't expand PErefs finding
+                                ^
+./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 308 and termdef
+and provide access to their content and structure.</termdef> <termdef
+                                                            ^
+./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 50 and p
+data and the information it must provide to the application.</p>
+                                                                ^
+./test/errors/759398.xml:316: parser error : Extra content at the end of the document
+<div2 id='sec-origin-goals'>
+^
index bc9e5e0..f6036a3 100644 (file)
@@ -1,10 +1,10 @@
 ./test/errors/759398.xml:210: parser error : StartTag: invalid element name
 need to worry about parsers whi<! don't expand PErefs finding
                                 ^
-./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 205 and termdef
+./test/errors/759398.xml:309: parser error : Opening and ending tag mismatch: №№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№№m line 308 and termdef
 and provide access to their content and structure.</termdef> <termdef
                                                             ^
-./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 205 and p
+./test/errors/759398.xml:314: parser error : Opening and ending tag mismatch: spec line 50 and p
 data and the information it must provide to the application.</p>
                                                                 ^
 ./test/errors/759398.xml:316: parser error : Extra content at the end of the document
index de9a28c..6809c06 100644 (file)
@@ -1,5 +1,5 @@
 ./test/errors/759398.xml:210: parser error : internal error: detected an error in element content
 
-need to worry about parsers whi<! don't expand 
+need to worry about parsers whi<! don't expand PErefs finding
                                ^
 ./test/errors/759398.xml : failed to parse
diff --git a/result/errors/759573-2.xml.ent b/result/errors/759573-2.xml.ent
new file mode 100644 (file)
index 0000000..4c45475
--- /dev/null
@@ -0,0 +1,35 @@
+Entity: line 1: parser error : Space required after '<!ENTITY'
+%zz;
+    ^
+Entity: line 1: 
+<!ENTITY<?xDOCTYPEm~?>
+        ^
+Entity: line 1: parser error : xmlParseEntityDecl: no name
+%zz;
+    ^
+Entity: line 1: 
+<!ENTITY<?xDOCTYPEm~?>
+        ^
+Entity: line 1: parser error : ParsePI: PI xDOCTYPEm space expected
+%zz;
+    ^
+Entity: line 1: 
+<!ENTITY<?xDOCTYPEm~?>
+                   ^
+./test/errors/759573-2.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%xx;\ 3ÿggKENSMYNT&#35;MENTD&#372zz;'>
+    ^
+Entity: line 2: 
+<![INCLUDE[
+^
+./test/errors/759573-2.xml:6: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+%xx;\ 3ÿggKENSMYNT&#35;MENTD&#372zz;'>
+    ^
+./test/errors/759573-2.xml:6: parser error : DOCTYPE improperly terminated
+%xx;\ 3ÿggKENSMYNT&#35;MENTD&#372zz;'>
+    ^
+./test/errors/759573-2.xml:6: parser error : Start tag expected, '<' not found
+%xx;\ 3ÿggKENSMYNT&#35;MENTD&#372zz;'>
+    ^
diff --git a/result/errors/759573.xml.ent b/result/errors/759573.xml.ent
new file mode 100644 (file)
index 0000000..5524750
--- /dev/null
@@ -0,0 +1,32 @@
+./test/errors/759573.xml:1: parser error : Space required after '<!ENTITY'
+ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITY
+                                                                               ^
+./test/errors/759573.xml:1: parser error : Space required after the entity name
+LEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz
+                                                                               ^
+./test/errors/759573.xml:1: parser error : Entity value required
+LEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz
+                                                                               ^
+./test/errors/759573.xml:1: parser error : PEReference: no name
+T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
+                                                                               ^
+Entity: line 1: 
+%<![INCLUDE[000%ஸ000%z;
+ ^
+./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
+                                                                               ^
+Entity: line 1: 
+%<![INCLUDE[000%ஸ000%z;
+ ^
+./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
+                                                                               ^
+./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
+T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
+                                                                               ^
+./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
+T t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;000&#37;z;'><!ENTITYz>%xx;
+                                                                               ^
diff --git a/result/errors/759579.xml.ent b/result/errors/759579.xml.ent
new file mode 100644 (file)
index 0000000..288026e
--- /dev/null
@@ -0,0 +1,6 @@
+Entity: line 2: parser error : Detected an entity reference loop
+        %z; %z; %z; %z; %z;
+           ^
+Entity: line 2: 
+        %z; %z; %z; %z; %z;
+           ^
diff --git a/result/errors/attr1.xml.ent b/result/errors/attr1.xml.ent
new file mode 100644 (file)
index 0000000..c4c4fc8
--- /dev/null
@@ -0,0 +1,9 @@
+./test/errors/attr1.xml:2: parser error : AttValue: ' expected
+
+^
+./test/errors/attr1.xml:2: parser error : attributes construct error
+
+^
+./test/errors/attr1.xml:2: parser error : Couldn't find end of Start Tag foo line 1
+
+^
diff --git a/result/errors/attr2.xml.ent b/result/errors/attr2.xml.ent
new file mode 100644 (file)
index 0000000..77e342e
--- /dev/null
@@ -0,0 +1,9 @@
+./test/errors/attr2.xml:2: parser error : AttValue: ' expected
+
+^
+./test/errors/attr2.xml:2: parser error : attributes construct error
+
+^
+./test/errors/attr2.xml:2: parser error : Couldn't find end of Start Tag foo line 1
+
+^
diff --git a/result/errors/attr3.xml.ent b/result/errors/attr3.xml.ent
new file mode 100644 (file)
index 0000000..a628ca7
--- /dev/null
@@ -0,0 +1,3 @@
+./test/errors/attr3.xml:4: validity warning : Attribute a1 of element doc: already defined
+<!ATTLIST doc a1 CDATA "z1">
+                           ^
diff --git a/result/errors/attr4.xml.ent b/result/errors/attr4.xml.ent
new file mode 100644 (file)
index 0000000..a9966d8
--- /dev/null
@@ -0,0 +1,12 @@
+./test/errors/attr4.xml:1: parser error : invalid character in attribute value
+<ROOT attr="XY\16"/>
+              ^
+./test/errors/attr4.xml:1: parser error : attributes construct error
+<ROOT attr="XY\16"/>
+              ^
+./test/errors/attr4.xml:1: parser error : Couldn't find end of Start Tag ROOT line 1
+<ROOT attr="XY\16"/>
+              ^
+./test/errors/attr4.xml:1: parser error : Extra content at the end of the document
+<ROOT attr="XY\16"/>
+              ^
diff --git a/result/errors/cdata.xml.ent b/result/errors/cdata.xml.ent
new file mode 100644 (file)
index 0000000..f757963
--- /dev/null
@@ -0,0 +1,4 @@
+./test/errors/cdata.xml:2: parser error : Input is not proper UTF-8, indicate encoding !
+Bytes: 0xE1 0x72 0x5D 0x5D
+<A><![CDATA[Cár]]></A>
+             ^
diff --git a/result/errors/charref1.xml.ent b/result/errors/charref1.xml.ent
new file mode 100644 (file)
index 0000000..dbf3005
--- /dev/null
@@ -0,0 +1,3 @@
+./test/errors/charref1.xml:1: parser error : xmlParseCharRef: character reference out of bounds
+<bla>&#010100000000000000000000000000000000000000000000000060;</bla>
+                                                              ^
diff --git a/result/errors/comment1.xml.ent b/result/errors/comment1.xml.ent
new file mode 100644 (file)
index 0000000..5a732dd
--- /dev/null
@@ -0,0 +1,6 @@
+./test/errors/comment1.xml:5: parser error : xmlParseComment: invalid xmlChar value 14
+ in p02: \ e -->
+         ^
+./test/errors/comment1.xml:5: parser error : Start tag expected, '<' not found
+ in p02: \ e -->
+         ^
diff --git a/result/errors/content1.xml.ent b/result/errors/content1.xml.ent
new file mode 100644 (file)
index 0000000..9fcd603
--- /dev/null
@@ -0,0 +1,16 @@
+./test/errors/content1.xml:7: parser error : ContentDecl : ',' '|' or ')' expected
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : expected '>'
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : DOCTYPE improperly terminated
+<!ELEMENT aElement (a |b * >
+                         ^
+./test/errors/content1.xml:7: parser error : Start tag expected, '<' not found
+<!ELEMENT aElement (a |b * >
+                         ^
diff --git a/result/errors/extparsedent.xml.ent b/result/errors/extparsedent.xml.ent
new file mode 100644 (file)
index 0000000..2cce176
--- /dev/null
@@ -0,0 +1 @@
+I/O warning : failed to load external entity "/etc/doesnotexist"
diff --git a/result/errors/name.xml.ent b/result/errors/name.xml.ent
new file mode 100644 (file)
index 0000000..4dbfc52
--- /dev/null
@@ -0,0 +1,3 @@
+./test/errors/name.xml:2: parser error : Couldn't find end of Start Tag foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo line 1
+
+^
diff --git a/result/errors/name2.xml.ent b/result/errors/name2.xml.ent
new file mode 100644 (file)
index 0000000..8acef79
--- /dev/null
@@ -0,0 +1,9 @@
+./test/errors/name2.xml:2: parser error : Specification mandates value for attribute foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
+
+^
+./test/errors/name2.xml:2: parser error : attributes construct error
+
+^
+./test/errors/name2.xml:2: parser error : Couldn't find end of Start Tag foo line 1
+
+^
diff --git a/result/errors/rec_ext_ent.xml b/result/errors/rec_ext_ent.xml
new file mode 100644 (file)
index 0000000..6a196cb
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY e SYSTEM "rec_ext.ent">
+]>
+<doc>&e; &e; &e; &e;</doc>
diff --git a/result/errors/rec_ext_ent.xml.ent b/result/errors/rec_ext_ent.xml.ent
new file mode 100644 (file)
index 0000000..d8ccec1
--- /dev/null
@@ -0,0 +1,123 @@
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+test/errors/rec_ext.ent:1: parser error : Detected an entity reference loop
+<ent>&e; &e; &e; &e;</ent>
+        ^
+./test/errors/rec_ext_ent.xml:4: parser error : Detected an entity reference loop
+<doc>&e; &e; &e; &e;</doc>
+        ^
diff --git a/result/errors/rec_ext_ent.xml.err b/result/errors/rec_ext_ent.xml.err
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/result/errors/rec_ext_ent.xml.str b/result/errors/rec_ext_ent.xml.str
new file mode 100644 (file)
index 0000000..e69de29
index 88c6aa6..d17f2ff 100644 (file)
@@ -17,13 +17,6 @@ SAX.characters(my title, 8)
 SAX.endElementNs(title, NULL, NULL)
 SAX.characters(
 , 1)
-SAX.ignorableWhitespace(
-, 1)
-SAX.startElementNs(title, NULL, NULL, 0, 0, 0)
-SAX.characters(my title, 8)
-SAX.endElementNs(title, NULL, NULL)
-SAX.characters(
-, 1)
 SAX.characters(
   This text is about XML, the, 31)
 SAX.getEntity(xml)
diff --git a/result/noent/ent6hex b/result/noent/ent6hex
new file mode 100644 (file)
index 0000000..6d59df9
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0"?>
+<!DOCTYPE doc [
+<!ENTITY lt "&#x26;#x3c;">
+<!ENTITY gt "&#x26;#x3E;">
+<!ENTITY amp "&#x26;#x26;">
+<!ENTITY apos "&#x26;#x27;">
+<!ENTITY quot "&#x26;#x22;">
+]>
+<doc/>
diff --git a/result/noent/ent6hex.sax2 b/result/noent/ent6hex.sax2
new file mode 100644 (file)
index 0000000..6c9df2e
--- /dev/null
@@ -0,0 +1,17 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.internalSubset(doc, , )
+SAX.entityDecl(lt, 1, (null), (null), &#x3c;)
+SAX.getEntity(lt)
+SAX.entityDecl(gt, 1, (null), (null), &#x3E;)
+SAX.getEntity(gt)
+SAX.entityDecl(amp, 1, (null), (null), &#x26;)
+SAX.getEntity(amp)
+SAX.entityDecl(apos, 1, (null), (null), &#x27;)
+SAX.getEntity(apos)
+SAX.entityDecl(quot, 1, (null), (null), &#x22;)
+SAX.getEntity(quot)
+SAX.externalSubset(doc, , )
+SAX.startElementNs(doc, NULL, NULL, 0, 0, 0)
+SAX.endElementNs(doc, NULL, NULL)
+SAX.endDocument()
diff --git a/result/regexp/bug757711 b/result/regexp/bug757711
new file mode 100644 (file)
index 0000000..0991e4e
--- /dev/null
@@ -0,0 +1,2 @@
+Regexp: [;^((-
+   failed to compile
diff --git a/result/regexp/bug757711.err b/result/regexp/bug757711.err
new file mode 100644 (file)
index 0000000..f1cae80
--- /dev/null
@@ -0,0 +1,2 @@
+regexp error : failed to compile: Expecting the end of a char range
+regexp error : failed to compile: xmlFAParseCharClass: ']' expected
diff --git a/result/regexp/bug783015 b/result/regexp/bug783015
new file mode 100644 (file)
index 0000000..653f6f0
--- /dev/null
@@ -0,0 +1,4 @@
+Regexp: .{2147483647}
+input: Fail
+Regexp: .{2147483648}
+   failed to compile
diff --git a/result/regexp/bug783015.err b/result/regexp/bug783015.err
new file mode 100644 (file)
index 0000000..a00edc9
--- /dev/null
@@ -0,0 +1 @@
+regexp error : failed to compile: Improper quantifier
index 4460b3e..9fb9103 100644 (file)
@@ -10,7 +10,7 @@ publication.  --><!ENTITY XML.version "1.0">
 <!ENTITY draft.month "February">
 <!ENTITY draft.year "1998">
 <!ENTITY WebSGML "WebSGML Adaptations Annex to ISO 8879">
-<!ENTITY lt "<">
+<!ENTITY lt "&#38;#60;">
 <!ENTITY gt ">">
 <!ENTITY xmlpio "'&lt;?xml'">
 <!ENTITY pic "'?>'">
index ffa98d0..0f178cb 100644 (file)
--- a/runtest.c
+++ b/runtest.c
@@ -105,6 +105,7 @@ struct testDesc {
 };
 
 static int update_results = 0;
+static char* temp_directory = NULL;
 static int checkTestFile(const char *filename);
 
 #if defined(_WIN32) && !defined(__CYGWIN__)
@@ -1699,7 +1700,7 @@ saxParseTest(const char *filename, const char *result,
     char *temp;
 
     nb_tests++;
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "out of memory\n");
         fatalError();
@@ -1818,7 +1819,7 @@ oldParseTest(const char *filename, const char *result,
 #endif
     if (doc == NULL)
         return(1);
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "out of memory\n");
         fatalError();
@@ -2030,7 +2031,7 @@ noentParseTest(const char *filename, const char *result,
     doc = xmlReadFile(filename, NULL, options);
     if (doc == NULL)
         return(1);
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -2107,16 +2108,16 @@ errParseTest(const char *filename, const char *result, const char *err,
            xmlDocDumpMemory(doc, (xmlChar **) &base, &size);
        }
        res = compareFileMem(result, base, size);
-       if (res != 0) {
-           fprintf(stderr, "Result for %s failed in %s\n", filename, result);
-           return(-1);
-       }
     }
     if (doc != NULL) {
        if (base != NULL)
            xmlFree((char *)base);
        xmlFreeDoc(doc);
     }
+    if (res != 0) {
+        fprintf(stderr, "Result for %s failed in %s\n", filename, result);
+        return(-1);
+    }
     if (err != NULL) {
        res = compareFileMem(err, testErrors, testErrorsSize);
        if (res != 0) {
@@ -2177,7 +2178,7 @@ streamProcessTest(const char *filename, const char *result, const char *err,
 
     nb_tests++;
     if (result != NULL) {
-       temp = resultFilename(filename, "", ".res");
+       temp = resultFilename(filename, temp_directory, ".res");
        if (temp == NULL) {
            fprintf(stderr, "Out of memory\n");
            fatalError();
@@ -2406,7 +2407,7 @@ xpathCommonTest(const char *filename, const char *result,
     int len, ret = 0;
     char *temp;
 
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -2605,7 +2606,7 @@ xmlidDocTest(const char *filename,
        return(-1);
     }
 
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -2703,7 +2704,7 @@ uriCommonTest(const char *filename,
     char str[1024];
     int res = 0, i, ret;
 
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -3007,7 +3008,7 @@ schemasOneTest(const char *sch,
        return(-1);
     }
 
-    temp = resultFilename(result, "", ".res");
+    temp = resultFilename(result, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -3178,7 +3179,7 @@ rngOneTest(const char *sch,
        return(-1);
     }
 
-    temp = resultFilename(result, "", ".res");
+    temp = resultFilename(result, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -3528,7 +3529,7 @@ patternTest(const char *filename,
         fprintf(stderr, "Failed to open %s\n", filename);
        return(-1);
     }
-    temp = resultFilename(filename, "", ".res");
+    temp = resultFilename(filename, temp_directory, ".res");
     if (temp == NULL) {
         fprintf(stderr, "Out of memory\n");
         fatalError();
@@ -4248,6 +4249,9 @@ testDesc testDescriptions[] = {
     { "Error cases regression tests",
       errParseTest, "./test/errors/*.xml", "result/errors/", "", ".err",
       0 },
+    { "Error cases regression tests with entity substitution",
+      errParseTest, "./test/errors/*.xml", "result/errors/", NULL, ".ent",
+      XML_PARSE_NOENT },
     { "Error cases regression tests (old 1.0)",
       errParseTest, "./test/errors10/*.xml", "result/errors10/", "", ".err",
       XML_PARSE_OLD10 },
@@ -4562,6 +4566,8 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
            update_results = 1;
         else if (!strcmp(argv[a], "-quiet"))
            tests_quiet = 1;
+        else if (!strcmp(argv[a], "--out"))
+           temp_directory = argv[++a];
        else {
            for (i = 0; testDescriptions[i].func != NULL; i++) {
                if (strstr(testDescriptions[i].desc, argv[a])) {
index 70f6101..8a37aa8 100644 (file)
@@ -507,7 +507,7 @@ xmlconfInfo(void) {
     fprintf(stderr, "  you need to fetch and extract the\n");
     fprintf(stderr, "  latest XML Conformance Test Suites\n");
     fprintf(stderr, "  http://www.w3.org/XML/Test/xmlts20080827.tar.gz\n");
-    fprintf(stderr, "  see http://www.w3.org/XML/Test/ for informations\n");
+    fprintf(stderr, "  see http://www.w3.org/XML/Test/ for information\n");
 }
 
 static int
index 258ce40..ddbb069 100644 (file)
@@ -220,7 +220,7 @@ struct _xmlSchematronParserCtxt {
 /**
  * xmlSchematronPErrMemory:
  * @node: a context node
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -268,7 +268,7 @@ xmlSchematronPErr(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr node, int error,
 /**
  * xmlSchematronVTypeErrMemory:
  * @node: a context node
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
diff --git a/test/HTML/chunked_attr.html b/test/HTML/chunked_attr.html
new file mode 100644 (file)
index 0000000..84d8179
--- /dev/null
@@ -0,0 +1,53 @@
+<html>
+<!--
+This tests internal state tracking of the push parser and assumes a chunk
+size of 4096 (or a divisor of 4096) and an initial chunk of size 4.
+Make sure that the first '<' in the attribute value ends up near
+offset 4100.
+-->
+<body>
+<p>
+Filler bytes follow:
+
+      100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+     1000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      900 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+     2000 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      100 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      200 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      300 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      400 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      500 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      600 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      700 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+      800 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
+xxx
+</p>
+<div
+  fill1="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+  onmouseover="x<b>text</b>x"
+  fill2="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+  fill3="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+  fill4="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+  fill5="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+  fill6="123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789"
+>
+</div>
+</body>
+</html>
diff --git a/test/HTML/comments.html b/test/HTML/comments.html
new file mode 100644 (file)
index 0000000..a0d336b
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+  <body>
+    <div>
+      <h3>
+        <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+          Incorrectly closed comment
+        </a>
+      </h3>
+      <div>
+        <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is that this should be a DOM node</span><!--correctly closed comment-->
+      </div>
+    </div>
+  </body>
+</html>
diff --git a/test/HTML/comments2.html b/test/HTML/comments2.html
new file mode 100644 (file)
index 0000000..207e649
--- /dev/null
@@ -0,0 +1,14 @@
+<html>
+  <body>
+    <div>
+      <h3>
+        <a href="https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment">
+          Incorrectly closed comment without a correctly closed comment
+        </a>
+      </h3>
+      <div>
+        <!--incorrectly closed comment--!><span id=under-test>whatwg guidance is that this should be a DOM node</span>
+      </div>
+    </div>
+  </body>
+</html>
diff --git a/test/XInclude/docs/fallback3.xml b/test/XInclude/docs/fallback3.xml
new file mode 100644 (file)
index 0000000..0c8b6c9
--- /dev/null
@@ -0,0 +1,9 @@
+<a>
+    <xi:include href="../ents/something.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+        <xi:fallback>
+            <xi:include href="c.xml">
+                <xi:fallback>There is no c.xml ... </xi:fallback>
+            </xi:include>
+        </xi:fallback>
+    </xi:include>
+</a>
diff --git a/test/XInclude/docs/fallback4.xml b/test/XInclude/docs/fallback4.xml
new file mode 100644 (file)
index 0000000..b500a63
--- /dev/null
@@ -0,0 +1,7 @@
+<a>
+    <xi:include href="c.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+        <xi:fallback>
+            <xi:include href="../ents/something.xml"/>
+        </xi:fallback>
+    </xi:include>
+</a>
diff --git a/test/XInclude/docs/fallback5.xml b/test/XInclude/docs/fallback5.xml
new file mode 100644 (file)
index 0000000..d3ad424
--- /dev/null
@@ -0,0 +1,83 @@
+<a>
+ <xi:include href="a01.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+  <xi:fallback>
+   <elem/>
+   <xi:include href="a02.xml">
+    <xi:fallback>
+     <elem/>
+     <xi:include href="a03.xml">
+      <xi:fallback>
+       <elem/>
+       <xi:include href="a04.xml">
+        <xi:fallback>
+         <elem/>
+         <xi:include href="a05.xml">
+          <xi:fallback>
+           <elem/>
+           <xi:include href="a06.xml">
+            <xi:fallback>
+             <elem/>
+             <xi:include href="a07.xml">
+              <xi:fallback>
+               <elem/>
+               <xi:include href="a08.xml">
+                <xi:fallback>
+                 <elem/>
+                 <xi:include href="a09.xml">
+                  <xi:fallback>
+                   <elem/>
+                   <xi:include href="a10.xml">
+                    <xi:fallback>
+                     <elem/>
+                     <xi:include href="a11.xml">
+                      <xi:fallback>
+                       <elem/>
+                       <xi:include href="a12.xml">
+                        <xi:fallback>
+                         <elem/>
+                         <xi:include href="a13.xml">
+                          <xi:fallback>
+                           <elem/>
+                           <xi:include href="a14.xml">
+                            <xi:fallback>
+                             <elem/>
+                             <xi:include href="a15.xml">
+                              <xi:fallback>
+                               <elem/>
+                               <xi:include href="a16.xml">
+                                <xi:fallback>
+                                 <elem/>
+                                </xi:fallback>
+                               </xi:include>
+                              </xi:fallback>
+                             </xi:include>
+                            </xi:fallback>
+                           </xi:include>
+                          </xi:fallback>
+                         </xi:include>
+                        </xi:fallback>
+                       </xi:include>
+                      </xi:fallback>
+                     </xi:include>
+                    </xi:fallback>
+                   </xi:include>
+                  </xi:fallback>
+                 </xi:include>
+                </xi:fallback>
+               </xi:include>
+              </xi:fallback>
+             </xi:include>
+            </xi:fallback>
+           </xi:include>
+          </xi:fallback>
+         </xi:include>
+        </xi:fallback>
+       </xi:include>
+      </xi:fallback>
+     </xi:include>
+    </xi:fallback>
+   </xi:include>
+  </xi:fallback>
+ </xi:include>
+</a>
+
diff --git a/test/XInclude/docs/fallback6.xml b/test/XInclude/docs/fallback6.xml
new file mode 100644 (file)
index 0000000..fd00a03
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="b.xml">
+    <xi:fallback><xi:include href="c.xml">
+        <xi:fallback/>
+    </xi:include></xi:fallback>
+</xi:include>
diff --git a/test/XInclude/docs/ns1.xml b/test/XInclude/docs/ns1.xml
new file mode 100644 (file)
index 0000000..7523f4a
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<doc xmlns:xi="http://www.w3.org/2001/XInclude">
+    <xi:include href="#a"/>
+    <elem xmlns:ns="urn:foo">
+        <ns:elem xml:id="a"/>
+    </elem>
+    <xi:include href="b.xml">
+        <xi:fallback xmlns:ns="urn:bar">
+            <ns:elem/>
+        </xi:fallback>
+    </xi:include>
+</doc>
diff --git a/test/ent6hex b/test/ent6hex
new file mode 100644 (file)
index 0000000..b86028b
--- /dev/null
@@ -0,0 +1,8 @@
+<!DOCTYPE doc [
+<!ENTITY lt     "&#x26;#x3c;"> 
+<!ENTITY gt     "&#x26;#x3E;"> 
+<!ENTITY amp    "&#x26;#x26;"> 
+<!ENTITY apos   "&#x26;#x27;"> 
+<!ENTITY quot   "&#x26;#x22;"> 
+]>
+<doc/>
index 132e029..1fcaa3f 100644 (file)
@@ -18,7 +18,7 @@ publication.  -->
 <!ENTITY WebSGML 
  'WebSGML Adaptations Annex to ISO 8879'>
 
-<!ENTITY lt     "<"> 
+<!ENTITY lt     "&#38;#60;"> 
 <!ENTITY gt     ">"> 
 <!ENTITY xmlpio "'&lt;?xml'">
 <!ENTITY pic    "'?>'">
diff --git a/test/errors/rec_ext.ent b/test/errors/rec_ext.ent
new file mode 100644 (file)
index 0000000..345f836
--- /dev/null
@@ -0,0 +1 @@
+<ent>&e; &e; &e; &e;</ent>
diff --git a/test/errors/rec_ext_ent.xml b/test/errors/rec_ext_ent.xml
new file mode 100644 (file)
index 0000000..b4e7e74
--- /dev/null
@@ -0,0 +1,4 @@
+<!DOCTYPE doc [
+  <!ENTITY e SYSTEM "rec_ext.ent">
+]>
+<doc>&e; &e; &e; &e;</doc>
diff --git a/test/regexp/bug757711 b/test/regexp/bug757711
new file mode 100644 (file)
index 0000000..2909835
--- /dev/null
@@ -0,0 +1 @@
+=>[;^((-
diff --git a/test/regexp/bug783015 b/test/regexp/bug783015
new file mode 100644 (file)
index 0000000..5c91a0f
--- /dev/null
@@ -0,0 +1,4 @@
+# This assumes 32-bit ints.
+=>.{2147483647}
+input
+=>.{2147483648}
index d146032..495550b 100644 (file)
@@ -18,7 +18,7 @@ publication.  -->
 <!ENTITY WebSGML 
  'WebSGML Adaptations Annex to ISO 8879'>
 
-<!ENTITY lt     "<"> 
+<!ENTITY lt     "&#38;#60;"> 
 <!ENTITY gt     ">"> 
 <!ENTITY xmlpio "'&lt;?xml'">
 <!ENTITY pic    "'?>'">
index bec8e90..6591b69 100644 (file)
@@ -18,7 +18,7 @@ publication.  -->
 <!ENTITY WebSGML 
  'WebSGML Adaptations Annex to ISO 8879'>
 
-<!ENTITY lt     "<"> 
+<!ENTITY lt     "&#38;#60;"> 
 <!ENTITY gt     ">"> 
 <!ENTITY xmlpio "'&lt;?xml'">
 <!ENTITY pic    "'?>'">
index ff8b470..6f19c6f 100644 (file)
--- a/testapi.c
+++ b/testapi.c
@@ -2843,7 +2843,7 @@ test_htmlDocContentDumpFormatOutput(void) {
     int n_buf;
     xmlDocPtr cur; /* the document */
     int n_cur;
-    char * encoding; /* the encoding string */
+    char * encoding; /* the encoding string (unused) */
     int n_encoding;
     int format; /* should formatting spaces been added */
     int n_format;
@@ -2896,7 +2896,7 @@ test_htmlDocContentDumpOutput(void) {
     int n_buf;
     xmlDocPtr cur; /* the document */
     int n_cur;
-    char * encoding; /* the encoding string */
+    char * encoding; /* the encoding string (unused) */
     int n_encoding;
 
     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
@@ -3397,7 +3397,7 @@ test_htmlNodeDumpFormatOutput(void) {
     int n_doc;
     xmlNodePtr cur; /* the current node */
     int n_cur;
-    char * encoding; /* the encoding string */
+    char * encoding; /* the encoding string (unused) */
     int n_encoding;
     int format; /* should formatting spaces been added */
     int n_format;
@@ -3457,7 +3457,7 @@ test_htmlNodeDumpOutput(void) {
     int n_doc;
     xmlNodePtr cur; /* the current node */
     int n_cur;
-    char * encoding; /* the encoding string */
+    char * encoding; /* the encoding string (unused) */
     int n_encoding;
 
     for (n_buf = 0;n_buf < gen_nb_xmlOutputBufferPtr;n_buf++) {
@@ -13611,9 +13611,9 @@ test_xmlParseBalancedChunkMemory(void) {
 #ifdef LIBXML_SAX1_ENABLED
     int mem_base;
     int ret_val;
-    xmlDocPtr doc; /* the document the chunk pertains to */
+    xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
     int n_doc;
-    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
+    xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
     int n_sax;
     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
     int n_user_data;
@@ -13687,9 +13687,9 @@ test_xmlParseBalancedChunkMemoryRecover(void) {
 #ifdef LIBXML_SAX1_ENABLED
     int mem_base;
     int ret_val;
-    xmlDocPtr doc; /* the document the chunk pertains to */
+    xmlDocPtr doc; /* the document the chunk pertains to (must not be NULL) */
     int n_doc;
-    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
+    xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
     int n_sax;
     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
     int n_user_data;
@@ -14065,7 +14065,7 @@ test_xmlParseExternalEntity(void) {
     int ret_val;
     xmlDocPtr doc; /* the document the chunk pertains to */
     int n_doc;
-    xmlSAXHandlerPtr sax; /* the SAX handler bloc (possibly NULL) */
+    xmlSAXHandlerPtr sax; /* the SAX handler block (possibly NULL) */
     int n_sax;
     void * user_data; /* The user data returned on SAX callbacks (possibly NULL) */
     int n_user_data;
@@ -16158,7 +16158,7 @@ test_xmlErrMemory(void) {
     int mem_base;
     xmlParserCtxtPtr ctxt; /* an XML parser context */
     int n_ctxt;
-    char * extra; /* extra informations */
+    char * extra; /* extra information */
     int n_extra;
 
     for (n_ctxt = 0;n_ctxt < gen_nb_xmlParserCtxtPtr;n_ctxt++) {
@@ -29238,6 +29238,33 @@ test_xmlPopInputCallbacks(void) {
 
 
 static int
+test_xmlPopOutputCallbacks(void) {
+    int test_ret = 0;
+
+#if defined(LIBXML_OUTPUT_ENABLED)
+    int mem_base;
+    int ret_val;
+
+        mem_base = xmlMemBlocks();
+
+        ret_val = xmlPopOutputCallbacks();
+        desret_int(ret_val);
+        call_tests++;
+        xmlResetLastError();
+        if (mem_base != xmlMemBlocks()) {
+            printf("Leak of %d blocks found in xmlPopOutputCallbacks",
+                  xmlMemBlocks() - mem_base);
+           test_ret++;
+            printf("\n");
+        }
+    function_tests++;
+#endif
+
+    return(test_ret);
+}
+
+
+static int
 test_xmlRegisterDefaultInputCallbacks(void) {
     int test_ret = 0;
 
@@ -29313,7 +29340,7 @@ static int
 test_xmlIO(void) {
     int test_ret = 0;
 
-    if (quiet == 0) printf("Testing xmlIO : 40 of 50 functions ...\n");
+    if (quiet == 0) printf("Testing xmlIO : 41 of 51 functions ...\n");
     test_ret += test_xmlAllocOutputBuffer();
     test_ret += test_xmlAllocParserInputBuffer();
     test_ret += test_xmlCheckFilename();
@@ -29354,6 +29381,7 @@ test_xmlIO(void) {
     test_ret += test_xmlParserInputBufferPush();
     test_ret += test_xmlParserInputBufferRead();
     test_ret += test_xmlPopInputCallbacks();
+    test_ret += test_xmlPopOutputCallbacks();
     test_ret += test_xmlRegisterDefaultInputCallbacks();
     test_ret += test_xmlRegisterDefaultOutputCallbacks();
     test_ret += test_xmlRegisterHTTPPostCallbacks();
@@ -34240,27 +34268,27 @@ test_xmlSaveTree(void) {
     long ret_val;
     xmlSaveCtxtPtr ctxt; /* a document saving context */
     int n_ctxt;
-    xmlNodePtr node; /* the top node of the subtree to save */
-    int n_node;
+    xmlNodePtr cur; /*  */
+    int n_cur;
 
     for (n_ctxt = 0;n_ctxt < gen_nb_xmlSaveCtxtPtr;n_ctxt++) {
-    for (n_node = 0;n_node < gen_nb_xmlNodePtr;n_node++) {
+    for (n_cur = 0;n_cur < gen_nb_xmlNodePtr;n_cur++) {
         mem_base = xmlMemBlocks();
         ctxt = gen_xmlSaveCtxtPtr(n_ctxt, 0);
-        node = gen_xmlNodePtr(n_node, 1);
+        cur = gen_xmlNodePtr(n_cur, 1);
 
-        ret_val = xmlSaveTree(ctxt, node);
+        ret_val = xmlSaveTree(ctxt, cur);
         desret_long(ret_val);
         call_tests++;
         des_xmlSaveCtxtPtr(n_ctxt, ctxt, 0);
-        des_xmlNodePtr(n_node, node, 1);
+        des_xmlNodePtr(n_cur, cur, 1);
         xmlResetLastError();
         if (mem_base != xmlMemBlocks()) {
             printf("Leak of %d blocks found in xmlSaveTree",
                   xmlMemBlocks() - mem_base);
            test_ret++;
             printf(" %d", n_ctxt);
-            printf(" %d", n_node);
+            printf(" %d", n_cur);
             printf("\n");
         }
     }
index 72df9ba..503d2bf 100644 (file)
--- a/threads.c
+++ b/threads.c
@@ -885,8 +885,6 @@ xmlInitThreads(void)
         }
     }
 #endif /* XML_PTHREAD_WEAK */
-#elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
-    InitializeCriticalSection(&cleanup_helpers_cs);
 #endif
 }
 
@@ -958,6 +956,9 @@ xmlOnceInit(void)
     if (!run_once.done) {
         if (InterlockedIncrement(&run_once.control) == 1) {
 #if !defined(HAVE_COMPILER_TLS)
+#if !defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL)
+            InitializeCriticalSection(&cleanup_helpers_cs);
+#endif
             globalkey = TlsAlloc();
 #endif
             mainthread = GetCurrentThreadId();
diff --git a/tree.c b/tree.c
index 08b1a50..c707f59 100644 (file)
--- a/tree.c
+++ b/tree.c
@@ -70,7 +70,7 @@ static xmlChar* xmlGetPropNodeValueInternal(const xmlAttr *prop);
  ************************************************************************/
 /**
  * xmlTreeErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -83,7 +83,7 @@ xmlTreeErrMemory(const char *extra)
 /**
  * xmlTreeErr:
  * @code:  the error number
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -1064,7 +1064,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name,
  * @str:  a string
  *
  * Copy a string using a "dict" dictionary in the current scope,
- * if availabe.
+ * if available.
  */
 #define DICT_COPY(str, cpy) \
     if (str) { \
@@ -1081,7 +1081,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name,
  * @str:  a string
  *
  * Copy a string using a "dict" dictionary in the current scope,
- * if availabe.
+ * if available.
  */
 #define DICT_CONST_COPY(str, cpy) \
     if (str) { \
@@ -1276,12 +1276,14 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
     xmlNodePtr ret = NULL, last = NULL;
     xmlNodePtr node;
     xmlChar *val;
-    const xmlChar *cur = value, *end = cur + len;
+    const xmlChar *cur, *end;
     const xmlChar *q;
     xmlEntityPtr ent;
     xmlBufPtr buf;
 
     if (value == NULL) return(NULL);
+    cur = value;
+    end = cur + len;
 
     buf = xmlBufCreateSize(0);
     if (buf == NULL) return(NULL);
@@ -1308,6 +1310,16 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
                else
                    tmp = 0;
                while (tmp != ';') { /* Non input consuming loop */
+                    /*
+                     * If you find an integer overflow here when fuzzing,
+                     * the bug is probably elsewhere. This function should
+                     * only receive entities that were already validated by
+                     * the parser, typically by xmlParseAttValueComplex
+                     * calling xmlStringDecodeEntities.
+                     *
+                     * So it's better *not* to check for overflow to
+                     * potentially discover new bugs.
+                     */
                    if ((tmp >= '0') && (tmp <= '9'))
                        charval = charval * 16 + (tmp - '0');
                    else if ((tmp >= 'a') && (tmp <= 'f'))
@@ -1336,6 +1348,7 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
                else
                    tmp = 0;
                while (tmp != ';') { /* Non input consuming loops */
+                    /* Don't check for integer overflow, see above. */
                    if ((tmp >= '0') && (tmp <= '9'))
                        charval = charval * 10 + (tmp - '0');
                    else {
@@ -1515,6 +1528,7 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
                cur += 3;
                tmp = *cur;
                while (tmp != ';') { /* Non input consuming loop */
+                    /* Don't check for integer overflow, see above. */
                    if ((tmp >= '0') && (tmp <= '9'))
                        charval = charval * 16 + (tmp - '0');
                    else if ((tmp >= 'a') && (tmp <= 'f'))
@@ -1537,6 +1551,7 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
                cur += 2;
                tmp = *cur;
                while (tmp != ';') { /* Non input consuming loops */
+                    /* Don't check for integer overflow, see above. */
                    if ((tmp >= '0') && (tmp <= '9'))
                        charval = charval * 10 + (tmp - '0');
                    else {
@@ -1647,6 +1662,10 @@ xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
 
     if (!xmlBufIsEmpty(buf)) {
        node = xmlNewDocText(doc, NULL);
+        if (node == NULL) {
+            xmlBufFree(buf);
+            return(NULL);
+        }
        node->content = xmlBufDetach(buf);
 
        if (last == NULL) {
@@ -1882,12 +1901,6 @@ xmlNewPropInternal(xmlNodePtr node, xmlNsPtr ns,
     if (value != NULL) {
         xmlNodePtr tmp;
 
-        if(!xmlCheckUTF8(value)) {
-            xmlTreeErr(XML_TREE_NOT_UTF8, (xmlNodePtr) doc,
-                       NULL);
-            if (doc != NULL)
-                doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
-        }
         cur->children = xmlNewDocText(doc, value);
         cur->last = NULL;
         tmp = cur->children;
@@ -2007,6 +2020,11 @@ xmlNewNsPropEatName(xmlNodePtr node, xmlNsPtr ns, xmlChar *name,
  * @value:  the value of the attribute
  *
  * Create a new property carried by a document.
+ * NOTE: @value is supposed to be a piece of XML CDATA, so it allows entity
+ *       references, but XML special chars need to be escaped first by using
+ *       xmlEncodeEntitiesReentrant(). Use xmlNewProp() if you don't need
+ *       entities support.
+ *
  * Returns a pointer to the attribute
  */
 xmlAttrPtr
@@ -3706,6 +3724,11 @@ xmlFreeNodeList(xmlNodePtr cur) {
                (cur->type != XML_XINCLUDE_START) &&
                (cur->type != XML_XINCLUDE_END) &&
                (cur->type != XML_ENTITY_REF_NODE) &&
+               (cur->type != XML_DOCUMENT_NODE) &&
+#ifdef LIBXML_DOCB_ENABLED
+               (cur->type != XML_DOCB_DOCUMENT_NODE) &&
+#endif
+               (cur->type != XML_HTML_DOCUMENT_NODE) &&
                (cur->content != (xmlChar *) &(cur->properties))) {
                DICT_FREE(cur->content)
            }
@@ -4066,7 +4089,7 @@ xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
       } else {
         /*
          * we have to find something appropriate here since
-         * we cant be sure, that the namespace we found is identified
+         * we can't be sure, that the namespace we found is identified
          * by the prefix
          */
         if (xmlStrEqual(ns->href, cur->ns->href)) {
@@ -4547,6 +4570,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
     if (doc == NULL) return(NULL);
     ret = xmlNewDoc(doc->version);
     if (ret == NULL) return(NULL);
+    ret->type = doc->type;
     if (doc->name != NULL)
         ret->name = xmlMemStrdup(doc->name);
     if (doc->encoding != NULL)
@@ -4869,7 +4893,9 @@ xmlGetNodePath(const xmlNode *node)
             }
             next = ((xmlAttrPtr) cur)->parent;
         } else {
-            next = cur->parent;
+            xmlFree(buf);
+            xmlFree(buffer);
+            return (NULL);
         }
 
         /*
@@ -6564,6 +6590,16 @@ xmlGetPropNodeInternal(const xmlNode *node, const xmlChar *name,
                attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
                    elemQName, name, NULL);
            }
+        } else if (xmlStrEqual(nsName, XML_XML_NAMESPACE)) {
+           /*
+           * The XML namespace must be bound to prefix 'xml'.
+           */
+           attrDecl = xmlGetDtdQAttrDesc(doc->intSubset,
+               elemQName, name, BAD_CAST "xml");
+           if ((attrDecl == NULL) && (doc->extSubset != NULL)) {
+               attrDecl = xmlGetDtdQAttrDesc(doc->extSubset,
+                   elemQName, name, BAD_CAST "xml");
+           }
        } else {
            xmlNsPtr *nsList, *cur;
 
@@ -6910,12 +6946,6 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
        if (value != NULL) {
            xmlNodePtr tmp;
 
-           if(!xmlCheckUTF8(value)) {
-               xmlTreeErr(XML_TREE_NOT_UTF8, (xmlNodePtr) node->doc,
-                          NULL);
-                if (node->doc != NULL)
-                    node->doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
-           }
            prop->children = xmlNewDocText(node->doc, value);
            prop->last = NULL;
            tmp = prop->children;
@@ -7243,7 +7273,7 @@ xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
         ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL))) {
        /*
         * we just move the content pointer, but also make sure
-        * the perceived buffer size has shrinked accordingly
+        * the perceived buffer size has shrunk accordingly
         */
         buf->content += len;
        buf->size -= len;
@@ -7417,12 +7447,17 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
     if (size < buf->size)
         return 1;
 
+    if (size > UINT_MAX - 10) {
+        xmlTreeErrMemory("growing buffer");
+        return 0;
+    }
+
     /* figure out new size */
     switch (buf->alloc){
        case XML_BUFFER_ALLOC_IO:
        case XML_BUFFER_ALLOC_DOUBLEIT:
            /*take care of empty case*/
-           newSize = (buf->size ? buf->size*2 : size + 10);
+           newSize = (buf->size ? buf->size : size + 10);
            while (size > newSize) {
                if (newSize > UINT_MAX / 2) {
                    xmlTreeErrMemory("growing buffer");
@@ -7438,7 +7473,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
             if (buf->use < BASE_BUFFER_SIZE)
                 newSize = size;
             else {
-                newSize = buf->size * 2;
+                newSize = buf->size;
                 while (size > newSize) {
                     if (newSize > UINT_MAX / 2) {
                         xmlTreeErrMemory("growing buffer");
@@ -7595,7 +7630,7 @@ xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
 
        if (start_buf > (unsigned int) len) {
            /*
-            * We can add it in the space previously shrinked
+            * We can add it in the space previously shrunk
             */
            buf->content -= len;
             memmove(&buf->content[0], str, len);
diff --git a/trio.c b/trio.c
index f7a0da6..ee270bc 100644 (file)
--- a/trio.c
+++ b/trio.c
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  *************************************************************************
diff --git a/trio.h b/trio.h
index 99d2127..dcf96b6 100644 (file)
--- a/trio.h
+++ b/trio.h
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  *************************************************************************
index 46772ee..e101f6d 100644 (file)
--- a/triodef.h
+++ b/triodef.h
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  ************************************************************************/
index 530b1c0..8767a9f 100644 (file)
--- a/trionan.c
+++ b/trionan.c
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  ************************************************************************
@@ -123,8 +123,8 @@ static TRIO_CONST char rcsid[] = "@(#)$Id$";
  * integer, becomes 0x0706050403020100 (we could have used a 64-bit
  * integer value instead of a double, but not all platforms supports
  * that type). The value is automatically encoded with the correct
- * endianess by the compiler, which means that we can support any
- * kind of endianess. The individual bytes are then used as an index
+ * endianness by the compiler, which means that we can support any
+ * kind of endianness. The individual bytes are then used as an index
  * for the IEEE 754 bit-patterns and masks.
  */
 #define TRIO_DOUBLE_INDEX(x) (((unsigned char *)&internalEndianMagic)[7-(x)])
index be6e718..eac0e6f 100644 (file)
--- a/trionan.h
+++ b/trionan.h
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  ************************************************************************/
diff --git a/triop.h b/triop.h
index 8462c56..6d486f8 100644 (file)
--- a/triop.h
+++ b/triop.h
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  ************************************************************************
index 123bbeb..5937a44 100644 (file)
--- a/triostr.c
+++ b/triostr.c
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  ************************************************************************/
index 27f4ace..0a0e71a 100644 (file)
--- a/triostr.h
+++ b/triostr.h
@@ -10,7 +10,7 @@
  *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
  * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
  *
  ************************************************************************/
diff --git a/uri.c b/uri.c
index 05d81e5..8204825 100644 (file)
--- a/uri.c
+++ b/uri.c
@@ -11,6 +11,7 @@
 #define IN_LIBXML
 #include "libxml.h"
 
+#include <limits.h>
 #include <string.h>
 
 #include <libxml/xmlmemory.h>
@@ -329,9 +330,14 @@ xmlParse3986Port(xmlURIPtr uri, const char **str)
 
     if (ISA_DIGIT(cur)) {
        while (ISA_DIGIT(cur)) {
-           port = port * 10 + (*cur - '0');
-            if (port > 99999999)
-                port = 99999999;
+            int digit = *cur - '0';
+
+            if (port > INT_MAX / 10)
+                return(1);
+            port *= 10;
+            if (port > INT_MAX - digit)
+                return(1);
+           port += digit;
 
            cur++;
        }
@@ -348,7 +354,7 @@ xmlParse3986Port(xmlURIPtr uri, const char **str)
  * @uri:  pointer to an URI structure
  * @str:  the string to analyze
  *
- * Parse an user informations part and fills in the appropriate fields
+ * Parse an user information part and fills in the appropriate fields
  * of the @uri structure
  *
  * userinfo      = *( unreserved / pct-encoded / sub-delims / ":" )
@@ -1748,11 +1754,6 @@ xmlURIEscape(const xmlChar * str)
     xmlURIPtr uri;
     int ret2;
 
-#define NULLCHK(p) if(!p) { \
-         xmlURIErrMemory("escaping URI value\n"); \
-         xmlFreeURI(uri); \
-         return NULL; } \
-
     if (str == NULL)
         return (NULL);
 
@@ -1774,6 +1775,12 @@ xmlURIEscape(const xmlChar * str)
 
     ret = NULL;
 
+#define NULLCHK(p) if(!p) { \
+         xmlURIErrMemory("escaping URI value\n"); \
+         xmlFreeURI(uri); \
+         xmlFree(ret); \
+         return NULL; } \
+
     if (uri->scheme) {
         segment = xmlURIEscapeStr(BAD_CAST uri->scheme, BAD_CAST "+-.");
         NULLCHK(segment)
@@ -1794,7 +1801,7 @@ xmlURIEscape(const xmlChar * str)
     if (uri->user) {
         segment = xmlURIEscapeStr(BAD_CAST uri->user, BAD_CAST ";:&=+$,");
         NULLCHK(segment)
-               ret = xmlStrcat(ret,BAD_CAST "//");
+        ret = xmlStrcat(ret,BAD_CAST "//");
         ret = xmlStrcat(ret, segment);
         ret = xmlStrcat(ret, BAD_CAST "@");
         xmlFree(segment);
@@ -1803,8 +1810,8 @@ xmlURIEscape(const xmlChar * str)
     if (uri->server) {
         segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
         NULLCHK(segment)
-               if (uri->user == NULL)
-               ret = xmlStrcat(ret, BAD_CAST "//");
+        if (uri->user == NULL)
+            ret = xmlStrcat(ret, BAD_CAST "//");
         ret = xmlStrcat(ret, segment);
         xmlFree(segment);
     }
diff --git a/valid.c b/valid.c
index 07963e7..5ee391c 100644 (file)
--- a/valid.c
+++ b/valid.c
@@ -50,7 +50,7 @@ xmlValidateAttributeValueInternal(xmlDocPtr doc, xmlAttributeType type,
 /**
  * xmlVErrMemory:
  * @ctxt:  an XML validation parser context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory error
  */
@@ -89,7 +89,7 @@ xmlVErrMemory(xmlValidCtxtPtr ctxt, const char *extra)
  * xmlErrValid:
  * @ctxt:  an XML validation parser context
  * @error:  the error number
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a validation error
  */
@@ -131,11 +131,11 @@ xmlErrValid(xmlValidCtxtPtr ctxt, xmlParserErrors error,
  * @ctxt:  an XML validation parser context
  * @node:  the node raising the error
  * @error:  the error number
- * @str1:  extra informations
- * @str2:  extra informations
- * @str3:  extra informations
+ * @str1:  extra information
+ * @str2:  extra information
+ * @str3:  extra information
  *
- * Handle a validation error, provide contextual informations
+ * Handle a validation error, provide contextual information
  */
 static void LIBXML_ATTR_FORMAT(4,0)
 xmlErrValidNode(xmlValidCtxtPtr ctxt,
@@ -174,11 +174,11 @@ xmlErrValidNode(xmlValidCtxtPtr ctxt,
  * @ctxt:  an XML validation parser context
  * @node:  the node raising the error
  * @error:  the error number
- * @str1:  extra informations
- * @int2:  extra informations
- * @str3:  extra informations
+ * @str1:  extra information
+ * @int2:  extra information
+ * @str3:  extra information
  *
- * Handle a validation error, provide contextual informations
+ * Handle a validation error, provide contextual information
  */
 static void LIBXML_ATTR_FORMAT(4,0)
 xmlErrValidNodeNr(xmlValidCtxtPtr ctxt,
@@ -1174,7 +1174,7 @@ xmlFreeElementContent(xmlElementContentPtr cur) {
  * @buf:  An XML buffer
  * @cur:  An element table
  *
- * Dump the occurence operator of an element.
+ * Dump the occurrence operator of an element.
  */
 static void
 xmlDumpElementOccur(xmlBufferPtr buf, xmlElementContentPtr cur) {
@@ -5434,7 +5434,7 @@ fail:
     } else if (ret == -2) {
        /*
         * An entities reference appeared at this level.
-        * Buid a minimal representation of this node content
+        * Build a minimal representation of this node content
         * sufficient to run the validation process on it
         */
        DEBUG_VALID_MSG("Found an entity reference, linearizing");
@@ -5919,28 +5919,27 @@ xmlValidatePushCData(xmlValidCtxtPtr ctxt, const xmlChar *data, int len) {
                    break;
                case XML_ELEMENT_TYPE_MIXED:
                    break;
-               case XML_ELEMENT_TYPE_ELEMENT:
-                   if (len > 0) {
-                       int i;
-
-                       for (i = 0;i < len;i++) {
-                           if (!IS_BLANK_CH(data[i])) {
-                               xmlErrValidNode(ctxt, state->node,
-                                               XML_DTD_CONTENT_MODEL,
-          "Element %s content does not follow the DTD, Text not allowed\n",
-                                      state->node->name, NULL, NULL);
-                               ret = 0;
-                               goto done;
-                           }
-                       }
-                       /*
-                        * TODO:
-                        * VC: Standalone Document Declaration
-                        *  element types with element content, if white space
-                        *  occurs directly within any instance of those types.
-                        */
-                   }
-                   break;
+               case XML_ELEMENT_TYPE_ELEMENT: {
+                    int i;
+
+                    for (i = 0;i < len;i++) {
+                        if (!IS_BLANK_CH(data[i])) {
+                            xmlErrValidNode(ctxt, state->node,
+                                            XML_DTD_CONTENT_MODEL,
+       "Element %s content does not follow the DTD, Text not allowed\n",
+                                   state->node->name, NULL, NULL);
+                            ret = 0;
+                            goto done;
+                        }
+                    }
+                    /*
+                     * TODO:
+                     * VC: Standalone Document Declaration
+                     *  element types with element content, if white space
+                     *  occurs directly within any instance of those types.
+                     */
+                    break;
+                }
            }
        }
     }
index f6a0182..725b0ca 100644 (file)
@@ -106,6 +106,11 @@ CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
 LDFLAGS = $(LDFLAGS)
 !endif
 
+# append CFLAGS etc. passed on command line
+CPPFLAGS = $(CPPFLAGS) $(EXTRA_CPPFLAGS)
+CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS)
+LDFLAGS = $(LDFLAGS) $(EXTRA_LDFLAGS)
+
 # Libxml object files.
 XML_OBJS = $(XML_INTDIR)\buf.obj\
        $(XML_INTDIR)\c14n.obj\
index 6b3eddd..d02070e 100644 (file)
@@ -23,7 +23,7 @@ CONTENTS
    2.1 GNU C/C++, Mingw Edition
    2.2 Borland C++ Builder
        2.2.1 Building with iconv support
-          2.2.2 Compatability problems with MSVC (and probably CYGWIN)
+          2.2.2 Compatibility problems with MSVC (and probably CYGWIN)
           2.2.3 Other caveats
 
 
@@ -188,7 +188,7 @@ define EILSEQ=2 in Makefile.bcb. The value "2" is the value for ENOFILE (file
 not found). This should not have any disastrous side effects beyond possibly
 displaying a misleading error message in certain situations.
 
-2.2.2 Compatability problems with MSVC (and probably CYGWIN)
+2.2.2 Compatibility problems with MSVC (and probably CYGWIN)
 
 A libxml2 DLL generated by BCB is callable from MSVC programs, but there is a
 minor problem with the names of the symbols exported from the library. The
index 4805bdc..d33430b 100644 (file)
@@ -3,13 +3,13 @@ README file for VC10 project files for libxml2
 ----------------------------------------------\r
 \r
 to clarify: This is not the readme file for the whole libxml2 project. \r
-Rather, it's a readme for the VC10 project files, attached to the libxml2 proejct.\r
+Rather, it's a readme for the VC10 project files, attached to the libxml2 project.\r
 \r
 Quick Start\r
 -----------\r
 \r
 1) To use, load the libxml2.sln solution file into visual studio\r
-2) check and correct paths for dependent "iconv" project which most certaily \r
+2) check and correct paths for dependent "iconv" project which most certainly \r
 are wrong on your environment.\r
 3) Compile all projects\r
 \r
index e8c13ee..cec64c5 100644 (file)
@@ -165,9 +165,9 @@ function usage()
        txt += "              installed (" + buildLibPrefix + ")\n";
        txt += "  sodir:      Directory where shared libraries should be installed\n"; 
        txt += "              (" + buildSoPrefix + ")\n";
-       txt += "  include:    Additional search path for the compiler, particularily\n";
+       txt += "  include:    Additional search path for the compiler, particularly\n";
        txt += "              where iconv headers can be found (" + buildInclude + ")\n";
-       txt += "  lib:        Additional search path for the linker, particularily\n";
+       txt += "  lib:        Additional search path for the linker, particularly\n";
        txt += "              where iconv library can be found (" + buildLib + ")\n";
        WScript.Echo(txt);
 }
@@ -208,18 +208,18 @@ function discoverVersion()
        while (cf.AtEndOfStream != true) {
                ln = cf.ReadLine();
                s = new String(ln);
-               if (s.search(/^LIBXML_MAJOR_VERSION=/) != -1) {
-                       vf.WriteLine(s);
-                       verMajor = s.substring(s.indexOf("=") + 1, s.length)
-               } else if(s.search(/^LIBXML_MINOR_VERSION=/) != -1) {
-                       vf.WriteLine(s);
-                       verMinor = s.substring(s.indexOf("=") + 1, s.length)
-               } else if(s.search(/^LIBXML_MICRO_VERSION=/) != -1) {
-                       vf.WriteLine(s);
-                       verMicro = s.substring(s.indexOf("=") + 1, s.length)
+               if (m = s.match(/^m4_define\(\[MAJOR_VERSION\], (\w+)\)/)) {
+                       vf.WriteLine("LIBXML_MAJOR_VERSION=" + m[1]);
+                       verMajor = m[1];
+               } else if(m = s.match(/^m4_define\(\[MINOR_VERSION\], (\w+)\)/)) {
+                       vf.WriteLine("LIBXML_MINOR_VERSION=" + m[1]);
+                       verMinor = m[1];
+               } else if(m = s.match(/^m4_define\(\[MICRO_VERSION\], (\w+)\)/)) {
+                       vf.WriteLine("LIBXML_MICRO_VERSION=" + m[1]);
+                       verMicro = m[1];
                } else if(s.search(/^LIBXML_MICRO_VERSION_SUFFIX=/) != -1) {
                        vf.WriteLine(s);
-                       verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length)
+                       verMicroSuffix = s.substring(s.indexOf("=") + 1, s.length);
                }
        }
        cf.Close();
@@ -280,7 +280,7 @@ function discoverVersion()
                vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
        }
        vf.Close();
-       versionFile = "rcVersion.h"
+       versionFile = "rcVersion.h";
        vf = fso.CreateTextFile(versionFile, true);
        vf.WriteLine("/*");
        vf.WriteLine("  " + versionFile);
@@ -291,7 +291,7 @@ function discoverVersion()
        vf.WriteLine("#define LIBXML_MINOR_VERSION " + verMinor);
        vf.WriteLine("#define LIBXML_MICRO_VERSION " + verMicro);
        vf.WriteLine("#define LIBXML_DOTTED_VERSION " + "\"" + verMajor + "." + verMinor + "." + verMicro + "\"");
-       vf.Close()
+       vf.Close();
 }
 
 /* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
@@ -430,7 +430,7 @@ function genReadme(bname, ver, file)
        f.WriteLine("platform.");
        f.WriteBlankLines(1);
        f.WriteLine("  The files in this package do not require any special installation");
-       f.WriteLine("steps. Extract the contents of the archive whereever you wish and");
+       f.WriteLine("steps. Extract the contents of the archive wherever you wish and");
        f.WriteLine("make sure that your tools which use " + bname + " can find it.");
        f.WriteBlankLines(1);
        f.WriteLine("  For example, if you want to run the supplied utilities from the command");
@@ -544,8 +544,6 @@ for (i = 0; (i < WScript.Arguments.length) && (error == 0); i++) {
                        buildStatic = strToBool(arg.substring(opt.length + 1, arg.length));
                else if (opt == "prefix")
                        buildPrefix = arg.substring(opt.length + 1, arg.length);
-               else if (opt == "incdir")
-                       buildIncPrefix = arg.substring(opt.length + 1, arg.length);
                else if (opt == "bindir")
                        buildBinPrefix = arg.substring(opt.length + 1, arg.length);
                else if (opt == "libdir")
index ba850fa..b2e6ea1 100644 (file)
@@ -59,7 +59,7 @@ struct _xmlXIncludeRef {
     xmlNodePtr            inc; /* the included copy */
     int                   xml; /* xml or txt */
     int                 count; /* how many refs use that specific doc */
-    xmlXPathObjectPtr    xptr; /* the xpointer if needed */
+    int                     fallback; /* fallback was loaded */
     int                      emptyFb; /* flag to show fallback empty */
 };
 
@@ -72,7 +72,7 @@ struct _xmlXIncludeCtxt {
 
     int                 txtNr; /* number of unparsed documents */
     int                txtMax; /* size of unparsed documents tab */
-    xmlNodePtr        *txtTab; /* array of unparsed text nodes */
+    xmlChar *         *txtTab; /* array of unparsed text strings */
     xmlURL         *txturlTab; /* array of unparsed text URLs */
 
     xmlChar *             url; /* the current URL processed */
@@ -86,10 +86,13 @@ struct _xmlXIncludeCtxt {
     xmlChar *           base; /* the current xml:base */
 
     void            *_private; /* application data */
+
+    unsigned long    incTotal; /* total number of processed inclusions */
 };
 
 static int
-xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree);
+xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
+                     int skipRoot);
 
 
 /************************************************************************
@@ -207,8 +210,6 @@ xmlXIncludeFreeRef(xmlXIncludeRefPtr ref) {
        xmlFree(ref->URI);
     if (ref->fragment != NULL)
        xmlFree(ref->fragment);
-    if (ref->xptr != NULL)
-       xmlXPathFreeObject(ref->xptr);
     xmlFree(ref);
 }
 
@@ -392,18 +393,22 @@ xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) {
        if (ctxt->incTab[i] != NULL)
            xmlXIncludeFreeRef(ctxt->incTab[i]);
     }
+    if (ctxt->incTab != NULL)
+       xmlFree(ctxt->incTab);
+    if (ctxt->txtTab != NULL) {
+       for (i = 0;i < ctxt->txtNr;i++) {
+           if (ctxt->txtTab[i] != NULL)
+               xmlFree(ctxt->txtTab[i]);
+       }
+       xmlFree(ctxt->txtTab);
+    }
     if (ctxt->txturlTab != NULL) {
        for (i = 0;i < ctxt->txtNr;i++) {
            if (ctxt->txturlTab[i] != NULL)
                xmlFree(ctxt->txturlTab[i]);
        }
-    }
-    if (ctxt->incTab != NULL)
-       xmlFree(ctxt->incTab);
-    if (ctxt->txtTab != NULL)
-       xmlFree(ctxt->txtTab);
-    if (ctxt->txturlTab != NULL)
        xmlFree(ctxt->txturlTab);
+    }
     if (ctxt->base != NULL) {
         xmlFree(ctxt->base);
     }
@@ -626,8 +631,8 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
        xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
                       "detected a local recursion with no xpointer in %s\n",
                       URL);
-       if (fragment != NULL)
-           xmlFree(fragment);
+        xmlFree(URL);
+        xmlFree(fragment);
        return(-1);
     }
 
@@ -639,12 +644,15 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
            if (xmlStrEqual(URL, ctxt->urlTab[i])) {
                xmlXIncludeErr(ctxt, cur, XML_XINCLUDE_RECURSION,
                               "detected a recursion in %s\n", URL);
+                xmlFree(URL);
+                xmlFree(fragment);
                return(-1);
            }
        }
     }
 
     ref = xmlXIncludeNewRef(ctxt, URL, cur);
+    xmlFree(URL);
     if (ref == NULL) {
        return(-1);
     }
@@ -652,7 +660,6 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) {
     ref->doc = NULL;
     ref->xml = xml;
     ref->count = 1;
-    xmlFree(URL);
     return(0);
 }
 
@@ -729,7 +736,9 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc,
         * (bug 132597)
         */
        newctxt->parseFlags = ctxt->parseFlags;
-       xmlXIncludeDoProcess(newctxt, doc, xmlDocGetRootElement(doc));
+        newctxt->incTotal = ctxt->incTotal;
+       xmlXIncludeDoProcess(newctxt, doc, xmlDocGetRootElement(doc), 0);
+        ctxt->incTotal = newctxt->incTotal;
        for (i = 0;i < ctxt->incNr;i++) {
            newctxt->incTab[i]->count--;
            newctxt->incTab[i] = NULL;
@@ -759,13 +768,14 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc,
  * Add a new text node to the list
  */
 static void
-xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) {
+xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *txt,
+                  const xmlURL url) {
 #ifdef DEBUG_XINCLUDE
     xmlGenericError(xmlGenericErrorContext, "Adding text %s\n", url);
 #endif
     if (ctxt->txtMax == 0) {
        ctxt->txtMax = 4;
-        ctxt->txtTab = (xmlNodePtr *) xmlMalloc(ctxt->txtMax *
+        ctxt->txtTab = (xmlChar **) xmlMalloc(ctxt->txtMax *
                                          sizeof(ctxt->txtTab[0]));
         if (ctxt->txtTab == NULL) {
            xmlXIncludeErrMemory(ctxt, NULL, "processing text");
@@ -780,7 +790,7 @@ xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) {
     }
     if (ctxt->txtNr >= ctxt->txtMax) {
        ctxt->txtMax *= 2;
-        ctxt->txtTab = (xmlNodePtr *) xmlRealloc(ctxt->txtTab,
+        ctxt->txtTab = (xmlChar **) xmlRealloc(ctxt->txtTab,
                     ctxt->txtMax * sizeof(ctxt->txtTab[0]));
         if (ctxt->txtTab == NULL) {
            xmlXIncludeErrMemory(ctxt, NULL, "processing text");
@@ -793,7 +803,7 @@ xmlXIncludeAddTxt(xmlXIncludeCtxtPtr ctxt, xmlNodePtr txt, const xmlURL url) {
            return;
        }
     }
-    ctxt->txtTab[ctxt->txtNr] = txt;
+    ctxt->txtTab[ctxt->txtNr] = xmlStrdup(txt);
     ctxt->txturlTab[ctxt->txtNr] = xmlStrdup(url);
     ctxt->txtNr++;
 }
@@ -1071,7 +1081,7 @@ xmlXIncludeCopyRange(xmlXIncludeCtxtPtr ctxt, xmlDocPtr target,
                case XML_ELEMENT_DECL:
                case XML_ATTRIBUTE_DECL:
                case XML_ENTITY_NODE:
-                   /* Do not copy DTD informations */
+                   /* Do not copy DTD information */
                    break;
                case XML_ENTITY_DECL:
                    /* handle crossing entities -> stack needed */
@@ -1459,7 +1469,7 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) {
      */
     if ((URL[0] == 0) || (URL[0] == '#') ||
        ((ctxt->doc != NULL) && (xmlStrEqual(URL, ctxt->doc->URL)))) {
-       doc = NULL;
+       doc = ctxt->doc;
         goto loaded;
     }
 
@@ -1551,15 +1561,8 @@ loaded:
        /*
         * Add the top children list as the replacement copy.
         */
-       if (doc == NULL)
-       {
-           /* Hopefully a DTD declaration won't be copied from
-            * the same document */
-           ctxt->incTab[nr]->inc = xmlCopyNodeList(ctxt->doc->children);
-       } else {
-           ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc,
-                                                      doc, doc->children);
-       }
+       ctxt->incTab[nr]->inc = xmlXIncludeCopyNodeList(ctxt, ctxt->doc,
+                                                       doc, doc->children);
     }
 #ifdef LIBXML_XPTR_ENABLED
     else {
@@ -1571,12 +1574,7 @@ loaded:
        xmlXPathContextPtr xptrctxt;
        xmlNodeSetPtr set;
 
-       if (doc == NULL) {
-           xptrctxt = xmlXPtrNewContext(ctxt->doc, ctxt->incTab[nr]->ref,
-                                        NULL);
-       } else {
-           xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
-       }
+       xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
        if (xptrctxt == NULL) {
            xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
                           XML_XINCLUDE_XPTR_FAILED,
@@ -1608,6 +1606,7 @@ loaded:
                               XML_XINCLUDE_XPTR_RESULT,
                               "XPointer is not a range: #%s\n",
                               fragment);
+                xmlXPathFreeObject(xptr);
                xmlXPathFreeContext(xptrctxt);
                xmlFree(URL);
                xmlFree(fragment);
@@ -1615,6 +1614,7 @@ loaded:
            case XPATH_NODESET:
                if ((xptr->nodesetval == NULL) ||
                    (xptr->nodesetval->nodeNr <= 0)) {
+                    xmlXPathFreeObject(xptr);
                    xmlXPathFreeContext(xptrctxt);
                    xmlFree(URL);
                    xmlFree(fragment);
@@ -1678,14 +1678,9 @@ loaded:
                }
            }
        }
-       if (doc == NULL) {
-           ctxt->incTab[nr]->xptr = xptr;
-           ctxt->incTab[nr]->inc = NULL;
-       } else {
-           ctxt->incTab[nr]->inc =
-               xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr);
-           xmlXPathFreeObject(xptr);
-       }
+        ctxt->incTab[nr]->inc =
+            xmlXIncludeCopyXPointer(ctxt, ctxt->doc, doc, xptr);
+        xmlXPathFreeObject(xptr);
        xmlXPathFreeContext(xptrctxt);
        xmlFree(fragment);
     }
@@ -1855,7 +1850,7 @@ xmlXIncludeLoadTxt(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) {
      */
     for (i = 0; i < ctxt->txtNr; i++) {
        if (xmlStrEqual(URL, ctxt->txturlTab[i])) {
-           node = xmlCopyNode(ctxt->txtTab[i], 1);
+            node = xmlNewText(ctxt->txtTab[i]);
            goto loaded;
        }
     }
@@ -1945,7 +1940,7 @@ xinclude_multibyte_fallback:
        xmlBufShrink(buf->buffer, len);
     }
     xmlFreeParserCtxt(pctxt);
-    xmlXIncludeAddTxt(ctxt, node, URL);
+    xmlXIncludeAddTxt(ctxt, node->content, URL);
     xmlFreeInputStream(inputStream);
 
 loaded:
@@ -1988,19 +1983,23 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) {
        newctxt->_private = ctxt->_private;
        newctxt->base = xmlStrdup(ctxt->base);  /* Inherit the base from the existing context */
        xmlXIncludeSetFlags(newctxt, ctxt->parseFlags);
-       ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children);
+        newctxt->incTotal = ctxt->incTotal;
+        if (xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback, 1) < 0)
+            ret = -1;
+        ctxt->incTotal = newctxt->incTotal;
        if (ctxt->nbErrors > oldNbErrors)
            ret = -1;
-       else if (ret > 0)
-           ret = 0;    /* xmlXIncludeDoProcess can return +ve number */
        xmlXIncludeFreeContext(newctxt);
 
        ctxt->incTab[nr]->inc = xmlDocCopyNodeList(ctxt->doc,
                                                   fallback->children);
+        if (ctxt->incTab[nr]->inc == NULL)
+            ctxt->incTab[nr]->emptyFb = 1;
     } else {
         ctxt->incTab[nr]->inc = NULL;
        ctxt->incTab[nr]->emptyFb = 1;  /* flag empty callback */
     }
+    ctxt->incTab[nr]->fallback = 1;
     return(ret);
 }
 
@@ -2156,8 +2155,7 @@ xmlXIncludeLoadNode(xmlXIncludeCtxtPtr ctxt, int nr) {
                ((xmlStrEqual(children->ns->href, XINCLUDE_NS)) ||
                 (xmlStrEqual(children->ns->href, XINCLUDE_OLD_NS)))) {
                ret = xmlXIncludeLoadFallback(ctxt, children, nr);
-               if (ret == 0)
-                   break;
+               break;
            }
            children = children->next;
        }
@@ -2204,19 +2202,9 @@ xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) {
     if ((cur == NULL) || (cur->type == XML_NAMESPACE_DECL))
        return(-1);
 
-    /*
-     * If we stored an XPointer a late computation may be needed
-     */
-    if ((ctxt->incTab[nr]->inc == NULL) &&
-       (ctxt->incTab[nr]->xptr != NULL)) {
-       ctxt->incTab[nr]->inc =
-           xmlXIncludeCopyXPointer(ctxt, ctxt->doc, ctxt->doc,
-                                   ctxt->incTab[nr]->xptr);
-       xmlXPathFreeObject(ctxt->incTab[nr]->xptr);
-       ctxt->incTab[nr]->xptr = NULL;
-    }
     list = ctxt->incTab[nr]->inc;
     ctxt->incTab[nr]->inc = NULL;
+    ctxt->incTab[nr]->emptyFb = 0;
 
     /*
      * Check against the risk of generating a multi-rooted document
@@ -2236,6 +2224,7 @@ xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) {
                           XML_XINCLUDE_MULTIPLE_ROOT,
                       "XInclude error: would result in multiple root nodes\n",
                           NULL);
+            xmlFreeNodeList(list);
            return(-1);
        }
     }
@@ -2253,16 +2242,27 @@ xmlXIncludeIncludeNode(xmlXIncludeCtxtPtr ctxt, int nr) {
        xmlUnlinkNode(cur);
        xmlFreeNode(cur);
     } else {
+        xmlNodePtr child, next;
+
        /*
         * Change the current node as an XInclude start one, and add an
         * XInclude end one
         */
+        if (ctxt->incTab[nr]->fallback)
+            xmlUnsetProp(cur, BAD_CAST "href");
        cur->type = XML_XINCLUDE_START;
+        /* Remove fallback children */
+        for (child = cur->children; child != NULL; child = next) {
+            next = child->next;
+            xmlUnlinkNode(child);
+            xmlFreeNode(child);
+        }
        end = xmlNewDocNode(cur->doc, cur->ns, cur->name, NULL);
        if (end == NULL) {
            xmlXIncludeErr(ctxt, ctxt->incTab[nr]->ref,
                           XML_XINCLUDE_BUILD_FAILED,
                           "failed to build node\n", NULL);
+            xmlFreeNodeList(list);
            return(-1);
        }
        end->type = XML_XINCLUDE_END;
@@ -2364,6 +2364,7 @@ xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
  * @ctxt: the XInclude processing context
  * @doc: an XML document
  * @tree: the top of the tree to process
+ * @skipRoot: don't process the root node of the tree
  *
  * Implement the XInclude substitution on the XML document @doc
  *
@@ -2371,13 +2372,16 @@ xmlXIncludeTestNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
  *    or the number of substitutions done.
  */
 static int
-xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) {
+xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree,
+                     int skipRoot) {
     xmlNodePtr cur;
     int ret = 0;
     int i, start;
 
     if ((doc == NULL) || (tree == NULL) || (tree->type == XML_NAMESPACE_DECL))
        return(-1);
+    if ((skipRoot) && (tree->children == NULL))
+        return(-1);
     if (ctxt == NULL)
        return(-1);
 
@@ -2389,40 +2393,58 @@ xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) {
     start = ctxt->incNr;
 
     /*
+     * TODO: The phases must run separately for recursive inclusions.
+     *
+     * - Phase 1 should start with top-level XInclude nodes, load documents,
+     *   execute XPointer expressions, then process only the result nodes
+     *   (not whole document, see bug #324081) and only for phase 1
+     *   recursively. We will need a backreference from xmlNodes to
+     *   xmlIncludeRefs to detect references that were already visited.
+     *   This can also be used for proper cycle detection, see bug #344240.
+     *
+     * - Phase 2 should visit all top-level XInclude nodes and expand
+     *   possible subreferences in the replacement recursively.
+     *
+     * - Phase 3 should finally replace the top-level XInclude nodes.
+     *   It could also be run together with phase 2.
+     */
+
+    /*
      * First phase: lookup the elements in the document
      */
-    cur = tree;
-    if (xmlXIncludeTestNode(ctxt, cur) == 1)
-       xmlXIncludePreProcessNode(ctxt, cur);
-    while ((cur != NULL) && (cur != tree->parent)) {
+    if (skipRoot)
+        cur = tree->children;
+    else
+        cur = tree;
+    do {
        /* TODO: need to work on entities -> stack */
-       if ((cur->children != NULL) &&
-           (cur->children->type != XML_ENTITY_DECL) &&
-           (cur->children->type != XML_XINCLUDE_START) &&
-           (cur->children->type != XML_XINCLUDE_END)) {
-           cur = cur->children;
-           if (xmlXIncludeTestNode(ctxt, cur))
-               xmlXIncludePreProcessNode(ctxt, cur);
-       } else if (cur->next != NULL) {
-           cur = cur->next;
-           if (xmlXIncludeTestNode(ctxt, cur))
-               xmlXIncludePreProcessNode(ctxt, cur);
-       } else {
-           if (cur == tree)
-               break;
-           do {
-               cur = cur->parent;
-               if ((cur == NULL) || (cur == tree->parent))
-                   break; /* do */
-               if (cur->next != NULL) {
-                   cur = cur->next;
-                   if (xmlXIncludeTestNode(ctxt, cur))
-                       xmlXIncludePreProcessNode(ctxt, cur);
-                   break; /* do */
-               }
-           } while (cur != NULL);
-       }
-    }
+        if (xmlXIncludeTestNode(ctxt, cur) == 1) {
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+            /*
+             * Avoid superlinear expansion by limiting the total number
+             * of replacements.
+             */
+            if (ctxt->incTotal >= 20)
+                return(-1);
+#endif
+            ctxt->incTotal++;
+            xmlXIncludePreProcessNode(ctxt, cur);
+        } else if ((cur->children != NULL) &&
+                   ((cur->type == XML_DOCUMENT_NODE) ||
+                    (cur->type == XML_ELEMENT_NODE))) {
+            cur = cur->children;
+            continue;
+        }
+        do {
+            if (cur == tree)
+                break;
+            if (cur->next != NULL) {
+                cur = cur->next;
+                break;
+            }
+            cur = cur->parent;
+        } while (cur != NULL);
+    } while ((cur != NULL) && (cur != tree));
 
     /*
      * Second Phase : collect the infosets fragments
@@ -2445,8 +2467,7 @@ xmlXIncludeDoProcess(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr tree) {
      */
     for (i = ctxt->incBase;i < ctxt->incNr; i++) {
        if ((ctxt->incTab[i]->inc != NULL) ||
-               (ctxt->incTab[i]->xptr != NULL) ||
-               (ctxt->incTab[i]->emptyFb != 0))        /* (empty fallback) */
+           (ctxt->incTab[i]->emptyFb != 0))    /* (empty fallback) */
            xmlXIncludeIncludeNode(ctxt, i);
     }
 
@@ -2500,7 +2521,7 @@ xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree, int flags, void *data) {
     ctxt->_private = data;
     ctxt->base = xmlStrdup((xmlChar *)tree->doc->URL);
     xmlXIncludeSetFlags(ctxt, flags);
-    ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree);
+    ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree, 0);
     if ((ret >= 0) && (ctxt->nbErrors > 0))
         ret = -1;
 
@@ -2584,7 +2605,7 @@ xmlXIncludeProcessTreeFlags(xmlNodePtr tree, int flags) {
        return(-1);
     ctxt->base = xmlNodeGetBase(tree->doc, tree);
     xmlXIncludeSetFlags(ctxt, flags);
-    ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree);
+    ret = xmlXIncludeDoProcess(ctxt, tree->doc, tree, 0);
     if ((ret >= 0) && (ctxt->nbErrors > 0))
        ret = -1;
 
@@ -2612,7 +2633,7 @@ xmlXIncludeProcessTree(xmlNodePtr tree) {
  * @node: a node in an XML document
  *
  * Implement the XInclude substitution for the given subtree reusing
- * the informations and data coming from the given context.
+ * the information and data coming from the given context.
  *
  * Returns 0 if no substitution were done, -1 if some processing failed
  *    or the number of substitutions done.
@@ -2624,7 +2645,7 @@ xmlXIncludeProcessNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node) {
     if ((node == NULL) || (node->type == XML_NAMESPACE_DECL) ||
         (node->doc == NULL) || (ctxt == NULL))
        return(-1);
-    ret = xmlXIncludeDoProcess(ctxt, node->doc, node);
+    ret = xmlXIncludeDoProcess(ctxt, node->doc, node, 0);
     if ((ret >= 0) && (ctxt->nbErrors > 0))
        ret = -1;
     return(ret);
index cb4aa61..5863ffa 100644 (file)
@@ -4,6 +4,8 @@ prefix=@prefix@
 exec_prefix=@exec_prefix@
 includedir=@includedir@
 libdir=@libdir@
+cflags=
+libs=
 
 usage()
 {
@@ -95,14 +97,13 @@ while test $# -gt 0; do
         ;;
 
     *)
-       usage
-       exit 1
+       usage 1
        ;;
     esac
     shift
 done
 
-if test "$cflags" -o "$libs"; then
+if test -n "$cflags$libs"; then
     echo $cflags $libs
 fi
 
diff --git a/xmlIO.c b/xmlIO.c
index 752d5e0..57312b9 100644 (file)
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -224,7 +224,7 @@ __xmlIOWin32UTF8ToWChar(const char *u8String)
 
 /**
  * xmlIOErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -238,7 +238,7 @@ xmlIOErrMemory(const char *extra)
  * __xmlIOErr:
  * @code:  the error number
  * @
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an I/O error
  */
@@ -416,7 +416,7 @@ __xmlIOErr(int domain, int code, const char *extra)
 /**
  * xmlIOErr:
  * @code:  the error number
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an I/O error
  */
@@ -429,7 +429,7 @@ xmlIOErr(int code, const char *extra)
 /**
  * __xmlLoaderErr:
  * @ctx: the parser context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a resource access error
  */
@@ -560,6 +560,33 @@ xmlCleanupOutputCallbacks(void)
     xmlOutputCallbackNr = 0;
     xmlOutputCallbackInitialized = 0;
 }
+
+/**
+ * xmlPopOutputCallbacks:
+ *
+ * Remove the top output callbacks from the output stack. This includes the
+ * compiled-in I/O.
+ *
+ * Returns the number of output callback registered or -1 in case of error.
+ */
+int
+xmlPopOutputCallbacks(void)
+{
+    if (!xmlOutputCallbackInitialized)
+        return(-1);
+
+    if (xmlOutputCallbackNr <= 0)
+        return(-1);
+
+    xmlOutputCallbackNr--;
+    xmlOutputCallbackTable[xmlOutputCallbackNr].matchcallback = NULL;
+    xmlOutputCallbackTable[xmlOutputCallbackNr].opencallback = NULL;
+    xmlOutputCallbackTable[xmlOutputCallbackNr].writecallback = NULL;
+    xmlOutputCallbackTable[xmlOutputCallbackNr].closecallback = NULL;
+
+    return(xmlOutputCallbackNr);
+}
+
 #endif /* LIBXML_OUTPUT_ENABLED */
 
 /************************************************************************
@@ -3374,18 +3401,12 @@ xmlOutputBufferWrite(xmlOutputBufferPtr out, int len, const char *buf) {
                out->error = XML_IO_ENCODER;
                return(-1);
            }
-            if (out->writecallback)
-               nbchars = xmlBufUse(out->conv);
-            else
-                nbchars = ret;
+            nbchars = ret >= 0 ? ret : 0;
        } else {
            ret = xmlBufAdd(out->buffer, (const xmlChar *) buf, chunk);
            if (ret != 0)
                return(-1);
-            if (out->writecallback)
-               nbchars = xmlBufUse(out->buffer);
-            else
-                nbchars = chunk;
+            nbchars = chunk;
        }
        buf += chunk;
        len -= chunk;
@@ -3572,19 +3593,13 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
                out->error = XML_IO_ENCODER;
                return(-1);
            }
-            if (out->writecallback)
-               nbchars = xmlBufUse(out->conv);
-            else
-                nbchars = ret;
+            nbchars = ret >= 0 ? ret : 0;
        } else {
            ret = escaping(xmlBufEnd(out->buffer), &chunk, str, &cons);
            if ((ret < 0) || (chunk == 0)) /* chunk==0 => nothing done */
                return(-1);
             xmlBufAddLen(out->buffer, chunk);
-            if (out->writecallback)
-               nbchars = xmlBufUse(out->buffer);
-            else
-                nbchars = chunk;
+            nbchars = chunk;
        }
        str += cons;
        len -= cons;
index c02b97f..3f0e1b9 100644 (file)
@@ -325,7 +325,7 @@ Usage : %s [options] catalogfile entities...\n\
 \t         used with --add or --del, it saves the catalog changes\n\
 \t         and with --sgml it automatically updates the super catalog\n\
 \t--no-super-update: do not update the SGML super catalog\n\
-\t-v --verbose : provide debug informations\n");
+\t-v --verbose : provide debug information\n");
 }
 int main(int argc, char **argv) {
     int i;
index 735d951..a3fe10a 100644 (file)
--- a/xmllint.c
+++ b/xmllint.c
@@ -165,6 +165,7 @@ static int xinclude = 0;
 static int dtdattrs = 0;
 static int loaddtd = 0;
 static xmllintReturnCode progresult = XMLLINT_RETURN_OK;
+static int quiet = 0;
 static int timing = 0;
 static int generate = 0;
 static int dropdtd = 0;
@@ -528,6 +529,12 @@ static void
 xmlHTMLEncodeSend(void) {
     char *result;
 
+    /*
+     * xmlEncodeEntitiesReentrant assumes valid UTF-8, but the buffer might
+     * end with a truncated UTF-8 sequence. This is a hack to at least avoid
+     * an out-of-bounds read.
+     */
+    memset(&buffer[sizeof(buffer)-4], 0, 4);
     result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
     if (result) {
        xmlGenericError(xmlGenericErrorContext, "%s", result);
@@ -540,7 +547,7 @@ xmlHTMLEncodeSend(void) {
  * xmlHTMLPrintFileInfo:
  * @input:  an xmlParserInputPtr input
  *
- * Displays the associated file and line informations for the current input
+ * Displays the associated file and line information for the current input
  */
 
 static void
@@ -1659,7 +1666,9 @@ testSAX(const char *filename) {
                                      (void *)user_data);
        if (repeat == 0) {
            if (ret == 0) {
-               fprintf(stderr, "%s validates\n", filename);
+               if (!quiet) {
+                   fprintf(stderr, "%s validates\n", filename);
+               }
            } else if (ret > 0) {
                fprintf(stderr, "%s fails to validate\n", filename);
                progresult = XMLLINT_ERR_VALID;
@@ -1942,7 +1951,9 @@ static void streamFile(char *filename) {
                fprintf(stderr, "%s fails to validate\n", filename);
                progresult = XMLLINT_ERR_VALID;
            } else {
-               fprintf(stderr, "%s validates\n", filename);
+               if (!quiet) {
+                   fprintf(stderr, "%s validates\n", filename);
+               }
            }
        }
 #endif
@@ -2182,13 +2193,17 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
     else if ((html) && (push)) {
         FILE *f;
 
+        if ((filename[0] == '-') && (filename[1] == 0)) {
+            f = stdin;
+        } else {
 #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
-       f = fopen(filename, "rb");
+           f = fopen(filename, "rb");
 #elif defined(__OS400__)
-       f = fopen(filename, "rb");
+           f = fopen(filename, "rb");
 #else
-       f = fopen(filename, "r");
+           f = fopen(filename, "r");
 #endif
+        }
         if (f != NULL) {
             int res;
             char chars[4096];
@@ -2198,7 +2213,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
             if (res > 0) {
                 ctxt = htmlCreatePushParserCtxt(NULL, NULL,
                             chars, res, filename, XML_CHAR_ENCODING_NONE);
-                xmlCtxtUseOptions(ctxt, options);
+                htmlCtxtUseOptions(ctxt, options);
                 while ((res = fread(chars, 1, pushsize, f)) > 0) {
                     htmlParseChunk(ctxt, chars, res, 0);
                 }
@@ -2277,7 +2292,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
                    doc = ctxt->myDoc;
                    ret = ctxt->wellFormed;
                    xmlFreeParserCtxt(ctxt);
-                   if (!ret) {
+                   if ((!ret) && (!recovery)) {
                        xmlFreeDoc(doc);
                        doc = NULL;
                    }
@@ -2411,6 +2426,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
        dtd = xmlGetIntSubset(doc);
        if (dtd != NULL) {
            xmlUnlinkNode((xmlNodePtr)dtd);
+            doc->intSubset = NULL;
            xmlFreeDtd(dtd);
        }
     }
@@ -2830,7 +2846,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
 #endif
        ret = xmlSchematronValidateDoc(ctxt, doc);
        if (ret == 0) {
-           fprintf(stderr, "%s validates\n", filename);
+           if (!quiet) {
+               fprintf(stderr, "%s validates\n", filename);
+           }
        } else if (ret > 0) {
            fprintf(stderr, "%s fails to validate\n", filename);
            progresult = XMLLINT_ERR_VALID;
@@ -2858,7 +2876,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
        xmlRelaxNGSetValidErrors(ctxt, xmlGenericError, xmlGenericError, NULL);
        ret = xmlRelaxNGValidateDoc(ctxt, doc);
        if (ret == 0) {
-           fprintf(stderr, "%s validates\n", filename);
+           if (!quiet) {
+               fprintf(stderr, "%s validates\n", filename);
+           }
        } else if (ret > 0) {
            fprintf(stderr, "%s fails to validate\n", filename);
            progresult = XMLLINT_ERR_VALID;
@@ -2883,7 +2903,9 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
        xmlSchemaSetValidErrors(ctxt, xmlGenericError, xmlGenericError, NULL);
        ret = xmlSchemaValidateDoc(ctxt, doc);
        if (ret == 0) {
-           fprintf(stderr, "%s validates\n", filename);
+           if (!quiet) {
+               fprintf(stderr, "%s validates\n", filename);
+           }
        } else if (ret > 0) {
            fprintf(stderr, "%s fails to validate\n", filename);
            progresult = XMLLINT_ERR_VALID;
@@ -3000,6 +3022,7 @@ static void usage(FILE *f, const char *name) {
     fprintf(f, "\t--dtdvalid URL : do a posteriori validation against a given DTD\n");
     fprintf(f, "\t--dtdvalidfpi FPI : same but name the DTD with a Public Identifier\n");
 #endif /* LIBXML_VALID_ENABLED */
+    fprintf(f, "\t--quiet : be quiet when succeeded\n");
     fprintf(f, "\t--timing : print some timings\n");
     fprintf(f, "\t--output file or -o file: save to a given file\n");
     fprintf(f, "\t--repeat : repeat 100 times, for timing or profiling\n");
@@ -3234,6 +3257,9 @@ main(int argc, char **argv) {
        else if ((!strcmp(argv[i], "-insert")) ||
                 (!strcmp(argv[i], "--insert")))
            insert++;
+       else if ((!strcmp(argv[i], "-quiet")) ||
+                (!strcmp(argv[i], "--quiet")))
+           quiet++;
        else if ((!strcmp(argv[i], "-timing")) ||
                 (!strcmp(argv[i], "--timing")))
            timing++;
index 6f16c4b..c51f49a 100644 (file)
@@ -75,7 +75,7 @@ void xmlMallocBreakpoint(void);
 #endif
 
 /*
- * Each of the blocks allocated begin with a header containing informations
+ * Each of the blocks allocated begin with a header containing information
  */
 
 #define MEMTAG 0x5aa5
index f3891e4..72e40b0 100644 (file)
 
 #define MAX_ERR_MSG_SIZE 64000
 
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+/* Keeping free objects can hide memory errors. */
+#define MAX_FREE_NODES 1
+#else
+#define MAX_FREE_NODES 100
+#endif
+
 /*
  * The following VA_COPY was coded following an example in
  * the Samba project.  It may not be sufficient for some
@@ -279,6 +286,59 @@ xmlTextReaderRemoveID(xmlDocPtr doc, xmlAttrPtr attr) {
 }
 
 /**
+ * xmlTextReaderWalkRemoveRef:
+ * @data:  Contents of current link
+ * @user:  Value supplied by the user
+ *
+ * Returns 0 to abort the walk or 1 to continue
+ */
+static int
+xmlTextReaderWalkRemoveRef(const void *data, void *user)
+{
+    xmlRefPtr ref = (xmlRefPtr)data;
+    xmlAttrPtr attr = (xmlAttrPtr)user;
+
+    if (ref->attr == attr) { /* Matched: remove and terminate walk */
+        ref->name = xmlStrdup(attr->name);
+        ref->attr = NULL;
+        return 0;
+    }
+    return 1;
+}
+
+/**
+ * xmlTextReaderRemoveRef:
+ * @doc:  the document
+ * @attr:  the attribute
+ *
+ * Remove the given attribute from the Ref table maintained internally.
+ *
+ * Returns -1 if the lookup failed and 0 otherwise
+ */
+static int
+xmlTextReaderRemoveRef(xmlDocPtr doc, xmlAttrPtr attr) {
+    xmlListPtr ref_list;
+    xmlRefTablePtr table;
+    xmlChar *ID;
+
+    if (doc == NULL) return(-1);
+    if (attr == NULL) return(-1);
+    table = (xmlRefTablePtr) doc->refs;
+    if (table == NULL)
+        return(-1);
+
+    ID = xmlNodeListGetString(doc, attr->children, 1);
+    if (ID == NULL)
+        return(-1);
+    ref_list = xmlHashLookup(table, ID);
+    xmlFree(ID);
+    if(ref_list == NULL)
+        return (-1);
+    xmlListWalk(ref_list, xmlTextReaderWalkRemoveRef, attr);
+    return(0);
+}
+
+/**
  * xmlTextReaderFreeProp:
  * @reader:  the xmlTextReaderPtr used
  * @cur:  the node
@@ -299,18 +359,20 @@ xmlTextReaderFreeProp(xmlTextReaderPtr reader, xmlAttrPtr cur) {
        xmlDeregisterNodeDefaultValue((xmlNodePtr) cur);
 
     /* Check for ID removal -> leading to invalid references ! */
-    if ((cur->parent != NULL) && (cur->parent->doc != NULL) &&
-       ((cur->parent->doc->intSubset != NULL) ||
-        (cur->parent->doc->extSubset != NULL))) {
+    if ((cur->parent != NULL) && (cur->parent->doc != NULL)) {
         if (xmlIsID(cur->parent->doc, cur->parent, cur))
            xmlTextReaderRemoveID(cur->parent->doc, cur);
+       if (((cur->parent->doc->intSubset != NULL) ||
+            (cur->parent->doc->extSubset != NULL)) &&
+            (xmlIsRef(cur->parent->doc, cur->parent, cur)))
+            xmlTextReaderRemoveRef(cur->parent->doc, cur);
     }
     if (cur->children != NULL)
         xmlTextReaderFreeNodeList(reader, cur->children);
 
     DICT_FREE(cur->name);
     if ((reader != NULL) && (reader->ctxt != NULL) &&
-        (reader->ctxt->freeAttrsNr < 100)) {
+        (reader->ctxt->freeAttrsNr < MAX_FREE_NODES)) {
         cur->next = reader->ctxt->freeAttrs;
        reader->ctxt->freeAttrs = cur;
        reader->ctxt->freeAttrsNr++;
@@ -411,7 +473,7 @@ xmlTextReaderFreeNodeList(xmlTextReaderPtr reader, xmlNodePtr cur) {
            if (((cur->type == XML_ELEMENT_NODE) ||
                 (cur->type == XML_TEXT_NODE)) &&
                (reader != NULL) && (reader->ctxt != NULL) &&
-               (reader->ctxt->freeElemsNr < 100)) {
+               (reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
                cur->next = reader->ctxt->freeElems;
                reader->ctxt->freeElems = cur;
                reader->ctxt->freeElemsNr++;
@@ -499,7 +561,7 @@ xmlTextReaderFreeNode(xmlTextReaderPtr reader, xmlNodePtr cur) {
     if (((cur->type == XML_ELEMENT_NODE) ||
         (cur->type == XML_TEXT_NODE)) &&
        (reader != NULL) && (reader->ctxt != NULL) &&
-       (reader->ctxt->freeElemsNr < 100)) {
+       (reader->ctxt->freeElemsNr < MAX_FREE_NODES)) {
        cur->next = reader->ctxt->freeElems;
        reader->ctxt->freeElems = cur;
        reader->ctxt->freeElemsNr++;
@@ -1106,20 +1168,9 @@ static void
 xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
     xmlNodePtr oldnode = reader->node;
     xmlNodePtr node = reader->node;
-    xmlParserCtxtPtr ctxt = reader->ctxt;
 
     do {
        if (node->type == XML_ENTITY_REF_NODE) {
-           /*
-            * Case where the underlying tree is not available, lookup the entity
-            * and walk it.
-            */
-           if ((node->children == NULL) && (ctxt->sax != NULL) &&
-               (ctxt->sax->getEntity != NULL)) {
-               node->children = (xmlNodePtr)
-                   ctxt->sax->getEntity(ctxt, node->name);
-           }
-
            if ((node->children != NULL) &&
                (node->children->type == XML_ENTITY_DECL) &&
                (node->children->children != NULL)) {
@@ -1447,6 +1498,8 @@ get_next_node:
             (reader->node->prev->type != XML_DTD_NODE)) {
            xmlNodePtr tmp = reader->node->prev;
            if ((tmp->extra & NODE_IS_PRESERVED) == 0) {
+                if (oldnode == tmp)
+                    oldnode = NULL;
                xmlUnlinkNode(tmp);
                xmlTextReaderFreeNode(reader, tmp);
            }
@@ -1532,7 +1585,8 @@ node_found:
     /*
      * Handle XInclude if asked for
      */
-    if ((reader->xinclude) && (reader->node != NULL) &&
+    if ((reader->xinclude) && (reader->in_xinclude == 0) &&
+        (reader->node != NULL) &&
        (reader->node->type == XML_ELEMENT_NODE) &&
        (reader->node->ns != NULL) &&
        ((xmlStrEqual(reader->node->ns->href, XINCLUDE_NS)) ||
@@ -1564,16 +1618,6 @@ node_found:
     if ((reader->node != NULL) &&
        (reader->node->type == XML_ENTITY_REF_NODE) &&
        (reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
-       /*
-        * Case where the underlying tree is not available, lookup the entity
-        * and walk it.
-        */
-       if ((reader->node->children == NULL) && (reader->ctxt->sax != NULL) &&
-           (reader->ctxt->sax->getEntity != NULL)) {
-           reader->node->children = (xmlNodePtr)
-               reader->ctxt->sax->getEntity(reader->ctxt, reader->node->name);
-       }
-
        if ((reader->node->children != NULL) &&
            (reader->node->children->type == XML_ENTITY_DECL) &&
            (reader->node->children->children != NULL)) {
@@ -2281,14 +2325,18 @@ xmlFreeTextReader(xmlTextReaderPtr reader) {
     if (reader->ctxt != NULL) {
         if (reader->dict == reader->ctxt->dict)
            reader->dict = NULL;
+#ifdef LIBXML_VALID_ENABLED
        if ((reader->ctxt->vctxt.vstateTab != NULL) &&
            (reader->ctxt->vctxt.vstateMax > 0)){
+#ifdef LIBXML_REGEXP_ENABLED
             while (reader->ctxt->vctxt.vstateNr > 0)
                 xmlValidatePopElement(&reader->ctxt->vctxt, NULL, NULL, NULL);
+#endif /* LIBXML_REGEXP_ENABLED */
            xmlFree(reader->ctxt->vctxt.vstateTab);
            reader->ctxt->vctxt.vstateTab = NULL;
            reader->ctxt->vctxt.vstateMax = 0;
        }
+#endif /* LIBXML_VALID_ENABLED */
        if (reader->ctxt->myDoc != NULL) {
            if (reader->preserve == 0)
                xmlTextReaderFreeDoc(reader, reader->ctxt->myDoc);
@@ -2971,7 +3019,7 @@ xmlTextReaderConstEncoding(xmlTextReaderPtr reader) {
 
 /************************************************************************
  *                                                                     *
- *                     Acces API to the current node                   *
+ *                     Access API to the current node                  *
  *                                                                     *
  ************************************************************************/
 /**
@@ -3786,7 +3834,7 @@ xmlTextReaderConstString(xmlTextReaderPtr reader, const xmlChar *str) {
  *
  * The value indicating whether to normalize white space and attribute values.
  * Since attribute value and end of line normalizations are a MUST in the XML
- * specification only the value true is accepted. The broken bahaviour of
+ * specification only the value true is accepted. The broken behaviour of
  * accepting out of range character entities like &#0; is of course not
  * supported either.
  *
@@ -3848,16 +3896,20 @@ xmlTextReaderSetParserProp(xmlTextReaderPtr reader, int prop, int value) {
            return(0);
         case XML_PARSER_VALIDATE:
            if (value != 0) {
+                ctxt->options |= XML_PARSE_DTDVALID;
                ctxt->validate = 1;
                reader->validate = XML_TEXTREADER_VALIDATE_DTD;
            } else {
+                ctxt->options &= ~XML_PARSE_DTDVALID;
                ctxt->validate = 0;
            }
            return(0);
         case XML_PARSER_SUBST_ENTITIES:
            if (value != 0) {
+                ctxt->options |= XML_PARSE_NOENT;
                ctxt->replaceEntities = 1;
            } else {
+                ctxt->options &= ~XML_PARSE_NOENT;
                ctxt->replaceEntities = 0;
            }
            return(0);
index c119ff1..40dabb2 100644 (file)
@@ -26,6 +26,9 @@
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
 #endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
 
 #include <libxml/tree.h>
 #include <libxml/parserInternals.h>
@@ -36,6 +39,9 @@
 #ifndef INT_MAX
 #define INT_MAX 123456789 /* easy to flag and big enough for our needs */
 #endif
+#ifndef SIZE_MAX
+#define SIZE_MAX ((size_t) -1)
+#endif
 
 /* #define DEBUG_REGEXP_GRAPH */
 /* #define DEBUG_REGEXP_EXEC */
@@ -267,6 +273,8 @@ struct _xmlAutomata {
     int determinist;
     int negs;
     int flags;
+
+    int depth;
 };
 
 struct _xmlRegexp {
@@ -418,6 +426,32 @@ xmlRegexpErrCompile(xmlRegParserCtxtPtr ctxt, const char *extra)
  ************************************************************************/
 
 static int xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt);
+
+/**
+ * xmlRegCalloc2:
+ * @dim1:  size of first dimension
+ * @dim2:  size of second dimension
+ * @elemSize:  size of element
+ *
+ * Allocate a two-dimensional array and set all elements to zero.
+ *
+ * Returns the new array or NULL in case of error.
+ */
+static void*
+xmlRegCalloc2(size_t dim1, size_t dim2, size_t elemSize) {
+    size_t totalSize;
+    void *ret;
+
+    /* Check for overflow */
+    if (dim1 > SIZE_MAX / dim2 / elemSize)
+        return (NULL);
+    totalSize = dim1 * dim2 * elemSize;
+    ret = xmlMalloc(totalSize);
+    if (ret != NULL)
+        memset(ret, 0, totalSize);
+    return (ret);
+}
+
 /**
  * xmlRegEpxFromParse:
  * @ctxt:  the parser context used to build it
@@ -540,8 +574,8 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
 #ifdef DEBUG_COMPACTION
        printf("Final: %d atoms\n", nbatoms);
 #endif
-       transitions = (int *) xmlMalloc((nbstates + 1) *
-                                       (nbatoms + 1) * sizeof(int));
+       transitions = (int *) xmlRegCalloc2(nbstates + 1, nbatoms + 1,
+                                            sizeof(int));
        if (transitions == NULL) {
            xmlFree(stateRemap);
            xmlFree(stringRemap);
@@ -551,7 +585,6 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
            xmlFree(ret);
            return(NULL);
        }
-       memset(transitions, 0, (nbstates + 1) * (nbatoms + 1) * sizeof(int));
 
        /*
         * Allocate the transition table. The first entry for each
@@ -577,12 +610,9 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
                    continue;
                 atomno = stringRemap[trans->atom->no];
                if ((trans->atom->data != NULL) && (transdata == NULL)) {
-                   transdata = (void **) xmlMalloc(nbstates * nbatoms *
-                                                   sizeof(void *));
-                   if (transdata != NULL)
-                       memset(transdata, 0,
-                              nbstates * nbatoms * sizeof(void *));
-                   else {
+                   transdata = (void **) xmlRegCalloc2(nbstates, nbatoms,
+                                                       sizeof(void *));
+                   if (transdata == NULL) {
                        xmlRegexpErrMemory(ctxt, "compiling regexp");
                        break;
                    }
@@ -2628,7 +2658,6 @@ xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
            state->markd = XML_REGEXP_MARK_VISITED;
            res = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
                                           to, atom);
-           state->markd = 0;
            if (res == 0) {
                ret = 0;
                /* t1->nd = 1; */
@@ -2647,6 +2676,30 @@ xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
 }
 
 /**
+ * xmlFAFinishRecurseDeterminism:
+ * @ctxt:  a regexp parser context
+ *
+ * Reset flags after checking determinism.
+ */
+static void
+xmlFAFinishRecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state) {
+    int transnr, nbTrans;
+
+    if (state == NULL)
+       return;
+    if (state->markd != XML_REGEXP_MARK_VISITED)
+       return;
+    state->markd = 0;
+
+    nbTrans = state->nbTrans;
+    for (transnr = 0; transnr < nbTrans; transnr++) {
+       xmlRegTransPtr t1 = &state->trans[transnr];
+       if ((t1->atom == NULL) && (t1->to >= 0))
+           xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t1->to]);
+    }
+}
+
+/**
  * xmlFAComputesDeterminism:
  * @ctxt:  a regexp parser context
  *
@@ -2759,6 +2812,7 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
                     */
                    ret = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
                                                   t2->to, t2->atom);
+                    xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t1->to]);
                    /* don't shortcut the computation so all non deterministic
                       transition get marked down
                    if (ret == 0)
@@ -4221,7 +4275,7 @@ xmlRegExecPushString2(xmlRegExecCtxtPtr exec, const xmlChar *value,
  * @values: pointer to the array of acceptable values
  * @terminal: return value if this was a terminal state
  *
- * Extract informations from the regexp execution, internal routine to
+ * Extract information from the regexp execution, internal routine to
  * implement xmlRegExecNextValues() and xmlRegExecErrInfo()
  *
  * Returns: 0 in case of success or -1 in case of error.
@@ -4380,7 +4434,7 @@ xmlRegExecGetValues(xmlRegExecCtxtPtr exec, int err,
  * @values: pointer to the array of acceptable values
  * @terminal: return value if this was a terminal state
  *
- * Extract informations from the regexp execution,
+ * Extract information from the regexp execution,
  * the parameter @values must point to an array of @nbval string pointers
  * on return nbval will contain the number of possible strings in that
  * state and the @values array will be updated with them. The string values
@@ -4404,7 +4458,7 @@ xmlRegExecNextValues(xmlRegExecCtxtPtr exec, int *nbval, int *nbneg,
  * @values: pointer to the array of acceptable values
  * @terminal: return value if this was a terminal state
  *
- * Extract error informations from the regexp execution, the parameter
+ * Extract error information from the regexp execution, the parameter
  * @string will be updated with the value pushed and not accepted,
  * the parameter @values must point to an array of @nbval string pointers
  * on return nbval will contain the number of possible strings in that
@@ -5101,7 +5155,7 @@ xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) {
        } else {
            xmlFAParseCharRange(ctxt);
        }
-    } while ((CUR != ']') && (CUR != '^') && (CUR != '-') &&
+    } while ((CUR != ']') && (CUR != '-') &&
              (CUR != 0) && (ctxt->error == 0));
 }
 
@@ -5116,34 +5170,31 @@ xmlFAParsePosCharGroup(xmlRegParserCtxtPtr ctxt) {
  */
 static void
 xmlFAParseCharGroup(xmlRegParserCtxtPtr ctxt) {
-    int n = ctxt->neg;
-    while ((CUR != ']') && (ctxt->error == 0)) {
-       if (CUR == '^') {
-           int neg = ctxt->neg;
+    int neg = ctxt->neg;
 
-           NEXT;
-           ctxt->neg = !ctxt->neg;
-           xmlFAParsePosCharGroup(ctxt);
-           ctxt->neg = neg;
-       } else if ((CUR == '-') && (NXT(1) == '[')) {
-           int neg = ctxt->neg;
-           ctxt->neg = 2;
+    if (CUR == '^') {
+       NEXT;
+       ctxt->neg = !ctxt->neg;
+       xmlFAParsePosCharGroup(ctxt);
+       ctxt->neg = neg;
+    }
+    while ((CUR != ']') && (ctxt->error == 0)) {
+       if ((CUR == '-') && (NXT(1) == '[')) {
            NEXT;       /* eat the '-' */
            NEXT;       /* eat the '[' */
+           ctxt->neg = 2;
            xmlFAParseCharGroup(ctxt);
+           ctxt->neg = neg;
            if (CUR == ']') {
                NEXT;
            } else {
                ERROR("charClassExpr: ']' expected");
-               break;
            }
-           ctxt->neg = neg;
            break;
-       } else if (CUR != ']') {
+       } else {
            xmlFAParsePosCharGroup(ctxt);
        }
     }
-    ctxt->neg = n;
 }
 
 /**
@@ -5183,13 +5234,24 @@ static int
 xmlFAParseQuantExact(xmlRegParserCtxtPtr ctxt) {
     int ret = 0;
     int ok = 0;
+    int overflow = 0;
 
     while ((CUR >= '0') && (CUR <= '9')) {
-       ret = ret * 10 + (CUR - '0');
+        if (ret > INT_MAX / 10) {
+            overflow = 1;
+        } else {
+            int digit = CUR - '0';
+
+            ret *= 10;
+            if (ret > INT_MAX - digit)
+                overflow = 1;
+            else
+                ret += digit;
+        }
        ok = 1;
        NEXT;
     }
-    if (ok != 1) {
+    if ((ok != 1) || (overflow == 1)) {
        return(-1);
     }
     return(ret);
@@ -5229,6 +5291,9 @@ xmlFAParseQuantifier(xmlRegParserCtxtPtr ctxt) {
        cur = xmlFAParseQuantExact(ctxt);
        if (cur >= 0)
            min = cur;
+        else {
+            ERROR("Improper quantifier");
+        }
        if (CUR == ',') {
            NEXT;
            if (CUR == '}')
@@ -5288,6 +5353,10 @@ xmlFAParseAtom(xmlRegParserCtxtPtr ctxt) {
        xmlRegStatePtr start, oldend, start0;
 
        NEXT;
+        if (ctxt->depth >= 50) {
+           ERROR("xmlFAParseAtom: maximum nesting depth exceeded");
+            return(-1);
+        }
        /*
         * this extra Epsilon transition is needed if we count with 0 allowed
         * unfortunately this can't be known at that point
@@ -5299,7 +5368,9 @@ xmlFAParseAtom(xmlRegParserCtxtPtr ctxt) {
        oldend = ctxt->end;
        ctxt->end = NULL;
        ctxt->atom = NULL;
+        ctxt->depth++;
        xmlFAParseRegExp(ctxt, 0);
+        ctxt->depth--;
        if (CUR == ')') {
            NEXT;
        } else {
@@ -6055,7 +6126,7 @@ xmlAutomataNewOnceTrans2(xmlAutomataPtr am, xmlAutomataStatePtr from,
        return(NULL);
     if (min < 1)
        return(NULL);
-    if ((max < min) || (max < 1))
+    if (max < min)
        return(NULL);
     atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
     if (atom == NULL)
@@ -6134,7 +6205,7 @@ xmlAutomataNewOnceTrans(xmlAutomataPtr am, xmlAutomataStatePtr from,
        return(NULL);
     if (min < 1)
        return(NULL);
-    if ((max < min) || (max < 1))
+    if (max < min)
        return(NULL);
     atom = xmlRegNewAtom(am, XML_REGEXP_STRING);
     if (atom == NULL)
index fa00915..61a4045 100644 (file)
--- a/xmlsave.c
+++ b/xmlsave.c
@@ -100,7 +100,7 @@ struct _xmlSaveCtxt {
  ************************************************************************/
 /**
  * xmlSaveErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -114,7 +114,7 @@ xmlSaveErrMemory(const char *extra)
  * xmlSaveErr:
  * @code:  the error number
  * @node:  the location of the error.
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -590,7 +590,6 @@ static int xmlSaveClearEncoding(xmlSaveCtxtPtr ctxt) {
 static void
 xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
 #endif
-static void xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
 static void xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur);
 void xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur);
 static int xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur);
@@ -705,6 +704,7 @@ xmlNsListDumpOutput(xmlOutputBufferPtr buf, xmlNsPtr cur) {
 static void
 xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
     xmlOutputBufferPtr buf;
+    xmlNodePtr cur;
     int format, level;
 
     if (dtd == NULL) return;
@@ -742,7 +742,9 @@ xmlDtdDumpOutput(xmlSaveCtxtPtr ctxt, xmlDtdPtr dtd) {
     level = ctxt->level;
     ctxt->format = 0;
     ctxt->level = -1;
-    xmlNodeListDumpOutput(ctxt, dtd->children);
+    for (cur = dtd->children; cur != NULL; cur = cur->next) {
+        xmlNodeDumpOutputInternal(ctxt, cur);
+    }
     ctxt->format = format;
     ctxt->level = level;
     xmlOutputBufferWrite(buf, 2, "]>");
@@ -776,58 +778,9 @@ xmlAttrDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
     xmlOutputBufferWrite(buf, 1, "\"");
 }
 
-/**
- * xmlAttrListDumpOutput:
- * @buf:  the XML buffer output
- * @doc:  the document
- * @cur:  the first attribute pointer
- * @encoding:  an optional encoding string
- *
- * Dump a list of XML attributes
- */
-static void
-xmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
-    if (cur == NULL) return;
-    while (cur != NULL) {
-        xmlAttrDumpOutput(ctxt, cur);
-       cur = cur->next;
-    }
-}
-
-
-
-/**
- * xmlNodeListDumpOutput:
- * @cur:  the first node
- *
- * Dump an XML node list, recursive behaviour, children are printed too.
- */
-static void
-xmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
-    xmlOutputBufferPtr buf;
-
-    if (cur == NULL) return;
-    buf = ctxt->buf;
-    while (cur != NULL) {
-       if ((ctxt->format == 1) && (xmlIndentTreeOutput) &&
-           ((cur->type == XML_ELEMENT_NODE) ||
-            (cur->type == XML_COMMENT_NODE) ||
-            (cur->type == XML_PI_NODE)))
-           xmlOutputBufferWrite(buf, ctxt->indent_size *
-                                (ctxt->level > ctxt->indent_nr ?
-                                 ctxt->indent_nr : ctxt->level),
-                                ctxt->indent);
-        xmlNodeDumpOutputInternal(ctxt, cur);
-       if (ctxt->format == 1) {
-           xmlOutputBufferWrite(buf, 1, "\n");
-       }
-       cur = cur->next;
-    }
-}
-
 #ifdef LIBXML_HTML_ENABLED
 /**
- * xmlNodeDumpOutputInternal:
+ * htmlNodeDumpOutputInternal:
  * @cur:  the current node
  *
  * Dump an HTML node, recursive behaviour, children are printed too.
@@ -893,57 +846,111 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  */
 static void
 xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
-    int format;
-    xmlNodePtr tmp;
+    int format = ctxt->format;
+    xmlNodePtr tmp, root, unformattedNode = NULL;
+    xmlAttrPtr attr;
     xmlChar *start, *end;
     xmlOutputBufferPtr buf;
 
     if (cur == NULL) return;
     buf = ctxt->buf;
-    if (cur->type == XML_XINCLUDE_START)
-       return;
-    if (cur->type == XML_XINCLUDE_END)
-       return;
-    if ((cur->type == XML_DOCUMENT_NODE) ||
-        (cur->type == XML_HTML_DOCUMENT_NODE)) {
-       xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
-       return;
-    }
-#ifdef LIBXML_HTML_ENABLED
-    if (ctxt->options & XML_SAVE_XHTML) {
-        xhtmlNodeDumpOutput(ctxt, cur);
-        return;
-    }
-    if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) &&
-         (cur->doc->type == XML_HTML_DOCUMENT_NODE) &&
-         ((ctxt->options & XML_SAVE_AS_XML) == 0)) ||
-        (ctxt->options & XML_SAVE_AS_HTML)) {
-       htmlNodeDumpOutputInternal(ctxt, cur);
-       return;
-    }
-#endif
-    if (cur->type == XML_DTD_NODE) {
-        xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
-       return;
-    }
-    if (cur->type == XML_DOCUMENT_FRAG_NODE) {
-        xmlNodeListDumpOutput(ctxt, cur->children);
-       return;
-    }
-    if (cur->type == XML_ELEMENT_DECL) {
-        xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
-       return;
-    }
-    if (cur->type == XML_ATTRIBUTE_DECL) {
-        xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
-       return;
-    }
-    if (cur->type == XML_ENTITY_DECL) {
-        xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
-       return;
-    }
-    if (cur->type == XML_TEXT_NODE) {
-       if (cur->content != NULL) {
+
+    root = cur;
+    while (1) {
+        switch (cur->type) {
+        case XML_DOCUMENT_NODE:
+        case XML_HTML_DOCUMENT_NODE:
+           xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
+           break;
+
+        case XML_DTD_NODE:
+            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
+            break;
+
+        case XML_DOCUMENT_FRAG_NODE:
+            if (cur->children != NULL) {
+                cur = cur->children;
+                continue;
+            }
+           break;
+
+        case XML_ELEMENT_DECL:
+            xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
+            break;
+
+        case XML_ATTRIBUTE_DECL:
+            xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
+            break;
+
+        case XML_ENTITY_DECL:
+            xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
+            break;
+
+        case XML_ELEMENT_NODE:
+           if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+               xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                    (ctxt->level > ctxt->indent_nr ?
+                                     ctxt->indent_nr : ctxt->level),
+                                    ctxt->indent);
+
+            xmlOutputBufferWrite(buf, 1, "<");
+            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
+                xmlOutputBufferWrite(buf, 1, ":");
+            }
+            xmlOutputBufferWriteString(buf, (const char *)cur->name);
+            if (cur->nsDef)
+                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
+            for (attr = cur->properties; attr != NULL; attr = attr->next)
+                xmlAttrDumpOutput(ctxt, attr);
+
+            if (cur->children == NULL) {
+                if ((ctxt->options & XML_SAVE_NO_EMPTY) == 0) {
+                    if (ctxt->format == 2)
+                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
+                    xmlOutputBufferWrite(buf, 2, "/>");
+                } else {
+                    if (ctxt->format == 2)
+                        xmlOutputBufferWriteWSNonSig(ctxt, 1);
+                    xmlOutputBufferWrite(buf, 3, "></");
+                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                        xmlOutputBufferWriteString(buf,
+                                (const char *)cur->ns->prefix);
+                        xmlOutputBufferWrite(buf, 1, ":");
+                    }
+                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                    if (ctxt->format == 2)
+                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
+                    xmlOutputBufferWrite(buf, 1, ">");
+                }
+            } else {
+                if (ctxt->format == 1) {
+                    tmp = cur->children;
+                    while (tmp != NULL) {
+                        if ((tmp->type == XML_TEXT_NODE) ||
+                            (tmp->type == XML_CDATA_SECTION_NODE) ||
+                            (tmp->type == XML_ENTITY_REF_NODE)) {
+                            ctxt->format = 0;
+                            unformattedNode = cur;
+                            break;
+                        }
+                        tmp = tmp->next;
+                    }
+                }
+                if (ctxt->format == 2)
+                    xmlOutputBufferWriteWSNonSig(ctxt, 1);
+                xmlOutputBufferWrite(buf, 1, ">");
+                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+                if (ctxt->level >= 0) ctxt->level++;
+                cur = cur->children;
+                continue;
+            }
+
+            break;
+
+        case XML_TEXT_NODE:
+           if (cur->content == NULL)
+                break;
            if (cur->name != xmlStringTextNoenc) {
                 xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
            } else {
@@ -952,139 +959,140 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
                 */
                xmlOutputBufferWriteString(buf, (const char *) cur->content);
            }
-       }
+           break;
 
-       return;
-    }
-    if (cur->type == XML_PI_NODE) {
-       if (cur->content != NULL) {
-           xmlOutputBufferWrite(buf, 2, "<?");
-           xmlOutputBufferWriteString(buf, (const char *)cur->name);
-           if (cur->content != NULL) {
-               if (ctxt->format == 2)
-                   xmlOutputBufferWriteWSNonSig(ctxt, 0);
-               else
-                   xmlOutputBufferWrite(buf, 1, " ");
-               xmlOutputBufferWriteString(buf, (const char *)cur->content);
-           }
-           xmlOutputBufferWrite(buf, 2, "?>");
-       } else {
-           xmlOutputBufferWrite(buf, 2, "<?");
-           xmlOutputBufferWriteString(buf, (const char *)cur->name);
-           if (ctxt->format == 2)
-               xmlOutputBufferWriteWSNonSig(ctxt, 0);
-           xmlOutputBufferWrite(buf, 2, "?>");
-       }
-       return;
-    }
-    if (cur->type == XML_COMMENT_NODE) {
-       if (cur->content != NULL) {
-           xmlOutputBufferWrite(buf, 4, "<!--");
-           xmlOutputBufferWriteString(buf, (const char *)cur->content);
-           xmlOutputBufferWrite(buf, 3, "-->");
-       }
-       return;
-    }
-    if (cur->type == XML_ENTITY_REF_NODE) {
-        xmlOutputBufferWrite(buf, 1, "&");
-       xmlOutputBufferWriteString(buf, (const char *)cur->name);
-        xmlOutputBufferWrite(buf, 1, ";");
-       return;
-    }
-    if (cur->type == XML_CDATA_SECTION_NODE) {
-       if (cur->content == NULL || *cur->content == '\0') {
-           xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
-       } else {
-           start = end = cur->content;
-           while (*end != '\0') {
-               if ((*end == ']') && (*(end + 1) == ']') &&
-                   (*(end + 2) == '>')) {
-                   end = end + 2;
-                   xmlOutputBufferWrite(buf, 9, "<![CDATA[");
-                   xmlOutputBufferWrite(buf, end - start, (const char *)start);
-                   xmlOutputBufferWrite(buf, 3, "]]>");
-                   start = end;
-               }
-               end++;
-           }
-           if (start != end) {
-               xmlOutputBufferWrite(buf, 9, "<![CDATA[");
-               xmlOutputBufferWriteString(buf, (const char *)start);
-               xmlOutputBufferWrite(buf, 3, "]]>");
-           }
-       }
-       return;
-    }
-    if (cur->type == XML_ATTRIBUTE_NODE) {
-       xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
-       return;
-    }
-    if (cur->type == XML_NAMESPACE_DECL) {
-       xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
-       return;
-    }
+        case XML_PI_NODE:
+           if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+               xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                    (ctxt->level > ctxt->indent_nr ?
+                                     ctxt->indent_nr : ctxt->level),
+                                    ctxt->indent);
+
+            if (cur->content != NULL) {
+                xmlOutputBufferWrite(buf, 2, "<?");
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                if (cur->content != NULL) {
+                    if (ctxt->format == 2)
+                        xmlOutputBufferWriteWSNonSig(ctxt, 0);
+                    else
+                        xmlOutputBufferWrite(buf, 1, " ");
+                    xmlOutputBufferWriteString(buf,
+                            (const char *)cur->content);
+                }
+                xmlOutputBufferWrite(buf, 2, "?>");
+            } else {
+                xmlOutputBufferWrite(buf, 2, "<?");
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                if (ctxt->format == 2)
+                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
+                xmlOutputBufferWrite(buf, 2, "?>");
+            }
+            break;
+
+        case XML_COMMENT_NODE:
+           if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+               xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                    (ctxt->level > ctxt->indent_nr ?
+                                     ctxt->indent_nr : ctxt->level),
+                                    ctxt->indent);
+
+            if (cur->content != NULL) {
+                xmlOutputBufferWrite(buf, 4, "<!--");
+                xmlOutputBufferWriteString(buf, (const char *)cur->content);
+                xmlOutputBufferWrite(buf, 3, "-->");
+            }
+            break;
+
+        case XML_ENTITY_REF_NODE:
+            xmlOutputBufferWrite(buf, 1, "&");
+            xmlOutputBufferWriteString(buf, (const char *)cur->name);
+            xmlOutputBufferWrite(buf, 1, ";");
+            break;
+
+        case XML_CDATA_SECTION_NODE:
+            if (cur->content == NULL || *cur->content == '\0') {
+                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
+            } else {
+                start = end = cur->content;
+                while (*end != '\0') {
+                    if ((*end == ']') && (*(end + 1) == ']') &&
+                        (*(end + 2) == '>')) {
+                        end = end + 2;
+                        xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+                        xmlOutputBufferWrite(buf, end - start,
+                                (const char *)start);
+                        xmlOutputBufferWrite(buf, 3, "]]>");
+                        start = end;
+                    }
+                    end++;
+                }
+                if (start != end) {
+                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+                    xmlOutputBufferWriteString(buf, (const char *)start);
+                    xmlOutputBufferWrite(buf, 3, "]]>");
+                }
+            }
+            break;
 
-    format = ctxt->format;
-    if (format == 1) {
-       tmp = cur->children;
-       while (tmp != NULL) {
-           if ((tmp->type == XML_TEXT_NODE) ||
-               (tmp->type == XML_CDATA_SECTION_NODE) ||
-               (tmp->type == XML_ENTITY_REF_NODE)) {
-               ctxt->format = 0;
-               break;
-           }
-           tmp = tmp->next;
-       }
-    }
-    xmlOutputBufferWrite(buf, 1, "<");
-    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-       xmlOutputBufferWrite(buf, 1, ":");
-    }
+        case XML_ATTRIBUTE_NODE:
+            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
+            break;
 
-    xmlOutputBufferWriteString(buf, (const char *)cur->name);
-    if (cur->nsDef)
-        xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
-    if (cur->properties != NULL)
-        xmlAttrListDumpOutput(ctxt, cur->properties);
-
-    if (((cur->type == XML_ELEMENT_NODE) || (cur->content == NULL)) &&
-       (cur->children == NULL) && ((ctxt->options & XML_SAVE_NO_EMPTY) == 0)) {
-        if (ctxt->format == 2)
-            xmlOutputBufferWriteWSNonSig(ctxt, 0);
-        xmlOutputBufferWrite(buf, 2, "/>");
-       ctxt->format = format;
-       return;
-    }
-    if (ctxt->format == 2)
-        xmlOutputBufferWriteWSNonSig(ctxt, 1);
-    xmlOutputBufferWrite(buf, 1, ">");
-    if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
-       xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
-    }
-    if (cur->children != NULL) {
-       if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
-       if (ctxt->level >= 0) ctxt->level++;
-       xmlNodeListDumpOutput(ctxt, cur->children);
-       if (ctxt->level > 0) ctxt->level--;
-       if ((xmlIndentTreeOutput) && (ctxt->format == 1))
-           xmlOutputBufferWrite(buf, ctxt->indent_size *
-                                (ctxt->level > ctxt->indent_nr ?
-                                 ctxt->indent_nr : ctxt->level),
-                                ctxt->indent);
-    }
-    xmlOutputBufferWrite(buf, 2, "</");
-    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-       xmlOutputBufferWrite(buf, 1, ":");
-    }
+        case XML_NAMESPACE_DECL:
+            xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
+            break;
 
-    xmlOutputBufferWriteString(buf, (const char *)cur->name);
-    if (ctxt->format == 2)
-        xmlOutputBufferWriteWSNonSig(ctxt, 0);
-    xmlOutputBufferWrite(buf, 1, ">");
-    ctxt->format = format;
+        default:
+            break;
+        }
+
+        while (1) {
+            if (cur == root)
+                return;
+            if ((ctxt->format == 1) &&
+                (cur->type != XML_XINCLUDE_START) &&
+                (cur->type != XML_XINCLUDE_END))
+                xmlOutputBufferWrite(buf, 1, "\n");
+            if (cur->next != NULL) {
+                cur = cur->next;
+                break;
+            }
+
+            /*
+             * The parent should never be NULL here but we want to handle
+             * corrupted documents gracefully.
+             */
+            if (cur->parent == NULL)
+                return;
+            cur = cur->parent;
+
+            if (cur->type == XML_ELEMENT_NODE) {
+                if (ctxt->level > 0) ctxt->level--;
+                if ((xmlIndentTreeOutput) && (ctxt->format == 1))
+                    xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                         (ctxt->level > ctxt->indent_nr ?
+                                          ctxt->indent_nr : ctxt->level),
+                                         ctxt->indent);
+
+                xmlOutputBufferWrite(buf, 2, "</");
+                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                    xmlOutputBufferWriteString(buf,
+                            (const char *)cur->ns->prefix);
+                    xmlOutputBufferWrite(buf, 1, ":");
+                }
+
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                if (ctxt->format == 2)
+                    xmlOutputBufferWriteWSNonSig(ctxt, 0);
+                xmlOutputBufferWrite(buf, 1, ">");
+
+                if (cur == unformattedNode) {
+                    ctxt->format = format;
+                    unformattedNode = NULL;
+                }
+            }
+        }
+    }
 }
 
 /**
@@ -1224,7 +1232,9 @@ xmlDocContentDumpOutput(xmlSaveCtxtPtr ctxt, xmlDocPtr cur) {
                else
 #endif
                    xmlNodeDumpOutputInternal(ctxt, child);
-               xmlOutputBufferWrite(buf, 1, "\n");
+                if ((child->type != XML_XINCLUDE_START) &&
+                    (child->type != XML_XINCLUDE_END))
+                    xmlOutputBufferWrite(buf, 1, "\n");
                child = child->next;
            }
        }
@@ -1396,40 +1406,6 @@ xhtmlAttrListDumpOutput(xmlSaveCtxtPtr ctxt, xmlAttrPtr cur) {
 }
 
 /**
- * xhtmlNodeListDumpOutput:
- * @buf:  the XML buffer output
- * @doc:  the XHTML document
- * @cur:  the first node
- * @level: the imbrication level for indenting
- * @format: is formatting allowed
- * @encoding:  an optional encoding string
- *
- * Dump an XML node list, recursive behaviour, children are printed too.
- * Note that @format = 1 provide node indenting only if xmlIndentTreeOutput = 1
- * or xmlKeepBlanksDefault(0) was called
- */
-static void
-xhtmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
-    xmlOutputBufferPtr buf;
-
-    if (cur == NULL) return;
-    buf = ctxt->buf;
-    while (cur != NULL) {
-       if ((ctxt->format == 1) && (xmlIndentTreeOutput) &&
-           (cur->type == XML_ELEMENT_NODE))
-           xmlOutputBufferWrite(buf, ctxt->indent_size *
-                                (ctxt->level > ctxt->indent_nr ?
-                                 ctxt->indent_nr : ctxt->level),
-                                ctxt->indent);
-        xhtmlNodeDumpOutput(ctxt, cur);
-       if (ctxt->format == 1) {
-           xmlOutputBufferWrite(buf, 1, "\n");
-       }
-       cur = cur->next;
-    }
-}
-
-/**
  * xhtmlNodeDumpOutput:
  * @buf:  the XML buffer output
  * @doc:  the XHTML document
@@ -1442,48 +1418,195 @@ xhtmlNodeListDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
  */
 static void
 xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
-    int format, addmeta = 0;
-    xmlNodePtr tmp;
+    int format = ctxt->format, addmeta;
+    xmlNodePtr tmp, root, unformattedNode = NULL;
     xmlChar *start, *end;
-    xmlOutputBufferPtr buf;
+    xmlOutputBufferPtr buf = ctxt->buf;
 
     if (cur == NULL) return;
-    if ((cur->type == XML_DOCUMENT_NODE) ||
-        (cur->type == XML_HTML_DOCUMENT_NODE)) {
-        xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
-       return;
-    }
-    if (cur->type == XML_XINCLUDE_START)
-       return;
-    if (cur->type == XML_XINCLUDE_END)
-       return;
-    if (cur->type == XML_NAMESPACE_DECL) {
-       xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
-       return;
-    }
-    if (cur->type == XML_DTD_NODE) {
-        xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
-       return;
-    }
-    if (cur->type == XML_DOCUMENT_FRAG_NODE) {
-        xhtmlNodeListDumpOutput(ctxt, cur->children);
-       return;
-    }
-    buf = ctxt->buf;
-    if (cur->type == XML_ELEMENT_DECL) {
-        xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
-       return;
-    }
-    if (cur->type == XML_ATTRIBUTE_DECL) {
-        xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
-       return;
-    }
-    if (cur->type == XML_ENTITY_DECL) {
-        xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
-       return;
-    }
-    if (cur->type == XML_TEXT_NODE) {
-       if (cur->content != NULL) {
+
+    root = cur;
+    while (1) {
+        switch (cur->type) {
+        case XML_DOCUMENT_NODE:
+        case XML_HTML_DOCUMENT_NODE:
+            xmlDocContentDumpOutput(ctxt, (xmlDocPtr) cur);
+           break;
+
+        case XML_NAMESPACE_DECL:
+           xmlNsDumpOutputCtxt(ctxt, (xmlNsPtr) cur);
+           break;
+
+        case XML_DTD_NODE:
+            xmlDtdDumpOutput(ctxt, (xmlDtdPtr) cur);
+           break;
+
+        case XML_DOCUMENT_FRAG_NODE:
+            if (cur->children) {
+                cur = cur->children;
+                continue;
+            }
+            break;
+
+        case XML_ELEMENT_DECL:
+            xmlBufDumpElementDecl(buf->buffer, (xmlElementPtr) cur);
+           break;
+
+        case XML_ATTRIBUTE_DECL:
+            xmlBufDumpAttributeDecl(buf->buffer, (xmlAttributePtr) cur);
+           break;
+
+        case XML_ENTITY_DECL:
+            xmlBufDumpEntityDecl(buf->buffer, (xmlEntityPtr) cur);
+           break;
+
+        case XML_ELEMENT_NODE:
+            addmeta = 0;
+
+           if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
+               xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                    (ctxt->level > ctxt->indent_nr ?
+                                     ctxt->indent_nr : ctxt->level),
+                                    ctxt->indent);
+
+            xmlOutputBufferWrite(buf, 1, "<");
+            if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
+                xmlOutputBufferWrite(buf, 1, ":");
+            }
+
+            xmlOutputBufferWriteString(buf, (const char *)cur->name);
+            if (cur->nsDef)
+                xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
+            if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
+                (cur->ns == NULL) && (cur->nsDef == NULL))) {
+                /*
+                 * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
+                 */
+                xmlOutputBufferWriteString(buf,
+                        " xmlns=\"http://www.w3.org/1999/xhtml\"");
+            }
+            if (cur->properties != NULL)
+                xhtmlAttrListDumpOutput(ctxt, cur->properties);
+
+            if ((cur->parent != NULL) &&
+                (cur->parent->parent == (xmlNodePtr) cur->doc) &&
+                xmlStrEqual(cur->name, BAD_CAST"head") &&
+                xmlStrEqual(cur->parent->name, BAD_CAST"html")) {
+
+                tmp = cur->children;
+                while (tmp != NULL) {
+                    if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
+                        xmlChar *httpequiv;
+
+                        httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv");
+                        if (httpequiv != NULL) {
+                            if (xmlStrcasecmp(httpequiv,
+                                        BAD_CAST"Content-Type") == 0) {
+                                xmlFree(httpequiv);
+                                break;
+                            }
+                            xmlFree(httpequiv);
+                        }
+                    }
+                    tmp = tmp->next;
+                }
+                if (tmp == NULL)
+                    addmeta = 1;
+            }
+
+            if (cur->children == NULL) {
+                if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
+                    ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
+                    /*
+                     * C.2. Empty Elements
+                     */
+                    xmlOutputBufferWrite(buf, 3, " />");
+                } else {
+                    if (addmeta == 1) {
+                        xmlOutputBufferWrite(buf, 1, ">");
+                        if (ctxt->format == 1) {
+                            xmlOutputBufferWrite(buf, 1, "\n");
+                            if (xmlIndentTreeOutput)
+                                xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                    (ctxt->level + 1 > ctxt->indent_nr ?
+                                    ctxt->indent_nr : ctxt->level + 1),
+                                    ctxt->indent);
+                        }
+                        xmlOutputBufferWriteString(buf,
+                                "<meta http-equiv=\"Content-Type\" "
+                                "content=\"text/html; charset=");
+                        if (ctxt->encoding) {
+                            xmlOutputBufferWriteString(buf,
+                                    (const char *)ctxt->encoding);
+                        } else {
+                            xmlOutputBufferWrite(buf, 5, "UTF-8");
+                        }
+                        xmlOutputBufferWrite(buf, 4, "\" />");
+                        if (ctxt->format == 1)
+                            xmlOutputBufferWrite(buf, 1, "\n");
+                    } else {
+                        xmlOutputBufferWrite(buf, 1, ">");
+                    }
+                    /*
+                     * C.3. Element Minimization and Empty Element Content
+                     */
+                    xmlOutputBufferWrite(buf, 2, "</");
+                    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                        xmlOutputBufferWriteString(buf,
+                                (const char *)cur->ns->prefix);
+                        xmlOutputBufferWrite(buf, 1, ":");
+                    }
+                    xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                    xmlOutputBufferWrite(buf, 1, ">");
+                }
+            } else {
+                xmlOutputBufferWrite(buf, 1, ">");
+                if (addmeta == 1) {
+                    if (ctxt->format == 1) {
+                        xmlOutputBufferWrite(buf, 1, "\n");
+                        if (xmlIndentTreeOutput)
+                            xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                (ctxt->level + 1 > ctxt->indent_nr ?
+                                ctxt->indent_nr : ctxt->level + 1),
+                                ctxt->indent);
+                    }
+                    xmlOutputBufferWriteString(buf,
+                            "<meta http-equiv=\"Content-Type\" "
+                            "content=\"text/html; charset=");
+                    if (ctxt->encoding) {
+                        xmlOutputBufferWriteString(buf,
+                                (const char *)ctxt->encoding);
+                    } else {
+                        xmlOutputBufferWrite(buf, 5, "UTF-8");
+                    }
+                    xmlOutputBufferWrite(buf, 4, "\" />");
+                }
+
+                if (ctxt->format == 1) {
+                    tmp = cur->children;
+                    while (tmp != NULL) {
+                        if ((tmp->type == XML_TEXT_NODE) ||
+                            (tmp->type == XML_ENTITY_REF_NODE)) {
+                            unformattedNode = cur;
+                            ctxt->format = 0;
+                            break;
+                        }
+                        tmp = tmp->next;
+                    }
+                }
+
+                if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+                if (ctxt->level >= 0) ctxt->level++;
+                cur = cur->children;
+                continue;
+            }
+
+            break;
+
+        case XML_TEXT_NODE:
+           if (cur->content == NULL)
+                break;
            if ((cur->name == xmlStringText) ||
                (cur->name != xmlStringTextNoenc)) {
                 xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
@@ -1493,286 +1616,115 @@ xhtmlNodeDumpOutput(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
                 */
                xmlOutputBufferWriteString(buf, (const char *) cur->content);
            }
-       }
-
-       return;
-    }
-    if (cur->type == XML_PI_NODE) {
-       if (cur->content != NULL) {
-           xmlOutputBufferWrite(buf, 2, "<?");
-           xmlOutputBufferWriteString(buf, (const char *)cur->name);
-           if (cur->content != NULL) {
-               xmlOutputBufferWrite(buf, 1, " ");
-               xmlOutputBufferWriteString(buf, (const char *)cur->content);
-           }
-           xmlOutputBufferWrite(buf, 2, "?>");
-       } else {
-           xmlOutputBufferWrite(buf, 2, "<?");
-           xmlOutputBufferWriteString(buf, (const char *)cur->name);
-           xmlOutputBufferWrite(buf, 2, "?>");
-       }
-       return;
-    }
-    if (cur->type == XML_COMMENT_NODE) {
-       if (cur->content != NULL) {
-           xmlOutputBufferWrite(buf, 4, "<!--");
-           xmlOutputBufferWriteString(buf, (const char *)cur->content);
-           xmlOutputBufferWrite(buf, 3, "-->");
-       }
-       return;
-    }
-    if (cur->type == XML_ENTITY_REF_NODE) {
-        xmlOutputBufferWrite(buf, 1, "&");
-       xmlOutputBufferWriteString(buf, (const char *)cur->name);
-        xmlOutputBufferWrite(buf, 1, ";");
-       return;
-    }
-    if (cur->type == XML_CDATA_SECTION_NODE) {
-       if (cur->content == NULL || *cur->content == '\0') {
-           xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
-       } else {
-           start = end = cur->content;
-           while (*end != '\0') {
-               if (*end == ']' && *(end + 1) == ']' && *(end + 2) == '>') {
-                   end = end + 2;
-                   xmlOutputBufferWrite(buf, 9, "<![CDATA[");
-                   xmlOutputBufferWrite(buf, end - start, (const char *)start);
-                   xmlOutputBufferWrite(buf, 3, "]]>");
-                   start = end;
-               }
-               end++;
-           }
-           if (start != end) {
-               xmlOutputBufferWrite(buf, 9, "<![CDATA[");
-               xmlOutputBufferWriteString(buf, (const char *)start);
-               xmlOutputBufferWrite(buf, 3, "]]>");
-           }
-       }
-       return;
-    }
-    if (cur->type == XML_ATTRIBUTE_NODE) {
-        xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
-       return;
-    }
+           break;
 
-    format = ctxt->format;
-    if (format == 1) {
-       tmp = cur->children;
-       while (tmp != NULL) {
-           if ((tmp->type == XML_TEXT_NODE) ||
-               (tmp->type == XML_ENTITY_REF_NODE)) {
-               format = 0;
-               break;
-           }
-           tmp = tmp->next;
-       }
-    }
-    xmlOutputBufferWrite(buf, 1, "<");
-    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-       xmlOutputBufferWrite(buf, 1, ":");
-    }
+        case XML_PI_NODE:
+            if (cur->content != NULL) {
+                xmlOutputBufferWrite(buf, 2, "<?");
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                if (cur->content != NULL) {
+                    xmlOutputBufferWrite(buf, 1, " ");
+                    xmlOutputBufferWriteString(buf,
+                            (const char *)cur->content);
+                }
+                xmlOutputBufferWrite(buf, 2, "?>");
+            } else {
+                xmlOutputBufferWrite(buf, 2, "<?");
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                xmlOutputBufferWrite(buf, 2, "?>");
+            }
+            break;
 
-    xmlOutputBufferWriteString(buf, (const char *)cur->name);
-    if (cur->nsDef)
-        xmlNsListDumpOutputCtxt(ctxt, cur->nsDef);
-    if ((xmlStrEqual(cur->name, BAD_CAST "html") &&
-       (cur->ns == NULL) && (cur->nsDef == NULL))) {
-       /*
-        * 3.1.1. Strictly Conforming Documents A.3.1.1 3/
-        */
-       xmlOutputBufferWriteString(buf,
-               " xmlns=\"http://www.w3.org/1999/xhtml\"");
-    }
-    if (cur->properties != NULL)
-        xhtmlAttrListDumpOutput(ctxt, cur->properties);
-
-    if ((cur->type == XML_ELEMENT_NODE) &&
-        (cur->parent != NULL) &&
-        (cur->parent->parent == (xmlNodePtr) cur->doc) &&
-        xmlStrEqual(cur->name, BAD_CAST"head") &&
-        xmlStrEqual(cur->parent->name, BAD_CAST"html")) {
-
-        tmp = cur->children;
-        while (tmp != NULL) {
-            if (xmlStrEqual(tmp->name, BAD_CAST"meta")) {
-                xmlChar *httpequiv;
-
-                httpequiv = xmlGetProp(tmp, BAD_CAST"http-equiv");
-                if (httpequiv != NULL) {
-                    if (xmlStrcasecmp(httpequiv, BAD_CAST"Content-Type") == 0) {
-                        xmlFree(httpequiv);
-                        break;
+        case XML_COMMENT_NODE:
+            if (cur->content != NULL) {
+                xmlOutputBufferWrite(buf, 4, "<!--");
+                xmlOutputBufferWriteString(buf, (const char *)cur->content);
+                xmlOutputBufferWrite(buf, 3, "-->");
+            }
+            break;
+
+        case XML_ENTITY_REF_NODE:
+            xmlOutputBufferWrite(buf, 1, "&");
+            xmlOutputBufferWriteString(buf, (const char *)cur->name);
+            xmlOutputBufferWrite(buf, 1, ";");
+            break;
+
+        case XML_CDATA_SECTION_NODE:
+            if (cur->content == NULL || *cur->content == '\0') {
+                xmlOutputBufferWrite(buf, 12, "<![CDATA[]]>");
+            } else {
+                start = end = cur->content;
+                while (*end != '\0') {
+                    if (*end == ']' && *(end + 1) == ']' &&
+                        *(end + 2) == '>') {
+                        end = end + 2;
+                        xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+                        xmlOutputBufferWrite(buf, end - start,
+                                (const char *)start);
+                        xmlOutputBufferWrite(buf, 3, "]]>");
+                        start = end;
                     }
-                    xmlFree(httpequiv);
+                    end++;
+                }
+                if (start != end) {
+                    xmlOutputBufferWrite(buf, 9, "<![CDATA[");
+                    xmlOutputBufferWriteString(buf, (const char *)start);
+                    xmlOutputBufferWrite(buf, 3, "]]>");
                 }
             }
-            tmp = tmp->next;
+            break;
+
+        case XML_ATTRIBUTE_NODE:
+            xmlAttrDumpOutput(ctxt, (xmlAttrPtr) cur);
+           break;
+
+        default:
+            break;
         }
-        if (tmp == NULL)
-            addmeta = 1;
-    }
 
-    if ((cur->type == XML_ELEMENT_NODE) && (cur->children == NULL)) {
-       if (((cur->ns == NULL) || (cur->ns->prefix == NULL)) &&
-           ((xhtmlIsEmpty(cur) == 1) && (addmeta == 0))) {
-           /*
-            * C.2. Empty Elements
-            */
-           xmlOutputBufferWrite(buf, 3, " />");
-       } else {
-               if (addmeta == 1) {
-                       xmlOutputBufferWrite(buf, 1, ">");
-                       if (ctxt->format == 1) {
-                               xmlOutputBufferWrite(buf, 1, "\n");
-                               if (xmlIndentTreeOutput)
-                                       xmlOutputBufferWrite(buf, ctxt->indent_size *
-                                       (ctxt->level + 1 > ctxt->indent_nr ?
-                                       ctxt->indent_nr : ctxt->level + 1), ctxt->indent);
-                       }
-                       xmlOutputBufferWriteString(buf,
-                               "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
-                       if (ctxt->encoding) {
-                               xmlOutputBufferWriteString(buf, (const char *)ctxt->encoding);
-                       } else {
-                               xmlOutputBufferWrite(buf, 5, "UTF-8");
-                       }
-                       xmlOutputBufferWrite(buf, 4, "\" />");
-                       if (ctxt->format == 1)
-                               xmlOutputBufferWrite(buf, 1, "\n");
-               } else {
-                       xmlOutputBufferWrite(buf, 1, ">");
-               }
-           /*
-            * C.3. Element Minimization and Empty Element Content
-            */
-           xmlOutputBufferWrite(buf, 2, "</");
-           if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-               xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-               xmlOutputBufferWrite(buf, 1, ":");
-           }
-           xmlOutputBufferWriteString(buf, (const char *)cur->name);
-           xmlOutputBufferWrite(buf, 1, ">");
-       }
-       return;
-    }
-    xmlOutputBufferWrite(buf, 1, ">");
-       if (addmeta == 1) {
-               if (ctxt->format == 1) {
-                       xmlOutputBufferWrite(buf, 1, "\n");
-                       if (xmlIndentTreeOutput)
-                               xmlOutputBufferWrite(buf, ctxt->indent_size *
-                               (ctxt->level + 1 > ctxt->indent_nr ?
-                               ctxt->indent_nr : ctxt->level + 1), ctxt->indent);
-               }
-               xmlOutputBufferWriteString(buf,
-                       "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=");
-               if (ctxt->encoding) {
-                       xmlOutputBufferWriteString(buf, (const char *)ctxt->encoding);
-               } else {
-                       xmlOutputBufferWrite(buf, 5, "UTF-8");
-               }
-               xmlOutputBufferWrite(buf, 4, "\" />");
-       }
-    if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL)) {
-       xmlOutputBufferWriteEscape(buf, cur->content, ctxt->escape);
-    }
+        while (1) {
+            if (cur == root)
+                return;
+            if (ctxt->format == 1)
+                xmlOutputBufferWrite(buf, 1, "\n");
+            if (cur->next != NULL) {
+                cur = cur->next;
+                break;
+            }
 
-#if 0
-    /*
-    * This was removed due to problems with HTML processors.
-    * See bug #345147.
-    */
-    /*
-     * 4.8. Script and Style elements
-     */
-    if ((cur->type == XML_ELEMENT_NODE) &&
-       ((xmlStrEqual(cur->name, BAD_CAST "script")) ||
-        (xmlStrEqual(cur->name, BAD_CAST "style"))) &&
-       ((cur->ns == NULL) ||
-        (xmlStrEqual(cur->ns->href, XHTML_NS_NAME)))) {
-       xmlNodePtr child = cur->children;
-
-       while (child != NULL) {
-           if (child->type == XML_TEXT_NODE) {
-               if ((xmlStrchr(child->content, '<') == NULL) &&
-                   (xmlStrchr(child->content, '&') == NULL) &&
-                   (xmlStrstr(child->content, BAD_CAST "]]>") == NULL)) {
-                   /* Nothing to escape, so just output as is... */
-                   /* FIXME: Should we do something about "--" also? */
-                   int level = ctxt->level;
-                   int indent = ctxt->format;
-
-                   ctxt->level = 0;
-                   ctxt->format = 0;
-                   xmlOutputBufferWriteString(buf, (const char *) child->content);
-                   /* (We cannot use xhtmlNodeDumpOutput() here because
-                    * we wish to leave '>' unescaped!) */
-                   ctxt->level = level;
-                   ctxt->format = indent;
-               } else {
-                   /* We must use a CDATA section.  Unfortunately,
-                    * this will break CSS and JavaScript when read by
-                    * a browser in HTML4-compliant mode. :-( */
-                   start = end = child->content;
-                   while (*end != '\0') {
-                       if (*end == ']' &&
-                           *(end + 1) == ']' &&
-                           *(end + 2) == '>') {
-                           end = end + 2;
-                           xmlOutputBufferWrite(buf, 9, "<![CDATA[");
-                           xmlOutputBufferWrite(buf, end - start,
-                                                (const char *)start);
-                           xmlOutputBufferWrite(buf, 3, "]]>");
-                           start = end;
-                       }
-                       end++;
-                   }
-                   if (start != end) {
-                       xmlOutputBufferWrite(buf, 9, "<![CDATA[");
-                       xmlOutputBufferWrite(buf, end - start,
-                                            (const char *)start);
-                       xmlOutputBufferWrite(buf, 3, "]]>");
-                   }
-               }
-           } else {
-               int level = ctxt->level;
-               int indent = ctxt->format;
+            /*
+             * The parent should never be NULL here but we want to handle
+             * corrupted documents gracefully.
+             */
+            if (cur->parent == NULL)
+                return;
+            cur = cur->parent;
+
+            if (cur->type == XML_ELEMENT_NODE) {
+                if (ctxt->level > 0) ctxt->level--;
+                if ((xmlIndentTreeOutput) && (ctxt->format == 1))
+                    xmlOutputBufferWrite(buf, ctxt->indent_size *
+                                         (ctxt->level > ctxt->indent_nr ?
+                                          ctxt->indent_nr : ctxt->level),
+                                         ctxt->indent);
+
+                xmlOutputBufferWrite(buf, 2, "</");
+                if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
+                    xmlOutputBufferWriteString(buf,
+                            (const char *)cur->ns->prefix);
+                    xmlOutputBufferWrite(buf, 1, ":");
+                }
 
-               ctxt->level = 0;
-               ctxt->format = 0;
-               xhtmlNodeDumpOutput(ctxt, child);
-               ctxt->level = level;
-               ctxt->format = indent;
-           }
-           child = child->next;
-       }
-    }
-#endif
+                xmlOutputBufferWriteString(buf, (const char *)cur->name);
+                xmlOutputBufferWrite(buf, 1, ">");
 
-    if (cur->children != NULL) {
-       int indent = ctxt->format;
-
-       if (format == 1) xmlOutputBufferWrite(buf, 1, "\n");
-       if (ctxt->level >= 0) ctxt->level++;
-       ctxt->format = format;
-       xhtmlNodeListDumpOutput(ctxt, cur->children);
-       if (ctxt->level > 0) ctxt->level--;
-       ctxt->format = indent;
-       if ((xmlIndentTreeOutput) && (format == 1))
-           xmlOutputBufferWrite(buf, ctxt->indent_size *
-                                (ctxt->level > ctxt->indent_nr ?
-                                 ctxt->indent_nr : ctxt->level),
-                                ctxt->indent);
-    }
-    xmlOutputBufferWrite(buf, 2, "</");
-    if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
-        xmlOutputBufferWriteString(buf, (const char *)cur->ns->prefix);
-       xmlOutputBufferWrite(buf, 1, ":");
+                if (cur == unformattedNode) {
+                    ctxt->format = format;
+                    unformattedNode = NULL;
+                }
+            }
+        }
     }
-
-    xmlOutputBufferWriteString(buf, (const char *)cur->name);
-    xmlOutputBufferWrite(buf, 1, ">");
 }
 #endif
 
@@ -1802,6 +1754,7 @@ xmlSaveToFd(int fd, const char *encoding, int options)
     if (ret == NULL) return(NULL);
     ret->buf = xmlOutputBufferCreateFd(fd, ret->handler);
     if (ret->buf == NULL) {
+        xmlCharEncCloseFunc(ret->handler);
        xmlFreeSaveCtxt(ret);
        return(NULL);
     }
@@ -1831,6 +1784,7 @@ xmlSaveToFilename(const char *filename, const char *encoding, int options)
     ret->buf = xmlOutputBufferCreateFilename(filename, ret->handler,
                                              compression);
     if (ret->buf == NULL) {
+        xmlCharEncCloseFunc(ret->handler);
        xmlFreeSaveCtxt(ret);
        return(NULL);
     }
@@ -1853,28 +1807,15 @@ xmlSaveCtxtPtr
 xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options)
 {
     xmlSaveCtxtPtr ret;
-    xmlOutputBufferPtr out_buff;
-    xmlCharEncodingHandlerPtr handler;
 
     ret = xmlNewSaveCtxt(encoding, options);
     if (ret == NULL) return(NULL);
-
-    if (encoding != NULL) {
-        handler = xmlFindCharEncodingHandler(encoding);
-        if (handler == NULL) {
-            xmlFree(ret);
-            return(NULL);
-        }
-    } else
-        handler = NULL;
-    out_buff = xmlOutputBufferCreateBuffer(buffer, handler);
-    if (out_buff == NULL) {
-        xmlFree(ret);
-        if (handler) xmlCharEncCloseFunc(handler);
-        return(NULL);
+    ret->buf = xmlOutputBufferCreateBuffer(buffer, ret->handler);
+    if (ret->buf == NULL) {
+        xmlCharEncCloseFunc(ret->handler);
+       xmlFreeSaveCtxt(ret);
+       return(NULL);
     }
-
-    ret->buf = out_buff;
     return(ret);
 }
 
@@ -1902,6 +1843,7 @@ xmlSaveToIO(xmlOutputWriteCallback iowrite,
     if (ret == NULL) return(NULL);
     ret->buf = xmlOutputBufferCreateIO(iowrite, ioclose, ioctx, ret->handler);
     if (ret->buf == NULL) {
+        xmlCharEncCloseFunc(ret->handler);
        xmlFreeSaveCtxt(ret);
        return(NULL);
     }
@@ -1942,12 +1884,25 @@ xmlSaveDoc(xmlSaveCtxtPtr ctxt, xmlDocPtr doc)
  * Returns the number of byte written or -1 in case of error
  */
 long
-xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr node)
+xmlSaveTree(xmlSaveCtxtPtr ctxt, xmlNodePtr cur)
 {
     long ret = 0;
 
-    if ((ctxt == NULL) || (node == NULL)) return(-1);
-    xmlNodeDumpOutputInternal(ctxt, node);
+    if ((ctxt == NULL) || (cur == NULL)) return(-1);
+#ifdef LIBXML_HTML_ENABLED
+    if (ctxt->options & XML_SAVE_XHTML) {
+        xhtmlNodeDumpOutput(ctxt, cur);
+        return(ret);
+    }
+    if (((cur->type != XML_NAMESPACE_DECL) && (cur->doc != NULL) &&
+         (cur->doc->type == XML_HTML_DOCUMENT_NODE) &&
+         ((ctxt->options & XML_SAVE_AS_XML) == 0)) ||
+        (ctxt->options & XML_SAVE_AS_HTML)) {
+       htmlNodeDumpOutputInternal(ctxt, cur);
+       return(ret);
+    }
+#endif
+    xmlNodeDumpOutputInternal(ctxt, cur);
     return(ret);
 }
 
@@ -2197,7 +2152,7 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
             int format)
 {
     xmlBufPtr buffer;
-    int ret;
+    size_t ret;
 
     if ((buf == NULL) || (cur == NULL))
         return(-1);
index d19de6d..1efd096 100644 (file)
@@ -860,6 +860,7 @@ struct _xmlSchemaIDCMatcher {
     int sizeKeySeqs;
     xmlSchemaItemListPtr targets; /* list of target-node
                                      (xmlSchemaPSVIIDCNodePtr) entries */
+    xmlHashTablePtr htab;
 };
 
 /*
@@ -1002,11 +1003,11 @@ struct _xmlSchemaValidCtxt {
     int xsiAssemble;
 
     int depth;
-    xmlSchemaNodeInfoPtr *elemInfos; /* array of element informations */
+    xmlSchemaNodeInfoPtr *elemInfos; /* array of element information */
     int sizeElemInfos;
     xmlSchemaNodeInfoPtr inode; /* the current element information */
 
-    xmlSchemaIDCAugPtr aidcs; /* a list of augmented IDC informations */
+    xmlSchemaIDCAugPtr aidcs; /* a list of augmented IDC information */
 
     xmlSchemaIDCStateObjPtr xpathStates; /* first active state object. */
     xmlSchemaIDCStateObjPtr xpathStatePool; /* first stored state object. */
@@ -1055,6 +1056,18 @@ struct _xmlSchemaSubstGroup {
     xmlSchemaItemListPtr members;
 };
 
+/**
+ * xmlIDCHashEntry:
+ *
+ * an entry in hash tables to quickly look up keys/uniques
+ */
+typedef struct _xmlIDCHashEntry xmlIDCHashEntry;
+typedef xmlIDCHashEntry *xmlIDCHashEntryPtr;
+struct _xmlIDCHashEntry {
+    xmlIDCHashEntryPtr next; /* next item with same hash */
+    int index;               /* index into associated item list */
+};
+
 /************************************************************************
  *                                                                     *
  *                     Some predeclarations                            *
@@ -1478,6 +1491,7 @@ xmlSchemaWildcardPCToString(int pc)
  * @val: the precomputed value
  * @retValue: the returned value
  * @ws: the whitespace type of the value
+ * @for_hash: non-zero if this is supposed to generate a string for hashing
  *
  * Get a the canonical representation of the value.
  * The caller has to free the returned retValue.
@@ -1486,9 +1500,10 @@ xmlSchemaWildcardPCToString(int pc)
  *         API errors or if the value type is not supported yet.
  */
 static int
-xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
-                              xmlSchemaWhitespaceValueType ws,
-                              xmlChar **retValue)
+xmlSchemaGetCanonValueWhtspExt_1(xmlSchemaValPtr val,
+                                xmlSchemaWhitespaceValueType ws,
+                                xmlChar **retValue,
+                                int for_hash)
 {
     int list;
     xmlSchemaValType valType;
@@ -1522,6 +1537,20 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
                        xmlFree((xmlChar *) value2);
                    goto internal_error;
                }
+               if (for_hash && valType == XML_SCHEMAS_DECIMAL) {
+                   /* We can mostly use the canonical value for hashing,
+                      except in the case of decimal.  There the canonical
+                      representation requires a trailing '.0' even for
+                      non-fractional numbers, but for the derived integer
+                      types it forbids any decimal point.  Nevertheless they
+                      compare equal if the value is equal.  We need to generate
+                      the same hash value for this to work, and it's easiest
+                      to just cut off the useless '.0' suffix for the
+                      decimal type.  */
+                   int len = xmlStrlen(value2);
+                   if (len > 2 && value2[len-1] == '0' && value2[len-2] == '.')
+                     ((xmlChar*)value2)[len-2] = 0;
+               }
                value = value2;
        }
        if (*retValue == NULL)
@@ -1548,6 +1577,22 @@ internal_error:
     return (-1);
 }
 
+static int
+xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
+                              xmlSchemaWhitespaceValueType ws,
+                              xmlChar **retValue)
+{
+    return xmlSchemaGetCanonValueWhtspExt_1(val, ws, retValue, 0);
+}
+
+static int
+xmlSchemaGetCanonValueHash(xmlSchemaValPtr val,
+                          xmlChar **retValue)
+{
+    return xmlSchemaGetCanonValueWhtspExt_1(val, XML_SCHEMA_WHITESPACE_COLLAPSE,
+                                           retValue, 1);
+}
+
 /**
  * xmlSchemaFormatItemForReport:
  * @buf: the string buffer
@@ -1873,7 +1918,7 @@ xmlSchemaPSimpleErr(const char *msg)
 /**
  * xmlSchemaPErrMemory:
  * @node: a context node
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -1995,7 +2040,7 @@ xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
 /**
  * xmlSchemaVTypeErrMemory:
  * @node: a context node
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -6031,7 +6076,7 @@ xmlSchemaPValAttrID(xmlSchemaParserCtxtPtr ctxt,
 /**
  * xmlGetMaxOccurs:
  * @ctxt:  a schema validation context
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Get the maxOccurs property
  *
@@ -6074,7 +6119,16 @@ xmlGetMaxOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
        return (def);
     }
     while ((*cur >= '0') && (*cur <= '9')) {
-        ret = ret * 10 + (*cur - '0');
+        if (ret > INT_MAX / 10) {
+            ret = INT_MAX;
+        } else {
+            int digit = *cur - '0';
+            ret *= 10;
+            if (ret > INT_MAX - digit)
+                ret = INT_MAX;
+            else
+                ret += digit;
+        }
         cur++;
     }
     while (IS_BLANK_CH(*cur))
@@ -6096,7 +6150,7 @@ xmlGetMaxOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
 /**
  * xmlGetMinOccurs:
  * @ctxt:  a schema validation context
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Get the minOccurs property
  *
@@ -6126,7 +6180,16 @@ xmlGetMinOccurs(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
         return (def);
     }
     while ((*cur >= '0') && (*cur <= '9')) {
-        ret = ret * 10 + (*cur - '0');
+        if (ret > INT_MAX / 10) {
+            ret = INT_MAX;
+        } else {
+            int digit = *cur - '0';
+            ret *= 10;
+            if (ret > INT_MAX - digit)
+                ret = INT_MAX;
+            else
+                ret += digit;
+        }
         cur++;
     }
     while (IS_BLANK_CH(*cur))
@@ -6193,7 +6256,7 @@ xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt,
 /**
  * xmlGetBooleanProp:
  * @ctxt:  a schema validation context
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  * @name:  the attribute name
  * @def:  the default value
  *
@@ -6481,7 +6544,7 @@ xmlSchemaCheckReference(xmlSchemaParserCtxtPtr pctxt,
  * xmlSchemaParseLocalAttributes:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  * @type:  the hosting type where the attributes will be anchored
  *
  * Parses attribute uses and attribute declarations and
@@ -6523,7 +6586,7 @@ xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseAnnotation:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Attribute declaration
  * *WARNING* this interface is highly subject to change
@@ -6643,7 +6706,7 @@ xmlSchemaParseAnnotation(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int neede
  * xmlSchemaParseFacet:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Facet declaration
  * *WARNING* this interface is highly subject to change
@@ -6734,7 +6797,7 @@ xmlSchemaParseFacet(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseWildcardNs:
  * @ctxt:  a schema parser context
  * @wildc:  the wildcard, already created
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parses the attribute "processContents" and "namespace"
  * of a xsd:anyAttribute and xsd:any.
@@ -6901,7 +6964,7 @@ xmlSchemaPCheckParticleCorrect_2(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseAny:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parsea a XML schema <any> element. A particle and wildcard
  * will be created (except if minOccurs==maxOccurs==0, in this case
@@ -6996,7 +7059,7 @@ xmlSchemaParseAny(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseNotation:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Notation declaration
  *
@@ -7043,7 +7106,7 @@ xmlSchemaParseNotation(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseAnyAttribute:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema AnyAttribute declaration
  * *WARNING* this interface is highly subject to change
@@ -7113,7 +7176,7 @@ xmlSchemaParseAnyAttribute(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseAttribute:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Attribute declaration
  * *WARNING* this interface is highly subject to change
@@ -7656,7 +7719,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
  * xmlSchemaParseAttributeGroupRef:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parse an attribute group definition reference.
  * Note that a reference to an attribute group does not
@@ -7789,7 +7852,7 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
  * xmlSchemaParseAttributeGroupDefinition:
  * @pctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Attribute Group declaration
  * *WARNING* this interface is highly subject to change
@@ -8220,7 +8283,7 @@ xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem,
  * xmlSchemaParseIDCSelectorAndField:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parses a XML Schema identity-constraint definition's
  * <selector> and <field> elements.
@@ -8318,7 +8381,7 @@ xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseIDC:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parses a XML Schema identity-constraint definition.
  *
@@ -8465,7 +8528,7 @@ xmlSchemaParseIDC(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseElement:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  * @topLevel: indicates if this is global declaration
  *
  * Parses a XML schema element declaration.
@@ -8864,7 +8927,7 @@ return_null:
  * xmlSchemaParseUnion:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Union definition
  * *WARNING* this interface is highly subject to change
@@ -9033,7 +9096,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseList:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema List definition
  * *WARNING* this interface is highly subject to change
@@ -9144,7 +9207,7 @@ xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseSimpleType:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Simple Type definition
  * *WARNING* this interface is highly subject to change
@@ -9455,7 +9518,7 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseModelGroupDefinition:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parses a XML schema model group definition.
  *
@@ -10293,7 +10356,7 @@ xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location,
  * xmlSchemaAddSchemaDoc:
  * @pctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parse an included (and to-be-redefined) XML schema document.
  *
@@ -10717,7 +10780,7 @@ exit_failure:
  * xmlSchemaParseImport:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Import definition
  * *WARNING* this interface is highly subject to change
@@ -11209,7 +11272,7 @@ xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
  * xmlSchemaParseModelGroup:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  * @type: the "compositor" type
  * @particleNeeded: if a a model group with a particle
  *
@@ -11489,7 +11552,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseRestriction:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Restriction definition
  * *WARNING* this interface is highly subject to change
@@ -11792,7 +11855,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseExtension:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * Parses an <extension>, which is found inside a
  * <simpleContent> or <complexContent>.
@@ -11928,7 +11991,7 @@ xmlSchemaParseExtension(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
  * xmlSchemaParseSimpleContent:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema SimpleContent definition
  * *WARNING* this interface is highly subject to change
@@ -12018,7 +12081,7 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseComplexContent:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema ComplexContent definition
  * *WARNING* this interface is highly subject to change
@@ -12113,7 +12176,7 @@ xmlSchemaParseComplexContent(xmlSchemaParserCtxtPtr ctxt,
  * xmlSchemaParseComplexType:
  * @ctxt:  a schema validation context
  * @schema:  the schema being built
- * @node:  a subtree containing XML Schema informations
+ * @node:  a subtree containing XML Schema information
  *
  * parse a XML schema Complex Type definition
  * *WARNING* this interface is highly subject to change
@@ -14658,6 +14721,7 @@ xmlSchemaGetUnionSimpleTypeMemberTypes(xmlSchemaTypePtr type)
     return (NULL);
 }
 
+#if 0
 /**
  * xmlSchemaGetParticleTotalRangeMin:
  * @particle: the particle
@@ -14713,7 +14777,6 @@ xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle)
     }
 }
 
-#if 0
 /**
  * xmlSchemaGetParticleTotalRangeMax:
  * @particle: the particle
@@ -14776,6 +14839,48 @@ xmlSchemaGetParticleTotalRangeMax(xmlSchemaParticlePtr particle)
 #endif
 
 /**
+ * xmlSchemaGetParticleEmptiable:
+ * @particle: the particle
+ *
+ * Returns 1 if emptiable, 0 otherwise.
+ */
+static int
+xmlSchemaGetParticleEmptiable(xmlSchemaParticlePtr particle)
+{
+    xmlSchemaParticlePtr part;
+    int emptiable;
+
+    if ((particle->children == NULL) || (particle->minOccurs == 0))
+       return (1);
+
+    part = (xmlSchemaParticlePtr) particle->children->children;
+    if (part == NULL)
+        return (1);
+
+    while (part != NULL) {
+        if ((part->children->type == XML_SCHEMA_TYPE_ELEMENT) ||
+            (part->children->type == XML_SCHEMA_TYPE_ANY))
+            emptiable = (part->minOccurs == 0);
+        else
+            emptiable = xmlSchemaGetParticleEmptiable(part);
+        if (particle->children->type == XML_SCHEMA_TYPE_CHOICE) {
+            if (emptiable)
+                return (1);
+        } else {
+           /* <all> and <sequence> */
+            if (!emptiable)
+                return (0);
+        }
+        part = (xmlSchemaParticlePtr) part->next;
+    }
+
+    if (particle->children->type == XML_SCHEMA_TYPE_CHOICE)
+        return (0);
+    else
+        return (1);
+}
+
+/**
  * xmlSchemaIsParticleEmptiable:
  * @particle: the particle
  *
@@ -14797,10 +14902,8 @@ xmlSchemaIsParticleEmptiable(xmlSchemaParticlePtr particle)
     * SPEC (2) "Its {term} is a group and the minimum part of the
     * effective total range of that group, [...] is 0."
     */
-    if (WXS_IS_MODEL_GROUP(particle->children)) {
-       if (xmlSchemaGetParticleTotalRangeMin(particle) == 0)
-           return (1);
-    }
+    if (WXS_IS_MODEL_GROUP(particle->children))
+       return (xmlSchemaGetParticleEmptiable(particle));
     return (0);
 }
 
@@ -14938,7 +15041,7 @@ xmlSchemaCheckTypeDefCircularInternal(xmlSchemaParserCtxtPtr pctxt,
     }
     if (ancestor->flags & XML_SCHEMAS_TYPE_MARKED) {
        /*
-       * Avoid inifinite recursion on circular types not yet checked.
+       * Avoid infinite recursion on circular types not yet checked.
        */
        return (0);
     }
@@ -20961,7 +21064,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
                break;
            case XML_SCHEMA_EXTRA_ATTR_USE_PROHIB:
                /*
-               * Handle attribue prohibition which had a
+               * Handle attribute prohibition which had a
                * "ref" attribute.
                */
                xmlSchemaResolveAttrUseProhibReferences(
@@ -22293,6 +22396,17 @@ xmlSchemaIDCFreeIDCTable(xmlSchemaPSVIIDCBindingPtr bind)
     }
 }
 
+static void
+xmlFreeIDCHashEntry (void *payload, const xmlChar *name ATTRIBUTE_UNUSED)
+{
+    xmlIDCHashEntryPtr e = payload, n;
+    while (e) {
+       n = e->next;
+       xmlFree(e);
+       e = n;
+    }
+}
+
 /**
  * xmlSchemaIDCFreeMatcherList:
  * @matcher: the first IDC matcher in the list
@@ -22331,6 +22445,8 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher)
            }
            xmlSchemaItemListFree(matcher->targets);
        }
+       if (matcher->htab != NULL)
+         xmlHashFree(matcher->htab, xmlFreeIDCHashEntry);
        xmlFree(matcher);
        matcher = next;
     }
@@ -22381,6 +22497,10 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
            xmlSchemaItemListFree(matcher->targets);
            matcher->targets = NULL;
        }
+       if (matcher->htab != NULL) {
+           xmlHashFree(matcher->htab, xmlFreeIDCHashEntry);
+           matcher->htab = NULL;
+       }
        matcher->next = NULL;
        /*
        * Cache the matcher.
@@ -22615,10 +22735,10 @@ next_sto:
 }
 
 static const xmlChar *
-xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
-                             xmlChar **buf,
-                             xmlSchemaPSVIIDCKeyPtr *seq,
-                             int count)
+xmlSchemaFormatIDCKeySequence_1(xmlSchemaValidCtxtPtr vctxt,
+                               xmlChar **buf,
+                               xmlSchemaPSVIIDCKeyPtr *seq,
+                               int count, int for_hash)
 {
     int i, res;
     xmlChar *value = NULL;
@@ -22626,9 +22746,13 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
     *buf = xmlStrdup(BAD_CAST "[");
     for (i = 0; i < count; i++) {
        *buf = xmlStrcat(*buf, BAD_CAST "'");
-       res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
-           xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
-           &value);
+       if (!for_hash)
+           res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
+                   xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
+                   &value);
+       else {
+           res = xmlSchemaGetCanonValueHash(seq[i]->val, &value);
+       }
        if (res == 0)
            *buf = xmlStrcat(*buf, BAD_CAST value);
        else {
@@ -22650,6 +22774,24 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
     return (BAD_CAST *buf);
 }
 
+static const xmlChar *
+xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
+                             xmlChar **buf,
+                             xmlSchemaPSVIIDCKeyPtr *seq,
+                             int count)
+{
+    return xmlSchemaFormatIDCKeySequence_1(vctxt, buf, seq, count, 0);
+}
+
+static const xmlChar *
+xmlSchemaHashKeySequence(xmlSchemaValidCtxtPtr vctxt,
+                        xmlChar **buf,
+                        xmlSchemaPSVIIDCKeyPtr *seq,
+                        int count)
+{
+    return xmlSchemaFormatIDCKeySequence_1(vctxt, buf, seq, count, 1);
+}
+
 /**
  * xmlSchemaXPathPop:
  * @vctxt: the WXS validation context
@@ -23011,15 +23153,25 @@ create_key:
            if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
                (targets->nbItems != 0)) {
                xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq;
+               xmlIDCHashEntryPtr e;
 
-               i = 0;
                res = 0;
+
+               if (!matcher->htab)
+                   e = NULL;
+               else {
+                   xmlChar *value = NULL;
+                   xmlSchemaHashKeySequence(vctxt, &value, *keySeq, nbKeys);
+                   e = xmlHashLookup(matcher->htab, value);
+                   FREE_AND_NULL(value);
+               }
+
                /*
                * Compare the key-sequences, key by key.
                */
-               do {
+               for (;e; e = e->next) {
                    bkeySeq =
-                       ((xmlSchemaPSVIIDCNodePtr) targets->items[i])->keys;
+                       ((xmlSchemaPSVIIDCNodePtr) targets->items[e->index])->keys;
                    for (j = 0; j < nbKeys; j++) {
                        ckey = (*keySeq)[j];
                        bkey = bkeySeq[j];
@@ -23040,9 +23192,8 @@ create_key:
                        */
                        break;
                    }
-                   i++;
-               } while (i < targets->nbItems);
-               if (i != targets->nbItems) {
+               }
+               if (e) {
                    xmlChar *str = NULL, *strB = NULL;
                    /*
                    * TODO: Try to report the key-sequence.
@@ -23120,6 +23271,24 @@ create_key:
                }
                return (-1);
            }
+           if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) {
+               xmlChar *value = NULL;
+               xmlIDCHashEntryPtr r, e;
+               if (!matcher->htab)
+                 matcher->htab = xmlHashCreate(4);
+               xmlSchemaHashKeySequence(vctxt, &value, ntItem->keys, nbKeys);
+               e = xmlMalloc(sizeof *e);
+               e->index = targets->nbItems - 1;
+               r = xmlHashLookup(matcher->htab, value);
+               if (r) {
+                   e->next = r->next;
+                   r->next = e;
+               } else {
+                   e->next = NULL;
+                   xmlHashAddEntry(matcher->htab, value, e);
+               }
+               FREE_AND_NULL(value);
+           }
 
            goto selector_leave;
 selector_key_error:
@@ -23376,6 +23545,10 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
            matcher->targets->items = NULL;
            matcher->targets->sizeItems = 0;
            matcher->targets->nbItems = 0;
+           if (matcher->htab) {
+               xmlHashFree(matcher->htab, xmlFreeIDCHashEntry);
+               matcher->htab = NULL;
+           }
        } else {
            /*
            * Compare the key-sequences and add to the IDC node-table.
@@ -23823,6 +23996,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
            int i, j, k, res, nbFields, hasDupls;
            xmlSchemaPSVIIDCKeyPtr *refKeys, *keys;
            xmlSchemaPSVIIDCNodePtr refNode = NULL;
+           xmlHashTablePtr table = NULL;
 
            nbFields = matcher->aidc->def->nbFields;
 
@@ -23840,26 +24014,52 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
            /*
            * Search for a matching key-sequences.
            */
+           if (bind) {
+               table = xmlHashCreate(bind->nbNodes * 2);
+               for (j = 0; j < bind->nbNodes; j++) {
+                   xmlChar *value;
+                   xmlIDCHashEntryPtr r, e;
+                   keys = bind->nodeTable[j]->keys;
+                   xmlSchemaHashKeySequence(vctxt, &value, keys, nbFields);
+                   e = xmlMalloc(sizeof *e);
+                   e->index = j;
+                   r = xmlHashLookup(table, value);
+                   if (r) {
+                       e->next = r->next;
+                       r->next = e;
+                   } else {
+                       e->next = NULL;
+                       xmlHashAddEntry(table, value, e);
+                   }
+                   FREE_AND_NULL(value);
+               }
+           }
            for (i = 0; i < matcher->targets->nbItems; i++) {
                res = 0;
                refNode = matcher->targets->items[i];
                if (bind != NULL) {
+                   xmlChar *value;
+                   xmlIDCHashEntryPtr e;
                    refKeys = refNode->keys;
-                   for (j = 0; j < bind->nbNodes; j++) {
-                       keys = bind->nodeTable[j]->keys;
+                   xmlSchemaHashKeySequence(vctxt, &value, refKeys, nbFields);
+                   e = xmlHashLookup(table, value);
+                   FREE_AND_NULL(value);
+                   res = 0;
+                   for (;e; e = e->next) {
+                       keys = bind->nodeTable[e->index]->keys;
                        for (k = 0; k < nbFields; k++) {
                            res = xmlSchemaAreValuesEqual(keys[k]->val,
-                               refKeys[k]->val);
+                                                         refKeys[k]->val);
                            if (res == 0)
-                               break;
+                               break;
                            else if (res == -1) {
                                return (-1);
                            }
                        }
                        if (res == 1) {
                            /*
-                           * Match found.
-                           */
+                            * Match found.
+                            */
                            break;
                        }
                    }
@@ -23914,6 +24114,9 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
                    FREE_AND_NULL(strB);
                }
            }
+           if (table) {
+               xmlHashFree(table, xmlFreeIDCHashEntry);
+           }
        }
        matcher = matcher->next;
     }
@@ -24184,7 +24387,7 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt,
                        unsigned long length,
                        int fireErrors)
 {
-    int ret, error = 0;
+    int ret, error = 0, found;
 
     xmlSchemaTypePtr tmpType;
     xmlSchemaFacetLinkPtr facetLink;
@@ -24308,103 +24511,98 @@ WXS_IS_LIST:
     }
 
 pattern_and_enum:
-    if (error >= 0) {
-       int found = 0;
-       /*
-       * Process enumerations. Facet values are in the value space
-       * of the defining type's base type. This seems to be a bug in the
-       * XML Schema 1.0 spec. Use the whitespace type of the base type.
-       * Only the first set of enumerations in the ancestor-or-self axis
-       * is used for validation.
-       */
-       ret = 0;
-       tmpType = type;
-       do {
-           for (facet = tmpType->facets; facet != NULL; facet = facet->next) {
-               if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
-                   continue;
-               found = 1;
-               ret = xmlSchemaAreValuesEqual(facet->val, val);
-               if (ret == 1)
-                   break;
-               else if (ret < 0) {
-                   AERROR_INT("xmlSchemaValidateFacets",
-                       "validating against an enumeration facet");
-                   return (-1);
-               }
-           }
-           if (ret != 0)
-               break;
-           /*
-           * Break on the first set of enumerations. Any additional
-           *  enumerations which might be existent on the ancestors
-           *  of the current type are restricted by this set; thus
-           *  *must* *not* be taken into account.
-           */
-           if (found)
-               break;
-           tmpType = tmpType->baseType;
-       } while ((tmpType != NULL) &&
-           (tmpType->type != XML_SCHEMA_TYPE_BASIC));
-       if (found && (ret == 0)) {
-           ret = XML_SCHEMAV_CVC_ENUMERATION_VALID;
-           if (fireErrors) {
-               xmlSchemaFacetErr(actxt, ret, node,
-                   value, 0, type, NULL, NULL, NULL, NULL);
-           } else
-               return (ret);
-           if (error == 0)
-               error = ret;
-       }
-    }
-
-    if (error >= 0) {
-       int found;
-       /*
-       * Process patters. Pattern facets are ORed at type level
-       * and ANDed if derived. Walk the base type axis.
-       */
-       tmpType = type;
-       facet = NULL;
-       do {
-           found = 0;
-           for (facetLink = tmpType->facetSet; facetLink != NULL;
-               facetLink = facetLink->next) {
-               if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
-                   continue;
-               found = 1;
-               /*
-               * NOTE that for patterns, @value needs to be the
-               * normalized value.
-               */
-               ret = xmlRegexpExec(facetLink->facet->regexp, value);
-               if (ret == 1)
-                   break;
-               else if (ret < 0) {
-                   AERROR_INT("xmlSchemaValidateFacets",
-                       "validating against a pattern facet");
-                   return (-1);
-               } else {
-                   /*
-                   * Save the last non-validating facet.
-                   */
-                   facet = facetLink->facet;
-               }
-           }
-           if (found && (ret != 1)) {
-               ret = XML_SCHEMAV_CVC_PATTERN_VALID;
-               if (fireErrors) {
-                   xmlSchemaFacetErr(actxt, ret, node,
-                       value, 0, type, facet, NULL, NULL, NULL);
-               } else
-                   return (ret);
-               if (error == 0)
-                   error = ret;
-               break;
-           }
-           tmpType = tmpType->baseType;
-       } while ((tmpType != NULL) && (tmpType->type != XML_SCHEMA_TYPE_BASIC));
-    }
+    found = 0;
+    /*
+    * Process enumerations. Facet values are in the value space
+    * of the defining type's base type. This seems to be a bug in the
+    * XML Schema 1.0 spec. Use the whitespace type of the base type.
+    * Only the first set of enumerations in the ancestor-or-self axis
+    * is used for validation.
+    */
+    ret = 0;
+    tmpType = type;
+    do {
+        for (facet = tmpType->facets; facet != NULL; facet = facet->next) {
+            if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
+                continue;
+            found = 1;
+            ret = xmlSchemaAreValuesEqual(facet->val, val);
+            if (ret == 1)
+                break;
+            else if (ret < 0) {
+                AERROR_INT("xmlSchemaValidateFacets",
+                    "validating against an enumeration facet");
+                return (-1);
+            }
+        }
+        if (ret != 0)
+            break;
+        /*
+        * Break on the first set of enumerations. Any additional
+        *  enumerations which might be existent on the ancestors
+        *  of the current type are restricted by this set; thus
+        *  *must* *not* be taken into account.
+        */
+        if (found)
+            break;
+        tmpType = tmpType->baseType;
+    } while ((tmpType != NULL) &&
+        (tmpType->type != XML_SCHEMA_TYPE_BASIC));
+    if (found && (ret == 0)) {
+        ret = XML_SCHEMAV_CVC_ENUMERATION_VALID;
+        if (fireErrors) {
+            xmlSchemaFacetErr(actxt, ret, node,
+                value, 0, type, NULL, NULL, NULL, NULL);
+        } else
+            return (ret);
+        if (error == 0)
+            error = ret;
+    }
+
+    /*
+    * Process patters. Pattern facets are ORed at type level
+    * and ANDed if derived. Walk the base type axis.
+    */
+    tmpType = type;
+    facet = NULL;
+    do {
+        found = 0;
+        for (facetLink = tmpType->facetSet; facetLink != NULL;
+            facetLink = facetLink->next) {
+            if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
+                continue;
+            found = 1;
+            /*
+            * NOTE that for patterns, @value needs to be the
+            * normalized value.
+            */
+            ret = xmlRegexpExec(facetLink->facet->regexp, value);
+            if (ret == 1)
+                break;
+            else if (ret < 0) {
+                AERROR_INT("xmlSchemaValidateFacets",
+                    "validating against a pattern facet");
+                return (-1);
+            } else {
+                /*
+                * Save the last non-validating facet.
+                */
+                facet = facetLink->facet;
+            }
+        }
+        if (found && (ret != 1)) {
+            ret = XML_SCHEMAV_CVC_PATTERN_VALID;
+            if (fireErrors) {
+                xmlSchemaFacetErr(actxt, ret, node,
+                    value, 0, type, facet, NULL, NULL, NULL);
+            } else
+                return (ret);
+            if (error == 0)
+                error = ret;
+            break;
+        }
+        tmpType = tmpType->baseType;
+    } while ((tmpType != NULL) && (tmpType->type != XML_SCHEMA_TYPE_BASIC));
 
     return (error);
 }
@@ -27802,7 +28000,7 @@ xmlSchemaIsValid(xmlSchemaValidCtxtPtr ctxt)
  * @warn: the warning function
  * @ctx: the functions context
  *
- * Set the error and warning callback informations
+ * Set the error and warning callback information
  */
 void
 xmlSchemaSetValidErrors(xmlSchemaValidCtxtPtr ctxt,
@@ -27847,7 +28045,7 @@ xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
  * @warn: the warning function result
  * @ctx: the functions context result
  *
- * Get the error and warning callback informations
+ * Get the error and warning callback information
  *
  * Returns -1 in case of error and 0 otherwise
  */
@@ -27938,6 +28136,10 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
        VERROR(1, NULL, "The document has no document element");
        return (1);
     }
+    for (node = valRoot->next; node != NULL; node = node->next) {
+        if (node->type == XML_ELEMENT_NODE)
+            VERROR(1, NULL, "The document has more than one top element");
+    }
     vctxt->depth = -1;
     vctxt->validationRoot = valRoot;
     node = valRoot;
@@ -28095,7 +28297,6 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
     vctxt->nberrors = 0;
     vctxt->depth = -1;
     vctxt->skipDepth = -1;
-    vctxt->xsiAssemble = 0;
     vctxt->hasKeyrefs = 0;
 #ifdef ENABLE_IDC_NODE_TABLES_TEST
     vctxt->createIDCNodeTables = 1;
@@ -28273,13 +28474,13 @@ struct _xmlSchemaSplitSAXData {
 struct _xmlSchemaSAXPlug {
     unsigned int magic;
 
-    /* the original callbacks informations */
+    /* the original callbacks information */
     xmlSAXHandlerPtr     *user_sax_ptr;
     xmlSAXHandlerPtr      user_sax;
     void                **user_data_ptr;
     void                 *user_data;
 
-    /* the block plugged back and validation informations */
+    /* the block plugged back and validation information */
     xmlSAXHandler         schemas_sax;
     xmlSchemaValidCtxtPtr ctxt;
 };
index e7764d9..9c2dff0 100644 (file)
@@ -199,7 +199,7 @@ static xmlSchemaTypePtr xmlSchemaTypeNmtokensDef = NULL;
  ************************************************************************/
 /**
  * xmlSchemaTypeErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle an out of memory condition
  */
@@ -1160,9 +1160,12 @@ static const unsigned int daysInMonthLeap[12] =
 #define VALID_DATETIME(dt)                                     \
        (VALID_DATE(dt) && VALID_TIME(dt))
 
-#define SECS_PER_MIN            (60)
-#define SECS_PER_HOUR           (60 * SECS_PER_MIN)
-#define SECS_PER_DAY            (24 * SECS_PER_HOUR)
+#define SECS_PER_MIN            60
+#define MINS_PER_HOUR           60
+#define HOURS_PER_DAY           24
+#define SECS_PER_HOUR           (MINS_PER_HOUR * SECS_PER_MIN)
+#define SECS_PER_DAY            (HOURS_PER_DAY * SECS_PER_HOUR)
+#define MINS_PER_DAY            (HOURS_PER_DAY * MINS_PER_HOUR)
 
 static const long dayInYearByMonth[12] =
        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
@@ -1222,7 +1225,14 @@ _xmlSchemaParseGYear (xmlSchemaValDatePtr dt, const xmlChar **str) {
     firstChar = cur;
 
     while ((*cur >= '0') && (*cur <= '9')) {
-       dt->year = dt->year * 10 + (*cur - '0');
+        int digit = *cur - '0';
+
+        if (dt->year > LONG_MAX / 10)
+            return 2;
+       dt->year *= 10;
+        if (dt->year > LONG_MAX - digit)
+            return 2;
+        dt->year += digit;
        cur++;
        digcnt++;
     }
@@ -1791,10 +1801,8 @@ xmlSchemaValidateDuration (xmlSchemaTypePtr type ATTRIBUTE_UNUSED,
     xmlSchemaValPtr dur;
     int isneg = 0;
     unsigned int seq = 0;
-    double         num;
-    int            num_type = 0;  /* -1 = invalid, 0 = int, 1 = floating */
-    const xmlChar  desig[]  = {'Y', 'M', 'D', 'H', 'M', 'S'};
-    const double   multi[]  = { 0.0, 0.0, 86400.0, 3600.0, 60.0, 1.0, 0.0};
+    long days, secs = 0;
+    double sec_frac = 0.0;
 
     if (duration == NULL)
        return -1;
@@ -1819,6 +1827,10 @@ xmlSchemaValidateDuration (xmlSchemaTypePtr type ATTRIBUTE_UNUSED,
        return -1;
 
     while (*cur != 0) {
+        long           num = 0;
+        size_t         has_digits = 0;
+        int            has_frac = 0;
+        const xmlChar  desig[] = {'Y', 'M', 'D', 'H', 'M', 'S'};
 
         /* input string should be empty or invalid date/time item */
         if (seq >= sizeof(desig))
@@ -1826,53 +1838,104 @@ xmlSchemaValidateDuration (xmlSchemaTypePtr type ATTRIBUTE_UNUSED,
 
         /* T designator must be present for time items */
         if (*cur == 'T') {
-            if (seq <= 3) {
-                seq = 3;
-                cur++;
-            } else
-                return 1;
+            if (seq > 3)
+                goto error;
+            cur++;
+            seq = 3;
         } else if (seq == 3)
             goto error;
 
-        /* parse the number portion of the item */
-        PARSE_NUM(num, cur, num_type);
-
-        if ((num_type == -1) || (*cur == 0))
-            goto error;
-
-        /* update duration based on item type */
-        while (seq < sizeof(desig)) {
-            if (*cur == desig[seq]) {
+        /* Parse integral part. */
+        while (*cur >= '0' && *cur <= '9') {
+            long digit = *cur - '0';
 
-                /* verify numeric type; only seconds can be float */
-                if ((num_type != 0) && (seq < (sizeof(desig)-1)))
-                    goto error;
+            if (num > LONG_MAX / 10)
+                goto error;
+            num *= 10;
+            if (num > LONG_MAX - digit)
+                goto error;
+            num += digit;
 
-                switch (seq) {
-                    case 0:
-                        dur->value.dur.mon = (long)num * 12;
-                        break;
-                    case 1:
-                        dur->value.dur.mon += (long)num;
-                        break;
-                    default:
-                        /* convert to seconds using multiplier */
-                        dur->value.dur.sec += num * multi[seq];
-                        seq++;
-                        break;
-                }
+            has_digits = 1;
+            cur++;
+        }
 
-                break;          /* exit loop */
+        if (*cur == '.') {
+            /* Parse fractional part. */
+            double mult = 1.0;
+            cur++;
+            has_frac = 1;
+            while (*cur >= '0' && *cur <= '9') {
+                mult /= 10.0;
+                sec_frac += (*cur - '0') * mult;
+                has_digits = 1;
+                cur++;
             }
-            /* no date designators found? */
-            if ((++seq == 3) || (seq == 6))
+        }
+
+        while (*cur != desig[seq]) {
+            seq++;
+            /* No T designator or invalid char. */
+            if (seq == 3 || seq == sizeof(desig))
                 goto error;
         }
        cur++;
-       if (collapse)
-           while IS_WSP_BLANK_CH(*cur) cur++;
+
+        if (!has_digits || (has_frac && (seq != 5)))
+            goto error;
+
+        switch (seq) {
+            case 0:
+                /* Year */
+                if (num > LONG_MAX / 12)
+                    goto error;
+                dur->value.dur.mon = num * 12;
+                break;
+            case 1:
+                /* Month */
+                if (dur->value.dur.mon > LONG_MAX - num)
+                    goto error;
+                dur->value.dur.mon += num;
+                break;
+            case 2:
+                /* Day */
+                dur->value.dur.day = num;
+                break;
+            case 3:
+                /* Hour */
+                days = num / HOURS_PER_DAY;
+                if (dur->value.dur.day > LONG_MAX - days)
+                    goto error;
+                dur->value.dur.day += days;
+                secs = (num % HOURS_PER_DAY) * SECS_PER_HOUR;
+                break;
+            case 4:
+                /* Minute */
+                days = num / MINS_PER_DAY;
+                if (dur->value.dur.day > LONG_MAX - days)
+                    goto error;
+                dur->value.dur.day += days;
+                secs += (num % MINS_PER_DAY) * SECS_PER_MIN;
+                break;
+            case 5:
+                /* Second */
+                days = num / SECS_PER_DAY;
+                if (dur->value.dur.day > LONG_MAX - days)
+                    goto error;
+                dur->value.dur.day += days;
+                secs += num % SECS_PER_DAY;
+                break;
+        }
+
+        seq++;
     }
 
+    days = secs / SECS_PER_DAY;
+    if (dur->value.dur.day > LONG_MAX - days)
+        goto error;
+    dur->value.dur.day += days;
+    dur->value.dur.sec = (secs % SECS_PER_DAY) + sec_frac;
+
     if (isneg) {
         dur->value.dur.mon = -dur->value.dur.mon;
         dur->value.dur.day = -dur->value.dur.day;
@@ -2124,6 +2187,44 @@ xmlSchemaParseUInt(const xmlChar **str, unsigned long *llo,
     return(ret);
 }
 
+/*
+ * xmlSchemaCheckLanguageType
+ * @value: the value to check
+ *
+ * Check that a value conforms to the lexical space of the language datatype.
+ * Must conform to [a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*
+ *
+ * Returns 1 if this validates, 0 otherwise.
+ */
+static int
+xmlSchemaCheckLanguageType(const xmlChar* value) {
+    int first = 1, len = 0;
+    const xmlChar* cur = value;
+
+    if (value == NULL)
+        return (0);
+
+    while (cur[0] != 0) {
+        if (!( ((cur[0] >= 'a') && (cur[0] <= 'z')) || ((cur[0] >= 'A') && (cur[0] <= 'Z'))
+            || (cur[0] == '-')
+            || ((first == 0) && (xmlIsDigit_ch(cur[0]))) ))
+            return (0);
+        if (cur[0] == '-') {
+            if ((len < 1) || (len > 8))
+                return (0);
+            len = 0;
+            first = 0;
+        }
+        else
+            len++;
+        cur++;
+    }
+    if ((len < 1) || (len > 8))
+        return (0);
+
+    return (1);
+}
+
 /**
  * xmlSchemaValAtomicType:
  * @type: the predefined type
@@ -2636,12 +2737,13 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
                 goto return0;
             }
         case XML_SCHEMAS_LANGUAGE:
-           if (normOnTheFly) {
+           if ((norm == NULL) && (normOnTheFly)) {
                norm = xmlSchemaCollapseString(value);
                if (norm != NULL)
                    value = norm;
            }
-            if (xmlCheckLanguageID(value) == 1) {
+
+            if (xmlSchemaCheckLanguageType(value) == 1) {
                 if (val != NULL) {
                     v = xmlSchemaNewValue(XML_SCHEMAS_LANGUAGE);
                     if (v != NULL) {
@@ -3628,6 +3730,8 @@ xmlSchemaCompareDurations(xmlSchemaValPtr x, xmlSchemaValPtr y)
        minday = 0;
        maxday = 0;
     } else {
+        if (myear > LONG_MAX / 366)
+            return -2;
         /* FIXME: This doesn't take leap year exceptions every 100/400 years
            into account. */
        maxday = 365 * myear + (myear + 3) / 4;
@@ -4016,6 +4120,14 @@ xmlSchemaCompareDates (xmlSchemaValPtr x, xmlSchemaValPtr y)
     if ((x == NULL) || (y == NULL))
         return -2;
 
+    if ((x->value.date.year > LONG_MAX / 366) ||
+        (x->value.date.year < LONG_MIN / 366) ||
+        (y->value.date.year > LONG_MAX / 366) ||
+        (y->value.date.year < LONG_MIN / 366)) {
+        /* Possible overflow when converting to days. */
+        return -2;
+    }
+
     if (x->value.date.tz_flag) {
 
         if (!y->value.date.tz_flag) {
@@ -5069,7 +5181,7 @@ xmlSchemaGetFacetValueAsULong(xmlSchemaFacetPtr facet)
     /*
     * TODO: Check if this is a decimal.
     */
-    if (facet == NULL)
+    if (facet == NULL || facet->val == NULL)
         return 0;
     return ((unsigned long) facet->val->value.decimal.lo);
 }
@@ -6003,13 +6115,13 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue)
                    * recoverable timezone and not "Z".
                    */
                    snprintf(buf, 30,
-                       "%04ld:%02u:%02uZ",
+                       "%04ld-%02u-%02uZ",
                        norm->value.date.year, norm->value.date.mon,
                        norm->value.date.day);
                    xmlSchemaFreeValue(norm);
                } else {
                    snprintf(buf, 30,
-                       "%04ld:%02u:%02u",
+                       "%04ld-%02u-%02u",
                        val->value.date.year, val->value.date.mon,
                        val->value.date.day);
                }
@@ -6030,14 +6142,14 @@ xmlSchemaGetCanonValue(xmlSchemaValPtr val, const xmlChar **retValue)
                    * TODO: Check if "%.14g" is portable.
                    */
                    snprintf(buf, 50,
-                       "%04ld:%02u:%02uT%02u:%02u:%02.14gZ",
+                       "%04ld-%02u-%02uT%02u:%02u:%02.14gZ",
                        norm->value.date.year, norm->value.date.mon,
                        norm->value.date.day, norm->value.date.hour,
                        norm->value.date.min, norm->value.date.sec);
                    xmlSchemaFreeValue(norm);
                } else {
                    snprintf(buf, 50,
-                       "%04ld:%02u:%02uT%02u:%02u:%02.14g",
+                       "%04ld-%02u-%02uT%02u:%02u:%02.14g",
                        val->value.date.year, val->value.date.mon,
                        val->value.date.day, val->value.date.hour,
                        val->value.date.min, val->value.date.sec);
index 8d2e06f..e8a1e45 100644 (file)
@@ -130,16 +130,18 @@ xmlCharStrdup(const char *cur) {
 
 int
 xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
-    register int tmp;
-
     if (str1 == str2) return(0);
     if (str1 == NULL) return(-1);
     if (str2 == NULL) return(1);
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+    return(strcmp((const char *)str1, (const char *)str2));
+#else
     do {
-        tmp = *str1++ - *str2;
+        int tmp = *str1++ - *str2;
         if (tmp != 0) return(tmp);
     } while (*str2++ != 0);
     return 0;
+#endif
 }
 
 /**
@@ -158,10 +160,14 @@ xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
     if (str1 == str2) return(1);
     if (str1 == NULL) return(0);
     if (str2 == NULL) return(0);
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+    return(strcmp((const char *)str1, (const char *)str2) == 0);
+#else
     do {
         if (*str1++ != *str2) return(0);
     } while (*str2++);
     return(1);
+#endif
 }
 
 /**
@@ -204,18 +210,15 @@ xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
 
 int
 xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
-    register int tmp;
-
     if (len <= 0) return(0);
     if (str1 == str2) return(0);
     if (str1 == NULL) return(-1);
     if (str2 == NULL) return(1);
-#ifdef __GNUC__
-    tmp = strncmp((const char *)str1, (const char *)str2, len);
-    return tmp;
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+    return(strncmp((const char *)str1, (const char *)str2, len));
 #else
     do {
-        tmp = *str1++ - *str2;
+        int tmp = *str1++ - *str2;
         if (tmp != 0 || --len == 0) return(tmp);
     } while (*str2++ != 0);
     return 0;
diff --git a/xpath.c b/xpath.c
index 9f64ab9..7497ba0 100644 (file)
--- a/xpath.c
+++ b/xpath.c
 #define XPATH_MAX_NODESET_LENGTH 10000000
 
 /*
+ * XPATH_MAX_RECRUSION_DEPTH:
+ * Maximum amount of nested functions calls when parsing or evaluating
+ * expressions
+ */
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+#define XPATH_MAX_RECURSION_DEPTH 500
+#else
+#define XPATH_MAX_RECURSION_DEPTH 5000
+#endif
+
+/*
  * TODO:
  * There are a few spots where some tests are done which depend upon ascii
  * data.  These should be enhanced for full UTF8 support (see particularly
@@ -477,14 +488,6 @@ int wrap_cmp( xmlNodePtr x, xmlNodePtr y );
  *                                                                     *
  ************************************************************************/
 
-#ifndef INFINITY
-#define INFINITY (DBL_MAX * DBL_MAX)
-#endif
-
-#ifndef NAN
-#define NAN (INFINITY / INFINITY)
-#endif
-
 double xmlXPathNAN;
 double xmlXPathPINF;
 double xmlXPathNINF;
@@ -494,11 +497,14 @@ double xmlXPathNINF;
  *
  * Initialize the XPath environment
  */
+ATTRIBUTE_NO_SANITIZE("float-divide-by-zero")
 void
 xmlXPathInit(void) {
-    xmlXPathNAN = NAN;
-    xmlXPathPINF = INFINITY;
-    xmlXPathNINF = -INFINITY;
+    /* MSVC doesn't allow division by zero in constant expressions. */
+    double zero = 0.0;
+    xmlXPathNAN = 0.0 / zero;
+    xmlXPathPINF = 1.0 / zero;
+    xmlXPathNINF = -xmlXPathPINF;
 }
 
 /**
@@ -527,9 +533,9 @@ xmlXPathIsInf(double val) {
 #ifdef isinf
     return isinf(val) ? (val > 0 ? 1 : -1) : 0;
 #else
-    if (val >= INFINITY)
+    if (val >= xmlXPathPINF)
         return 1;
-    if (val <= -INFINITY)
+    if (val <= -xmlXPathPINF)
         return -1;
     return 0;
 #endif
@@ -619,7 +625,7 @@ static const char *xmlXPathErrorMessages[] = {
 /**
  * xmlXPathErrMemory:
  * @ctxt:  an XPath context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -662,7 +668,7 @@ xmlXPathErrMemory(xmlXPathContextPtr ctxt, const char *extra)
 /**
  * xmlXPathPErrMemory:
  * @ctxt:  an XPath parser context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -1746,7 +1752,6 @@ static int xmlXPathDebugObjMaxUsers = 0;
 static int xmlXPathDebugObjMaxXSLTTree = 0;
 static int xmlXPathDebugObjMaxAll = 0;
 
-/* REVISIT TODO: Make this static when committing */
 static void
 xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
 {
@@ -2061,7 +2066,6 @@ xmlXPathDebugObjUsageReleased(xmlXPathContextPtr ctxt,
     xmlXPathDebugObjCounterAll--;
 }
 
-/* REVISIT TODO: Make this static when committing */
 static void
 xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
 {
@@ -5864,10 +5868,10 @@ xmlXPathCastNodeToNumber (xmlNodePtr node) {
     double ret;
 
     if (node == NULL)
-       return(NAN);
+       return(xmlXPathNAN);
     strval = xmlXPathCastNodeToString(node);
     if (strval == NULL)
-       return(NAN);
+       return(xmlXPathNAN);
     ret = xmlXPathCastStringToNumber(strval);
     xmlFree(strval);
 
@@ -5888,7 +5892,7 @@ xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns) {
     double ret;
 
     if (ns == NULL)
-       return(NAN);
+       return(xmlXPathNAN);
     str = xmlXPathCastNodeSetToString(ns);
     ret = xmlXPathCastStringToNumber(str);
     xmlFree(str);
@@ -5908,13 +5912,13 @@ xmlXPathCastToNumber(xmlXPathObjectPtr val) {
     double ret = 0.0;
 
     if (val == NULL)
-       return(NAN);
+       return(xmlXPathNAN);
     switch (val->type) {
     case XPATH_UNDEFINED:
 #ifdef DEBUG_EXPR
        xmlGenericError(xmlGenericErrorContext, "NUMBER: undefined\n");
 #endif
-       ret = NAN;
+       ret = xmlXPathNAN;
        break;
     case XPATH_NODESET:
     case XPATH_XSLT_TREE:
@@ -5934,7 +5938,7 @@ xmlXPathCastToNumber(xmlXPathObjectPtr val) {
     case XPATH_RANGE:
     case XPATH_LOCATIONSET:
        TODO;
-       ret = NAN;
+       ret = xmlXPathNAN;
        break;
     }
     return(ret);
@@ -6120,9 +6124,6 @@ xmlXPathNewContext(xmlDocPtr doc) {
     ret->contextSize = -1;
     ret->proximityPosition = -1;
 
-    ret->maxDepth = INT_MAX;
-    ret->maxParserDepth = INT_MAX;
-
 #ifdef XP_DEFAULT_CACHE_ON
     if (xmlXPathContextSetCache(ret, 1, -1, 0) == -1) {
        xmlXPathFreeContext(ret);
@@ -7564,7 +7565,7 @@ xmlXPathModValues(xmlXPathParserContextPtr ctxt) {
     CHECK_TYPE(XPATH_NUMBER);
     arg1 = ctxt->value->floatval;
     if (arg2 == 0)
-       ctxt->value->floatval = NAN;
+       ctxt->value->floatval = xmlXPathNAN;
     else {
        ctxt->value->floatval = fmod(arg1, arg2);
     }
@@ -9994,7 +9995,7 @@ xmlXPathStringEvalNumber(const xmlChar *str) {
     if (cur == NULL) return(0);
     while (IS_BLANK_CH(*cur)) cur++;
     if ((*cur != '.') && ((*cur < '0') || (*cur > '9')) && (*cur != '-')) {
-        return(NAN);
+        return(xmlXPathNAN);
     }
     if (*cur == '-') {
        isneg = 1;
@@ -10030,7 +10031,7 @@ xmlXPathStringEvalNumber(const xmlChar *str) {
 
         cur++;
        if (((*cur < '0') || (*cur > '9')) && (!ok)) {
-           return(NAN);
+           return(xmlXPathNAN);
        }
         while (*cur == '0') {
            frac = frac + 1;
@@ -10063,7 +10064,7 @@ xmlXPathStringEvalNumber(const xmlChar *str) {
       }
     }
     while (IS_BLANK_CH(*cur)) cur++;
-    if (*cur != 0) return(NAN);
+    if (*cur != 0) return(xmlXPathNAN);
     if (isneg) ret = -ret;
     if (is_exponent_negative) exponent = -exponent;
     ret *= pow(10.0, (double)exponent);
@@ -10088,6 +10089,7 @@ xmlXPathCompNumber(xmlXPathParserContextPtr ctxt)
     int ok = 0;
     int exponent = 0;
     int is_exponent_negative = 0;
+    xmlXPathObjectPtr num;
 #ifdef __GNUC__
     unsigned long tmp = 0;
     double temp;
@@ -10160,8 +10162,13 @@ xmlXPathCompNumber(xmlXPathParserContextPtr ctxt)
             exponent = -exponent;
         ret *= pow(10.0, (double) exponent);
     }
-    PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0,
-                   xmlXPathCacheNewFloat(ctxt->context, ret), NULL);
+    num = xmlXPathCacheNewFloat(ctxt->context, ret);
+    if (num == NULL) {
+       ctxt->error = XPATH_MEMORY_ERROR;
+    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_NUMBER, 0, 0, num,
+                              NULL) == -1) {
+        xmlXPathReleaseObject(ctxt->context, num);
+    }
 }
 
 /**
@@ -10223,6 +10230,7 @@ static void
 xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
     const xmlChar *q;
     xmlChar *ret = NULL;
+    xmlXPathObjectPtr lit;
 
     if (CUR == '"') {
         NEXT;
@@ -10250,8 +10258,13 @@ xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
        XP_ERROR(XPATH_START_LITERAL_ERROR);
     }
     if (ret == NULL) return;
-    PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0,
-                  xmlXPathCacheNewString(ctxt->context, ret), NULL);
+    lit = xmlXPathCacheNewString(ctxt->context, ret);
+    if (lit == NULL) {
+       ctxt->error = XPATH_MEMORY_ERROR;
+    } else if (PUSH_LONG_EXPR(XPATH_OP_VALUE, XPATH_STRING, 0, 0, lit,
+                              NULL) == -1) {
+        xmlXPathReleaseObject(ctxt->context, lit);
+    }
     xmlFree(ret);
 }
 
@@ -10288,8 +10301,10 @@ xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
        XP_ERROR(XPATH_VARIABLE_REF_ERROR);
     }
     ctxt->comp->last = -1;
-    PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0,
-                  name, prefix);
+    if (PUSH_LONG_EXPR(XPATH_OP_VARIABLE, 0, 0, 0, name, prefix) == -1) {
+        xmlFree(prefix);
+        xmlFree(name);
+    }
     SKIP_BLANKS;
     if ((ctxt->context != NULL) && (ctxt->context->flags & XML_XPATH_NOVAR)) {
        XP_ERROR(XPATH_FORBID_VARIABLE_ERROR);
@@ -10396,8 +10411,10 @@ xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
            SKIP_BLANKS;
        }
     }
-    PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0,
-                  name, prefix);
+    if (PUSH_LONG_EXPR(XPATH_OP_FUNCTION, nbargs, 0, 0, name, prefix) == -1) {
+        xmlFree(prefix);
+        xmlFree(name);
+    }
     NEXT;
     SKIP_BLANKS;
 }
@@ -10934,9 +10951,13 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
     xmlXPathContextPtr xpctxt = ctxt->context;
 
     if (xpctxt != NULL) {
-        if (xpctxt->depth >= xpctxt->maxParserDepth)
+        if (xpctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
             XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
-        xpctxt->depth += 1;
+        /*
+         * Parsing a single '(' pushes about 10 functions on the call stack
+         * before recursing!
+         */
+        xpctxt->depth += 10;
     }
 
     xmlXPathCompAndExpr(ctxt);
@@ -11038,7 +11059,7 @@ xmlXPathCompPredicate(xmlXPathParserContextPtr ctxt, int filter) {
  */
 static xmlChar *
 xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
-                    xmlXPathTypeVal *type, const xmlChar **prefix,
+                    xmlXPathTypeVal *type, xmlChar **prefix,
                     xmlChar *name) {
     int blanks;
 
@@ -11269,7 +11290,7 @@ xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
        SKIP_BLANKS;
     } else {
        xmlChar *name = NULL;
-       const xmlChar *prefix = NULL;
+       xmlChar *prefix = NULL;
        xmlXPathTestVal test = (xmlXPathTestVal) 0;
        xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
        xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
@@ -11379,9 +11400,11 @@ eval_predicates:
            PUSH_BINARY_EXPR(XPATH_OP_RANGETO, op2, op1, 0, 0);
        } else
 #endif
-           PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
-                          test, type, (void *)prefix, (void *)name);
-
+        if (PUSH_FULL_EXPR(XPATH_OP_COLLECT, op1, ctxt->comp->last, axis,
+                           test, type, (void *)prefix, (void *)name) == -1) {
+            xmlFree(prefix);
+            xmlFree(name);
+        }
     }
 #ifdef DEBUG_STEP
     xmlGenericError(xmlGenericErrorContext, "Step : ");
@@ -11649,11 +11672,11 @@ xmlXPathNodeSetFilter(xmlXPathParserContextPtr ctxt,
         res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 
         if (ctxt->error != XPATH_EXPRESSION_OK)
-            goto exit;
+            break;
         if (res < 0) {
             /* Shouldn't happen */
             xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
-            goto exit;
+            break;
         }
 
         if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
@@ -11672,15 +11695,7 @@ xmlXPathNodeSetFilter(xmlXPathParserContextPtr ctxt,
 
         if (res != 0) {
             if (pos == maxPos) {
-                /* Clear remaining nodes and exit loop. */
-                if (hasNsNodes) {
-                    for (i++; i < set->nodeNr; i++) {
-                        node = set->nodeTab[i];
-                        if ((node != NULL) &&
-                            (node->type == XML_NAMESPACE_DECL))
-                            xmlXPathNodeSetFreeNs((xmlNsPtr) node);
-                    }
-                }
+                i += 1;
                 break;
             }
 
@@ -11688,6 +11703,15 @@ xmlXPathNodeSetFilter(xmlXPathParserContextPtr ctxt,
         }
     }
 
+    /* Free remaining nodes. */
+    if (hasNsNodes) {
+        for (; i < set->nodeNr; i++) {
+            xmlNodePtr node = set->nodeTab[i];
+            if ((node != NULL) && (node->type == XML_NAMESPACE_DECL))
+                xmlXPathNodeSetFreeNs((xmlNsPtr) node);
+        }
+    }
+
     set->nodeNr = j;
 
     /* If too many elements were removed, shrink table to preserve memory. */
@@ -11708,7 +11732,6 @@ xmlXPathNodeSetFilter(xmlXPathParserContextPtr ctxt,
         }
     }
 
-exit:
     xpctxt->node = oldnode;
     xpctxt->doc = olddoc;
     xpctxt->contextSize = oldcs;
@@ -11773,11 +11796,11 @@ xmlXPathLocationSetFilter(xmlXPathParserContextPtr ctxt,
         res = xmlXPathCompOpEvalToBoolean(ctxt, filterOp, 1);
 
         if (ctxt->error != XPATH_EXPRESSION_OK)
-            goto exit;
+            break;
         if (res < 0) {
             /* Shouldn't happen */
             xmlXPathErr(ctxt, XPATH_EXPR_ERROR);
-            goto exit;
+            break;
         }
 
         if ((res != 0) && ((pos >= minPos) && (pos <= maxPos))) {
@@ -11795,10 +11818,7 @@ xmlXPathLocationSetFilter(xmlXPathParserContextPtr ctxt,
 
         if (res != 0) {
             if (pos == maxPos) {
-                /* Clear remaining nodes and exit loop. */
-                for (i++; i < locset->locNr; i++) {
-                    xmlXPathFreeObject(locset->locTab[i]);
-                }
+                i += 1;
                 break;
             }
 
@@ -11806,6 +11826,10 @@ xmlXPathLocationSetFilter(xmlXPathParserContextPtr ctxt,
         }
     }
 
+    /* Free remaining nodes. */
+    for (; i < locset->locNr; i++)
+        xmlXPathFreeObject(locset->locTab[i]);
+
     locset->locNr = j;
 
     /* If too many elements were removed, shrink table to preserve memory. */
@@ -11826,7 +11850,6 @@ xmlXPathLocationSetFilter(xmlXPathParserContextPtr ctxt,
         }
     }
 
-exit:
     xpctxt->node = oldnode;
     xpctxt->doc = olddoc;
     xpctxt->contextSize = oldcs;
@@ -11864,7 +11887,7 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
                 "xmlXPathCompOpEvalPredicate: Expected a predicate\n");
             XP_ERROR(XPATH_INVALID_OPERAND);
        }
-        if (ctxt->context->depth >= ctxt->context->maxDepth)
+        if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
             XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
         ctxt->context->depth += 1;
        xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
@@ -12580,7 +12603,7 @@ xmlXPathCompOpEvalFirst(xmlXPathParserContextPtr ctxt,
     CHECK_ERROR0;
     if (OP_LIMIT_EXCEEDED(ctxt, 1))
         return(0);
-    if (ctxt->context->depth >= ctxt->context->maxDepth)
+    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
         XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
     ctxt->context->depth += 1;
     comp = ctxt->comp;
@@ -12721,7 +12744,7 @@ xmlXPathCompOpEvalLast(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op,
     CHECK_ERROR0;
     if (OP_LIMIT_EXCEEDED(ctxt, 1))
         return(0);
-    if (ctxt->context->depth >= ctxt->context->maxDepth)
+    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
         XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
     ctxt->context->depth += 1;
     comp = ctxt->comp;
@@ -12939,7 +12962,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
     CHECK_ERROR0;
     if (OP_LIMIT_EXCEEDED(ctxt, 1))
         return(0);
-    if (ctxt->context->depth >= ctxt->context->maxDepth)
+    if (ctxt->context->depth >= XPATH_MAX_RECURSION_DEPTH)
         XP_ERROR0(XPATH_RECURSION_LIMIT_EXCEEDED);
     ctxt->context->depth += 1;
     comp = ctxt->comp;
@@ -13815,7 +13838,8 @@ scan_children:
        do {
            cur = cur->parent;
            depth--;
-           if ((cur == NULL) || (cur == limit))
+           if ((cur == NULL) || (cur == limit) ||
+                (cur->type == XML_DOCUMENT_NODE))
                goto done;
            if (cur->type == XML_ELEMENT_NODE) {
                ret = xmlStreamPop(patstream);
@@ -14086,8 +14110,7 @@ xmlXPathTryStreamCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
            }
        }
 
-       stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH,
-                       &namespaces[0]);
+       stream = xmlPatterncompile(str, dict, XML_PATTERN_XPATH, namespaces);
        if (namespaces != NULL) {
            xmlFree((xmlChar **)namespaces);
        }
@@ -14173,7 +14196,7 @@ xmlXPathOptimizeExpression(xmlXPathParserContextPtr pctxt,
     /* Recurse */
     ctxt = pctxt->context;
     if (ctxt != NULL) {
-        if (ctxt->depth >= ctxt->maxDepth)
+        if (ctxt->depth >= XPATH_MAX_RECURSION_DEPTH)
             return;
         ctxt->depth += 1;
     }
@@ -14206,7 +14229,7 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
         return(comp);
 #endif
 
-    xmlXPathInit();
+    xmlInitParser();
 
     pctxt = xmlXPathNewParserContext(str, ctxt);
     if (pctxt == NULL)
@@ -14295,7 +14318,7 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
 
     if (comp == NULL)
        return(-1);
-    xmlXPathInit();
+    xmlInitParser();
 
 #ifndef LIBXML_THREAD_ENABLED
     reentance++;
@@ -14440,7 +14463,7 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
 
     CHECK_CTXT(ctx)
 
-    xmlXPathInit();
+    xmlInitParser();
 
     ctxt = xmlXPathNewParserContext(str, ctx);
     if (ctxt == NULL)
index c1732a5..3e3c8b8 100644 (file)
@@ -70,7 +70,7 @@
 
 /**
  * xmlXPtrErrMemory:
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -86,7 +86,7 @@ xmlXPtrErrMemory(const char *extra)
 /**
  * xmlXPtrErr:
  * @ctxt:  an XPTR evaluation context
- * @extra:  extra informations
+ * @extra:  extra information
  *
  * Handle a redefinition of attribute error
  */
@@ -1005,7 +1005,7 @@ xmlXPtrEvalXPtrPart(xmlXPathParserContextPtr ctxt, xmlChar *name) {
        /*
         * To evaluate an xpointer scheme element (4.3) we need:
         *   context initialized to the root
-        *   context position initalized to 1
+        *   context position initialized to 1
         *   context size initialized to 1
         */
        ctxt->context->node = (xmlNodePtr)ctxt->context->doc;
@@ -1352,7 +1352,7 @@ xmlXPtrEval(const xmlChar *str, xmlXPathContextPtr ctx) {
     xmlXPathObjectPtr init = NULL;
     int stack = 0;
 
-    xmlXPathInit();
+    xmlInitParser();
 
     if ((ctx == NULL) || (str == NULL))
        return(NULL);
@@ -1536,7 +1536,7 @@ xmlXPtrBuildRangeNodeList(xmlXPathObjectPtr range) {
                case XML_ELEMENT_DECL:
                case XML_ATTRIBUTE_DECL:
                case XML_ENTITY_NODE:
-                   /* Do not copy DTD informations */
+                   /* Do not copy DTD information */
                    break;
                case XML_ENTITY_DECL:
                    TODO /* handle crossing entities -> stack needed */
@@ -2200,7 +2200,6 @@ xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) {
             XP_ERROR(XPATH_MEMORY_ERROR)
        set = tmp;
     }
-    oldset = (xmlLocationSetPtr) set->user;
 
     /*
      * The loop is to compute the covering range for each item and add it
@@ -2210,9 +2209,12 @@ xmlXPtrRangeInsideFunction(xmlXPathParserContextPtr ctxt, int nargs) {
        xmlXPathFreeObject(set);
         XP_ERROR(XPATH_MEMORY_ERROR);
     }
-    for (i = 0;i < oldset->locNr;i++) {
-       xmlXPtrLocationSetAdd(newset,
-               xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
+    oldset = (xmlLocationSetPtr) set->user;
+    if (oldset != NULL) {
+        for (i = 0;i < oldset->locNr;i++) {
+            xmlXPtrLocationSetAdd(newset,
+                    xmlXPtrInsideRange(ctxt, oldset->locTab[i]));
+        }
     }
 
     /*
@@ -2706,10 +2708,10 @@ static void
 xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
     int i, startindex, endindex = 0, fendindex;
     xmlNodePtr start, end = 0, fend;
-    xmlXPathObjectPtr set;
+    xmlXPathObjectPtr set = NULL;
     xmlLocationSetPtr oldset;
-    xmlLocationSetPtr newset;
-    xmlXPathObjectPtr string;
+    xmlLocationSetPtr newset = NULL;
+    xmlXPathObjectPtr string = NULL;
     xmlXPathObjectPtr position = NULL;
     xmlXPathObjectPtr number = NULL;
     int found, pos = 0, num = 0;
@@ -2721,29 +2723,39 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
        XP_ERROR(XPATH_INVALID_ARITY);
 
     if (nargs >= 4) {
-       CHECK_TYPE(XPATH_NUMBER);
+        if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NUMBER)) {
+            xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+            goto error;
+        }
        number = valuePop(ctxt);
        if (number != NULL)
            num = (int) number->floatval;
     }
     if (nargs >= 3) {
-       CHECK_TYPE(XPATH_NUMBER);
+        if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_NUMBER)) {
+            xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+            goto error;
+        }
        position = valuePop(ctxt);
        if (position != NULL)
            pos = (int) position->floatval;
     }
-    CHECK_TYPE(XPATH_STRING);
+    if ((ctxt->value == NULL) || (ctxt->value->type != XPATH_STRING)) {
+        xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+        goto error;
+    }
     string = valuePop(ctxt);
     if ((ctxt->value == NULL) ||
        ((ctxt->value->type != XPATH_LOCATIONSET) &&
-        (ctxt->value->type != XPATH_NODESET)))
-        XP_ERROR(XPATH_INVALID_TYPE)
-
+        (ctxt->value->type != XPATH_NODESET))) {
+        xmlXPathErr(ctxt, XPATH_INVALID_TYPE);
+        goto error;
+    }
     set = valuePop(ctxt);
     newset = xmlXPtrLocationSetCreate(NULL);
     if (newset == NULL) {
-       xmlXPathFreeObject(set);
-        XP_ERROR(XPATH_MEMORY_ERROR);
+        xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
+        goto error;
     }
     if (set->nodesetval == NULL) {
         goto error;
@@ -2756,8 +2768,10 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
         */
        tmp = xmlXPtrNewLocationSetNodeSet(set->nodesetval);
        xmlXPathFreeObject(set);
-       if (tmp == NULL)
-            XP_ERROR(XPATH_MEMORY_ERROR)
+       if (tmp == NULL) {
+            xmlXPathErr(ctxt, XPATH_MEMORY_ERROR);
+            goto error;
+        }
        set = tmp;
     }
     oldset = (xmlLocationSetPtr) set->user;
@@ -2830,7 +2844,8 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
      * Save the new value and cleanup
      */
 error:
-    valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
+    if (newset != NULL)
+        valuePush(ctxt, xmlXPtrWrapLocationSet(newset));
     xmlXPathFreeObject(set);
     xmlXPathFreeObject(string);
     if (position) xmlXPathFreeObject(position);
index 5ef1819..1c97724 100644 (file)
@@ -26,7 +26,7 @@ EXTRA_DIST=xstc.py xstc-to-python.xsl
 all:
 
 #
-# Rule to load the test description and extract the informations
+# Rule to load the test description and extract the information
 #
 $(TESTDIRS) Tests/Metadata/$(NISTTESTDEF_2) Tests/Metadata/$(MSTTESTDEF) Tests/Metadata/$(SUNTESTDEF):
        -@(if [ ! -d Tests ] ; then \
index ca011bb..21c1f41 100755 (executable)
@@ -213,7 +213,7 @@ class XSTCTestCase:
                        tokens = self.groupName.split("-")
                        self.combineName = "%s-%s" % (tokens[0], tokens[1])
                else:
-                       self.combineName = "unkown"
+                       self.combineName = "unknown"
                        raise Exception("Could not compute the combine name of a test.")
                if (not options.silent) and (self.group.descr is not None):
                        self.log.append("'%s'   group-descr: %s\n" % (self.name, self.group.descr))