summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2009-03-01 10:53:23 +0100
committerMike Hommey <glandium@debian.org>2009-03-01 10:53:23 +0100
commitd03a853bb0370d89552eceee59df1746da4a37f8 (patch)
tree441802d52ac5c0a2b6929e6dd5d8a58210b0fe3a
parent88f9c7ca80bfbc9a5429fc632b90d6c4a2a2787d (diff)
downloadlibxml2-upstream/2.7.0.dfsg.tar.gz
Import upstream version 2.7.0upstream/2.7.0.dfsg
-rw-r--r--ChangeLog450
-rw-r--r--HTMLparser.c23
-rw-r--r--Makefile.am62
-rw-r--r--Makefile.in157
-rw-r--r--Makefile.tests10
-rw-r--r--NEWS74
-rw-r--r--README.tests7
-rw-r--r--SAX2.c12
-rw-r--r--aclocal.m438
-rw-r--r--catalog.c4
-rwxr-xr-xconfigure96
-rw-r--r--configure.in16
-rwxr-xr-xdepcomp33
-rw-r--r--dict.c357
-rw-r--r--doc/APIchunk1.html2
-rw-r--r--doc/APIchunk10.html11
-rw-r--r--doc/APIchunk11.html8
-rw-r--r--doc/APIchunk12.html8
-rw-r--r--doc/APIchunk13.html16
-rw-r--r--doc/APIchunk14.html5
-rw-r--r--doc/APIchunk15.html11
-rw-r--r--doc/APIchunk17.html7
-rw-r--r--doc/APIchunk18.html6
-rw-r--r--doc/APIchunk19.html22
-rw-r--r--doc/APIchunk2.html3
-rw-r--r--doc/APIchunk20.html3
-rw-r--r--doc/APIchunk21.html7
-rw-r--r--doc/APIchunk22.html64
-rw-r--r--doc/APIchunk23.html43
-rw-r--r--doc/APIchunk24.html11
-rw-r--r--doc/APIchunk25.html3
-rw-r--r--doc/APIchunk26.html5
-rw-r--r--doc/APIchunk27.html8
-rw-r--r--doc/APIchunk28.html7
-rw-r--r--doc/APIchunk3.html2
-rw-r--r--doc/APIchunk4.html5
-rw-r--r--doc/APIchunk5.html1
-rw-r--r--doc/APIchunk6.html5
-rw-r--r--doc/APIchunk7.html20
-rw-r--r--doc/APIchunk8.html2
-rw-r--r--doc/APIchunk9.html9
-rw-r--r--doc/APIconstructors.html2
-rw-r--r--doc/APIfiles.html20
-rw-r--r--doc/APIfunctions.html5
-rw-r--r--doc/APIsymbols.html20
-rw-r--r--doc/FAQ.html26
-rw-r--r--doc/Makefile.in17
-rwxr-xr-xdoc/apibuild.py44
-rw-r--r--doc/devhelp/Makefile.in4
-rw-r--r--doc/devhelp/libxml2-c14n.html4
-rw-r--r--doc/devhelp/libxml2-entities.html5
-rw-r--r--doc/devhelp/libxml2-globals.html16
-rw-r--r--doc/devhelp/libxml2-parser.html5
-rw-r--r--doc/devhelp/libxml2-parserInternals.html14
-rw-r--r--doc/devhelp/libxml2-relaxng.html8
-rw-r--r--doc/devhelp/libxml2-schematron.html8
-rw-r--r--doc/devhelp/libxml2-tree.html28
-rw-r--r--doc/devhelp/libxml2-uri.html6
-rw-r--r--doc/devhelp/libxml2-valid.html4
-rw-r--r--doc/devhelp/libxml2-xmlerror.html4
-rw-r--r--doc/devhelp/libxml2-xmlmemory.html5
-rw-r--r--doc/devhelp/libxml2-xmlreader.html4
-rw-r--r--doc/devhelp/libxml2-xmlregexp.html4
-rw-r--r--doc/devhelp/libxml2-xmlschemas.html73
-rw-r--r--doc/devhelp/libxml2.devhelp20
-rw-r--r--doc/examples/Makefile.am104
-rw-r--r--doc/examples/Makefile.in121
-rw-r--r--doc/examples/examples.xml464
-rw-r--r--doc/examples/reader3.c5
-rw-r--r--doc/html/libxml-c14n.html2
-rw-r--r--doc/html/libxml-entities.html5
-rw-r--r--doc/html/libxml-globals.html8
-rw-r--r--doc/html/libxml-parser.html3
-rw-r--r--doc/html/libxml-parserInternals.html14
-rw-r--r--doc/html/libxml-relaxng.html4
-rw-r--r--doc/html/libxml-schematron.html4
-rw-r--r--doc/html/libxml-tree.html27
-rw-r--r--doc/html/libxml-uri.html6
-rw-r--r--doc/html/libxml-valid.html4
-rw-r--r--doc/html/libxml-xmlerror.html4
-rw-r--r--doc/html/libxml-xmlmemory.html5
-rw-r--r--doc/html/libxml-xmlreader.html2
-rw-r--r--doc/html/libxml-xmlregexp.html2
-rw-r--r--doc/html/libxml-xmlschemas.html65
-rw-r--r--doc/libxml2-api.xml346
-rw-r--r--doc/libxml2.xsa54
-rw-r--r--doc/news.html26
-rw-r--r--doc/news.xsl2
-rw-r--r--doc/xml.html53
-rw-r--r--elfgcchack.h12
-rw-r--r--encoding.c8
-rw-r--r--entities.c122
-rw-r--r--example/Makefile.in19
-rwxr-xr-xgentest.py5
-rw-r--r--include/Makefile.in17
-rw-r--r--include/libxml/Makefile.in17
-rw-r--r--include/libxml/c14n.h46
-rw-r--r--include/libxml/entities.h40
-rw-r--r--include/libxml/globals.h46
-rw-r--r--include/libxml/parser.h7
-rw-r--r--include/libxml/parserInternals.h2
-rw-r--r--include/libxml/relaxng.h19
-rw-r--r--include/libxml/schematron.h19
-rw-r--r--include/libxml/tree.h29
-rw-r--r--include/libxml/uri.h36
-rw-r--r--include/libxml/xmlerror.h4
-rw-r--r--include/libxml/xmlmemory.h44
-rw-r--r--include/libxml/xmlreader.h188
-rw-r--r--include/libxml/xmlregexp.h42
-rw-r--r--include/libxml/xmlschemas.h48
-rw-r--r--include/libxml/xmlversion.h8
-rw-r--r--include/wsockcompat.h1
-rw-r--r--libxml.spec.in2
-rw-r--r--libxml2.spec8
-rw-r--r--macos/src/XMLTestPrefix.h.orig1
-rw-r--r--nanoftp.c2
-rw-r--r--nanohttp.c4
-rw-r--r--parser.c2677
-rw-r--r--parserInternals.c4
-rw-r--r--pattern.c10
-rw-r--r--python/Makefile.in27
-rwxr-xr-xpython/generator.py760
-rw-r--r--python/libxml.c5
-rw-r--r--python/libxml_wrap.h4
-rwxr-xr-xpython/setup.py2
-rw-r--r--python/tests/Makefile.in4
-rw-r--r--python/types.c2
-rw-r--r--relaxng.c4
-rw-r--r--runsuite.c2
-rw-r--r--runtest.c165
-rw-r--r--runxmlconf.c603
-rw-r--r--testapi.c235
-rw-r--r--testchar.c615
-rw-r--r--testdict.c444
-rw-r--r--testrecurse.c973
-rw-r--r--threads.c8
-rw-r--r--tree.c706
-rw-r--r--uri.c1882
-rw-r--r--valid.c279
-rw-r--r--win32/Makefile.msvc.orig462
-rw-r--r--win32/libxml2.def.src3
-rw-r--r--xinclude.c4
-rw-r--r--xmlIO.c21
-rw-r--r--xmllint.c17
-rw-r--r--xmlmemory.c143
-rw-r--r--xmlreader.c16
-rw-r--r--xmlregexp.c67
-rw-r--r--xmlschemas.c2205
-rw-r--r--xpath.c792
-rw-r--r--xstc/Makefile.in4
150 files changed, 10932 insertions, 6318 deletions
diff --git a/ChangeLog b/ChangeLog
index 4da35e4..1f976e8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,338 @@
+Sat Aug 30 14:50:16 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/tree.h tree.c: make a new kind of buffer where
+ shrinking and adding in head can avoid reallocation or full
+ buffer memmoves
+ * encoding.c xmlIO.c: use the new kind of buffers for output
+ buffers
+
+Sat Aug 30 10:18:13 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * doc/* testapi.c: regenerated
+
+Fri Aug 29 21:53:12 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * doc/examples/reader3.c: patch from Robert Schwebel , allows to
+ compile the example if configured without output support fixes
+ #545582
+ * Makefile.am: add testrecurse to the make check tests
+ * HTMLparser.c: if the parser got a encoding argument it should be
+ used over what the meta specifies, patch fixing #536346
+
+Fri Aug 29 14:41:38 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: a couple more fixes
+ * nanohttp.c nanoftp.c: patch from Andreas Färber to compile on Haiku
+ fixes #527880
+ * doc/examples/*: regenerated
+
+Thu Aug 28 17:31:46 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c include/libxml/parser.h: completely different fix for
+ the recursion detection based on entity density, big cleanups
+ in the entity parsing code too
+ * result/*.sax*: the parser should not ask for used defined versions
+ of the predefined entities
+ * testrecurse.c: automatic test for entity recursion checks
+ * Makefile.am: added testrecurse
+ * test/recurse/lol* test/recurse/good*: a first set of tests for
+ the recursion
+
+Wed Aug 27 21:55:34 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/xmlerror.h parser.c: a bit of cleanup and
+ added checks based on the regression tests of the xmlconf suite
+
+Wed Aug 27 19:22:35 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c: bug in parsing RFC 3986 uris with port numbers
+
+Wed Aug 27 17:30:48 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * configure.in Makefile.am: add an --with-coverage configure option
+ and a 'make cov' target based on gcc profiling and the lcov
+ tool. Currently at 68.9% coverage out of 'make check' and
+ runsuite executions.
+ * xmlreader.c: remove warnings due to C++ comments
+
+Wed Aug 27 15:00:54 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/parserInternals.h parser.c: cleanup entity
+ pushing error handling based on a patch from Ashwin
+
+Wed Aug 27 13:41:26 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * threads.c: fix a small initialization problem raised by Ashwin
+ * testapi.c gentest.py: increase testing especially for document
+ with an internal subset, and entities
+ * tree.c: fix a deallocation issue when unlinking entities from
+ a document.
+ * valid.c: fix a missing entry point test not found previously.
+ * doc/*: regenerated the APIs, docs etc.
+
+Tue Aug 26 15:02:58 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/parser.h parser.c xmllint.c: strengthen some
+ of the internal parser limits, add an XML_PARSE_HUGE option
+ to bypass them all. More internal parser limits will still need
+ to be added.
+
+Tue Aug 26 09:42:08 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * Makefile.am: add the testchar to 'make check'
+ * xmlschemas.c: Volker Grabsch pointed out a typo
+ * xmlregexp.c: production [19] from XML Schemas regexps were a
+ mistake removed in version REC-xmlschema-2-20041028, Volker Grabsch
+ provided a patch to remove it
+ * 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
+
+Tue Aug 26 09:25:39 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/parser.h xinclude.c xmllint.c: patch based on
+ Wieant Nielander contribution to add the option of not doing
+ URI base fixup in XInclude
+
+Mon Aug 25 16:52:53 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * xmlreader.c: applied patch from Aswin to fix tree skipping
+ * include/libxml/entities.h entities.c: fixed a comment and
+ added a new xmlNewEntity() entry point
+ * runtest.c: be less verbose
+ * tree.c: space and tabs cleanups
+
+Mon Aug 25 10:56:30 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/entities.h entities.c SAX2.c parser.c: rework
+ the patch to avoid some ABI issue with people allocating
+ entities structure directly
+
+Wed Aug 20 19:02:01 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/parser.h include/libxml/entities.h entities.c
+ parserInternals.c parser.c: fix for CVE-2008-3281
+
+Sun Aug 10 17:06:13 CEST 2008 Rob Richards <rrichards@ctindustries.net>
+
+ * dict.c: fix non GNUC builds.
+
+Fri Aug 8 14:13:06 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * makefile.am: adding a check-valgrind target
+
+Fri Aug 8 14:01:59 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * Makefile.am testdict.c: add the new test in 'make check' and
+ update it to check subdictionaries processing.
+
+Fri Aug 8 12:07:20 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * testdict.c: added a program to regression test the dictionary code
+ * dict.c: improve the lookup efficiency by caching the key.
+
+Thu Aug 7 18:30:55 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * dict.c: chased and found a couple of nasty issues
+
+Thu Aug 7 15:51:31 CEST 2008 Sven Herzberg <sven@imendio.com>
+
+ Bug 546629 – runtests doesn't pass on my mac
+ Reviewed by William M. Brack.
+
+ * runtest.c: use libpthread on Mac OS X as well
+
+Wed Aug 6 12:24:33 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c: allow [ and ] in fragment identifiers, 3986 disallow them
+ but it's widely used for XPointer, and would break DocBook
+ processing among others
+
+Wed Aug 6 11:32:21 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * dict.c: change the big key algorithm to work properly with QName
+ too, fix a bug with dict size and sub dictionaries
+
+Mon Aug 4 17:27:27 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c include/libxml/uri.h: rewrite the URI parser to update to
+ rfc3986 (from 2396)
+ * test/errors/webdav.xml result/errors/webdav.xml*: removed the
+ error test, 'DAV:' is a correct URI under 3986
+ * Makefile.am: small cleanup in make check
+
+Thu Jul 31 21:49:45 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * runxmlconf.c: more progresses against the official regression tests
+ * runsuite.c: small cleanup for non-leak reports
+ * include/libxml/tree.h: parsing flags and other properties are
+ now added to the document node, this is generally useful and
+ allow to make Name and NmToken validations based on the parser
+ flags, more specifically the 5th edition of XML or not
+ * HTMLparser.c tree.c: small side effects for the previous changes
+ * parser.c SAX2.c valid.c: the bulk of teh changes are here,
+ the parser and validation behaviour can be affected, parsing
+ flags need to be copied, lot of changes. Also fixing various
+ validation problems in the regression tests.
+
+Thu Jul 31 10:15:53 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * runxmlconf.c: added a skipped list, insert rmt-ns10-035
+ * Makefile.am: improve 'make check'
+ * 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.
+ * result/errors/webdav.xml.*: some warnings are no recategorized
+ as Namespace errors
+
+Wed Jul 30 14:55:54 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/xmlmemory.h xmlmemory.c: add xmlMemDisplayLast to
+ help debug incremental memory leaks, and some cleanups
+ * runxmlconf.c: use that new call and avoid ever touching the
+ system catalog in the regression tests
+
+Wed Jul 30 14:33:33 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c include/libxml/xmlerror.h: an XML-1.0 document can't load
+ an 1.1 entity
+ * runxmlconf.c: when using entities make sure we load them
+
+Tue Jul 29 18:43:07 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fix a bug not detecting cross entity comments probably
+ when comment parsing got optimized.
+ * Makefile.am: add make check
+ * runxmlconf.c: fix the log file name
+
+Tue Jul 29 18:09:26 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * runxmlconf.c Makefile.am: add a C program to run the W3C test
+ suite, work in progress
+ * xmllint.c: add a new option --oldxml10 to use the old parser
+ * parser.c: fix the XML_PARSE_OLD10 processing of the new option
+ and a bug in version parsing
+
+Tue Jul 29 11:12:40 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * xpath.c: space and tabs cleanup
+
+Tue Jul 29 10:59:36 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/parser.h include/libxml/xmlerror.h parser.c:
+ implement XML-1.0 5th edition, add parser option XML_PARSE_OLD10
+ to stick to old behaviour
+ * testapi.c gentest.py: modified slightly and regenerated
+ * Makefile.am: add testchar
+
+Thu Jul 24 16:57:20 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * Makefile.am testchar.c Makefile.tests README.tests: add a
+ new regression test program for testing character ranges and
+ UTF8 encoding/decoding
+
+Wed Jul 23 15:32:39 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * libxml.spec.in: fix the build root
+
+Wed Jul 16 22:28:48 PDT 2008 William Brack <wbrack@mmm.com.hk>
+
+ * pattern.c: fix problem with xmlStreamPop when pattern includes
+ a "." element (see discussion on libxslt list)
+
+Mon Jul 7 15:49:59 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * SAX2.c: fix line number on text nodes, problem raised by Ralf Junker
+
+Sun Jun 29 17:04:28 CEST 2008 Rob Richards <rrichards@ctindustries.net>
+ * xmlschemas.c: fix crash with invalid whitespace facet
+
+Wed Jun 11 10:13:02 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * doc/xml.html doc/FAQ.html: add a section in the FAQ about
+ multithread and xmlCleanupParser
+
+Tue Jun 10 16:52:17 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * catalog.c: apply a couple of fixes based on a Coverity report
+ forwarded by Derrick Price.
+ * VxWorks/README VxWorks/Makefile VxWorks/build.sh: instructions
+ Makefile, and shell script to build on VxWorks 6.4+ provided by
+ Jim Wert.
+
+Tue Jun 3 18:07:13 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * python/generator.py python/setup.py: apply patch from Martin fixing
+ python whitespaces
+ * NEWS: following previous commit rebuilt now in UTF-8
+
+Mon Jun 2 17:39:42 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * ChangeLog: patch from Hans de Goede to switch the file to UTF-8
+ * doc/news.xsl: switch to generate the NEWS file in UTF-8 instead of
+ ISO-8859-1
+
+Mon May 12 15:12:44 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * xmlregexp.c: avoid a regexp crash, should fix #523738
+
+Mon May 12 14:56:06 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * xmlschemas.c runtest.c testapi.c include/libxml/xmlreader.h
+ python/types.c python/libxml_wrap.h python/libxml.c: fx compilation
+ when configured without the reader should fix #513110
+ * doc/*: regenerated
+
+Sat May 3 14:33:29 CEST 2008 Rob Richards <rrichards@ctindustries.net>
+
+ * dict.c: check for stdint.h and define types when using MSVC
+
+Mon Apr 28 20:06:12 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * parserInternals.c: applied patch from Ashwin to avoid a potential
+ double-free
+
+Thu Apr 24 13:56:53 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * uri.c: applied patch from Ashwin fixing a number of realloc problems
+ * HTMLparser.c: improve handling for misplaced html/head/body
+
+Tue Apr 22 10:27:17 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * dict.c: improvement on the hashing of the dictionnary, with visible
+ speed up as the number of strings in the hash increases, work from
+ Stefan Behnel
+
+Fri Apr 11 14:44:00 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * include/libxml/xmlschemas.h xmlschemas.c: added new function
+ xmlSchemaValidCtxtGetParserCtxt based on Holger Kaelberer patch
+ * doc/apibuild.py doc/*: regenerated the doc, chased why the new
+ function didn't got any documentation, added more checking in the
+ generator
+ * include/libxml/relaxng.h include/libxml/schematron.h
+ include/libxml/xmlschemas.h include/libxml/c14n.h
+ include/libxml/xmlregexp.h include/libxml/globals.h
+ include/libxml/xmlreader.h threads.c xmlschemas.c: various changes
+ and cleanups following the new reports
+
+
+Thu Apr 10 10:07:00 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * Makefile.am: extend the cleanup rule
+ * xmlschemas.c: space cleanup
+
+Wed Apr 9 19:43:25 CEST 2008 Rob Richards <rrichards@ctindustries.net>
+
+ * include/wsockcompat.h: support older win32 platforms when building
+ with newer versions of VS
+
+Tue Apr 8 16:56:07 CEST 2008 Daniel Veillard <daniel@veillard.com>
+
+ * configure.in NEWS doc/*: preparing release of 2.6.32
+
Tue Apr 8 10:19:01 CEST 2008 Daniel Veillard <daniel@veillard.com>
* tree.c: fix a bug introduced when fixing #438208 and reported by
@@ -481,7 +816,7 @@ Wed Jun 13 13:33:38 PDT 2007 William Brack <wbrack@mmm.com.hk>
Tue Jun 12 18:17:28 CEST 2007 Daniel Veillard <daniel@veillard.com>
* doc/* configure.in NEWS: release of libxml2 2.6.29
- * valid.c: patch from Dagfinn I. Mannsĺker for idness of name
+ * valid.c: patch from Dagfinn I. MannsĂĄker for idness of name
in HTML, c.f. bug #305885.
Tue Jun 12 17:14:08 CEST 2007 Daniel Veillard <daniel@veillard.com>
@@ -571,7 +906,7 @@ Wed May 30 22:05:08 PDT 2007 William Brack <wbrack@mmm.com.hk>
Mon May 28 16:14:50 CEST 2007 Daniel Veillard <daniel@veillard.com>
- * uri.c: fix bug reported by François Delyon
+ * uri.c: fix bug reported by François Delyon
Tue May 22 08:59:48 PDT 2007 William Brack <wbrack@mmm.com.hk>
@@ -602,7 +937,7 @@ Fri May 11 22:45:18 HKT 2007 William Brack <wbrack@mmm.com.hk>
Thu May 10 01:52:42 CEST 2007 Daniel Veillard <daniel@veillard.com>
* list.c: applied patch to fix xmlListAppend() from
- Georges-André SILBER
+ Georges-André SILBER
* valid.c: also fix the place wher it was called.
Wed May 2 18:47:33 CEST 2007 Daniel Veillard <daniel@veillard.com>
@@ -700,7 +1035,7 @@ Wed Mar 21 14:23:08 HKT 2007 William Brack <wbrack@mmm.com.hk>
Tue Mar 20 09:58:13 CET 2007 Daniel Veillard <daniel@veillard.com>
- * nanoftp.c: applied patch from Björn Wiberg to try to fix again
+ * nanoftp.c: applied patch from Björn Wiberg to try to fix again
the silly __ss_familly problem on various AIXes, should fix #420184
Wed Mar 14 20:30:38 HKT 2007 William Brack <wbrack@mmm.com.hk>
@@ -772,7 +1107,7 @@ Wed Jan 31 10:25:38 PST 2007 William Brack <wbrack@mmm.com.hk>
Fri Jan 26 00:05:18 PST 2007 William Brack <wbrack@mmm.com.hk>
- * implemented patch from Stéphane Bidoul for uri.c (bug #389767)
+ * implemented patch from Stéphane Bidoul for uri.c (bug #389767)
Thu Jan 25 11:15:08 PST 2007 William Brack <wbrack@mmm.com.hk>
@@ -2481,7 +2816,7 @@ Fri Sep 9 12:56:19 CEST 2005 Daniel Veillard <daniel@veillard.com>
Thu Sep 8 23:39:41 CEST 2005 Daniel Veillard <daniel@veillard.com>
- * xmllint.c: patch from Stéphane Bidoul to compile without schematron
+ * xmllint.c: patch from Stéphane Bidoul to compile without schematron
Wed Sep 7 00:16:27 CEST 2005 Daniel Veillard <daniel@veillard.com>
@@ -4314,7 +4649,7 @@ Sun Jan 30 19:27:23 CET 2005 Daniel Veillard <daniel@veillard.com>
* pattern.c include/libxml/pattern.h xmllint.c: added a
streaming pattern detector for a subset of XPath, should
help Kasimier for identity constraints
- * python/generator.py: applied Stephane Bidoul patch to find
+ * python/generator.py: applied Stéphane Bidoul patch to find
paths without breaking.
Fri Jan 28 18:53:40 CET 2005 Daniel Veillard <daniel@veillard.com>
@@ -5903,7 +6238,7 @@ Thu Jul 1 14:53:36 CEST 2004 Daniel Veillard <daniel@veillard.com>
* python/libxml.c python/generator.py python/libxml.py
python/libxml2-python-api.xml python/libxml2class.txt:
- applied patch from Stéphane Bidoul to fix some Python bindings
+ applied patch from Stéphane Bidoul to fix some Python bindings
initialization, then had to change the parserCleanup()
to handle memory released there.
* xmlmemory.c: added more debugging comments.
@@ -6294,7 +6629,7 @@ Tue May 11 23:04:47 HKT 2004 William Brack <wbrack@mmm.com.hk>
Tue May 11 09:06:53 CEST 2004 Daniel Veillard <daniel@veillard.com>
* python/tests/tstLastError.py: better portability fix for f(*args),
- use apply(f, args) as Stephane Bidoul suggested
+ use apply(f, args) as Stéphane Bidoul suggested
Mon May 10 15:49:22 HKT 2004 William Brack <wbrack@mmm.com.hk>
@@ -7159,7 +7494,7 @@ Wed Jan 21 10:59:55 CET 2004 Daniel Veillard <daniel@veillard.com>
Thu Jan 15 00:48:46 CET 2004 Daniel Veillard <daniel@veillard.com>
* python/generator.py python/tests/tstLastError.py: applied
- patch from Stephane Bidoul to add enums to the Python bindings.
+ patch from Stéphane Bidoul to add enums to the Python bindings.
Tue Jan 13 21:50:05 CET 2004 Daniel Veillard <daniel@veillard.com>
@@ -7202,7 +7537,7 @@ Tue Jan 6 23:51:46 CET 2004 Daniel Veillard <daniel@veillard.com>
* python/libxml2-python-api.xml python/libxml_wrap.h python/types.c
python/tests/Makefile.am python/tests/tstLastError.py: applied
- patch from Stephane Bidoul for structured error handling from
+ patch from Stéphane Bidoul for structured error handling from
python, and the associated test
Tue Jan 6 23:18:11 HKT 2004 William Brack <wbrack@mmm.com.hk>
@@ -7285,7 +7620,7 @@ Sun Jan 4 08:57:51 HKT 2004 William Brack <wbrack@mmm.com.hk>
Fri Jan 2 21:22:18 CET 2004 Daniel Veillard <daniel@veillard.com>
- * error.c: applied patch from Stéphane Bidoul for structured error
+ * error.c: applied patch from Stéphane Bidoul for structured error
reporting.
Fri Jan 2 21:03:17 CET 2004 Daniel Veillard <daniel@veillard.com>
@@ -7314,7 +7649,7 @@ Wed Dec 31 22:02:37 HKT 2003 William Brack <wbrack@mmm.com.hk>
Wed Dec 31 15:55:55 HKT 2003 William Brack <wbrack@mmm.com.hk>
* python/generator.py, python/libxml2class.txt: fixed problem
- pointed out by Stéphane Bidoul on the list.
+ pointed out by Stéphane Bidoul on the list.
* xinclude.c, xpointer.c, xpath.c, include/libxml/xpointer.h:
completed modifications required to fix Bug 129967 (at last!).
Now wait to see how long before further trouble...
@@ -8204,17 +8539,17 @@ Wed Oct 22 14:33:05 CEST 2003 Daniel Veillard <daniel@veillard.com>
Wed Oct 22 10:50:31 CEST 2003 Daniel Veillard <daniel@veillard.com>
- * chvalid.c genChRanges.py: Stephane Bidoul pointed out another
+ * chvalid.c genChRanges.py: Stéphane Bidoul pointed out another
small glitch missing a const
Wed Oct 22 10:43:21 CEST 2003 Daniel Veillard <daniel@veillard.com>
- * chvalid.c genChRanges.py: Stephane Bidoul pointed out that
+ * chvalid.c genChRanges.py: Stéphane Bidoul pointed out that
it doesn't define IN_LIBXML
Tue Oct 21 21:14:55 CEST 2003 Daniel Veillard <daniel@veillard.com>
- * win32/Makefile.mingw: typo pointed out by Stephane Bidoul
+ * win32/Makefile.mingw: typo pointed out by Stéphane Bidoul
Tue Oct 21 11:26:36 CEST 2003 Daniel Veillard <daniel@veillard.com>
@@ -8574,7 +8909,7 @@ Tue Oct 7 13:30:39 CEST 2003 Daniel Veillard <daniel@veillard.com>
Mon Oct 6 10:46:35 CEST 2003 Daniel Veillard <daniel@veillard.com>
* win32/Makefile.bcb win32/Makefile.mingw win32/Makefile.msvc
- win32/configure.js: applied patch from Stéphane Bidoul to
+ win32/configure.js: applied patch from Stéphane Bidoul to
fix the compilation of 2.6.0 code on Win32
Mon Oct 6 10:16:30 CEST 2003 Daniel Veillard <daniel@veillard.com>
@@ -8820,7 +9155,7 @@ Thu Sep 25 14:16:51 CEST 2003 Daniel Veillard <daniel@veillard.com>
Wed Sep 24 23:42:08 CEST 2003 Daniel Veillard <daniel@veillard.com>
- * win32/configure.js: patch from Stephane Bidoul for configuring
+ * win32/configure.js: patch from Stéphane Bidoul for configuring
the beta2 version #123104
Wed Sep 24 23:17:59 CEST 2003 Daniel Veillard <daniel@veillard.com>
@@ -9117,7 +9452,7 @@ Sat Sep 6 10:55:01 PTD 2003 William Brack <wbrack@mmm.com.hk>
Fri Sep 5 10:33:42 CEST 2003 Daniel Veillard <daniel@veillard.com>
- * include/libxml/globals.h: patch from Stéphane Bidoul to export
+ * include/libxml/globals.h: patch from Stéphane Bidoul to export
globals entry points to the python bindings
Wed Sep 3 15:24:41 CEST 2003 Daniel Veillard <daniel@veillard.com>
@@ -9842,7 +10177,7 @@ Tue May 20 14:21:23 CEST 2003 Daniel Veillard <daniel@veillard.com>
Sat May 17 12:53:11 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com>
- * threads.c: applied the patch from Stéphane Bidoul for getting
+ * threads.c: applied the patch from Stéphane Bidoul for getting
rid of extra threads in a dynamic library.
* win32/configure.js: threads default to 'native' now.
@@ -9854,7 +10189,7 @@ Fri May 16 13:17:52 EDT 2003 Daniel Veillard <daniel@veillard.com>
Thu May 15 18:06:18 EDT 2003 Daniel Veillard <daniel@veillard.com>
* build_glob.py global.data globals.c parser.c
- include/libxml/globals.h: patch from Stéphane Bidoul for setting
+ include/libxml/globals.h: patch from Stéphane Bidoul for setting
up threads global defaults.
* doc/libxml2-api.xml: this extends the API with new functions
* python/tests/Makefile.am python/tests/reader2.py
@@ -9911,7 +10246,7 @@ Sun May 11 16:13:20 EDT 2003 Daniel Veillard <daniel@veillard.com>
Sat May 10 16:01:21 EDT 2003 Daniel Veillard <daniel@veillard.com>
- * relaxng.c: Stéphane Bidoul found an off by one addressing
+ * relaxng.c: Stéphane Bidoul found an off by one addressing
error on the error handling.
Fri May 9 19:08:20 EDT 2003 Daniel Veillard <daniel@veillard.com>
@@ -9970,7 +10305,7 @@ Mon Apr 28 02:19:00 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com>
Mon Apr 28 00:12:11 CEST 2003 Daniel Veillard <daniel@veillard.com>
* win32/configure.js python/setup.py.in: applied patch
- from Stéphane Bidoul for the Python bindings on the new
+ from Stéphane Bidoul for the Python bindings on the new
release.
Sun Apr 27 17:56:21 CEST 2003 Igor Zlatkovic <igor@zlatkovic.com>
@@ -10001,7 +10336,7 @@ Sat Apr 26 14:00:58 CEST 2003 Daniel Veillard <daniel@veillard.com>
* python/generator.py: fixed a problem in the generator where
the way functions are remapped as methods on classes was
not symetric and dependant on python internal hash order,
- as reported by Stéphane Bidoul
+ as reported by Stéphane Bidoul
Fri Apr 25 21:52:33 MDT 2003 John Fleck <jfleck@inkstain.net>
@@ -10806,7 +11141,7 @@ Sun Feb 16 16:40:52 CET 2003 Daniel Veillard <daniel@veillard.com>
* relaxng.c: more bug-hunting
* testRelax.c include/libxml/relaxng.h: added --tree to dump the
intermediate rng tree
- * python/generator.py: patch from Stephane Bidoul to fix the generator
+ * python/generator.py: patch from Stéphane Bidoul to fix the generator
on python < 2.2
Fri Feb 14 17:49:26 CET 2003 Daniel Veillard <daniel@veillard.com>
@@ -10942,7 +11277,7 @@ Wed Feb 5 12:00:36 CET 2003 Daniel Veillard <daniel@veillard.com>
Wed Feb 5 11:43:58 CET 2003 Daniel Veillard <daniel@veillard.com>
* SAX.c: added the redefinition of namespaced attribute
- check that was missing as Fabrice Desré pointed out.
+ check that was missing as Fabrice Desré pointed out.
Wed Feb 5 11:09:29 CET 2003 Daniel Veillard <daniel@veillard.com>
@@ -11165,7 +11500,7 @@ Thu Jan 23 17:41:37 CET 2003 Daniel Veillard <daniel@veillard.com>
Tue Jan 21 13:19:35 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c doc/apibuild.py: applied a new patch from
- Stéphane Bidoul for cleanups
+ Stéphane Bidoul for cleanups
* doc/libxml2-api.xml: rebuilt the API description with
new entry points
@@ -11173,7 +11508,7 @@ Mon Jan 20 23:25:00 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/drv_libxml2.py python/generator.py
python/libxml.c python/libxml.py python/libxml_wrap.h
- python/types.c: patch from Stéphane Bidoul for better per
+ python/types.c: patch from Stéphane Bidoul for better per
context error message APIs
* python/tests/ctxterror.py python/tests/readererr.py:
update of the tests
@@ -11187,7 +11522,7 @@ Fri Jan 17 00:31:30 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c include/libxml/xmlreader.h python/generator.py
python/libxml.c python/libxml.py win32/libxml2.def.src: applied
- a patch from Stéphane Bidoul to allow per XMLtextReader error
+ a patch from Stéphane Bidoul to allow per XMLtextReader error
and warning handling
* python/tests/Makefile.am python/tests/readererr.py: adding the
specific regression test
@@ -11199,7 +11534,7 @@ Tue Jan 14 17:00:08 CET 2003 Daniel Veillard <daniel@veillard.com>
Tue Jan 14 15:39:14 CET 2003 Daniel Veillard <daniel@veillard.com>
- * python/libxml.c: cleanup patch from Stéphane Bidoul
+ * python/libxml.c: cleanup patch from Stéphane Bidoul
Tue Jan 14 14:41:18 CET 2003 Daniel Veillard <daniel@veillard.com>
@@ -11209,7 +11544,7 @@ Tue Jan 14 12:40:29 CET 2003 Daniel Veillard <daniel@veillard.com>
* python/generator.py python/libxml.c python/libxml.py
python/libxml_wrap.h python/types.c: applied and fixed a patch
- from Stéphane Bidoul to provide per parser error handlers at the
+ from Stéphane Bidoul to provide per parser error handlers at the
Python level.
* python/tests/Makefile.am python/tests/ctxterror.py: added a
regression test for it.
@@ -11261,7 +11596,7 @@ Fri Jan 10 00:16:49 CET 2003 Daniel Veillard <daniel@veillard.com>
Thu Jan 9 22:35:31 CET 2003 Daniel Veillard <daniel@veillard.com>
- * python/drv_libxml2.py: update from Stéphane Bidoul: python 2.1
+ * python/drv_libxml2.py: update from Stéphane Bidoul: python 2.1
support and improved error handler registration
Thu Jan 9 14:16:38 CET 2003 Daniel Veillard <daniel@veillard.com>
@@ -11351,7 +11686,7 @@ Sat Jan 4 17:33:17 CET 2003 Daniel Veillard <daniel@veillard.com>
Sat Jan 4 13:46:14 CET 2003 Daniel Veillard <daniel@veillard.com>
- * python/setup.py.in: patch from Stéphane Bidoul to include
+ * python/setup.py.in: patch from Stéphane Bidoul to include
drv_libxml2.py in setup.py
Sat Jan 4 01:43:06 CET 2003 Daniel Veillard <daniel@veillard.com>
@@ -11378,13 +11713,13 @@ Fri Jan 3 02:17:18 CET 2003 Daniel Veillard <daniel@veillard.com>
Thu Jan 2 15:15:26 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader.py: another couple of problem
- related to IsEmptyElement reported by Stéphane Bidoul needed
+ related to IsEmptyElement reported by Stéphane Bidoul needed
some fixes.
Thu Jan 2 13:57:07 CET 2003 Daniel Veillard <daniel@veillard.com>
* libxml.spec.in python/Makefile.am python/drv_libxml2.py:
- integrated drv_libxml2.py Python xml.sax driver from Stéphane Bidoul
+ integrated drv_libxml2.py Python xml.sax driver from Stéphane Bidoul
based on the python XmlTextReader interface.
Wed Jan 1 22:05:40 CET 2003 Daniel Veillard <daniel@veillard.com>
@@ -11407,38 +11742,38 @@ Wed Jan 1 20:12:07 CET 2003 Daniel Veillard <daniel@veillard.com>
Wed Jan 1 16:09:57 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader.py: fixed another couple of
- xmlreader bugs reported by Stéphane Bidoul and added tests.
+ xmlreader bugs reported by Stéphane Bidoul and added tests.
Wed Jan 1 15:42:54 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader2.py: fixed another validity
- checking in external parsed entities raised by Stéphane Bidoul
+ checking in external parsed entities raised by Stéphane Bidoul
and added a specific regression test.
* python/tests/reader3.py: cleanup
Tue Dec 31 15:44:02 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader2.py: fixed a problem with
- validation within entities pointed by Stéphane Bidoul, augmented
+ validation within entities pointed by Stéphane Bidoul, augmented
the tests to catch those.
Tue Dec 31 12:15:37 CET 2002 Daniel Veillard <daniel@veillard.com>
* python/generator.py: modified the generator to allow keeping
class references when creating new classes, needed to fix a bug
- pointed by Stéphane Bidoul where the input buffer of the
+ pointed by Stéphane Bidoul where the input buffer of the
xmlTextReader instance gets destroyed if the python wrapper for
the input is not referenced anymore.
Mon Dec 30 19:39:36 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader.py: fixed another pair of problem
- pointed by Stéphane Bidoul: depth start at 0 and a parse problem.
+ pointed by Stéphane Bidoul: depth start at 0 and a parse problem.
Mon Dec 30 13:36:50 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader.py: fixed another problem
- pointed by Stéphane Bidoul
+ pointed by Stéphane Bidoul
Mon Dec 30 12:39:55 CET 2002 Daniel Veillard <daniel@veillard.com>
@@ -11460,7 +11795,7 @@ Mon Dec 30 00:59:07 CET 2002 Daniel Veillard <daniel@veillard.com>
Sun Dec 29 12:13:18 CET 2002 Daniel Veillard <daniel@veillard.com>
* xmlreader.c python/tests/reader.py: fixed a bug pointed out
- by Stéphane Bidoul and integrated it into the tests
+ by Stéphane Bidoul and integrated it into the tests
Sat Dec 28 23:49:12 CET 2002 Daniel Veillard <daniel@veillard.com>
@@ -11522,7 +11857,7 @@ Mon Dec 23 16:54:22 CET 2002 Daniel Veillard <daniel@veillard.com>
Mon Dec 23 15:42:24 CET 2002 Daniel Veillard <daniel@veillard.com>
- * python/libxml.c python/setup.py.in: patch from Stéphane Bidoul
+ * python/libxml.c python/setup.py.in: patch from Stéphane Bidoul
for Python 2.1
Sun Dec 22 11:24:06 CET 2002 Daniel Veillard <daniel@veillard.com>
@@ -11724,7 +12059,7 @@ Wed Nov 27 12:40:16 CET 2002 Daniel Veillard <daniel@veillard.com>
Wed Nov 27 09:00:00 CET 2002 Daniel Veillard <daniel@veillard.com>
- * python/setup.py.in: another patch from Stéphane Bidoul for
+ * python/setup.py.in: another patch from Stéphane Bidoul for
Python bindings on Windows
* doc/parsedecl.py: small cleanup
@@ -11749,7 +12084,7 @@ Sat Nov 23 17:22:22 CET 2002 Daniel Veillard <daniel@veillard.com>
Sat Nov 23 12:21:24 CET 2002 Daniel Veillard <daniel@veillard.com>
* python/generator.py python/libxml.c python/setup.py.in: trying
- to fix the Python bindings build on Windows (Stéphane Bidoul)
+ to fix the Python bindings build on Windows (Stéphane Bidoul)
Fri Nov 22 22:41:34 CEST 2002 Igor Zlatkovic <igor@stud.fh-frankfurt.de>
@@ -13139,7 +13474,7 @@ Mon Apr 1 10:02:57 CEST 2002 Daniel Veillard <daniel@veillard.com>
Fri Mar 29 23:41:53 CET 2002 Daniel Veillard <daniel@veillard.com>
- * libxml.m4: Frédéric Crozat gave a patch related to the change
+ * libxml.m4: Frédéric Crozat gave a patch related to the change
of Include paths breaking the libxml.m4
Fri Mar 29 18:25:54 CET 2002 Daniel Veillard <daniel@veillard.com>
@@ -15981,7 +16316,7 @@ Fri May 11 19:37:30 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Fri May 11 16:07:13 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * HTMLparser.c: Patch from Jonas Borgström
+ * HTMLparser.c: Patch from Jonas Borgström
(htmlGetEndPriority): New function, returns
the priority of a certain element.
(htmlAutoCloseOnClose): Only close inline elements if they
@@ -16049,7 +16384,7 @@ Thu May 3 12:47:46 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Thu May 3 10:25:19 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * HTMLparser.c: trying to fix the problem reported by Jonas Borgström
+ * HTMLparser.c: trying to fix the problem reported by Jonas Borgström
* results/HTML/ : a few changes in the output of the HTML tests as
a result.
* configure.in: tying to fix -liconv where needed
@@ -16065,7 +16400,7 @@ Wed May 2 18:39:39 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Wed May 2 14:39:57 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * DOCBparser.c: patche from László Kovács, fixed entities refs
+ * DOCBparser.c: patche from László Kovács, fixed entities refs
in attributes handling
Wed May 2 12:56:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -16147,7 +16482,7 @@ Thu Apr 26 16:35:53 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Thu Apr 26 12:57:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * DOCBparser.c: patche from László Kovács
+ * DOCBparser.c: patche from László Kovács
Thu Apr 26 11:31:54 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -16155,7 +16490,7 @@ Thu Apr 26 11:31:54 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Thu Apr 26 11:14:56 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * error.c: Jean François Lecomte provided a complete description
+ * error.c: Jean François Lecomte provided a complete description
and a fix to bug #53537
Thu Apr 26 09:42:58 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -16169,7 +16504,7 @@ Wed Apr 25 21:05:31 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Wed Apr 25 17:52:27 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * DOCBparser.c include/Makefile.am: two patches from László Kovács
+ * DOCBparser.c include/Makefile.am: two patches from László Kovács
Wed Apr 25 14:56:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -16211,7 +16546,7 @@ Tue Apr 24 14:10:38 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Tue Apr 24 13:21:36 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
- * HTMLparser.c: Jonas Borgström patch, the <td>, and <th> elements
+ * HTMLparser.c: Jonas Borgström patch, the <td>, and <th> elements
now means the end of any open <span>,<font>,<a>,<b>,<i>,<u>.
Mon Apr 23 15:40:04 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -17013,7 +17348,7 @@ Wed Jan 3 21:51:13 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
Wed Jan 3 18:56:00 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* HTMLparser.c: htmlCheckParagraph to check htmlOmittedDefaultValue,
- reported by Jonas Borgström
+ reported by Jonas Borgström
* nanohttp.c: Applied Bjorn Reese' IPV6 first patch
Wed Jan 3 16:19:39 CET 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
@@ -18636,7 +18971,7 @@ Sun Jul 11 18:16:34 CEST 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* example/Makefile.am, configure.in: added the makefile for the
gjobread example
-Sat Jul 10 14:19:11 CEST 1999 Tomasz Kłoczko <kloczek@pld.org.pl>
+Sat Jul 10 14:19:11 CEST 1999 Tomasz KĹ‚oczko <kloczek@pld.org.pl>
* doc/Makefile.am:
- fix which allow "make install DESTDIR=</install/prefix>".
@@ -18739,7 +19074,7 @@ Wed Mar 24 21:37:02 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
* parser.c, parserInternals.h: moved the chars macro definitions
to parserInternals.h
- * parser.c, error.c: applied patches from "Knut Ĺkesson"
+ * parser.c, error.c: applied patches from "Knut Ă…kesson"
<ka@s2.chalmers.se> for clean compilation under MSVC 6 :-o
Tue Mar 23 11:10:15 CET 1999 Daniel Veillard <Daniel.Veillard@w3.org>
@@ -19046,3 +19381,6 @@ Fri Jul 24 16:47:14 1998 Daniel Veillard <Daniel.Veillard@w3.org>
* migrated to automake
* prefixed the filenames by xml_ to avoid filename clashes
+#
+# vim: set enc=utf-8
+#
diff --git a/HTMLparser.c b/HTMLparser.c
index 92503a1..57e64df 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -2143,6 +2143,7 @@ htmlNewDocNoDtD(const xmlChar *URI, const xmlChar *ExternalID) {
cur->refs = NULL;
cur->_private = NULL;
cur->charset = XML_CHAR_ENCODING_UTF8;
+ cur->properties = XML_DOC_HTML | XML_DOC_USERBUILT;
if ((ExternalID != NULL) ||
(URI != NULL))
xmlCreateIntSubset(cur, BAD_CAST "html", ExternalID, URI);
@@ -3482,6 +3483,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
"htmlParseStartTag: misplaced <html> tag\n",
name, NULL);
discardtag = 1;
+ ctxt->depth++;
}
if ((ctxt->nameNr != 1) &&
(xmlStrEqual(name, BAD_CAST"head"))) {
@@ -3489,6 +3491,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
"htmlParseStartTag: misplaced <head> tag\n",
name, NULL);
discardtag = 1;
+ ctxt->depth++;
}
if (xmlStrEqual(name, BAD_CAST"body")) {
int indx;
@@ -3498,6 +3501,7 @@ htmlParseStartTag(htmlParserCtxtPtr ctxt) {
"htmlParseStartTag: misplaced <body> tag\n",
name, NULL);
discardtag = 1;
+ ctxt->depth++;
}
}
}
@@ -3648,7 +3652,6 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
name = htmlParseHTMLName(ctxt);
if (name == NULL)
return (0);
-
/*
* We should definitely be at the ending "S? '>'" part
*/
@@ -3669,6 +3672,18 @@ htmlParseEndTag(htmlParserCtxtPtr ctxt)
NEXT;
/*
+ * if we ignored misplaced tags in htmlParseStartTag don't pop them
+ * out now.
+ */
+ if ((ctxt->depth > 0) &&
+ (xmlStrEqual(name, BAD_CAST "html") ||
+ xmlStrEqual(name, BAD_CAST "body") ||
+ xmlStrEqual(name, BAD_CAST "head"))) {
+ ctxt->depth--;
+ return (0);
+ }
+
+ /*
* If the name read is not one of the element in the parsing stack
* then return, it's just an error.
*/
@@ -5958,8 +5973,12 @@ htmlDoRead(htmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
xmlCharEncodingHandlerPtr hdlr;
hdlr = xmlFindCharEncodingHandler(encoding);
- if (hdlr != NULL)
+ if (hdlr != NULL) {
xmlSwitchToEncoding(ctxt, hdlr);
+ if (ctxt->input->encoding != NULL)
+ xmlFree((xmlChar *) ctxt->input->encoding);
+ ctxt->input->encoding = xmlStrdup((xmlChar *)encoding);
+ }
}
if ((URL != NULL) && (ctxt->input != NULL) &&
(ctxt->input->filename == NULL))
diff --git a/Makefile.am b/Makefile.am
index 5061f46..de57c46 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,7 +8,8 @@ INCLUDES = -I$(top_builddir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAG
noinst_PROGRAMS=testSchemas testRelax testSAX testHTML testXPath testURI \
testThreads testC14N testAutomata testRegexp \
- testReader testapi testModule runtest runsuite
+ testReader testapi testModule runtest runsuite testchar \
+ testdict runxmlconf testrecurse
bin_PROGRAMS = xmllint xmlcatalog
@@ -55,6 +56,21 @@ runtest_LDFLAGS =
runtest_DEPENDENCIES = $(DEPS)
runtest_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
+testrecurse_SOURCES=testrecurse.c
+testrecurse_LDFLAGS =
+testrecurse_DEPENDENCIES = $(DEPS)
+testrecurse_LDADD= @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
+
+testchar_SOURCES=testchar.c
+testchar_LDFLAGS =
+testchar_DEPENDENCIES = $(DEPS)
+testchar_LDADD= @RDL_LIBS@ $(LDADDS)
+
+testdict_SOURCES=testdict.c
+testdict_LDFLAGS =
+testdict_DEPENDENCIES = $(DEPS)
+testdict_LDADD= @RDL_LIBS@ $(LDADDS)
+
runsuite_SOURCES=runsuite.c
runsuite_LDFLAGS =
runsuite_DEPENDENCIES = $(DEPS)
@@ -150,12 +166,25 @@ testapi_LDFLAGS =
testapi_DEPENDENCIES = $(DEPS)
testapi_LDADD= $(LDADDS)
+runxmlconf_SOURCES=runxmlconf.c
+runxmlconf_LDFLAGS =
+runxmlconf_DEPENDENCIES = $(DEPS)
+runxmlconf_LDADD= $(LDADDS)
+
#testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
#testOOM_LDFLAGS =
#testOOM_DEPENDENCIES = $(DEPS)
#testOOM_LDADD= $(LDADDS)
-check-local: all tests
+runtests:
+ $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
+
+check: all runtests
+
+check-valgrind: all
+ @echo '## Running the regression tests under Valgrind'
+ @echo '## Go get a cup of coffee it is gonna take a while ...'
+ $(MAKE) CHECKER='valgrind -q' check
testall : tests SVGtests SAXtests
@@ -1105,6 +1134,8 @@ ModuleTests: testModule$(EXEEXT) testdso.la
cleanup:
-@(find . -name .\#\* -exec rm {} \;)
+ -@(find . -name \*.gcda -o *.gcno -exec rm {} \;)
+ -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;)
dist-hook: cleanup libxml2.spec
-cp libxml2.spec $(distdir)
@@ -1139,7 +1170,7 @@ xml2Conf.sh: xml2Conf.sh.in Makefile
< $(srcdir)/xml2Conf.sh.in > xml2Conf.tmp \
&& mv xml2Conf.tmp xml2Conf.sh
-CLEANFILES=xml2Conf.sh
+CLEANFILES=xml2Conf.sh *.gcda *.gcno
confexecdir=$(libdir)
confexec_DATA = xml2Conf.sh
@@ -1191,3 +1222,28 @@ tst: tst.c
sparse: clean
$(MAKE) CC=cgcc
+
+#
+# Coverage support, largely borrowed from libvirt
+# Both binaries comes from the lcov package in Fedora
+#
+LCOV = /usr/bin/lcov
+GENHTML = /usr/bin/genhtml
+
+cov: clean-cov
+ if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \
+ echo not configured with coverage; exit 1 ; fi
+ if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
+ echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
+ -@($(MAKE) check)
+ -@(./runsuite$(EXEEXT))
+ mkdir $(top_builddir)/coverage
+ $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
+ $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
+ rm $(top_builddir)/coverage/libxml2.info.tmp
+ $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
+ echo "Coverage report is in $(top_builddir)/coverage/index.html"
+
+clean-cov:
+ rm -rf $(top_builddir)/coverage
+
diff --git a/Makefile.in b/Makefile.in
index 5fb6611..d986d7b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -40,7 +40,8 @@ noinst_PROGRAMS = testSchemas$(EXEEXT) testRelax$(EXEEXT) \
testURI$(EXEEXT) testThreads$(EXEEXT) testC14N$(EXEEXT) \
testAutomata$(EXEEXT) testRegexp$(EXEEXT) testReader$(EXEEXT) \
testapi$(EXEEXT) testModule$(EXEEXT) runtest$(EXEEXT) \
- runsuite$(EXEEXT)
+ runsuite$(EXEEXT) testchar$(EXEEXT) testdict$(EXEEXT) \
+ runxmlconf$(EXEEXT) testrecurse$(EXEEXT)
bin_PROGRAMS = xmllint$(EXEEXT) xmlcatalog$(EXEEXT)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
@@ -138,6 +139,11 @@ runtest_OBJECTS = $(am_runtest_OBJECTS)
runtest_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(runtest_LDFLAGS) \
$(LDFLAGS) -o $@
+am_runxmlconf_OBJECTS = runxmlconf.$(OBJEXT)
+runxmlconf_OBJECTS = $(am_runxmlconf_OBJECTS)
+runxmlconf_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(runxmlconf_LDFLAGS) $(LDFLAGS) -o $@
am_testAutomata_OBJECTS = testAutomata.$(OBJEXT)
testAutomata_OBJECTS = $(am_testAutomata_OBJECTS)
testAutomata_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -203,6 +209,21 @@ testapi_OBJECTS = $(am_testapi_OBJECTS)
testapi_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testapi_LDFLAGS) \
$(LDFLAGS) -o $@
+am_testchar_OBJECTS = testchar.$(OBJEXT)
+testchar_OBJECTS = $(am_testchar_OBJECTS)
+testchar_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testchar_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am_testdict_OBJECTS = testdict.$(OBJEXT)
+testdict_OBJECTS = $(am_testdict_OBJECTS)
+testdict_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(testdict_LDFLAGS) \
+ $(LDFLAGS) -o $@
+am_testrecurse_OBJECTS = testrecurse.$(OBJEXT)
+testrecurse_OBJECTS = $(am_testrecurse_OBJECTS)
+testrecurse_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(testrecurse_LDFLAGS) $(LDFLAGS) -o $@
am_xmlcatalog_OBJECTS = xmlcatalog.$(OBJEXT)
xmlcatalog_OBJECTS = $(am_xmlcatalog_OBJECTS)
xmlcatalog_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
@@ -228,19 +249,25 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
$(LDFLAGS) -o $@
SOURCES = $(libxml2_la_SOURCES) $(testdso_la_SOURCES) \
- $(runsuite_SOURCES) $(runtest_SOURCES) $(testAutomata_SOURCES) \
- $(testC14N_SOURCES) $(testHTML_SOURCES) $(testModule_SOURCES) \
+ $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \
+ $(testAutomata_SOURCES) $(testC14N_SOURCES) \
+ $(testHTML_SOURCES) $(testModule_SOURCES) \
$(testReader_SOURCES) $(testRegexp_SOURCES) \
$(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \
$(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) \
- $(testapi_SOURCES) $(xmlcatalog_SOURCES) $(xmllint_SOURCES)
+ $(testapi_SOURCES) $(testchar_SOURCES) $(testdict_SOURCES) \
+ $(testrecurse_SOURCES) $(xmlcatalog_SOURCES) \
+ $(xmllint_SOURCES)
DIST_SOURCES = $(am__libxml2_la_SOURCES_DIST) $(testdso_la_SOURCES) \
- $(runsuite_SOURCES) $(runtest_SOURCES) $(testAutomata_SOURCES) \
- $(testC14N_SOURCES) $(testHTML_SOURCES) $(testModule_SOURCES) \
+ $(runsuite_SOURCES) $(runtest_SOURCES) $(runxmlconf_SOURCES) \
+ $(testAutomata_SOURCES) $(testC14N_SOURCES) \
+ $(testHTML_SOURCES) $(testModule_SOURCES) \
$(testReader_SOURCES) $(testRegexp_SOURCES) \
$(testRelax_SOURCES) $(testSAX_SOURCES) $(testSchemas_SOURCES) \
$(testThreads_SOURCES) $(testURI_SOURCES) $(testXPath_SOURCES) \
- $(testapi_SOURCES) $(xmlcatalog_SOURCES) $(xmllint_SOURCES)
+ $(testapi_SOURCES) $(testchar_SOURCES) $(testdict_SOURCES) \
+ $(testrecurse_SOURCES) $(xmlcatalog_SOURCES) \
+ $(xmllint_SOURCES)
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
install-dvi-recursive install-exec-recursive \
@@ -522,6 +549,18 @@ runtest_SOURCES = runtest.c
runtest_LDFLAGS =
runtest_DEPENDENCIES = $(DEPS)
runtest_LDADD = @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
+testrecurse_SOURCES = testrecurse.c
+testrecurse_LDFLAGS =
+testrecurse_DEPENDENCIES = $(DEPS)
+testrecurse_LDADD = @BASE_THREAD_LIBS@ @RDL_LIBS@ $(LDADDS)
+testchar_SOURCES = testchar.c
+testchar_LDFLAGS =
+testchar_DEPENDENCIES = $(DEPS)
+testchar_LDADD = @RDL_LIBS@ $(LDADDS)
+testdict_SOURCES = testdict.c
+testdict_LDFLAGS =
+testdict_DEPENDENCIES = $(DEPS)
+testdict_LDADD = @RDL_LIBS@ $(LDADDS)
runsuite_SOURCES = runsuite.c
runsuite_LDFLAGS =
runsuite_DEPENDENCIES = $(DEPS)
@@ -589,7 +628,11 @@ testapi_SOURCES = testapi.c
testapi_LDFLAGS =
testapi_DEPENDENCIES = $(DEPS)
testapi_LDADD = $(LDADDS)
-CLEANFILES = xml2Conf.sh
+runxmlconf_SOURCES = runxmlconf.c
+runxmlconf_LDFLAGS =
+runxmlconf_DEPENDENCIES = $(DEPS)
+runxmlconf_LDADD = $(LDADDS)
+CLEANFILES = xml2Conf.sh *.gcda *.gcno
confexecdir = $(libdir)
confexec_DATA = xml2Conf.sh
CVS_EXTRA_DIST =
@@ -615,6 +658,13 @@ pkgconfig_DATA = libxml-2.0.pc
BASE_DIR = $(datadir)/doc
DOC_MODULE = libxml2-$(VERSION)
EXAMPLES_DIR = $(BASE_DIR)/$(DOC_MODULE)/examples
+
+#
+# Coverage support, largely borrowed from libvirt
+# Both binaries comes from the lcov package in Fedora
+#
+LCOV = /usr/bin/lcov
+GENHTML = /usr/bin/genhtml
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -684,8 +734,8 @@ install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
- $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
else :; fi; \
done
@@ -693,8 +743,8 @@ uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
done
clean-libLTLIBRARIES:
@@ -727,8 +777,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -759,6 +809,9 @@ runsuite$(EXEEXT): $(runsuite_OBJECTS) $(runsuite_DEPENDENCIES)
runtest$(EXEEXT): $(runtest_OBJECTS) $(runtest_DEPENDENCIES)
@rm -f runtest$(EXEEXT)
$(runtest_LINK) $(runtest_OBJECTS) $(runtest_LDADD) $(LIBS)
+runxmlconf$(EXEEXT): $(runxmlconf_OBJECTS) $(runxmlconf_DEPENDENCIES)
+ @rm -f runxmlconf$(EXEEXT)
+ $(runxmlconf_LINK) $(runxmlconf_OBJECTS) $(runxmlconf_LDADD) $(LIBS)
testAutomata$(EXEEXT): $(testAutomata_OBJECTS) $(testAutomata_DEPENDENCIES)
@rm -f testAutomata$(EXEEXT)
$(testAutomata_LINK) $(testAutomata_OBJECTS) $(testAutomata_LDADD) $(LIBS)
@@ -798,6 +851,15 @@ testXPath$(EXEEXT): $(testXPath_OBJECTS) $(testXPath_DEPENDENCIES)
testapi$(EXEEXT): $(testapi_OBJECTS) $(testapi_DEPENDENCIES)
@rm -f testapi$(EXEEXT)
$(testapi_LINK) $(testapi_OBJECTS) $(testapi_LDADD) $(LIBS)
+testchar$(EXEEXT): $(testchar_OBJECTS) $(testchar_DEPENDENCIES)
+ @rm -f testchar$(EXEEXT)
+ $(testchar_LINK) $(testchar_OBJECTS) $(testchar_LDADD) $(LIBS)
+testdict$(EXEEXT): $(testdict_OBJECTS) $(testdict_DEPENDENCIES)
+ @rm -f testdict$(EXEEXT)
+ $(testdict_LINK) $(testdict_OBJECTS) $(testdict_LDADD) $(LIBS)
+testrecurse$(EXEEXT): $(testrecurse_OBJECTS) $(testrecurse_DEPENDENCIES)
+ @rm -f testrecurse$(EXEEXT)
+ $(testrecurse_LINK) $(testrecurse_OBJECTS) $(testrecurse_LDADD) $(LIBS)
xmlcatalog$(EXEEXT): $(xmlcatalog_OBJECTS) $(xmlcatalog_DEPENDENCIES)
@rm -f xmlcatalog$(EXEEXT)
$(xmlcatalog_LINK) $(xmlcatalog_OBJECTS) $(xmlcatalog_LDADD) $(LIBS)
@@ -855,6 +917,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/relaxng.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runsuite.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runtest.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/runxmlconf.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schematron.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testAutomata.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testC14N.Po@am__quote@
@@ -869,7 +932,10 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testURI.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testXPath.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testapi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testchar.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdict.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testdso.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testrecurse.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tree.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trio.Plo@am__quote@
@@ -1140,8 +1206,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -1166,8 +1232,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -1177,13 +1243,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -1257,6 +1322,10 @@ dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
+dist-lzma: distdir
+ tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+ $(am__remove_distdir)
+
dist-tarZ: distdir
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
@@ -1283,6 +1352,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.lzma*) \
+ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
@@ -1342,7 +1413,6 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-local
check: check-recursive
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) $(DATA) \
config.h
@@ -1452,11 +1522,11 @@ uninstall-man: uninstall-man1 uninstall-man3
install-strip
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
- all all-am am--refresh check check-am check-local clean \
- clean-binPROGRAMS clean-generic clean-libLTLIBRARIES \
- clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
- ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
- dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
+ all all-am am--refresh check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags \
+ ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-hook \
+ dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-compile distclean-generic distclean-hdr \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
@@ -1494,7 +1564,15 @@ testapi.c:
#testOOM_DEPENDENCIES = $(DEPS)
#testOOM_LDADD= $(LDADDS)
-check-local: all tests
+runtests:
+ $(CHECKER) ./runtest$(EXEEXT) && $(CHECKER) ./testrecurse$(EXEEXT) &&$(CHECKER) ./testapi$(EXEEXT) && $(CHECKER) ./testchar$(EXEEXT)&& $(CHECKER) ./testdict$(EXEEXT) && $(CHECKER) ./runxmlconf$(EXEEXT)
+
+check: all runtests
+
+check-valgrind: all
+ @echo '## Running the regression tests under Valgrind'
+ @echo '## Go get a cup of coffee it is gonna take a while ...'
+ $(MAKE) CHECKER='valgrind -q' check
testall : tests SVGtests SAXtests
@@ -2444,6 +2522,8 @@ ModuleTests: testModule$(EXEEXT) testdso.la
cleanup:
-@(find . -name .\#\* -exec rm {} \;)
+ -@(find . -name \*.gcda -o *.gcno -exec rm {} \;)
+ -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm {} \;)
dist-hook: cleanup libxml2.spec
-cp libxml2.spec $(distdir)
@@ -2495,6 +2575,23 @@ tst: tst.c
sparse: clean
$(MAKE) CC=cgcc
+
+cov: clean-cov
+ if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \
+ echo not configured with coverage; exit 1 ; fi
+ if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
+ echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
+ -@($(MAKE) check)
+ -@(./runsuite$(EXEEXT))
+ mkdir $(top_builddir)/coverage
+ $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
+ $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
+ rm $(top_builddir)/coverage/libxml2.info.tmp
+ $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
+ echo "Coverage report is in $(top_builddir)/coverage/index.html"
+
+clean-cov:
+ rm -rf $(top_builddir)/coverage
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/Makefile.tests b/Makefile.tests
index bd223ca..619cbfb 100644
--- a/Makefile.tests
+++ b/Makefile.tests
@@ -8,12 +8,12 @@ LIBS=`xml2-config --libs`
THREADLIB= -lpthread
EXEEXT=
-all: runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT)
+all: runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT) testchar$(EXEEXT)
clean:
$(RM) runtest$(EXEEXT) runsuite$(EXEEXT) testapi$(EXEEXT)
-check: do_runtest do_runsuite do_testapi
+check: do_runtest do_testchar do_testapi do_runsuite
runtest$(EXEEXT): runtest.c
$(CC) -o runtest$(EXEEXT) $(CFLAGS) runtest.c $(LIBS) $(THREADLIB)
@@ -33,3 +33,9 @@ testapi$(EXEEXT): testapi.c
do_testapi: testapi$(EXEEXT)
./testapi
+testchar$(EXEEXT): testchar.c
+ $(CC) -o testchar$(EXEEXT) $(CFLAGS) testchar.c $(LIBS)
+
+do_testchar: testchar$(EXEEXT)
+ ./testchar
+
diff --git a/NEWS b/NEWS
index bd96196..2d6a794 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,42 @@ ChangeLog.html
to the SVN at
http://svn.gnome.org/viewcvs/libxml2/trunk/
code base.Here is the list of public releases:
+2.6.32: Apr 8 2008:
+ - Documentation: returning heap memory to kernel (Wolfram Sang),
+ trying to clarify xmlCleanupParser() use, xmlXPathContext improvement
+ (Jack Jansen), improve the *Recover* functions documentation,
+ XmlNodeType doc link fix (Martijn Arts)
+ - Bug fixes: internal subset memory leak (Ashwin), avoid problem with
+ paths starting with // (Petr Sumbera), streaming XSD validation callback
+ patches (Ashwin), fix redirection on port other than 80 (William Brack),
+ SAX2 leak (Ashwin), XInclude fragment of own document (Chris Ryan),
+ regexp bug with '.' (Andrew Tosh), flush the writer at the end of the
+ document (Alfred Mickautsch), output I/O bug fix (William Brack),
+ writer CDATA output after a text node (Alex Khesin), UTF-16 encoding
+ detection (William Brack), fix handling of empty CDATA nodes for Safari
+ team, python binding problem with namespace nodes, improve HTML parsing
+ (Arnold Hendriks), regexp automata build bug, memory leak fix (Vasily
+ Chekalkin), XSD test crash, weird system parameter entity parsing problem,
+ allow save to file:///X:/ windows paths, various attribute normalisation
+ problems, externalSubsetSplit fix (Ashwin), attribute redefinition in
+ the DTD (Ashwin), fix in char ref parsing check (Alex Khesin), many
+ out of memory handling fixes (Ashwin), XPath out of memory handling fixes
+ (Alvaro Herrera), various realloc problems (Ashwin), UCS4 encoding
+ conversion buffer size (Christian Fruth), problems with EatName
+ functions on memory errors, BOM handling in external parsed entities
+ (Mark Rowe)
+ - Code cleanup: fix build under VS 2008 (David Wimsey), remove useless
+ mutex in xmlDict (Florent Guilian), Mingw32 compilation fix (Carlo
+ Bramini), Win and MacOS EOL cleanups (Florent Guiliani), iconv need
+ a const detection (Roumen Petrov), simplify xmlSetProp (Julien Charbon),
+ cross compilation fixes for Mingw (Roumen Petrov), SCO Openserver build
+ fix (Florent Guiliani), iconv uses const on Win32 (Rob Richards),
+ duplicate code removal (Ashwin), missing malloc test and error reports
+ (Ashwin), VMS makefile fix (Tycho Hilhorst)
+ - improvements: better plug of schematron in the normal error handling
+ (Tobias Minich)
+
+
2.6.31: Jan 11 2008:
- Security fix: missing of checks in UTF-8 parsing
- Bug fixes: regexp bug, dump attribute from XHTML document, fix
@@ -59,9 +95,9 @@ http://svn.gnome.org/viewcvs/libxml2/trunk/
flag fix (Richard Jones), regexp interpretation of \,
htmlCreateDocParserCtxt (Jean-Daniel Dupas), configure.in
typo (Bjorn Reese), entity content failure, xmlListAppend() fix
- (Georges-André Silber), XPath number serialization (William Brack),
+ (Georges-André Silber), XPath number serialization (William Brack),
nanohttp gzipped stream fix (William Brack and Alex Cornejo),
- xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
+ xmlCharEncFirstLine typo (Mark Rowe), uri bug (François Delyon),
XPath string value of PI nodes (William Brack), XPath node set
sorting bugs (William Brack), avoid outputting namespace decl
dups in the writer (Rob Richards), xmlCtxtReset bug, UTF-8 encoding
@@ -69,7 +105,7 @@ http://svn.gnome.org/viewcvs/libxml2/trunk/
workaround wrong file: URIs, htmlNodeDumpFormatOutput on attributes,
invalid character in attribute detection bug, big comments before
internal subset streaming bug, HTML parsing of attributes with : in
- the name, IDness of name in HTML (Dagfinn I. Mannsĺker)
+ the name, IDness of name in HTML (Dagfinn I. MannsĂĄker)
- Improvement: keep URI query parts in raw form (Richard Jones),
embed tag support in HTML (Michael Day)
@@ -84,7 +120,7 @@ http://svn.gnome.org/viewcvs/libxml2/trunk/
(Steven Rainwater), user data propagation in XInclude (Michael Day),
standalone and XML decl detection (Michael Day), Python id ouptut
for some id, fix the big python string memory leak, URI parsing fixes
- (Stéphane Bidoul and William), long comments parsing bug (William),
+ (Stéphane Bidoul and William), long comments parsing bug (William),
concurrent threads initialization (Ted Phelps), invalid char
in text XInclude (William), XPath memory leak (William), tab in
python problems (Andreas Hanke), XPath node comparison error
@@ -94,7 +130,7 @@ http://svn.gnome.org/viewcvs/libxml2/trunk/
min occurs of 0 (William), HTML script/style parsing (Mike Day)
- Improvement: make xmlTextReaderSetup() public
- Compilation and postability: fix a missing include problem (William),
- __ss_familly on AIX again (Björn Wiberg), compilation without zlib
+ __ss_familly on AIX again (Björn Wiberg), compilation without zlib
(Michael Day), catalog patch for Win32 (Christian Ehrlicher),
Windows CE fixes (Andreas Stricke)
- Various CVS to SVN infrastructure changes
@@ -241,7 +277,7 @@ Do not use or package 2.6.25
2.6.22: Sep 12 2005:
- - build fixes: compile without schematron (Stéphane Bidoul)
+ - build fixes: compile without schematron (Stéphane Bidoul)
- bug fixes: xmlDebugDumpNode on namespace node (Oleg Paraschenko)i,
CDATA push parser bug, xmlElemDump problem with XHTML1 doc,
XML_FEATURE_xxx clash with expat headers renamed XML_WITH_xxx, fix some
@@ -514,7 +550,7 @@ Do not use or package 2.6.25
streaming problem (Steve Ball), DTD serialization problem (William),
libxml.m4 fixes (Mike Hommey), do not provide destructors as methods on
Python classes, xmlReader buffer bug, Python bindings memory interfaces
- improvement (with Stéphane Bidoul), Fixed the push parser to be back to
+ improvement (with Stéphane Bidoul), Fixed the push parser to be back to
synchronous behaviour.
- improvement: custom per-thread I/O enhancement (Rob Richards), register
namespace in debug shell (Stefano Debenedetti), Python based regression
@@ -640,8 +676,8 @@ Do not use or package 2.6.25
callbacks order for XPath callbacks (Frederic Peters)
- Documentation: python scripts (William Brack), xslt stylesheets (John
Fleck), doc (Sven Zimmerman), I/O example.
- - Python bindings: fixes (William), enum support (Stéphane Bidoul),
- structured error reporting (Stéphane Bidoul)
+ - Python bindings: fixes (William), enum support (Stéphane Bidoul),
+ structured error reporting (Stéphane Bidoul)
- XInclude: various fixes for conformance, problem related to dictionnary
references (William & me), recursion (William)
- xmlWriter: indentation (Lucas Brasilino), memory leaks (Alfred
@@ -771,7 +807,7 @@ Do not use or package 2.6.25
and charset information if available.
- Relax-NG: bug fixes including the one reported by Martijn Faassen and
zeroOrMore, better error reporting.
- - Python bindings (Stéphane Bidoul), never use stdout for errors
+ - Python bindings (Stéphane Bidoul), never use stdout for errors
output
- Portability: all the headers have macros for export and calling
convention definitions (Igor Zlatkovic), VMS update (Craig A. Berry),
@@ -852,11 +888,11 @@ A bugfixes only release - Windows Makefiles (William Brack)
- portability: DJGPP (MsDos) , OpenVMS (Craig A. Berry)
- William Brack fixed multithreading lock problems
- IPv6 patch for FTP and HTTP accesses (Archana Shah/Wipro)
- - Windows fixes (Igor Zlatkovic, Eric Zurcher), threading (Stéphane
+ - Windows fixes (Igor Zlatkovic, Eric Zurcher), threading (Stéphane
Bidoul)
- A few W3C Schemas Structure improvements
- W3C Schemas Datatype improvements (Charlie Bozeman)
- - Python bindings for thread globals (Stéphane Bidoul), and method/class
+ - Python bindings for thread globals (Stéphane Bidoul), and method/class
generator
- added --nonet option to xmllint
- documentation improvements (John Fleck)
@@ -932,7 +968,7 @@ A bugfixes only release - Windows Makefiles (William Brack)
- First implementation of RelaxNG, added --relaxng flag to xmllint
- Schemas support now compiled in by default.
- Bug fixes: DTD validation, namespace checking, XInclude and entities,
- delegateURI in XML Catalogs, HTML parser, XML reader (Stéphane Bidoul),
+ delegateURI in XML Catalogs, HTML parser, XML reader (Stéphane Bidoul),
XPath parser and evaluation, UTF8ToUTF8 serialization, XML reader memory
consumption, HTML parser, HTML serialization in the presence of
namespaces
@@ -941,7 +977,7 @@ A bugfixes only release - Windows Makefiles (William Brack)
patches (Stefan Kost)
- Portability fixes: NetBSD (Julio Merino), Windows (Igor Zlatkovic)
- Added python bindings for XPointer, contextual error reporting
- (Stéphane Bidoul)
+ (Stéphane Bidoul)
- URI/file escaping problems (Stefano Zacchiroli)
@@ -953,11 +989,11 @@ A bugfixes only release - Windows Makefiles (William Brack)
2.5.0: Jan 6 2003:
- New XmltextReader interface based on C#
- API (with help of Stéphane Bidoul)
+ API (with help of Stéphane Bidoul)
- Windows: more exports, including the new API (Igor)
- XInclude fallback fix
- - Python: bindings for the new API, packaging (Stéphane Bidoul),
- drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), fixes, speedup
+ - Python: bindings for the new API, packaging (Stéphane Bidoul),
+ drv_libxml2.py Python xml.sax driver (Stéphane Bidoul), fixes, speedup
and iterators for Python-2.2 (Hannu Krosing)
- Tutorial fixes (john Fleck and Niraj Tolia) xmllint man update
(John)
@@ -977,7 +1013,7 @@ A bugfixes only release - Windows Makefiles (William Brack)
2.4.29: Dec 11 2002:
- Windows fixes (Igor): Windows CE port, pthread linking, python bindings
- (Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates
+ (Stéphane Bidoul), Mingw (Magnus Henoch), and export list updates
- Fix for prev in python bindings (ERDI Gergo)
- Fix for entities handling (Marcus Clarke)
- Refactored the XML and HTML dumps to a single code path, fixed XHTML1
@@ -1324,7 +1360,7 @@ it's actually not compiled in by default. The real fixes are: - a couple of bu
2.3.9: May 19 2001:
-Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #54891 and another patch from Jonas Borgström
+Lots of bugfixes, and added a basic SGML catalog support: - HTML push bugfix #54891 and another patch from Jonas Borgström
- some serious speed optimization again
- some documentation cleanups
- trying to get better linking on Solaris (-R)
diff --git a/README.tests b/README.tests
index eb7223d..66522ab 100644
--- a/README.tests
+++ b/README.tests
@@ -10,13 +10,14 @@ program has a different testing purpose:
runtest.c : runs libxml2 basic internal regression tests
runsuite.c: runs libxml2 against external regression tests
testapi.c : exercises the library public entry points
+ testchar.c: exercise the check of character ranges and UTF-8 validation
The command:
- make -f Makefile.tests
+ make -f Makefile.tests check
should be sufficient on an Unix system to build and exercise the tests
-for the version of the library installed on the system. Note however
+for the version of the library installed on the system. Note however
that there isn't backward compatibility provided so if the installed
version is older to the testsuite one, failing to compile or run the tests
is likely. In any event this won't work with an installed libxml2 older
@@ -26,4 +27,4 @@ like any other program using libxml2, running the test should be done
simply by launching the resulting executables.
Daniel Veillard
-Sun Jul 10 2005
+Thu Jul 24 2008
diff --git a/SAX2.c b/SAX2.c
index 7dbc2b2..80cd1bd 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -580,7 +580,8 @@ xmlSAX2GetEntity(void *ctx, const xmlChar *name)
return(NULL);
}
ret->owner = 1;
- ret->checked = 1;
+ if (ret->checked == 0)
+ ret->checked = 1;
}
return(ret);
}
@@ -957,6 +958,8 @@ xmlSAX2StartDocument(void *ctx)
#ifdef LIBXML_HTML_ENABLED
if (ctxt->myDoc == NULL)
ctxt->myDoc = htmlNewDocNoDtD(NULL, NULL);
+ ctxt->myDoc->properties = XML_DOC_HTML;
+ ctxt->myDoc->parseFlags = ctxt->options;
if (ctxt->myDoc == NULL) {
xmlSAX2ErrMemory(ctxt, "xmlSAX2StartDocument");
return;
@@ -972,6 +975,10 @@ xmlSAX2StartDocument(void *ctx)
} else {
doc = ctxt->myDoc = xmlNewDoc(ctxt->version);
if (doc != NULL) {
+ doc->properties = 0;
+ if (ctxt->options & XML_PARSE_OLD10)
+ doc->properties |= XML_DOC_OLD10;
+ doc->parseFlags = ctxt->options;
if (ctxt->encoding != NULL)
doc->encoding = xmlStrdup(ctxt->encoding);
else
@@ -1837,6 +1844,9 @@ skip:
} else
ret->content = (xmlChar *) intern;
+ if (ctxt->input != NULL)
+ ret->line = ctxt->input->line;
+
if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
xmlRegisterNodeDefaultValue(ret);
return(ret);
diff --git a/aclocal.m4 b/aclocal.m4
index 6da47d8..190c670 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.10 -*- Autoconf -*-
+# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,10 +11,13 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-m4_if(m4_PACKAGE_VERSION, [2.61],,
-[m4_fatal([this file was generated for autoconf 2.61.
-You have another version of autoconf. If you want to use that,
-you should regenerate the build system entirely.], [63])])
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(AC_AUTOCONF_VERSION, [2.61],,
+[m4_warning([this file was generated for autoconf 2.61.
+You have another version of autoconf. It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
@@ -6584,7 +6587,7 @@ AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])
-# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -6599,7 +6602,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.10'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.10], [],
+m4_if([$1], [1.10.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -6615,8 +6618,10 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.10])dnl
-_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
+[AM_AUTOMAKE_VERSION([1.10.1])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+ [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
@@ -6888,7 +6893,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
@@ -6948,13 +6953,13 @@ AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006 Free Software Foundation, Inc.
+# 2005, 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 12
+# serial 13
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
@@ -7059,16 +7064,17 @@ AC_PROVIDE_IFELSE([AC_PROG_OBJC],
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
+_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $1 | $1:* )
+ $_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
@@ -7366,7 +7372,7 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
-# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
diff --git a/catalog.c b/catalog.c
index ee3f8f2..af84b7c 100644
--- a/catalog.c
+++ b/catalog.c
@@ -2616,6 +2616,8 @@ xmlCatalogSGMLResolve(xmlCatalogPtr catal, const xmlChar *pubID,
return(ret);
if (sysID != NULL)
ret = xmlCatalogGetSGMLSystem(catal->sgml, sysID);
+ if (ret != NULL)
+ return(ret);
return(NULL);
}
@@ -2912,7 +2914,7 @@ xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) {
sgml = xmlCatalogSGMLResolve(catal, NULL, URI);
if (sgml != NULL)
- sgml = xmlStrdup(sgml);
+ ret = xmlStrdup(sgml);
}
return(ret);
}
diff --git a/configure b/configure
index e80c4a9..5360aa8 100755
--- a/configure
+++ b/configure
@@ -1633,6 +1633,7 @@ Optional Packages:
--with-xptr add the XPointer support (on)
--with-modules add the dynamic modules support (on)
--with-zlib[=DIR] use libz in DIR
+ --with-coverage build for code coverage with GCC (off)
Some influential environment variables:
CC C compiler command
@@ -2189,8 +2190,8 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
LIBXML_MAJOR_VERSION=2
-LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=32
+LIBXML_MINOR_VERSION=7
+LIBXML_MICRO_VERSION=0
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
@@ -5507,7 +5508,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5510 "configure"' > conftest.$ac_ext
+ echo '#line 5511 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -8061,11 +8062,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8064: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8065: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8068: \$? = $ac_status" >&5
+ echo "$as_me:8069: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8351,11 +8352,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8354: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8355: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:8358: \$? = $ac_status" >&5
+ echo "$as_me:8359: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -8455,11 +8456,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:8458: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8459: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8462: \$? = $ac_status" >&5
+ echo "$as_me:8463: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10806,7 +10807,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10809 "configure"
+#line 10810 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10906,7 +10907,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10909 "configure"
+#line 10910 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -13326,11 +13327,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13329: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13330: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13333: \$? = $ac_status" >&5
+ echo "$as_me:13334: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -13430,11 +13431,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13433: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13434: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13437: \$? = $ac_status" >&5
+ echo "$as_me:13438: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14994,11 +14995,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14997: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:14998: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15001: \$? = $ac_status" >&5
+ echo "$as_me:15002: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -15098,11 +15099,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15101: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15102: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:15105: \$? = $ac_status" >&5
+ echo "$as_me:15106: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17287,11 +17288,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17290: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17291: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17294: \$? = $ac_status" >&5
+ echo "$as_me:17295: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17577,11 +17578,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17580: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17581: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17584: \$? = $ac_status" >&5
+ echo "$as_me:17585: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17681,11 +17682,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17684: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17685: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17688: \$? = $ac_status" >&5
+ echo "$as_me:17689: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20581,6 +20582,12 @@ if test "${with_zlib+set}" = set; then
fi
+# Check whether --with-coverage was given.
+if test "${with_coverage+set}" = set; then
+ withval=$with_coverage;
+fi
+
+
if test "$with_schemas" = "yes"
then
with_pattern=yes
@@ -26375,7 +26382,7 @@ fi
{ echo "$as_me:$LINENO: checking for type of socket length (socklen_t)" >&5
echo $ECHO_N "checking for type of socket length (socklen_t)... $ECHO_C" >&6; }
cat > conftest.$ac_ext <<EOF
-#line 26378 "configure"
+#line 26385 "configure"
#include "confdefs.h"
#include <stddef.h>
@@ -26386,7 +26393,7 @@ int main(void) {
(void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)
; return 0; }
EOF
-if { (eval echo configure:26389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:26396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
rm -rf conftest*
{ echo "$as_me:$LINENO: result: socklen_t *" >&5
@@ -26398,7 +26405,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 26401 "configure"
+#line 26408 "configure"
#include "confdefs.h"
#include <stddef.h>
@@ -26409,7 +26416,7 @@ int main(void) {
(void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)
; return 0; }
EOF
-if { (eval echo configure:26412: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:26419: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
rm -rf conftest*
{ echo "$as_me:$LINENO: result: size_t *" >&5
@@ -26421,7 +26428,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 26424 "configure"
+#line 26431 "configure"
#include "confdefs.h"
#include <stddef.h>
@@ -26432,7 +26439,7 @@ int main(void) {
(void)getsockopt (1, 1, 1, NULL, (int *)NULL)
; return 0; }
EOF
-if { (eval echo configure:26435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
+if { (eval echo configure:26442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; _out=`eval $ac_compile 2>&1` && test "x$_out" = x; }; then
rm -rf conftest*
{ echo "$as_me:$LINENO: result: int *" >&5
@@ -29259,6 +29266,16 @@ esac
+if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
+then
+ echo Enabling code coverage for GCC
+ CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+ LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
+else
+ echo Disabling code coverage for GCC
+fi
+
+
@@ -30670,21 +30687,22 @@ echo "$as_me: $ac_file is unchanged" >&6;}
fi
rm -f "$tmp/out12"
# Compute $ac_file's index in $config_headers.
+_am_arg=$ac_file
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
- $ac_file | $ac_file:* )
+ $_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
-$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X$ac_file : 'X\(//\)[^/]' \| \
- X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
-echo X$ac_file |
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$_am_arg" : 'X\(//\)[^/]' \| \
+ X"$_am_arg" : 'X\(//\)$' \| \
+ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$_am_arg" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
@@ -30721,7 +30739,7 @@ echo "$as_me: executing $ac_file commands" >&6;}
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
diff --git a/configure.in b/configure.in
index 8fc76e5..65824f3 100644
--- a/configure.in
+++ b/configure.in
@@ -4,8 +4,8 @@ AM_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
LIBXML_MAJOR_VERSION=2
-LIBXML_MINOR_VERSION=6
-LIBXML_MICRO_VERSION=32
+LIBXML_MINOR_VERSION=7
+LIBXML_MICRO_VERSION=0
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
@@ -163,6 +163,8 @@ AC_ARG_WITH(zlib,
LDFLAGS="${LDFLAGS} -L$withval/lib"
fi
])
+AC_ARG_WITH(coverage,
+[ --with-coverage build for code coverage with GCC (off)])
dnl
dnl hard dependancies on options
@@ -1371,8 +1373,18 @@ AC_SUBST(WIN32_EXTRA_LDFLAGS)
AC_SUBST(CYGWIN_EXTRA_LDFLAGS)
AC_SUBST(CYGWIN_EXTRA_PYTHON_LIBADD)
+if test "$with_coverage" = "yes" -a "${GCC}" = "yes"
+then
+ echo Enabling code coverage for GCC
+ CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"
+ LDFLAGS="$LDFLAGS -fprofile-arcs -ftest-coverage"
+else
+ echo Disabling code coverage for GCC
+fi
+
AC_SUBST(CPPFLAGS)
AC_SUBST(CFLAGS)
+AC_SUBST(LDFLAGS)
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBDIR)
diff --git a/depcomp b/depcomp
index ca5ea4e..e5f9736 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2006-10-15.18
+scriptversion=2007-03-29.01
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
# Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
@@ -215,34 +215,39 @@ aix)
# current directory. Also, the AIX compiler puts `$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
- stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
- tmpdepfile="$stripped.u"
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$base.u
+ tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
+ tmpdepfile1=$dir$base.u
+ tmpdepfile2=$dir$base.u
+ tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
- if test -f "$tmpdepfile"; then :
- else
- stripped=`echo "$stripped" | sed 's,^.*/,,'`
- tmpdepfile="$stripped.u"
- fi
-
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile"
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+ do
+ test -f "$tmpdepfile" && break
+ done
if test -f "$tmpdepfile"; then
- outname="$stripped.o"
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
- sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
- sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
diff --git a/dict.c b/dict.c
index c071887..20bd310 100644
--- a/dict.c
+++ b/dict.c
@@ -20,18 +20,44 @@
#include "libxml.h"
#include <string.h>
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#elif defined(WIN32)
+typedef unsigned __int32 uint32_t;
+#endif
#include <libxml/tree.h>
#include <libxml/dict.h>
#include <libxml/xmlmemory.h>
#include <libxml/xmlerror.h>
#include <libxml/globals.h>
-#define MAX_HASH_LEN 4
+/* #define DEBUG_GROW */
+/* #define DICT_DEBUG_PATTERNS */
+
+#define MAX_HASH_LEN 3
#define MIN_DICT_SIZE 128
#define MAX_DICT_HASH 8 * 2048
-
-/* #define ALLOW_REMOVAL */
-/* #define DEBUG_GROW */
+#define WITH_BIG_KEY
+
+#ifdef WITH_BIG_KEY
+#define xmlDictComputeKey(dict, name, len) \
+ (((dict)->size == MIN_DICT_SIZE) ? \
+ xmlDictComputeFastKey(name, len) : \
+ xmlDictComputeBigKey(name, len))
+
+#define xmlDictComputeQKey(dict, prefix, plen, name, len) \
+ (((prefix) == NULL) ? \
+ (xmlDictComputeKey(dict, name, len)) : \
+ (((dict)->size == MIN_DICT_SIZE) ? \
+ xmlDictComputeFastQKey(prefix, plen, name, len) : \
+ xmlDictComputeBigQKey(prefix, plen, name, len)))
+
+#else /* !WITH_BIG_KEY */
+#define xmlDictComputeKey(dict, name, len) \
+ xmlDictComputeFastKey(name, len)
+#define xmlDictComputeQKey(dict, prefix, plen, name, len) \
+ xmlDictComputeFastQKey(prefix, plen, name, len)
+#endif /* WITH_BIG_KEY */
/*
* An entry in the dictionnary
@@ -43,6 +69,7 @@ struct _xmlDictEntry {
const xmlChar *name;
int len;
int valid;
+ unsigned long okey;
};
typedef struct _xmlDictStrings xmlDictStrings;
@@ -129,6 +156,9 @@ xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) {
const xmlChar *ret;
int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "-");
+#endif
pool = dict->strings;
while (pool != NULL) {
if (pool->end - pool->free > namelen)
@@ -153,12 +183,16 @@ xmlDictAddString(xmlDictPtr dict, const xmlChar *name, int namelen) {
pool->end = &pool->array[size];
pool->next = dict->strings;
dict->strings = pool;
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "+");
+#endif
}
found_pool:
ret = pool->free;
memcpy(pool->free, name, namelen);
pool->free += namelen;
*(pool->free++) = 0;
+ pool->nbStrings++;
return(ret);
}
@@ -166,6 +200,7 @@ found_pool:
* xmlDictAddQString:
* @dict: the dictionnary
* @prefix: the prefix of the userdata
+ * @plen: the prefix length
* @name: the name of the userdata
* @len: the length of the name, if -1 it is recomputed
*
@@ -174,20 +209,21 @@ found_pool:
* Returns the pointer of the local string, or NULL in case of error.
*/
static const xmlChar *
-xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix,
+xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix, int plen,
const xmlChar *name, int namelen)
{
xmlDictStringsPtr pool;
const xmlChar *ret;
int size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
- int plen;
if (prefix == NULL) return(xmlDictAddString(dict, name, namelen));
- plen = xmlStrlen(prefix);
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "=");
+#endif
pool = dict->strings;
while (pool != NULL) {
- if (pool->end - pool->free > namelen)
+ if (pool->end - pool->free > namelen + plen + 1)
goto found_pool;
if (pool->size > size) size = pool->size;
pool = pool->next;
@@ -198,8 +234,8 @@ xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix,
if (pool == NULL) {
if (size == 0) size = 1000;
else size *= 4; /* exponential growth */
- if (size < 4 * namelen)
- size = 4 * namelen; /* just in case ! */
+ if (size < 4 * (namelen + plen + 1))
+ size = 4 * (namelen + plen + 1); /* just in case ! */
pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
if (pool == NULL)
return(NULL);
@@ -209,27 +245,106 @@ xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix,
pool->end = &pool->array[size];
pool->next = dict->strings;
dict->strings = pool;
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "+");
+#endif
}
found_pool:
ret = pool->free;
memcpy(pool->free, prefix, plen);
pool->free += plen;
*(pool->free++) = ':';
- namelen -= plen + 1;
memcpy(pool->free, name, namelen);
pool->free += namelen;
*(pool->free++) = 0;
+ pool->nbStrings++;
return(ret);
}
+#ifdef WITH_BIG_KEY
+/*
+ * xmlDictComputeBigKey:
+ *
+ * Calculate a hash key using a good hash function that works well for
+ * larger hash table sizes.
+ *
+ * Hash function by "One-at-a-Time Hash" see
+ * http://burtleburtle.net/bob/hash/doobs.html
+ */
+
+static uint32_t
+xmlDictComputeBigKey(const xmlChar* data, int namelen) {
+ uint32_t hash;
+ int i;
+
+ if (namelen <= 0 || data == NULL) return(0);
+
+ hash = 0;
+
+ for (i = 0;i < namelen; i++) {
+ hash += data[i];
+ hash += (hash << 10);
+ hash ^= (hash >> 6);
+ }
+ hash += (hash << 3);
+ hash ^= (hash >> 11);
+ hash += (hash << 15);
+
+ return hash;
+}
+
+/*
+ * xmlDictComputeBigQKey:
+ *
+ * Calculate a hash key for two strings using a good hash function
+ * that works well for larger hash table sizes.
+ *
+ * Hash function by "One-at-a-Time Hash" see
+ * http://burtleburtle.net/bob/hash/doobs.html
+ *
+ * Neither of the two strings must be NULL.
+ */
+static unsigned long
+xmlDictComputeBigQKey(const xmlChar *prefix, int plen,
+ const xmlChar *name, int len)
+{
+ uint32_t hash;
+ int i;
+
+ hash = 0;
+
+ for (i = 0;i < plen; i++) {
+ hash += prefix[i];
+ hash += (hash << 10);
+ hash ^= (hash >> 6);
+ }
+ hash += ':';
+ hash += (hash << 10);
+ hash ^= (hash >> 6);
+
+ for (i = 0;i < len; i++) {
+ hash += name[i];
+ hash += (hash << 10);
+ hash ^= (hash >> 6);
+ }
+ hash += (hash << 3);
+ hash ^= (hash >> 11);
+ hash += (hash << 15);
+
+ return hash;
+}
+#endif /* WITH_BIG_KEY */
+
/*
- * xmlDictComputeKey:
- * Calculate the hash key
+ * xmlDictComputeFastKey:
+ *
+ * Calculate a hash key using a fast hash function that works well
+ * for low hash table fill.
*/
static unsigned long
-xmlDictComputeKey(const xmlChar *name, int namelen) {
+xmlDictComputeFastKey(const xmlChar *name, int namelen) {
unsigned long value = 0L;
-
+
if (name == NULL) return(0);
value = *name;
value <<= 5;
@@ -253,24 +368,24 @@ xmlDictComputeKey(const xmlChar *name, int namelen) {
}
/*
- * xmlDictComputeQKey:
- * Calculate the hash key
+ * xmlDictComputeFastQKey:
+ *
+ * Calculate a hash key for two strings using a fast hash function
+ * that works well for low hash table fill.
+ *
+ * Neither of the two strings must be NULL.
*/
static unsigned long
-xmlDictComputeQKey(const xmlChar *prefix, const xmlChar *name, int len)
+xmlDictComputeFastQKey(const xmlChar *prefix, int plen,
+ const xmlChar *name, int len)
{
unsigned long value = 0L;
- int plen;
-
- if (prefix == NULL)
- return(xmlDictComputeKey(name, len));
- plen = xmlStrlen(prefix);
if (plen == 0)
value += 30 * (unsigned long) ':';
else
value += 30 * (*prefix);
-
+
if (len > 10) {
value += name[len - (plen + 1 + 1)];
len = 10;
@@ -325,7 +440,11 @@ xmlDictCreate(void) {
if (!xmlDictInitialized)
if (!xmlInitializeDict())
return(NULL);
-
+
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "C");
+#endif
+
dict = xmlMalloc(sizeof(xmlDict));
if (dict) {
dict->ref_counter = 1;
@@ -358,8 +477,11 @@ xmlDictCreate(void) {
xmlDictPtr
xmlDictCreateSub(xmlDictPtr sub) {
xmlDictPtr dict = xmlDictCreate();
-
+
if ((dict != NULL) && (sub != NULL)) {
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "R");
+#endif
dict->subdict = sub;
xmlDictReference(dict->subdict);
}
@@ -398,14 +520,16 @@ xmlDictReference(xmlDictPtr dict) {
*/
static int
xmlDictGrow(xmlDictPtr dict, int size) {
- unsigned long key;
+ unsigned long key, okey;
int oldsize, i;
xmlDictEntryPtr iter, next;
struct _xmlDictEntry *olddict;
#ifdef DEBUG_GROW
unsigned long nbElem = 0;
#endif
-
+ int ret = 0;
+ int keep_keys = 1;
+
if (dict == NULL)
return(-1);
if (size < 8)
@@ -413,11 +537,17 @@ xmlDictGrow(xmlDictPtr dict, int size) {
if (size > 8 * 2048)
return(-1);
+#ifdef DICT_DEBUG_PATTERNS
+ fprintf(stderr, "*");
+#endif
+
oldsize = dict->size;
olddict = dict->dict;
if (olddict == NULL)
return(-1);
-
+ if (oldsize == MIN_DICT_SIZE)
+ keep_keys = 0;
+
dict->dict = xmlMalloc(size * sizeof(xmlDictEntry));
if (dict->dict == NULL) {
dict->dict = olddict;
@@ -427,17 +557,44 @@ xmlDictGrow(xmlDictPtr dict, int size) {
dict->size = size;
/* If the two loops are merged, there would be situations where
- a new entry needs to allocated and data copied into it from
- the main dict. So instead, we run through the array twice, first
- copying all the elements in the main array (where we can't get
- conflicts) and then the rest, so we only free (and don't allocate)
+ a new entry needs to allocated and data copied into it from
+ the main dict. It is nicer to run through the array twice, first
+ copying all the elements in the main array (less probability of
+ allocate) and then the rest, so we only free in the second loop.
*/
for (i = 0; i < oldsize; i++) {
- if (olddict[i].valid == 0)
+ if (olddict[i].valid == 0)
continue;
- key = xmlDictComputeKey(olddict[i].name, olddict[i].len) % dict->size;
- memcpy(&(dict->dict[key]), &(olddict[i]), sizeof(xmlDictEntry));
- dict->dict[key].next = NULL;
+
+ if (keep_keys)
+ okey = olddict[i].okey;
+ else
+ okey = xmlDictComputeKey(dict, olddict[i].name, olddict[i].len);
+ key = okey % dict->size;
+
+ if (dict->dict[key].valid == 0) {
+ memcpy(&(dict->dict[key]), &(olddict[i]), sizeof(xmlDictEntry));
+ dict->dict[key].next = NULL;
+ dict->dict[key].okey = okey;
+ } else {
+ xmlDictEntryPtr entry;
+
+ entry = xmlMalloc(sizeof(xmlDictEntry));
+ if (entry != NULL) {
+ entry->name = olddict[i].name;
+ entry->len = olddict[i].len;
+ entry->okey = okey;
+ entry->next = dict->dict[key].next;
+ entry->valid = 1;
+ dict->dict[key].next = entry;
+ } else {
+ /*
+ * we don't have much ways to alert from herei
+ * result is loosing an entry and unicity garantee
+ */
+ ret = -1;
+ }
+ }
#ifdef DEBUG_GROW
nbElem++;
#endif
@@ -452,15 +609,21 @@ xmlDictGrow(xmlDictPtr dict, int size) {
* put back the entry in the new dict
*/
- key = xmlDictComputeKey(iter->name, iter->len) % dict->size;
+ if (keep_keys)
+ okey = iter->okey;
+ else
+ okey = xmlDictComputeKey(dict, iter->name, iter->len);
+ key = okey % dict->size;
if (dict->dict[key].valid == 0) {
memcpy(&(dict->dict[key]), iter, sizeof(xmlDictEntry));
dict->dict[key].next = NULL;
dict->dict[key].valid = 1;
+ dict->dict[key].okey = okey;
xmlFree(iter);
} else {
- iter->next = dict->dict[key].next;
- dict->dict[key].next = iter;
+ iter->next = dict->dict[key].next;
+ iter->okey = okey;
+ dict->dict[key].next = iter;
}
#ifdef DEBUG_GROW
@@ -478,7 +641,7 @@ xmlDictGrow(xmlDictPtr dict, int size) {
"xmlDictGrow : from %d to %d, %d elems\n", oldsize, size, nbElem);
#endif
- return(0);
+ return(ret);
}
/**
@@ -565,12 +728,12 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
return(NULL);
if (len < 0)
- len = xmlStrlen(name);
+ len = strlen((const char *) name);
/*
* Check for duplicate and insertion location.
*/
- okey = xmlDictComputeKey(name, len);
+ okey = xmlDictComputeKey(dict, name, len);
key = okey % dict->size;
if (dict->dict[key].valid == 0) {
insert = NULL;
@@ -578,55 +741,66 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) {
#ifdef __GNUC__
- if (insert->len == len) {
+ if ((insert->okey == okey) && (insert->len == len)) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
- if ((insert->len == len) &&
+ if ((insert->okey == okey) && (insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
nbi++;
}
#ifdef __GNUC__
- if (insert->len == len) {
+ if ((insert->okey == okey) && (insert->len == len)) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
- if ((insert->len == len) &&
+ if ((insert->okey == okey) && (insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
}
if (dict->subdict) {
- key = okey % dict->subdict->size;
+ unsigned long skey;
+
+ /* we cannot always reuse the same okey for the subdict */
+ if (((dict->size == MIN_DICT_SIZE) &&
+ (dict->subdict->size != MIN_DICT_SIZE)) ||
+ ((dict->size != MIN_DICT_SIZE) &&
+ (dict->subdict->size == MIN_DICT_SIZE)))
+ skey = xmlDictComputeKey(dict->subdict, name, len);
+ else
+ skey = okey;
+
+ key = skey % dict->subdict->size;
if (dict->subdict->dict[key].valid != 0) {
xmlDictEntryPtr tmp;
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) {
#ifdef __GNUC__
- if (tmp->len == len) {
+ if ((tmp->okey == skey) && (tmp->len == len)) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
- if ((tmp->len == len) &&
+ if ((tmp->okey == skey) && (tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
nbi++;
}
#ifdef __GNUC__
- if (tmp->len == len) {
+ if ((tmp->okey == skey) && (tmp->len == len)) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
- if ((tmp->len == len) &&
+ if ((tmp->okey == skey) && (tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
@@ -648,6 +822,7 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
entry->len = len;
entry->next = NULL;
entry->valid = 1;
+ entry->okey = okey;
if (insert != NULL)
@@ -656,8 +831,10 @@ xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len) {
dict->nbElems++;
if ((nbi > MAX_HASH_LEN) &&
- (dict->size <= ((MAX_DICT_HASH / 2) / MAX_HASH_LEN)))
- xmlDictGrow(dict, MAX_HASH_LEN * 2 * dict->size);
+ (dict->size <= ((MAX_DICT_HASH / 2) / MAX_HASH_LEN))) {
+ if (xmlDictGrow(dict, MAX_HASH_LEN * 2 * dict->size) != 0)
+ return(NULL);
+ }
/* Note that entry may have been freed at this point by xmlDictGrow */
return(ret);
@@ -682,12 +859,12 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
return(NULL);
if (len < 0)
- len = xmlStrlen(name);
+ len = strlen((const char *) name);
/*
* Check for duplicate and insertion location.
*/
- okey = xmlDictComputeKey(name, len);
+ okey = xmlDictComputeKey(dict, name, len);
key = okey % dict->size;
if (dict->dict[key].valid == 0) {
insert = NULL;
@@ -695,60 +872,70 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) {
#ifdef __GNUC__
- if (insert->len == len) {
+ if ((insert->okey == okey) && (insert->len == len)) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
- if ((insert->len == len) &&
+ if ((insert->okey == okey) && (insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
nbi++;
}
#ifdef __GNUC__
- if (insert->len == len) {
+ if ((insert->okey == okey) && (insert->len == len)) {
if (!memcmp(insert->name, name, len))
return(insert->name);
}
#else
- if ((insert->len == len) &&
+ if ((insert->okey == okey) && (insert->len == len) &&
(!xmlStrncmp(insert->name, name, len)))
return(insert->name);
#endif
}
if (dict->subdict) {
- key = okey % dict->subdict->size;
+ unsigned long skey;
+
+ /* we cannot always reuse the same okey for the subdict */
+ if (((dict->size == MIN_DICT_SIZE) &&
+ (dict->subdict->size != MIN_DICT_SIZE)) ||
+ ((dict->size != MIN_DICT_SIZE) &&
+ (dict->subdict->size == MIN_DICT_SIZE)))
+ skey = xmlDictComputeKey(dict->subdict, name, len);
+ else
+ skey = okey;
+
+ key = skey % dict->subdict->size;
if (dict->subdict->dict[key].valid != 0) {
xmlDictEntryPtr tmp;
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) {
#ifdef __GNUC__
- if (tmp->len == len) {
+ if ((tmp->okey == skey) && (tmp->len == len)) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
- if ((tmp->len == len) &&
+ if ((tmp->okey == skey) && (tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
nbi++;
}
#ifdef __GNUC__
- if (tmp->len == len) {
+ if ((tmp->okey == skey) && (tmp->len == len)) {
if (!memcmp(tmp->name, name, len))
return(tmp->name);
}
#else
- if ((tmp->len == len) &&
+ if ((tmp->okey == skey) && (tmp->len == len) &&
(!xmlStrncmp(tmp->name, name, len)))
return(tmp->name);
#endif
}
- key = okey % dict->size;
}
/* not found */
@@ -758,7 +945,7 @@ xmlDictExists(xmlDictPtr dict, const xmlChar *name, int len) {
/**
* xmlDictQLookup:
* @dict: the dictionnary
- * @prefix: the prefix
+ * @prefix: the prefix
* @name: the name
*
* Add the QName @prefix:@name to the hash @dict if not present.
@@ -771,54 +958,67 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) {
xmlDictEntryPtr entry;
xmlDictEntryPtr insert;
const xmlChar *ret;
- int len;
+ int len, plen, l;
if ((dict == NULL) || (name == NULL))
return(NULL);
+ if (prefix == NULL)
+ return(xmlDictLookup(dict, name, -1));
- len = xmlStrlen(name);
- if (prefix != NULL)
- len += 1 + xmlStrlen(prefix);
+ l = len = strlen((const char *) name);
+ plen = strlen((const char *) prefix);
+ len += 1 + plen;
/*
* Check for duplicate and insertion location.
*/
- okey = xmlDictComputeQKey(prefix, name, len);
+ okey = xmlDictComputeQKey(dict, prefix, plen, name, l);
key = okey % dict->size;
if (dict->dict[key].valid == 0) {
insert = NULL;
} else {
for (insert = &(dict->dict[key]); insert->next != NULL;
insert = insert->next) {
- if ((insert->len == len) &&
+ if ((insert->okey == okey) && (insert->len == len) &&
(xmlStrQEqual(prefix, name, insert->name)))
return(insert->name);
nbi++;
}
- if ((insert->len == len) &&
+ if ((insert->okey == okey) && (insert->len == len) &&
(xmlStrQEqual(prefix, name, insert->name)))
return(insert->name);
}
if (dict->subdict) {
- key = okey % dict->subdict->size;
+ unsigned long skey;
+
+ /* we cannot always reuse the same okey for the subdict */
+ if (((dict->size == MIN_DICT_SIZE) &&
+ (dict->subdict->size != MIN_DICT_SIZE)) ||
+ ((dict->size != MIN_DICT_SIZE) &&
+ (dict->subdict->size == MIN_DICT_SIZE)))
+ skey = xmlDictComputeQKey(dict->subdict, prefix, plen, name, l);
+ else
+ skey = okey;
+
+ key = skey % dict->subdict->size;
if (dict->subdict->dict[key].valid != 0) {
xmlDictEntryPtr tmp;
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
tmp = tmp->next) {
- if ((tmp->len == len) &&
+ if ((tmp->okey == skey) && (tmp->len == len) &&
(xmlStrQEqual(prefix, name, tmp->name)))
return(tmp->name);
nbi++;
}
- if ((tmp->len == len) &&
+ if ((tmp->okey == skey) && (tmp->len == len) &&
(xmlStrQEqual(prefix, name, tmp->name)))
return(tmp->name);
}
key = okey % dict->size;
}
- ret = xmlDictAddQString(dict, prefix, name, len);
+ ret = xmlDictAddQString(dict, prefix, plen, name, l);
if (ret == NULL)
return(NULL);
if (insert == NULL) {
@@ -832,6 +1032,7 @@ xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) {
entry->len = len;
entry->next = NULL;
entry->valid = 1;
+ entry->okey = okey;
if (insert != NULL)
insert->next = entry;
diff --git a/doc/APIchunk1.html b/doc/APIchunk1.html
index bedf943..eacab4b 100644
--- a/doc/APIchunk1.html
+++ b/doc/APIchunk1.html
@@ -39,6 +39,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="APIchunk29.html">y-z</a>
</h2><h2>Letter C:</h2><dl><dt>C14N</dt><dd><a href="html/libxml-c14n.html#xmlC14NDocSaveTo">xmlC14NDocSaveTo</a><br />
<a href="html/libxml-c14n.html#xmlC14NExecute">xmlC14NExecute</a><br />
+<a href="html/libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a><br />
</dd><dt>CATALOG</dt><dd><a href="html/libxml-catalog.html#xmlLoadACatalog">xmlLoadACatalog</a><br />
<a href="html/libxml-catalog.html#xmlLoadCatalog">xmlLoadCatalog</a><br />
<a href="html/libxml-catalog.html#xmlLoadSGMLSuperCatalog">xmlLoadSGMLSuperCatalog</a><br />
@@ -108,6 +109,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlIO.html#xmlOutputOpenCallback">xmlOutputOpenCallback</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a><br />
<a href="html/libxml-parser.html#xmlParserInputDeallocate">xmlParserInputDeallocate</a><br />
+<a href="html/libxml-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2ExternalSubset">xmlSAX2ExternalSubset</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2InternalSubset">xmlSAX2InternalSubset</a><br />
<a href="html/libxml-valid.html#xmlValidityErrorFunc">xmlValidityErrorFunc</a><br />
diff --git a/doc/APIchunk10.html b/doc/APIchunk10.html
index cbcc86b..94fd2fa 100644
--- a/doc/APIchunk10.html
+++ b/doc/APIchunk10.html
@@ -41,7 +41,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-uri.html#xmlURIEscapeStr">xmlURIEscapeStr</a><br />
</dd><dt>a-zA-Z</dt><dd><a href="html/libxml-parserInternals.html#IS_ASCII_LETTER">IS_ASCII_LETTER</a><br />
</dd><dt>a-zA-Z0-9</dt><dd><a href="html/libxml-parserInternals.html#IS_PUBIDCHAR">IS_PUBIDCHAR</a><br />
-</dd><dt>a-zA-Z0-9_</dt><dd><a href="html/libxml-parserInternals.html#xmlParseVersionNum">xmlParseVersionNum</a><br />
</dd><dt>a@b</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPProxy">xmlNanoFTPProxy</a><br />
</dd><dt>abc</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathTranslateFunction">xmlXPathTranslateFunction</a><br />
</dd><dt>abc-</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathTranslateFunction">xmlXPathTranslateFunction</a><br />
@@ -62,8 +61,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_FINAL_ABSENT">XML_SCHEMAS_ELEM_FINAL_ABSENT</a><br />
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_TYPE_VARIETY_ABSENT">XML_SCHEMAS_TYPE_VARIETY_ABSENT</a><br />
</dd><dt>absoluteURI</dt><dd><a href="html/libxml-uri.html#xmlParseURI">xmlParseURI</a><br />
-<a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
-<a href="html/libxml-uri.html#xmlParseURIReference">xmlParseURIReference</a><br />
</dd><dt>abstract</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_ABSTRACT">XML_SCHEMAS_ELEM_ABSTRACT</a><br />
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_TYPE_ABSTRACT">XML_SCHEMAS_TYPE_ABSTRACT</a><br />
</dd><dt>accept</dt><dd><a href="html/libxml-xmlregexp.html#xmlExpMaxToken">xmlExpMaxToken</a><br />
@@ -88,6 +85,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlmemory.html#xmlMemSetup">xmlMemSetup</a><br />
<a href="html/libxml-threads.html#xmlNewMutex">xmlNewMutex</a><br />
<a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
</dd><dt>accessed</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderCurrentDoc">xmlTextReaderCurrentDoc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderCurrentNode">xmlTextReaderCurrentNode</a><br />
</dd><dt>accesses</dt><dd><a href="html/libxml-parserInternals.html#xmlCreateURLParserCtxt">xmlCreateURLParserCtxt</a><br />
@@ -315,6 +313,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</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-parserInternals.html#xmlParseVersionNum">xmlParseVersionNum</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-tree.html#xmlSearchNs">xmlSearchNs</a><br />
<a href="html/libxml-debugXML.html#xmlShell">xmlShell</a><br />
<a href="html/libxml-tree.html#xmlValidateNCName">xmlValidateNCName</a><br />
@@ -372,7 +372,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlReplaceNode">xmlReplaceNode</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathNodeSetAddUnique">xmlXPathNodeSetAddUnique</a><br />
<a href="html/libxml-xpointer.html#xmlXPtrLocationSetAdd">xmlXPtrLocationSetAdd</a><br />
-</dd><dt>also</dt><dd><a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
+</dd><dt>also</dt><dd><a href="html/libxml-entities.html#_xmlEntity">_xmlEntity</a><br />
+<a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
<a href="html/libxml-xmlIO.html#xmlCheckHTTPInput">xmlCheckHTTPInput</a><br />
<a href="html/libxml-parser.html#xmlCleanupParser">xmlCleanupParser</a><br />
<a href="html/libxml-tree.html#xmlHasProp">xmlHasProp</a><br />
@@ -398,6 +399,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>amd</dt><dd><a href="html/libxml-catalog.html#xmlCatalogIsEmpty">xmlCatalogIsEmpty</a><br />
</dd><dt>amount</dt><dd><a href="html/libxml-parserInternals.html#INPUT_CHUNK">INPUT_CHUNK</a><br />
<a href="html/libxml-xmlIO.html#_xmlParserInputBuffer">_xmlParserInputBuffer</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferGrow">xmlParserInputBufferGrow</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferRead">xmlParserInputBufferRead</a><br />
@@ -437,6 +439,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlNamespaceParseNCName">xmlNamespaceParseNCName</a><br />
<a href="html/libxml-parserInternals.html#xmlNamespaceParseNSDef">xmlNamespaceParseNSDef</a><br />
<a href="html/libxml-parserInternals.html#xmlNamespaceParseQName">xmlNamespaceParseQName</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
</dd><dt>anyway</dt><dd><a href="html/libxml-parser.html#xmlRecoverDoc">xmlRecoverDoc</a><br />
<a href="html/libxml-parser.html#xmlRecoverFile">xmlRecoverFile</a><br />
<a href="html/libxml-parser.html#xmlRecoverMemory">xmlRecoverMemory</a><br />
diff --git a/doc/APIchunk11.html b/doc/APIchunk11.html
index bcb58cf..7062e5e 100644
--- a/doc/APIchunk11.html
+++ b/doc/APIchunk11.html
@@ -56,8 +56,14 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlNewEntityInputStream">xmlNewEntityInputStream</a><br />
<a href="html/libxml-parserInternals.html#xmlNewInputFromFile">xmlNewInputFromFile</a><br />
<a href="html/libxml-parserInternals.html#xmlNewStringInputStream">xmlNewStringInputStream</a><br />
+<a href="html/libxml-uri.html#xmlParseURI">xmlParseURI</a><br />
+<a href="html/libxml-uri.html#xmlParseURIReference">xmlParseURIReference</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewValidCtxt">xmlRelaxNGNewValidCtxt</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaNewStringValue">xmlSchemaNewStringValue</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaNewValidCtxt">xmlSchemaNewValidCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
<a href="html/libxml-schematron.html#xmlSchematronNewValidCtxt">xmlSchematronNewValidCtxt</a><br />
<a href="html/libxml-tree.html#xmlSetCompressMode">xmlSetCompressMode</a><br />
<a href="html/libxml-tree.html#xmlSetDocCompressMode">xmlSetDocCompressMode</a><br />
@@ -142,6 +148,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
<a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans2">xmlAutomataNewOnceTrans2</a><br />
<a href="html/libxml-catalog.html#xmlCatalogSetDefaultPrefer">xmlCatalogSetDefaultPrefer</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-parserInternals.html#xmlParseQuotedString">xmlParseQuotedString</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathDifference">xmlXPathDifference</a><br />
</dd><dt>beyond</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
@@ -192,6 +199,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>bracket</dt><dd><a href="html/libxml-parserInternals.html#xmlParseCharData">xmlParseCharData</a><br />
</dd><dt>branch</dt><dd><a href="html/libxml-tree.html#xmlDOMWrapCloneNode">xmlDOMWrapCloneNode</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />
</dd><dt>break</dt><dd><a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapAdoptNode">xmlDOMWrapAdoptNode</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapCloneNode">xmlDOMWrapCloneNode</a><br />
diff --git a/doc/APIchunk12.html b/doc/APIchunk12.html
index 769619b..ff1be47 100644
--- a/doc/APIchunk12.html
+++ b/doc/APIchunk12.html
@@ -55,6 +55,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpathInternals.html#xmlXPathSubValues">xmlXPathSubValues</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathValueFlipSign">xmlXPathValueFlipSign</a><br />
</dd><dt>calls</dt><dd><a href="html/libxml-xlink.html#xlinkNodeDetectFunc">xlinkNodeDetectFunc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
<a href="html/libxml-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a><br />
</dd><dt>came</dt><dd><a href="html/libxml-parserInternals.html#xmlPopInput">xmlPopInput</a><br />
</dd><dt>cannot</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttribute">xmlParseAttribute</a><br />
@@ -769,6 +770,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>corresponding</dt><dd><a href="html/libxml-entities.html#xmlGetDocEntity">xmlGetDocEntity</a><br />
<a href="html/libxml-entities.html#xmlGetDtdEntity">xmlGetDtdEntity</a><br />
<a href="html/libxml-entities.html#xmlGetParameterEntity">xmlGetParameterEntity</a><br />
+<a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-tree.html#xmlSetProp">xmlSetProp</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathTranslateFunction">xmlXPathTranslateFunction</a><br />
</dd><dt>cost</dt><dd><a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
@@ -788,7 +791,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlreader.html#xmlTextReaderSchemaValidateCtxt">xmlTextReaderSchemaValidateCtxt</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetSchema">xmlTextReaderSetSchema</a><br />
<a href="html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd</a><br />
-</dd><dt>count</dt><dd><a href="html/libxml-nanoftp.html#ftpListCallback">ftpListCallback</a><br />
+</dd><dt>count</dt><dd><a href="html/libxml-entities.html#_xmlEntity">_xmlEntity</a><br />
+<a href="html/libxml-nanoftp.html#ftpListCallback">ftpListCallback</a><br />
<a href="html/libxml-xmlregexp.html#xmlExpRef">xmlExpRef</a><br />
<a href="html/libxml-debugXML.html#xmlLsCountNode">xmlLsCountNode</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveDoc">xmlSaveDoc</a><br />
@@ -849,12 +853,14 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-valid.html#xmlValidityErrorFunc">xmlValidityErrorFunc</a><br />
<a href="html/libxml-valid.html#xmlValidityWarningFunc">xmlValidityWarningFunc</a><br />
</dd><dt>cur</dt><dd><a href="html/libxml-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a><br />
+</dd><dt>curent</dt><dd><a href="html/libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a><br />
</dd><dt>currently</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_INCLUDING_CONVERT_NS">XML_SCHEMAS_INCLUDING_CONVERT_NS</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemUsed">xmlMemUsed</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferCreateFilename">xmlOutputBufferCreateFilename</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
<a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
</dd><dt>custom</dt><dd><a href="html/libxml-tree.html#xmlDOMWrapAdoptNode">xmlDOMWrapAdoptNode</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapCloneNode">xmlDOMWrapCloneNode</a><br />
diff --git a/doc/APIchunk13.html b/doc/APIchunk13.html
index c86ff16..2e8417f 100644
--- a/doc/APIchunk13.html
+++ b/doc/APIchunk13.html
@@ -178,6 +178,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
<a href="html/libxml-tree.html#xmlGetNsList">xmlGetNsList</a><br />
<a href="html/libxml-parserInternals.html#xmlHandleEntity">xmlHandleEntity</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-tree.html#xmlNewNs">xmlNewNs</a><br />
<a href="html/libxml-tree.html#xmlNodeGetBase">xmlNodeGetBase</a><br />
<a href="html/libxml-parser.html#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a><br />
@@ -248,6 +249,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-pattern.html#xmlPatternMinDepth">xmlPatternMinDepth</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderDepth">xmlTextReaderDepth</a><br />
</dd><dt>deregistration</dt><dd><a href="html/libxml-globals.html#xmlDeregisterNodeDefault">xmlDeregisterNodeDefault</a><br />
+<a href="html/libxml-globals.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a><br />
</dd><dt>derivation</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION">XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION</a><br />
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION">XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION</a><br />
<a href="html/libxml-xmlregexp.html#xmlExpExpDerive">xmlExpExpDerive</a><br />
@@ -301,6 +303,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-HTMLparser.html#htmlReadFd">htmlReadFd</a><br />
<a href="html/libxml-parser.html#xmlCtxtReadFd">xmlCtxtReadFd</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferCreateFd">xmlOutputBufferCreateFd</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferCreateFd">xmlParserInputBufferCreateFd</a><br />
@@ -356,6 +359,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-SAX2.html#xmlSAX2EndElementNs">xmlSAX2EndElementNs</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2Reference">xmlSAX2Reference</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2StartElementNs">xmlSAX2StartElementNs</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaIsValid">xmlSchemaIsValid</a><br />
</dd><dt>detection</dt><dd><a href="html/libxml-DOCBparser.html#docbCreatePushParserCtxt">docbCreatePushParserCtxt</a><br />
<a href="html/libxml-xlink.html#xlinkExtendedLinkFunk">xlinkExtendedLinkFunk</a><br />
<a href="html/libxml-xlink.html#xlinkExtendedLinkSetFunk">xlinkExtendedLinkSetFunk</a><br />
@@ -400,7 +404,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderStandalone">xmlTextReaderStandalone</a><br />
</dd><dt>difference</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathDifference">xmlXPathDifference</a><br />
-</dd><dt>different</dt><dd><a href="html/libxml-catalog.html#xmlACatalogAdd">xmlACatalogAdd</a><br />
+</dd><dt>different</dt><dd><a href="html/libxml-tree.html#_xmlBuffer">_xmlBuffer</a><br />
+<a href="html/libxml-catalog.html#xmlACatalogAdd">xmlACatalogAdd</a><br />
<a href="html/libxml-tree.html#xmlBuildQName">xmlBuildQName</a><br />
<a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
<a href="html/libxml-tree.html#xmlNodeGetBase">xmlNodeGetBase</a><br />
@@ -408,6 +413,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlstring.html#xmlStrQEqual">xmlStrQEqual</a><br />
</dd><dt>differentiate</dt><dd><a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
</dd><dt>differently</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
+</dd><dt>differs</dt><dd><a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
</dd><dt>digit</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
</dd><dt>digits</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
</dd><dt>dir</dt><dd><a href="html/libxml-debugXML.html#xmlShellDir">xmlShellDir</a><br />
@@ -462,6 +468,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_BLOCK_RESTRICTION">XML_SCHEMAS_ELEM_BLOCK_RESTRICTION</a><br />
<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION">XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION</a><br />
</dd><dt>discard</dt><dd><a href="html/libxml-parser.html#xmlParserInputRead">xmlParserInputRead</a><br />
+</dd><dt>discarded</dt><dd><a href="html/libxml-globals.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a><br />
</dd><dt>discarding</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
<a href="html/libxml-valid.html#xmlValidCtxtNormalizeAttributeValue">xmlValidCtxtNormalizeAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
@@ -526,6 +533,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpathInternals.html#xmlXPathNodeTrailingSorted">xmlXPathNodeTrailingSorted</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathTrailing">xmlXPathTrailing</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathTrailingSorted">xmlXPathTrailingSorted</a><br />
+</dd><dt>doing</dt><dd><a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
+<a href="html/libxml-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a><br />
</dd><dt>don</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ANY_LAX">XML_SCHEMAS_ANY_LAX</a><br />
<a href="html/libxml-xlink.html#xlinkIsLink">xlinkIsLink</a><br />
<a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
@@ -584,9 +594,11 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-valid.html#xmlDumpNotationDecl">xmlDumpNotationDecl</a><br />
<a href="html/libxml-valid.html#xmlDumpNotationTable">xmlDumpNotationTable</a><br />
<a href="html/libxml-debugXML.html#xmlLsOneNode">xmlLsOneNode</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a><br />
<a href="html/libxml-valid.html#xmlSnprintfElementContent">xmlSnprintfElementContent</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathDebugDumpObject">xmlXPathDebugDumpObject</a><br />
+</dd><dt>dumping</dt><dd><a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
</dd><dt>dumps</dt><dd><a href="html/libxml-debugXML.html#xmlShellBase">xmlShellBase</a><br />
<a href="html/libxml-debugXML.html#xmlShellCat">xmlShellCat</a><br />
<a href="html/libxml-debugXML.html#xmlShellDir">xmlShellDir</a><br />
@@ -597,7 +609,9 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>duplicates</dt><dd><a href="html/libxml-xmlschemastypes.html#xmlSchemaCopyValue">xmlSchemaCopyValue</a><br />
</dd><dt>duration</dt><dd><a href="html/libxml-xmlschemastypes.html#xmlSchemaGetCanonValue">xmlSchemaGetCanonValue</a><br />
</dd><dt>during</dt><dd><a href="html/libxml-SAX2.html#xmlSAXDefaultVersion">xmlSAXDefaultVersion</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaIsValid">xmlSchemaIsValid</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaNewDocParserCtxt">xmlSchemaNewDocParserCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
<a href="html/libxml-schematron.html#xmlSchematronNewDocParserCtxt">xmlSchematronNewDocParserCtxt</a><br />
</dd><dt>dynamic</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a><br />
</dd></dl><h2 align="center"><a href="APIchunk0.html">A-B</a>
diff --git a/doc/APIchunk14.html b/doc/APIchunk14.html
index 61e35fc..0973657 100644
--- a/doc/APIchunk14.html
+++ b/doc/APIchunk14.html
@@ -186,6 +186,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>ensuring</dt><dd><a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
</dd><dt>entire</dt><dd><a href="html/libxml-xmlIO.html#xmlCleanupInputCallbacks">xmlCleanupInputCallbacks</a><br />
<a href="html/libxml-xmlIO.html#xmlCleanupOutputCallbacks">xmlCleanupOutputCallbacks</a><br />
+</dd><dt>entites</dt><dd><a href="html/libxml-entities.html#_xmlEntity">_xmlEntity</a><br />
</dd><dt>entities:</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
</dd><dt>entproc</dt><dd><a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br />
@@ -321,7 +322,11 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a><br />
<a href="html/libxml-xmlwriter.html#xmlTextWriterFullEndElement">xmlTextWriterFullEndElement</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathRoundFunction">xmlXPathRoundFunction</a><br />
+</dd><dt>event</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
</dd><dt>events</dt><dd><a href="html/libxml-HTMLparser.html#htmlSAXParseDoc">htmlSAXParseDoc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
</dd><dt>ever</dt><dd><a href="html/libxml-xmlregexp.html#xmlExpCtxtNbCons">xmlExpCtxtNbCons</a><br />
</dd><dt>everywhere</dt><dd><a href="html/libxml-parser.html#xmlSAXParseFileWithData">xmlSAXParseFileWithData</a><br />
<a href="html/libxml-parser.html#xmlSAXParseMemoryWithData">xmlSAXParseMemoryWithData</a><br />
diff --git a/doc/APIchunk15.html b/doc/APIchunk15.html
index 03616a5..d8ac416 100644
--- a/doc/APIchunk15.html
+++ b/doc/APIchunk15.html
@@ -105,6 +105,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#xmlSAXParseMemoryWithData">xmlSAXParseMemoryWithData</a><br />
</dd><dt>far</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<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 />
@@ -231,6 +232,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
</dd><dt>floor</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathFloorFunction">xmlXPathFloorFunction</a><br />
</dd><dt>flow</dt><dd><a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
</dd><dt>flushed</dt><dd><a href="html/libxml-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a><br />
</dd><dt>flushes</dt><dd><a href="html/libxml-xmlIO.html#xmlOutputBufferClose">xmlOutputBufferClose</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferFlush">xmlOutputBufferFlush</a><br />
@@ -316,12 +320,11 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-HTMLparser.html#htmlSAXParseFile">htmlSAXParseFile</a><br />
<a href="html/libxml-parser.html#xmlParseCtxtExternalEntity">xmlParseCtxtExternalEntity</a><br />
<a href="html/libxml-parser.html#xmlParseExternalEntity">xmlParseExternalEntity</a><br />
+</dd><dt>forward</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
</dd><dt>fptr</dt><dd><a href="html/libxml-hash.html#XML_CAST_FPTR">XML_CAST_FPTR</a><br />
</dd><dt>fragment</dt><dd><a href="html/libxml-uri.html#_xmlURI">_xmlURI</a><br />
<a href="html/libxml-tree.html#xmlNewDocFragment">xmlNewDocFragment</a><br />
<a href="html/libxml-uri.html#xmlParseURI">xmlParseURI</a><br />
-<a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
-<a href="html/libxml-uri.html#xmlParseURIReference">xmlParseURIReference</a><br />
<a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
</dd><dt>fragments</dt><dd><a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
</dd><dt>freeing</dt><dd><a href="html/libxml-uri.html#xmlCanonicPath">xmlCanonicPath</a><br />
@@ -392,8 +395,11 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGSetParserStructuredErrors">xmlRelaxNGSetParserStructuredErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidErrors">xmlRelaxNGSetValidErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidStructuredErrors">xmlRelaxNGSetValidStructuredErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaSetParserErrors">xmlSchemaSetParserErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
<a href="html/libxml-schematron.html#xmlSchematronSetValidStructuredErrors">xmlSchematronSetValidStructuredErrors</a><br />
<a href="html/libxml-debugXML.html#xmlShellCmd">xmlShellCmd</a><br />
<a href="html/libxml-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a><br />
@@ -407,6 +413,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-valid.html#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeSetFlags">xmlXIncludeSetFlags</a><br />
</dd><dt>future</dt><dd><a href="html/libxml-tree.html#_xmlDOMWrapCtxt">_xmlDOMWrapCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
</dd></dl><h2 align="center"><a href="APIchunk0.html">A-B</a>
<a href="APIchunk1.html">C-C</a>
<a href="APIchunk2.html">D-E</a>
diff --git a/doc/APIchunk17.html b/doc/APIchunk17.html
index 548d945..633240e 100644
--- a/doc/APIchunk17.html
+++ b/doc/APIchunk17.html
@@ -144,6 +144,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>included</dt><dd><a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
<a href="html/libxml-c14n.html#xmlC14NDocSave">xmlC14NDocSave</a><br />
<a href="html/libxml-c14n.html#xmlC14NDocSaveTo">xmlC14NDocSaveTo</a><br />
+<a href="html/libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a><br />
<a href="html/libxml-tree.html#xmlDocDumpMemory">xmlDocDumpMemory</a><br />
<a href="html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPContentLength">xmlNanoHTTPContentLength</a><br />
@@ -201,6 +202,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#nodePush">nodePush</a><br />
<a href="html/libxml-parser.html#xmlByteConsumed">xmlByteConsumed</a><br />
<a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
+<a href="html/libxml-parserInternals.html#xmlPushInput">xmlPushInput</a><br />
<a href="html/libxml-xmlstring.html#xmlStrsub">xmlStrsub</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderByteConsumed">xmlTextReaderByteConsumed</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderGetAttributeNo">xmlTextReaderGetAttributeNo</a><br />
@@ -236,6 +238,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>indicating</dt><dd><a href="html/libxml-parserInternals.html#xmlParseCharData">xmlParseCharData</a><br />
<a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
<a href="html/libxml-debugXML.html#xmlShellCmd">xmlShellCmd</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderNormalization">xmlTextReaderNormalization</a><br />
<a href="html/libxml-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a><br />
</dd><dt>indication</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPRead">xmlNanoFTPRead</a><br />
@@ -293,6 +296,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<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#xmlSchemaValidateStream">xmlSchemaValidateStream</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 />
@@ -317,6 +321,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<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-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 />
@@ -472,6 +478,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGNewDocParserCtxt">xmlRelaxNGNewDocParserCtxt</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-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
<a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
</dd><dt>interned</dt><dd><a href="html/libxml-pattern.html#xmlPatterncompile">xmlPatterncompile</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderConstString">xmlTextReaderConstString</a><br />
diff --git a/doc/APIchunk18.html b/doc/APIchunk18.html
index fcdce05..78b4480 100644
--- a/doc/APIchunk18.html
+++ b/doc/APIchunk18.html
@@ -125,6 +125,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-hash.html#xmlHashUpdateEntry2">xmlHashUpdateEntry2</a><br />
<a href="html/libxml-hash.html#xmlHashUpdateEntry3">xmlHashUpdateEntry3</a><br />
<a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
</dd><dt>latest</dt><dd><a href="html/libxml-nanohttp.html#xmlNanoHTTPReturnCode">xmlNanoHTTPReturnCode</a><br />
</dd><dt>layer</dt><dd><a href="html/libxml-tree.html#xmlChildrenNode">xmlChildrenNode</a><br />
@@ -136,6 +137,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlRootNode">xmlRootNode</a><br />
<a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
</dd><dt>leading</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElementMixedContentDecl">xmlParseElementMixedContentDecl</a><br />
@@ -152,6 +155,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
</dd><dt>left</dt><dd><a href="html/libxml-xmlregexp.html#xmlExpNewOr">xmlExpNewOr</a><br />
<a href="html/libxml-xmlregexp.html#xmlExpNewSeq">xmlExpNewSeq</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
</dd><dt>legacy</dt><dd><a href="html/libxml-HTMLparser.html#htmlNodeStatus">htmlNodeStatus</a><br />
</dd><dt>len</dt><dd><a href="html/libxml-tree.html#xmlBufferAdd">xmlBufferAdd</a><br />
@@ -194,6 +198,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-debugXML.html#xmlDebugDumpOneNode">xmlDebugDumpOneNode</a><br />
<a href="html/libxml-tree.html#xmlNodeDump">xmlNodeDump</a><br />
<a href="html/libxml-tree.html#xmlNodeDumpOutput">xmlNodeDumpOutput</a><br />
+<a href="html/libxml-parserInternals.html#xmlParseVersionNum">xmlParseVersionNum</a><br />
<a href="html/libxml-debugXML.html#xmlShellPwd">xmlShellPwd</a><br />
<a href="html/libxml-pattern.html#xmlStreamPop">xmlStreamPop</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathDebugDumpCompExpr">xmlXPathDebugDumpCompExpr</a><br />
@@ -348,6 +353,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-uri.html#xmlCanonicPath">xmlCanonicPath</a><br />
<a href="html/libxml-uri.html#xmlPathToURI">xmlPathToURI</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2SetDocumentLocator">xmlSAX2SetDocumentLocator</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderLocatorBaseURI">xmlTextReaderLocatorBaseURI</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderLocatorLineNumber">xmlTextReaderLocatorLineNumber</a><br />
</dd><dt>locators</dt><dd><a href="html/libxml-xlink.html#xlinkExtendedLinkFunk">xlinkExtendedLinkFunk</a><br />
diff --git a/doc/APIchunk19.html b/doc/APIchunk19.html
index a5db809..eccf3d3 100644
--- a/doc/APIchunk19.html
+++ b/doc/APIchunk19.html
@@ -51,6 +51,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>main</dt><dd><a href="html/libxml-threads.html#xmlIsMainThread">xmlIsMainThread</a><br />
</dd><dt>maintained</dt><dd><a href="html/libxml-valid.html#xmlRemoveID">xmlRemoveID</a><br />
<a href="html/libxml-valid.html#xmlRemoveRef">xmlRemoveRef</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
</dd><dt>major</dt><dd><a href="html/libxml-parserInternals.html#xmlDecodeEntities">xmlDecodeEntities</a><br />
</dd><dt>make</dt><dd><a href="html/libxml-entities.html#xmlCreateEntitiesTable">xmlCreateEntitiesTable</a><br />
<a href="html/libxml-tree.html#xmlNewNode">xmlNewNode</a><br />
@@ -72,7 +73,6 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>manage</dt><dd><a href="html/libxml-tree.html#xmlBufferWriteChar">xmlBufferWriteChar</a><br />
<a href="html/libxml-tree.html#xmlBufferWriteQuotedString">xmlBufferWriteQuotedString</a><br />
</dd><dt>manages</dt><dd><a href="html/libxml-tree.html#xmlBufferWriteCHAR">xmlBufferWriteCHAR</a><br />
-</dd><dt>mandatory</dt><dd><a href="html/libxml-parserInternals.html#xmlParseTextDecl">xmlParseTextDecl</a><br />
</dd><dt>manipulated</dt><dd><a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
</dd><dt>manipulating</dt><dd><a href="html/libxml-xmlregexp.html#xmlExpNewCtxt">xmlExpNewCtxt</a><br />
<a href="html/libxml-catalog.html#xmlLoadSGMLSuperCatalog">xmlLoadSGMLSuperCatalog</a><br />
@@ -185,6 +185,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>memo</dt><dd><a href="html/libxml-SAX.html#getSystemId">getSystemId</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2GetSystemId">xmlSAX2GetSystemId</a><br />
</dd><dt>memorylist</dt><dd><a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a><br />
</dd><dt>merged</dt><dd><a href="html/libxml-tree.html#xmlTextMerge">xmlTextMerge</a><br />
</dd><dt>merging</dt><dd><a href="html/libxml-tree.html#xmlAddChild">xmlAddChild</a><br />
@@ -192,20 +193,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlAddNextSibling">xmlAddNextSibling</a><br />
<a href="html/libxml-tree.html#xmlAddPrevSibling">xmlAddPrevSibling</a><br />
<a href="html/libxml-tree.html#xmlAddSibling">xmlAddSibling</a><br />
-</dd><dt>message</dt><dd><a href="html/libxml-xmlerror.html#_xmlError">_xmlError</a><br />
-<a href="html/libxml-parser.html#errorSAXFunc">errorSAXFunc</a><br />
-<a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br />
-<a href="html/libxml-parser.html#warningSAXFunc">warningSAXFunc</a><br />
-<a href="html/libxml-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a><br />
-<a href="html/libxml-xmlerror.html#xmlParserError">xmlParserError</a><br />
-<a href="html/libxml-xmlerror.html#xmlParserValidityError">xmlParserValidityError</a><br />
-<a href="html/libxml-xmlerror.html#xmlParserValidityWarning">xmlParserValidityWarning</a><br />
-<a href="html/libxml-xmlerror.html#xmlParserWarning">xmlParserWarning</a><br />
-<a href="html/libxml-xmlstring.html#xmlStrPrintf">xmlStrPrintf</a><br />
-<a href="html/libxml-xmlstring.html#xmlStrVPrintf">xmlStrVPrintf</a><br />
-<a href="html/libxml-valid.html#xmlValidityErrorFunc">xmlValidityErrorFunc</a><br />
-<a href="html/libxml-valid.html#xmlValidityWarningFunc">xmlValidityWarningFunc</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPatherror">xmlXPatherror</a><br />
</dd><dt>messages</dt><dd><a href="html/libxml-parser.html#errorSAXFunc">errorSAXFunc</a><br />
<a href="html/libxml-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a><br />
<a href="html/libxml-parser.html#warningSAXFunc">warningSAXFunc</a><br />
@@ -220,6 +207,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#_xmlBuffer">_xmlBuffer</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-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-xmlIO.html#xmlRegisterHTTPPostCallbacks">xmlRegisterHTTPPostCallbacks</a><br />
<a href="html/libxml-tree.html#xmlSetBufferAllocationScheme">xmlSetBufferAllocationScheme</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderClose">xmlTextReaderClose</a><br />
@@ -251,7 +240,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>mixed-content</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementMixedContentDecl">xmlParseElementMixedContentDecl</a><br />
</dd><dt>mmap</dt><dd><a href="html/libxml-xmlIO.html#xmlParserInputBufferCreateStatic">xmlParserInputBufferCreateStatic</a><br />
</dd><dt>mod</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathModValues">xmlXPathModValues</a><br />
-</dd><dt>mode</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
+</dd><dt>mode</dt><dd><a href="html/libxml-tree.html#_xmlBuffer">_xmlBuffer</a><br />
+<a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-DOCBparser.html#docbCreatePushParserCtxt">docbCreatePushParserCtxt</a><br />
<a href="html/libxml-HTMLparser.html#htmlCreatePushParserCtxt">htmlCreatePushParserCtxt</a><br />
<a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
diff --git a/doc/APIchunk2.html b/doc/APIchunk2.html
index 214bf62..1923889 100644
--- a/doc/APIchunk2.html
+++ b/doc/APIchunk2.html
@@ -227,13 +227,11 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd></dl><h2>Letter E:</h2><dl><dt>ELEMENT</dt><dd><a href="html/libxml-tree.html#_xmlElementContent">_xmlElementContent</a><br />
</dd><dt>EMPTY</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a><br />
</dd><dt>ENTITIES</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateDtdFinal">xmlValidateDtdFinal</a><br />
</dd><dt>ENTITY</dt><dd><a href="html/libxml-HTMLparser.html#htmlParseEntityRef">htmlParseEntityRef</a><br />
<a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEntityValue">xmlParseEntityValue</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateDtdFinal">xmlValidateDtdFinal</a><br />
</dd><dt>ENTITY_REF</dt><dd><a href="html/libxml-tree.html#xmlNodeBufGetContent">xmlNodeBufGetContent</a><br />
<a href="html/libxml-tree.html#xmlNodeGetContent">xmlNodeGetContent</a><br />
@@ -322,7 +320,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlParsePEReference">xmlParsePEReference</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateOneAttribute">xmlValidateOneAttribute</a><br />
<a href="html/libxml-valid.html#xmlValidateOneNamespace">xmlValidateOneNamespace</a><br />
</dd><dt>EntityDecl</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityDecl">xmlParseEntityDecl</a><br />
diff --git a/doc/APIchunk20.html b/doc/APIchunk20.html
index 1f00aa3..3bd1894 100644
--- a/doc/APIchunk20.html
+++ b/doc/APIchunk20.html
@@ -73,6 +73,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
</dd><dt>naming</dt><dd><a href="html/libxml-tree.html#xmlChildrenNode">xmlChildrenNode</a><br />
<a href="html/libxml-tree.html#xmlRootNode">xmlRootNode</a><br />
+</dd><dt>nbBytes</dt><dd><a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
</dd><dt>nbval</dt><dd><a href="html/libxml-xmlregexp.html#xmlRegExecErrInfo">xmlRegExecErrInfo</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegExecNextValues">xmlRegExecNextValues</a><br />
</dd><dt>ncname</dt><dd><a href="html/libxml-tree.html#xmlBuildQName">xmlBuildQName</a><br />
@@ -120,10 +121,12 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlDOMWrapReconcileNamespaces">xmlDOMWrapReconcileNamespaces</a><br />
<a href="html/libxml-tree.html#xmlGetBufferAllocationScheme">xmlGetBufferAllocationScheme</a><br />
<a href="html/libxml-catalog.html#xmlLoadSGMLSuperCatalog">xmlLoadSGMLSuperCatalog</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-tree.html#xmlNewNodeEatName">xmlNewNodeEatName</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseElementMixedContentDecl">xmlParseElementMixedContentDecl</a><br />
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
<a href="html/libxml-tree.html#xmlSetBufferAllocationScheme">xmlSetBufferAllocationScheme</a><br />
<a href="html/libxml-debugXML.html#xmlShellPwd">xmlShellPwd</a><br />
<a href="html/libxml-xmlstring.html#xmlStrncat">xmlStrncat</a><br />
diff --git a/doc/APIchunk21.html b/doc/APIchunk21.html
index 05eab1d..cff8e69 100644
--- a/doc/APIchunk21.html
+++ b/doc/APIchunk21.html
@@ -67,6 +67,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-hash.html#xmlHashCreateDict">xmlHashCreateDict</a><br />
<a href="html/libxml-list.html#xmlListRemoveFirst">xmlListRemoveFirst</a><br />
<a href="html/libxml-list.html#xmlListRemoveLast">xmlListRemoveLast</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
</dd><dt>occurences</dt><dd><a href="html/libxml-xmlautomata.html#xmlAutomataNewCountTrans">xmlAutomataNewCountTrans</a><br />
<a href="html/libxml-xmlautomata.html#xmlAutomataNewCountTrans2">xmlAutomataNewCountTrans2</a><br />
<a href="html/libxml-xmlautomata.html#xmlAutomataNewOnceTrans">xmlAutomataNewOnceTrans</a><br />
@@ -233,6 +234,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#xmlDOMWrapReconcileNamespaces">xmlDOMWrapReconcileNamespaces</a><br />
<a href="html/libxml-tree.html#xmlGetLineNo">xmlGetLineNo</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
</dd><dt>options</dt><dd><a href="html/libxml-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a><br />
<a href="html/libxml-parser.html#xmlCtxtUseOptions">xmlCtxtUseOptions</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
@@ -241,6 +243,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlsave.html#xmlSaveToFd">xmlSaveToFd</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveToFilename">xmlSaveToFilename</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveToIO">xmlSaveToIO</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSchemaValidateCtxt">xmlTextReaderSchemaValidateCtxt</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetup">xmlTextReaderSetup</a><br />
<a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
@@ -272,6 +277,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-list.html#xmlListMerge">xmlListMerge</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEntityValue">xmlParseEntityValue</a><br />
<a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
<a href="html/libxml-debugXML.html#xmlShellSave">xmlShellSave</a><br />
<a href="html/libxml-xmlstring.html#xmlStrcat">xmlStrcat</a><br />
<a href="html/libxml-xmlstring.html#xmlStrncat">xmlStrncat</a><br />
diff --git a/doc/APIchunk22.html b/doc/APIchunk22.html
index 1fcc6c9..c84804c 100644
--- a/doc/APIchunk22.html
+++ b/doc/APIchunk22.html
@@ -170,7 +170,8 @@ 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-tree.html#xmlReplaceNode">xmlReplaceNode</a><br />
-</dd><dt>places</dt><dd><a href="html/libxml-xmlstring.html#xmlStrPrintf">xmlStrPrintf</a><br />
+</dd><dt>places</dt><dd><a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
+<a href="html/libxml-xmlstring.html#xmlStrPrintf">xmlStrPrintf</a><br />
<a href="html/libxml-xmlstring.html#xmlStrVPrintf">xmlStrVPrintf</a><br />
</dd><dt>plug</dt><dd><a href="html/libxml-xpath.html#xmlXPathFuncLookupFunc">xmlXPathFuncLookupFunc</a><br />
<a href="html/libxml-xpath.html#xmlXPathVariableLookupFunc">xmlXPathVariableLookupFunc</a><br />
@@ -184,6 +185,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</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-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
<a href="html/libxml-valid.html#xmlValidGetValidElements">xmlValidGetValidElements</a><br />
</dd><dt>points</dt><dd><a href="html/libxml-chvalid.html#_xmlChRangeGroup">_xmlChRangeGroup</a><br />
</dd><dt>pop</dt><dd><a href="html/libxml-parserInternals.html#xmlPopInput">xmlPopInput</a><br />
@@ -202,35 +205,6 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>positioned</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderReadString">xmlTextReaderReadString</a><br />
</dd><dt>positionned</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderReadAttributeValue">xmlTextReaderReadAttributeValue</a><br />
</dd><dt>positions</dt><dd><a href="html/libxml-xmlstring.html#xmlUTF8Strsub">xmlUTF8Strsub</a><br />
-</dd><dt>positive</dt><dd><a href="html/libxml-HTMLparser.html#UTF8ToHtml">UTF8ToHtml</a><br />
-<a href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a><br />
-<a href="html/libxml-DOCBparser.html#docbEncodeEntities">docbEncodeEntities</a><br />
-<a href="html/libxml-HTMLparser.html#htmlEncodeEntities">htmlEncodeEntities</a><br />
-<a href="html/libxml-encoding.html#isolat1ToUTF8">isolat1ToUTF8</a><br />
-<a href="html/libxml-tree.html#xmlBufferAdd">xmlBufferAdd</a><br />
-<a href="html/libxml-tree.html#xmlBufferAddHead">xmlBufferAddHead</a><br />
-<a href="html/libxml-tree.html#xmlBufferCCat">xmlBufferCCat</a><br />
-<a href="html/libxml-tree.html#xmlBufferCat">xmlBufferCat</a><br />
-<a href="html/libxml-encoding.html#xmlCharEncodingInputFunc">xmlCharEncodingInputFunc</a><br />
-<a href="html/libxml-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a><br />
-<a href="html/libxml-relaxng.html#xmlRelaxNGValidateDoc">xmlRelaxNGValidateDoc</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaCheckFacet">xmlSchemaCheckFacet</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValPredefTypeNode">xmlSchemaValPredefTypeNode</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValPredefTypeNodeNoNorm">xmlSchemaValPredefTypeNodeNoNorm</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateFacet">xmlSchemaValidateFacet</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateFacetWhtsp">xmlSchemaValidateFacetWhtsp</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateLengthFacet">xmlSchemaValidateLengthFacet</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateLengthFacetWhtsp">xmlSchemaValidateLengthFacetWhtsp</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateListSimpleTypeFacet">xmlSchemaValidateListSimpleTypeFacet</a><br />
-<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidatePredefinedType">xmlSchemaValidatePredefinedType</a><br />
-<a href="html/libxml-xmlreader.html#xmlTextReaderPreservePattern">xmlTextReaderPreservePattern</a><br />
-<a href="html/libxml-tree.html#xmlValidateNCName">xmlValidateNCName</a><br />
-<a href="html/libxml-tree.html#xmlValidateNMToken">xmlValidateNMToken</a><br />
-<a href="html/libxml-tree.html#xmlValidateName">xmlValidateName</a><br />
-<a href="html/libxml-tree.html#xmlValidateQName">xmlValidateQName</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathBooleanFunction">xmlXPathBooleanFunction</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathFloorFunction">xmlXPathFloorFunction</a><br />
-<a href="html/libxml-xpathInternals.html#xmlXPathStringFunction">xmlXPathStringFunction</a><br />
</dd><dt>possible</dt><dd><a href="html/libxml-tree.html#xmlCopyNodeList">xmlCopyNodeList</a><br />
<a href="html/libxml-parserInternals.html#xmlCreateEntityParserCtxt">xmlCreateEntityParserCtxt</a><br />
<a href="html/libxml-parserInternals.html#xmlParseDefaultDecl">xmlParseDefaultDecl</a><br />
@@ -256,6 +230,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>potential</dt><dd><a href="html/libxml-debugXML.html#xmlDebugCheckDocument">xmlDebugCheckDocument</a><br />
<a href="html/libxml-valid.html#xmlValidGetPotentialChildren">xmlValidGetPotentialChildren</a><br />
</dd><dt>potentially</dt><dd><a href="html/libxml-uri.html#_xmlURI">_xmlURI</a><br />
+</dd><dt>practice</dt><dd><a href="html/libxml-parserInternals.html#xmlParseVersionNum">xmlParseVersionNum</a><br />
</dd><dt>pre-interned</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
</dd><dt>preallocated</dt><dd><a href="html/libxml-tree.html#xmlBuildQName">xmlBuildQName</a><br />
</dd><dt>precede</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
@@ -281,6 +256,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-pattern.html#xmlPatternStreamable">xmlPatternStreamable</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegNewExecCtxt">xmlRegNewExecCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGNewValidCtxt">xmlRelaxNGNewValidCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaNewValidCtxt">xmlSchemaNewValidCtxt</a><br />
<a href="html/libxml-schematron.html#xmlSchematronNewValidCtxt">xmlSchematronNewValidCtxt</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderRelaxNGSetSchema">xmlTextReaderRelaxNGSetSchema</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetSchema">xmlTextReaderSetSchema</a><br />
@@ -453,6 +429,32 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>produced</dt><dd><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#IS_BASECHAR">IS_BASECHAR</a><br />
+<a href="html/libxml-parserInternals.html#IS_BLANK">IS_BLANK</a><br />
+<a href="html/libxml-parserInternals.html#IS_BYTE_CHAR">IS_BYTE_CHAR</a><br />
+<a href="html/libxml-parserInternals.html#IS_CHAR">IS_CHAR</a><br />
+<a href="html/libxml-parserInternals.html#IS_COMBINING">IS_COMBINING</a><br />
+<a href="html/libxml-parserInternals.html#IS_DIGIT">IS_DIGIT</a><br />
+<a href="html/libxml-parserInternals.html#IS_EXTENDER">IS_EXTENDER</a><br />
+<a href="html/libxml-parserInternals.html#IS_IDEOGRAPHIC">IS_IDEOGRAPHIC</a><br />
+<a href="html/libxml-parserInternals.html#IS_LETTER">IS_LETTER</a><br />
+<a href="html/libxml-parserInternals.html#IS_PUBIDCHAR">IS_PUBIDCHAR</a><br />
+<a href="html/libxml-parserInternals.html#xmlIsLetter">xmlIsLetter</a><br />
+<a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</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#xmlParseCharRef">xmlParseCharRef</a><br />
+<a href="html/libxml-parser.html#xmlParseCtxtExternalEntity">xmlParseCtxtExternalEntity</a><br />
+<a href="html/libxml-parser.html#xmlParseExtParsedEnt">xmlParseExtParsedEnt</a><br />
+<a href="html/libxml-parser.html#xmlParseExternalEntity">xmlParseExternalEntity</a><br />
+<a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
+<a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
+<a href="html/libxml-valid.html#xmlValidateNameValue">xmlValidateNameValue</a><br />
+<a href="html/libxml-valid.html#xmlValidateNamesValue">xmlValidateNamesValue</a><br />
+<a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
+<a href="html/libxml-valid.html#xmlValidateNmtokensValue">xmlValidateNmtokensValue</a><br />
+<a href="html/libxml-xpathInternals.html#xmlXPathIdFunction">xmlXPathIdFunction</a><br />
+<a href="html/libxml-xpathInternals.html#xmlXPathNormalizeFunction">xmlXPathNormalizeFunction</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 />
@@ -479,7 +481,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpath.html#xmlXPathIsNaN">xmlXPathIsNaN</a><br />
</dd><dt>prolog</dt><dd><a href="html/libxml-parser.html#xmlParseDocument">xmlParseDocument</a><br />
</dd><dt>prompt</dt><dd><a href="html/libxml-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a><br />
-</dd><dt>proper</dt><dd><a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
</dd><dt>properly</dt><dd><a href="html/libxml-parserInternals.html#xmlParseElementChildrenContentDecl">xmlParseElementChildrenContentDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseMarkupDecl">xmlParseMarkupDecl</a><br />
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
@@ -521,6 +522,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlIO.html#xmlOutputMatchCallback">xmlOutputMatchCallback</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFile">xmlSaveFormatFile</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFileEnc">xmlSaveFormatFileEnc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strloc">xmlUTF8Strloc</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strpos">xmlUTF8Strpos</a><br />
</dd><dt>provides</dt><dd><a href="html/libxml-parser.html#endElementNsSAX2Func">endElementNsSAX2Func</a><br />
diff --git a/doc/APIchunk23.html b/doc/APIchunk23.html
index 4d76cc6..b7b26c2 100644
--- a/doc/APIchunk23.html
+++ b/doc/APIchunk23.html
@@ -118,7 +118,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>read-only</dt><dd><a href="html/libxml-dict.html#xmlDictCreateSub">xmlDictCreateSub</a><br />
</dd><dt>readable</dt><dd><a href="html/libxml-xmlstring.html#xmlStrEqual">xmlStrEqual</a><br />
</dd><dt>reader-</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
-</dd><dt>reading</dt><dd><a href="html/libxml-debugXML.html#xmlShell">xmlShell</a><br />
+</dd><dt>reading</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
+<a href="html/libxml-debugXML.html#xmlShell">xmlShell</a><br />
</dd><dt>ready</dt><dd><a href="html/libxml-parserInternals.html#INPUT_CHUNK">INPUT_CHUNK</a><br />
<a href="html/libxml-xmlautomata.html#xmlAutomataCompile">xmlAutomataCompile</a><br />
</dd><dt>realloc</dt><dd><a href="html/libxml-tree.html#_xmlBuffer">_xmlBuffer</a><br />
@@ -238,32 +239,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewCharRef">xmlNewCharRef</a><br />
</dd><dt>referenced</dt><dd><a href="html/libxml-list.html#xmlLinkGetData">xmlLinkGetData</a><br />
<a href="html/libxml-parserInternals.html#xmlParseAttValue">xmlParseAttValue</a><br />
-</dd><dt>references</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ATTRGROUP_HAS_REFS">XML_SCHEMAS_ATTRGROUP_HAS_REFS</a><br />
-<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ATTR_INTERNAL_RESOLVED">XML_SCHEMAS_ATTR_INTERNAL_RESOLVED</a><br />
-<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_CIRCULAR">XML_SCHEMAS_ELEM_CIRCULAR</a><br />
-<a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ELEM_INTERNAL_RESOLVED">XML_SCHEMAS_ELEM_INTERNAL_RESOLVED</a><br />
-<a href="html/libxml-HTMLparser.html#htmlParseEntityRef">htmlParseEntityRef</a><br />
-<a href="html/libxml-valid.html#xmlGetRefs">xmlGetRefs</a><br />
-<a href="html/libxml-catalog.html#xmlLoadSGMLSuperCatalog">xmlLoadSGMLSuperCatalog</a><br />
-<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#xmlNodeAddContent">xmlNodeAddContent</a><br />
-<a href="html/libxml-tree.html#xmlNodeAddContentLen">xmlNodeAddContentLen</a><br />
-<a href="html/libxml-tree.html#xmlNodeBufGetContent">xmlNodeBufGetContent</a><br />
-<a href="html/libxml-tree.html#xmlNodeGetContent">xmlNodeGetContent</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#xmlParseAttribute">xmlParseAttribute</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseCharRef">xmlParseCharRef</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseMarkupDecl">xmlParseMarkupDecl</a><br />
-<a href="html/libxml-parserInternals.html#xmlParsePEReference">xmlParsePEReference</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseReference">xmlParseReference</a><br />
-<a href="html/libxml-parserInternals.html#xmlParseSDDecl">xmlParseSDDecl</a><br />
-<a href="html/libxml-parserInternals.html#xmlParserHandlePEReference">xmlParserHandlePEReference</a><br />
-<a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
-<a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
</dd><dt>referencing</dt><dd><a href="html/libxml-entities.html#xmlGetDocEntity">xmlGetDocEntity</a><br />
<a href="html/libxml-entities.html#xmlGetDtdEntity">xmlGetDtdEntity</a><br />
<a href="html/libxml-entities.html#xmlGetParameterEntity">xmlGetParameterEntity</a><br />
@@ -305,7 +280,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameDefault">xmlOutputBufferCreateFilenameDefault</a><br />
<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a><br />
<a href="html/libxml-globals.html#xmlRegisterNodeDefault">xmlRegisterNodeDefault</a><br />
+<a href="html/libxml-globals.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a><br />
</dd><dt>regular</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_REGEXP_ENABLED">LIBXML_REGEXP_ENABLED</a><br />
+<a href="html/libxml-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegFreeExecCtxt">xmlRegFreeExecCtxt</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegNewExecCtxt">xmlRegNewExecCtxt</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegexpCompile">xmlRegexpCompile</a><br />
@@ -331,9 +308,9 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlreader.html#xmlTextReaderMoveToAttributeNo">xmlTextReaderMoveToAttributeNo</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strloc">xmlUTF8Strloc</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Strsub">xmlUTF8Strsub</a><br />
-</dd><dt>relativeURI</dt><dd><a href="html/libxml-uri.html#xmlParseURI">xmlParseURI</a><br />
-<a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
+</dd><dt>relative-ref</dt><dd><a href="html/libxml-uri.html#xmlParseURIRaw">xmlParseURIRaw</a><br />
<a href="html/libxml-uri.html#xmlParseURIReference">xmlParseURIReference</a><br />
+</dd><dt>relativeURI</dt><dd><a href="html/libxml-uri.html#xmlParseURI">xmlParseURI</a><br />
</dd><dt>release</dt><dd><a href="html/libxml-parser.html#xmlClearNodeInfoSeq">xmlClearNodeInfoSeq</a><br />
<a href="html/libxml-parser.html#xmlClearParserCtxt">xmlClearParserCtxt</a><br />
<a href="html/libxml-parserInternals.html#xmlDecodeEntities">xmlDecodeEntities</a><br />
@@ -406,6 +383,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-hash.html#xmlHashUpdateEntry2">xmlHashUpdateEntry2</a><br />
<a href="html/libxml-hash.html#xmlHashUpdateEntry3">xmlHashUpdateEntry3</a><br />
<a href="html/libxml-tree.html#xmlNewTextChild">xmlNewTextChild</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathTranslateFunction">xmlXPathTranslateFunction</a><br />
</dd><dt>replacement</dt><dd><a href="html/libxml-catalog.html#xmlACatalogAdd">xmlACatalogAdd</a><br />
<a href="html/libxml-catalog.html#xmlCatalogAdd">xmlCatalogAdd</a><br />
@@ -453,6 +431,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#xmlHasFeature">xmlHasFeature</a><br />
<a href="html/libxml-valid.html#xmlIsID">xmlIsID</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a><br />
</dd><dt>requests</dt><dd><a href="html/libxml-xmlIO.html#xmlRegisterHTTPPostCallbacks">xmlRegisterHTTPPostCallbacks</a><br />
</dd><dt>required</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ATTR_USE_REQUIRED">XML_SCHEMAS_ATTR_USE_REQUIRED</a><br />
@@ -514,6 +493,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGFreeParserCtxt">xmlRelaxNGFreeParserCtxt</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGFreeValidCtxt">xmlRelaxNGFreeValidCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaFreeParserCtxt">xmlSchemaFreeParserCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaFreeValidCtxt">xmlSchemaFreeValidCtxt</a><br />
<a href="html/libxml-schematron.html#xmlSchematronFreeParserCtxt">xmlSchematronFreeParserCtxt</a><br />
<a href="html/libxml-schematron.html#xmlSchematronFreeValidCtxt">xmlSchematronFreeValidCtxt</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderClose">xmlTextReaderClose</a><br />
@@ -522,13 +502,15 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNodeSetContentLen">xmlNodeSetContentLen</a><br />
</dd><dt>respect</dt><dd><a href="html/libxml-xmlregexp.html#xmlExpStringDerive">xmlExpStringDerive</a><br />
</dd><dt>respecting</dt><dd><a href="html/libxml-valid.html#xmlValidGetValidElements">xmlValidGetValidElements</a><br />
+</dd><dt>responsability</dt><dd><a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
</dd><dt>response</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPCheckResponse">xmlNanoFTPCheckResponse</a><br />
<a href="html/libxml-nanoftp.html#xmlNanoFTPGetResponse">xmlNanoFTPGetResponse</a><br />
<a href="html/libxml-nanohttp.html#xmlNanoHTTPContentLength">xmlNanoHTTPContentLength</a><br />
</dd><dt>responsible</dt><dd><a href="html/libxml-c14n.html#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a><br />
<a href="html/libxml-uri.html#xmlCanonicPath">xmlCanonicPath</a><br />
<a href="html/libxml-uri.html#xmlPathToURI">xmlPathToURI</a><br />
-</dd><dt>restored</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
+</dd><dt>restored</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
</dd><dt>restrict</dt><dd><a href="html/libxml-parserInternals.html#xmlParseExternalID">xmlParseExternalID</a><br />
</dd><dt>restriction</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION">XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION</a><br />
@@ -636,6 +618,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>running</dt><dd><a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
</dd><dt>runtime</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_DEBUG_RUNTIME">LIBXML_DEBUG_RUNTIME</a><br />
<a href="html/libxml-parserInternals.html#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
</dd></dl><h2 align="center"><a href="APIchunk0.html">A-B</a>
<a href="APIchunk1.html">C-C</a>
<a href="APIchunk2.html">D-E</a>
diff --git a/doc/APIchunk24.html b/doc/APIchunk24.html
index 0a798e6..83f5111 100644
--- a/doc/APIchunk24.html
+++ b/doc/APIchunk24.html
@@ -128,8 +128,11 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlschemastypes.html#xmlSchemaGetFacetValueAsULong">xmlSchemaGetFacetValueAsULong</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaGetValType">xmlSchemaGetValType</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaNewMemParserCtxt">xmlSchemaNewMemParserCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateFacet">xmlSchemaValidateFacet</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateFacetWhtsp">xmlSchemaValidateFacetWhtsp</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
<a href="html/libxml-schematron.html#xmlSchematronNewMemParserCtxt">xmlSchematronNewMemParserCtxt</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSchemaValidate">xmlTextReaderSchemaValidate</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSchemaValidateCtxt">xmlTextReaderSchemaValidateCtxt</a><br />
@@ -266,6 +269,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>setting</dt><dd><a href="html/libxml-xmlerror.html#xmlSetGenericErrorFunc">xmlSetGenericErrorFunc</a><br />
<a href="html/libxml-xpath.html#xmlXPathContextSetCache">xmlXPathContextSetCache</a><br />
</dd><dt>setups</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEncodingDecl">xmlParseEncodingDecl</a><br />
+</dd><dt>severity</dt><dd><a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
</dd><dt>sgmlsource</dt><dd><a href="html/libxml-SAX.html#getSystemId">getSystemId</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2GetSystemId">xmlSAX2GetSystemId</a><br />
</dd><dt>shadowed</dt><dd><a href="html/libxml-tree.html#xmlDOMWrapAdoptNode">xmlDOMWrapAdoptNode</a><br />
@@ -448,6 +452,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#xmlCopyError">xmlCopyError</a><br />
<a href="html/libxml-parser.html#xmlCtxtReadIO">xmlCtxtReadIO</a><br />
<a href="html/libxml-xmlreader.html#xmlNewTextReader">xmlNewTextReader</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-parser.html#xmlReadIO">xmlReadIO</a><br />
<a href="html/libxml-xmlreader.html#xmlReaderForIO">xmlReaderForIO</a><br />
<a href="html/libxml-xmlreader.html#xmlReaderNewIO">xmlReaderNewIO</a><br />
@@ -584,6 +589,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewCharRef">xmlNewCharRef</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveTree">xmlSaveTree</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />
<a href="html/libxml-xpath.html#xmlXPathOrderDocElems">xmlXPathOrderDocElems</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
<a href="html/libxml-xpointer.html#xmlXPtrNewCollapsedRange">xmlXPtrNewCollapsedRange</a><br />
@@ -674,6 +680,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlstring.html#xmlStrdup">xmlStrdup</a><br />
<a href="html/libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a><br />
</dd><dt>streamable</dt><dd><a href="html/libxml-pattern.html#xmlPatternStreamable">xmlPatternStreamable</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
</dd><dt>streaming</dt><dd><a href="html/libxml-pattern.html#xmlPatternGetStreamCtxt">xmlPatternGetStreamCtxt</a><br />
<a href="html/libxml-pattern.html#xmlStreamWantsAnyNode">xmlStreamWantsAnyNode</a><br />
</dd><dt>streams</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
@@ -721,6 +728,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlschemastypes.html#xmlSchemaNewStringValue">xmlSchemaNewStringValue</a><br />
</dd><dt>structured</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGSetValidStructuredErrors">xmlRelaxNGSetValidStructuredErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
<a href="html/libxml-schematron.html#xmlSchematronSetValidStructuredErrors">xmlSchematronSetValidStructuredErrors</a><br />
<a href="html/libxml-xmlerror.html#xmlSetStructuredErrorFunc">xmlSetStructuredErrorFunc</a><br />
</dd><dt>structures</dt><dd><a href="html/libxml-tree.html#xmlFreeDoc">xmlFreeDoc</a><br />
@@ -793,6 +801,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlReconciliateNs">xmlReconciliateNs</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGValidateFullElement">xmlRelaxNGValidateFullElement</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveTree">xmlSaveTree</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />
<a href="html/libxml-debugXML.html#xmlShellDu">xmlShellDu</a><br />
<a href="html/libxml-debugXML.html#xmlShellWrite">xmlShellWrite</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderExpand">xmlTextReaderExpand</a><br />
@@ -861,6 +870,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>suffix</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a><br />
</dd><dt>suggested</dt><dd><a href="html/libxml-HTMLparser.html#_htmlElemDesc">_htmlElemDesc</a><br />
</dd><dt>suitable</dt><dd><a href="html/libxml-parser.html#xmlNewIOInputStream">xmlNewIOInputStream</a><br />
+<a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegexpCompile">xmlRegexpCompile</a><br />
</dd><dt>sum</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathSumFunction">xmlXPathSumFunction</a><br />
diff --git a/doc/APIchunk25.html b/doc/APIchunk25.html
index aa590d2..2dce6a0 100644
--- a/doc/APIchunk25.html
+++ b/doc/APIchunk25.html
@@ -216,6 +216,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-threads.html#xmlMutexLock">xmlMutexLock</a><br />
<a href="html/libxml-threads.html#xmlMutexUnlock">xmlMutexUnlock</a><br />
<a href="html/libxml-threads.html#xmlNewMutex">xmlNewMutex</a><br />
+<a href="html/libxml-xmlregexp.html#xmlRegExecCallbacks">xmlRegExecCallbacks</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegExecPushString">xmlRegExecPushString</a><br />
<a href="html/libxml-xmlregexp.html#xmlRegExecPushString2">xmlRegExecPushString2</a><br />
</dd><dt>token_r</dt><dd><a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
@@ -400,6 +401,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlHasProp">xmlHasProp</a><br />
<a href="html/libxml-parser.html#xmlLineNumbersDefault">xmlLineNumbersDefault</a><br />
</dd><dt>two</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlstring.html#xmlStrncatNew">xmlStrncatNew</a><br />
<a href="html/libxml-tree.html#xmlTextMerge">xmlTextMerge</a><br />
<a href="html/libxml-xmlstring.html#xmlUTF8Charcmp">xmlUTF8Charcmp</a><br />
@@ -421,7 +423,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlschemastypes.html#xmlSchemaNewStringValue">xmlSchemaNewStringValue</a><br />
<a href="html/libxml-xmlschemastypes.html#xmlSchemaValidateFacetWhtsp">xmlSchemaValidateFacetWhtsp</a><br />
<a href="html/libxml-pattern.html#xmlStreamWantsAnyNode">xmlStreamWantsAnyNode</a><br />
-</dd><dt>typo</dt><dd><a href="html/libxml-parserInternals.html#xmlParseTextDecl">xmlParseTextDecl</a><br />
</dd></dl><h2 align="center"><a href="APIchunk0.html">A-B</a>
<a href="APIchunk1.html">C-C</a>
<a href="APIchunk2.html">D-E</a>
diff --git a/doc/APIchunk26.html b/doc/APIchunk26.html
index ed2a00d..4fca766 100644
--- a/doc/APIchunk26.html
+++ b/doc/APIchunk26.html
@@ -107,6 +107,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>unlinked</dt><dd><a href="html/libxml-tree.html#xmlAddNextSibling">xmlAddNextSibling</a><br />
<a href="html/libxml-tree.html#xmlAddPrevSibling">xmlAddPrevSibling</a><br />
<a href="html/libxml-tree.html#xmlAddSibling">xmlAddSibling</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-tree.html#xmlReplaceNode">xmlReplaceNode</a><br />
</dd><dt>unload</dt><dd><a href="html/libxml-xmlmodule.html#xmlModuleClose">xmlModuleClose</a><br />
<a href="html/libxml-xmlmodule.html#xmlModuleFree">xmlModuleFree</a><br />
@@ -121,6 +122,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
<a href="html/libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2UnparsedEntityDecl">xmlSAX2UnparsedEntityDecl</a><br />
+</dd><dt>unplug</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
</dd><dt>unpredictable</dt><dd><a href="html/libxml-HTMLparser.html#UTF8ToHtml">UTF8ToHtml</a><br />
<a href="html/libxml-encoding.html#UTF8Toisolat1">UTF8Toisolat1</a><br />
<a href="html/libxml-DOCBparser.html#docbEncodeEntities">docbEncodeEntities</a><br />
@@ -155,6 +157,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpath.html#_xmlXPathContext">_xmlXPathContext</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapReconcileNamespaces">xmlDOMWrapReconcileNamespaces</a><br />
<a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
<a href="html/libxml-debugXML.html#xmlShellBase">xmlShellBase</a><br />
<a href="html/libxml-debugXML.html#xmlShellCat">xmlShellCat</a><br />
<a href="html/libxml-debugXML.html#xmlShellDir">xmlShellDir</a><br />
@@ -190,6 +193,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-schemasInternals.html#_xmlSchemaElement">_xmlSchemaElement</a><br />
</dd><dt>useful</dt><dd><a href="html/libxml-xmlmemory.html#xmlGcMemGet">xmlGcMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlGcMemSetup">xmlGcMemSetup</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-threads.html#xmlNewRMutex">xmlNewRMutex</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferCreateStatic">xmlParserInputBufferCreateStatic</a><br />
</dd><dt>useless</dt><dd><a href="html/libxml-SAX.html#setDocumentLocator">setDocumentLocator</a><br />
@@ -275,6 +279,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>view</dt><dd><a href="html/libxml-debugXML.html#xmlShell">xmlShell</a><br />
</dd><dt>violated</dt><dd><a href="html/libxml-hash.html#XML_CAST_FPTR">XML_CAST_FPTR</a><br />
</dd><dt>visible</dt><dd><a href="html/libxml-c14n.html#xmlC14NExecute">xmlC14NExecute</a><br />
+<a href="html/libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a><br />
</dd><dt>void</dt><dd><a href="html/libxml-hash.html#XML_CAST_FPTR">XML_CAST_FPTR</a><br />
<a href="html/libxml-parser.html#xmlSAXParseFileWithData">xmlSAXParseFileWithData</a><br />
<a href="html/libxml-parser.html#xmlSAXParseMemoryWithData">xmlSAXParseMemoryWithData</a><br />
diff --git a/doc/APIchunk27.html b/doc/APIchunk27.html
index d2272eb..d9fe323 100644
--- a/doc/APIchunk27.html
+++ b/doc/APIchunk27.html
@@ -62,9 +62,14 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGGetValidErrors">xmlRelaxNGGetValidErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGSetParserErrors">xmlRelaxNGSetParserErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidErrors">xmlRelaxNGSetValidErrors</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2InitDefaultSAXHandler">xmlSAX2InitDefaultSAXHandler</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaGetParserErrors">xmlSchemaGetParserErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaSetParserErrors">xmlSchemaSetParserErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a><br />
+<a href="html/libxml-schematron.html#xmlSchematronValidityWarningFunc">xmlSchematronValidityWarningFunc</a><br />
<a href="html/libxml-tree.html#xmlSearchNs">xmlSearchNs</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a><br />
@@ -115,6 +120,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlCheckLanguageID">xmlCheckLanguageID</a><br />
<a href="html/libxml-parser.html#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaIsValid">xmlSchemaIsValid</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessFlags">xmlXIncludeProcessFlags</a><br />
<a href="html/libxml-xinclude.html#xmlXIncludeProcessFlagsData">xmlXIncludeProcessFlagsData</a><br />
@@ -143,6 +149,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewNs">xmlNewNs</a><br />
<a href="html/libxml-parserInternals.html#xmlParseMarkupDecl">xmlParseMarkupDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseSDDecl">xmlParseSDDecl</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
</dd><dt>while</dt><dd><a href="html/libxml-encoding.html#xmlInitCharEncodingHandlers">xmlInitCharEncodingHandlers</a><br />
<a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEnumeratedType">xmlParseEnumeratedType</a><br />
@@ -268,6 +275,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlIO.html#xmlIOFTPRead">xmlIOFTPRead</a><br />
<a href="html/libxml-xmlIO.html#xmlIOHTTPRead">xmlIOHTTPRead</a><br />
<a href="html/libxml-encoding.html#xmlNewCharEncodingHandler">xmlNewCharEncodingHandler</a><br />
+<a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferCreateIO">xmlOutputBufferCreateIO</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveToIO">xmlSaveToIO</a><br />
diff --git a/doc/APIchunk28.html b/doc/APIchunk28.html
index bc198ee..5fbd28f 100644
--- a/doc/APIchunk28.html
+++ b/doc/APIchunk28.html
@@ -98,6 +98,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>xml:space</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-tree.html#xmlNodeGetSpacePreserve">xmlNodeGetSpacePreserve</a><br />
<a href="html/libxml-tree.html#xmlNodeSetSpacePreserve">xmlNodeSetSpacePreserve</a><br />
+</dd><dt>xmlAddDocEntity</dt><dd><a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
</dd><dt>xmlAttr</dt><dd><a href="html/libxml-SAX.html#attribute">attribute</a><br />
<a href="html/libxml-parser.html#attributeSAXFunc">attributeSAXFunc</a><br />
</dd><dt>xmlAttrPtr</dt><dd><a href="html/libxml-tree.html#xmlCopyProp">xmlCopyProp</a><br />
@@ -141,6 +142,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>xmlDoc</dt><dd><a href="html/libxml-tree.html#_xmlNs">_xmlNs</a><br />
</dd><dt>xmlDocCopyNodeList</dt><dd><a href="html/libxml-tree.html#xmlCopyNodeList">xmlCopyNodeList</a><br />
</dd><dt>xmlDocNewPI</dt><dd><a href="html/libxml-tree.html#xmlNewPI">xmlNewPI</a><br />
+</dd><dt>xmlDocProperties</dt><dd><a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
</dd><dt>xmlDocPtr</dt><dd><a href="html/libxml-tree.html#xmlCopyDoc">xmlCopyDoc</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a><br />
@@ -312,6 +314,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>xmlOutputBufferClose</dt><dd><a href="html/libxml-tree.html#xmlSaveFileTo">xmlSaveFileTo</a><br />
<a href="html/libxml-tree.html#xmlSaveFormatFileTo">xmlSaveFormatFileTo</a><br />
</dd><dt>xmlOutputBufferPtr</dt><dd><a href="html/libxml-xmlwriter.html#xmlNewTextWriter">xmlNewTextWriter</a><br />
+<a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
</dd><dt>xmlOutputCloseCallback</dt><dd><a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
</dd><dt>xmlOutputMatchCallback</dt><dd><a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
</dd><dt>xmlOutputOpenCallback</dt><dd><a href="html/libxml-xmlIO.html#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a><br />
@@ -336,6 +339,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>xmlParserFindNodeInfoIndex</dt><dd><a href="html/libxml-parser.html#xmlParserFindNodeInfoIndex">xmlParserFindNodeInfoIndex</a><br />
</dd><dt>xmlParserHandleReference</dt><dd><a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
</dd><dt>xmlParserInputBufferPtr</dt><dd><a href="html/libxml-xmlreader.html#xmlNewTextReader">xmlNewTextReader</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderGetRemainder">xmlTextReaderGetRemainder</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetup">xmlTextReaderSetup</a><br />
</dd><dt>xmlParserInputPtr</dt><dd><a href="html/libxml-SAX.html#resolveEntity">resolveEntity</a><br />
@@ -401,12 +405,15 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>xmlSAX2StartDocument</dt><dd><a href="html/libxml-SAX.html#startDocument">startDocument</a><br />
</dd><dt>xmlSAX2StartElement</dt><dd><a href="html/libxml-SAX.html#startElement">startElement</a><br />
</dd><dt>xmlSAX2UnparsedEntityDecl</dt><dd><a href="html/libxml-SAX.html#unparsedEntityDecl">unparsedEntityDecl</a><br />
+</dd><dt>xmlSAXHandlerPtr</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
</dd><dt>xmlSAXVersion</dt><dd><a href="html/libxml-SAX2.html#xmlSAXDefaultVersion">xmlSAXDefaultVersion</a><br />
</dd><dt>xmlSaveOptions</dt><dd><a href="html/libxml-xmlsave.html#xmlSaveToBuffer">xmlSaveToBuffer</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveToFd">xmlSaveToFd</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveToFilename">xmlSaveToFilename</a><br />
<a href="html/libxml-xmlsave.html#xmlSaveToIO">xmlSaveToIO</a><br />
+</dd><dt>xmlSchemaSAXPlug</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
</dd><dt>xmlSchemaValType</dt><dd><a href="html/libxml-xmlschemastypes.html#xmlSchemaGetValType">xmlSchemaGetValType</a><br />
+</dd><dt>xmlSchemaValidOption</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
</dd><dt>xmlSchematronValidOptions</dt><dd><a href="html/libxml-schematron.html#xmlSchematronNewValidCtxt">xmlSchematronNewValidCtxt</a><br />
</dd><dt>xmlSetExternalEntityLoader</dt><dd><a href="html/libxml-SAX.html#resolveEntity">resolveEntity</a><br />
<a href="html/libxml-parser.html#resolveEntitySAXFunc">resolveEntitySAXFunc</a><br />
diff --git a/doc/APIchunk3.html b/doc/APIchunk3.html
index e8d2266..3f5646a 100644
--- a/doc/APIchunk3.html
+++ b/doc/APIchunk3.html
@@ -192,14 +192,12 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlIO.html#xmlParserInputBufferRead">xmlParserInputBufferRead</a><br />
</dd><dt>IDREF</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
<a href="html/libxml-valid.html#xmlValidateAttributeDecl">xmlValidateAttributeDecl</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br />
<a href="html/libxml-valid.html#xmlValidateDtd">xmlValidateDtd</a><br />
<a href="html/libxml-valid.html#xmlValidateOneAttribute">xmlValidateOneAttribute</a><br />
<a href="html/libxml-valid.html#xmlValidateOneElement">xmlValidateOneElement</a><br />
<a href="html/libxml-valid.html#xmlValidateOneNamespace">xmlValidateOneNamespace</a><br />
</dd><dt>IDREFS</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a><br />
</dd><dt>IDREFs</dt><dd><a href="html/libxml-tree.html#_xmlDoc">_xmlDoc</a><br />
</dd><dt>IDs</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathIdFunction">xmlXPathIdFunction</a><br />
diff --git a/doc/APIchunk4.html b/doc/APIchunk4.html
index b954f38..924c236 100644
--- a/doc/APIchunk4.html
+++ b/doc/APIchunk4.html
@@ -182,9 +182,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>NDataDecl</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityDecl">xmlParseEntityDecl</a><br />
</dd><dt>NDataDecl?</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityDecl">xmlParseEntityDecl</a><br />
</dd><dt>NMTOKEN</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
</dd><dt>NMTOKENS</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
</dd><dt>NMToken</dt><dd><a href="html/libxml-tree.html#xmlValidateNMToken">xmlValidateNMToken</a><br />
</dd><dt>NOTATION</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEnumeratedType">xmlParseEnumeratedType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseNotationType">xmlParseNotationType</a><br />
@@ -234,7 +232,6 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>Names</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseName">xmlParseName</a><br />
<a href="html/libxml-parserInternals.html#xmlScanName">xmlScanName</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNamesValue">xmlValidateNamesValue</a><br />
</dd><dt>Namespace</dt><dd><a href="html/libxml-tree.html#XML_XML_NAMESPACE">XML_XML_NAMESPACE</a><br />
<a href="html/libxml-tree.html#_xmlElementContent">_xmlElementContent</a><br />
@@ -251,11 +248,9 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>Nmtoken</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEnumerationType">xmlParseEnumerationType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseNmtoken">xmlParseNmtoken</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
</dd><dt>Nmtokens</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseNmtoken">xmlParseNmtoken</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNmtokensValue">xmlValidateNmtokensValue</a><br />
</dd><dt>Node</dt><dd><a href="html/libxml-parser.html#_xmlParserCtxt">_xmlParserCtxt</a><br />
<a href="html/libxml-valid.html#_xmlValidCtxt">_xmlValidCtxt</a><br />
diff --git a/doc/APIchunk5.html b/doc/APIchunk5.html
index 72067ed..0c4f510 100644
--- a/doc/APIchunk5.html
+++ b/doc/APIchunk5.html
@@ -153,6 +153,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>People</dt><dd><a href="html/libxml-entities.html#xmlEncodeEntities">xmlEncodeEntities</a><br />
</dd><dt>PhoneticExtensions</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsPhoneticExtensions">xmlUCSIsPhoneticExtensions</a><br />
</dd><dt>Please</dt><dd><a href="html/libxml-xmlIO.html#xmlNormalizeWindowsPath">xmlNormalizeWindowsPath</a><br />
+</dd><dt>Plug</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a><br />
</dd><dt>Pointer</dt><dd><a href="html/libxml-xmlstring.html#xmlCheckUTF8">xmlCheckUTF8</a><br />
</dd><dt>Points</dt><dd><a href="html/libxml-xpointer.html#xmlXPtrNewRangePoints">xmlXPtrNewRangePoints</a><br />
</dd><dt>Pop</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxNGValidatePopElement">xmlRelaxNGValidatePopElement</a><br />
diff --git a/doc/APIchunk6.html b/doc/APIchunk6.html
index 6e4a169..f598093 100644
--- a/doc/APIchunk6.html
+++ b/doc/APIchunk6.html
@@ -61,7 +61,6 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>Query</dt><dd><a href="html/libxml-dict.html#xmlDictSize">xmlDictSize</a><br />
<a href="html/libxml-hash.html#xmlHashSize">xmlHashSize</a><br />
<a href="html/libxml-pattern.html#xmlStreamWantsAnyNode">xmlStreamWantsAnyNode</a><br />
-</dd><dt>Question:</dt><dd><a href="html/libxml-parserInternals.html#xmlParseTextDecl">xmlParseTextDecl</a><br />
</dd></dl><h2>Letter R:</h2><dl><dt>REC</dt><dd><a href="html/libxml-parserInternals.html#IS_BASECHAR">IS_BASECHAR</a><br />
<a href="html/libxml-parserInternals.html#IS_COMBINING">IS_COMBINING</a><br />
<a href="html/libxml-parserInternals.html#IS_DIGIT">IS_DIGIT</a><br />
@@ -75,6 +74,8 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>RFC</dt><dd><a href="html/libxml-uri.html#xmlBuildURI">xmlBuildURI</a><br />
<a href="html/libxml-tree.html#xmlNodeGetBase">xmlNodeGetBase</a><br />
<a href="html/libxml-uri.html#xmlNormalizeURIPath">xmlNormalizeURIPath</a><br />
+<a href="html/libxml-uri.html#xmlParseURI">xmlParseURI</a><br />
+<a href="html/libxml-uri.html#xmlParseURIReference">xmlParseURIReference</a><br />
</dd><dt>RFC2396</dt><dd><a href="html/libxml-uri.html#xmlURIEscape">xmlURIEscape</a><br />
</dd><dt>Raises</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathSetArityError">xmlXPathSetArityError</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathSetError">xmlXPathSetError</a><br />
@@ -176,6 +177,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidErrors">xmlRelaxNGSetValidErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGSetValidStructuredErrors">xmlRelaxNGSetValidStructuredErrors</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGValidateDoc">xmlRelaxNGValidateDoc</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a><br />
</dd><dt>RelaxNG</dt><dd><a href="html/libxml-schemasInternals.html#_xmlSchemaElement">_xmlSchemaElement</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGCleanupTypes">xmlRelaxNGCleanupTypes</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGDump">xmlRelaxNGDump</a><br />
diff --git a/doc/APIchunk7.html b/doc/APIchunk7.html
index df878bf..f9550fc 100644
--- a/doc/APIchunk7.html
+++ b/doc/APIchunk7.html
@@ -50,6 +50,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-SAX2.html#xmlSAX2InitDocbDefaultSAXHandler">xmlSAX2InitDocbDefaultSAXHandler</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2InitHtmlDefaultSAXHandler">xmlSAX2InitHtmlDefaultSAXHandler</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2StartElementNs">xmlSAX2StartElementNs</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
</dd><dt>SAX::substituteEntities</dt><dd><a href="html/libxml-parser.html#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a><br />
</dd><dt>SDDecl</dt><dd><a href="html/libxml-parserInternals.html#xmlParseSDDecl">xmlParseSDDecl</a><br />
</dd><dt>SDDecl?</dt><dd><a href="html/libxml-parserInternals.html#xmlParseXMLDecl">xmlParseXMLDecl</a><br />
@@ -119,10 +120,13 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlschemas.html#xmlSchemaNewDocParserCtxt">xmlSchemaNewDocParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaNewMemParserCtxt">xmlSchemaNewMemParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaNewParserCtxt">xmlSchemaNewParserCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaNewValidCtxt">xmlSchemaNewValidCtxt</a><br />
</dd><dt>Schematron</dt><dd><a href="html/libxml-xmlversion.html#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a><br />
<a href="html/libxml-schematron.html#xmlSchematronFree">xmlSchematronFree</a><br />
<a href="html/libxml-schematron.html#xmlSchematronParse">xmlSchematronParse</a><br />
<a href="html/libxml-schematron.html#xmlSchematronSetValidStructuredErrors">xmlSchematronSetValidStructuredErrors</a><br />
+<a href="html/libxml-schematron.html#xmlSchematronValidityErrorFunc">xmlSchematronValidityErrorFunc</a><br />
+<a href="html/libxml-schematron.html#xmlSchematronValidityWarningFunc">xmlSchematronValidityWarningFunc</a><br />
</dd><dt>Schematrons</dt><dd><a href="html/libxml-schematron.html#xmlSchematronNewDocParserCtxt">xmlSchematronNewDocParserCtxt</a><br />
<a href="html/libxml-schematron.html#xmlSchematronNewMemParserCtxt">xmlSchematronNewMemParserCtxt</a><br />
<a href="html/libxml-schematron.html#xmlSchematronNewParserCtxt">xmlSchematronNewParserCtxt</a><br />
@@ -163,13 +167,13 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-list.html#xmlLinkGetData">xmlLinkGetData</a><br />
<a href="html/libxml-parserInternals.html#xmlParseNotationDecl">xmlParseNotationDecl</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderByteConsumed">xmlTextReaderByteConsumed</a><br />
-</dd><dt>Seems</dt><dd><a href="html/libxml-parserInternals.html#xmlParseTextDecl">xmlParseTextDecl</a><br />
</dd><dt>Semi</dt><dd><a href="html/libxml-relaxng.html#xmlRelaxParserSetFlag">xmlRelaxParserSetFlag</a><br />
</dd><dt>Send</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPQuit">xmlNanoFTPQuit</a><br />
</dd><dt>Serialize</dt><dd><a href="html/libxml-tree.html#xmlAttrSerializeTxtContent">xmlAttrSerializeTxtContent</a><br />
<a href="html/libxml-xmlregexp.html#xmlExpDump">xmlExpDump</a><br />
</dd><dt>Sets</dt><dd><a href="html/libxml-HTMLtree.html#htmlSetMetaEncoding">htmlSetMetaEncoding</a><br />
<a href="html/libxml-tree.html#xmlBufferSetAllocationScheme">xmlBufferSetAllocationScheme</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathDifference">xmlXPathDifference</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathDistinct">xmlXPathDistinct</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathDistinctSorted">xmlXPathDistinctSorted</a><br />
@@ -205,12 +209,24 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a><br />
<a href="html/libxml-tree.html#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a><br />
</dd><dt>Show</dt><dd><a href="html/libxml-debugXML.html#xmlShellPwd">xmlShellPwd</a><br />
-</dd><dt>Signature</dt><dd><a href="html/libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a><br />
+</dd><dt>Signature</dt><dd><a href="html/libxml-c14n.html#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a><br />
+<a href="html/libxml-globals.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a><br />
+<a href="html/libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a><br />
<a href="html/libxml-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a><br />
+<a href="html/libxml-globals.html#xmlOutputBufferCreateFilenameFunc">xmlOutputBufferCreateFilenameFunc</a><br />
+<a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a><br />
<a href="html/libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a><br />
+<a href="html/libxml-globals.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a><br />
+<a href="html/libxml-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a><br />
+<a href="html/libxml-schematron.html#xmlSchematronValidityErrorFunc">xmlSchematronValidityErrorFunc</a><br />
+<a href="html/libxml-schematron.html#xmlSchematronValidityWarningFunc">xmlSchematronValidityWarningFunc</a><br />
<a href="html/libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a><br />
<a href="html/libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a><br />
+<a href="html/libxml-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a><br />
</dd><dt>Similarly</dt><dd><a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
</dd><dt>Simply</dt><dd><a href="html/libxml-uri.html#xmlCreateURI">xmlCreateURI</a><br />
</dd><dt>Since</dt><dd><a href="html/libxml-xmlstring.html#xmlStrcat">xmlStrcat</a><br />
diff --git a/doc/APIchunk8.html b/doc/APIchunk8.html
index 316f827..10e852a 100644
--- a/doc/APIchunk8.html
+++ b/doc/APIchunk8.html
@@ -119,7 +119,6 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>Thus:</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathSubstringFunction">xmlXPathSubstringFunction</a><br />
</dd><dt>Tibetan</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsTibetan">xmlUCSIsTibetan</a><br />
</dd><dt>Token</dt><dd><a href="html/libxml-parserInternals.html#xmlParseAttributeType">xmlParseAttributeType</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNmtokensValue">xmlValidateNmtokensValue</a><br />
<a href="html/libxml-valid.html#xmlValidateOneAttribute">xmlValidateOneAttribute</a><br />
@@ -222,6 +221,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlReplaceNode">xmlReplaceNode</a><br />
<a href="html/libxml-tree.html#xmlUnlinkNode">xmlUnlinkNode</a><br />
</dd><dt>Unlinks</dt><dd><a href="html/libxml-tree.html#xmlDOMWrapRemoveNode">xmlDOMWrapRemoveNode</a><br />
+</dd><dt>Unplug</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a><br />
</dd><dt>Unregisters</dt><dd><a href="html/libxml-encoding.html#xmlCleanupEncodingAliases">xmlCleanupEncodingAliases</a><br />
<a href="html/libxml-encoding.html#xmlDelEncodingAlias">xmlDelEncodingAlias</a><br />
</dd><dt>Update</dt><dd><a href="html/libxml-nanoftp.html#xmlNanoFTPUpdateURL">xmlNanoFTPUpdateURL</a><br />
diff --git a/doc/APIchunk9.html b/doc/APIchunk9.html
index cf7f9d9..fb32180 100644
--- a/doc/APIchunk9.html
+++ b/doc/APIchunk9.html
@@ -41,9 +41,11 @@ A:link, A:visited, A:active { text-decoration: underline }
</dd><dt>Validate</dt><dd><a href="html/libxml-schemasInternals.html#XML_SCHEMAS_ANY_LAX">XML_SCHEMAS_ANY_LAX</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGValidateDoc">xmlRelaxNGValidateDoc</a><br />
<a href="html/libxml-relaxng.html#xmlRelaxNGValidateFullElement">xmlRelaxNGValidateFullElement</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidateStream">xmlSchemaValidateStream</a><br />
<a href="html/libxml-schematron.html#xmlSchematronValidateDoc">xmlSchematronValidateDoc</a><br />
<a href="html/libxml-debugXML.html#xmlShellValidate">xmlShellValidate</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNameValue">xmlValidateNameValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNamesValue">xmlValidateNamesValue</a><br />
<a href="html/libxml-valid.html#xmlValidateNmtokenValue">xmlValidateNmtokenValue</a><br />
@@ -60,7 +62,6 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlParseDefaultDecl">xmlParseDefaultDecl</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEnumerationType">xmlParseEnumerationType</a><br />
<a href="html/libxml-parserInternals.html#xmlParseNotationType">xmlParseNotationType</a><br />
-<a href="html/libxml-valid.html#xmlValidateAttributeValue">xmlValidateAttributeValue</a><br />
</dd><dt>Variable</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathVariableLookup">xmlXPathVariableLookup</a><br />
<a href="html/libxml-xpathInternals.html#xmlXPathVariableLookupNS">xmlXPathVariableLookupNS</a><br />
</dd><dt>VariationSelectors</dt><dd><a href="html/libxml-xmlunicode.html#xmlUCSIsVariationSelectors">xmlUCSIsVariationSelectors</a><br />
@@ -154,6 +155,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-valid.html#xmlValidateOneElement">xmlValidateOneElement</a><br />
<a href="html/libxml-valid.html#xmlValidateOneNamespace">xmlValidateOneNamespace</a><br />
<a href="html/libxml-valid.html#xmlValidateRoot">xmlValidateRoot</a><br />
+</dd><dt>XML-Schema</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a><br />
</dd><dt>XMLDecl</dt><dd><a href="html/libxml-parserInternals.html#xmlParseXMLDecl">xmlParseXMLDecl</a><br />
</dd><dt>XMLDecl?</dt><dd><a href="html/libxml-parser.html#xmlParseDocument">xmlParseDocument</a><br />
</dd><dt>XMLSchema</dt><dd><a href="html/libxml-xmlschemastypes.html#xmlSchemaGetPredefinedType">xmlSchemaGetPredefinedType</a><br />
@@ -193,6 +195,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parserInternals.html#xmlStringLenDecodeEntities">xmlStringLenDecodeEntities</a><br />
</dd><dt>XML_xxx_yyy_ENTITY</dt><dd><a href="html/libxml-entities.html#xmlAddDocEntity">xmlAddDocEntity</a><br />
<a href="html/libxml-entities.html#xmlAddDtdEntity">xmlAddDtdEntity</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
</dd><dt>XMl-Schema</dt><dd><a href="html/libxml-xmlschemas.html#xmlSchemaGetParserErrors">xmlSchemaGetParserErrors</a><br />
</dd><dt>XPATH</dt><dd><a href="html/libxml-xpath.html#xmlXPathFreeCompExpr">xmlXPathFreeCompExpr</a><br />
</dd><dt>XPATH_INVALID_ARITY</dt><dd><a href="html/libxml-xpathInternals.html#xmlXPathSetArityError">xmlXPathSetArityError</a><br />
@@ -206,6 +209,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xpointer.html#xmlXPtrNewContext">xmlXPtrNewContext</a><br />
<a href="html/libxml-xpointer.html#xmlXPtrRangeToFunction">xmlXPtrRangeToFunction</a><br />
</dd><dt>XSD</dt><dd><a href="html/libxml-xmlautomata.html#xmlAutomataNewNegTrans">xmlAutomataNewNegTrans</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSchemaValidate">xmlTextReaderSchemaValidate</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSchemaValidateCtxt">xmlTextReaderSchemaValidateCtxt</a><br />
<a href="html/libxml-xmlreader.html#xmlTextReaderSetSchema">xmlTextReaderSetSchema</a><br />
diff --git a/doc/APIconstructors.html b/doc/APIconstructors.html
index 8ccc8a6..300fc03 100644
--- a/doc/APIconstructors.html
+++ b/doc/APIconstructors.html
@@ -318,6 +318,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-entities.html#xmlGetDtdEntity">xmlGetDtdEntity</a><br />
<a href="html/libxml-entities.html#xmlGetParameterEntity">xmlGetParameterEntity</a><br />
<a href="html/libxml-entities.html#xmlGetPredefinedEntity">xmlGetPredefinedEntity</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-parserInternals.html#xmlParseEntityRef">xmlParseEntityRef</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2GetEntity">xmlSAX2GetEntity</a><br />
<a href="html/libxml-SAX2.html#xmlSAX2GetParameterEntity">xmlSAX2GetParameterEntity</a><br />
@@ -447,6 +448,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a><br />
<a href="html/libxml-parserInternals.html#xmlCreateURLParserCtxt">xmlCreateURLParserCtxt</a><br />
<a href="html/libxml-parser.html#xmlNewParserCtxt">xmlNewParserCtxt</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
</p><h2>Type xmlParserErrors:</h2><p><a href="html/libxml-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a><br />
</p><h2>Type xmlParserInputBufferCreateFilenameFunc:</h2><p><a href="html/libxml-globals.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a><br />
<a href="html/libxml-globals.html#xmlThrDefParserInputBufferCreateFilenameDefault">xmlThrDefParserInputBufferCreateFilenameDefault</a><br />
diff --git a/doc/APIfiles.html b/doc/APIfiles.html
index 30d650a..479d244 100644
--- a/doc/APIfiles.html
+++ b/doc/APIfiles.html
@@ -405,6 +405,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-entities.html#xmlGetParameterEntity">xmlGetParameterEntity</a><br />
<a href="html/libxml-entities.html#xmlGetPredefinedEntity">xmlGetPredefinedEntity</a><br />
<a href="html/libxml-entities.html#xmlInitializePredefinedEntities">xmlInitializePredefinedEntities</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
</p><h2><a name="globals" id="globals">Module globals</a>:</h2><p><a href="html/libxml-globals.html#_xmlGlobalState">_xmlGlobalState</a><br />
<a href="html/libxml-globals.html#docbDefaultSAXHandler">docbDefaultSAXHandler</a><br />
<a href="html/libxml-globals.html#htmlDefaultSAXHandler">htmlDefaultSAXHandler</a><br />
@@ -601,6 +602,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#XML_PARSE_DTDATTR">XML_PARSE_DTDATTR</a><br />
<a href="html/libxml-parser.html#XML_PARSE_DTDLOAD">XML_PARSE_DTDLOAD</a><br />
<a href="html/libxml-parser.html#XML_PARSE_DTDVALID">XML_PARSE_DTDVALID</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_NOBASEFIX">XML_PARSE_NOBASEFIX</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NOBLANKS">XML_PARSE_NOBLANKS</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NOCDATA">XML_PARSE_NOCDATA</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NODICT">XML_PARSE_NODICT</a><br />
@@ -610,6 +613,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#XML_PARSE_NOWARNING">XML_PARSE_NOWARNING</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NOXINCNODE">XML_PARSE_NOXINCNODE</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_OLD10">XML_PARSE_OLD10</a><br />
<a href="html/libxml-parser.html#XML_PARSE_PEDANTIC">XML_PARSE_PEDANTIC</a><br />
<a href="html/libxml-parser.html#XML_PARSE_PUSH_DOM">XML_PARSE_PUSH_DOM</a><br />
<a href="html/libxml-parser.html#XML_PARSE_PUSH_SAX">XML_PARSE_PUSH_SAX</a><br />
@@ -1283,12 +1287,21 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a><br />
<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a><br />
<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a><br />
+<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_IO">XML_BUFFER_ALLOC_IO</a><br />
<a href="html/libxml-tree.html#XML_CDATA_SECTION_NODE">XML_CDATA_SECTION_NODE</a><br />
<a href="html/libxml-tree.html#XML_COMMENT_NODE">XML_COMMENT_NODE</a><br />
<a href="html/libxml-tree.html#XML_DOCB_DOCUMENT_NODE">XML_DOCB_DOCUMENT_NODE</a><br />
<a href="html/libxml-tree.html#XML_DOCUMENT_FRAG_NODE">XML_DOCUMENT_FRAG_NODE</a><br />
<a href="html/libxml-tree.html#XML_DOCUMENT_NODE">XML_DOCUMENT_NODE</a><br />
<a href="html/libxml-tree.html#XML_DOCUMENT_TYPE_NODE">XML_DOCUMENT_TYPE_NODE</a><br />
+<a href="html/libxml-tree.html#XML_DOC_DTDVALID">XML_DOC_DTDVALID</a><br />
+<a href="html/libxml-tree.html#XML_DOC_HTML">XML_DOC_HTML</a><br />
+<a href="html/libxml-tree.html#XML_DOC_INTERNAL">XML_DOC_INTERNAL</a><br />
+<a href="html/libxml-tree.html#XML_DOC_NSVALID">XML_DOC_NSVALID</a><br />
+<a href="html/libxml-tree.html#XML_DOC_OLD10">XML_DOC_OLD10</a><br />
+<a href="html/libxml-tree.html#XML_DOC_USERBUILT">XML_DOC_USERBUILT</a><br />
+<a href="html/libxml-tree.html#XML_DOC_WELLFORMED">XML_DOC_WELLFORMED</a><br />
+<a href="html/libxml-tree.html#XML_DOC_XINCLUDE">XML_DOC_XINCLUDE</a><br />
<a href="html/libxml-tree.html#XML_DTD_NODE">XML_DTD_NODE</a><br />
<a href="html/libxml-tree.html#XML_ELEMENT_CONTENT_ELEMENT">XML_ELEMENT_CONTENT_ELEMENT</a><br />
<a href="html/libxml-tree.html#XML_ELEMENT_CONTENT_MULT">XML_ELEMENT_CONTENT_MULT</a><br />
@@ -1398,6 +1411,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlDocDumpMemoryEnc">xmlDocDumpMemoryEnc</a><br />
<a href="html/libxml-tree.html#xmlDocFormatDump">xmlDocFormatDump</a><br />
<a href="html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a><br />
+<a href="html/libxml-tree.html#xmlDocProperties">xmlDocProperties</a><br />
<a href="html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a><br />
<a href="html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a><br />
<a href="html/libxml-tree.html#xmlDtd">xmlDtd</a><br />
@@ -1835,6 +1849,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_DTD_CONTENT_MODEL">XML_DTD_CONTENT_MODEL</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_CONTENT_NOT_DETERMINIST">XML_DTD_CONTENT_NOT_DETERMINIST</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_DIFFERENT_PREFIX">XML_DTD_DIFFERENT_PREFIX</a><br />
+<a href="html/libxml-xmlerror.html#XML_DTD_DUP_TOKEN">XML_DTD_DUP_TOKEN</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ELEM_DEFAULT_NAMESPACE">XML_DTD_ELEM_DEFAULT_NAMESPACE</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ELEM_NAMESPACE">XML_DTD_ELEM_NAMESPACE</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ELEM_REDEFINED">XML_DTD_ELEM_REDEFINED</a><br />
@@ -1963,11 +1978,13 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_ERR_TAG_NOT_FINISHED">XML_ERR_TAG_NOT_FINISHED</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNDECLARED_ENTITY">XML_ERR_UNDECLARED_ENTITY</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNKNOWN_ENCODING">XML_ERR_UNKNOWN_ENCODING</a><br />
+<a href="html/libxml-xmlerror.html#XML_ERR_UNKNOWN_VERSION">XML_ERR_UNKNOWN_VERSION</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNPARSED_ENTITY">XML_ERR_UNPARSED_ENTITY</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNSUPPORTED_ENCODING">XML_ERR_UNSUPPORTED_ENCODING</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_URI_FRAGMENT">XML_ERR_URI_FRAGMENT</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_URI_REQUIRED">XML_ERR_URI_REQUIRED</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_VALUE_REQUIRED">XML_ERR_VALUE_REQUIRED</a><br />
+<a href="html/libxml-xmlerror.html#XML_ERR_VERSION_MISMATCH">XML_ERR_VERSION_MISMATCH</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_VERSION_MISSING">XML_ERR_VERSION_MISSING</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_WARNING">XML_ERR_WARNING</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_XMLDECL_NOT_FINISHED">XML_ERR_XMLDECL_NOT_FINISHED</a><br />
@@ -2075,6 +2092,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_MODULE_CLOSE">XML_MODULE_CLOSE</a><br />
<a href="html/libxml-xmlerror.html#XML_MODULE_OPEN">XML_MODULE_OPEN</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_ATTRIBUTE_REDEFINED">XML_NS_ERR_ATTRIBUTE_REDEFINED</a><br />
+<a href="html/libxml-xmlerror.html#XML_NS_ERR_COLON">XML_NS_ERR_COLON</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_EMPTY">XML_NS_ERR_EMPTY</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_QNAME">XML_NS_ERR_QNAME</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_UNDEFINED_NAMESPACE">XML_NS_ERR_UNDEFINED_NAMESPACE</a><br />
@@ -2581,6 +2599,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlmemory.html#xmlMallocLoc">xmlMallocLoc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemFree">xmlMemFree</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemMalloc">xmlMemMalloc</a><br />
@@ -2849,6 +2868,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidError">xmlSchemaValidError</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a><br />
diff --git a/doc/APIfunctions.html b/doc/APIfunctions.html
index 9e83889..3cf9ced 100644
--- a/doc/APIfunctions.html
+++ b/doc/APIfunctions.html
@@ -59,6 +59,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlElemDump">xmlElemDump</a><br />
<a href="html/libxml-debugXML.html#xmlLsOneNode">xmlLsOneNode</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemShow">xmlMemShow</a><br />
<a href="html/libxml-xmlIO.html#xmlOutputBufferCreateFile">xmlOutputBufferCreateFile</a><br />
<a href="html/libxml-xmlIO.html#xmlParserInputBufferCreateFile">xmlParserInputBufferCreateFile</a><br />
@@ -276,6 +277,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewDocTextLen">xmlNewDocTextLen</a><br />
<a href="html/libxml-tree.html#xmlNewDtd">xmlNewDtd</a><br />
<a href="html/libxml-valid.html#xmlNewElementContent">xmlNewElementContent</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-tree.html#xmlNewGlobalNs">xmlNewGlobalNs</a><br />
<a href="html/libxml-tree.html#xmlNewNode">xmlNewNode</a><br />
<a href="html/libxml-tree.html#xmlNewNs">xmlNewNs</a><br />
@@ -577,6 +579,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlSplitQName3">xmlSplitQName3</a><br />
<a href="html/libxml-parserInternals.html#xmlStringCurrentChar">xmlStringCurrentChar</a><br />
<a href="html/libxml-valid.html#xmlValidGetPotentialChildren">xmlValidGetPotentialChildren</a><br />
+</p><h2>Type long:</h2><p><a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
</p><h2>Type size_t:</h2><p><a href="html/libxml-tree.html#xmlBufferCreateSize">xmlBufferCreateSize</a><br />
<a href="html/libxml-tree.html#xmlBufferCreateStatic">xmlBufferCreateStatic</a><br />
<a href="html/libxml-xmlmemory.html#xmlMallocAtomicLoc">xmlMallocAtomicLoc</a><br />
@@ -1161,6 +1164,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewDocText">xmlNewDocText</a><br />
<a href="html/libxml-tree.html#xmlNewDocTextLen">xmlNewDocTextLen</a><br />
<a href="html/libxml-tree.html#xmlNewDtd">xmlNewDtd</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-tree.html#xmlNewGlobalNs">xmlNewGlobalNs</a><br />
<a href="html/libxml-tree.html#xmlNewReference">xmlNewReference</a><br />
<a href="html/libxml-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a><br />
@@ -1934,6 +1938,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidateFile">xmlSchemaValidateFile</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a><br />
diff --git a/doc/APIsymbols.html b/doc/APIsymbols.html
index af09644..952abf5 100644
--- a/doc/APIsymbols.html
+++ b/doc/APIsymbols.html
@@ -146,6 +146,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a><br />
<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a><br />
<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a><br />
+<a href="html/libxml-tree.html#XML_BUFFER_ALLOC_IO">XML_BUFFER_ALLOC_IO</a><br />
<a href="html/libxml-xmlerror.html#XML_C14N_CREATE_CTXT">XML_C14N_CREATE_CTXT</a><br />
<a href="html/libxml-xmlerror.html#XML_C14N_CREATE_STACK">XML_C14N_CREATE_STACK</a><br />
<a href="html/libxml-xmlerror.html#XML_C14N_INVALID_NODE">XML_C14N_INVALID_NODE</a><br />
@@ -242,6 +243,14 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#XML_DOCUMENT_FRAG_NODE">XML_DOCUMENT_FRAG_NODE</a><br />
<a href="html/libxml-tree.html#XML_DOCUMENT_NODE">XML_DOCUMENT_NODE</a><br />
<a href="html/libxml-tree.html#XML_DOCUMENT_TYPE_NODE">XML_DOCUMENT_TYPE_NODE</a><br />
+<a href="html/libxml-tree.html#XML_DOC_DTDVALID">XML_DOC_DTDVALID</a><br />
+<a href="html/libxml-tree.html#XML_DOC_HTML">XML_DOC_HTML</a><br />
+<a href="html/libxml-tree.html#XML_DOC_INTERNAL">XML_DOC_INTERNAL</a><br />
+<a href="html/libxml-tree.html#XML_DOC_NSVALID">XML_DOC_NSVALID</a><br />
+<a href="html/libxml-tree.html#XML_DOC_OLD10">XML_DOC_OLD10</a><br />
+<a href="html/libxml-tree.html#XML_DOC_USERBUILT">XML_DOC_USERBUILT</a><br />
+<a href="html/libxml-tree.html#XML_DOC_WELLFORMED">XML_DOC_WELLFORMED</a><br />
+<a href="html/libxml-tree.html#XML_DOC_XINCLUDE">XML_DOC_XINCLUDE</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ATTRIBUTE_DEFAULT">XML_DTD_ATTRIBUTE_DEFAULT</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ATTRIBUTE_REDEFINED">XML_DTD_ATTRIBUTE_REDEFINED</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ATTRIBUTE_VALUE">XML_DTD_ATTRIBUTE_VALUE</a><br />
@@ -249,6 +258,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_DTD_CONTENT_MODEL">XML_DTD_CONTENT_MODEL</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_CONTENT_NOT_DETERMINIST">XML_DTD_CONTENT_NOT_DETERMINIST</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_DIFFERENT_PREFIX">XML_DTD_DIFFERENT_PREFIX</a><br />
+<a href="html/libxml-xmlerror.html#XML_DTD_DUP_TOKEN">XML_DTD_DUP_TOKEN</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ELEM_DEFAULT_NAMESPACE">XML_DTD_ELEM_DEFAULT_NAMESPACE</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ELEM_NAMESPACE">XML_DTD_ELEM_NAMESPACE</a><br />
<a href="html/libxml-xmlerror.html#XML_DTD_ELEM_REDEFINED">XML_DTD_ELEM_REDEFINED</a><br />
@@ -396,11 +406,13 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlerror.html#XML_ERR_TAG_NOT_FINISHED">XML_ERR_TAG_NOT_FINISHED</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNDECLARED_ENTITY">XML_ERR_UNDECLARED_ENTITY</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNKNOWN_ENCODING">XML_ERR_UNKNOWN_ENCODING</a><br />
+<a href="html/libxml-xmlerror.html#XML_ERR_UNKNOWN_VERSION">XML_ERR_UNKNOWN_VERSION</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNPARSED_ENTITY">XML_ERR_UNPARSED_ENTITY</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_UNSUPPORTED_ENCODING">XML_ERR_UNSUPPORTED_ENCODING</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_URI_FRAGMENT">XML_ERR_URI_FRAGMENT</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_URI_REQUIRED">XML_ERR_URI_REQUIRED</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_VALUE_REQUIRED">XML_ERR_VALUE_REQUIRED</a><br />
+<a href="html/libxml-xmlerror.html#XML_ERR_VERSION_MISMATCH">XML_ERR_VERSION_MISMATCH</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_VERSION_MISSING">XML_ERR_VERSION_MISSING</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_WARNING">XML_ERR_WARNING</a><br />
<a href="html/libxml-xmlerror.html#XML_ERR_XMLDECL_NOT_FINISHED">XML_ERR_XMLDECL_NOT_FINISHED</a><br />
@@ -529,6 +541,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#XML_NAMESPACE_DECL">XML_NAMESPACE_DECL</a><br />
<a href="html/libxml-tree.html#XML_NOTATION_NODE">XML_NOTATION_NODE</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_ATTRIBUTE_REDEFINED">XML_NS_ERR_ATTRIBUTE_REDEFINED</a><br />
+<a href="html/libxml-xmlerror.html#XML_NS_ERR_COLON">XML_NS_ERR_COLON</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_EMPTY">XML_NS_ERR_EMPTY</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_QNAME">XML_NS_ERR_QNAME</a><br />
<a href="html/libxml-xmlerror.html#XML_NS_ERR_UNDEFINED_NAMESPACE">XML_NS_ERR_UNDEFINED_NAMESPACE</a><br />
@@ -564,6 +577,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#XML_PARSE_DTDATTR">XML_PARSE_DTDATTR</a><br />
<a href="html/libxml-parser.html#XML_PARSE_DTDLOAD">XML_PARSE_DTDLOAD</a><br />
<a href="html/libxml-parser.html#XML_PARSE_DTDVALID">XML_PARSE_DTDVALID</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_NOBASEFIX">XML_PARSE_NOBASEFIX</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NOBLANKS">XML_PARSE_NOBLANKS</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NOCDATA">XML_PARSE_NOCDATA</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NODICT">XML_PARSE_NODICT</a><br />
@@ -573,6 +588,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-parser.html#XML_PARSE_NOWARNING">XML_PARSE_NOWARNING</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NOXINCNODE">XML_PARSE_NOXINCNODE</a><br />
<a href="html/libxml-parser.html#XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a><br />
+<a href="html/libxml-parser.html#XML_PARSE_OLD10">XML_PARSE_OLD10</a><br />
<a href="html/libxml-parser.html#XML_PARSE_PEDANTIC">XML_PARSE_PEDANTIC</a><br />
<a href="html/libxml-parser.html#XML_PARSE_PUSH_DOM">XML_PARSE_PUSH_DOM</a><br />
<a href="html/libxml-parser.html#XML_PARSE_PUSH_SAX">XML_PARSE_PUSH_SAX</a><br />
@@ -1908,6 +1924,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlDocDumpMemoryEnc">xmlDocDumpMemoryEnc</a><br />
<a href="html/libxml-tree.html#xmlDocFormatDump">xmlDocFormatDump</a><br />
<a href="html/libxml-tree.html#xmlDocGetRootElement">xmlDocGetRootElement</a><br />
+<a href="html/libxml-tree.html#xmlDocProperties">xmlDocProperties</a><br />
<a href="html/libxml-tree.html#xmlDocPtr">xmlDocPtr</a><br />
<a href="html/libxml-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a><br />
<a href="html/libxml-tree.html#xmlDtd">xmlDtd</a><br />
@@ -2206,6 +2223,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-xmlmemory.html#xmlMallocLoc">xmlMallocLoc</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemBlocks">xmlMemBlocks</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemDisplay">xmlMemDisplay</a><br />
+<a href="html/libxml-xmlmemory.html#xmlMemDisplayLast">xmlMemDisplayLast</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemFree">xmlMemFree</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemGet">xmlMemGet</a><br />
<a href="html/libxml-xmlmemory.html#xmlMemMalloc">xmlMemMalloc</a><br />
@@ -2290,6 +2308,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-tree.html#xmlNewDocTextLen">xmlNewDocTextLen</a><br />
<a href="html/libxml-tree.html#xmlNewDtd">xmlNewDtd</a><br />
<a href="html/libxml-valid.html#xmlNewElementContent">xmlNewElementContent</a><br />
+<a href="html/libxml-entities.html#xmlNewEntity">xmlNewEntity</a><br />
<a href="html/libxml-parserInternals.html#xmlNewEntityInputStream">xmlNewEntityInputStream</a><br />
<a href="html/libxml-tree.html#xmlNewGlobalNs">xmlNewGlobalNs</a><br />
<a href="html/libxml-parser.html#xmlNewIOInputStream">xmlNewIOInputStream</a><br />
@@ -2747,6 +2766,7 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="html/libxml-schemasInternals.html#xmlSchemaValType">xmlSchemaValType</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxt">xmlSchemaValidCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a><br />
+<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidError">xmlSchemaValidError</a><br />
<a href="html/libxml-xmlschemas.html#xmlSchemaValidOption">xmlSchemaValidOption</a><br />
diff --git a/doc/FAQ.html b/doc/FAQ.html
index 3b43432..6454942 100644
--- a/doc/FAQ.html
+++ b/doc/FAQ.html
@@ -217,9 +217,11 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
and libxml2, but you need to install a more recent version:
libxml(-devel) &gt;= 1.8.8 or libxml2(-devel) &gt;= 2.1.0</p>
</li>
- <li><em>XPath implementation looks seriously broken</em>
- <p>XPath implementation prior to 2.3.0 was really incomplete. Upgrade to
- a recent version, there are no known bugs in the current version.</p>
+ <li><em>Random crashes in threaded applications</em>
+ <p>Read and follow all advices on the <a href="threads.html">thread
+ safety</a> page, and make 100% sure you never call xmlCleanupParser()
+ while the library or an XML document might still be in use by another
+ thread.</p>
</li>
<li><em>The example provided in the web page does not compile.</em>
<p>It's hard to maintain the documentation in sync with the code
@@ -235,16 +237,8 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
generated doc</a></li>
<li>have a look at <a href="examples/index.html">the set of
examples</a>.</li>
- <li>look for examples of use for libxml2 function using the Gnome code.
-<!--
- For example the following will query the full Gnome CVS base for the
- use of the <strong>xmlAddChild()</strong> function:
- <p><a
- href="http://cvs.gnome.org/lxr/search?string=xmlAddChild">http://cvs.gnome.org/lxr/search?string=xmlAddChild</a></p>
- <p>This may be slow, a large hardware donation to the gnome project
- could cure this :-)</p>
--->
- </li>
+ <li>look for examples of use for libxml2 function using the Gnome code
+ or by asking on Google.</li>
<li><a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">Browse
the libxml2 source</a> , I try to write code as clean and documented
as possible, so looking at it may be helpful. In particular the code
@@ -261,12 +255,6 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
<p>Website: <a href="http://libxmlplusplus.sourceforge.net/">http://libxmlplusplus.sourceforge.net/</a></p>
<p>Download: <a href="http://sourceforge.net/project/showfiles.php?group_id=12999">http://sourceforge.net/project/showfiles.php?group_id=12999</a></p>
</li>
- <!-- Website is currently unavailable as of 2003-08-02
- <li>by Peter Jones &lt;pjones@pmade.org&gt;
- <p>Website: <a
- href="http://pmade.org/pjones/software/xmlwrapp/">http://pmade.org/pjones/software/xmlwrapp/</a></p>
- </li>
- -->
</ul></li>
<li><em>How to validate a document a posteriori ?</em>
<p>It is possible to validate documents which had not been validated at
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 2310c52..62f96dc 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -460,8 +460,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -486,8 +486,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -497,13 +497,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/doc/apibuild.py b/doc/apibuild.py
index 1e73725..3c38061 100755
--- a/doc/apibuild.py
+++ b/doc/apibuild.py
@@ -51,6 +51,7 @@ ignored_files = {
"tst.c": "not part of the library",
"test.c": "not part of the library",
"testdso.c": "test for dynamid shared libraries",
+ "testrecurse.c": "test for entities recursions",
}
ignored_words = {
@@ -356,7 +357,7 @@ class index:
self.analyze_dict("structs", self.structs)
self.analyze_dict("typedefs", self.typedefs)
self.analyze_dict("macros", self.macros)
-
+
class CLexer:
"""A lexer for the C language, tokenize the input by reading and
analyzing it line by line"""
@@ -388,7 +389,7 @@ class CLexer:
else:
line = line + n
return line
-
+
def getlineno(self):
return self.lineno
@@ -557,12 +558,12 @@ class CLexer:
else:
break
self.tokens.append(('name', line[s:i]))
-
+
tok = self.tokens[0]
self.tokens = self.tokens[1:]
self.last = tok
return tok
-
+
class CParser:
"""The C module parser"""
def __init__(self, filename, idx = None):
@@ -717,7 +718,7 @@ class CParser:
l = string.strip(l)
desc = desc + " " + l
del lines[0]
-
+
desc = string.strip(desc)
if quiet == 0:
@@ -787,7 +788,7 @@ class CParser:
l = string.strip(l)
desc = desc + " " + l
del lines[0]
-
+
desc = string.strip(desc)
if quiet == 0:
@@ -888,7 +889,7 @@ class CParser:
else:
desc = desc + " " + l
del lines[0]
-
+
retdesc = string.strip(retdesc)
desc = string.strip(desc)
@@ -898,7 +899,8 @@ class CParser:
#
i = 0
while i < nbargs:
- if args[i][2] == None and args[i][0] != "void" and args[i][1] != None:
+ if args[i][2] == None and args[i][0] != "void" and \
+ ((args[i][1] != None) or (args[i][1] == '')):
self.warning("Function comment for %s lacks description of arg %s" % (name, args[i][1]))
i = i + 1
if retdesc == "" and ret[0] != "void":
@@ -906,7 +908,6 @@ class CParser:
if desc == "":
self.warning("Function comment for %s lacks description of the function" % (name))
-
return(((ret[0], retdesc), args, desc))
def parsePreproc(self, token):
@@ -966,7 +967,7 @@ class CParser:
try:
self.defines.append(apstr)
if string.find(apstr, 'ENABLED') != -1:
- self.conditionals.append("defined(%s)" % apstr)
+ self.conditionals.append("defined(%s)" % apstr)
except:
pass
elif name == "#ifndef":
@@ -974,7 +975,7 @@ class CParser:
try:
self.defines.append(apstr)
if string.find(apstr, 'ENABLED') != -1:
- self.conditionals.append("!defined(%s)" % apstr)
+ self.conditionals.append("!defined(%s)" % apstr)
except:
pass
elif name == "#if":
@@ -1096,7 +1097,7 @@ class CParser:
return token
token = self.token()
return token
-
+
#
# Parse a C code block, used for functions it parse till
# the balancing } included
@@ -1131,7 +1132,7 @@ class CParser:
elif oldtok[0] == "name" and oldtok[1][0:7] == "LIBXML_":
self.index_add_ref(oldtok[1], self.filename,
0, "typedef")
-
+
else:
token = self.token()
return token
@@ -1264,7 +1265,7 @@ class CParser:
if token == None:
return token
- while token[0] == "name" and (
+ while token[0] == "name" and (
token[1] == "const" or \
token[1] == "unsigned" or \
token[1] == "signed"):
@@ -1284,7 +1285,7 @@ class CParser:
self.type = tmp[1]
else:
self.type = self.type + " " + tmp[1]
-
+
elif token[0] == "name" and token[1] == "struct":
if self.type == "":
self.type = token[1]
@@ -1574,7 +1575,7 @@ class CParser:
token = self.token()
else:
break
-
+
return token
def parse(self):
@@ -1590,7 +1591,7 @@ class CParser:
return
self.parseTopComment(self.top_comment)
return self.index
-
+
class docBuilder:
"""A documentation builder"""
@@ -1687,7 +1688,7 @@ class docBuilder:
self.headers[file] = None;
self.scanHeaders()
self.scanModules()
-
+
def modulename_file(self, file):
module = os.path.basename(file)
if module[-2:] == '.h':
@@ -1781,7 +1782,7 @@ class docBuilder:
else:
output.write(" <variable name='%s' file='%s'/>\n" % (
name, self.modulename_file(id.header)))
-
+
def serialize_function(self, output, name):
id = self.idx.functions[name]
if name == debugsym:
@@ -1802,6 +1803,11 @@ class docBuilder:
output.write(" <cond>%s</cond>\n"% (apstr));
try:
(ret, params, desc) = id.info
+ if (desc == None or desc == '') and \
+ name[0:9] != "xmlThrDef" and name != "xmlDllMain":
+ print "%s %s from %s has no description" % (id.type, name,
+ self.modulename_file(id.module))
+
output.write(" <info>%s</info>\n" % (escape(desc)))
self.indexString(name, desc)
if ret[0] != None:
diff --git a/doc/devhelp/Makefile.in b/doc/devhelp/Makefile.in
index 169521d..1257ad4 100644
--- a/doc/devhelp/Makefile.in
+++ b/doc/devhelp/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/doc/devhelp/libxml2-c14n.html b/doc/devhelp/libxml2-c14n.html
index 72f53b6..e60f229 100644
--- a/doc/devhelp/libxml2-c14n.html
+++ b/doc/devhelp/libxml2-c14n.html
@@ -57,8 +57,8 @@ int <a href="#xmlC14NDocDumpMemory">xmlC14NDocDumpMemory</a> (<a href="libxml2-
<h2>Details</h2>
<div class="refsect2" lang="en">
<div class="refsect2" lang="en"><h3><a name="xmlC14NIsVisibleCallback"/>Function type xmlC14NIsVisibleCallback</h3><pre class="programlisting">int xmlC14NIsVisibleCallback (void * user_data, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> parent)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for a C14N callback on visible nodes</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>user data</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the curent node</td></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td>the parent node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the node should be included</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlC14NDocDumpMemory"/>xmlC14NDocDumpMemory ()</h3><pre class="programlisting">int xmlC14NDocDumpMemory (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> <a href="libxml2-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> nodes, <br/> int exclusive, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** inclusive_ns_prefixes, <br/> int with_comments, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** doc_txt_ptr)<br/>
</pre><p>Dumps the canonized image of given XML document into memory. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</p>
diff --git a/doc/devhelp/libxml2-entities.html b/doc/devhelp/libxml2-entities.html
index cd1e9a8..0d0effb 100644
--- a/doc/devhelp/libxml2-entities.html
+++ b/doc/devhelp/libxml2-entities.html
@@ -47,6 +47,7 @@
typedef struct _xmlHashTable <a href="#xmlEntitiesTable">xmlEntitiesTable</a>;
typedef <a href="libxml2-entities.html#xmlEntitiesTable">xmlEntitiesTable</a> * <a href="#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a>;
<a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlAddDocEntity">xmlAddDocEntity</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> int type, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
+<a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlNewEntity">xmlNewEntity</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> int type, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input);
<a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlGetDocEntity">xmlGetDocEntity</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
<a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlGetDtdEntity">xmlGetDtdEntity</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
@@ -155,6 +156,10 @@ The content of this structure is not made public by the API.
</pre><p>Set up the predefined entities. Deprecated call</p>
</div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlNewEntity"/>xmlNewEntity ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> xmlNewEntity (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br/> int type, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br/>
+</pre><p>Create a new entity, this differs from xmlAddDocEntity() that if the document is NULL or has no internal subset defined, then an unlinked entity structure will be returned, it is then the responsability of the caller to link it to the document later or free it when not needed anymore.</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 entity name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the entity type XML_xxx_yyy_ENTITY</td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td>the entity external ID if available</td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td>the entity system ID if available</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the entity content</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the entity or NULL in case of error</td></tr></tbody></table></div></div>
+ <hr/>
</div>
</div>
</body>
diff --git a/doc/devhelp/libxml2-globals.html b/doc/devhelp/libxml2-globals.html
index c7f396e..449049e 100644
--- a/doc/devhelp/libxml2-globals.html
+++ b/doc/devhelp/libxml2-globals.html
@@ -125,20 +125,20 @@ const char * <a href="#xmlThrDefTreeIndentString">xmlThrDefTreeIndentString</a>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlDeregisterNodeFunc"/>Function type xmlDeregisterNodeFunc</h3><pre class="programlisting">void xmlDeregisterNodeFunc (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the deregistration callback of a discarded 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 current node</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlOutputBufferCreateFilenameFunc"/>Function type xmlOutputBufferCreateFilenameFunc</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> xmlOutputBufferCreateFilenameFunc (const char * URI, <br/> <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder, <br/> int compression)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the function doing the lookup for a suitable output method corresponding to an URI.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to write to</td></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParserInputBufferCreateFilenameFunc"/>Function type xmlParserInputBufferCreateFilenameFunc</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> xmlParserInputBufferCreateFilenameFunc (const char * URI, <br/> <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the function doing the lookup for a suitable input method corresponding to an URI.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to read from</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>the requested source encoding</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegisterNodeFunc"/>Function type xmlRegisterNodeFunc</h3><pre class="programlisting">void xmlRegisterNodeFunc (<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature for the registration callback of a created 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 current node</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="docbDefaultSAXHandler">Variable </a>docbDefaultSAXHandler</h3><pre class="programlisting"><a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> docbDefaultSAXHandler;
</pre><p/>
diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html
index 76b4967..ea0697f 100644
--- a/doc/devhelp/libxml2-parser.html
+++ b/doc/devhelp/libxml2-parser.html
@@ -302,7 +302,10 @@ void <a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a> (<a hr
<a name="XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a> = 8192 /* remove redundant namespaces declarations */
<a name="XML_PARSE_NOCDATA">XML_PARSE_NOCDATA</a> = 16384 /* merge CDATA as text nodes */
<a name="XML_PARSE_NOXINCNODE">XML_PARSE_NOXINCNODE</a> = 32768 /* do not generate XINCLUDE START/END nodes */
- <a name="XML_PARSE_COMPACT">XML_PARSE_COMPACT</a> = 65536 /* compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree) */
+ <a name="XML_PARSE_COMPACT">XML_PARSE_COMPACT</a> = 65536 /* compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree) */
+ <a name="XML_PARSE_OLD10">XML_PARSE_OLD10</a> = 131072 /* parse using XML-1.0 before update 5 */
+ <a name="XML_PARSE_NOBASEFIX">XML_PARSE_NOBASEFIX</a> = 262144 /* do not fixup XINCLUDE xml:base uris */
+ <a name="XML_PARSE_HUGE">XML_PARSE_HUGE</a> = 524288 /* relax any hardcoded limit from the parser */
};
</pre><p/>
</div>
diff --git a/doc/devhelp/libxml2-parserInternals.html b/doc/devhelp/libxml2-parserInternals.html
index 1e575f8..cdae32e 100644
--- a/doc/devhelp/libxml2-parserInternals.html
+++ b/doc/devhelp/libxml2-parserInternals.html
@@ -139,7 +139,7 @@ int <a href="#xmlParseElementContentDecl">xmlParseElementContentDecl</a> (<a hre
<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="#inputPop">inputPop</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> <a href="#xmlPopInput">xmlPopInput</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlParsePubidLiteral">xmlParsePubidLiteral</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-void <a href="#xmlPushInput">xmlPushInput</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
+int <a href="#xmlPushInput">xmlPushInput</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlParseEntityValue">xmlParseEntityValue</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** orig);
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlDecodeEntities">xmlDecodeEntities</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> int len, <br/> int what, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> end, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> end2, <br/> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> end3);
<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlParseVersionNum">xmlParseVersionNum</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
@@ -316,7 +316,7 @@ void <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a> (<a href="libxml2-tre
<hr/>
<div class="refsect2" lang="en"><h3><a name="inputPush"/>inputPush ()</h3><pre class="programlisting">int inputPush (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value)<br/>
</pre><p>Pushes a new parser input on top of 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>value</tt></i>:</span></td><td>the parser input</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of error, the index in the stack otherwise</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>value</tt></i>:</span></td><td>the parser input</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, the index in the stack otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="namePop"/>namePop ()</h3><pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * namePop (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
</pre><p>Pops the top element name from the name stack</p>
@@ -332,7 +332,7 @@ void <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a> (<a href="libxml2-tre
<hr/>
<div class="refsect2" lang="en"><h3><a name="nodePush"/>nodePush ()</h3><pre class="programlisting">int nodePush (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> value)<br/>
</pre><p>Pushes a new element node on top of the node 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>value</tt></i>:</span></td><td>the element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of error, the index in the stack otherwise</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>value</tt></i>:</span></td><td>the element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, the index in the stack otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlCheckLanguageID"/>xmlCheckLanguageID ()</h3><pre class="programlisting">int xmlCheckLanguageID (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * lang)<br/>
</pre><p>Checks that the value conforms to the LanguageID production: NOTE: this is somewhat deprecated, those productions were removed from the XML Second edition. [33] LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+</p>
@@ -587,7 +587,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><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the SystemLiteral parsed or NULL</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseTextDecl"/>xmlParseTextDecl ()</h3><pre class="programlisting">void xmlParseTextDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
-</pre><p>parse an XML declaration header for external entities [77] TextDecl ::= '&lt;?xml' VersionInfo? EncodingDecl S? '?&gt;' Question: Seems that EncodingDecl is mandatory ? Is that a typo ?</p>
+</pre><p>parse an XML declaration header for external entities [77] TextDecl ::= '&lt;?xml' VersionInfo? EncodingDecl S? '?&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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseVersionInfo"/>xmlParseVersionInfo ()</h3><pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseVersionInfo (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
@@ -595,7 +595,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><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the version string, e.g. "1.0"</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseVersionNum"/>xmlParseVersionNum ()</h3><pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseVersionNum (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
-</pre><p>parse the XML version value. [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+</p>
+</pre><p>parse the XML version value. [26] VersionNum ::= '1.' [0-9]+ In practice allow [0-9].[0-9]+ at that level</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 string giving the XML version number, or NULL</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseXMLDecl"/>xmlParseXMLDecl ()</h3><pre class="programlisting">void xmlParseXMLDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
@@ -618,9 +618,9 @@ void <a href="#xmlParseEntityDecl">xmlParseEntityDecl</a> (<a href="libxml2-tre
</pre><p>xmlPopInput: the current input pointed by ctxt-&gt;input came to an end pop it and return the next char.</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 current <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> in the parser context</td></tr></tbody></table></div></div>
<hr/>
- <div class="refsect2" lang="en"><h3><a name="xmlPushInput"/>xmlPushInput ()</h3><pre class="programlisting">void xmlPushInput (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br/>
+ <div class="refsect2" lang="en"><h3><a name="xmlPushInput"/>xmlPushInput ()</h3><pre class="programlisting">int xmlPushInput (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br/>
</pre><p>xmlPushInput: switch to a new input stream which is stacked on top of the previous one(s).</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>input</tt></i>:</span></td><td>an XML parser input fragment (entity, XML fragment ...).</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>input</tt></i>:</span></td><td>an XML parser input fragment (entity, XML fragment ...).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error or the index in the input stack</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlScanName"/>xmlScanName ()</h3><pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlScanName (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br/>
</pre><p>Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. TODO: seems deprecated now, only used in the default part of <a href="libxml2-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a> [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)*</p>
diff --git a/doc/devhelp/libxml2-relaxng.html b/doc/devhelp/libxml2-relaxng.html
index d7da3e5..a89b58f 100644
--- a/doc/devhelp/libxml2-relaxng.html
+++ b/doc/devhelp/libxml2-relaxng.html
@@ -169,12 +169,12 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGValidityErrorFunc"/>Function type xmlRelaxNGValidityErrorFunc</h3><pre class="programlisting">void xmlRelaxNGValidityErrorFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error 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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGValidityWarningFunc"/>Function type xmlRelaxNGValidityWarningFunc</h3><pre class="programlisting">void xmlRelaxNGValidityWarningFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRelaxNGCleanupTypes"/>xmlRelaxNGCleanupTypes ()</h3><pre class="programlisting">void xmlRelaxNGCleanupTypes (void)<br/>
</pre><p>Cleanup the default Schemas type library associated to RelaxNG</p>
diff --git a/doc/devhelp/libxml2-schematron.html b/doc/devhelp/libxml2-schematron.html
index bdcb944..c99e33e 100644
--- a/doc/devhelp/libxml2-schematron.html
+++ b/doc/devhelp/libxml2-schematron.html
@@ -113,12 +113,12 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchematronValidityErrorFunc"/>Function type xmlSchematronValidityErrorFunc</h3><pre class="programlisting">void xmlSchematronValidityErrorFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error callback from a Schematron 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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchematronValidityWarningFunc"/>Function type xmlSchematronValidityWarningFunc</h3><pre class="programlisting">void xmlSchematronValidityWarningFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of a warning callback from a Schematron 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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchematronFree"/>xmlSchematronFree ()</h3><pre class="programlisting">void xmlSchematronFree (<a href="libxml2-schematron.html#xmlSchematronPtr">xmlSchematronPtr</a> schema)<br/>
</pre><p>Deallocate a Schematron structure.</p>
diff --git a/doc/devhelp/libxml2-tree.html b/doc/devhelp/libxml2-tree.html
index d5879f5..188d43b 100644
--- a/doc/devhelp/libxml2-tree.html
+++ b/doc/devhelp/libxml2-tree.html
@@ -96,6 +96,7 @@ typedef struct _xmlOutputBuffer <a href="#xmlOutputBuffer">xmlOutputBuffer</a>;
typedef struct _xmlSAXLocator <a href="#xmlSAXLocator">xmlSAXLocator</a>;
typedef <a href="libxml2-tree.html#xmlElementContent">xmlElementContent</a> * <a href="#xmlElementContentPtr">xmlElementContentPtr</a>;
typedef enum <a href="#xmlElementContentType">xmlElementContentType</a>;
+typedef enum <a href="#xmlDocProperties">xmlDocProperties</a>;
typedef <a href="libxml2-tree.html#xmlID">xmlID</a> * <a href="#xmlIDPtr">xmlIDPtr</a>;
typedef struct _xmlDtd <a href="#xmlDtd">xmlDtd</a>;
typedef struct _xmlAttribute <a href="#xmlAttribute">xmlAttribute</a>;
@@ -369,14 +370,16 @@ void <a href="#xmlFreeNsList">xmlFreeNsList</a> (<a href="libxml2-tree.html#xm
unsigned int use : The buffer size used
unsigned int size : The buffer size
<a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> alloc : The realloc method
+ <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * contentIO : in IO mode we may have a different base
} xmlBuffer;
</pre><p/>
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlBufferAllocationScheme">Enum </a>xmlBufferAllocationScheme</h3><pre class="programlisting">enum <a href="#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> {
- <a name="XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> = 1
- <a name="XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> = 2
- <a name="XML_BUFFER_ALLOC_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a> = 3
+ <a name="XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> = 1 /* double each time one need to grow */
+ <a name="XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> = 2 /* grow only to the minimal size */
+ <a name="XML_BUFFER_ALLOC_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a> = 3 /* immutable buffer */
+ <a name="XML_BUFFER_ALLOC_IO">XML_BUFFER_ALLOC_IO</a> = 4 /* special allocation scheme used for I/O */
};
</pre><p/>
</div>
@@ -421,10 +424,25 @@ void <a href="#xmlFreeNsList">xmlFreeNsList</a> (<a href="libxml2-tree.html#xm
int charset : encoding of the in-memory content 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
+ 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;
</pre><p/>
</div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlDocProperties">Enum </a>xmlDocProperties</h3><pre class="programlisting">enum <a href="#xmlDocProperties">xmlDocProperties</a> {
+ <a name="XML_DOC_WELLFORMED">XML_DOC_WELLFORMED</a> = 1 /* document is XML well formed */
+ <a name="XML_DOC_NSVALID">XML_DOC_NSVALID</a> = 2 /* document is Namespace valid */
+ <a name="XML_DOC_OLD10">XML_DOC_OLD10</a> = 4 /* parsed with old XML-1.0 parser */
+ <a name="XML_DOC_DTDVALID">XML_DOC_DTDVALID</a> = 8 /* DTD validation was successful */
+ <a name="XML_DOC_XINCLUDE">XML_DOC_XINCLUDE</a> = 16 /* XInclude substitution was done */
+ <a name="XML_DOC_USERBUILT">XML_DOC_USERBUILT</a> = 32 /* Document was built using the API and not by parsing an instance */
+ <a name="XML_DOC_INTERNAL">XML_DOC_INTERNAL</a> = 64 /* built for internal processing */
+ <a name="XML_DOC_HTML">XML_DOC_HTML</a> = 128 /* parsed or built HTML document */
+};
+</pre><p/>
+</div>
+ <hr/>
<div class="refsect2" lang="en"><h3><a name="xmlDocPtr">Typedef </a>xmlDocPtr</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * xmlDocPtr;
</pre><p/>
</div>
@@ -567,7 +585,7 @@ void <a href="#xmlFreeNsList">xmlFreeNsList</a> (<a href="libxml2-tree.html#xm
struct _xmlEntity * nexte : unused
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI : the full URI as computed
int owner : does the entity own the childrens
- int checked : was the entity content checked
+ int checked : was the entity content checked this is also used to count entites * r
} xmlEntity;
</pre><p/>
</div>
@@ -757,6 +775,8 @@ void <a href="#xmlFreeNsList">xmlFreeNsList</a> (<a href="libxml2-tree.html#xm
<a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error informations 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
+ unsigned long sizeentities : size of parsed entities
} xmlParserCtxt;
</pre><p/>
</div>
diff --git a/doc/devhelp/libxml2-uri.html b/doc/devhelp/libxml2-uri.html
index c67dacf..8b33c4e 100644
--- a/doc/devhelp/libxml2-uri.html
+++ b/doc/devhelp/libxml2-uri.html
@@ -113,15 +113,15 @@ int <a href="#xmlParseURIReference">xmlParseURIReference</a> (<a href="libxml2-
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>pointer to the path string</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 or an error code</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseURI"/>xmlParseURI ()</h3><pre class="programlisting"><a href="libxml2-uri.html#xmlURIPtr">xmlURIPtr</a> xmlParseURI (const char * str)<br/>
-</pre><p>Parse an URI URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
+</pre><p>Parse an URI based on RFC 3986 URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the URI string to analyze</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a newly built <a href="libxml2-uri.html#xmlURIPtr">xmlURIPtr</a> or NULL in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseURIRaw"/>xmlParseURIRaw ()</h3><pre class="programlisting"><a href="libxml2-uri.html#xmlURIPtr">xmlURIPtr</a> xmlParseURIRaw (const char * str, <br/> int raw)<br/>
-</pre><p>Parse an URI but allows to keep intact the original fragments. URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
+</pre><p>Parse an URI but allows to keep intact the original fragments. URI-reference = URI / relative-ref</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the URI string to analyze</td></tr><tr><td><span class="term"><i><tt>raw</tt></i>:</span></td><td>if 1 unescaping of URI pieces are disabled</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a newly built <a href="libxml2-uri.html#xmlURIPtr">xmlURIPtr</a> or NULL in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlParseURIReference"/>xmlParseURIReference ()</h3><pre class="programlisting">int xmlParseURIReference (<a href="libxml2-uri.html#xmlURIPtr">xmlURIPtr</a> uri, <br/> const char * str)<br/>
-</pre><p>Parse an URI <a href="libxml2-SAX.html#reference">reference</a> string and fills in the appropriate fields of the @uri structure URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
+</pre><p>Parse an URI <a href="libxml2-SAX.html#reference">reference</a> string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = URI / relative-ref</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>pointer to an URI structure</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string to analyze</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 or the error code</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlPathToURI"/>xmlPathToURI ()</h3><pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlPathToURI (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * path)<br/>
diff --git a/doc/devhelp/libxml2-valid.html b/doc/devhelp/libxml2-valid.html
index 3480214..15b3371 100644
--- a/doc/devhelp/libxml2-valid.html
+++ b/doc/devhelp/libxml2-valid.html
@@ -443,8 +443,8 @@ 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>attr</tt></i>:</span></td><td>an <a href="libxml2-SAX.html#attribute">attribute</a> definition</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlValidateAttributeValue"/>xmlValidateAttributeValue ()</h3><pre class="programlisting">int xmlValidateAttributeValue (<a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br/>
-</pre><p>Validate that the given <a href="libxml2-SAX.html#attribute">attribute</a> value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>an <a href="libxml2-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>an <a href="libxml2-SAX.html#attribute">attribute</a> value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div></div>
+</pre><p/>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlValidateDocument"/>xmlValidateDocument ()</h3><pre class="programlisting">int xmlValidateDocument (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br/>
</pre><p>Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</p>
diff --git a/doc/devhelp/libxml2-xmlerror.html b/doc/devhelp/libxml2-xmlerror.html
index eaacd0b..cf445dd 100644
--- a/doc/devhelp/libxml2-xmlerror.html
+++ b/doc/devhelp/libxml2-xmlerror.html
@@ -247,11 +247,14 @@ void <a href="#xmlResetError">xmlResetError</a> (<a href="libxml2-xmlerror.htm
<a name="XML_ERR_NOTATION_PROCESSING">XML_ERR_NOTATION_PROCESSING</a> = 105 /* 105 */
<a name="XML_WAR_NS_COLUMN">XML_WAR_NS_COLUMN</a> = 106 /* 106 */
<a name="XML_WAR_ENTITY_REDEFINED">XML_WAR_ENTITY_REDEFINED</a> = 107 /* 107 */
+ <a name="XML_ERR_UNKNOWN_VERSION">XML_ERR_UNKNOWN_VERSION</a> = 108 /* 108 */
+ <a name="XML_ERR_VERSION_MISMATCH">XML_ERR_VERSION_MISMATCH</a> = 109 /* 109 */
<a name="XML_NS_ERR_XML_NAMESPACE">XML_NS_ERR_XML_NAMESPACE</a> = 200
<a name="XML_NS_ERR_UNDEFINED_NAMESPACE">XML_NS_ERR_UNDEFINED_NAMESPACE</a> = 201 /* 201 */
<a name="XML_NS_ERR_QNAME">XML_NS_ERR_QNAME</a> = 202 /* 202 */
<a name="XML_NS_ERR_ATTRIBUTE_REDEFINED">XML_NS_ERR_ATTRIBUTE_REDEFINED</a> = 203 /* 203 */
<a name="XML_NS_ERR_EMPTY">XML_NS_ERR_EMPTY</a> = 204 /* 204 */
+ <a name="XML_NS_ERR_COLON">XML_NS_ERR_COLON</a> = 205 /* 205 */
<a name="XML_DTD_ATTRIBUTE_DEFAULT">XML_DTD_ATTRIBUTE_DEFAULT</a> = 500
<a name="XML_DTD_ATTRIBUTE_REDEFINED">XML_DTD_ATTRIBUTE_REDEFINED</a> = 501 /* 501 */
<a name="XML_DTD_ATTRIBUTE_VALUE">XML_DTD_ATTRIBUTE_VALUE</a> = 502 /* 502 */
@@ -293,6 +296,7 @@ void <a href="#xmlResetError">xmlResetError</a> (<a href="libxml2-xmlerror.htm
<a name="XML_DTD_STANDALONE_DEFAULTED">XML_DTD_STANDALONE_DEFAULTED</a> = 538 /* 538 */
<a name="XML_DTD_XMLID_VALUE">XML_DTD_XMLID_VALUE</a> = 539 /* 539 */
<a name="XML_DTD_XMLID_TYPE">XML_DTD_XMLID_TYPE</a> = 540 /* 540 */
+ <a name="XML_DTD_DUP_TOKEN">XML_DTD_DUP_TOKEN</a> = 541 /* 541 */
<a name="XML_HTML_STRUCURE_ERROR">XML_HTML_STRUCURE_ERROR</a> = 800
<a name="XML_HTML_UNKNOWN_TAG">XML_HTML_UNKNOWN_TAG</a> = 801 /* 801 */
<a name="XML_RNGP_ANYNAME_ATTR_ANCESTOR">XML_RNGP_ANYNAME_ATTR_ANCESTOR</a> = 1000
diff --git a/doc/devhelp/libxml2-xmlmemory.html b/doc/devhelp/libxml2-xmlmemory.html
index eabbbf9..8610538 100644
--- a/doc/devhelp/libxml2-xmlmemory.html
+++ b/doc/devhelp/libxml2-xmlmemory.html
@@ -52,6 +52,7 @@ void * <a href="#xmlMemRealloc">xmlMemRealloc</a> (void * ptr, <br/> size
int <a href="#xmlInitMemory">xmlInitMemory</a> (void);
void <a href="#xmlMemFree">xmlMemFree</a> (void * ptr);
void * <a href="#xmlMemMalloc">xmlMemMalloc</a> (size_t size);
+void <a href="#xmlMemDisplayLast">xmlMemDisplayLast</a> (FILE * fp, <br/> long nbBytes);
int <a href="#xmlMemGet">xmlMemGet</a> (<a href="libxml2-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br/> <a href="libxml2-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br/> <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc);
void <a href="#xmlMemoryDump">xmlMemoryDump</a> (void);
void * <a href="#xmlMallocLoc">xmlMallocLoc</a> (size_t size, <br/> const char * file, <br/> int line);
@@ -131,6 +132,10 @@ char * <a href="#xmlMemStrdupLoc">xmlMemStrdupLoc</a> (const char * str, <br/>
</pre><p>show in-extenso the memory blocks allocated</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist</td></tr></tbody></table></div></div>
<hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlMemDisplayLast"/>xmlMemDisplayLast ()</h3><pre class="programlisting">void xmlMemDisplayLast (FILE * fp, <br/> long nbBytes)<br/>
+</pre><p>the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist</td></tr><tr><td><span class="term"><i><tt>nbBytes</tt></i>:</span></td><td>the amount of memory to dump</td></tr></tbody></table></div></div>
+ <hr/>
<div class="refsect2" lang="en"><h3><a name="xmlMemFree"/>xmlMemFree ()</h3><pre class="programlisting">void xmlMemFree (void * ptr)<br/>
</pre><p>a free() equivalent, with error checking.</p>
<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ptr</tt></i>:</span></td><td>the memory block pointer</td></tr></tbody></table></div></div>
diff --git a/doc/devhelp/libxml2-xmlreader.html b/doc/devhelp/libxml2-xmlreader.html
index 1609a96..2466e75 100644
--- a/doc/devhelp/libxml2-xmlreader.html
+++ b/doc/devhelp/libxml2-xmlreader.html
@@ -211,8 +211,8 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlTextReaderErrorFunc"/>Function type xmlTextReaderErrorFunc</h3><pre class="programlisting">void xmlTextReaderErrorFunc (void * arg, <br/> const char * msg, <br/> <a href="libxml2-xmlreader.html#xmlParserSeverities">xmlParserSeverities</a> severity, <br/> <a href="libxml2-xmlreader.html#xmlTextReaderLocatorPtr">xmlTextReaderLocatorPtr</a> locator)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>severity</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>locator</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Signature of an error callback from a reader parser</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>the user argument</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>severity</tt></i>:</span></td><td>the severity of the error</td></tr><tr><td><span class="term"><i><tt>locator</tt></i>:</span></td><td>a locator indicating where the error occured</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlFreeTextReader"/>xmlFreeTextReader ()</h3><pre class="programlisting">void xmlFreeTextReader (<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br/>
</pre><p>Deallocate all the resources associated to the reader</p>
diff --git a/doc/devhelp/libxml2-xmlregexp.html b/doc/devhelp/libxml2-xmlregexp.html
index e783648..4d11966 100644
--- a/doc/devhelp/libxml2-xmlregexp.html
+++ b/doc/devhelp/libxml2-xmlregexp.html
@@ -143,8 +143,8 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlRegExecCallbacks"/>Function type xmlRegExecCallbacks</h3><pre class="programlisting">void xmlRegExecCallbacks (<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br/> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * token, <br/> void * transdata, <br/> void * inputdata)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>token</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>transdata</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>inputdata</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="emptyExp">Variable </a>emptyExp</h3><pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> emptyExp;
</pre><p/>
diff --git a/doc/devhelp/libxml2-xmlschemas.html b/doc/devhelp/libxml2-xmlschemas.html
index 4801ea5..cc49dfa 100644
--- a/doc/devhelp/libxml2-xmlschemas.html
+++ b/doc/devhelp/libxml2-xmlschemas.html
@@ -68,7 +68,7 @@ void <a href="#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErr
void <a href="#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a> (<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);
int <a href="#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a> (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
int <a href="#xmlSchemaValidateFile">xmlSchemaValidateFile</a> (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> const char * filename, <br/> int options);
-int <a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a> (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> instance);
+int <a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a> (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
void <a href="#xmlSchemaFree">xmlSchemaFree</a> (<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> <a href="#xmlSchemaNewMemParserCtxt">xmlSchemaNewMemParserCtxt</a> (const char * buffer, <br/> int size);
int <a href="#xmlSchemaGetValidErrors">xmlSchemaGetValidErrors</a> (<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);
@@ -77,6 +77,7 @@ void <a href="#xmlSchemaSetParserErrors">xmlSchemaSetParserErrors</a> (<a href="
typedef void <a href="#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> (void * ctx, <br/> const char * msg, <br/> ... ...);
void <a href="#xmlSchemaDump">xmlSchemaDump</a> (FILE * output, <br/> <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
void <a href="#xmlSchemaFreeValidCtxt">xmlSchemaFreeValidCtxt</a> (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
+<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a> (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt);
void <a href="#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a> (<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br/> void * ctx);
<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> <a href="#xmlSchemaNewValidCtxt">xmlSchemaNewValidCtxt</a> (<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
</pre>
@@ -185,12 +186,12 @@ The content of this structure is not made public by the API.
</div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidityErrorFunc"/>Function type xmlSchemaValidityErrorFunc</h3><pre class="programlisting">void xmlSchemaValidityErrorFunc (void * ctx, <br/> const char * msg, <br/> ... ...)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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></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/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaDump"/>xmlSchemaDump ()</h3><pre class="programlisting">void xmlSchemaDump (FILE * output, <br/> <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br/>
</pre><p>Dump a Schema structure.</p>
@@ -205,20 +206,20 @@ 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 parser context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaFreeValidCtxt"/>xmlSchemaFreeValidCtxt ()</h3><pre class="programlisting">void xmlSchemaFreeValidCtxt (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Free the resources associated to the schema 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>the schema validation context</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaGetParserErrors"/>xmlSchemaGetParserErrors ()</h3><pre class="programlisting">int xmlSchemaGetParserErrors (<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</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 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></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/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Get the error and warning callback 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>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/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaNewDocParserCtxt"/>xmlSchemaNewDocParserCtxt ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> xmlSchemaNewDocParserCtxt (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br/>
</pre><p>Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.</p>
@@ -233,20 +234,20 @@ 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>URL</tt></i>:</span></td><td>the location of the schema</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context or NULL in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaNewValidCtxt"/>xmlSchemaNewValidCtxt ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> xmlSchemaNewValidCtxt (<a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>schema</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Create an XML Schemas validation context based on the given schema.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>schema</tt></i>:</span></td><td>a precompiled XML Schemas</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the validation context or NULL in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaParse"/>xmlSchemaParse ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> xmlSchemaParse (<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br/>
</pre><p>parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.</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>Returns</tt></i>:</span></td><td>the internal XML Schema structure built from the resource or NULL in case of error</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaSAXPlug"/>xmlSchemaSAXPlug ()</h3><pre class="programlisting"><a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> xmlSchemaSAXPlug (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> * sax, <br/> void ** user_data)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.</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>sax</tt></i>:</span></td><td>a pointer to the original <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a></td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>a pointer to the original SAX user data pointer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaSAXUnplug"/>xmlSchemaSAXUnplug ()</h3><pre class="programlisting">int xmlSchemaSAXUnplug (<a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>plug</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.</p>
+<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>plug</tt></i>:</span></td><td>a data structure returned by <a href="libxml2-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a></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 failure.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaSetParserErrors"/>xmlSchemaSetParserErrors ()</h3><pre class="programlisting">void xmlSchemaSetParserErrors (<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</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 callback functions used to handle errors for a validation context</p>
@@ -257,36 +258,40 @@ 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/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Set the error and warning callback 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>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/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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="libxml2-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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaSetValidStructuredErrors"/>xmlSchemaSetValidStructuredErrors ()</h3><pre class="programlisting">void xmlSchemaSetValidStructuredErrors (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br/> void * ctx)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</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 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></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidCtxtGetOptions"/>xmlSchemaValidCtxtGetOptions ()</h3><pre class="programlisting">int xmlSchemaValidCtxtGetOptions (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Get the validation context options.</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>Returns</tt></i>:</span></td><td>the option combination or -1 on error.</td></tr></tbody></table></div></div>
<hr/>
- <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateDoc"/>xmlSchemaValidateDoc ()</h3><pre class="programlisting">int xmlSchemaValidateDoc (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> instance)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>instance</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+ <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidCtxtGetParserCtxt"/>xmlSchemaValidCtxtGetParserCtxt ()</h3><pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlSchemaValidCtxtGetParserCtxt (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br/>
+</pre><p>allow access to the parser context of the schema 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 schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context of the schema validation context or NULL in case of error.</td></tr></tbody></table></div></div>
+ <hr/>
+ <div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateDoc"/>xmlSchemaValidateDoc ()</h3><pre class="programlisting">int xmlSchemaValidateDoc (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br/>
+</pre><p>Validate a document tree in 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>a schema validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a parsed document tree</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateFile"/>xmlSchemaValidateFile ()</h3><pre class="programlisting">int xmlSchemaValidateFile (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> const char * filename, <br/> int options)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Do a schemas validation of the given resource, it will use the SAX streamable validation internally.</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>filename</tt></i>:</span></td><td>the URI of the instance</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a future set of options, currently unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateOneElement"/>xmlSchemaValidateOneElement ()</h3><pre class="programlisting">int xmlSchemaValidateOneElement (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Validate a branch of a tree, starting with the given @elem.</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>elem</tt></i>:</span></td><td>an element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td></tr></tbody></table></div></div>
<hr/>
<div class="refsect2" lang="en"><h3><a name="xmlSchemaValidateStream"/>xmlSchemaValidateStream ()</h3><pre class="programlisting">int xmlSchemaValidateStream (<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br/> <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br/> <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br/> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br/> void * user_data)<br/>
-</pre><p/>
-<div class="variablelist"><table border="0"><col align="left"/><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td/></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td/></tr></tbody></table></div></div>
+</pre><p>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</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>input</tt></i>:</span></td><td>the input to use for reading the data</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>an optional encoding information</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>a SAX handler for the resulting events</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>the context to provide to the SAX handler.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td></tr></tbody></table></div></div>
<hr/>
</div>
</div>
diff --git a/doc/devhelp/libxml2.devhelp b/doc/devhelp/libxml2.devhelp
index 499bcb9..1288b18 100644
--- a/doc/devhelp/libxml2.devhelp
+++ b/doc/devhelp/libxml2.devhelp
@@ -339,6 +339,7 @@
<function name="XML_BUFFER_ALLOC_DOUBLEIT" link="libxml2-tree.html#XML_BUFFER_ALLOC_DOUBLEIT"/>
<function name="XML_BUFFER_ALLOC_EXACT" link="libxml2-tree.html#XML_BUFFER_ALLOC_EXACT"/>
<function name="XML_BUFFER_ALLOC_IMMUTABLE" link="libxml2-tree.html#XML_BUFFER_ALLOC_IMMUTABLE"/>
+ <function name="XML_BUFFER_ALLOC_IO" link="libxml2-tree.html#XML_BUFFER_ALLOC_IO"/>
<function name="XML_C14N_CREATE_CTXT" link="libxml2-xmlerror.html#XML_C14N_CREATE_CTXT"/>
<function name="XML_C14N_CREATE_STACK" link="libxml2-xmlerror.html#XML_C14N_CREATE_STACK"/>
<function name="XML_C14N_INVALID_NODE" link="libxml2-xmlerror.html#XML_C14N_INVALID_NODE"/>
@@ -427,6 +428,14 @@
<function name="XML_DOCUMENT_FRAG_NODE" link="libxml2-tree.html#XML_DOCUMENT_FRAG_NODE"/>
<function name="XML_DOCUMENT_NODE" link="libxml2-tree.html#XML_DOCUMENT_NODE"/>
<function name="XML_DOCUMENT_TYPE_NODE" link="libxml2-tree.html#XML_DOCUMENT_TYPE_NODE"/>
+ <function name="XML_DOC_DTDVALID" link="libxml2-tree.html#XML_DOC_DTDVALID"/>
+ <function name="XML_DOC_HTML" link="libxml2-tree.html#XML_DOC_HTML"/>
+ <function name="XML_DOC_INTERNAL" link="libxml2-tree.html#XML_DOC_INTERNAL"/>
+ <function name="XML_DOC_NSVALID" link="libxml2-tree.html#XML_DOC_NSVALID"/>
+ <function name="XML_DOC_OLD10" link="libxml2-tree.html#XML_DOC_OLD10"/>
+ <function name="XML_DOC_USERBUILT" link="libxml2-tree.html#XML_DOC_USERBUILT"/>
+ <function name="XML_DOC_WELLFORMED" link="libxml2-tree.html#XML_DOC_WELLFORMED"/>
+ <function name="XML_DOC_XINCLUDE" link="libxml2-tree.html#XML_DOC_XINCLUDE"/>
<function name="XML_DTD_ATTRIBUTE_DEFAULT" link="libxml2-xmlerror.html#XML_DTD_ATTRIBUTE_DEFAULT"/>
<function name="XML_DTD_ATTRIBUTE_REDEFINED" link="libxml2-xmlerror.html#XML_DTD_ATTRIBUTE_REDEFINED"/>
<function name="XML_DTD_ATTRIBUTE_VALUE" link="libxml2-xmlerror.html#XML_DTD_ATTRIBUTE_VALUE"/>
@@ -434,6 +443,7 @@
<function name="XML_DTD_CONTENT_MODEL" link="libxml2-xmlerror.html#XML_DTD_CONTENT_MODEL"/>
<function name="XML_DTD_CONTENT_NOT_DETERMINIST" link="libxml2-xmlerror.html#XML_DTD_CONTENT_NOT_DETERMINIST"/>
<function name="XML_DTD_DIFFERENT_PREFIX" link="libxml2-xmlerror.html#XML_DTD_DIFFERENT_PREFIX"/>
+ <function name="XML_DTD_DUP_TOKEN" link="libxml2-xmlerror.html#XML_DTD_DUP_TOKEN"/>
<function name="XML_DTD_ELEM_DEFAULT_NAMESPACE" link="libxml2-xmlerror.html#XML_DTD_ELEM_DEFAULT_NAMESPACE"/>
<function name="XML_DTD_ELEM_NAMESPACE" link="libxml2-xmlerror.html#XML_DTD_ELEM_NAMESPACE"/>
<function name="XML_DTD_ELEM_REDEFINED" link="libxml2-xmlerror.html#XML_DTD_ELEM_REDEFINED"/>
@@ -581,11 +591,13 @@
<function name="XML_ERR_TAG_NOT_FINISHED" link="libxml2-xmlerror.html#XML_ERR_TAG_NOT_FINISHED"/>
<function name="XML_ERR_UNDECLARED_ENTITY" link="libxml2-xmlerror.html#XML_ERR_UNDECLARED_ENTITY"/>
<function name="XML_ERR_UNKNOWN_ENCODING" link="libxml2-xmlerror.html#XML_ERR_UNKNOWN_ENCODING"/>
+ <function name="XML_ERR_UNKNOWN_VERSION" link="libxml2-xmlerror.html#XML_ERR_UNKNOWN_VERSION"/>
<function name="XML_ERR_UNPARSED_ENTITY" link="libxml2-xmlerror.html#XML_ERR_UNPARSED_ENTITY"/>
<function name="XML_ERR_UNSUPPORTED_ENCODING" link="libxml2-xmlerror.html#XML_ERR_UNSUPPORTED_ENCODING"/>
<function name="XML_ERR_URI_FRAGMENT" link="libxml2-xmlerror.html#XML_ERR_URI_FRAGMENT"/>
<function name="XML_ERR_URI_REQUIRED" link="libxml2-xmlerror.html#XML_ERR_URI_REQUIRED"/>
<function name="XML_ERR_VALUE_REQUIRED" link="libxml2-xmlerror.html#XML_ERR_VALUE_REQUIRED"/>
+ <function name="XML_ERR_VERSION_MISMATCH" link="libxml2-xmlerror.html#XML_ERR_VERSION_MISMATCH"/>
<function name="XML_ERR_VERSION_MISSING" link="libxml2-xmlerror.html#XML_ERR_VERSION_MISSING"/>
<function name="XML_ERR_WARNING" link="libxml2-xmlerror.html#XML_ERR_WARNING"/>
<function name="XML_ERR_XMLDECL_NOT_FINISHED" link="libxml2-xmlerror.html#XML_ERR_XMLDECL_NOT_FINISHED"/>
@@ -710,6 +722,7 @@
<function name="XML_NAMESPACE_DECL" link="libxml2-tree.html#XML_NAMESPACE_DECL"/>
<function name="XML_NOTATION_NODE" link="libxml2-tree.html#XML_NOTATION_NODE"/>
<function name="XML_NS_ERR_ATTRIBUTE_REDEFINED" link="libxml2-xmlerror.html#XML_NS_ERR_ATTRIBUTE_REDEFINED"/>
+ <function name="XML_NS_ERR_COLON" link="libxml2-xmlerror.html#XML_NS_ERR_COLON"/>
<function name="XML_NS_ERR_EMPTY" link="libxml2-xmlerror.html#XML_NS_ERR_EMPTY"/>
<function name="XML_NS_ERR_QNAME" link="libxml2-xmlerror.html#XML_NS_ERR_QNAME"/>
<function name="XML_NS_ERR_UNDEFINED_NAMESPACE" link="libxml2-xmlerror.html#XML_NS_ERR_UNDEFINED_NAMESPACE"/>
@@ -745,6 +758,8 @@
<function name="XML_PARSE_DTDATTR" link="libxml2-parser.html#XML_PARSE_DTDATTR"/>
<function name="XML_PARSE_DTDLOAD" link="libxml2-parser.html#XML_PARSE_DTDLOAD"/>
<function name="XML_PARSE_DTDVALID" link="libxml2-parser.html#XML_PARSE_DTDVALID"/>
+ <function name="XML_PARSE_HUGE" link="libxml2-parser.html#XML_PARSE_HUGE"/>
+ <function name="XML_PARSE_NOBASEFIX" link="libxml2-parser.html#XML_PARSE_NOBASEFIX"/>
<function name="XML_PARSE_NOBLANKS" link="libxml2-parser.html#XML_PARSE_NOBLANKS"/>
<function name="XML_PARSE_NOCDATA" link="libxml2-parser.html#XML_PARSE_NOCDATA"/>
<function name="XML_PARSE_NODICT" link="libxml2-parser.html#XML_PARSE_NODICT"/>
@@ -754,6 +769,7 @@
<function name="XML_PARSE_NOWARNING" link="libxml2-parser.html#XML_PARSE_NOWARNING"/>
<function name="XML_PARSE_NOXINCNODE" link="libxml2-parser.html#XML_PARSE_NOXINCNODE"/>
<function name="XML_PARSE_NSCLEAN" link="libxml2-parser.html#XML_PARSE_NSCLEAN"/>
+ <function name="XML_PARSE_OLD10" link="libxml2-parser.html#XML_PARSE_OLD10"/>
<function name="XML_PARSE_PEDANTIC" link="libxml2-parser.html#XML_PARSE_PEDANTIC"/>
<function name="XML_PARSE_PUSH_DOM" link="libxml2-parser.html#XML_PARSE_PUSH_DOM"/>
<function name="XML_PARSE_PUSH_SAX" link="libxml2-parser.html#XML_PARSE_PUSH_SAX"/>
@@ -1547,6 +1563,7 @@
<function name="xmlCharEncodingHandlerPtr" link="libxml2-encoding.html#xmlCharEncodingHandlerPtr"/>
<function name="xmlDOMWrapCtxtPtr" link="libxml2-tree.html#xmlDOMWrapCtxtPtr"/>
<function name="xmlDictPtr" link="libxml2-dict.html#xmlDictPtr"/>
+ <function name="xmlDocProperties" link="libxml2-tree.html#xmlDocProperties"/>
<function name="xmlDocPtr" link="libxml2-tree.html#xmlDocPtr"/>
<function name="xmlDtdPtr" link="libxml2-tree.html#xmlDtdPtr"/>
<function name="xmlElementContentOccur" link="libxml2-tree.html#xmlElementContentOccur"/>
@@ -2414,6 +2431,7 @@
<function name="xmlMallocLoc ()" link="libxml2-xmlmemory.html#xmlMallocLoc"/>
<function name="xmlMemBlocks ()" link="libxml2-xmlmemory.html#xmlMemBlocks"/>
<function name="xmlMemDisplay ()" link="libxml2-xmlmemory.html#xmlMemDisplay"/>
+ <function name="xmlMemDisplayLast ()" link="libxml2-xmlmemory.html#xmlMemDisplayLast"/>
<function name="xmlMemFree ()" link="libxml2-xmlmemory.html#xmlMemFree"/>
<function name="xmlMemGet ()" link="libxml2-xmlmemory.html#xmlMemGet"/>
<function name="xmlMemMalloc ()" link="libxml2-xmlmemory.html#xmlMemMalloc"/>
@@ -2492,6 +2510,7 @@
<function name="xmlNewDocTextLen ()" link="libxml2-tree.html#xmlNewDocTextLen"/>
<function name="xmlNewDtd ()" link="libxml2-tree.html#xmlNewDtd"/>
<function name="xmlNewElementContent ()" link="libxml2-valid.html#xmlNewElementContent"/>
+ <function name="xmlNewEntity ()" link="libxml2-entities.html#xmlNewEntity"/>
<function name="xmlNewEntityInputStream ()" link="libxml2-parserInternals.html#xmlNewEntityInputStream"/>
<function name="xmlNewGlobalNs ()" link="libxml2-tree.html#xmlNewGlobalNs"/>
<function name="xmlNewIOInputStream ()" link="libxml2-parser.html#xmlNewIOInputStream"/>
@@ -2835,6 +2854,7 @@
<function name="xmlSchemaValPredefTypeNode ()" link="libxml2-xmlschemastypes.html#xmlSchemaValPredefTypeNode"/>
<function name="xmlSchemaValPredefTypeNodeNoNorm ()" link="libxml2-xmlschemastypes.html#xmlSchemaValPredefTypeNodeNoNorm"/>
<function name="xmlSchemaValidCtxtGetOptions ()" link="libxml2-xmlschemas.html#xmlSchemaValidCtxtGetOptions"/>
+ <function name="xmlSchemaValidCtxtGetParserCtxt ()" link="libxml2-xmlschemas.html#xmlSchemaValidCtxtGetParserCtxt"/>
<function name="xmlSchemaValidateDoc ()" link="libxml2-xmlschemas.html#xmlSchemaValidateDoc"/>
<function name="xmlSchemaValidateFacet ()" link="libxml2-xmlschemastypes.html#xmlSchemaValidateFacet"/>
<function name="xmlSchemaValidateFacetWhtsp ()" link="libxml2-xmlschemastypes.html#xmlSchemaValidateFacetWhtsp"/>
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index d1beee5..d0f42aa 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -15,75 +15,65 @@ install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
-EXTRA_DIST=examples.xsl index.py examples.xml writer.xml test3.xml tst.xml test1.xml test2.xml io2.res xpath2.res tree1.res reader4.res io1.res tree2.res reader3.res xpath1.res reader1.res
+EXTRA_DIST=examples.xsl index.py test1.xml examples.xml test2.xml tst.xml writer.xml test3.xml tree2.res xpath1.res reader1.res reader3.res reader4.res io1.res xpath2.res io2.res tree1.res
-noinst_PROGRAMS=xpath2 reader1 reader4 parse2 reader2 parse3 reader3 tree2 parse4 io2 testWriter io1 xpath1 parse1 tree1
+noinst_PROGRAMS=reader2 xpath2 xpath1 parse3 io2 tree2 reader1 testWriter parse4 reader3 io1 parse1 tree1 reader4 parse2
+
+reader2_SOURCES=reader2.c
+reader2_LDFLAGS=
+reader2_DEPENDENCIES= $(DEPS)
+reader2_LDADD= @RDL_LIBS@ $(LDADDS)
xpath2_SOURCES=xpath2.c
xpath2_LDFLAGS=
xpath2_DEPENDENCIES= $(DEPS)
xpath2_LDADD= @RDL_LIBS@ $(LDADDS)
-reader1_SOURCES=reader1.c
-reader1_LDFLAGS=
-reader1_DEPENDENCIES= $(DEPS)
-reader1_LDADD= @RDL_LIBS@ $(LDADDS)
-
-reader4_SOURCES=reader4.c
-reader4_LDFLAGS=
-reader4_DEPENDENCIES= $(DEPS)
-reader4_LDADD= @RDL_LIBS@ $(LDADDS)
-
-parse2_SOURCES=parse2.c
-parse2_LDFLAGS=
-parse2_DEPENDENCIES= $(DEPS)
-parse2_LDADD= @RDL_LIBS@ $(LDADDS)
-
-reader2_SOURCES=reader2.c
-reader2_LDFLAGS=
-reader2_DEPENDENCIES= $(DEPS)
-reader2_LDADD= @RDL_LIBS@ $(LDADDS)
+xpath1_SOURCES=xpath1.c
+xpath1_LDFLAGS=
+xpath1_DEPENDENCIES= $(DEPS)
+xpath1_LDADD= @RDL_LIBS@ $(LDADDS)
parse3_SOURCES=parse3.c
parse3_LDFLAGS=
parse3_DEPENDENCIES= $(DEPS)
parse3_LDADD= @RDL_LIBS@ $(LDADDS)
-reader3_SOURCES=reader3.c
-reader3_LDFLAGS=
-reader3_DEPENDENCIES= $(DEPS)
-reader3_LDADD= @RDL_LIBS@ $(LDADDS)
+io2_SOURCES=io2.c
+io2_LDFLAGS=
+io2_DEPENDENCIES= $(DEPS)
+io2_LDADD= @RDL_LIBS@ $(LDADDS)
tree2_SOURCES=tree2.c
tree2_LDFLAGS=
tree2_DEPENDENCIES= $(DEPS)
tree2_LDADD= @RDL_LIBS@ $(LDADDS)
-parse4_SOURCES=parse4.c
-parse4_LDFLAGS=
-parse4_DEPENDENCIES= $(DEPS)
-parse4_LDADD= @RDL_LIBS@ $(LDADDS)
-
-io2_SOURCES=io2.c
-io2_LDFLAGS=
-io2_DEPENDENCIES= $(DEPS)
-io2_LDADD= @RDL_LIBS@ $(LDADDS)
+reader1_SOURCES=reader1.c
+reader1_LDFLAGS=
+reader1_DEPENDENCIES= $(DEPS)
+reader1_LDADD= @RDL_LIBS@ $(LDADDS)
testWriter_SOURCES=testWriter.c
testWriter_LDFLAGS=
testWriter_DEPENDENCIES= $(DEPS)
testWriter_LDADD= @RDL_LIBS@ $(LDADDS)
+parse4_SOURCES=parse4.c
+parse4_LDFLAGS=
+parse4_DEPENDENCIES= $(DEPS)
+parse4_LDADD= @RDL_LIBS@ $(LDADDS)
+
+reader3_SOURCES=reader3.c
+reader3_LDFLAGS=
+reader3_DEPENDENCIES= $(DEPS)
+reader3_LDADD= @RDL_LIBS@ $(LDADDS)
+
io1_SOURCES=io1.c
io1_LDFLAGS=
io1_DEPENDENCIES= $(DEPS)
io1_LDADD= @RDL_LIBS@ $(LDADDS)
-xpath1_SOURCES=xpath1.c
-xpath1_LDFLAGS=
-xpath1_DEPENDENCIES= $(DEPS)
-xpath1_LDADD= @RDL_LIBS@ $(LDADDS)
-
parse1_SOURCES=parse1.c
parse1_LDFLAGS=
parse1_DEPENDENCIES= $(DEPS)
@@ -94,41 +84,51 @@ tree1_LDFLAGS=
tree1_DEPENDENCIES= $(DEPS)
tree1_LDADD= @RDL_LIBS@ $(LDADDS)
+reader4_SOURCES=reader4.c
+reader4_LDFLAGS=
+reader4_DEPENDENCIES= $(DEPS)
+reader4_LDADD= @RDL_LIBS@ $(LDADDS)
+
+parse2_SOURCES=parse2.c
+parse2_LDFLAGS=
+parse2_DEPENDENCIES= $(DEPS)
+parse2_LDADD= @RDL_LIBS@ $(LDADDS)
+
valgrind:
$(MAKE) CHECKER='valgrind' tests
tests: $(noinst_PROGRAMS)
@(echo '## examples regression tests')
@(echo > .memdump)
- @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp)
- @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
- @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp)
+ @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./parse2 test2.xml)
+ @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
+ @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./parse3)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp)
+ @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./parse4 test3.xml)
- @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp)
+ @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp)
+ @($(CHECKER) ./parse4 test3.xml)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp)
+ @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp)
+ @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
+ @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./parse1 test1.xml)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
+ @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp)
+ @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
+ @($(CHECKER) ./parse2 test2.xml)
+ @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
diff --git a/doc/examples/Makefile.in b/doc/examples/Makefile.in
index 14681b4..025ef95 100644
--- a/doc/examples/Makefile.in
+++ b/doc/examples/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -32,11 +32,11 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
-noinst_PROGRAMS = xpath2$(EXEEXT) reader1$(EXEEXT) reader4$(EXEEXT) \
- parse2$(EXEEXT) reader2$(EXEEXT) parse3$(EXEEXT) \
- reader3$(EXEEXT) tree2$(EXEEXT) parse4$(EXEEXT) io2$(EXEEXT) \
- testWriter$(EXEEXT) io1$(EXEEXT) xpath1$(EXEEXT) \
- parse1$(EXEEXT) tree1$(EXEEXT)
+noinst_PROGRAMS = reader2$(EXEEXT) xpath2$(EXEEXT) xpath1$(EXEEXT) \
+ parse3$(EXEEXT) io2$(EXEEXT) tree2$(EXEEXT) reader1$(EXEEXT) \
+ testWriter$(EXEEXT) parse4$(EXEEXT) reader3$(EXEEXT) \
+ io1$(EXEEXT) parse1$(EXEEXT) tree1$(EXEEXT) reader4$(EXEEXT) \
+ parse2$(EXEEXT)
subdir = doc/examples
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -125,7 +125,7 @@ xpath2_OBJECTS = $(am_xpath2_OBJECTS)
xpath2_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(xpath2_LDFLAGS) \
$(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -370,59 +370,51 @@ top_srcdir = @top_srcdir@
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@
DEPS = $(top_builddir)/libxml2.la
LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@
-EXTRA_DIST = examples.xsl index.py examples.xml writer.xml test3.xml tst.xml test1.xml test2.xml io2.res xpath2.res tree1.res reader4.res io1.res tree2.res reader3.res xpath1.res reader1.res
-xpath2_SOURCES = xpath2.c
-xpath2_LDFLAGS =
-xpath2_DEPENDENCIES = $(DEPS)
-xpath2_LDADD = @RDL_LIBS@ $(LDADDS)
-reader1_SOURCES = reader1.c
-reader1_LDFLAGS =
-reader1_DEPENDENCIES = $(DEPS)
-reader1_LDADD = @RDL_LIBS@ $(LDADDS)
-reader4_SOURCES = reader4.c
-reader4_LDFLAGS =
-reader4_DEPENDENCIES = $(DEPS)
-reader4_LDADD = @RDL_LIBS@ $(LDADDS)
-parse2_SOURCES = parse2.c
-parse2_LDFLAGS =
-parse2_DEPENDENCIES = $(DEPS)
-parse2_LDADD = @RDL_LIBS@ $(LDADDS)
+EXTRA_DIST = examples.xsl index.py test1.xml examples.xml test2.xml tst.xml writer.xml test3.xml tree2.res xpath1.res reader1.res reader3.res reader4.res io1.res xpath2.res io2.res tree1.res
reader2_SOURCES = reader2.c
reader2_LDFLAGS =
reader2_DEPENDENCIES = $(DEPS)
reader2_LDADD = @RDL_LIBS@ $(LDADDS)
+xpath2_SOURCES = xpath2.c
+xpath2_LDFLAGS =
+xpath2_DEPENDENCIES = $(DEPS)
+xpath2_LDADD = @RDL_LIBS@ $(LDADDS)
+xpath1_SOURCES = xpath1.c
+xpath1_LDFLAGS =
+xpath1_DEPENDENCIES = $(DEPS)
+xpath1_LDADD = @RDL_LIBS@ $(LDADDS)
parse3_SOURCES = parse3.c
parse3_LDFLAGS =
parse3_DEPENDENCIES = $(DEPS)
parse3_LDADD = @RDL_LIBS@ $(LDADDS)
-reader3_SOURCES = reader3.c
-reader3_LDFLAGS =
-reader3_DEPENDENCIES = $(DEPS)
-reader3_LDADD = @RDL_LIBS@ $(LDADDS)
-tree2_SOURCES = tree2.c
-tree2_LDFLAGS =
-tree2_DEPENDENCIES = $(DEPS)
-tree2_LDADD = @RDL_LIBS@ $(LDADDS)
-parse4_SOURCES = parse4.c
-parse4_LDFLAGS =
-parse4_DEPENDENCIES = $(DEPS)
-parse4_LDADD = @RDL_LIBS@ $(LDADDS)
io2_SOURCES = io2.c
io2_LDFLAGS =
io2_DEPENDENCIES = $(DEPS)
io2_LDADD = @RDL_LIBS@ $(LDADDS)
+tree2_SOURCES = tree2.c
+tree2_LDFLAGS =
+tree2_DEPENDENCIES = $(DEPS)
+tree2_LDADD = @RDL_LIBS@ $(LDADDS)
+reader1_SOURCES = reader1.c
+reader1_LDFLAGS =
+reader1_DEPENDENCIES = $(DEPS)
+reader1_LDADD = @RDL_LIBS@ $(LDADDS)
testWriter_SOURCES = testWriter.c
testWriter_LDFLAGS =
testWriter_DEPENDENCIES = $(DEPS)
testWriter_LDADD = @RDL_LIBS@ $(LDADDS)
+parse4_SOURCES = parse4.c
+parse4_LDFLAGS =
+parse4_DEPENDENCIES = $(DEPS)
+parse4_LDADD = @RDL_LIBS@ $(LDADDS)
+reader3_SOURCES = reader3.c
+reader3_LDFLAGS =
+reader3_DEPENDENCIES = $(DEPS)
+reader3_LDADD = @RDL_LIBS@ $(LDADDS)
io1_SOURCES = io1.c
io1_LDFLAGS =
io1_DEPENDENCIES = $(DEPS)
io1_LDADD = @RDL_LIBS@ $(LDADDS)
-xpath1_SOURCES = xpath1.c
-xpath1_LDFLAGS =
-xpath1_DEPENDENCIES = $(DEPS)
-xpath1_LDADD = @RDL_LIBS@ $(LDADDS)
parse1_SOURCES = parse1.c
parse1_LDFLAGS =
parse1_DEPENDENCIES = $(DEPS)
@@ -431,6 +423,14 @@ tree1_SOURCES = tree1.c
tree1_LDFLAGS =
tree1_DEPENDENCIES = $(DEPS)
tree1_LDADD = @RDL_LIBS@ $(LDADDS)
+reader4_SOURCES = reader4.c
+reader4_LDFLAGS =
+reader4_DEPENDENCIES = $(DEPS)
+reader4_LDADD = @RDL_LIBS@ $(LDADDS)
+parse2_SOURCES = parse2.c
+parse2_LDFLAGS =
+parse2_DEPENDENCIES = $(DEPS)
+parse2_LDADD = @RDL_LIBS@ $(LDADDS)
all: all-am
.SUFFIXES:
@@ -571,8 +571,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -584,8 +584,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -595,13 +595,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
@@ -762,36 +761,36 @@ valgrind:
tests: $(noinst_PROGRAMS)
@(echo '## examples regression tests')
@(echo > .memdump)
- @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp)
- @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
- @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp)
+ @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./parse2 test2.xml)
+ @($(CHECKER) ./xpath2 test3.xml '//discarded' discarded > xpath2.tmp ; diff xpath2.tmp xpath2.res ; rm xpath2.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader2 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
+ @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./parse3)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp)
+ @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./tree2 > tree2.tmp ; diff tree2.tmp tree2.res ; rm tree2.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./parse4 test3.xml)
- @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./io2 > io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp)
+ @($(CHECKER) ./reader1 test2.xml > reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./testWriter ; for i in 1 2 3 4 ; do diff writer.xml writer$$i.res ; done ; rm writer*.res)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp)
+ @($(CHECKER) ./parse4 test3.xml)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
- @($(CHECKER) ././xpath1 test3.xml '//child2' > xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp)
+ @($(CHECKER) ./reader3 > reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp)
+ @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
+ @($(CHECKER) ./io1 > io1.tmp ; diff io1.tmp io1.res ; rm -f io1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./parse1 test1.xml)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
@($(CHECKER) ./tree1 test2.xml > tree1.tmp ; diff tree1.tmp tree1.res ; rm tree1.tmp)
@(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
+ @($(CHECKER) ./reader4 test1.xml test2.xml test3.xml > reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp)
+ @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
+ @($(CHECKER) ./parse2 test2.xml)
+ @(grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml
index 2a0827b..a237a0e 100644
--- a/doc/examples/examples.xml
+++ b/doc/examples/examples.xml
@@ -1,4 +1,36 @@
<examples>
+ <example filename='reader2.c'>
+ <synopsis>Parse and validate an XML file with an xmlReader</synopsis>
+ <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
+ <usage>reader2 &lt;valid_xml_filename&gt;</usage>
+ <test>reader2 test2.xml &gt; reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
+ <author>Daniel Veillard</author>
+ <copy>see Copyright for the status of this software. </copy>
+ <section>xmlReader</section>
+ <includes>
+ <include>&lt;libxml/xmlreader.h&gt;</include>
+ </includes>
+ <uses>
+ <function line='45' file='xmlstring' name='xmlStrlen'/>
+ <function line='109' file='parser' name='xmlCleanupParser'/>
+ <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/>
+ <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/>
+ <function line='113' file='xmlmemory' name='xmlMemoryDump'/>
+ <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/>
+ <enum line='70' file='parser' name='XML_PARSE_NOENT'/>
+ <function line='37' file='xmlreader' name='xmlTextReaderDepth'/>
+ <enum line='71' file='parser' name='XML_PARSE_DTDVALID'/>
+ <enum line='69' file='parser' name='XML_PARSE_DTDATTR'/>
+ <function line='84' file='xmlreader' name='xmlFreeTextReader'/>
+ <macro line='104' file='xmlversion' name='LIBXML_TEST_VERSION'/>
+ <function line='30' file='xmlreader' name='xmlTextReaderConstName'/>
+ <function line='41' file='xmlreader' name='xmlTextReaderHasValue'/>
+ <function line='76' file='xmlreader' name='xmlTextReaderRead'/>
+ <function line='40' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
+ <function line='68' file='xmlreader' name='xmlReaderForFile'/>
+ <function line='81' file='xmlreader' name='xmlTextReaderIsValid'/>
+ </uses>
+ </example>
<example filename='xpath2.c'>
<synopsis>Load a document, locate subelements with XPath, modify said elements and save the resulting document.</synopsis>
<purpose>Shows how to make a full round-trip from a load/edit/save</purpose>
@@ -32,114 +64,42 @@
<typedef line='86' file='tree' name='xmlDocPtr'/>
</uses>
</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>
- <usage>reader1 &lt;filename&gt;</usage>
- <test>reader1 test2.xml &gt; reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
- <author>Daniel Veillard</author>
- <copy>see Copyright for the status of this software. </copy>
- <section>xmlReader</section>
- <includes>
- <include>&lt;libxml/xmlreader.h&gt;</include>
- </includes>
- <uses>
- <function line='44' file='xmlstring' name='xmlStrlen'/>
- <function line='94' file='parser' name='xmlCleanupParser'/>
- <function line='37' file='xmlreader' name='xmlTextReaderNodeType'/>
- <typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/>
- <function line='98' file='xmlmemory' name='xmlMemoryDump'/>
- <function line='33' file='xmlreader' name='xmlTextReaderConstValue'/>
- <function line='36' file='xmlreader' name='xmlTextReaderDepth'/>
- <function line='69' file='xmlreader' name='xmlFreeTextReader'/>
- <macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='29' file='xmlreader' name='xmlTextReaderConstName'/>
- <function line='40' file='xmlreader' name='xmlTextReaderHasValue'/>
- <function line='67' file='xmlreader' name='xmlTextReaderRead'/>
- <function line='39' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
- <function line='62' file='xmlreader' name='xmlReaderForFile'/>
- </uses>
- </example>
- <example filename='reader4.c'>
- <synopsis>Parse multiple XML files reusing an xmlReader</synopsis>
- <purpose>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
- <usage>reader4 &lt;filename&gt; [ filename ... ]</usage>
- <test>reader4 test1.xml test2.xml test3.xml &gt; reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp</test>
- <author>Graham Bennett</author>
- <copy>see Copyright for the status of this software. </copy>
- <section>xmlReader</section>
- <includes>
- <include>&lt;libxml/xmlreader.h&gt;</include>
- </includes>
- <uses>
- <function line='99' file='tree' name='xmlFreeDoc'/>
- <typedef line='54' file='xmlreader' name='xmlTextReaderPtr'/>
- <function line='109' file='parser' name='xmlCleanupParser'/>
- <function line='113' file='xmlmemory' name='xmlMemoryDump'/>
- <function line='83' file='xmlreader' name='xmlReaderNewFile'/>
- <function line='104' file='xmlreader' name='xmlFreeTextReader'/>
- <macro line='72' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='26' file='xmlreader' name='xmlTextReaderRead'/>
- <function line='97' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
- <function line='72' file='xmlreader' name='xmlReaderForFile'/>
- <typedef line='56' file='tree' name='xmlDocPtr'/>
- </uses>
- </example>
- <example filename='parse2.c'>
- <synopsis>Parse and validate an XML file to a tree and free the result</synopsis>
- <purpose>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</purpose>
- <usage>parse2 test2.xml</usage>
- <test>parse2 test2.xml</test>
- <author>Daniel Veillard</author>
+ <example filename='xpath1.c'>
+ <synopsis>Evaluate XPath expression and prints result node set.</synopsis>
+ <purpose>Shows how to evaluate XPath expression and register known namespaces in XPath context.</purpose>
+ <usage>xpath1 &lt;xml-file&gt; &lt;xpath-expr&gt; [&lt;known-ns-list&gt;]</usage>
+ <test>./xpath1 test3.xml &apos;//child2&apos; &gt; xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp</test>
+ <author>Aleksey Sanin</author>
<copy>see Copyright for the status of this software. </copy>
- <section>Parsing</section>
+ <section>XPath</section>
<includes>
- <include>&lt;libxml/tree.h&gt;</include>
<include>&lt;libxml/parser.h&gt;</include>
+ <include>&lt;libxml/xpath.h&gt;</include>
+ <include>&lt;libxml/xpathInternals.h&gt;</include>
+ <include>&lt;libxml/tree.h&gt;</include>
</includes>
<uses>
- <function line='47' file='parser' name='xmlFreeParserCtxt'/>
- <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/>
- <function line='29' file='parser' name='xmlNewParserCtxt'/>
- <typedef line='25' file='tree' name='xmlParserCtxtPtr'/>
- <function line='35' file='parser' name='xmlCtxtReadFile'/>
- <function line='66' file='parser' name='xmlCleanupParser'/>
- <macro line='61' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='44' file='tree' name='xmlFreeDoc'/>
- <typedef line='26' file='tree' name='xmlDocPtr'/>
- <function line='70' file='xmlmemory' name='xmlMemoryDump'/>
- </uses>
- </example>
- <example filename='reader2.c'>
- <synopsis>Parse and validate an XML file with an xmlReader</synopsis>
- <purpose>Demonstrate the use of xmlReaderForFile() to parse an XML file validating the content in the process and activating options like entities substitution, and DTD attributes defaulting. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
- <usage>reader2 &lt;valid_xml_filename&gt;</usage>
- <test>reader2 test2.xml &gt; reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
- <author>Daniel Veillard</author>
- <copy>see Copyright for the status of this software. </copy>
- <section>xmlReader</section>
- <includes>
- <include>&lt;libxml/xmlreader.h&gt;</include>
- </includes>
- <uses>
- <function line='45' file='xmlstring' name='xmlStrlen'/>
- <function line='109' file='parser' name='xmlCleanupParser'/>
- <function line='38' file='xmlreader' name='xmlTextReaderNodeType'/>
- <typedef line='60' file='xmlreader' name='xmlTextReaderPtr'/>
- <function line='113' file='xmlmemory' name='xmlMemoryDump'/>
- <function line='34' file='xmlreader' name='xmlTextReaderConstValue'/>
- <enum line='70' file='parser' name='XML_PARSE_NOENT'/>
- <function line='37' file='xmlreader' name='xmlTextReaderDepth'/>
- <enum line='71' file='parser' name='XML_PARSE_DTDVALID'/>
- <enum line='69' file='parser' name='XML_PARSE_DTDATTR'/>
- <function line='84' file='xmlreader' name='xmlFreeTextReader'/>
- <macro line='104' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='30' file='xmlreader' name='xmlTextReaderConstName'/>
- <function line='41' file='xmlreader' name='xmlTextReaderHasValue'/>
- <function line='76' file='xmlreader' name='xmlTextReaderRead'/>
- <function line='40' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
- <function line='68' file='xmlreader' name='xmlReaderForFile'/>
- <function line='81' file='xmlreader' name='xmlTextReaderIsValid'/>
+ <enum line='229' file='tree' name='XML_ELEMENT_NODE'/>
+ <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
+ <function line='54' file='xmlmemory' name='xmlMemoryDump'/>
+ <function line='117' file='xpath' name='xmlXPathEvalExpression'/>
+ <function line='94' file='parser' name='xmlParseFile'/>
+ <function line='186' file='xpathInternals' name='xmlXPathRegisterNs'/>
+ <function line='129' file='xpath' name='xmlXPathFreeObject'/>
+ <variable line='193' file='globals' name='xmlFree'/>
+ <typedef line='218' file='tree' name='xmlNsPtr'/>
+ <function line='101' file='xpath' name='xmlXPathNewContext'/>
+ <function line='49' file='parser' name='xmlCleanupParser'/>
+ <macro line='43' file='xmlversion' name='LIBXML_TEST_VERSION'/>
+ <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
+ <function line='130' file='xpath' name='xmlXPathFreeContext'/>
+ <function line='39' file='parser' name='xmlInitParser'/>
+ <function line='156' file='xmlstring' name='xmlStrdup'/>
+ <function line='131' file='tree' name='xmlFreeDoc'/>
+ <function line='180' file='xmlstring' name='xmlStrchr'/>
+ <typedef line='206' file='tree' name='xmlNodePtr'/>
+ <typedef line='86' file='tree' name='xmlDocPtr'/>
+ <enum line='217' file='tree' name='XML_NAMESPACE_DECL'/>
</uses>
</example>
<example filename='parse3.c'>
@@ -163,27 +123,27 @@
<typedef line='27' file='tree' name='xmlDocPtr'/>
</uses>
</example>
- <example filename='reader3.c'>
- <synopsis>Show how to extract subdocuments with xmlReader</synopsis>
- <purpose>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
- <usage>reader3</usage>
- <test>reader3 &gt; reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp</test>
- <author>Daniel Veillard</author>
+ <example filename='io2.c'>
+ <synopsis>Output to char buffer</synopsis>
+ <purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose>
+ <usage>io2</usage>
+ <test>io2 &gt; io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp</test>
+ <author>John Fleck</author>
<copy>see Copyright for the status of this software. </copy>
- <section>xmlReader</section>
+ <section>InputOutput</section>
<includes>
- <include>&lt;libxml/xmlreader.h&gt;</include>
+ <include>&lt;libxml/parser.h&gt;</include>
</includes>
<uses>
- <typedef line='31' file='xmlreader' name='xmlTextReaderPtr'/>
- <function line='99' file='tree' name='xmlFreeDoc'/>
- <function line='65' file='xmlreader' name='xmlFreeTextReader'/>
- <function line='95' file='tree' name='xmlDocDump'/>
- <function line='51' file='xmlreader' name='xmlTextReaderRead'/>
- <function line='61' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
- <function line='42' file='xmlreader' name='xmlTextReaderPreservePattern'/>
- <function line='37' file='xmlreader' name='xmlReaderForFile'/>
- <typedef line='76' file='tree' name='xmlDocPtr'/>
+ <function line='29' file='tree' name='xmlNodeSetContent'/>
+ <function line='36' file='tree' name='xmlDocDumpFormatMemory'/>
+ <variable line='42' file='globals' name='xmlFree'/>
+ <function line='30' file='tree' name='xmlDocSetRootElement'/>
+ <typedef line='20' file='tree' name='xmlDocPtr'/>
+ <function line='43' file='tree' name='xmlFreeDoc'/>
+ <typedef line='19' file='tree' name='xmlNodePtr'/>
+ <function line='27' file='tree' name='xmlNewDoc'/>
+ <function line='28' file='tree' name='xmlNewNode'/>
</uses>
</example>
<example filename='tree2.c'>
@@ -200,9 +160,12 @@
</includes>
<uses>
<function line='75' file='tree' name='xmlNewText'/>
+ <function line='110' file='xmlmemory' name='xmlMemoryDump'/>
<function line='96' file='tree' name='xmlSaveFormatFileEnc'/>
<function line='78' file='tree' name='xmlAddChild'/>
<function line='41' file='tree' name='xmlDocSetRootElement'/>
+ <function line='105' file='parser' name='xmlCleanupParser'/>
+ <macro line='34' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<function line='89' file='tree' name='xmlNewProp'/>
<function line='88' file='tree' name='xmlNewChild'/>
<function line='74' file='tree' name='xmlNewNode'/>
@@ -211,45 +174,32 @@
<function line='39' file='tree' name='xmlNewDoc'/>
</uses>
</example>
- <example filename='parse4.c'>
- <synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis>
- <purpose>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
- <usage>parse4 test3.xml</usage>
- <test>parse4 test3.xml</test>
+ <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>
+ <usage>reader1 &lt;filename&gt;</usage>
+ <test>reader1 test2.xml &gt; reader1.tmp ; diff reader1.tmp reader1.res ; rm reader1.tmp</test>
<author>Daniel Veillard</author>
<copy>see Copyright for the status of this software. </copy>
- <section>Parsing</section>
- <includes>
- <include>&lt;libxml/tree.h&gt;</include>
- <include>&lt;libxml/parser.h&gt;</include>
- </includes>
- <uses>
- <function line='94' file='parser' name='xmlFreeParserCtxt'/>
- <function line='86' file='parser' name='xmlParseChunk'/>
- <function line='67' file='parser' name='xmlCreatePushParserCtxt'/>
- <typedef line='45' file='tree' name='xmlParserCtxtPtr'/>
- <typedef line='47' file='tree' name='xmlDocPtr'/>
- </uses>
- </example>
- <example filename='io2.c'>
- <synopsis>Output to char buffer</synopsis>
- <purpose>Demonstrate the use of xmlDocDumpMemory to output document to a character buffer</purpose>
- <usage>io2</usage>
- <test>io2 &gt; io2.tmp ; diff io2.tmp io2.res ; rm -f io2.tmp</test>
- <author>John Fleck</author>
- <copy>see Copyright for the status of this software. </copy>
- <section>InputOutput</section>
+ <section>xmlReader</section>
<includes>
- <include>&lt;libxml/parser.h&gt;</include>
+ <include>&lt;libxml/xmlreader.h&gt;</include>
</includes>
<uses>
- <function line='29' file='tree' name='xmlNodeSetContent'/>
- <function line='36' file='tree' name='xmlDocDumpFormatMemory'/>
- <variable line='42' file='globals' name='xmlFree'/>
- <function line='30' file='tree' name='xmlDocSetRootElement'/>
- <typedef line='19' file='tree' name='xmlNodePtr'/>
- <function line='27' file='tree' name='xmlNewDoc'/>
- <function line='28' file='tree' name='xmlNewNode'/>
+ <function line='44' file='xmlstring' name='xmlStrlen'/>
+ <function line='94' file='parser' name='xmlCleanupParser'/>
+ <function line='37' file='xmlreader' name='xmlTextReaderNodeType'/>
+ <typedef line='59' file='xmlreader' name='xmlTextReaderPtr'/>
+ <function line='98' file='xmlmemory' name='xmlMemoryDump'/>
+ <function line='33' file='xmlreader' name='xmlTextReaderConstValue'/>
+ <function line='36' file='xmlreader' name='xmlTextReaderDepth'/>
+ <function line='69' file='xmlreader' name='xmlFreeTextReader'/>
+ <macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/>
+ <function line='29' file='xmlreader' name='xmlTextReaderConstName'/>
+ <function line='40' file='xmlreader' name='xmlTextReaderHasValue'/>
+ <function line='67' file='xmlreader' name='xmlTextReaderRead'/>
+ <function line='39' file='xmlreader' name='xmlTextReaderIsEmptyElement'/>
+ <function line='62' file='xmlreader' name='xmlReaderForFile'/>
</uses>
</example>
<example filename='testWriter.c'>
@@ -271,6 +221,7 @@
<function line='925' file='xmlwriter' name='xmlTextWriterWriteComment'/>
<function line='1156' file='encoding' name='xmlFindCharEncodingHandler'/>
<variable line='1166' file='globals' name='xmlMalloc'/>
+ <typedef line='879' file='tree' name='xmlDocPtr'/>
<typedef line='341' file='tree' name='xmlBufferPtr'/>
<macro line='885' file='parser' name='XML_DEFAULT_VERSION'/>
<function line='901' file='tree' name='xmlDocSetRootElement'/>
@@ -282,6 +233,7 @@
<function line='959' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/>
<function line='1073' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/>
<typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/>
+ <function line='1131' file='tree' name='xmlFreeDoc'/>
<typedef line='880' file='tree' name='xmlNodePtr'/>
<function line='949' file='xmlwriter' name='xmlTextWriterWriteAttribute'/>
<function line='632' file='xmlwriter' name='xmlNewTextWriterDoc'/>
@@ -296,6 +248,47 @@
<function line='885' file='tree' name='xmlNewDoc'/>
</uses>
</example>
+ <example filename='parse4.c'>
+ <synopsis>Parse an XML document chunk by chunk to a tree and free it</synopsis>
+ <purpose>Demonstrate the use of xmlCreatePushParserCtxt() and xmlParseChunk() to read an XML file progressively into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
+ <usage>parse4 test3.xml</usage>
+ <test>parse4 test3.xml</test>
+ <author>Daniel Veillard</author>
+ <copy>see Copyright for the status of this software. </copy>
+ <section>Parsing</section>
+ <includes>
+ <include>&lt;libxml/tree.h&gt;</include>
+ <include>&lt;libxml/parser.h&gt;</include>
+ </includes>
+ <uses>
+ <function line='94' file='parser' name='xmlFreeParserCtxt'/>
+ <function line='86' file='parser' name='xmlParseChunk'/>
+ <function line='67' file='parser' name='xmlCreatePushParserCtxt'/>
+ <typedef line='45' file='tree' name='xmlParserCtxtPtr'/>
+ <typedef line='47' file='tree' name='xmlDocPtr'/>
+ </uses>
+ </example>
+ <example filename='reader3.c'>
+ <synopsis>Show how to extract subdocuments with xmlReader</synopsis>
+ <purpose>Demonstrate the use of xmlTextReaderPreservePattern() to parse an XML file with the xmlReader while collecting only some subparts of the document. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
+ <usage>reader3</usage>
+ <test>reader3 &gt; reader3.tmp ; diff reader3.tmp reader3.res ; rm reader3.tmp</test>
+ <author>Daniel Veillard</author>
+ <copy>see Copyright for the status of this software. </copy>
+ <section>xmlReader</section>
+ <includes>
+ <include>&lt;libxml/xmlreader.h&gt;</include>
+ </includes>
+ <uses>
+ <typedef line='32' file='xmlreader' name='xmlTextReaderPtr'/>
+ <function line='66' file='xmlreader' name='xmlFreeTextReader'/>
+ <function line='96' file='tree' name='xmlDocDump'/>
+ <function line='52' file='xmlreader' name='xmlTextReaderRead'/>
+ <function line='62' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
+ <function line='43' file='xmlreader' name='xmlTextReaderPreservePattern'/>
+ <function line='38' file='xmlreader' name='xmlReaderForFile'/>
+ </uses>
+ </example>
<example filename='io1.c'>
<synopsis>Example of custom Input/Output</synopsis>
<purpose>Demonstrate the use of xmlRegisterInputCallbacks to build a custom I/O layer, this is used in an XInclude method context to show how dynamic document can be built in a clean way.</purpose>
@@ -317,39 +310,6 @@
<function line='124' file='parser' name='xmlReadMemory'/>
</uses>
</example>
- <example filename='xpath1.c'>
- <synopsis>Evaluate XPath expression and prints result node set.</synopsis>
- <purpose>Shows how to evaluate XPath expression and register known namespaces in XPath context.</purpose>
- <usage>xpath1 &lt;xml-file&gt; &lt;xpath-expr&gt; [&lt;known-ns-list&gt;]</usage>
- <test>./xpath1 test3.xml &apos;//child2&apos; &gt; xpath1.tmp ; diff xpath1.tmp xpath1.res ; rm xpath1.tmp</test>
- <author>Aleksey Sanin</author>
- <copy>see Copyright for the status of this software. </copy>
- <section>XPath</section>
- <includes>
- <include>&lt;libxml/parser.h&gt;</include>
- <include>&lt;libxml/xpath.h&gt;</include>
- <include>&lt;libxml/xpathInternals.h&gt;</include>
- <include>&lt;libxml/tree.h&gt;</include>
- </includes>
- <uses>
- <enum line='229' file='tree' name='XML_ELEMENT_NODE'/>
- <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
- <function line='117' file='xpath' name='xmlXPathEvalExpression'/>
- <function line='94' file='parser' name='xmlParseFile'/>
- <function line='186' file='xpathInternals' name='xmlXPathRegisterNs'/>
- <function line='129' file='xpath' name='xmlXPathFreeObject'/>
- <variable line='193' file='globals' name='xmlFree'/>
- <typedef line='218' file='tree' name='xmlNsPtr'/>
- <function line='101' file='xpath' name='xmlXPathNewContext'/>
- <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
- <function line='130' file='xpath' name='xmlXPathFreeContext'/>
- <function line='39' file='parser' name='xmlInitParser'/>
- <function line='156' file='xmlstring' name='xmlStrdup'/>
- <function line='180' file='xmlstring' name='xmlStrchr'/>
- <typedef line='206' file='tree' name='xmlNodePtr'/>
- <enum line='217' file='tree' name='XML_NAMESPACE_DECL'/>
- </uses>
- </example>
<example filename='parse1.c'>
<synopsis>Parse an XML file to a tree and free it</synopsis>
<purpose>Demonstrate the use of xmlReadFile() to read an XML file into a tree and and xmlFreeDoc() to free the resulting tree</purpose>
@@ -384,14 +344,54 @@
<function line='67' file='parser' name='xmlReadFile'/>
</uses>
</example>
+ <example filename='reader4.c'>
+ <synopsis>Parse multiple XML files reusing an xmlReader</synopsis>
+ <purpose>Demonstrate the use of xmlReaderForFile() and xmlReaderNewFile to parse XML files while reusing the reader object and parser context. (Note that the XMLReader functions require libxml2 version later than 2.6.)</purpose>
+ <usage>reader4 &lt;filename&gt; [ filename ... ]</usage>
+ <test>reader4 test1.xml test2.xml test3.xml &gt; reader4.tmp ; diff reader4.tmp reader4.res ; rm reader4.tmp</test>
+ <author>Graham Bennett</author>
+ <copy>see Copyright for the status of this software. </copy>
+ <section>xmlReader</section>
+ <includes>
+ <include>&lt;libxml/xmlreader.h&gt;</include>
+ </includes>
+ <uses>
+ <typedef line='54' file='xmlreader' name='xmlTextReaderPtr'/>
+ <function line='83' file='xmlreader' name='xmlReaderNewFile'/>
+ <function line='104' file='xmlreader' name='xmlFreeTextReader'/>
+ <function line='26' file='xmlreader' name='xmlTextReaderRead'/>
+ <function line='97' file='xmlreader' name='xmlTextReaderCurrentDoc'/>
+ <function line='72' file='xmlreader' name='xmlReaderForFile'/>
+ </uses>
+ </example>
+ <example filename='parse2.c'>
+ <synopsis>Parse and validate an XML file to a tree and free the result</synopsis>
+ <purpose>Create a parser context for an XML file, then parse and validate the file, creating a tree, check the validation result and xmlFreeDoc() to free the resulting tree.</purpose>
+ <usage>parse2 test2.xml</usage>
+ <test>parse2 test2.xml</test>
+ <author>Daniel Veillard</author>
+ <copy>see Copyright for the status of this software. </copy>
+ <section>Parsing</section>
+ <includes>
+ <include>&lt;libxml/tree.h&gt;</include>
+ <include>&lt;libxml/parser.h&gt;</include>
+ </includes>
+ <uses>
+ <function line='47' file='parser' name='xmlFreeParserCtxt'/>
+ <enum line='35' file='parser' name='XML_PARSE_DTDVALID'/>
+ <function line='29' file='parser' name='xmlNewParserCtxt'/>
+ <typedef line='25' file='tree' name='xmlParserCtxtPtr'/>
+ <function line='35' file='parser' name='xmlCtxtReadFile'/>
+ </uses>
+ </example>
<symbols>
<symbol name='LIBXML_TEST_VERSION'>
- <ref filename='xpath2.c'/>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
- <ref filename='parse2.c'/>
<ref filename='reader2.c'/>
+ <ref filename='xpath2.c'/>
+ <ref filename='xpath1.c'/>
<ref filename='parse3.c'/>
+ <ref filename='tree2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='XML_DEFAULT_VERSION'>
<ref filename='testWriter.c'/>
@@ -408,8 +408,8 @@
<ref filename='reader2.c'/>
</symbol>
<symbol name='XML_PARSE_DTDVALID'>
- <ref filename='parse2.c'/>
<ref filename='reader2.c'/>
+ <ref filename='parse2.c'/>
</symbol>
<symbol name='XML_PARSE_NOENT'>
<ref filename='reader2.c'/>
@@ -430,12 +430,12 @@
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlCleanupParser'>
- <ref filename='xpath2.c'/>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
- <ref filename='parse2.c'/>
<ref filename='reader2.c'/>
+ <ref filename='xpath2.c'/>
+ <ref filename='xpath1.c'/>
<ref filename='parse3.c'/>
+ <ref filename='tree2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlCreateIntSubset'>
<ref filename='tree2.c'/>
@@ -459,42 +459,42 @@
</symbol>
<symbol name='xmlDocPtr'>
<ref filename='xpath2.c'/>
- <ref filename='reader4.c'/>
- <ref filename='parse2.c'/>
+ <ref filename='xpath1.c'/>
<ref filename='parse3.c'/>
- <ref filename='reader3.c'/>
+ <ref filename='io2.c'/>
+ <ref filename='testWriter.c'/>
<ref filename='parse4.c'/>
</symbol>
<symbol name='xmlDocSetRootElement'>
- <ref filename='tree2.c'/>
<ref filename='io2.c'/>
+ <ref filename='tree2.c'/>
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlFindCharEncodingHandler'>
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlFree'>
+ <ref filename='xpath1.c'/>
<ref filename='io2.c'/>
<ref filename='testWriter.c'/>
- <ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlFreeDoc'>
<ref filename='xpath2.c'/>
- <ref filename='reader4.c'/>
- <ref filename='parse2.c'/>
+ <ref filename='xpath1.c'/>
<ref filename='parse3.c'/>
- <ref filename='reader3.c'/>
+ <ref filename='io2.c'/>
<ref filename='tree2.c'/>
+ <ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlFreeParserCtxt'>
- <ref filename='parse2.c'/>
<ref filename='parse4.c'/>
+ <ref filename='parse2.c'/>
</symbol>
<symbol name='xmlFreeTextReader'>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
<ref filename='reader3.c'/>
+ <ref filename='reader4.c'/>
</symbol>
<symbol name='xmlFreeTextWriter'>
<ref filename='testWriter.c'/>
@@ -507,27 +507,27 @@
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlMemoryDump'>
- <ref filename='xpath2.c'/>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
- <ref filename='parse2.c'/>
<ref filename='reader2.c'/>
+ <ref filename='xpath2.c'/>
+ <ref filename='xpath1.c'/>
<ref filename='parse3.c'/>
+ <ref filename='tree2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlNewChild'>
<ref filename='tree2.c'/>
</symbol>
<symbol name='xmlNewDoc'>
- <ref filename='tree2.c'/>
<ref filename='io2.c'/>
+ <ref filename='tree2.c'/>
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlNewDocNode'>
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlNewNode'>
- <ref filename='tree2.c'/>
<ref filename='io2.c'/>
+ <ref filename='tree2.c'/>
</symbol>
<symbol name='xmlNewParserCtxt'>
<ref filename='parse2.c'/>
@@ -551,9 +551,9 @@
<ref filename='testWriter.c'/>
</symbol>
<symbol name='xmlNodePtr'>
+ <ref filename='xpath1.c'/>
<ref filename='io2.c'/>
<ref filename='testWriter.c'/>
- <ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlNodeSetContent'>
<ref filename='xpath2.c'/>
@@ -570,8 +570,8 @@
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlParserCtxtPtr'>
- <ref filename='parse2.c'/>
<ref filename='parse4.c'/>
+ <ref filename='parse2.c'/>
</symbol>
<symbol name='xmlReadFile'>
<ref filename='parse1.c'/>
@@ -582,10 +582,10 @@
<ref filename='io1.c'/>
</symbol>
<symbol name='xmlReaderForFile'>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
<ref filename='reader3.c'/>
+ <ref filename='reader4.c'/>
</symbol>
<symbol name='xmlReaderNewFile'>
<ref filename='reader4.c'/>
@@ -609,54 +609,54 @@
<ref filename='xpath1.c'/>
</symbol>
<symbol name='xmlStrlen'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderConstName'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderConstValue'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderCurrentDoc'>
- <ref filename='reader4.c'/>
<ref filename='reader3.c'/>
+ <ref filename='reader4.c'/>
</symbol>
<symbol name='xmlTextReaderDepth'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderHasValue'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderIsEmptyElement'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderIsValid'>
<ref filename='reader2.c'/>
</symbol>
<symbol name='xmlTextReaderNodeType'>
- <ref filename='reader1.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
</symbol>
<symbol name='xmlTextReaderPreservePattern'>
<ref filename='reader3.c'/>
</symbol>
<symbol name='xmlTextReaderPtr'>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
<ref filename='reader3.c'/>
+ <ref filename='reader4.c'/>
</symbol>
<symbol name='xmlTextReaderRead'>
- <ref filename='reader1.c'/>
- <ref filename='reader4.c'/>
<ref filename='reader2.c'/>
+ <ref filename='reader1.c'/>
<ref filename='reader3.c'/>
+ <ref filename='reader4.c'/>
</symbol>
<symbol name='xmlTextWriterEndDocument'>
<ref filename='testWriter.c'/>
@@ -725,10 +725,10 @@
<example filename='io1.c'/>
</section>
<section name='Parsing'>
- <example filename='parse2.c'/>
<example filename='parse3.c'/>
<example filename='parse4.c'/>
<example filename='parse1.c'/>
+ <example filename='parse2.c'/>
</section>
<section name='Tree'>
<example filename='tree2.c'/>
@@ -739,10 +739,10 @@
<example filename='xpath1.c'/>
</section>
<section name='xmlReader'>
- <example filename='reader1.c'/>
- <example filename='reader4.c'/>
<example filename='reader2.c'/>
+ <example filename='reader1.c'/>
<example filename='reader3.c'/>
+ <example filename='reader4.c'/>
</section>
<section name='xmlWriter'>
<example filename='testWriter.c'/>
diff --git a/doc/examples/reader3.c b/doc/examples/reader3.c
index acbff4f..51f9d3b 100644
--- a/doc/examples/reader3.c
+++ b/doc/examples/reader3.c
@@ -15,7 +15,8 @@
#include <stdio.h>
#include <libxml/xmlreader.h>
-#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED)
+#if defined(LIBXML_READER_ENABLED) && defined(LIBXML_PATTERN_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
+
/**
* streamFile:
@@ -113,7 +114,7 @@ int main(int argc, char **argv) {
#else
int main(void) {
- fprintf(stderr, "Reader or Pattern support not compiled in\n");
+ fprintf(stderr, "Reader, Pattern or output support not compiled in\n");
exit(1);
}
#endif
diff --git a/doc/html/libxml-c14n.html b/doc/html/libxml-c14n.html
index f4b3ecd..dfcb9c5 100644
--- a/doc/html/libxml-c14n.html
+++ b/doc/html/libxml-c14n.html
@@ -28,5 +28,5 @@ int <a href="#xmlC14NIsVisibleCallback">xmlC14NIsVisibleCallback</a> (void * use
</pre><p>Dumps the canonized image of given XML document into the provided buffer. For details see "Canonical XML" (http://www.w3.org/TR/xml-c14n) or "Exclusive XML Canonicalization" (http://www.w3.org/TR/xml-exc-c14n)</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 XML document for canonization</td></tr><tr><td><span class="term"><i><tt>is_visible_callback</tt></i>:</span></td><td>the function to use to determine is node visible or not</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>the first parameter for @is_visible_callback function (in most cases, it is nodes set)</td></tr><tr><td><span class="term"><i><tt>exclusive</tt></i>:</span></td><td>the exclusive flag (0 - non-exclusive canonicalization; otherwise - exclusive canonicalization)</td></tr><tr><td><span class="term"><i><tt>inclusive_ns_prefixes</tt></i>:</span></td><td>the list of inclusive namespace prefixes ended with a NULL or NULL if there is no inclusive namespaces (only for exclusive canonicalization, ignored otherwise)</td></tr><tr><td><span class="term"><i><tt>with_comments</tt></i>:</span></td><td>include comments in the result (!=0) or not (==0)</td></tr><tr><td><span class="term"><i><tt>buf</tt></i>:</span></td><td>the output buffer to store canonical XML; this buffer MUST have encoder==NULL because C14N requires UTF-8 output</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>non-negative value on success or a negative value on fail</td></tr></tbody></table></div><h3><a name="xmlC14NIsVisibleCallback" id="xmlC14NIsVisibleCallback"></a>Function type: xmlC14NIsVisibleCallback</h3><pre class="programlisting">Function type: xmlC14NIsVisibleCallback
int xmlC14NIsVisibleCallback (void * user_data, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> parent)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature for a C14N callback on visible nodes</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>user data</td></tr><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td>the curent node</td></tr><tr><td><span class="term"><i><tt>parent</tt></i>:</span></td><td>the parent node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if the node should be included</td></tr></tbody></table></div><br />
<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>
diff --git a/doc/html/libxml-entities.html b/doc/html/libxml-entities.html
index fe4ea86..406e64e 100644
--- a/doc/html/libxml-entities.html
+++ b/doc/html/libxml-entities.html
@@ -30,6 +30,7 @@ The content of this structure is not made public by the API.
<pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlGetParameterEntity">xmlGetParameterEntity</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)</pre>
<pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlGetPredefinedEntity">xmlGetPredefinedEntity</a> (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)</pre>
<pre class="programlisting">void <a href="#xmlInitializePredefinedEntities">xmlInitializePredefinedEntities</a> (void)</pre>
+<pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> <a href="#xmlNewEntity">xmlNewEntity</a> (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> int type, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)</pre>
<h2>Description</h2>
<h3><a name="xmlEntitiesTable" id="xmlEntitiesTable">Structure xmlEntitiesTable</a></h3><pre class="programlisting">Structure xmlEntitiesTable<br />struct _xmlHashTable {
The content of this structure is not made public by the API.
@@ -73,4 +74,6 @@ The content of this structure is not made public by the API.
</pre><p>Check whether this name is an predefined entity.</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 entity name</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>NULL if not, otherwise the entity</td></tr></tbody></table></div><h3><a name="xmlInitializePredefinedEntities" id="xmlInitializePredefinedEntities"></a>Function: xmlInitializePredefinedEntities</h3><pre class="programlisting">void xmlInitializePredefinedEntities (void)<br />
</pre><p>Set up the predefined entities. Deprecated call</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>
+<h3><a name="xmlNewEntity" id="xmlNewEntity"></a>Function: xmlNewEntity</h3><pre class="programlisting"><a href="libxml-tree.html#xmlEntityPtr">xmlEntityPtr</a> xmlNewEntity (<a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name, <br /> int type, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * content)<br />
+</pre><p>Create a new entity, this differs from xmlAddDocEntity() that if the document is NULL or has no internal subset defined, then an unlinked entity structure will be returned, it is then the responsability of the caller to link it to the document later or free it when not needed anymore.</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 entity name</td></tr><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>the entity type XML_xxx_yyy_ENTITY</td></tr><tr><td><span class="term"><i><tt>ExternalID</tt></i>:</span></td><td>the entity external ID if available</td></tr><tr><td><span class="term"><i><tt>SystemID</tt></i>:</span></td><td>the entity system ID if available</td></tr><tr><td><span class="term"><i><tt>content</tt></i>:</span></td><td>the entity content</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to the entity or NULL 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>
diff --git a/doc/html/libxml-globals.html b/doc/html/libxml-globals.html
index fd9a06c..148d6a1 100644
--- a/doc/html/libxml-globals.html
+++ b/doc/html/libxml-globals.html
@@ -90,7 +90,7 @@ void <a href="#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a> (<a href="libxml-tr
</pre><p>Registers a callback for node destruction</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>func</tt></i>:</span></td><td>function pointer to the new DeregisterNodeFunc</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the previous value of the deregistration function</td></tr></tbody></table></div><h3><a name="xmlDeregisterNodeFunc" id="xmlDeregisterNodeFunc"></a>Function type: xmlDeregisterNodeFunc</h3><pre class="programlisting">Function type: xmlDeregisterNodeFunc
void xmlDeregisterNodeFunc (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature for the deregistration callback of a discarded 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 current node</td></tr></tbody></table></div><br />
<h3><a name="xmlInitGlobals" id="xmlInitGlobals"></a>Function: xmlInitGlobals</h3><pre class="programlisting">void xmlInitGlobals (void)<br />
</pre><p>Additional initialisation for multi-threading</p>
<h3><a name="xmlInitializeGlobalState" id="xmlInitializeGlobalState"></a>Function: xmlInitializeGlobalState</h3><pre class="programlisting">void xmlInitializeGlobalState (<a href="libxml-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> gs)<br />
@@ -99,17 +99,17 @@ void xmlDeregisterNodeFunc (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a
</pre><p>Registers a callback for URI output file handling</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>func</tt></i>:</span></td><td>function pointer to the new OutputBufferCreateFilenameFunc</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the old value of the registration function</td></tr></tbody></table></div><h3><a name="xmlOutputBufferCreateFilenameFunc" id="xmlOutputBufferCreateFilenameFunc"></a>Function type: xmlOutputBufferCreateFilenameFunc</h3><pre class="programlisting">Function type: xmlOutputBufferCreateFilenameFunc
<a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> xmlOutputBufferCreateFilenameFunc (const char * URI, <br /> <a href="libxml-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder, <br /> int compression)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature for the function doing the lookup for a suitable output method corresponding to an URI.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to write to</td></tr><tr><td><span class="term"><i><tt>encoder</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>compression</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div><br />
<h3><a name="xmlParserInputBufferCreateFilenameDefault" id="xmlParserInputBufferCreateFilenameDefault"></a>Function: xmlParserInputBufferCreateFilenameDefault</h3><pre class="programlisting"><a href="libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> xmlParserInputBufferCreateFilenameDefault (<a href="libxml-globals.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> func)<br />
</pre><p>Registers a callback for URI input file handling</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>func</tt></i>:</span></td><td>function pointer to the new ParserInputBufferCreateFilenameFunc</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the old value of the registration function</td></tr></tbody></table></div><h3><a name="xmlParserInputBufferCreateFilenameFunc" id="xmlParserInputBufferCreateFilenameFunc"></a>Function type: xmlParserInputBufferCreateFilenameFunc</h3><pre class="programlisting">Function type: xmlParserInputBufferCreateFilenameFunc
<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> xmlParserInputBufferCreateFilenameFunc (const char * URI, <br /> <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature for the function doing the lookup for a suitable input method corresponding to an URI.</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>URI</tt></i>:</span></td><td>the URI to read from</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>the requested source encoding</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the new <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in case of success or NULL if no method was found.</td></tr></tbody></table></div><br />
<h3><a name="xmlRegisterNodeDefault" id="xmlRegisterNodeDefault"></a>Function: xmlRegisterNodeDefault</h3><pre class="programlisting"><a href="libxml-globals.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a> xmlRegisterNodeDefault (<a href="libxml-globals.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a> func)<br />
</pre><p>Registers a callback for node creation</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>func</tt></i>:</span></td><td>function pointer to the new RegisterNodeFunc</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the old value of the registration function</td></tr></tbody></table></div><h3><a name="xmlRegisterNodeFunc" id="xmlRegisterNodeFunc"></a>Function type: xmlRegisterNodeFunc</h3><pre class="programlisting">Function type: xmlRegisterNodeFunc
void xmlRegisterNodeFunc (<a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> node)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>node</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature for the registration callback of a created 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 current node</td></tr></tbody></table></div><br />
<h3><a name="xmlThrDefBufferAllocScheme" id="xmlThrDefBufferAllocScheme"></a>Function: xmlThrDefBufferAllocScheme</h3><pre class="programlisting"><a href="libxml-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> xmlThrDefBufferAllocScheme (<a href="libxml-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> v)<br />
</pre><p></p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>v</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlThrDefDefaultBufferSize" id="xmlThrDefDefaultBufferSize"></a>Function: xmlThrDefDefaultBufferSize</h3><pre class="programlisting">int xmlThrDefDefaultBufferSize (int v)<br />
diff --git a/doc/html/libxml-parser.html b/doc/html/libxml-parser.html
index 82c6f8e..82dbf95 100644
--- a/doc/html/libxml-parser.html
+++ b/doc/html/libxml-parser.html
@@ -282,6 +282,9 @@ void <a href="#xmlParserInputDeallocate">xmlParserInputDeallocate</a> (<a href="
<a name="XML_PARSE_NOCDATA" id="XML_PARSE_NOCDATA">XML_PARSE_NOCDATA</a> = 16384 : merge CDATA as text nodes
<a name="XML_PARSE_NOXINCNODE" id="XML_PARSE_NOXINCNODE">XML_PARSE_NOXINCNODE</a> = 32768 : do not generate XINCLUDE START/END nodes
<a name="XML_PARSE_COMPACT" id="XML_PARSE_COMPACT">XML_PARSE_COMPACT</a> = 65536 : compact small text nodes; no modification of the tree allowed afterwards (will possibly crash if you try to modify the tree)
+ <a name="XML_PARSE_OLD10" id="XML_PARSE_OLD10">XML_PARSE_OLD10</a> = 131072 : parse using XML-1.0 before update 5
+ <a name="XML_PARSE_NOBASEFIX" id="XML_PARSE_NOBASEFIX">XML_PARSE_NOBASEFIX</a> = 262144 : do not fixup XINCLUDE xml:base uris
+ <a name="XML_PARSE_HUGE" id="XML_PARSE_HUGE">XML_PARSE_HUGE</a> = 524288 : relax any hardcoded limit from the parser
}
</pre><h3><a name="xmlSAXHandlerV1" id="xmlSAXHandlerV1">Structure xmlSAXHandlerV1</a></h3><pre class="programlisting">Structure xmlSAXHandlerV1<br />struct _xmlSAXHandlerV1 {
<a href="libxml-parser.html#internalSubsetSAXFunc">internalSubsetSAXFunc</a> internalSubset
diff --git a/doc/html/libxml-parserInternals.html b/doc/html/libxml-parserInternals.html
index 3c12a6a..ad1fb8e 100644
--- a/doc/html/libxml-parserInternals.html
+++ b/doc/html/libxml-parserInternals.html
@@ -92,7 +92,7 @@ void <a href="#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> (<a href="lib
<pre class="programlisting">void <a href="#xmlParserHandleReference">xmlParserHandleReference</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
<pre class="programlisting">void <a href="#xmlParserInputShrink">xmlParserInputShrink</a> (<a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in)</pre>
<pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> <a href="#xmlPopInput">xmlPopInput</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
-<pre class="programlisting">void <a href="#xmlPushInput">xmlPushInput</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)</pre>
+<pre class="programlisting">int <a href="#xmlPushInput">xmlPushInput</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)</pre>
<pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlScanName">xmlScanName</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
<pre class="programlisting">void <a href="#xmlSetEntityReferenceFunc">xmlSetEntityReferenceFunc</a> (<a href="libxml-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> func)</pre>
<pre class="programlisting">int <a href="#xmlSkipBlankChars">xmlSkipBlankChars</a> (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)</pre>
@@ -140,7 +140,7 @@ void <a href="#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> (<a href="lib
</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 />
</pre><p>Pushes a new parser input on top of 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>value</tt></i>:</span></td><td>the parser input</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of error, the index in the stack otherwise</td></tr></tbody></table></div><h3><a name="namePop" id="namePop"></a>Function: namePop</h3><pre class="programlisting">const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * namePop (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<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>value</tt></i>:</span></td><td>the parser input</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, the index in the stack otherwise</td></tr></tbody></table></div><h3><a name="namePop" id="namePop"></a>Function: namePop</h3><pre class="programlisting">const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * namePop (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>Pops the top element name from the name 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 name just removed</td></tr></tbody></table></div><h3><a name="namePush" id="namePush"></a>Function: namePush</h3><pre class="programlisting">int namePush (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value)<br />
</pre><p>Pushes a new element name on top of the name stack</p>
@@ -148,7 +148,7 @@ void <a href="#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> (<a href="lib
</pre><p>Pops the top element node from the node 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 node just removed</td></tr></tbody></table></div><h3><a name="nodePush" id="nodePush"></a>Function: nodePush</h3><pre class="programlisting">int nodePush (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> value)<br />
</pre><p>Pushes a new element node on top of the node 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>value</tt></i>:</span></td><td>the element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of error, the index in the stack otherwise</td></tr></tbody></table></div><h3><a name="xmlCheckLanguageID" id="xmlCheckLanguageID"></a>Function: xmlCheckLanguageID</h3><pre class="programlisting">int xmlCheckLanguageID (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * lang)<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>value</tt></i>:</span></td><td>the element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error, the index in the stack otherwise</td></tr></tbody></table></div><h3><a name="xmlCheckLanguageID" id="xmlCheckLanguageID"></a>Function: xmlCheckLanguageID</h3><pre class="programlisting">int xmlCheckLanguageID (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * lang)<br />
</pre><p>Checks that the value conforms to the LanguageID production: NOTE: this is somewhat deprecated, those productions were removed from the XML Second edition. [33] LanguageID ::= Langcode ('-' Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= ('i' | 'I') '-' ([a-z] | [A-Z])+ [37] UserCode ::= ('x' | 'X') '-' ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>lang</tt></i>:</span></td><td>pointer to the string value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if correct 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlCopyChar" id="xmlCopyChar"></a>Function: xmlCopyChar</h3><pre class="programlisting">int xmlCopyChar (int len, <br /> <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * out, <br /> int val)<br />
</pre><p>append the char value in the array</p>
@@ -278,11 +278,11 @@ 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 element name parsed</td></tr></tbody></table></div><h3><a name="xmlParseSystemLiteral" id="xmlParseSystemLiteral"></a>Function: xmlParseSystemLiteral</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlParseSystemLiteral (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")</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 SystemLiteral parsed or NULL</td></tr></tbody></table></div><h3><a name="xmlParseTextDecl" id="xmlParseTextDecl"></a>Function: xmlParseTextDecl</h3><pre class="programlisting">void xmlParseTextDecl (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
-</pre><p>parse an XML declaration header for external entities [77] TextDecl ::= '&lt;?xml' VersionInfo? EncodingDecl S? '?&gt;' Question: Seems that EncodingDecl is mandatory ? Is that a typo ?</p>
+</pre><p>parse an XML declaration header for external entities [77] TextDecl ::= '&lt;?xml' VersionInfo? EncodingDecl S? '?&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="xmlParseVersionInfo" id="xmlParseVersionInfo"></a>Function: xmlParseVersionInfo</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlParseVersionInfo (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>parse the XML version. [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ") [25] Eq ::= S? '=' S?</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 version string, e.g. "1.0"</td></tr></tbody></table></div><h3><a name="xmlParseVersionNum" id="xmlParseVersionNum"></a>Function: xmlParseVersionNum</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlParseVersionNum (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
-</pre><p>parse the XML version value. [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+</p>
+</pre><p>parse the XML version value. [26] VersionNum ::= '1.' [0-9]+ In practice allow [0-9].[0-9]+ at that level</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 string giving the XML version number, or NULL</td></tr></tbody></table></div><h3><a name="xmlParseXMLDecl" id="xmlParseXMLDecl"></a>Function: xmlParseXMLDecl</h3><pre class="programlisting">void xmlParseXMLDecl (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>parse an XML declaration header [23] XMLDecl ::= '&lt;?xml' VersionInfo EncodingDecl? SDDecl? S? '?&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="xmlParserHandlePEReference" id="xmlParserHandlePEReference"></a>Function: xmlParserHandlePEReference</h3><pre class="programlisting">void xmlParserHandlePEReference (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
@@ -293,9 +293,9 @@ void xmlEntityReferenceFunc (<a href="libxml-tree.html#xmlEntityPtr">xmlEntityP
</pre><p>This function removes used input for the parser.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>in</tt></i>:</span></td><td>an XML parser input</td></tr></tbody></table></div><h3><a name="xmlPopInput" id="xmlPopInput"></a>Function: xmlPopInput</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> xmlPopInput (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>xmlPopInput: the current input pointed by ctxt-&gt;input came to an end pop it and return the next char.</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 current <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> in the parser context</td></tr></tbody></table></div><h3><a name="xmlPushInput" id="xmlPushInput"></a>Function: xmlPushInput</h3><pre class="programlisting">void xmlPushInput (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <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>Returns</tt></i>:</span></td><td>the current <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> in the parser context</td></tr></tbody></table></div><h3><a name="xmlPushInput" id="xmlPushInput"></a>Function: xmlPushInput</h3><pre class="programlisting">int xmlPushInput (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br />
</pre><p>xmlPushInput: switch to a new input stream which is stacked on top of the previous one(s).</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>input</tt></i>:</span></td><td>an XML parser input fragment (entity, XML fragment ...).</td></tr></tbody></table></div><h3><a name="xmlScanName" id="xmlScanName"></a>Function: xmlScanName</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlScanName (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<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>input</tt></i>:</span></td><td>an XML parser input fragment (entity, XML fragment ...).</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>-1 in case of error or the index in the input stack</td></tr></tbody></table></div><h3><a name="xmlScanName" id="xmlScanName"></a>Function: xmlScanName</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlScanName (<a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br />
</pre><p>Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. TODO: seems deprecated now, only used in the default part of <a href="libxml-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a> [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)*</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 Name parsed or NULL</td></tr></tbody></table></div><h3><a name="xmlSetEntityReferenceFunc" id="xmlSetEntityReferenceFunc"></a>Function: xmlSetEntityReferenceFunc</h3><pre class="programlisting">void xmlSetEntityReferenceFunc (<a href="libxml-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> func)<br />
</pre><p>Set the function to call call back when a xml <a href="libxml-SAX.html#reference">reference</a> has been made</p>
diff --git a/doc/html/libxml-relaxng.html b/doc/html/libxml-relaxng.html
index 650d058..b631a1a 100644
--- a/doc/html/libxml-relaxng.html
+++ b/doc/html/libxml-relaxng.html
@@ -153,10 +153,10 @@ The content of this structure is not made public by the API.
</pre><p>Push a new element start on the RelaxNG validation 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>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><h3><a name="xmlRelaxNGValidityErrorFunc" id="xmlRelaxNGValidityErrorFunc"></a>Function type: xmlRelaxNGValidityErrorFunc</h3><pre class="programlisting">Function type: xmlRelaxNGValidityErrorFunc
void xmlRelaxNGValidityErrorFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature of an error 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="xmlRelaxNGValidityWarningFunc" id="xmlRelaxNGValidityWarningFunc"></a>Function type: xmlRelaxNGValidityWarningFunc</h3><pre class="programlisting">Function type: xmlRelaxNGValidityWarningFunc
void xmlRelaxNGValidityWarningFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td></td></tr></tbody></table></div><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>
<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>
diff --git a/doc/html/libxml-schematron.html b/doc/html/libxml-schematron.html
index 5ec67e5..1dcd73a 100644
--- a/doc/html/libxml-schematron.html
+++ b/doc/html/libxml-schematron.html
@@ -74,8 +74,8 @@ The content of this structure is not made public by the API.
</pre><p>Validate a tree instance against the schematron</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>instance</tt></i>:</span></td><td>the document instace tree</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 in case of success, -1 in case of internal error and an error count otherwise.</td></tr></tbody></table></div><h3><a name="xmlSchematronValidityErrorFunc" id="xmlSchematronValidityErrorFunc"></a>Function type: xmlSchematronValidityErrorFunc</h3><pre class="programlisting">Function type: xmlSchematronValidityErrorFunc
void xmlSchematronValidityErrorFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature of an error callback from a Schematron 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="xmlSchematronValidityWarningFunc" id="xmlSchematronValidityWarningFunc"></a>Function type: xmlSchematronValidityWarningFunc</h3><pre class="programlisting">Function type: xmlSchematronValidityWarningFunc
void xmlSchematronValidityWarningFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature of a warning callback from a Schematron 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 />
<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>
diff --git a/doc/html/libxml-tree.html b/doc/html/libxml-tree.html
index 34914cb..ab57566 100644
--- a/doc/html/libxml-tree.html
+++ b/doc/html/libxml-tree.html
@@ -22,6 +22,7 @@ A:link, A:visited, A:active { text-decoration: underline }
</pre><pre class="programlisting">Structure <a href="#xmlDOMWrapCtxt">xmlDOMWrapCtxt</a><br />struct _xmlDOMWrapCtxt
</pre><pre class="programlisting">Typedef <a href="libxml-tree.html#xmlDOMWrapCtxt">xmlDOMWrapCtxt</a> * <a name="xmlDOMWrapCtxtPtr" id="xmlDOMWrapCtxtPtr">xmlDOMWrapCtxtPtr</a>
</pre><pre class="programlisting">Structure <a href="#xmlDoc">xmlDoc</a><br />struct _xmlDoc
+</pre><pre class="programlisting">Enum <a href="#xmlDocProperties">xmlDocProperties</a>
</pre><pre class="programlisting">Typedef <a href="libxml-tree.html#xmlDoc">xmlDoc</a> * <a name="xmlDocPtr" id="xmlDocPtr">xmlDocPtr</a>
</pre><pre class="programlisting">Structure <a href="#xmlDtd">xmlDtd</a><br />struct _xmlDtd
</pre><pre class="programlisting">Typedef <a href="libxml-tree.html#xmlDtd">xmlDtd</a> * <a name="xmlDtdPtr" id="xmlDtdPtr">xmlDtdPtr</a>
@@ -277,10 +278,12 @@ A:link, A:visited, A:active { text-decoration: underline }
unsigned int use : The buffer size used
unsigned int size : The buffer size
<a href="libxml-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> alloc : The realloc method
+ <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * contentIO : in IO mode we may have a different base
}</pre><h3>Enum <a name="xmlBufferAllocationScheme" id="xmlBufferAllocationScheme">xmlBufferAllocationScheme</a></h3><pre class="programlisting">Enum xmlBufferAllocationScheme {
- <a name="XML_BUFFER_ALLOC_DOUBLEIT" id="XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> = 1
- <a name="XML_BUFFER_ALLOC_EXACT" id="XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> = 2
- <a name="XML_BUFFER_ALLOC_IMMUTABLE" id="XML_BUFFER_ALLOC_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a> = 3
+ <a name="XML_BUFFER_ALLOC_DOUBLEIT" id="XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> = 1 : double each time one need to grow
+ <a name="XML_BUFFER_ALLOC_EXACT" id="XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> = 2 : grow only to the minimal size
+ <a name="XML_BUFFER_ALLOC_IMMUTABLE" id="XML_BUFFER_ALLOC_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a> = 3 : immutable buffer
+ <a name="XML_BUFFER_ALLOC_IO" id="XML_BUFFER_ALLOC_IO">XML_BUFFER_ALLOC_IO</a> = 4 : special allocation scheme used for I/O
}
</pre><h3><a name="xmlDOMWrapCtxt" id="xmlDOMWrapCtxt">Structure xmlDOMWrapCtxt</a></h3><pre class="programlisting">Structure xmlDOMWrapCtxt<br />struct _xmlDOMWrapCtxt {
void * _private : * The type of this context, just in case
@@ -310,7 +313,19 @@ A:link, A:visited, A:active { text-decoration: underline }
int charset : encoding of the in-memory content actua
struct _xmlDict * dict : dict used to allocate names or NULL
void * psvi : for type/PSVI informations
-}</pre><h3><a name="xmlDtd" id="xmlDtd">Structure xmlDtd</a></h3><pre class="programlisting">Structure xmlDtd<br />struct _xmlDtd {
+ 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 {
+ <a name="XML_DOC_WELLFORMED" id="XML_DOC_WELLFORMED">XML_DOC_WELLFORMED</a> = 1 : document is XML well formed
+ <a name="XML_DOC_NSVALID" id="XML_DOC_NSVALID">XML_DOC_NSVALID</a> = 2 : document is Namespace valid
+ <a name="XML_DOC_OLD10" id="XML_DOC_OLD10">XML_DOC_OLD10</a> = 4 : parsed with old XML-1.0 parser
+ <a name="XML_DOC_DTDVALID" id="XML_DOC_DTDVALID">XML_DOC_DTDVALID</a> = 8 : DTD validation was successful
+ <a name="XML_DOC_XINCLUDE" id="XML_DOC_XINCLUDE">XML_DOC_XINCLUDE</a> = 16 : XInclude substitution was done
+ <a name="XML_DOC_USERBUILT" id="XML_DOC_USERBUILT">XML_DOC_USERBUILT</a> = 32 : Document was built using the API and not by parsing an instance
+ <a name="XML_DOC_INTERNAL" id="XML_DOC_INTERNAL">XML_DOC_INTERNAL</a> = 64 : built for internal processing
+ <a name="XML_DOC_HTML" id="XML_DOC_HTML">XML_DOC_HTML</a> = 128 : parsed or built HTML document
+}
+</pre><h3><a name="xmlDtd" id="xmlDtd">Structure xmlDtd</a></h3><pre class="programlisting">Structure xmlDtd<br />struct _xmlDtd {
void * _private : application data
<a href="libxml-tree.html#xmlElementType">xmlElementType</a> type : XML_DTD_NODE, must be second !
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name : Name of the DTD
@@ -412,7 +427,7 @@ A:link, A:visited, A:active { text-decoration: underline }
struct _xmlEntity * nexte : unused
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * URI : the full URI as computed
int owner : does the entity own the childrens
- int checked : was the entity content checked
+ int checked : was the entity content checked this is
}</pre><h3><a name="xmlEnumeration" id="xmlEnumeration">Structure xmlEnumeration</a></h3><pre class="programlisting">Structure xmlEnumeration<br />struct _xmlEnumeration {
struct _xmlEnumeration * next : next one
const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name : Enumeration name
@@ -542,6 +557,8 @@ A:link, A:visited, A:active { text-decoration: underline }
<a href="libxml-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error informations for th
<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
+ unsigned long sizeentities : size of parsed entities
}</pre><h3><a name="xmlParserInput" id="xmlParserInput">Structure xmlParserInput</a></h3><pre class="programlisting">Structure xmlParserInput<br />struct _xmlParserInput {
<a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> buf : UTF-8 encoded buffer
const char * filename : The file analyzed, if any
diff --git a/doc/html/libxml-uri.html b/doc/html/libxml-uri.html
index 9b8cdb6..61d4dba 100644
--- a/doc/html/libxml-uri.html
+++ b/doc/html/libxml-uri.html
@@ -53,11 +53,11 @@ 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>uri</tt></i>:</span></td><td>pointer to an <a href="libxml-uri.html#xmlURI">xmlURI</a></td></tr></tbody></table></div><h3><a name="xmlNormalizeURIPath" id="xmlNormalizeURIPath"></a>Function: xmlNormalizeURIPath</h3><pre class="programlisting">int xmlNormalizeURIPath (char * path)<br />
</pre><p>Applies the 5 normalization steps to a path string--that is, RFC 2396 Section 5.2, steps 6.c through 6.g. Normalization occurs directly on the string, no new allocation is done</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>pointer to the path string</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 or an error code</td></tr></tbody></table></div><h3><a name="xmlParseURI" id="xmlParseURI"></a>Function: xmlParseURI</h3><pre class="programlisting"><a href="libxml-uri.html#xmlURIPtr">xmlURIPtr</a> xmlParseURI (const char * str)<br />
-</pre><p>Parse an URI URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
+</pre><p>Parse an URI based on RFC 3986 URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the URI string to analyze</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a newly built <a href="libxml-uri.html#xmlURIPtr">xmlURIPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlParseURIRaw" id="xmlParseURIRaw"></a>Function: xmlParseURIRaw</h3><pre class="programlisting"><a href="libxml-uri.html#xmlURIPtr">xmlURIPtr</a> xmlParseURIRaw (const char * str, <br /> int raw)<br />
-</pre><p>Parse an URI but allows to keep intact the original fragments. URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
+</pre><p>Parse an URI but allows to keep intact the original fragments. URI-reference = URI / relative-ref</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the URI string to analyze</td></tr><tr><td><span class="term"><i><tt>raw</tt></i>:</span></td><td>if 1 unescaping of URI pieces are disabled</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a newly built <a href="libxml-uri.html#xmlURIPtr">xmlURIPtr</a> or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlParseURIReference" id="xmlParseURIReference"></a>Function: xmlParseURIReference</h3><pre class="programlisting">int xmlParseURIReference (<a href="libxml-uri.html#xmlURIPtr">xmlURIPtr</a> uri, <br /> const char * str)<br />
-</pre><p>Parse an URI <a href="libxml-SAX.html#reference">reference</a> string and fills in the appropriate fields of the @uri structure URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]</p>
+</pre><p>Parse an URI <a href="libxml-SAX.html#reference">reference</a> string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = URI / relative-ref</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>uri</tt></i>:</span></td><td>pointer to an URI structure</td></tr><tr><td><span class="term"><i><tt>str</tt></i>:</span></td><td>the string to analyze</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 or the error code</td></tr></tbody></table></div><h3><a name="xmlPathToURI" id="xmlPathToURI"></a>Function: xmlPathToURI</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlPathToURI (const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * path)<br />
</pre><p>Constructs an URI expressing the existing path</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>path</tt></i>:</span></td><td>the resource locator in a filesystem notation</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new URI, or a duplicate of the path parameter if the construction fails. The caller is responsible for freeing the memory occupied by the returned string. If there is insufficient memory available, or the argument is NULL, the function returns NULL.</td></tr></tbody></table></div><h3><a name="xmlPrintURI" id="xmlPrintURI"></a>Function: xmlPrintURI</h3><pre class="programlisting">void xmlPrintURI (FILE * stream, <br /> <a href="libxml-uri.html#xmlURIPtr">xmlURIPtr</a> uri)<br />
diff --git a/doc/html/libxml-valid.html b/doc/html/libxml-valid.html
index 30ef3cd..eb9f667 100644
--- a/doc/html/libxml-valid.html
+++ b/doc/html/libxml-valid.html
@@ -241,8 +241,8 @@ 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>elem</tt></i>:</span></td><td>the parent</td></tr><tr><td><span class="term"><i><tt>name</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> name</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>the <a href="libxml-SAX.html#attribute">attribute</a> value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a new normalized string if normalization is needed, NULL otherwise the caller must free the returned value.</td></tr></tbody></table></div><h3><a name="xmlValidateAttributeDecl" id="xmlValidateAttributeDecl"></a>Function: xmlValidateAttributeDecl</h3><pre class="programlisting">int xmlValidateAttributeDecl (<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br /> <a href="libxml-tree.html#xmlAttributePtr">xmlAttributePtr</a> attr)<br />
</pre><p>Try to validate a single <a href="libxml-SAX.html#attribute">attribute</a> definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] The ID/IDREF uniqueness and matching are done separately</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 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>attr</tt></i>:</span></td><td>an <a href="libxml-SAX.html#attribute">attribute</a> definition</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlValidateAttributeValue" id="xmlValidateAttributeValue"></a>Function: xmlValidateAttributeValue</h3><pre class="programlisting">int xmlValidateAttributeValue (<a href="libxml-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * value)<br />
-</pre><p>Validate that the given <a href="libxml-SAX.html#attribute">attribute</a> value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td>an <a href="libxml-SAX.html#attribute">attribute</a> type</td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td>an <a href="libxml-SAX.html#attribute">attribute</a> value</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlValidateDocument" id="xmlValidateDocument"></a>Function: xmlValidateDocument</h3><pre class="programlisting">int xmlValidateDocument (<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
+</pre><p></p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>type</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>value</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlValidateDocument" id="xmlValidateDocument"></a>Function: xmlValidateDocument</h3><pre class="programlisting">int xmlValidateDocument (<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
</pre><p>Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</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 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>Returns</tt></i>:</span></td><td>1 if valid or 0 otherwise</td></tr></tbody></table></div><h3><a name="xmlValidateDocumentFinal" id="xmlValidateDocumentFinal"></a>Function: xmlValidateDocumentFinal</h3><pre class="programlisting">int xmlValidateDocumentFinal (<a href="libxml-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
</pre><p>Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for validity</p>
diff --git a/doc/html/libxml-xmlerror.html b/doc/html/libxml-xmlerror.html
index 9803b4a..74af5ed 100644
--- a/doc/html/libxml-xmlerror.html
+++ b/doc/html/libxml-xmlerror.html
@@ -197,11 +197,14 @@ void <a href="#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> (void * userD
<a name="XML_ERR_NOTATION_PROCESSING" id="XML_ERR_NOTATION_PROCESSING">XML_ERR_NOTATION_PROCESSING</a> = 105 : 105
<a name="XML_WAR_NS_COLUMN" id="XML_WAR_NS_COLUMN">XML_WAR_NS_COLUMN</a> = 106 : 106
<a name="XML_WAR_ENTITY_REDEFINED" id="XML_WAR_ENTITY_REDEFINED">XML_WAR_ENTITY_REDEFINED</a> = 107 : 107
+ <a name="XML_ERR_UNKNOWN_VERSION" id="XML_ERR_UNKNOWN_VERSION">XML_ERR_UNKNOWN_VERSION</a> = 108 : 108
+ <a name="XML_ERR_VERSION_MISMATCH" id="XML_ERR_VERSION_MISMATCH">XML_ERR_VERSION_MISMATCH</a> = 109 : 109
<a name="XML_NS_ERR_XML_NAMESPACE" id="XML_NS_ERR_XML_NAMESPACE">XML_NS_ERR_XML_NAMESPACE</a> = 200
<a name="XML_NS_ERR_UNDEFINED_NAMESPACE" id="XML_NS_ERR_UNDEFINED_NAMESPACE">XML_NS_ERR_UNDEFINED_NAMESPACE</a> = 201 : 201
<a name="XML_NS_ERR_QNAME" id="XML_NS_ERR_QNAME">XML_NS_ERR_QNAME</a> = 202 : 202
<a name="XML_NS_ERR_ATTRIBUTE_REDEFINED" id="XML_NS_ERR_ATTRIBUTE_REDEFINED">XML_NS_ERR_ATTRIBUTE_REDEFINED</a> = 203 : 203
<a name="XML_NS_ERR_EMPTY" id="XML_NS_ERR_EMPTY">XML_NS_ERR_EMPTY</a> = 204 : 204
+ <a name="XML_NS_ERR_COLON" id="XML_NS_ERR_COLON">XML_NS_ERR_COLON</a> = 205 : 205
<a name="XML_DTD_ATTRIBUTE_DEFAULT" id="XML_DTD_ATTRIBUTE_DEFAULT">XML_DTD_ATTRIBUTE_DEFAULT</a> = 500
<a name="XML_DTD_ATTRIBUTE_REDEFINED" id="XML_DTD_ATTRIBUTE_REDEFINED">XML_DTD_ATTRIBUTE_REDEFINED</a> = 501 : 501
<a name="XML_DTD_ATTRIBUTE_VALUE" id="XML_DTD_ATTRIBUTE_VALUE">XML_DTD_ATTRIBUTE_VALUE</a> = 502 : 502
@@ -243,6 +246,7 @@ void <a href="#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> (void * userD
<a name="XML_DTD_STANDALONE_DEFAULTED" id="XML_DTD_STANDALONE_DEFAULTED">XML_DTD_STANDALONE_DEFAULTED</a> = 538 : 538
<a name="XML_DTD_XMLID_VALUE" id="XML_DTD_XMLID_VALUE">XML_DTD_XMLID_VALUE</a> = 539 : 539
<a name="XML_DTD_XMLID_TYPE" id="XML_DTD_XMLID_TYPE">XML_DTD_XMLID_TYPE</a> = 540 : 540
+ <a name="XML_DTD_DUP_TOKEN" id="XML_DTD_DUP_TOKEN">XML_DTD_DUP_TOKEN</a> = 541 : 541
<a name="XML_HTML_STRUCURE_ERROR" id="XML_HTML_STRUCURE_ERROR">XML_HTML_STRUCURE_ERROR</a> = 800
<a name="XML_HTML_UNKNOWN_TAG" id="XML_HTML_UNKNOWN_TAG">XML_HTML_UNKNOWN_TAG</a> = 801 : 801
<a name="XML_RNGP_ANYNAME_ATTR_ANCESTOR" id="XML_RNGP_ANYNAME_ATTR_ANCESTOR">XML_RNGP_ANYNAME_ATTR_ANCESTOR</a> = 1000
diff --git a/doc/html/libxml-xmlmemory.html b/doc/html/libxml-xmlmemory.html
index ea62ae7..8dd16ec 100644
--- a/doc/html/libxml-xmlmemory.html
+++ b/doc/html/libxml-xmlmemory.html
@@ -32,6 +32,7 @@ void * <a href="#xmlMallocFunc">xmlMallocFunc</a> (size_t size)
<pre class="programlisting">void * <a href="#xmlMallocLoc">xmlMallocLoc</a> (size_t size, <br /> const char * file, <br /> int line)</pre>
<pre class="programlisting">int <a href="#xmlMemBlocks">xmlMemBlocks</a> (void)</pre>
<pre class="programlisting">void <a href="#xmlMemDisplay">xmlMemDisplay</a> (FILE * fp)</pre>
+<pre class="programlisting">void <a href="#xmlMemDisplayLast">xmlMemDisplayLast</a> (FILE * fp, <br /> long nbBytes)</pre>
<pre class="programlisting">void <a href="#xmlMemFree">xmlMemFree</a> (void * ptr)</pre>
<pre class="programlisting">int <a href="#xmlMemGet">xmlMemGet</a> (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br /> <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br /> <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br /> <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc)</pre>
<pre class="programlisting">void * <a href="#xmlMemMalloc">xmlMemMalloc</a> (size_t size)</pre>
@@ -73,7 +74,9 @@ void * xmlMallocFunc (size_t size)
</pre><p>Provides the number of memory areas currently allocated</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>an int representing the number of blocks</td></tr></tbody></table></div><h3><a name="xmlMemDisplay" id="xmlMemDisplay"></a>Function: xmlMemDisplay</h3><pre class="programlisting">void xmlMemDisplay (FILE * fp)<br />
</pre><p>show in-extenso the memory blocks allocated</p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist</td></tr></tbody></table></div><h3><a name="xmlMemFree" id="xmlMemFree"></a>Function: xmlMemFree</h3><pre class="programlisting">void xmlMemFree (void * ptr)<br />
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist</td></tr></tbody></table></div><h3><a name="xmlMemDisplayLast" id="xmlMemDisplayLast"></a>Function: xmlMemDisplayLast</h3><pre class="programlisting">void xmlMemDisplayLast (FILE * fp, <br /> long nbBytes)<br />
+</pre><p>the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>fp</tt></i>:</span></td><td>a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist</td></tr><tr><td><span class="term"><i><tt>nbBytes</tt></i>:</span></td><td>the amount of memory to dump</td></tr></tbody></table></div><h3><a name="xmlMemFree" id="xmlMemFree"></a>Function: xmlMemFree</h3><pre class="programlisting">void xmlMemFree (void * ptr)<br />
</pre><p>a free() equivalent, with error checking.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ptr</tt></i>:</span></td><td>the memory block pointer</td></tr></tbody></table></div><h3><a name="xmlMemGet" id="xmlMemGet"></a>Function: xmlMemGet</h3><pre class="programlisting">int xmlMemGet (<a href="libxml-xmlmemory.html#xmlFreeFunc">xmlFreeFunc</a> * freeFunc, <br /> <a href="libxml-xmlmemory.html#xmlMallocFunc">xmlMallocFunc</a> * mallocFunc, <br /> <a href="libxml-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br /> <a href="libxml-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc)<br />
</pre><p>Provides the memory access functions set currently in use</p>
diff --git a/doc/html/libxml-xmlreader.html b/doc/html/libxml-xmlreader.html
index b4c1cbc..f02707a 100644
--- a/doc/html/libxml-xmlreader.html
+++ b/doc/html/libxml-xmlreader.html
@@ -217,7 +217,7 @@ The content of this structure is not made public by the API.
</pre><p>The depth of the node in the tree.</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 depth or -1 in case of error</td></tr></tbody></table></div><h3><a name="xmlTextReaderErrorFunc" id="xmlTextReaderErrorFunc"></a>Function type: xmlTextReaderErrorFunc</h3><pre class="programlisting">Function type: xmlTextReaderErrorFunc
void xmlTextReaderErrorFunc (void * arg, <br /> const char * msg, <br /> <a href="libxml-xmlreader.html#xmlParserSeverities">xmlParserSeverities</a> severity, <br /> <a href="libxml-xmlreader.html#xmlTextReaderLocatorPtr">xmlTextReaderLocatorPtr</a> locator)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>severity</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>locator</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</pre><p>Signature of an error callback from a reader parser</p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>arg</tt></i>:</span></td><td>the user argument</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>severity</tt></i>:</span></td><td>the severity of the error</td></tr><tr><td><span class="term"><i><tt>locator</tt></i>:</span></td><td>a locator indicating where the error occured</td></tr></tbody></table></div><br />
<h3><a name="xmlTextReaderExpand" id="xmlTextReaderExpand"></a>Function: xmlTextReaderExpand</h3><pre class="programlisting"><a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> xmlTextReaderExpand (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br />
</pre><p>Reads the contents of the current node and the full subtree. It then makes the subtree available until the next xmlTextReaderRead() call</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>a node pointer valid until the next xmlTextReaderRead() call or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlTextReaderGetAttribute" id="xmlTextReaderGetAttribute"></a>Function: xmlTextReaderGetAttribute</h3><pre class="programlisting"><a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * xmlTextReaderGetAttribute (<a href="libxml-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br /> const <a href="libxml-xmlstring.html#xmlChar">xmlChar</a> * name)<br />
diff --git a/doc/html/libxml-xmlregexp.html b/doc/html/libxml-xmlregexp.html
index 642e930..15de2f4 100644
--- a/doc/html/libxml-xmlregexp.html
+++ b/doc/html/libxml-xmlregexp.html
@@ -117,7 +117,7 @@ The content of this structure is not made public by the API.
</pre><p>Check whether @exp accepts all the languages accexpted by @sub the input being a subexpression.</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 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><h3><a name="xmlRegExecCallbacks" id="xmlRegExecCallbacks"></a>Function type: xmlRegExecCallbacks</h3><pre class="programlisting">Function type: xmlRegExecCallbacks
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></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>exec</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>token</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>transdata</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>inputdata</tt></i>:</span></td><td></td></tr></tbody></table></div><br />
+</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>
<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 />
diff --git a/doc/html/libxml-xmlschemas.html b/doc/html/libxml-xmlschemas.html
index 261f221..aa4b76f 100644
--- a/doc/html/libxml-xmlschemas.html
+++ b/doc/html/libxml-xmlschemas.html
@@ -43,7 +43,8 @@ The content of this structure is not made public by the API.
<pre class="programlisting">int <a href="#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> int options)</pre>
<pre class="programlisting">void <a href="#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br /> void * ctx)</pre>
<pre class="programlisting">int <a href="#xmlSchemaValidCtxtGetOptions">xmlSchemaValidCtxtGetOptions</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)</pre>
-<pre class="programlisting">int <a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> instance)</pre>
+<pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="#xmlSchemaValidCtxtGetParserCtxt">xmlSchemaValidCtxtGetParserCtxt</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)</pre>
+<pre class="programlisting">int <a href="#xmlSchemaValidateDoc">xmlSchemaValidateDoc</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)</pre>
<pre class="programlisting">int <a href="#xmlSchemaValidateFile">xmlSchemaValidateFile</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> const char * filename, <br /> int options)</pre>
<pre class="programlisting">int <a href="#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)</pre>
<pre class="programlisting">int <a href="#xmlSchemaValidateStream">xmlSchemaValidateStream</a> (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br /> <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data)</pre>
@@ -120,51 +121,53 @@ 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>schema</tt></i>:</span></td><td>a schema structure</td></tr></tbody></table></div><h3><a name="xmlSchemaFreeParserCtxt" id="xmlSchemaFreeParserCtxt"></a>Function: xmlSchemaFreeParserCtxt</h3><pre class="programlisting">void xmlSchemaFreeParserCtxt (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br />
</pre><p>Free the resources associated to the schema 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>the schema parser context</td></tr></tbody></table></div><h3><a name="xmlSchemaFreeValidCtxt" id="xmlSchemaFreeValidCtxt"></a>Function: xmlSchemaFreeValidCtxt</h3><pre class="programlisting">void xmlSchemaFreeValidCtxt (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></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>Free the resources associated to the schema 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>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></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></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></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></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 />
+</pre><p>Get the error and warning callback 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>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 />
</pre><p>Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a preparsed document tree</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlSchemaNewMemParserCtxt" id="xmlSchemaNewMemParserCtxt"></a>Function: xmlSchemaNewMemParserCtxt</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> xmlSchemaNewMemParserCtxt (const char * buffer, <br /> int size)<br />
</pre><p>Create an XML Schemas parse context for that memory buffer expected to contain an XML Schemas file.</p>
<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>buffer</tt></i>:</span></td><td>a pointer to a char array containing the schemas</td></tr><tr><td><span class="term"><i><tt>size</tt></i>:</span></td><td>the size of the array</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlSchemaNewParserCtxt" id="xmlSchemaNewParserCtxt"></a>Function: xmlSchemaNewParserCtxt</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> xmlSchemaNewParserCtxt (const char * URL)<br />
</pre><p>Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas 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 location of the schema</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlSchemaNewValidCtxt" id="xmlSchemaNewValidCtxt"></a>Function: xmlSchemaNewValidCtxt</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> xmlSchemaNewValidCtxt (<a href="libxml-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>schema</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaParse" id="xmlSchemaParse"></a>Function: xmlSchemaParse</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> xmlSchemaParse (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br />
+</pre><p>Create an XML Schemas validation context based on the given schema.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>schema</tt></i>:</span></td><td>a precompiled XML Schemas</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the validation context or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlSchemaParse" id="xmlSchemaParse"></a>Function: xmlSchemaParse</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> xmlSchemaParse (<a href="libxml-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt)<br />
</pre><p>parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.</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>Returns</tt></i>:</span></td><td>the internal XML Schema structure built from the resource or NULL in case of error</td></tr></tbody></table></div><h3><a name="xmlSchemaSAXPlug" id="xmlSchemaSAXPlug"></a>Function: xmlSchemaSAXPlug</h3><pre class="programlisting"><a href="libxml-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> xmlSchemaSAXPlug (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> * sax, <br /> void ** user_data)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaSAXUnplug" id="xmlSchemaSAXUnplug"></a>Function: xmlSchemaSAXUnplug</h3><pre class="programlisting">int xmlSchemaSAXUnplug (<a href="libxml-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>plug</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaSetParserErrors" id="xmlSchemaSetParserErrors"></a>Function: xmlSchemaSetParserErrors</h3><pre class="programlisting">void xmlSchemaSetParserErrors (<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>Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.</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>sax</tt></i>:</span></td><td>a pointer to the original <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a></td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>a pointer to the original SAX user data pointer</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.</td></tr></tbody></table></div><h3><a name="xmlSchemaSAXUnplug" id="xmlSchemaSAXUnplug"></a>Function: xmlSchemaSAXUnplug</h3><pre class="programlisting">int xmlSchemaSAXUnplug (<a href="libxml-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug)<br />
+</pre><p>Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.</p>
+<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>plug</tt></i>:</span></td><td>a data structure returned by <a href="libxml-xmlschemas.html#xmlSchemaSAXPlug">xmlSchemaSAXPlug</a></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 failure.</td></tr></tbody></table></div><h3><a name="xmlSchemaSetParserErrors" id="xmlSchemaSetParserErrors"></a>Function: xmlSchemaSetParserErrors</h3><pre class="programlisting">void xmlSchemaSetParserErrors (<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>Set the callback functions 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 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></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>err</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>warn</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></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></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></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 />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>serror</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidCtxtGetOptions" id="xmlSchemaValidCtxtGetOptions"></a>Function: xmlSchemaValidCtxtGetOptions</h3><pre class="programlisting">int xmlSchemaValidCtxtGetOptions (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidateDoc" id="xmlSchemaValidateDoc"></a>Function: xmlSchemaValidateDoc</h3><pre class="programlisting">int xmlSchemaValidateDoc (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> instance)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>instance</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidateFile" id="xmlSchemaValidateFile"></a>Function: xmlSchemaValidateFile</h3><pre class="programlisting">int xmlSchemaValidateFile (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> const char * filename, <br /> int options)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>filename</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidateOneElement" id="xmlSchemaValidateOneElement"></a>Function: xmlSchemaValidateOneElement</h3><pre class="programlisting">int xmlSchemaValidateOneElement (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>elem</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidateStream" id="xmlSchemaValidateStream"></a>Function: xmlSchemaValidateStream</h3><pre class="programlisting">int xmlSchemaValidateStream (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br /> <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data)<br />
-</pre><p></p>
-<div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctxt</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>input</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td></td></tr></tbody></table></div><h3><a name="xmlSchemaValidityErrorFunc" id="xmlSchemaValidityErrorFunc"></a>Function type: xmlSchemaValidityErrorFunc</h3><pre class="programlisting">Function type: xmlSchemaValidityErrorFunc
+</pre><p>Set the error and warning callback 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>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 />
+</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 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="xmlSchemaValidCtxtGetOptions" id="xmlSchemaValidCtxtGetOptions"></a>Function: xmlSchemaValidCtxtGetOptions</h3><pre class="programlisting">int xmlSchemaValidCtxtGetOptions (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
+</pre><p>Get the validation context options.</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>Returns</tt></i>:</span></td><td>the option combination or -1 on error.</td></tr></tbody></table></div><h3><a name="xmlSchemaValidCtxtGetParserCtxt" id="xmlSchemaValidCtxtGetParserCtxt"></a>Function: xmlSchemaValidCtxtGetParserCtxt</h3><pre class="programlisting"><a href="libxml-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlSchemaValidCtxtGetParserCtxt (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt)<br />
+</pre><p>allow access to the parser context of the schema 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 schema validation context</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>the parser context of the schema validation context or NULL in case of error.</td></tr></tbody></table></div><h3><a name="xmlSchemaValidateDoc" id="xmlSchemaValidateDoc"></a>Function: xmlSchemaValidateDoc</h3><pre class="programlisting">int xmlSchemaValidateDoc (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br />
+</pre><p>Validate a document tree in 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>a schema validation context</td></tr><tr><td><span class="term"><i><tt>doc</tt></i>:</span></td><td>a parsed document tree</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td></tr></tbody></table></div><h3><a name="xmlSchemaValidateFile" id="xmlSchemaValidateFile"></a>Function: xmlSchemaValidateFile</h3><pre class="programlisting">int xmlSchemaValidateFile (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> const char * filename, <br /> int options)<br />
+</pre><p>Do a schemas validation of the given resource, it will use the SAX streamable validation internally.</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>filename</tt></i>:</span></td><td>the URI of the instance</td></tr><tr><td><span class="term"><i><tt>options</tt></i>:</span></td><td>a future set of options, currently unused</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td></tr></tbody></table></div><h3><a name="xmlSchemaValidateOneElement" id="xmlSchemaValidateOneElement"></a>Function: xmlSchemaValidateOneElement</h3><pre class="programlisting">int xmlSchemaValidateOneElement (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br />
+</pre><p>Validate a branch of a tree, starting with the given @elem.</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>elem</tt></i>:</span></td><td>an element node</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.</td></tr></tbody></table></div><h3><a name="xmlSchemaValidateStream" id="xmlSchemaValidateStream"></a>Function: xmlSchemaValidateStream</h3><pre class="programlisting">int xmlSchemaValidateStream (<a href="libxml-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br /> <a href="libxml-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br /> <a href="libxml-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br /> <a href="libxml-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br /> void * user_data)<br />
+</pre><p>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</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>input</tt></i>:</span></td><td>the input to use for reading the data</td></tr><tr><td><span class="term"><i><tt>enc</tt></i>:</span></td><td>an optional encoding information</td></tr><tr><td><span class="term"><i><tt>sax</tt></i>:</span></td><td>a SAX handler for the resulting events</td></tr><tr><td><span class="term"><i><tt>user_data</tt></i>:</span></td><td>the context to provide to the SAX handler.</td></tr><tr><td><span class="term"><i><tt>Returns</tt></i>:</span></td><td>0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.</td></tr></tbody></table></div><h3><a name="xmlSchemaValidityErrorFunc" id="xmlSchemaValidityErrorFunc"></a>Function type: xmlSchemaValidityErrorFunc</h3><pre class="programlisting">Function type: xmlSchemaValidityErrorFunc
void xmlSchemaValidityErrorFunc (void * ctx, <br /> const char * msg, <br /> ... ...)
-</pre><p></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td></td></tr></tbody></table></div><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="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></p><div class="variablelist"><table border="0"><col align="left" /><tbody><tr><td><span class="term"><i><tt>ctx</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>msg</tt></i>:</span></td><td></td></tr><tr><td><span class="term"><i><tt>...</tt></i>:</span></td><td></td></tr></tbody></table></div><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 />
<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>
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 867ac92..98dc568 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -445,6 +445,7 @@
<exports symbol='xmlEntitiesTablePtr' type='typedef'/>
<exports symbol='_xmlEntity' type='struct'/>
<exports symbol='xmlAddDocEntity' type='function'/>
+ <exports symbol='xmlNewEntity' type='function'/>
<exports symbol='xmlEncodeEntitiesReentrant' type='function'/>
<exports symbol='xmlGetDocEntity' type='function'/>
<exports symbol='xmlGetDtdEntity' type='function'/>
@@ -665,6 +666,7 @@
<exports symbol='XML_SAX2_MAGIC' type='macro'/>
<exports symbol='XML_DETECT_IDS' type='macro'/>
<exports symbol='XML_DEFAULT_VERSION' type='macro'/>
+ <exports symbol='XML_WITH_NONE' type='enum'/>
<exports symbol='XML_WITH_SCHEMATRON' type='enum'/>
<exports symbol='XML_PARSER_ENTITY_DECL' type='enum'/>
<exports symbol='XML_PARSER_CONTENT' type='enum'/>
@@ -674,9 +676,10 @@
<exports symbol='XML_PARSER_SYSTEM_LITERAL' type='enum'/>
<exports symbol='XML_WITH_REGEXP' type='enum'/>
<exports symbol='XML_PARSER_PI' type='enum'/>
- <exports symbol='XML_WITH_FTP' type='enum'/>
+ <exports symbol='XML_PARSE_UNKNOWN' type='enum'/>
<exports symbol='XML_WITH_XPATH' type='enum'/>
<exports symbol='XML_WITH_HTML' type='enum'/>
+ <exports symbol='XML_WITH_FTP' type='enum'/>
<exports symbol='XML_WITH_WRITER' type='enum'/>
<exports symbol='XML_WITH_C14N' type='enum'/>
<exports symbol='XML_PARSE_PUSH_DOM' type='enum'/>
@@ -699,7 +702,7 @@
<exports symbol='XML_WITH_LEGACY' type='enum'/>
<exports symbol='XML_PARSE_XINCLUDE' type='enum'/>
<exports symbol='XML_PARSE_NOXINCNODE' type='enum'/>
- <exports symbol='XML_WITH_NONE' type='enum'/>
+ <exports symbol='XML_PARSE_NOBASEFIX' type='enum'/>
<exports symbol='XML_WITH_OUTPUT' type='enum'/>
<exports symbol='XML_WITH_XINCLUDE' type='enum'/>
<exports symbol='XML_WITH_PUSH' type='enum'/>
@@ -711,7 +714,7 @@
<exports symbol='XML_PARSE_DTDLOAD' type='enum'/>
<exports symbol='XML_PARSE_DTDATTR' type='enum'/>
<exports symbol='XML_PARSE_NOWARNING' type='enum'/>
- <exports symbol='XML_WITH_VALID' type='enum'/>
+ <exports symbol='XML_PARSE_OLD10' type='enum'/>
<exports symbol='XML_PARSE_NOERROR' type='enum'/>
<exports symbol='XML_WITH_ISO8859X' type='enum'/>
<exports symbol='XML_WITH_EXPR' type='enum'/>
@@ -729,7 +732,7 @@
<exports symbol='XML_PARSER_MISC' type='enum'/>
<exports symbol='XML_PARSER_START' type='enum'/>
<exports symbol='XML_WITH_DEBUG_MEM' type='enum'/>
- <exports symbol='XML_PARSE_UNKNOWN' type='enum'/>
+ <exports symbol='XML_PARSE_HUGE' type='enum'/>
<exports symbol='XML_PARSER_START_TAG' type='enum'/>
<exports symbol='XML_PARSER_IGNORE' type='enum'/>
<exports symbol='XML_PARSER_COMMENT' type='enum'/>
@@ -738,6 +741,7 @@
<exports symbol='XML_WITH_AUTOMATA' type='enum'/>
<exports symbol='XML_WITH_DEBUG_RUN' type='enum'/>
<exports symbol='XML_WITH_SAX1' type='enum'/>
+ <exports symbol='XML_WITH_VALID' type='enum'/>
<exports symbol='xmlParserNodeInfoSeqPtr' type='typedef'/>
<exports symbol='xmlSAXHandlerV1' type='typedef'/>
<exports symbol='xmlParserInputState' type='typedef'/>
@@ -1393,36 +1397,44 @@
<exports symbol='BASE_BUFFER_SIZE' type='macro'/>
<exports symbol='XML_ATTRIBUTE_IMPLIED' type='enum'/>
<exports symbol='XML_ELEMENT_CONTENT_ELEMENT' type='enum'/>
+ <exports symbol='XML_ENTITY_REF_NODE' type='enum'/>
<exports symbol='XML_ATTRIBUTE_IDREFS' type='enum'/>
<exports symbol='XML_BUFFER_ALLOC_DOUBLEIT' type='enum'/>
<exports symbol='XML_XINCLUDE_END' type='enum'/>
<exports symbol='XML_ATTRIBUTE_NODE' type='enum'/>
+ <exports symbol='XML_ATTRIBUTE_NMTOKENS' type='enum'/>
<exports symbol='XML_ATTRIBUTE_IDREF' type='enum'/>
<exports symbol='XML_ELEMENT_TYPE_ELEMENT' type='enum'/>
+ <exports symbol='XML_TEXT_NODE' type='enum'/>
<exports symbol='XML_CDATA_SECTION_NODE' type='enum'/>
<exports symbol='XML_ELEMENT_NODE' type='enum'/>
<exports symbol='XML_ELEMENT_DECL' type='enum'/>
- <exports symbol='XML_ELEMENT_CONTENT_SEQ' type='enum'/>
+ <exports symbol='XML_DOC_USERBUILT' type='enum'/>
+ <exports symbol='XML_DOC_INTERNAL' type='enum'/>
<exports symbol='XML_ATTRIBUTE_REQUIRED' type='enum'/>
<exports symbol='XML_DOCUMENT_FRAG_NODE' type='enum'/>
+ <exports symbol='XML_DOC_DTDVALID' type='enum'/>
<exports symbol='XML_ELEMENT_TYPE_ANY' type='enum'/>
+ <exports symbol='XML_DOC_NSVALID' type='enum'/>
<exports symbol='XML_ELEMENT_CONTENT_ONCE' type='enum'/>
<exports symbol='XML_ELEMENT_CONTENT_PCDATA' type='enum'/>
<exports symbol='XML_ATTRIBUTE_FIXED' type='enum'/>
<exports symbol='XML_DOCUMENT_TYPE_NODE' type='enum'/>
+ <exports symbol='XML_DOC_HTML' type='enum'/>
<exports symbol='XML_ELEMENT_CONTENT_OPT' type='enum'/>
<exports symbol='XML_NAMESPACE_DECL' type='enum'/>
<exports symbol='XML_ATTRIBUTE_NOTATION' type='enum'/>
<exports symbol='XML_ELEMENT_TYPE_MIXED' type='enum'/>
<exports symbol='XML_XINCLUDE_START' type='enum'/>
- <exports symbol='XML_TEXT_NODE' type='enum'/>
+ <exports symbol='XML_DOC_XINCLUDE' type='enum'/>
<exports symbol='XML_BUFFER_ALLOC_EXACT' type='enum'/>
<exports symbol='XML_ATTRIBUTE_ENTITIES' type='enum'/>
<exports symbol='XML_BUFFER_ALLOC_IMMUTABLE' type='enum'/>
<exports symbol='XML_NOTATION_NODE' type='enum'/>
- <exports symbol='XML_ENTITY_REF_NODE' type='enum'/>
+ <exports symbol='XML_ELEMENT_CONTENT_SEQ' type='enum'/>
<exports symbol='XML_ELEMENT_TYPE_EMPTY' type='enum'/>
<exports symbol='XML_ATTRIBUTE_ENUMERATION' type='enum'/>
+ <exports symbol='XML_DOC_OLD10' type='enum'/>
<exports symbol='XML_HTML_DOCUMENT_NODE' type='enum'/>
<exports symbol='XML_ELEMENT_TYPE_UNDEFINED' type='enum'/>
<exports symbol='XML_DOCUMENT_NODE' type='enum'/>
@@ -1433,9 +1445,10 @@
<exports symbol='XML_ELEMENT_CONTENT_OR' type='enum'/>
<exports symbol='XML_ATTRIBUTE_NMTOKEN' type='enum'/>
<exports symbol='XML_PI_NODE' type='enum'/>
- <exports symbol='XML_ATTRIBUTE_NMTOKENS' type='enum'/>
+ <exports symbol='XML_BUFFER_ALLOC_IO' type='enum'/>
<exports symbol='XML_ENTITY_NODE' type='enum'/>
<exports symbol='XML_ATTRIBUTE_ENTITY' type='enum'/>
+ <exports symbol='XML_DOC_WELLFORMED' type='enum'/>
<exports symbol='XML_ATTRIBUTE_DECL' type='enum'/>
<exports symbol='XML_ENTITY_DECL' type='enum'/>
<exports symbol='XML_ATTRIBUTE_ID' type='enum'/>
@@ -1487,6 +1500,7 @@
<exports symbol='xmlSAXLocator' type='typedef'/>
<exports symbol='xmlElementContentPtr' type='typedef'/>
<exports symbol='xmlElementContentType' type='typedef'/>
+ <exports symbol='xmlDocProperties' type='typedef'/>
<exports symbol='xmlIDPtr' type='typedef'/>
<exports symbol='xmlDtd' type='typedef'/>
<exports symbol='xmlAttribute' type='typedef'/>
@@ -2010,7 +2024,6 @@
<exports symbol='XML_ERR_ENTITY_LOOP' type='enum'/>
<exports symbol='XML_IO_EINPROGRESS' type='enum'/>
<exports symbol='XML_SCHEMAP_REDEFINED_NOTATION' type='enum'/>
- <exports symbol='XML_IO_EFAULT' type='enum'/>
<exports symbol='XML_HTML_STRUCURE_ERROR' type='enum'/>
<exports symbol='XML_DTD_INVALID_DEFAULT' type='enum'/>
<exports symbol='XML_FROM_SCHEMATRONV' type='enum'/>
@@ -2023,7 +2036,7 @@
<exports symbol='XML_SCHEMAP_COS_ST_RESTRICTS_1_1' type='enum'/>
<exports symbol='XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD' type='enum'/>
<exports symbol='XML_ERR_PEREF_AT_EOF' type='enum'/>
- <exports symbol='XML_IO_LOAD_ERROR' type='enum'/>
+ <exports symbol='XML_DTD_NOT_EMPTY' type='enum'/>
<exports symbol='XML_RNGP_PAT_START_LIST' type='enum'/>
<exports symbol='XML_ERR_LT_REQUIRED' type='enum'/>
<exports symbol='XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2' type='enum'/>
@@ -2062,7 +2075,7 @@
<exports symbol='XML_SCHEMAV_NOTDETERMINIST' type='enum'/>
<exports symbol='XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD' type='enum'/>
<exports symbol='XML_SCHEMAV_MISSING' type='enum'/>
- <exports symbol='XML_RNGP_GRAMMAR_CONTENT' type='enum'/>
+ <exports symbol='XML_IO_EFAULT' type='enum'/>
<exports symbol='XML_XINCLUDE_XPTR_FAILED' type='enum'/>
<exports symbol='XML_FROM_FTP' type='enum'/>
<exports symbol='XML_RNGP_PARENTREF_CREATE_FAILED' type='enum'/>
@@ -2193,6 +2206,7 @@
<exports symbol='XML_ERR_NOTATION_NOT_STARTED' type='enum'/>
<exports symbol='XML_DTD_ENTITY_TYPE' type='enum'/>
<exports symbol='XML_SCHEMAP_SRC_SIMPLE_TYPE_4' type='enum'/>
+ <exports symbol='XML_RNGP_GRAMMAR_CONTENT' type='enum'/>
<exports symbol='XML_FTP_URL_SYNTAX' type='enum'/>
<exports symbol='XML_ERR_NONE' type='enum'/>
<exports symbol='XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD' type='enum'/>
@@ -2266,7 +2280,7 @@
<exports symbol='XML_ERR_ATTRIBUTE_NOT_FINISHED' type='enum'/>
<exports symbol='XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID' type='enum'/>
<exports symbol='XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE' type='enum'/>
- <exports symbol='XML_RNGP_GRAMMAR_EMPTY' type='enum'/>
+ <exports symbol='XML_IO_EINVAL' type='enum'/>
<exports symbol='XML_IO_ENAMETOOLONG' type='enum'/>
<exports symbol='XML_RNGP_EXTERNAL_REF_FAILURE' type='enum'/>
<exports symbol='XML_RNGP_PAT_START_TEXT' type='enum'/>
@@ -2360,6 +2374,7 @@
<exports symbol='XML_SCHEMAP_UNION_NOT_EXPRESSIBLE' type='enum'/>
<exports symbol='XML_RNGP_PAT_DATA_EXCEPT_ATTR' type='enum'/>
<exports symbol='XML_FTP_PASV_ANSWER' type='enum'/>
+ <exports symbol='XML_ERR_VERSION_MISMATCH' type='enum'/>
<exports symbol='XML_SCHEMAP_INVALID_BOOLEAN' type='enum'/>
<exports symbol='XML_SCHEMAV_CVC_ELT_4_2' type='enum'/>
<exports symbol='XML_DTD_ELEM_DEFAULT_NAMESPACE' type='enum'/>
@@ -2470,7 +2485,7 @@
<exports symbol='XML_ERR_ENTITY_PROCESSING' type='enum'/>
<exports symbol='XML_FROM_XINCLUDE' type='enum'/>
<exports symbol='XML_SCHEMAP_CVC_SIMPLE_TYPE' type='enum'/>
- <exports symbol='XML_IO_EINVAL' type='enum'/>
+ <exports symbol='XML_RNGP_GRAMMAR_EMPTY' type='enum'/>
<exports symbol='XML_CHECK_NOT_NCNAME' type='enum'/>
<exports symbol='XML_RNGP_ELEMENT_NO_CONTENT' type='enum'/>
<exports symbol='XML_XINCLUDE_NO_HREF' type='enum'/>
@@ -2505,6 +2520,7 @@
<exports symbol='XML_I18N_NO_HANDLER' type='enum'/>
<exports symbol='XML_RNGP_MISSING_HREF' type='enum'/>
<exports symbol='XML_ERR_PI_NOT_FINISHED' type='enum'/>
+ <exports symbol='XML_ERR_UNKNOWN_VERSION' type='enum'/>
<exports symbol='XML_FROM_RELAXNGP' type='enum'/>
<exports symbol='XML_FROM_VALID' type='enum'/>
<exports symbol='XML_SCHEMAP_S4S_ATTR_INVALID_VALUE' type='enum'/>
@@ -2521,6 +2537,7 @@
<exports symbol='XML_SCHEMAP_RECURSIVE' type='enum'/>
<exports symbol='XML_HTTP_URL_SYNTAX' type='enum'/>
<exports symbol='XML_SCHEMAP_GROUP_NONAME_NOREF' type='enum'/>
+ <exports symbol='XML_DTD_DUP_TOKEN' type='enum'/>
<exports symbol='XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4' type='enum'/>
<exports symbol='XML_SCHEMAP_S4S_ELEM_MISSING' type='enum'/>
<exports symbol='XML_SCHEMAV_CVC_ELT_5_1_1' type='enum'/>
@@ -2557,7 +2574,7 @@
<exports symbol='XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1' type='enum'/>
<exports symbol='XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1' type='enum'/>
<exports symbol='XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3' type='enum'/>
- <exports symbol='XML_DTD_NOT_EMPTY' type='enum'/>
+ <exports symbol='XML_IO_LOAD_ERROR' type='enum'/>
<exports symbol='XML_CHECK_NOT_ENTITY_DECL' type='enum'/>
<exports symbol='XML_RNGP_CREATE_FAILURE' type='enum'/>
<exports symbol='XML_IO_EBADF' type='enum'/>
@@ -2666,6 +2683,7 @@
<exports symbol='XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2' type='enum'/>
<exports symbol='XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1' type='enum'/>
<exports symbol='XML_ERR_OK' type='enum'/>
+ <exports symbol='XML_NS_ERR_COLON' type='enum'/>
<exports symbol='XML_WAR_ENTITY_REDEFINED' type='enum'/>
<exports symbol='XML_ERR_ATTRIBUTE_REDEFINED' type='enum'/>
<exports symbol='XML_SCHEMAP_SIMPLETYPE_NONAME' type='enum'/>
@@ -2742,6 +2760,7 @@
<exports symbol='xmlInitMemory' type='function'/>
<exports symbol='xmlMemFree' type='function'/>
<exports symbol='xmlMemMalloc' type='function'/>
+ <exports symbol='xmlMemDisplayLast' type='function'/>
<exports symbol='xmlMemGet' type='function'/>
<exports symbol='xmlMemoryDump' type='function'/>
<exports symbol='xmlMallocLoc' type='function'/>
@@ -3046,6 +3065,7 @@
<exports symbol='xmlSchemaValidityWarningFunc' type='function'/>
<exports symbol='xmlSchemaDump' type='function'/>
<exports symbol='xmlSchemaFreeValidCtxt' type='function'/>
+ <exports symbol='xmlSchemaValidCtxtGetParserCtxt' type='function'/>
<exports symbol='xmlSchemaSetParserStructuredErrors' type='function'/>
<exports symbol='xmlSchemaNewValidCtxt' type='function'/>
</file>
@@ -4579,9 +4599,10 @@
<enum name='XML_ATTRIBUTE_NONE' file='tree' value='1' type='xmlAttributeDefault'/>
<enum name='XML_ATTRIBUTE_NOTATION' file='tree' value='10' type='xmlAttributeType'/>
<enum name='XML_ATTRIBUTE_REQUIRED' file='tree' value='2' type='xmlAttributeDefault'/>
- <enum name='XML_BUFFER_ALLOC_DOUBLEIT' file='tree' value='1' type='xmlBufferAllocationScheme'/>
- <enum name='XML_BUFFER_ALLOC_EXACT' file='tree' value='2' type='xmlBufferAllocationScheme'/>
- <enum name='XML_BUFFER_ALLOC_IMMUTABLE' file='tree' value='3' type='xmlBufferAllocationScheme'/>
+ <enum name='XML_BUFFER_ALLOC_DOUBLEIT' file='tree' value='1' type='xmlBufferAllocationScheme' info='double each time one need to grow'/>
+ <enum name='XML_BUFFER_ALLOC_EXACT' file='tree' value='2' type='xmlBufferAllocationScheme' info='grow only to the minimal size'/>
+ <enum name='XML_BUFFER_ALLOC_IMMUTABLE' file='tree' value='3' type='xmlBufferAllocationScheme' info='immutable buffer'/>
+ <enum name='XML_BUFFER_ALLOC_IO' file='tree' value='4' type='xmlBufferAllocationScheme' info=' special allocation scheme used for I/O'/>
<enum name='XML_C14N_CREATE_CTXT' file='xmlerror' value='1950' type='xmlParserErrors'/>
<enum name='XML_C14N_CREATE_STACK' file='xmlerror' value='1952' type='xmlParserErrors' info='1952'/>
<enum name='XML_C14N_INVALID_NODE' file='xmlerror' value='1953' type='xmlParserErrors' info='1953'/>
@@ -4670,6 +4691,15 @@
<enum name='XML_DOCUMENT_FRAG_NODE' file='tree' value='11' type='xmlElementType'/>
<enum name='XML_DOCUMENT_NODE' file='tree' value='9' type='xmlElementType'/>
<enum name='XML_DOCUMENT_TYPE_NODE' file='tree' value='10' type='xmlElementType'/>
+ <enum name='XML_DOC_DTDVALID' file='tree' value='8' type='xmlDocProperties' info='DTD validation was successful'/>
+ <enum name='XML_DOC_HTML' file='tree' value='128' type='xmlDocProperties' info=' parsed or built HTML document'/>
+ <enum name='XML_DOC_INTERNAL' file='tree' value='64' type='xmlDocProperties' info='built for internal processing'/>
+ <enum name='XML_DOC_NSVALID' file='tree' value='2' type='xmlDocProperties' info='document is Namespace valid'/>
+ <enum name='XML_DOC_OLD10' file='tree' value='4' type='xmlDocProperties' info='parsed with old XML-1.0 parser'/>
+ <enum name='XML_DOC_USERBUILT' file='tree' value='32' type='xmlDocProperties' info='Document was built using the API
+and not by parsing an instance'/>
+ <enum name='XML_DOC_WELLFORMED' file='tree' value='1' type='xmlDocProperties' info='document is XML well formed'/>
+ <enum name='XML_DOC_XINCLUDE' file='tree' value='16' type='xmlDocProperties' info='XInclude substitution was done'/>
<enum name='XML_DTD_ATTRIBUTE_DEFAULT' file='xmlerror' value='500' type='xmlParserErrors'/>
<enum name='XML_DTD_ATTRIBUTE_REDEFINED' file='xmlerror' value='501' type='xmlParserErrors' info='501'/>
<enum name='XML_DTD_ATTRIBUTE_VALUE' file='xmlerror' value='502' type='xmlParserErrors' info='502'/>
@@ -4677,6 +4707,7 @@
<enum name='XML_DTD_CONTENT_MODEL' file='xmlerror' value='504' type='xmlParserErrors' info='504'/>
<enum name='XML_DTD_CONTENT_NOT_DETERMINIST' file='xmlerror' value='505' type='xmlParserErrors' info='505'/>
<enum name='XML_DTD_DIFFERENT_PREFIX' file='xmlerror' value='506' type='xmlParserErrors' info='506'/>
+ <enum name='XML_DTD_DUP_TOKEN' file='xmlerror' value='541' type='xmlParserErrors' info='541'/>
<enum name='XML_DTD_ELEM_DEFAULT_NAMESPACE' file='xmlerror' value='507' type='xmlParserErrors' info='507'/>
<enum name='XML_DTD_ELEM_NAMESPACE' file='xmlerror' value='508' type='xmlParserErrors' info='508'/>
<enum name='XML_DTD_ELEM_REDEFINED' file='xmlerror' value='509' type='xmlParserErrors' info='509'/>
@@ -4824,11 +4855,13 @@
<enum name='XML_ERR_TAG_NOT_FINISHED' file='xmlerror' value='77' type='xmlParserErrors' info='77'/>
<enum name='XML_ERR_UNDECLARED_ENTITY' file='xmlerror' value='26' type='xmlParserErrors' info='26'/>
<enum name='XML_ERR_UNKNOWN_ENCODING' file='xmlerror' value='31' type='xmlParserErrors' info='31'/>
+ <enum name='XML_ERR_UNKNOWN_VERSION' file='xmlerror' value='108' type='xmlParserErrors' info='108'/>
<enum name='XML_ERR_UNPARSED_ENTITY' file='xmlerror' value='28' type='xmlParserErrors' info='28'/>
<enum name='XML_ERR_UNSUPPORTED_ENCODING' file='xmlerror' value='32' type='xmlParserErrors' info='32'/>
<enum name='XML_ERR_URI_FRAGMENT' file='xmlerror' value='92' type='xmlParserErrors' info='92'/>
<enum name='XML_ERR_URI_REQUIRED' file='xmlerror' value='70' type='xmlParserErrors' info='70'/>
<enum name='XML_ERR_VALUE_REQUIRED' file='xmlerror' value='84' type='xmlParserErrors' info='84'/>
+ <enum name='XML_ERR_VERSION_MISMATCH' file='xmlerror' value='109' type='xmlParserErrors' info='109'/>
<enum name='XML_ERR_VERSION_MISSING' file='xmlerror' value='96' type='xmlParserErrors' info='96'/>
<enum name='XML_ERR_WARNING' file='xmlerror' value='1' type='xmlErrorLevel' info='A simple warning'/>
<enum name='XML_ERR_XMLDECL_NOT_FINISHED' file='xmlerror' value='57' type='xmlParserErrors' info='57'/>
@@ -4953,6 +4986,7 @@
<enum name='XML_NAMESPACE_DECL' file='tree' value='18' type='xmlElementType'/>
<enum name='XML_NOTATION_NODE' file='tree' value='12' type='xmlElementType'/>
<enum name='XML_NS_ERR_ATTRIBUTE_REDEFINED' file='xmlerror' value='203' type='xmlParserErrors' info='203'/>
+ <enum name='XML_NS_ERR_COLON' file='xmlerror' value='205' type='xmlParserErrors' info='205'/>
<enum name='XML_NS_ERR_EMPTY' file='xmlerror' value='204' type='xmlParserErrors' info='204'/>
<enum name='XML_NS_ERR_QNAME' file='xmlerror' value='202' type='xmlParserErrors' info='202'/>
<enum name='XML_NS_ERR_UNDEFINED_NAMESPACE' file='xmlerror' value='201' type='xmlParserErrors' info='201'/>
@@ -4983,13 +5017,15 @@
<enum name='XML_PARSER_SUBST_ENTITIES' file='xmlreader' value='4' type='xmlParserProperties'/>
<enum name='XML_PARSER_SYSTEM_LITERAL' file='parser' value='13' type='xmlParserInputState' info='within a SYSTEM value'/>
<enum name='XML_PARSER_VALIDATE' file='xmlreader' value='3' type='xmlParserProperties'/>
- <enum name='XML_PARSE_COMPACT' file='parser' value='65536' type='xmlParserOption' info=' compact small text nodes; no modification of
+ <enum name='XML_PARSE_COMPACT' file='parser' value='65536' type='xmlParserOption' info='compact small text nodes; no modification of
the tree allowed afterwards (will possibly
crash if you try to modify the tree)'/>
<enum name='XML_PARSE_DOM' file='parser' value='1' type='xmlParserMode'/>
<enum name='XML_PARSE_DTDATTR' file='parser' value='8' type='xmlParserOption' info='default DTD attributes'/>
<enum name='XML_PARSE_DTDLOAD' file='parser' value='4' type='xmlParserOption' info='load the external subset'/>
<enum name='XML_PARSE_DTDVALID' file='parser' value='16' type='xmlParserOption' info='validate with the DTD'/>
+ <enum name='XML_PARSE_HUGE' file='parser' value='524288' type='xmlParserOption' info=' relax any hardcoded limit from the parser'/>
+ <enum name='XML_PARSE_NOBASEFIX' file='parser' value='262144' type='xmlParserOption' info='do not fixup XINCLUDE xml:base uris'/>
<enum name='XML_PARSE_NOBLANKS' file='parser' value='256' type='xmlParserOption' info='remove blank nodes'/>
<enum name='XML_PARSE_NOCDATA' file='parser' value='16384' type='xmlParserOption' info='merge CDATA as text nodes'/>
<enum name='XML_PARSE_NODICT' file='parser' value='4096' type='xmlParserOption' info='Do not reuse the context dictionnary'/>
@@ -4999,6 +5035,7 @@ crash if you try to modify the tree)'/>
<enum name='XML_PARSE_NOWARNING' file='parser' value='64' type='xmlParserOption' info='suppress warning reports'/>
<enum name='XML_PARSE_NOXINCNODE' file='parser' value='32768' type='xmlParserOption' info='do not generate XINCLUDE START/END nodes'/>
<enum name='XML_PARSE_NSCLEAN' file='parser' value='8192' type='xmlParserOption' info='remove redundant namespaces declarations'/>
+ <enum name='XML_PARSE_OLD10' file='parser' value='131072' type='xmlParserOption' info='parse using XML-1.0 before update 5'/>
<enum name='XML_PARSE_PEDANTIC' file='parser' value='128' type='xmlParserOption' info='pedantic error reporting'/>
<enum name='XML_PARSE_PUSH_DOM' file='parser' value='3' type='xmlParserMode'/>
<enum name='XML_PARSE_PUSH_SAX' file='parser' value='4' type='xmlParserMode'/>
@@ -5861,6 +5898,7 @@ if necessary or NULL'/>
<field name='use' type='unsigned int' info=' The buffer size used'/>
<field name='size' type='unsigned int' info=' The buffer size'/>
<field name='alloc' type='xmlBufferAllocationScheme' info=' The realloc method'/>
+ <field name='contentIO' type='xmlChar *' info=' in IO mode we may have a different base'/>
</struct>
<typedef name='xmlBufferAllocationScheme' file='tree' type='enum'/>
<typedef name='xmlBufferPtr' file='tree' type='xmlBuffer *'/>
@@ -5940,7 +5978,12 @@ standalone attribute was specified'/>
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='parseFlags' type='int' info=' set of xmlParserOption used to parse the
+document'/>
+ <field name='properties' type='int' info=' set of xmlDocProperties for this document
+set at the end of parsing'/>
</struct>
+ <typedef name='xmlDocProperties' file='tree' type='enum'/>
<typedef name='xmlDocPtr' file='tree' type='xmlDoc *'/>
<struct name='xmlDtd' file='tree' type='struct _xmlDtd'>
<field name='_private' type='void *' info=' application data'/>
@@ -6016,7 +6059,8 @@ actually an xmlCharEncoding'/>
<field name='nexte' type='struct _xmlEntity *' info=' unused'/>
<field name='URI' type='const xmlChar *' info=' the full URI as computed'/>
<field name='owner' type='int' info=' does the entity own the childrens'/>
- <field name='checked' type='int' info=' was the entity content checked'/>
+ <field name='checked' type='int' info=' was the entity content checked this is also used to count entites
+* references done from that entity'/>
</struct>
<typedef name='xmlEntityPtr' file='tree' type='xmlEntity *'/>
<typedef name='xmlEntityType' file='entities' type='enum'/>
@@ -6255,6 +6299,8 @@ actually an xmlCharEncoding'/>
*'/>
<field name='lastError' type='xmlError' info=''/>
<field name='parseMode' type='xmlParserMode' info=' the parser mode'/>
+ <field name='nbentities' type='unsigned long' info=' number of entities references'/>
+ <field name='sizeentities' type='unsigned long' info=' size of parsed entities'/>
</struct>
<typedef name='xmlParserCtxtPtr' file='tree' type='xmlParserCtxt *'/>
<typedef name='xmlParserErrors' file='xmlerror' type='enum'/>
@@ -7727,7 +7773,7 @@ Could we use @subtypes for this?'/>
</function>
<function name='inputPush' file='parserInternals' module='parser'>
<info>Pushes a new parser input on top of the input stack</info>
- <return type='int' info='0 in case of error, the index in the stack otherwise'/>
+ <return type='int' info='-1 in case of error, the index in the stack otherwise'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
<arg name='value' type='xmlParserInputPtr' info='the parser input'/>
</function>
@@ -7793,7 +7839,7 @@ Could we use @subtypes for this?'/>
</function>
<function name='nodePush' file='parserInternals' module='parser'>
<info>Pushes a new element node on top of the node stack</info>
- <return type='int' info='0 in case of error, the index in the stack otherwise'/>
+ <return type='int' info='-1 in case of error, the index in the stack otherwise'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
<arg name='value' type='xmlNodePtr' info='the element node'/>
</function>
@@ -8552,11 +8598,11 @@ Could we use @subtypes for this?'/>
</function>
<functype name='xmlC14NIsVisibleCallback' file='c14n' module='c14n'>
<cond>defined(LIBXML_C14N_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='user_data' type='void *' info=''/>
- <arg name='node' type='xmlNodePtr' info=''/>
- <arg name='parent' type='xmlNodePtr' info=''/>
+ <info>Signature for a C14N callback on visible nodes</info>
+ <return type='int' info='1 if the node should be included'/>
+ <arg name='user_data' type='void *' info='user data'/>
+ <arg name='node' type='xmlNodePtr' info='the curent node'/>
+ <arg name='parent' type='xmlNodePtr' info='the parent node'/>
</functype>
<function name='xmlCanonicPath' file='uri' module='uri'>
<info>Constructs a canonic path from the specified path.</info>
@@ -9247,9 +9293,9 @@ Could we use @subtypes for this?'/>
<arg name='func' type='xmlDeregisterNodeFunc' info='function pointer to the new DeregisterNodeFunc'/>
</function>
<functype name='xmlDeregisterNodeFunc' file='globals' module='globals'>
- <info></info>
+ <info>Signature for the deregistration callback of a discarded node</info>
<return type='void'/>
- <arg name='node' type='xmlNodePtr' info=''/>
+ <arg name='node' type='xmlNodePtr' info='the current node'/>
</functype>
<function name='xmlDetectCharEncoding' file='encoding' module='encoding'>
<info>Guess the encoding of the entity using the first bytes of the entity content according to the non-normative appendix F of the XML-1.0 recommendation.</info>
@@ -10742,6 +10788,12 @@ Could we use @subtypes for this?'/>
<return type='void'/>
<arg name='fp' type='FILE *' info='a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist'/>
</function>
+ <function name='xmlMemDisplayLast' file='xmlmemory' module='xmlmemory'>
+ <info>the last nbBytes of memory allocated and not freed, useful for dumping the memory left allocated between two places at runtime.</info>
+ <return type='void'/>
+ <arg name='fp' type='FILE *' info='a FILE descriptor used as the output file, if NULL, the result is written to the file .memorylist'/>
+ <arg name='nbBytes' type='long' info='the amount of memory to dump'/>
+ </function>
<function name='xmlMemFree' file='xmlmemory' module='xmlmemory'>
<info>a free() equivalent, with error checking.</info>
<return type='void'/>
@@ -11257,6 +11309,16 @@ Could we use @subtypes for this?'/>
<arg name='name' type='const xmlChar *' info='the subelement name or NULL'/>
<arg name='type' type='xmlElementContentType' info='the type of element content decl'/>
</function>
+ <function name='xmlNewEntity' file='entities' module='entities'>
+ <info>Create a new entity, this differs from xmlAddDocEntity() that if the document is NULL or has no internal subset defined, then an unlinked entity structure will be returned, it is then the responsability of the caller to link it to the document later or free it when not needed anymore.</info>
+ <return type='xmlEntityPtr' info='a pointer to the entity or NULL in case of error'/>
+ <arg name='doc' type='xmlDocPtr' info='the document'/>
+ <arg name='name' type='const xmlChar *' info='the entity name'/>
+ <arg name='type' type='int' info='the entity type XML_xxx_yyy_ENTITY'/>
+ <arg name='ExternalID' type='const xmlChar *' info='the entity external ID if available'/>
+ <arg name='SystemID' type='const xmlChar *' info='the entity system ID if available'/>
+ <arg name='content' type='const xmlChar *' info='the entity content'/>
+ </function>
<function name='xmlNewEntityInputStream' file='parserInternals' module='parserInternals'>
<info>Create a new input stream based on an xmlEntityPtr</info>
<return type='xmlParserInputPtr' info='the new input stream or NULL'/>
@@ -11628,9 +11690,9 @@ Could we use @subtypes for this?'/>
<arg name='func' type='xmlOutputBufferCreateFilenameFunc' info='function pointer to the new OutputBufferCreateFilenameFunc'/>
</function>
<functype name='xmlOutputBufferCreateFilenameFunc' file='globals' module='globals'>
- <info></info>
- <return type='xmlOutputBufferPtr' info=''/>
- <arg name='URI' type='const char *' info=''/>
+ <info>Signature for the function doing the lookup for a suitable output method corresponding to an URI.</info>
+ <return type='xmlOutputBufferPtr' info='the new xmlOutputBufferPtr in case of success or NULL if no method was found.'/>
+ <arg name='URI' type='const char *' info='the URI to write to'/>
<arg name='encoder' type='xmlCharEncodingHandlerPtr' info=''/>
<arg name='compression' type='int' info=''/>
</functype>
@@ -12042,23 +12104,23 @@ Could we use @subtypes for this?'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<function name='xmlParseTextDecl' file='parserInternals' module='parser'>
- <info>parse an XML declaration header for external entities [77] TextDecl ::= &apos;&lt;?xml&apos; VersionInfo? EncodingDecl S? &apos;?&gt;&apos; Question: Seems that EncodingDecl is mandatory ? Is that a typo ?</info>
+ <info>parse an XML declaration header for external entities [77] TextDecl ::= &apos;&lt;?xml&apos; VersionInfo? EncodingDecl S? &apos;?&gt;&apos;</info>
<return type='void'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<function name='xmlParseURI' file='uri' module='uri'>
- <info>Parse an URI URI-reference = [ absoluteURI | relativeURI ] [ &quot;#&quot; fragment ]</info>
+ <info>Parse an URI based on RFC 3986 URI-reference = [ absoluteURI | relativeURI ] [ &quot;#&quot; fragment ]</info>
<return type='xmlURIPtr' info='a newly built xmlURIPtr or NULL in case of error'/>
<arg name='str' type='const char *' info='the URI string to analyze'/>
</function>
<function name='xmlParseURIRaw' file='uri' module='uri'>
- <info>Parse an URI but allows to keep intact the original fragments. URI-reference = [ absoluteURI | relativeURI ] [ &quot;#&quot; fragment ]</info>
+ <info>Parse an URI but allows to keep intact the original fragments. URI-reference = URI / relative-ref</info>
<return type='xmlURIPtr' info='a newly built xmlURIPtr or NULL in case of error'/>
<arg name='str' type='const char *' info='the URI string to analyze'/>
<arg name='raw' type='int' info='if 1 unescaping of URI pieces are disabled'/>
</function>
<function name='xmlParseURIReference' file='uri' module='uri'>
- <info>Parse an URI reference string and fills in the appropriate fields of the @uri structure URI-reference = [ absoluteURI | relativeURI ] [ &quot;#&quot; fragment ]</info>
+ <info>Parse an URI reference string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = URI / relative-ref</info>
<return type='int' info='0 or the error code'/>
<arg name='uri' type='xmlURIPtr' info='pointer to an URI structure'/>
<arg name='str' type='const char *' info='the string to analyze'/>
@@ -12069,7 +12131,7 @@ Could we use @subtypes for this?'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<function name='xmlParseVersionNum' file='parserInternals' module='parser'>
- <info>parse the XML version value. [26] VersionNum ::= ([a-zA-Z0-9_.:] | &apos;-&apos;)+</info>
+ <info>parse the XML version value. [26] VersionNum ::= &apos;1.&apos; [0-9]+ In practice allow [0-9].[0-9]+ at that level</info>
<return type='xmlChar *' info='the string giving the XML version number, or NULL'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
@@ -12143,10 +12205,10 @@ Could we use @subtypes for this?'/>
<arg name='func' type='xmlParserInputBufferCreateFilenameFunc' info='function pointer to the new ParserInputBufferCreateFilenameFunc'/>
</function>
<functype name='xmlParserInputBufferCreateFilenameFunc' file='globals' module='globals'>
- <info></info>
- <return type='xmlParserInputBufferPtr' info=''/>
- <arg name='URI' type='const char *' info=''/>
- <arg name='enc' type='xmlCharEncoding' info=''/>
+ <info>Signature for the function doing the lookup for a suitable input method corresponding to an URI.</info>
+ <return type='xmlParserInputBufferPtr' info='the new xmlParserInputBufferPtr in case of success or NULL if no method was found.'/>
+ <arg name='URI' type='const char *' info='the URI to read from'/>
+ <arg name='enc' type='xmlCharEncoding' info='the requested source encoding'/>
</functype>
<function name='xmlParserInputBufferCreateIO' file='xmlIO' module='xmlIO'>
<info>Create a buffered parser input for the progressive parsing for the input from an I/O handler</info>
@@ -12315,7 +12377,7 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlPushInput' file='parserInternals' module='parser'>
<info>xmlPushInput: switch to a new input stream which is stacked on top of the previous one(s).</info>
- <return type='void'/>
+ <return type='int' info='-1 in case of error or the index in the input stack'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
<arg name='input' type='xmlParserInputPtr' info='an XML parser input fragment (entity, XML fragment ...).'/>
</function>
@@ -12525,12 +12587,12 @@ Could we use @subtypes for this?'/>
</function>
<functype name='xmlRegExecCallbacks' file='xmlregexp' module='xmlregexp'>
<cond>defined(LIBXML_REGEXP_ENABLED)</cond>
- <info></info>
+ <info>Callback function when doing a transition in the automata</info>
<return type='void'/>
- <arg name='exec' type='xmlRegExecCtxtPtr' info=''/>
- <arg name='token' type='const xmlChar *' info=''/>
- <arg name='transdata' type='void *' info=''/>
- <arg name='inputdata' type='void *' info=''/>
+ <arg name='exec' type='xmlRegExecCtxtPtr' info='the regular expression context'/>
+ <arg name='token' type='const xmlChar *' info='the current token string'/>
+ <arg name='transdata' type='void *' info='transition data'/>
+ <arg name='inputdata' type='void *' info='input data'/>
</functype>
<function name='xmlRegExecErrInfo' file='xmlregexp' module='xmlregexp'>
<cond>defined(LIBXML_REGEXP_ENABLED)</cond>
@@ -12649,9 +12711,9 @@ Could we use @subtypes for this?'/>
<arg name='func' type='xmlRegisterNodeFunc' info='function pointer to the new RegisterNodeFunc'/>
</function>
<functype name='xmlRegisterNodeFunc' file='globals' module='globals'>
- <info></info>
+ <info>Signature for the registration callback of a created node</info>
<return type='void'/>
- <arg name='node' type='xmlNodePtr' info=''/>
+ <arg name='node' type='xmlNodePtr' info='the current node'/>
</functype>
<function name='xmlRegisterOutputCallbacks' file='xmlIO' module='xmlIO'>
<cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
@@ -12828,19 +12890,19 @@ Could we use @subtypes for this?'/>
</function>
<functype name='xmlRelaxNGValidityErrorFunc' file='relaxng' module='relaxng'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Signature of an error callback from a Relax-NG validation</info>
<return type='void'/>
- <arg name='ctx' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='...' type='...' info=''/>
+ <arg name='ctx' type='void *' info='the validation context'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='...' type='...' info='extra arguments'/>
</functype>
<functype name='xmlRelaxNGValidityWarningFunc' file='relaxng' module='relaxng'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Signature of a warning callback from a Relax-NG validation</info>
<return type='void'/>
- <arg name='ctx' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='...' type='...' info=''/>
+ <arg name='ctx' type='void *' info='the validation context'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='...' type='...' info='extra arguments'/>
</functype>
<function name='xmlRelaxParserSetFlag' file='relaxng' module='relaxng'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13405,9 +13467,9 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaFreeValidCtxt' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Free the resources associated to the schema validation context</info>
<return type='void'/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='the schema validation context'/>
</function>
<function name='xmlSchemaFreeValue' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13478,12 +13540,12 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaGetValidErrors' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='err' type='xmlSchemaValidityErrorFunc *' info=''/>
- <arg name='warn' type='xmlSchemaValidityWarningFunc *' info=''/>
- <arg name='ctx' type='void **' info=''/>
+ <info>Get the error and warning callback informations</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'/>
+ <arg name='warn' type='xmlSchemaValidityWarningFunc *' info='the warning function result'/>
+ <arg name='ctx' type='void **' info='the functions context result'/>
</function>
<function name='xmlSchemaInitTypes' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13499,9 +13561,9 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaIsValid' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
+ <info>Check if any error was detected during validation.</info>
+ <return type='int' info='1 if valid so far, 0 if errors were detected, and -1 in case of internal error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='the schema validation context'/>
</function>
<function name='xmlSchemaNewDocParserCtxt' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13550,9 +13612,9 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaNewValidCtxt' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='schema' type='xmlSchemaPtr' info=''/>
+ <info>Create an XML Schemas validation context based on the given schema.</info>
+ <return type='xmlSchemaValidCtxtPtr' info='the validation context or NULL in case of error'/>
+ <arg name='schema' type='xmlSchemaPtr' info='a precompiled XML Schemas'/>
</function>
<function name='xmlSchemaParse' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13562,17 +13624,17 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaSAXPlug' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='xmlSchemaSAXPlugPtr' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='sax' type='xmlSAXHandlerPtr *' info=''/>
- <arg name='user_data' type='void **' info=''/>
+ <info>Plug a SAX based validation layer in a SAX parsing event flow. The original @saxptr and @dataptr data are replaced by new pointers but the calls to the original will be maintained.</info>
+ <return type='xmlSchemaSAXPlugPtr' info='a pointer to a data structure needed to unplug the validation layer or NULL in case of errors.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='sax' type='xmlSAXHandlerPtr *' info='a pointer to the original xmlSAXHandlerPtr'/>
+ <arg name='user_data' type='void **' info='a pointer to the original SAX user data pointer'/>
</function>
<function name='xmlSchemaSAXUnplug' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='plug' type='xmlSchemaSAXPlugPtr' info=''/>
+ <info>Unplug a SAX based validation layer in a SAX parsing event flow. The original pointers used in the call are restored.</info>
+ <return type='int' info='0 in case of success and -1 in case of failure.'/>
+ <arg name='plug' type='xmlSchemaSAXPlugPtr' info='a data structure returned by xmlSchemaSAXPlug'/>
</function>
<function name='xmlSchemaSetParserErrors' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13593,27 +13655,27 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaSetValidErrors' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Set the error and warning callback informations</info>
<return type='void'/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='err' type='xmlSchemaValidityErrorFunc' info=''/>
- <arg name='warn' type='xmlSchemaValidityWarningFunc' info=''/>
- <arg name='ctx' type='void *' info=''/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='err' type='xmlSchemaValidityErrorFunc' info='the error function'/>
+ <arg name='warn' type='xmlSchemaValidityWarningFunc' info='the warning function'/>
+ <arg name='ctx' type='void *' info='the functions context'/>
</function>
<function name='xmlSchemaSetValidOptions' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='options' type='int' info=''/>
+ <info>Sets the options to be used during the validation.</info>
+ <return type='int' info='0 in case of success, -1 in case of an API error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='options' type='int' info='a combination of xmlSchemaValidOption'/>
</function>
<function name='xmlSchemaSetValidStructuredErrors' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Set the structured error callback</info>
<return type='void'/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='serror' type='xmlStructuredErrorFunc' info=''/>
- <arg name='ctx' type='void *' info=''/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='serror' type='xmlStructuredErrorFunc' info='the structured error function'/>
+ <arg name='ctx' type='void *' info='the functions context'/>
</function>
<function name='xmlSchemaValPredefTypeNode' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13635,16 +13697,22 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaValidCtxtGetOptions' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
+ <info>Get the validation context options.</info>
+ <return type='int' info='the option combination or -1 on error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ </function>
+ <function name='xmlSchemaValidCtxtGetParserCtxt' file='xmlschemas' module='xmlschemas'>
+ <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+ <info>allow access to the parser context of the schema validation context</info>
+ <return type='xmlParserCtxtPtr' info='the parser context of the schema validation context or NULL in case of error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
</function>
<function name='xmlSchemaValidateDoc' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='instance' type='xmlDocPtr' info=''/>
+ <info>Validate a document tree in memory.</info>
+ <return type='int' info='0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='doc' type='xmlDocPtr' info='a parsed document tree'/>
</function>
<function name='xmlSchemaValidateFacet' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13668,11 +13736,11 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaValidateFile' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='filename' type='const char *' info=''/>
- <arg name='options' type='int' info=''/>
+ <info>Do a schemas validation of the given resource, it will use the SAX streamable validation internally.</info>
+ <return type='int' info='0 if the document is valid, a positive error code number otherwise and -1 in case of an internal or API error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='filename' type='const char *' info='the URI of the instance'/>
+ <arg name='options' type='int' info='a future set of options, currently unused'/>
</function>
<function name='xmlSchemaValidateLengthFacet' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13706,10 +13774,10 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaValidateOneElement' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='elem' type='xmlNodePtr' info=''/>
+ <info>Validate a branch of a tree, starting with the given @elem.</info>
+ <return type='int' info='0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='elem' type='xmlNodePtr' info='an element node'/>
</function>
<function name='xmlSchemaValidatePredefinedType' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13721,29 +13789,29 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaValidateStream' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
- <return type='int' info=''/>
- <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info=''/>
- <arg name='input' type='xmlParserInputBufferPtr' info=''/>
- <arg name='enc' type='xmlCharEncoding' info=''/>
- <arg name='sax' type='xmlSAXHandlerPtr' info=''/>
- <arg name='user_data' type='void *' info=''/>
+ <info>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</info>
+ <return type='int' info='0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error.'/>
+ <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
+ <arg name='input' type='xmlParserInputBufferPtr' info='the input to use for reading the data'/>
+ <arg name='enc' type='xmlCharEncoding' info='an optional encoding information'/>
+ <arg name='sax' type='xmlSAXHandlerPtr' info='a SAX handler for the resulting events'/>
+ <arg name='user_data' type='void *' info='the context to provide to the SAX handler.'/>
</function>
<functype name='xmlSchemaValidityErrorFunc' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Signature of an error callback from an XSD validation</info>
<return type='void'/>
- <arg name='ctx' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='...' type='...' info=''/>
+ <arg name='ctx' type='void *' info='the validation context'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='...' type='...' info='extra arguments'/>
</functype>
<functype name='xmlSchemaValidityWarningFunc' file='xmlschemas' module='xmlschemas'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info></info>
+ <info>Signature of a warning callback from an XSD validation</info>
<return type='void'/>
- <arg name='ctx' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='...' type='...' info=''/>
+ <arg name='ctx' type='void *' info='the validation context'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='...' type='...' info='extra arguments'/>
</functype>
<function name='xmlSchemaValueAppend' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -13843,19 +13911,19 @@ Could we use @subtypes for this?'/>
</function>
<functype name='xmlSchematronValidityErrorFunc' file='schematron' module='schematron'>
<cond>defined(LIBXML_SCHEMATRON_ENABLED)</cond>
- <info></info>
+ <info>Signature of an error callback from a Schematron validation</info>
<return type='void'/>
- <arg name='ctx' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='...' type='...' info=''/>
+ <arg name='ctx' type='void *' info='the validation context'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='...' type='...' info='extra arguments'/>
</functype>
<functype name='xmlSchematronValidityWarningFunc' file='schematron' module='schematron'>
<cond>defined(LIBXML_SCHEMATRON_ENABLED)</cond>
- <info></info>
+ <info>Signature of a warning callback from a Schematron validation</info>
<return type='void'/>
- <arg name='ctx' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='...' type='...' info=''/>
+ <arg name='ctx' type='void *' info='the validation context'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='...' type='...' info='extra arguments'/>
</functype>
<function name='xmlSearchNs' file='tree' module='tree'>
<info>Search a Ns registered under a given name space for a document. recurse on the parents until it finds the defined namespace or return NULL otherwise. @nameSpace can be NULL, this is a search for the default namespace. We don&apos;t allow to cross entities boundaries. If you don&apos;t declare the namespace within those you will be in troubles !!! A warning is generated to cover this case.</info>
@@ -14486,12 +14554,12 @@ Could we use @subtypes for this?'/>
</function>
<functype name='xmlTextReaderErrorFunc' file='xmlreader' module='xmlreader'>
<cond>defined(LIBXML_READER_ENABLED)</cond>
- <info></info>
+ <info>Signature of an error callback from a reader parser</info>
<return type='void'/>
- <arg name='arg' type='void *' info=''/>
- <arg name='msg' type='const char *' info=''/>
- <arg name='severity' type='xmlParserSeverities' info=''/>
- <arg name='locator' type='xmlTextReaderLocatorPtr' info=''/>
+ <arg name='arg' type='void *' info='the user argument'/>
+ <arg name='msg' type='const char *' info='the message'/>
+ <arg name='severity' type='xmlParserSeverities' info='the severity of the error'/>
+ <arg name='locator' type='xmlTextReaderLocatorPtr' info='a locator indicating where the error occured'/>
</functype>
<function name='xmlTextReaderExpand' file='xmlreader' module='xmlreader'>
<cond>defined(LIBXML_READER_ENABLED)</cond>
@@ -16670,10 +16738,10 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlValidateAttributeValue' file='valid' module='valid'>
<cond>defined(LIBXML_VALID_ENABLED)</cond>
- <info>Validate that the given attribute value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</info>
- <return type='int' info='1 if valid or 0 otherwise'/>
- <arg name='type' type='xmlAttributeType' info='an attribute type'/>
- <arg name='value' type='const xmlChar *' info='an attribute value'/>
+ <info></info>
+ <return type='int' info=''/>
+ <arg name='type' type='xmlAttributeType' info=''/>
+ <arg name='value' type='const xmlChar *' info=''/>
</function>
<function name='xmlValidateDocument' file='valid' module='valid'>
<cond>defined(LIBXML_VALID_ENABLED)</cond>
diff --git a/doc/libxml2.xsa b/doc/libxml2.xsa
index 9133b40..f93c298 100644
--- a/doc/libxml2.xsa
+++ b/doc/libxml2.xsa
@@ -8,26 +8,42 @@
</vendor>
<product id="libxml2">
<name>libxml2</name>
- <version>2.6.31</version>
- <last-release> Jan 11 2008</last-release>
+ <version>2.6.32</version>
+ <last-release> Apr 8 2008</last-release>
<info-url>http://xmlsoft.org/</info-url>
- <changes> - Security fix: missing of checks in UTF-8 parsing
- - Bug fixes: regexp bug, dump attribute from XHTML document, fix
- xmlFree(NULL) to not crash in debug mode, Schematron parsing crash
- (Rob Richards), global lock free on Windows (Marc-Antoine Ruel),
- XSD crash due to double free (Rob Richards), indentation fix in
- xmlTextWriterFullEndElement (Felipe Pena), error in attribute type
- parsing if attribute redeclared, avoid crash in hash list scanner if
- deleting elements, column counter bug fix (Christian Schmidt),
- HTML embed element saving fix (Stefan Behnel), avoid -L/usr/lib
- output from xml2-config (Fred Crozat), avoid an xmllint crash
- (Stefan Kost), don't stop HTML parsing on out of range chars.
-
- - 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)
- - Improvements: HTTP Header: includes port number (William Brack),
- testURI --debug option,
+ <changes> - Documentation: returning heap memory to kernel (Wolfram Sang),
+ trying to clarify xmlCleanupParser() use, xmlXPathContext improvement
+ (Jack Jansen), improve the *Recover* functions documentation,
+ XmlNodeType doc link fix (Martijn Arts)
+ - Bug fixes: internal subset memory leak (Ashwin), avoid problem with
+ paths starting with // (Petr Sumbera), streaming XSD validation callback
+ patches (Ashwin), fix redirection on port other than 80 (William Brack),
+ SAX2 leak (Ashwin), XInclude fragment of own document (Chris Ryan),
+ regexp bug with '.' (Andrew Tosh), flush the writer at the end of the
+ document (Alfred Mickautsch), output I/O bug fix (William Brack),
+ writer CDATA output after a text node (Alex Khesin), UTF-16 encoding
+ detection (William Brack), fix handling of empty CDATA nodes for Safari
+ team, python binding problem with namespace nodes, improve HTML parsing
+ (Arnold Hendriks), regexp automata build bug, memory leak fix (Vasily
+ Chekalkin), XSD test crash, weird system parameter entity parsing problem,
+ allow save to file:///X:/ windows paths, various attribute normalisation
+ problems, externalSubsetSplit fix (Ashwin), attribute redefinition in
+ the DTD (Ashwin), fix in char ref parsing check (Alex Khesin), many
+ out of memory handling fixes (Ashwin), XPath out of memory handling fixes
+ (Alvaro Herrera), various realloc problems (Ashwin), UCS4 encoding
+ conversion buffer size (Christian Fruth), problems with EatName
+ functions on memory errors, BOM handling in external parsed entities
+ (Mark Rowe)
+ - Code cleanup: fix build under VS 2008 (David Wimsey), remove useless
+ mutex in xmlDict (Florent Guilian), Mingw32 compilation fix (Carlo
+ Bramini), Win and MacOS EOL cleanups (Florent Guiliani), iconv need
+ a const detection (Roumen Petrov), simplify xmlSetProp (Julien Charbon),
+ cross compilation fixes for Mingw (Roumen Petrov), SCO Openserver build
+ fix (Florent Guiliani), iconv uses const on Win32 (Rob Richards),
+ duplicate code removal (Ashwin), missing malloc test and error reports
+ (Ashwin), VMS makefile fix (Tycho Hilhorst)
+ - improvements: better plug of schematron in the normal error handling
+ (Tobias Minich)
</changes>
</product>
diff --git a/doc/news.html b/doc/news.html
index 4c89278..a4126c0 100644
--- a/doc/news.html
+++ b/doc/news.html
@@ -12,7 +12,31 @@ to help those</p><ul><li>More testing on RelaxNG</li>
<li>Finishing up <a href="http://www.w3.org/TR/xmlschema-1/">XML
Schemas</a></li>
</ul><p>The <a href="ChangeLog.html">change log</a> describes the recents commits
-to the <a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">SVN</a> code base.</p><p>Here is the list of public releases:</p><h3>2.6.32: Apr 8 2008</h3><ul><li>Documentation: returning heap memory to kernel (Wolfram Sang),
+to the <a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">SVN</a> code base.</p><p>Here is the list of public releases:</p><h3>2.7.0: Aug 30 2008</h3><ul><li>Documentation: switch ChangeLog to UTF-8, improve mutithreads and
+ xmlParserCleanup docs</li>
+ <li>Portability fixes: Older Win32 platforms (Rob Richards), MSVC
+ porting fix (Rob Richards), Mac OS X regression tests (Sven Herzberg),
+ non GNUCC builds (Rob Richards), compilation on Haiku (Andreas Färber)
+ </li>
+ <li>Bug fixes: various realloc problems (Ashwin), potential double-free
+ (Ashwin), regexp crash, icrash with invalid whitespace facets (Rob
+ Richards), pattern fix when streaming (William Brack), various XML
+ 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>
+ <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),
+ 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
+ arbitrary parser limits avoidable as a parser option</li>
+</ul><h3>2.6.32: Apr 8 2008</h3><ul><li>Documentation: returning heap memory to kernel (Wolfram Sang),
trying to clarify xmlCleanupParser() use, xmlXPathContext improvement
(Jack Jansen), improve the *Recover* functions documentation,
XmlNodeType doc link fix (Martijn Arts)</li>
diff --git a/doc/news.xsl b/doc/news.xsl
index 2312e0d..50089eb 100644
--- a/doc/news.xsl
+++ b/doc/news.xsl
@@ -2,7 +2,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
version="1.0">
- <xsl:output method="text" encoding="ISO-8859-1"/>
+ <xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:text>
diff --git a/doc/xml.html b/doc/xml.html
index 8e42443..30398d2 100644
--- a/doc/xml.html
+++ b/doc/xml.html
@@ -421,9 +421,11 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
and libxml2, but you need to install a more recent version:
libxml(-devel) &gt;= 1.8.8 or libxml2(-devel) &gt;= 2.1.0</p>
</li>
- <li><em>XPath implementation looks seriously broken</em>
- <p>XPath implementation prior to 2.3.0 was really incomplete. Upgrade to
- a recent version, there are no known bugs in the current version.</p>
+ <li><em>Random crashes in threaded applications</em>
+ <p>Read and follow all advices on the <a href="threads.html">thread
+ safety</a> page, and make 100% sure you never call xmlCleanupParser()
+ while the library or an XML document might still be in use by another
+ thread.</p>
</li>
<li><em>The example provided in the web page does not compile.</em>
<p>It's hard to maintain the documentation in sync with the code
@@ -440,16 +442,8 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
generated doc</a></li>
<li>have a look at <a href="examples/index.html">the set of
examples</a>.</li>
- <li>look for examples of use for libxml2 function using the Gnome code.
-<!--
- For example the following will query the full Gnome CVS base for the
- use of the <strong>xmlAddChild()</strong> function:
- <p><a
- href="http://cvs.gnome.org/lxr/search?string=xmlAddChild">http://cvs.gnome.org/lxr/search?string=xmlAddChild</a></p>
- <p>This may be slow, a large hardware donation to the gnome project
- could cure this :-)</p>
--->
- </li>
+ <li>look for examples of use for libxml2 function using the Gnome code
+ or by asking on Google.</li>
<li><a
href="http://svn.gnome.org/viewcvs/libxml2/trunk/">Browse
the libxml2 source</a> , I try to write code as clean and documented
@@ -471,12 +465,6 @@ pnode=pxmlDoc-&gt;children-&gt;children;</pre>
<p>Download: <a
href="http://sourceforge.net/project/showfiles.php?group_id=12999">http://sourceforge.net/project/showfiles.php?group_id=12999</a></p>
</li>
- <!-- Website is currently unavailable as of 2003-08-02
- <li>by Peter Jones &lt;pjones@pmade.org&gt;
- <p>Website: <a
- href="http://pmade.org/pjones/software/xmlwrapp/">http://pmade.org/pjones/software/xmlwrapp/</a></p>
- </li>
- -->
</ul>
</li>
<li><em>How to validate a document a posteriori ?</em>
@@ -739,6 +727,33 @@ to the <a href="http://svn.gnome.org/viewcvs/libxml2/trunk/">SVN</a> code base.<
<p>Here is the list of public releases:</p>
+<h3>2.7.0: Aug 30 2008</h3>
+<ul>
+ <li>Documentation: switch ChangeLog to UTF-8, improve mutithreads and
+ xmlParserCleanup docs</li>
+ <li>Portability fixes: Older Win32 platforms (Rob Richards), MSVC
+ porting fix (Rob Richards), Mac OS X regression tests (Sven Herzberg),
+ non GNUCC builds (Rob Richards), compilation on Haiku (Andreas Färber)
+ </li>
+ <li>Bug fixes: various realloc problems (Ashwin), potential double-free
+ (Ashwin), regexp crash, icrash with invalid whitespace facets (Rob
+ Richards), pattern fix when streaming (William Brack), various XML
+ 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>
+ <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),
+ 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
+ arbitrary parser limits avoidable as a parser option</li>
+</ul>
<h3>2.6.32: Apr 8 2008</h3>
<ul>
<li>Documentation: returning heap memory to kernel (Wolfram Sang),
diff --git a/elfgcchack.h b/elfgcchack.h
index e1d21bb..a747fca 100644
--- a/elfgcchack.h
+++ b/elfgcchack.h
@@ -9843,6 +9843,18 @@ extern __typeof (xmlSchemaValidCtxtGetOptions) xmlSchemaValidCtxtGetOptions__int
#if defined(LIBXML_SCHEMAS_ENABLED)
#ifdef bottom_xmlschemas
+#undef xmlSchemaValidCtxtGetParserCtxt
+extern __typeof (xmlSchemaValidCtxtGetParserCtxt) xmlSchemaValidCtxtGetParserCtxt __attribute((alias("xmlSchemaValidCtxtGetParserCtxt__internal_alias")));
+#else
+#ifndef xmlSchemaValidCtxtGetParserCtxt
+extern __typeof (xmlSchemaValidCtxtGetParserCtxt) xmlSchemaValidCtxtGetParserCtxt__internal_alias __attribute((visibility("hidden")));
+#define xmlSchemaValidCtxtGetParserCtxt xmlSchemaValidCtxtGetParserCtxt__internal_alias
+#endif
+#endif
+#endif
+
+#if defined(LIBXML_SCHEMAS_ENABLED)
+#ifdef bottom_xmlschemas
#undef xmlSchemaValidateDoc
extern __typeof (xmlSchemaValidateDoc) xmlSchemaValidateDoc __attribute((alias("xmlSchemaValidateDoc__internal_alias")));
#else
diff --git a/encoding.c b/encoding.c
index 6c49fff..e2df797 100644
--- a/encoding.c
+++ b/encoding.c
@@ -1999,9 +1999,11 @@ retry:
if (handler->output != NULL) {
ret = handler->output(&out->content[out->use], &written,
in->content, &toconv);
- xmlBufferShrink(in, toconv);
- out->use += written;
- writtentot += written;
+ if (written > 0) {
+ xmlBufferShrink(in, toconv);
+ out->use += written;
+ writtentot += written;
+ }
out->content[out->use] = 0;
}
#ifdef LIBXML_ICONV_ENABLED
diff --git a/entities.c b/entities.c
index 91a3978..c171e97 100644
--- a/entities.c
+++ b/entities.c
@@ -139,45 +139,19 @@ xmlFreeEntity(xmlEntityPtr entity)
}
/*
- * xmlAddEntity : register a new entity for an entities table.
+ * xmlCreateEntity:
+ *
+ * internal routine doing the entity node strutures allocations
*/
static xmlEntityPtr
-xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
- const xmlChar *ExternalID, const xmlChar *SystemID,
- const xmlChar *content) {
- xmlDictPtr dict = NULL;
- xmlEntitiesTablePtr table = NULL;
+xmlCreateEntity(xmlDictPtr dict, const xmlChar *name, int type,
+ const xmlChar *ExternalID, const xmlChar *SystemID,
+ const xmlChar *content) {
xmlEntityPtr ret;
- if (name == NULL)
- return(NULL);
- if (dtd == NULL)
- return(NULL);
- if (dtd->doc != NULL)
- dict = dtd->doc->dict;
-
- switch (type) {
- case XML_INTERNAL_GENERAL_ENTITY:
- case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
- case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
- if (dtd->entities == NULL)
- dtd->entities = xmlHashCreateDict(0, dict);
- table = dtd->entities;
- break;
- case XML_INTERNAL_PARAMETER_ENTITY:
- case XML_EXTERNAL_PARAMETER_ENTITY:
- if (dtd->pentities == NULL)
- dtd->pentities = xmlHashCreateDict(0, dict);
- table = dtd->pentities;
- break;
- case XML_INTERNAL_PREDEFINED_ENTITY:
- return(NULL);
- }
- if (table == NULL)
- return(NULL);
ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
if (ret == NULL) {
- xmlEntitiesErrMemory("xmlAddEntity:: malloc failed");
+ xmlEntitiesErrMemory("xmlCreateEntity: malloc failed");
return(NULL);
}
memset(ret, 0, sizeof(xmlEntity));
@@ -216,6 +190,50 @@ xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
the defining entity */
ret->orig = NULL;
ret->owner = 0;
+
+ return(ret);
+}
+
+/*
+ * xmlAddEntity : register a new entity for an entities table.
+ */
+static xmlEntityPtr
+xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
+ const xmlChar *ExternalID, const xmlChar *SystemID,
+ const xmlChar *content) {
+ xmlDictPtr dict = NULL;
+ xmlEntitiesTablePtr table = NULL;
+ xmlEntityPtr ret;
+
+ if (name == NULL)
+ return(NULL);
+ if (dtd == NULL)
+ return(NULL);
+ if (dtd->doc != NULL)
+ dict = dtd->doc->dict;
+
+ switch (type) {
+ case XML_INTERNAL_GENERAL_ENTITY:
+ case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
+ case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
+ if (dtd->entities == NULL)
+ dtd->entities = xmlHashCreateDict(0, dict);
+ table = dtd->entities;
+ break;
+ case XML_INTERNAL_PARAMETER_ENTITY:
+ case XML_EXTERNAL_PARAMETER_ENTITY:
+ if (dtd->pentities == NULL)
+ dtd->pentities = xmlHashCreateDict(0, dict);
+ table = dtd->pentities;
+ break;
+ case XML_INTERNAL_PREDEFINED_ENTITY:
+ return(NULL);
+ }
+ if (table == NULL)
+ return(NULL);
+ ret = xmlCreateEntity(dict, name, type, ExternalID, SystemID, content);
+ if (ret == NULL)
+ return(NULL);
ret->doc = dtd->doc;
if (xmlHashAddEntry(table, name, ret)) {
@@ -363,6 +381,44 @@ xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type,
}
/**
+ * xmlNewEntity:
+ * @doc: the document
+ * @name: the entity name
+ * @type: the entity type XML_xxx_yyy_ENTITY
+ * @ExternalID: the entity external ID if available
+ * @SystemID: the entity system ID if available
+ * @content: the entity content
+ *
+ * Create a new entity, this differs from xmlAddDocEntity() that if
+ * the document is NULL or has no internal subset defined, then an
+ * unlinked entity structure will be returned, it is then the responsability
+ * of the caller to link it to the document later or free it when not needed
+ * anymore.
+ *
+ * Returns a pointer to the entity or NULL in case of error
+ */
+xmlEntityPtr
+xmlNewEntity(xmlDocPtr doc, const xmlChar *name, int type,
+ const xmlChar *ExternalID, const xmlChar *SystemID,
+ const xmlChar *content) {
+ xmlEntityPtr ret;
+ xmlDictPtr dict;
+
+ if ((doc != NULL) && (doc->intSubset != NULL)) {
+ return(xmlAddDocEntity(doc, name, type, ExternalID, SystemID, content));
+ }
+ if (doc != NULL)
+ dict = doc->dict;
+ else
+ dict = NULL;
+ ret = xmlCreateEntity(dict, name, type, ExternalID, SystemID, content);
+ if (ret == NULL)
+ return(NULL);
+ ret->doc = doc;
+ return(ret);
+}
+
+/**
* xmlGetEntityFromTable:
* @table: an entity table
* @name: the entity name
diff --git a/example/Makefile.in b/example/Makefile.in
index 2ecca3f..cc610a1 100644
--- a/example/Makefile.in
+++ b/example/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -51,7 +51,7 @@ am__DEPENDENCIES_2 = $(top_builddir)/libxml2.la $(am__DEPENDENCIES_1)
gjobread_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(gjobread_LDFLAGS) \
$(LDFLAGS) -o $@
-DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -374,8 +374,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -387,8 +387,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -398,13 +398,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/gentest.py b/gentest.py
index 4538eb8..17c9f59 100755
--- a/gentest.py
+++ b/gentest.py
@@ -174,7 +174,8 @@ skipped_memcheck = [ "xmlLoadCatalog", "xmlAddEncodingAlias",
"xmlInitCharEncodingHandlers", "xmlCatalogCleanup",
"xmlSchemaGetBuiltInType",
"htmlParseFile", "htmlCtxtReadFile", # loads the catalogs
- "xmlTextReaderSchemaValidate", "xmlSchemaCleanupTypes" # initialize the schemas type system
+ "xmlTextReaderSchemaValidate", "xmlSchemaCleanupTypes", # initialize the schemas type system
+ "xmlCatalogResolve", "xmlIOParseDTD" # loads the catalogs
]
#
@@ -207,6 +208,8 @@ extra_pre_call = {
extra_post_call = {
"xmlAddChild":
"if (ret_val == NULL) { xmlFreeNode(cur) ; cur = NULL ; }",
+ "xmlAddEntity":
+ "if (ret_val != NULL) { xmlFreeNode(ret_val) ; ret_val = NULL; }",
"xmlAddChildList":
"if (ret_val == NULL) { xmlFreeNodeList(cur) ; cur = NULL ; }",
"xmlAddSibling":
diff --git a/include/Makefile.in b/include/Makefile.in
index f2292f4..00844d1 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -387,8 +387,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -413,8 +413,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -424,13 +424,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/include/libxml/Makefile.in b/include/libxml/Makefile.in
index 1d495a9..f6650ef 100644
--- a/include/libxml/Makefile.in
+++ b/include/libxml/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -386,8 +386,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -399,8 +399,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -410,13 +410,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/include/libxml/c14n.h b/include/libxml/c14n.h
index 9f4c6c0..a8aa737 100644
--- a/include/libxml/c14n.h
+++ b/include/libxml/c14n.h
@@ -2,30 +2,30 @@
* Summary: Provide Canonical XML and Exclusive XML Canonicalization
* Description: the c14n modules provides a
*
- * "Canonical XML" implementation
+ * "Canonical XML" implementation
* http://www.w3.org/TR/xml-c14n
- *
+ *
* and an
*
* "Exclusive XML Canonicalization" implementation
* http://www.w3.org/TR/xml-exc-c14n
-
+
* Copy: See Copyright for the status of this software.
- *
+ *
* Author: Aleksey Sanin <aleksey@aleksey.com>
*/
#ifndef __XML_C14N_H__
-#define __XML_C14N_H__
+#define __XML_C14N_H__
#ifdef LIBXML_C14N_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef __cplusplus
extern "C" {
-#endif /* __cplusplus */
+#endif /* __cplusplus */
#include <libxml/xmlversion.h>
#include <libxml/tree.h>
-#include <libxml/xpath.h>
+#include <libxml/xpath.h>
/*
* XML Canonicazation
@@ -37,28 +37,28 @@ extern "C" {
* Canonical form of an XML document could be created if and only if
* a) default attributes (if any) are added to all nodes
* b) all character and parsed entity references are resolved
- * In order to achive this in libxml2 the document MUST be loaded with
+ * In order to achive this in libxml2 the document MUST be loaded with
* following global setings:
- *
+ *
* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
* xmlSubstituteEntitiesDefault(1);
*
* or corresponding parser context setting:
* xmlParserCtxtPtr ctxt;
- *
- * ...
+ *
+ * ...
* ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
* ctxt->replaceEntities = 1;
* ...
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlC14NDocSaveTo (xmlDocPtr doc,
xmlNodeSetPtr nodes,
int exclusive,
xmlChar **inclusive_ns_prefixes,
- int with_comments,
+ int with_comments,
xmlOutputBufferPtr buf);
XMLPUBFUN int XMLCALL
@@ -66,7 +66,7 @@ XMLPUBFUN int XMLCALL
xmlNodeSetPtr nodes,
int exclusive,
xmlChar **inclusive_ns_prefixes,
- int with_comments,
+ int with_comments,
xmlChar **doc_txt_ptr);
XMLPUBFUN int XMLCALL
@@ -74,7 +74,7 @@ XMLPUBFUN int XMLCALL
xmlNodeSetPtr nodes,
int exclusive,
xmlChar **inclusive_ns_prefixes,
- int with_comments,
+ int with_comments,
const char* filename,
int compression);
@@ -82,17 +82,27 @@ XMLPUBFUN int XMLCALL
/**
* This is the core C14N function
*/
-typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
+/**
+ * xmlC14NIsVisibleCallback:
+ * @user_data: user data
+ * @node: the curent node
+ * @parent: the parent node
+ *
+ * Signature for a C14N callback on visible nodes
+ *
+ * Returns 1 if the node should be included
+ */
+typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
xmlNodePtr node,
xmlNodePtr parent);
XMLPUBFUN int XMLCALL
xmlC14NExecute (xmlDocPtr doc,
xmlC14NIsVisibleCallback is_visible_callback,
- void* user_data,
+ void* user_data,
int exclusive,
xmlChar **inclusive_ns_prefixes,
- int with_comments,
+ int with_comments,
xmlOutputBufferPtr buf);
#ifdef __cplusplus
diff --git a/include/libxml/entities.h b/include/libxml/entities.h
index fdd7222..cefb97f 100644
--- a/include/libxml/entities.h
+++ b/include/libxml/entities.h
@@ -57,6 +57,8 @@ struct _xmlEntity {
const xmlChar *URI; /* the full URI as computed */
int owner; /* does the entity own the childrens */
int checked; /* was the entity content checked */
+ /* this is also used to count entites
+ * references done from that entity */
};
/*
@@ -72,9 +74,17 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr;
*/
#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlInitializePredefinedEntities (void);
#endif /* LIBXML_LEGACY_ENABLED */
+
+XMLPUBFUN xmlEntityPtr XMLCALL
+ xmlNewEntity (xmlDocPtr doc,
+ const xmlChar *name,
+ int type,
+ const xmlChar *ExternalID,
+ const xmlChar *SystemID,
+ const xmlChar *content);
XMLPUBFUN xmlEntityPtr XMLCALL
xmlAddDocEntity (xmlDocPtr doc,
const xmlChar *name,
@@ -82,53 +92,53 @@ XMLPUBFUN xmlEntityPtr XMLCALL
const xmlChar *ExternalID,
const xmlChar *SystemID,
const xmlChar *content);
-XMLPUBFUN xmlEntityPtr XMLCALL
+XMLPUBFUN xmlEntityPtr XMLCALL
xmlAddDtdEntity (xmlDocPtr doc,
const xmlChar *name,
int type,
const xmlChar *ExternalID,
const xmlChar *SystemID,
const xmlChar *content);
-XMLPUBFUN xmlEntityPtr XMLCALL
+XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetPredefinedEntity (const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
+XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetDocEntity (xmlDocPtr doc,
const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
+XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetDtdEntity (xmlDocPtr doc,
const xmlChar *name);
-XMLPUBFUN xmlEntityPtr XMLCALL
+XMLPUBFUN xmlEntityPtr XMLCALL
xmlGetParameterEntity (xmlDocPtr doc,
const xmlChar *name);
#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlEncodeEntities (xmlDocPtr doc,
const xmlChar *input);
#endif /* LIBXML_LEGACY_ENABLED */
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlEncodeEntitiesReentrant(xmlDocPtr doc,
const xmlChar *input);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlEncodeSpecialChars (xmlDocPtr doc,
const xmlChar *input);
-XMLPUBFUN xmlEntitiesTablePtr XMLCALL
+XMLPUBFUN xmlEntitiesTablePtr XMLCALL
xmlCreateEntitiesTable (void);
#ifdef LIBXML_TREE_ENABLED
-XMLPUBFUN xmlEntitiesTablePtr XMLCALL
+XMLPUBFUN xmlEntitiesTablePtr XMLCALL
xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
#endif /* LIBXML_TREE_ENABLED */
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlDumpEntitiesTable (xmlBufferPtr buf,
xmlEntitiesTablePtr table);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlDumpEntityDecl (xmlBufferPtr buf,
xmlEntityPtr ent);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlCleanupPredefinedEntities(void);
#endif /* LIBXML_LEGACY_ENABLED */
diff --git a/include/libxml/globals.h b/include/libxml/globals.h
index 1173a8f..57e25fa 100644
--- a/include/libxml/globals.h
+++ b/include/libxml/globals.h
@@ -28,8 +28,32 @@ extern "C" {
XMLPUBFUN void XMLCALL xmlInitGlobals(void);
XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
+/**
+ * xmlParserInputBufferCreateFilenameFunc:
+ * @URI: the URI to read from
+ * @enc: the requested source encoding
+ *
+ * Signature for the function doing the lookup for a suitable input method
+ * corresponding to an URI.
+ *
+ * Returns the new xmlParserInputBufferPtr in case of success or NULL if no
+ * method was found.
+ */
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
+
+/**
+ * xmlOutputBufferCreateFilenameFunc:
+ * @URI: the URI to write to
+ * @enc: the requested target encoding
+ *
+ * Signature for the function doing the lookup for a suitable output method
+ * corresponding to an URI.
+ *
+ * Returns the new xmlOutputBufferPtr in case of success or NULL if no
+ * method was found.
+ */
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
+
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
XMLPUBFUN xmlOutputBufferCreateFilenameFunc
@@ -73,12 +97,24 @@ XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc
#undef xmlParserInputBufferCreateFilenameValue
#undef xmlOutputBufferCreateFilenameValue
+/**
+ * xmlRegisterNodeFunc:
+ * @node: the current node
+ *
+ * Signature for the registration callback of a created node
+ */
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
+/**
+ * xmlDeregisterNodeFunc:
+ * @node: the current node
+ *
+ * Signature for the deregistration callback of a discarded node
+ */
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
typedef struct _xmlGlobalState xmlGlobalState;
typedef xmlGlobalState *xmlGlobalStatePtr;
-struct _xmlGlobalState
+struct _xmlGlobalState
{
const char *xmlParserVersion;
@@ -114,8 +150,8 @@ struct _xmlGlobalState
int xmlIndentTreeOutput;
const char *xmlTreeIndentString;
- xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
- xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
+ xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
+ xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
xmlMallocFunc xmlMallocAtomic;
xmlError xmlLastError;
@@ -143,9 +179,9 @@ XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNo
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
-XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
+XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
-XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
+XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
/** DOC_DISABLE */
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index fe63bda..24d5cf9 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -297,6 +297,8 @@ struct _xmlParserCtxt {
*/
xmlError lastError;
xmlParserMode parseMode; /* the parser mode */
+ unsigned long nbentities; /* number of entities references */
+ unsigned long sizeentities; /* size of parsed entities */
};
/**
@@ -1089,9 +1091,12 @@ typedef enum {
XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */
XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */
XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
- XML_PARSE_COMPACT = 1<<16 /* compact small text nodes; no modification of
+ XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of
the tree allowed afterwards (will possibly
crash if you try to modify the tree) */
+ XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */
+ XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */
+ XML_PARSE_HUGE = 1<<19 /* relax any hardcoded limit from the parser */
} xmlParserOption;
XMLPUBFUN void XMLCALL
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index 7ac0ce6..fddcd27 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -321,7 +321,7 @@ XMLPUBFUN xmlParserInputPtr XMLCALL
XMLPUBFUN xmlParserInputPtr XMLCALL
xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
xmlEntityPtr entity);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN int XMLCALL
xmlPushInput (xmlParserCtxtPtr ctxt,
xmlParserInputPtr input);
XMLPUBFUN xmlChar XMLCALL
diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h
index 6acd467..29c91c7 100644
--- a/include/libxml/relaxng.h
+++ b/include/libxml/relaxng.h
@@ -25,11 +25,28 @@ typedef xmlRelaxNG *xmlRelaxNGPtr;
/**
- * A schemas validation context
+ * xmlRelaxNGValidityErrorFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of an error callback from a Relax-NG validation
*/
typedef void (XMLCDECL *xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...);
+
+/**
+ * xmlRelaxNGValidityWarningFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of a warning callback from a Relax-NG validation
+ */
typedef void (XMLCDECL *xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...);
+/**
+ * A schemas validation context
+ */
typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
diff --git a/include/libxml/schematron.h b/include/libxml/schematron.h
index 9e36c0e..f442826 100644
--- a/include/libxml/schematron.h
+++ b/include/libxml/schematron.h
@@ -38,11 +38,28 @@ typedef struct _xmlSchematron xmlSchematron;
typedef xmlSchematron *xmlSchematronPtr;
/**
- * A schemas validation context
+ * xmlSchematronValidityErrorFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of an error callback from a Schematron validation
*/
typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
+
+/**
+ * xmlSchematronValidityWarningFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of a warning callback from a Schematron validation
+ */
typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
+/**
+ * A schemas validation context
+ */
typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 0e1d47c..6a6a09d 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -71,9 +71,10 @@ typedef xmlEntity *xmlEntityPtr;
*/
typedef enum {
- XML_BUFFER_ALLOC_DOUBLEIT,
- XML_BUFFER_ALLOC_EXACT,
- XML_BUFFER_ALLOC_IMMUTABLE
+ XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */
+ XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */
+ XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer */
+ XML_BUFFER_ALLOC_IO /* special allocation scheme used for I/O */
} xmlBufferAllocationScheme;
/**
@@ -88,6 +89,7 @@ struct _xmlBuffer {
unsigned int use; /* The buffer size used */
unsigned int size; /* The buffer size */
xmlBufferAllocationScheme alloc; /* The realloc method */
+ xmlChar *contentIO; /* in IO mode we may have a different base */
};
/**
@@ -482,6 +484,23 @@ struct _xmlNode {
#define XML_GET_LINE(n) \
(xmlGetLineNo(n))
+/**
+ * xmlDocProperty
+ *
+ * Set of properties of the document as found by the parser
+ * Some of them are linked to similary named xmlParserOption
+ */
+typedef enum {
+ XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */
+ XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */
+ XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */
+ XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */
+ XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */
+ XML_DOC_USERBUILT = 1<<5, /* Document was built using the API
+ and not by parsing an instance */
+ XML_DOC_INTERNAL = 1<<6, /* built for internal processing */
+ XML_DOC_HTML = 1<<7 /* parsed or built HTML document */
+} xmlDocProperties;
/**
* xmlDoc:
@@ -521,6 +540,10 @@ struct _xmlDoc {
actually an xmlCharEncoding */
struct _xmlDict *dict; /* dict used to allocate names or NULL */
void *psvi; /* for type/PSVI informations */
+ int parseFlags; /* set of xmlParserOption used to parse the
+ document */
+ int properties; /* set of xmlDocProperties for this document
+ set at the end of parsing */
};
diff --git a/include/libxml/uri.h b/include/libxml/uri.h
index 49ed105..db48262 100644
--- a/include/libxml/uri.h
+++ b/include/libxml/uri.h
@@ -49,43 +49,43 @@ struct _xmlURI {
* xmlChar * xmlNodeGetBase (xmlDocPtr doc,
* xmlNodePtr cur);
*/
-XMLPUBFUN xmlURIPtr XMLCALL
+XMLPUBFUN xmlURIPtr XMLCALL
xmlCreateURI (void);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlBuildURI (const xmlChar *URI,
- const xmlChar *base);
-XMLPUBFUN xmlChar * XMLCALL
+ const xmlChar *base);
+XMLPUBFUN xmlChar * XMLCALL
xmlBuildRelativeURI (const xmlChar *URI,
- const xmlChar *base);
-XMLPUBFUN xmlURIPtr XMLCALL
+ const xmlChar *base);
+XMLPUBFUN xmlURIPtr XMLCALL
xmlParseURI (const char *str);
-XMLPUBFUN xmlURIPtr XMLCALL
+XMLPUBFUN xmlURIPtr XMLCALL
xmlParseURIRaw (const char *str,
int raw);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlParseURIReference (xmlURIPtr uri,
const char *str);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlSaveUri (xmlURIPtr uri);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlPrintURI (FILE *stream,
xmlURIPtr uri);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlURIEscapeStr (const xmlChar *str,
- const xmlChar *list);
-XMLPUBFUN char * XMLCALL
+ const xmlChar *list);
+XMLPUBFUN char * XMLCALL
xmlURIUnescapeString (const char *str,
int len,
char *target);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlNormalizeURIPath (char *path);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlURIEscape (const xmlChar *str);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlFreeURI (xmlURIPtr uri);
-XMLPUBFUN xmlChar* XMLCALL
+XMLPUBFUN xmlChar* XMLCALL
xmlCanonicPath (const xmlChar *path);
-XMLPUBFUN xmlChar* XMLCALL
+XMLPUBFUN xmlChar* XMLCALL
xmlPathToURI (const xmlChar *path);
#ifdef __cplusplus
diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
index 8cbab5e..c9336b9 100644
--- a/include/libxml/xmlerror.h
+++ b/include/libxml/xmlerror.h
@@ -203,11 +203,14 @@ typedef enum {
XML_ERR_NOTATION_PROCESSING, /* 105 */
XML_WAR_NS_COLUMN, /* 106 */
XML_WAR_ENTITY_REDEFINED, /* 107 */
+ XML_ERR_UNKNOWN_VERSION, /* 108 */
+ XML_ERR_VERSION_MISMATCH, /* 109 */
XML_NS_ERR_XML_NAMESPACE = 200,
XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
XML_NS_ERR_QNAME, /* 202 */
XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */
XML_NS_ERR_EMPTY, /* 204 */
+ XML_NS_ERR_COLON, /* 205 */
XML_DTD_ATTRIBUTE_DEFAULT = 500,
XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */
XML_DTD_ATTRIBUTE_VALUE, /* 502 */
@@ -249,6 +252,7 @@ typedef enum {
XML_DTD_STANDALONE_DEFAULTED, /* 538 */
XML_DTD_XMLID_VALUE, /* 539 */
XML_DTD_XMLID_TYPE, /* 540 */
+ XML_DTD_DUP_TOKEN, /* 541 */
XML_HTML_STRUCURE_ERROR = 800,
XML_HTML_UNKNOWN_TAG, /* 801 */
XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000,
diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h
index 235721c..ee8328a 100644
--- a/include/libxml/xmlmemory.h
+++ b/include/libxml/xmlmemory.h
@@ -20,7 +20,7 @@
*
* DEBUG_MEMORY replaces the allocator with a collect and debug
* shell to the libc allocator.
- * DEBUG_MEMORY should only be activated when debugging
+ * DEBUG_MEMORY should only be activated when debugging
* libxml i.e. if libxml has been configured with --with-debug-mem too.
*/
/* #define DEBUG_MEMORY_FREED */
@@ -35,7 +35,7 @@
/**
* DEBUG_MEMORY_LOCATION:
*
- * DEBUG_MEMORY_LOCATION should be activated only when debugging
+ * DEBUG_MEMORY_LOCATION should be activated only when debugging
* libxml i.e. if libxml has been configured with --with-debug-mem too.
*/
#ifdef DEBUG_MEMORY_LOCATION
@@ -105,18 +105,18 @@ XMLPUBFUN int XMLCALL
xmlMallocFunc mallocFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlMemGet (xmlFreeFunc *freeFunc,
xmlMallocFunc *mallocFunc,
xmlReallocFunc *reallocFunc,
xmlStrdupFunc *strdupFunc);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlGcMemSetup (xmlFreeFunc freeFunc,
xmlMallocFunc mallocFunc,
xmlMallocFunc mallocAtomicFunc,
xmlReallocFunc reallocFunc,
xmlStrdupFunc strdupFunc);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlGcMemGet (xmlFreeFunc *freeFunc,
xmlMallocFunc *mallocFunc,
xmlMallocFunc *mallocAtomicFunc,
@@ -126,42 +126,44 @@ XMLPUBFUN int XMLCALL
/*
* Initialization of the memory layer.
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlInitMemory (void);
-/*
+/*
* Cleanup of the memory layer.
*/
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlCleanupMemory (void);
/*
* These are specific to the XML debug memory wrapper.
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlMemUsed (void);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlMemBlocks (void);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlMemDisplay (FILE *fp);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
+ xmlMemDisplayLast(FILE *fp, long nbBytes);
+XMLPUBFUN void XMLCALL
xmlMemShow (FILE *fp, int nr);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlMemoryDump (void);
-XMLPUBFUN void * XMLCALL
+XMLPUBFUN void * XMLCALL
xmlMemMalloc (size_t size);
-XMLPUBFUN void * XMLCALL
+XMLPUBFUN void * XMLCALL
xmlMemRealloc (void *ptr,size_t size);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlMemFree (void *ptr);
-XMLPUBFUN char * XMLCALL
+XMLPUBFUN char * XMLCALL
xmlMemoryStrdup (const char *str);
-XMLPUBFUN void * XMLCALL
+XMLPUBFUN void * XMLCALL
xmlMallocLoc (size_t size, const char *file, int line);
-XMLPUBFUN void * XMLCALL
+XMLPUBFUN void * XMLCALL
xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
-XMLPUBFUN void * XMLCALL
+XMLPUBFUN void * XMLCALL
xmlMallocAtomicLoc (size_t size, const char *file, int line);
-XMLPUBFUN char * XMLCALL
+XMLPUBFUN char * XMLCALL
xmlMemStrdupLoc (const char *str, const char *file, int line);
diff --git a/include/libxml/xmlreader.h b/include/libxml/xmlreader.h
index dfe51a3..6964482 100644
--- a/include/libxml/xmlreader.h
+++ b/include/libxml/xmlreader.h
@@ -18,13 +18,26 @@
#include <libxml/xmlschemas.h>
#endif
-#ifdef LIBXML_READER_ENABLED
-
#ifdef __cplusplus
extern "C" {
#endif
/**
+ * xmlParserSeverities:
+ *
+ * How severe an error callback is when the per-reader error callback API
+ * is used.
+ */
+typedef enum {
+ XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
+ XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
+ XML_PARSER_SEVERITY_WARNING = 3,
+ XML_PARSER_SEVERITY_ERROR = 4
+} xmlParserSeverities;
+
+#ifdef LIBXML_READER_ENABLED
+
+/**
* xmlTextReaderMode:
*
* Internal state values for the reader.
@@ -42,7 +55,7 @@ typedef enum {
* xmlParserProperties:
*
* Some common options to use with xmlTextReaderSetParserProp, but it
- * is better to use xmlParserOption and the xmlReaderNewxxx and
+ * is better to use xmlParserOption and the xmlReaderNewxxx and
* xmlReaderForxxx APIs now.
*/
typedef enum {
@@ -53,19 +66,6 @@ typedef enum {
} xmlParserProperties;
/**
- * xmlParserSeverities:
- *
- * How severe an error callback is when the per-reader error callback API
- * is used.
- */
-typedef enum {
- XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
- XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
- XML_PARSER_SEVERITY_WARNING = 3,
- XML_PARSER_SEVERITY_ERROR = 4
-} xmlParserSeverities;
-
-/**
* xmlReaderTypes:
*
* Predefined constants for the different types of nodes.
@@ -111,13 +111,13 @@ typedef xmlTextReader *xmlTextReaderPtr;
XMLPUBFUN xmlTextReaderPtr XMLCALL
xmlNewTextReader (xmlParserInputBufferPtr input,
const char *URI);
-XMLPUBFUN xmlTextReaderPtr XMLCALL
+XMLPUBFUN xmlTextReaderPtr XMLCALL
xmlNewTextReaderFilename(const char *URI);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlFreeTextReader (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderSetup(xmlTextReaderPtr reader,
xmlParserInputBufferPtr input, const char *URL,
const char *encoding, int options);
@@ -125,120 +125,120 @@ XMLPUBFUN int XMLCALL
/*
* Iterators
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderRead (xmlTextReaderPtr reader);
#ifdef LIBXML_WRITER_ENABLED
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
-
-XMLPUBFUN xmlChar * XMLCALL
+
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
#endif
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderReadString (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
/*
* Attributes of the node
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderDepth (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderHasValue(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderIsDefault (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderNodeType (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderReadState (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstName (xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
-XMLPUBFUN const xmlChar * XMLCALL
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstString (xmlTextReaderPtr reader,
- const xmlChar *str);
-XMLPUBFUN const xmlChar * XMLCALL
+ const xmlChar *str);
+XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstValue (xmlTextReaderPtr reader);
/*
* use the Const version of the routine for
* better performance and simpler code
*/
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderBaseUri (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderLocalName (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderName (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderPrefix (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderXmlLang (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderValue (xmlTextReaderPtr reader);
/*
* Methods of the XmlTextReader
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderClose (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
int no);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
const xmlChar *name);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
const xmlChar *localName,
const xmlChar *namespaceURI);
-XMLPUBFUN xmlParserInputBufferPtr XMLCALL
+XMLPUBFUN xmlParserInputBufferPtr XMLCALL
xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
const xmlChar *prefix);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
int no);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
const xmlChar *name);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
const xmlChar *localName,
const xmlChar *namespaceURI);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderNormalization (xmlTextReaderPtr reader);
XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
@@ -246,14 +246,14 @@ XMLPUBFUN const xmlChar * XMLCALL
/*
* Extensions
*/
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
int prop,
int value);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
int prop);
-XMLPUBFUN xmlNodePtr XMLCALL
+XMLPUBFUN xmlNodePtr XMLCALL
xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
@@ -262,41 +262,41 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
-XMLPUBFUN xmlNodePtr XMLCALL
+XMLPUBFUN xmlNodePtr XMLCALL
xmlTextReaderPreserve (xmlTextReaderPtr reader);
#ifdef LIBXML_PATTERN_ENABLED
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
- const xmlChar *pattern,
+ const xmlChar *pattern,
const xmlChar **namespaces);
#endif /* LIBXML_PATTERN_ENABLED */
-XMLPUBFUN xmlDocPtr XMLCALL
+XMLPUBFUN xmlDocPtr XMLCALL
xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
-XMLPUBFUN xmlNodePtr XMLCALL
+XMLPUBFUN xmlNodePtr XMLCALL
xmlTextReaderExpand (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderNext (xmlTextReaderPtr reader);
XMLPUBFUN int XMLCALL
xmlTextReaderNextSibling (xmlTextReaderPtr reader);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderIsValid (xmlTextReaderPtr reader);
#ifdef LIBXML_SCHEMAS_ENABLED
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
const char *rng);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
xmlRelaxNGPtr schema);
XMLPUBFUN int XMLCALL
xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
- const char *xsd);
+ const char *xsd);
XMLPUBFUN int XMLCALL
xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
xmlSchemaValidCtxtPtr ctxt,
int options);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderSetSchema (xmlTextReaderPtr reader,
- xmlSchemaPtr schema);
+ xmlSchemaPtr schema);
#endif
XMLPUBFUN const xmlChar * XMLCALL
xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
@@ -382,33 +382,43 @@ XMLPUBFUN int XMLCALL
* Error handling extensions
*/
typedef void * xmlTextReaderLocatorPtr;
-typedef void (XMLCALL *xmlTextReaderErrorFunc) (void *arg,
+
+/**
+ * xmlTextReaderErrorFunc:
+ * @arg: the user argument
+ * @msg: the message
+ * @severity: the severity of the error
+ * @locator: a locator indicating where the error occured
+ *
+ * Signature of an error callback from a reader parser
+ */
+typedef void (XMLCALL *xmlTextReaderErrorFunc)(void *arg,
const char *msg,
xmlParserSeverities severity,
xmlTextReaderLocatorPtr locator);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
-XMLPUBFUN xmlChar * XMLCALL
+XMLPUBFUN xmlChar * XMLCALL
xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
-XMLPUBFUN void XMLCALL
- xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc f,
+XMLPUBFUN void XMLCALL
+ xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc f,
void *arg);
XMLPUBFUN void XMLCALL
xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
xmlStructuredErrorFunc f,
void *arg);
-XMLPUBFUN void XMLCALL
- xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
- xmlTextReaderErrorFunc *f,
+XMLPUBFUN void XMLCALL
+ xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
+ xmlTextReaderErrorFunc *f,
void **arg);
+#endif /* LIBXML_READER_ENABLED */
+
#ifdef __cplusplus
}
#endif
-#endif /* LIBXML_READER_ENABLED */
-
#endif /* __XML_XMLREADER_H__ */
diff --git a/include/libxml/xmlregexp.h b/include/libxml/xmlregexp.h
index 022cd6a..7009645 100644
--- a/include/libxml/xmlregexp.h
+++ b/include/libxml/xmlregexp.h
@@ -38,7 +38,7 @@ typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
#ifdef __cplusplus
}
-#endif
+#endif
#include <libxml/tree.h>
#include <libxml/dict.h>
#ifdef __cplusplus
@@ -51,16 +51,22 @@ extern "C" {
XMLPUBFUN xmlRegexpPtr XMLCALL
xmlRegexpCompile (const xmlChar *regexp);
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlRegexpExec (xmlRegexpPtr comp,
const xmlChar *value);
-XMLPUBFUN void XMLCALL
- xmlRegexpPrint (FILE *output,
+XMLPUBFUN void XMLCALL
+ xmlRegexpPrint (FILE *output,
xmlRegexpPtr regexp);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
-/*
+/**
+ * xmlRegExecCallbacks:
+ * @exec: the regular expression context
+ * @token: the current token string
+ * @transdata: transition data
+ * @inputdata: input data
+ *
* Callback function when doing a transition in the automata
*/
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
@@ -71,17 +77,17 @@ typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
/*
* The progressive API
*/
-XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
- xmlRegNewExecCtxt (xmlRegexpPtr comp,
+XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
+ xmlRegNewExecCtxt (xmlRegexpPtr comp,
xmlRegExecCallbacks callback,
void *data);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
-XMLPUBFUN int XMLCALL
- xmlRegExecPushString(xmlRegExecCtxtPtr exec,
+XMLPUBFUN int XMLCALL
+ xmlRegExecPushString(xmlRegExecCtxtPtr exec,
const xmlChar *value,
void *data);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
const xmlChar *value,
const xmlChar *value2,
@@ -89,15 +95,15 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
- int *nbval,
- int *nbneg,
+ int *nbval,
+ int *nbneg,
xmlChar **values,
int *terminal);
XMLPUBFUN int XMLCALL
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
- const xmlChar **string,
+ const xmlChar **string,
int *nbval,
- int *nbneg,
+ int *nbneg,
xmlChar **values,
int *terminal);
#ifdef LIBXML_EXPR_ENABLED
@@ -135,7 +141,7 @@ typedef enum {
} xmlExpNodeType;
/*
- * 2 core expressions shared by all for the empty language set
+ * 2 core expressions shared by all for the empty language set
* and for the set with just the empty token
*/
XMLPUBVAR xmlExpNodePtr forbiddenExp;
@@ -209,7 +215,7 @@ XMLPUBFUN void XMLCALL
#endif /* LIBXML_EXPR_ENABLED */
#ifdef __cplusplus
}
-#endif
+#endif
#endif /* LIBXML_REGEXP_ENABLED */
diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h
index 15faef5..556ef89 100644
--- a/include/libxml/xmlschemas.h
+++ b/include/libxml/xmlschemas.h
@@ -56,7 +56,7 @@ typedef enum {
/*
* ATTENTION: Change xmlSchemaSetValidOptions's check
-* for invalid values, if adding to the validation
+* for invalid values, if adding to the validation
* options below.
*/
/**
@@ -85,11 +85,28 @@ typedef struct _xmlSchema xmlSchema;
typedef xmlSchema *xmlSchemaPtr;
/**
- * A schemas validation context
+ * xmlSchemaValidityErrorFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of an error callback from an XSD validation
*/
typedef void (XMLCDECL *xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
+
+/**
+ * xmlSchemaValidityWarningFunc:
+ * @ctx: the validation context
+ * @msg: the message
+ * @...: extra arguments
+ *
+ * Signature of a warning callback from an XSD validation
+ */
typedef void (XMLCDECL *xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
+/**
+ * A schemas validation context
+ */
typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
@@ -99,16 +116,16 @@ typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
/*
* Interfaces for parsing.
*/
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
+XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
xmlSchemaNewParserCtxt (const char *URL);
-XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
+XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
xmlSchemaNewMemParserCtxt (const char *buffer,
int size);
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
@@ -125,19 +142,19 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
-XMLPUBFUN xmlSchemaPtr XMLCALL
+XMLPUBFUN xmlSchemaPtr XMLCALL
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchemaFree (xmlSchemaPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchemaDump (FILE *output,
xmlSchemaPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
@@ -157,11 +174,11 @@ XMLPUBFUN int XMLCALL
XMLPUBFUN int XMLCALL
xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
-XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
+XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
-XMLPUBFUN void XMLCALL
+XMLPUBFUN void XMLCALL
xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
-XMLPUBFUN int XMLCALL
+XMLPUBFUN int XMLCALL
xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
xmlDocPtr instance);
XMLPUBFUN int XMLCALL
@@ -178,8 +195,11 @@ XMLPUBFUN int XMLCALL
const char * filename,
int options);
+XMLPUBFUN xmlParserCtxtPtr XMLCALL
+ xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
+
/*
- * Interface to insert Schemas SAX velidation in a SAX stream
+ * Interface to insert Schemas SAX validation in a SAX stream
*/
typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h
index 9fc51a2..e00a6e9 100644
--- a/include/libxml/xmlversion.h
+++ b/include/libxml/xmlversion.h
@@ -29,21 +29,21 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
*
* the version string like "1.2.3"
*/
-#define LIBXML_DOTTED_VERSION "2.6.32"
+#define LIBXML_DOTTED_VERSION "2.7.0"
/**
* LIBXML_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
-#define LIBXML_VERSION 20632
+#define LIBXML_VERSION 20700
/**
* LIBXML_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
-#define LIBXML_VERSION_STRING "20632"
+#define LIBXML_VERSION_STRING "20700"
/**
* LIBXML_VERSION_EXTRA:
@@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
* Macro to check that the libxml version in use is compatible with
* the version the software has been compiled against
*/
-#define LIBXML_TEST_VERSION xmlCheckVersion(20632);
+#define LIBXML_TEST_VERSION xmlCheckVersion(20700);
#ifndef VMS
#if 0
diff --git a/include/wsockcompat.h b/include/wsockcompat.h
index 333b561..18fab37 100644
--- a/include/wsockcompat.h
+++ b/include/wsockcompat.h
@@ -21,6 +21,7 @@
/* Check if ws2tcpip.h is a recent version which provides getaddrinfo() */
#if defined(GetAddrInfo)
+#include <wspiapi.h>
#define HAVE_GETADDRINFO
#endif
#endif
diff --git a/libxml.spec.in b/libxml.spec.in
index fd13511..324b12c 100644
--- a/libxml.spec.in
+++ b/libxml.spec.in
@@ -5,7 +5,7 @@ Release: 1
License: MIT
Group: Development/Libraries
Source: ftp://xmlsoft.org/libxml2-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python python-devel zlib-devel
URL: http://xmlsoft.org/
Prefix: %{_prefix}
diff --git a/libxml2.spec b/libxml2.spec
index 887e8a1..37ee12c 100644
--- a/libxml2.spec
+++ b/libxml2.spec
@@ -1,11 +1,11 @@
Summary: Library providing XML and HTML support
Name: libxml2
-Version: 2.6.32
+Version: 2.7.0
Release: 1
License: MIT
Group: Development/Libraries
Source: ftp://xmlsoft.org/libxml2-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-root
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python python-devel zlib-devel
URL: http://xmlsoft.org/
Prefix: %{_prefix}
@@ -128,6 +128,6 @@ rm -fr %{buildroot}
%doc doc/python.html
%changelog
-* Tue Apr 8 2008 Daniel Veillard <veillard@redhat.com>
-- upstream release 2.6.32 see http://xmlsoft.org/news.html
+* Sat Aug 30 2008 Daniel Veillard <veillard@redhat.com>
+- upstream release 2.7.0 see http://xmlsoft.org/news.html
diff --git a/macos/src/XMLTestPrefix.h.orig b/macos/src/XMLTestPrefix.h.orig
deleted file mode 100644
index 3e84255..0000000
--- a/macos/src/XMLTestPrefix.h.orig
+++ /dev/null
@@ -1 +0,0 @@
-int test_main(int argc, char **argv); #define main(X,Y) test_main(X,Y) \ No newline at end of file
diff --git a/nanoftp.c b/nanoftp.c
index 8c4ea88..a54b85b 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -89,7 +89,7 @@
* A couple portability macros
*/
#ifndef _WINSOCKAPI_
-#ifndef __BEOS__
+#if !defined(__BEOS__) || defined(__HAIKU__)
#define closesocket(s) close(s)
#endif
#define SOCKET int
diff --git a/nanohttp.c b/nanohttp.c
index 07829c7..9001ae5 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -95,7 +95,7 @@
* A couple portability macros
*/
#ifndef _WINSOCKAPI_
-#ifndef __BEOS__
+#if !defined(__BEOS__) || defined(__HAIKU__)
#define closesocket(s) close(s)
#endif
#define SOCKET int
@@ -844,7 +844,7 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
status = ioctl(s, FIONBIO, &enable);
}
#else /* VMS */
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(__HAIKU__)
{
bool noblock = true;
status = setsockopt(s, SOL_SOCKET, SO_NONBLOCK, &noblock, sizeof(noblock));
diff --git a/parser.c b/parser.c
index f20fd05..42b2852 100644
--- a/parser.c
+++ b/parser.c
@@ -80,20 +80,111 @@
#include <zlib.h>
#endif
+static void
+xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info);
+
+/************************************************************************
+ * *
+ * Arbitrary limits set in the parser. See XML_PARSE_HUGE *
+ * *
+ ************************************************************************/
+
+#define XML_PARSER_BIG_ENTITY 1000
+#define XML_PARSER_LOT_ENTITY 5000
+
+/*
+ * XML_PARSER_NON_LINEAR is the threshold where the ratio of parsed entity
+ * replacement over the size in byte of the input indicates that you have
+ * and eponential behaviour. A value of 10 correspond to at least 3 entity
+ * replacement per byte of input.
+ */
+#define XML_PARSER_NON_LINEAR 10
+
+/*
+ * xmlParserEntityCheck
+ *
+ * Function to check non-linear entity expansion behaviour
+ * This is here to detect and stop exponential linear entity expansion
+ * This is not a limitation of the parser but a safety
+ * boundary feature. It can be disabled with the XML_PARSE_HUGE
+ * parser option.
+ */
+static int
+xmlParserEntityCheck(xmlParserCtxtPtr ctxt, unsigned long size,
+ xmlEntityPtr ent)
+{
+ unsigned long consumed = 0;
+
+ if ((ctxt == NULL) || (ctxt->options & XML_PARSE_HUGE))
+ return (0);
+ if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
+ return (1);
+ if (size != 0) {
+ /*
+ * Do the check based on the replacement size of the entity
+ */
+ if (size < XML_PARSER_BIG_ENTITY)
+ return(0);
+
+ /*
+ * A limit on the amount of text data reasonably used
+ */
+ if (ctxt->input != NULL) {
+ consumed = ctxt->input->consumed +
+ (ctxt->input->cur - ctxt->input->base);
+ }
+ consumed += ctxt->sizeentities;
+
+ if ((size < XML_PARSER_NON_LINEAR * consumed) &&
+ (ctxt->nbentities * 3 < XML_PARSER_NON_LINEAR * consumed))
+ return (0);
+ } else if (ent != NULL) {
+ /*
+ * use the number of parsed entities in the replacement
+ */
+ size = ent->checked;
+
+ /*
+ * The amount of data parsed counting entities size only once
+ */
+ if (ctxt->input != NULL) {
+ consumed = ctxt->input->consumed +
+ (ctxt->input->cur - ctxt->input->base);
+ }
+ consumed += ctxt->sizeentities;
+
+ /*
+ * Check the density of entities for the amount of data
+ * knowing an entity reference will take at least 3 bytes
+ */
+ if (size * 3 < consumed * XML_PARSER_NON_LINEAR)
+ return (0);
+ } else {
+ /*
+ * strange we got no data for checking just return
+ */
+ return (0);
+ }
+
+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+ return (1);
+}
+
/**
* xmlParserMaxDepth:
*
- * arbitrary depth limit for the XML documents that we allow to
- * process. This is not a limitation of the parser but a safety
- * boundary feature.
+ * arbitrary depth limit for the XML documents that we allow to
+ * process. This is not a limitation of the parser but a safety
+ * boundary feature. It can be disabled with the XML_PARSE_HUGE
+ * parser option.
*/
-unsigned int xmlParserMaxDepth = 1024;
+unsigned int xmlParserMaxDepth = 256;
-#define SAX2 1
+
+#define SAX2 1
#define XML_PARSER_BIG_BUFFER_SIZE 300
#define XML_PARSER_BUFFER_SIZE 100
-
#define SAX_COMPAT_MODE BAD_CAST "SAX compatibility mode document"
/*
@@ -116,6 +207,9 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
void *user_data, int depth, const xmlChar *URL,
const xmlChar *ID, xmlNodePtr *list);
+static int
+xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options,
+ const char *encoding);
#ifdef LIBXML_LEGACY_ENABLED
static void
xmlAddEntityReference(xmlEntityPtr ent, xmlNodePtr firstNode,
@@ -418,7 +512,7 @@ xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
const char *msg, const xmlChar *str1, const xmlChar *str2)
{
xmlStructuredErrorFunc schannel = NULL;
-
+
if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
(ctxt->instate == XML_PARSER_EOF))
return;
@@ -445,7 +539,7 @@ xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error,
*/
static void
xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error,
- const char *msg, const xmlChar *str1)
+ const char *msg, const xmlChar *str1, const xmlChar *str2)
{
xmlStructuredErrorFunc schannel = NULL;
@@ -461,8 +555,8 @@ xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error,
ctxt->vctxt.error, ctxt->vctxt.userData,
ctxt, NULL, XML_FROM_DTD, error,
XML_ERR_ERROR, NULL, 0, (const char *) str1,
- NULL, NULL, 0, 0,
- msg, (const char *) str1);
+ (const char *) str2, NULL, 0, 0,
+ msg, (const char *) str1, (const char *) str2);
if (ctxt != NULL) {
ctxt->valid = 0;
}
@@ -610,6 +704,33 @@ xmlNsErr(xmlParserCtxtPtr ctxt, xmlParserErrors error,
ctxt->nsWellFormed = 0;
}
+/**
+ * xmlNsWarn
+ * @ctxt: an XML parser context
+ * @error: the error number
+ * @msg: the message
+ * @info1: extra information string
+ * @info2: extra information string
+ *
+ * Handle a fatal parser error, i.e. violating Well-Formedness constraints
+ */
+static void
+xmlNsWarn(xmlParserCtxtPtr ctxt, xmlParserErrors error,
+ const char *msg,
+ const xmlChar * info1, const xmlChar * info2,
+ const xmlChar * info3)
+{
+ if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
+ (ctxt->instate == XML_PARSER_EOF))
+ return;
+ if (ctxt != NULL)
+ ctxt->errNo = error;
+ __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_NAMESPACE, error,
+ XML_ERR_WARNING, NULL, 0, (const char *) info1,
+ (const char *) info2, (const char *) info3, 0, 0, msg,
+ info1, info2, info3);
+}
+
/************************************************************************
* *
* Library wide options *
@@ -809,7 +930,7 @@ xmlHasFeature(xmlFeature feature)
return(1);
#else
return(0);
-#endif
+#endif
case XML_WITH_ZLIB:
#ifdef LIBXML_ZLIB_ENABLED
return(1);
@@ -859,7 +980,7 @@ typedef xmlDefAttrs *xmlDefAttrsPtr;
struct _xmlDefAttrs {
int nbAttrs; /* number of defaulted attributes on that element */
int maxAttrs; /* the size of the array */
- const xmlChar *values[4]; /* array of localname/prefix/values */
+ const xmlChar *values[5]; /* array of localname/prefix/values/external */
};
/**
@@ -913,7 +1034,7 @@ xmlAttrNormalizeSpace(const xmlChar *src, xmlChar *dst)
* is needed.
*/
static const xmlChar *
-xmlAttrNormalizeSpace2(xmlParserCtxtPtr ctxt, const xmlChar *src, int *len)
+xmlAttrNormalizeSpace2(xmlParserCtxtPtr ctxt, xmlChar *src, int *len)
{
int i;
int remove_head = 0;
@@ -954,7 +1075,8 @@ xmlAttrNormalizeSpace2(xmlParserCtxtPtr ctxt, const xmlChar *src, int *len)
return(ret);
} else if (remove_head) {
*len -= remove_head;
- return(src + remove_head);
+ memmove(src, src + remove_head, 1 + *len);
+ return(src);
}
return(NULL);
}
@@ -1011,7 +1133,7 @@ xmlAddDefAttrs(xmlParserCtxtPtr ctxt,
defaults = xmlHashLookup2(ctxt->attsDefault, name, prefix);
if (defaults == NULL) {
defaults = (xmlDefAttrsPtr) xmlMalloc(sizeof(xmlDefAttrs) +
- (4 * 4) * sizeof(const xmlChar *));
+ (4 * 5) * sizeof(const xmlChar *));
if (defaults == NULL)
goto mem_error;
defaults->nbAttrs = 0;
@@ -1025,7 +1147,7 @@ xmlAddDefAttrs(xmlParserCtxtPtr ctxt,
xmlDefAttrsPtr temp;
temp = (xmlDefAttrsPtr) xmlRealloc(defaults, sizeof(xmlDefAttrs) +
- (2 * defaults->maxAttrs * 4) * sizeof(const xmlChar *));
+ (2 * defaults->maxAttrs * 5) * sizeof(const xmlChar *));
if (temp == NULL)
goto mem_error;
defaults = temp;
@@ -1050,13 +1172,17 @@ xmlAddDefAttrs(xmlParserCtxtPtr ctxt,
prefix = xmlDictLookup(ctxt->dict, fullattr, len);
}
- defaults->values[4 * defaults->nbAttrs] = name;
- defaults->values[4 * defaults->nbAttrs + 1] = prefix;
+ defaults->values[5 * defaults->nbAttrs] = name;
+ defaults->values[5 * defaults->nbAttrs + 1] = prefix;
/* intern the string and precompute the end */
len = xmlStrlen(value);
value = xmlDictLookup(ctxt->dict, value, len);
- defaults->values[4 * defaults->nbAttrs + 2] = value;
- defaults->values[4 * defaults->nbAttrs + 3] = value + len;
+ defaults->values[5 * defaults->nbAttrs + 2] = value;
+ defaults->values[5 * defaults->nbAttrs + 3] = value + len;
+ if (ctxt->external)
+ defaults->values[5 * defaults->nbAttrs + 4] = BAD_CAST "external";
+ else
+ defaults->values[5 * defaults->nbAttrs + 4] = NULL;
defaults->nbAttrs++;
return;
@@ -1212,7 +1338,7 @@ xmlCheckLanguageID(const xmlChar * lang)
/************************************************************************
* *
- * Parser stacks related functions and macros *
+ * Parser stacks related functions and macros *
* *
************************************************************************/
@@ -1293,7 +1419,7 @@ nsPop(xmlParserCtxtPtr ctxt, int nr)
}
if (ctxt->nsNr <= 0)
return (0);
-
+
for (i = 0;i < nr;i++) {
ctxt->nsNr--;
ctxt->nsTab[ctxt->nsNr] = NULL;
@@ -1343,13 +1469,13 @@ mem_error:
*
* Pushes a new parser input on top of the input stack
*
- * Returns 0 in case of error, the index in the stack otherwise
+ * Returns -1 in case of error, the index in the stack otherwise
*/
int
inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
{
if ((ctxt == NULL) || (value == NULL))
- return(0);
+ return(-1);
if (ctxt->inputNr >= ctxt->inputMax) {
ctxt->inputMax *= 2;
ctxt->inputTab =
@@ -1358,7 +1484,10 @@ inputPush(xmlParserCtxtPtr ctxt, xmlParserInputPtr value)
sizeof(ctxt->inputTab[0]));
if (ctxt->inputTab == NULL) {
xmlErrMemory(ctxt, NULL);
- return (0);
+ xmlFreeInputStream(value);
+ ctxt->inputMax /= 2;
+ value = NULL;
+ return (-1);
}
}
ctxt->inputTab[ctxt->inputNr] = value;
@@ -1398,7 +1527,7 @@ inputPop(xmlParserCtxtPtr ctxt)
*
* Pushes a new element node on top of the node stack
*
- * Returns 0 in case of error, the index in the stack otherwise
+ * Returns -1 in case of error, the index in the stack otherwise
*/
int
nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
@@ -1412,22 +1541,24 @@ nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
sizeof(ctxt->nodeTab[0]));
if (tmp == NULL) {
xmlErrMemory(ctxt, NULL);
- return (0);
+ return (-1);
}
ctxt->nodeTab = tmp;
ctxt->nodeMax *= 2;
}
- if (((unsigned int) ctxt->nodeNr) > xmlParserMaxDepth) {
+ if ((((unsigned int) ctxt->nodeNr) > xmlParserMaxDepth) &&
+ ((ctxt->options & XML_PARSE_HUGE) == 0)) {
xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR,
- "Excessive depth in document: change xmlParserMaxDepth = %d\n",
+ "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
xmlParserMaxDepth);
ctxt->instate = XML_PARSER_EOF;
- return(0);
+ return(-1);
}
ctxt->nodeTab[ctxt->nodeNr] = value;
ctxt->node = value;
return (ctxt->nodeNr++);
}
+
/**
* nodePop:
* @ctxt: an XML parser context
@@ -1594,7 +1725,8 @@ static int spacePush(xmlParserCtxtPtr ctxt, int val) {
ctxt->spaceMax * sizeof(ctxt->spaceTab[0]));
if (tmp == NULL) {
xmlErrMemory(ctxt, NULL);
- return(0);
+ ctxt->spaceMax /=2;
+ return(-1);
}
ctxt->spaceTab = tmp;
}
@@ -1842,10 +1974,12 @@ xmlPopInput(xmlParserCtxtPtr ctxt) {
*
* xmlPushInput: switch to a new input stream which is stacked on top
* of the previous one(s).
+ * Returns -1 in case of error or the index in the input stack
*/
-void
+int
xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
- if (input == NULL) return;
+ int ret;
+ if (input == NULL) return(-1);
if (xmlParserDebugEntities) {
if ((ctxt->input != NULL) && (ctxt->input->filename))
@@ -1855,8 +1989,9 @@ xmlPushInput(xmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
xmlGenericError(xmlGenericErrorContext,
"Pushing input %d : %.30s\n", ctxt->inputNr+1, input->cur);
}
- inputPush(ctxt, input);
+ ret = inputPush(ctxt, input);
GROW;
+ return(ret);
}
/**
@@ -2234,7 +2369,7 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
if ((ctxt->validate) && (ctxt->vctxt.error != NULL)) {
xmlValidityError(ctxt, XML_WAR_UNDECLARED_ENTITY,
"PEReference: %%%s; not found\n",
- name);
+ name, NULL);
} else
xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
"PEReference: %%%s; not found\n",
@@ -2243,7 +2378,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
}
} else if (ctxt->input->free != deallocblankswrapper) {
input = xmlNewBlanksWrapperInputStream(ctxt, entity);
- xmlPushInput(ctxt, input);
+ if (xmlPushInput(ctxt, input) < 0)
+ return;
} else {
if ((entity->etype == XML_INTERNAL_PARAMETER_ENTITY) ||
(entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)) {
@@ -2256,7 +2392,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
* this is done independently.
*/
input = xmlNewEntityInputStream(ctxt, entity);
- xmlPushInput(ctxt, input);
+ if (xmlPushInput(ctxt, input) < 0)
+ return;
/*
* Get the 4 first bytes and decode the charset
@@ -2299,9 +2436,10 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
/*
* Macro used to grow the current buffer.
*/
-#define growBuffer(buffer) { \
+#define growBuffer(buffer, n) { \
xmlChar *tmp; \
buffer##_size *= 2; \
+ buffer##_size += n; \
tmp = (xmlChar *) \
xmlRealloc(buffer, buffer##_size * sizeof(xmlChar)); \
if (tmp == NULL) goto mem_error; \
@@ -2344,7 +2482,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
return(NULL);
last = str + len;
- if (ctxt->depth > 40) {
+ if (((ctxt->depth > 40) &&
+ ((ctxt->options & XML_PARSE_HUGE) == 0)) ||
+ (ctxt->depth > 1024)) {
xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
return(NULL);
}
@@ -2374,7 +2514,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
COPY_BUF(0,buffer,nbchars,val);
}
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer);
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
}
} else if ((c == '&') && (what & XML_SUBSTITUTE_REF)) {
if (xmlParserDebugEntities)
@@ -2382,12 +2522,17 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
"String decoding Entity Reference: %.30s\n",
str);
ent = xmlParseStringEntityRef(ctxt, &str);
+ if ((ctxt->lastError.code == XML_ERR_ENTITY_LOOP) ||
+ (ctxt->lastError.code == XML_ERR_INTERNAL_ERROR))
+ goto int_error;
+ if (ent != NULL)
+ ctxt->nbentities += ent->checked;
if ((ent != NULL) &&
(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
if (ent->content != NULL) {
COPY_BUF(0,buffer,nbchars,ent->content[0]);
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer);
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
}
} else {
xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
@@ -2398,13 +2543,16 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
rep = xmlStringDecodeEntities(ctxt, ent->content, what,
0, 0, 0);
ctxt->depth--;
+
if (rep != NULL) {
current = rep;
while (*current != 0) { /* non input consuming loop */
buffer[nbchars++] = *current++;
if (nbchars >
buffer_size - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer);
+ if (xmlParserEntityCheck(ctxt, nbchars, ent))
+ goto int_error;
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
}
}
xmlFree(rep);
@@ -2416,7 +2564,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
buffer[nbchars++] = '&';
if (nbchars > buffer_size - i - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer);
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
}
for (;i > 0;i--)
buffer[nbchars++] = *cur++;
@@ -2427,10 +2575,13 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
xmlGenericError(xmlGenericErrorContext,
"String decoding PE Reference: %.30s\n", str);
ent = xmlParseStringPEReference(ctxt, &str);
+ if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP)
+ goto int_error;
+ if (ent != NULL)
+ ctxt->nbentities += ent->checked;
if (ent != NULL) {
if (ent->content == NULL) {
- if (xmlLoadEntityContent(ctxt, ent) < 0) {
- }
+ xmlLoadEntityContent(ctxt, ent);
}
ctxt->depth++;
rep = xmlStringDecodeEntities(ctxt, ent->content, what,
@@ -2442,7 +2593,9 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
buffer[nbchars++] = *current++;
if (nbchars >
buffer_size - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer);
+ if (xmlParserEntityCheck(ctxt, nbchars, ent))
+ goto int_error;
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
}
}
xmlFree(rep);
@@ -2453,7 +2606,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
COPY_BUF(l,buffer,nbchars,c);
str += l;
if (nbchars > buffer_size - XML_PARSER_BUFFER_SIZE) {
- growBuffer(buffer);
+ growBuffer(buffer, XML_PARSER_BUFFER_SIZE);
}
}
if (str < last)
@@ -2466,6 +2619,7 @@ xmlStringLenDecodeEntities(xmlParserCtxtPtr ctxt, const xmlChar *str, int len,
mem_error:
xmlErrMemory(ctxt, NULL);
+int_error:
if (rep != NULL)
xmlFree(rep);
if (buffer != NULL)
@@ -2758,10 +2912,198 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) {
* *
************************************************************************/
-static const xmlChar * xmlParseNameComplex(xmlParserCtxtPtr ctxt);
+/************************************************************************
+ * *
+ * Routines to parse Name, NCName and NmToken *
+ * *
+ ************************************************************************/
+unsigned long nbParseName = 0;
+unsigned long nbParseNmToken = 0;
+unsigned long nbParseNCName = 0;
+unsigned long nbParseNCNameComplex = 0;
+unsigned long nbParseNameComplex = 0;
+unsigned long nbParseStringName = 0;
+/*
+ * The two following functions are related to the change of accepted
+ * characters for Name and NmToken in the Revision 5 of XML-1.0
+ * They correspond to the modified production [4] and the new production [4a]
+ * changes in that revision. Also note that the macros used for the
+ * productions Letter, Digit, CombiningChar and Extender are not needed
+ * anymore.
+ * We still keep compatibility to pre-revision5 parsing semantic if the
+ * new XML_PARSE_OLD10 option is given to the parser.
+ */
+static int
+xmlIsNameStartChar(xmlParserCtxtPtr ctxt, int c) {
+ if ((ctxt->options & XML_PARSE_OLD10) == 0) {
+ /*
+ * Use the new checks of production [4] [4a] amd [5] of the
+ * Update 5 of XML-1.0
+ */
+ if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
+ (((c >= 'a') && (c <= 'z')) ||
+ ((c >= 'A') && (c <= 'Z')) ||
+ (c == '_') || (c == ':') ||
+ ((c >= 0xC0) && (c <= 0xD6)) ||
+ ((c >= 0xD8) && (c <= 0xF6)) ||
+ ((c >= 0xF8) && (c <= 0x2FF)) ||
+ ((c >= 0x370) && (c <= 0x37D)) ||
+ ((c >= 0x37F) && (c <= 0x1FFF)) ||
+ ((c >= 0x200C) && (c <= 0x200D)) ||
+ ((c >= 0x2070) && (c <= 0x218F)) ||
+ ((c >= 0x2C00) && (c <= 0x2FEF)) ||
+ ((c >= 0x3001) && (c <= 0xD7FF)) ||
+ ((c >= 0xF900) && (c <= 0xFDCF)) ||
+ ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
+ ((c >= 0x10000) && (c <= 0xEFFFF))))
+ return(1);
+ } else {
+ if (IS_LETTER(c) || (c == '_') || (c == ':'))
+ return(1);
+ }
+ return(0);
+}
+
+static int
+xmlIsNameChar(xmlParserCtxtPtr ctxt, int c) {
+ if ((ctxt->options & XML_PARSE_OLD10) == 0) {
+ /*
+ * Use the new checks of production [4] [4a] amd [5] of the
+ * Update 5 of XML-1.0
+ */
+ if ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
+ (((c >= 'a') && (c <= 'z')) ||
+ ((c >= 'A') && (c <= 'Z')) ||
+ ((c >= '0') && (c <= '9')) || /* !start */
+ (c == '_') || (c == ':') ||
+ (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
+ ((c >= 0xC0) && (c <= 0xD6)) ||
+ ((c >= 0xD8) && (c <= 0xF6)) ||
+ ((c >= 0xF8) && (c <= 0x2FF)) ||
+ ((c >= 0x300) && (c <= 0x36F)) || /* !start */
+ ((c >= 0x370) && (c <= 0x37D)) ||
+ ((c >= 0x37F) && (c <= 0x1FFF)) ||
+ ((c >= 0x200C) && (c <= 0x200D)) ||
+ ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
+ ((c >= 0x2070) && (c <= 0x218F)) ||
+ ((c >= 0x2C00) && (c <= 0x2FEF)) ||
+ ((c >= 0x3001) && (c <= 0xD7FF)) ||
+ ((c >= 0xF900) && (c <= 0xFDCF)) ||
+ ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
+ ((c >= 0x10000) && (c <= 0xEFFFF))))
+ return(1);
+ } else {
+ if ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
+ (c == '.') || (c == '-') ||
+ (c == '_') || (c == ':') ||
+ (IS_COMBINING(c)) ||
+ (IS_EXTENDER(c)))
+ return(1);
+ }
+ return(0);
+}
+
static xmlChar * xmlParseAttValueInternal(xmlParserCtxtPtr ctxt,
int *len, int *alloc, int normalize);
+static const xmlChar *
+xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
+ int len = 0, l;
+ int c;
+ int count = 0;
+
+ nbParseNameComplex++;
+
+ /*
+ * Handler for more complex cases
+ */
+ GROW;
+ c = CUR_CHAR(l);
+ if ((ctxt->options & XML_PARSE_OLD10) == 0) {
+ /*
+ * Use the new checks of production [4] [4a] amd [5] of the
+ * Update 5 of XML-1.0
+ */
+ if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
+ (!(((c >= 'a') && (c <= 'z')) ||
+ ((c >= 'A') && (c <= 'Z')) ||
+ (c == '_') || (c == ':') ||
+ ((c >= 0xC0) && (c <= 0xD6)) ||
+ ((c >= 0xD8) && (c <= 0xF6)) ||
+ ((c >= 0xF8) && (c <= 0x2FF)) ||
+ ((c >= 0x370) && (c <= 0x37D)) ||
+ ((c >= 0x37F) && (c <= 0x1FFF)) ||
+ ((c >= 0x200C) && (c <= 0x200D)) ||
+ ((c >= 0x2070) && (c <= 0x218F)) ||
+ ((c >= 0x2C00) && (c <= 0x2FEF)) ||
+ ((c >= 0x3001) && (c <= 0xD7FF)) ||
+ ((c >= 0xF900) && (c <= 0xFDCF)) ||
+ ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
+ ((c >= 0x10000) && (c <= 0xEFFFF))))) {
+ return(NULL);
+ }
+ len += l;
+ NEXTL(l);
+ c = CUR_CHAR(l);
+ while ((c != ' ') && (c != '>') && (c != '/') && /* accelerators */
+ (((c >= 'a') && (c <= 'z')) ||
+ ((c >= 'A') && (c <= 'Z')) ||
+ ((c >= '0') && (c <= '9')) || /* !start */
+ (c == '_') || (c == ':') ||
+ (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
+ ((c >= 0xC0) && (c <= 0xD6)) ||
+ ((c >= 0xD8) && (c <= 0xF6)) ||
+ ((c >= 0xF8) && (c <= 0x2FF)) ||
+ ((c >= 0x300) && (c <= 0x36F)) || /* !start */
+ ((c >= 0x370) && (c <= 0x37D)) ||
+ ((c >= 0x37F) && (c <= 0x1FFF)) ||
+ ((c >= 0x200C) && (c <= 0x200D)) ||
+ ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
+ ((c >= 0x2070) && (c <= 0x218F)) ||
+ ((c >= 0x2C00) && (c <= 0x2FEF)) ||
+ ((c >= 0x3001) && (c <= 0xD7FF)) ||
+ ((c >= 0xF900) && (c <= 0xFDCF)) ||
+ ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
+ ((c >= 0x10000) && (c <= 0xEFFFF))
+ )) {
+ if (count++ > 100) {
+ count = 0;
+ GROW;
+ }
+ len += l;
+ NEXTL(l);
+ c = CUR_CHAR(l);
+ }
+ } else {
+ if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
+ (!IS_LETTER(c) && (c != '_') &&
+ (c != ':'))) {
+ return(NULL);
+ }
+ len += l;
+ NEXTL(l);
+ c = CUR_CHAR(l);
+
+ while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
+ ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
+ (c == '.') || (c == '-') ||
+ (c == '_') || (c == ':') ||
+ (IS_COMBINING(c)) ||
+ (IS_EXTENDER(c)))) {
+ if (count++ > 100) {
+ count = 0;
+ GROW;
+ }
+ len += l;
+ NEXTL(l);
+ c = CUR_CHAR(l);
+ }
+ }
+ if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
+ return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len));
+ return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
+}
+
/**
* xmlParseName:
* @ctxt: an XML parser context
@@ -2786,6 +3128,8 @@ xmlParseName(xmlParserCtxtPtr ctxt) {
GROW;
+ nbParseName++;
+
/*
* Accelerator for simple ASCII names
*/
@@ -2811,9 +3155,93 @@ xmlParseName(xmlParserCtxtPtr ctxt) {
return(ret);
}
}
+ /* accelerator for special cases */
return(xmlParseNameComplex(ctxt));
}
+static const xmlChar *
+xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
+ int len = 0, l;
+ int c;
+ int count = 0;
+
+ nbParseNCNameComplex++;
+
+ /*
+ * Handler for more complex cases
+ */
+ GROW;
+ c = CUR_CHAR(l);
+ if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
+ (!xmlIsNameStartChar(ctxt, c) || (c == ':'))) {
+ return(NULL);
+ }
+
+ while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
+ (xmlIsNameChar(ctxt, c) && (c != ':'))) {
+ if (count++ > 100) {
+ count = 0;
+ GROW;
+ }
+ len += l;
+ NEXTL(l);
+ c = CUR_CHAR(l);
+ }
+ return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
+}
+
+/**
+ * xmlParseNCName:
+ * @ctxt: an XML parser context
+ * @len: lenght of the string parsed
+ *
+ * parse an XML name.
+ *
+ * [4NS] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
+ * CombiningChar | Extender
+ *
+ * [5NS] NCName ::= (Letter | '_') (NCNameChar)*
+ *
+ * Returns the Name parsed or NULL
+ */
+
+static const xmlChar *
+xmlParseNCName(xmlParserCtxtPtr ctxt) {
+ const xmlChar *in;
+ const xmlChar *ret;
+ int count = 0;
+
+ nbParseNCName++;
+
+ /*
+ * Accelerator for simple ASCII names
+ */
+ in = ctxt->input->cur;
+ if (((*in >= 0x61) && (*in <= 0x7A)) ||
+ ((*in >= 0x41) && (*in <= 0x5A)) ||
+ (*in == '_')) {
+ in++;
+ while (((*in >= 0x61) && (*in <= 0x7A)) ||
+ ((*in >= 0x41) && (*in <= 0x5A)) ||
+ ((*in >= 0x30) && (*in <= 0x39)) ||
+ (*in == '_') || (*in == '-') ||
+ (*in == '.'))
+ in++;
+ if ((*in > 0) && (*in < 0x80)) {
+ count = in - ctxt->input->cur;
+ 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);
+ }
+ return(ret);
+ }
+ }
+ return(xmlParseNCNameComplex(ctxt));
+}
+
/**
* xmlParseNameAndCompare:
* @ctxt: an XML parser context
@@ -2832,15 +3260,15 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
const xmlChar *ret;
GROW;
-
+
in = ctxt->input->cur;
while (*in != 0 && *in == *cmp) {
- ++in;
+ ++in;
++cmp;
ctxt->input->col++;
}
if (*cmp == 0 && (*in == '>' || IS_BLANK_CH (*in))) {
- /* success */
+ /* success */
ctxt->input->cur = in;
return (const xmlChar*) 1;
}
@@ -2853,42 +3281,6 @@ xmlParseNameAndCompare(xmlParserCtxtPtr ctxt, xmlChar const *other) {
return ret;
}
-static const xmlChar *
-xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
- int len = 0, l;
- int c;
- int count = 0;
-
- /*
- * Handler for more complex cases
- */
- GROW;
- c = CUR_CHAR(l);
- if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
- (!IS_LETTER(c) && (c != '_') &&
- (c != ':'))) {
- return(NULL);
- }
-
- while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
- ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
- (c == '.') || (c == '-') ||
- (c == '_') || (c == ':') ||
- (IS_COMBINING(c)) ||
- (IS_EXTENDER(c)))) {
- if (count++ > 100) {
- count = 0;
- GROW;
- }
- len += l;
- NEXTL(l);
- c = CUR_CHAR(l);
- }
- if ((*ctxt->input->cur == '\n') && (ctxt->input->cur[-1] == '\r'))
- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - (len + 1), len));
- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
-}
-
/**
* xmlParseStringName:
* @ctxt: an XML parser context
@@ -2914,17 +3306,17 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
int len = 0, l;
int c;
+ nbParseStringName++;
+
c = CUR_SCHAR(cur, l);
- if (!IS_LETTER(c) && (c != '_') &&
- (c != ':')) {
+ if (!xmlIsNameStartChar(ctxt, c)) {
return(NULL);
}
- while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigentname.xml */
- (c == '.') || (c == '-') ||
- (c == '_') || (c == ':') ||
- (IS_COMBINING(c)) ||
- (IS_EXTENDER(c))) {
+ COPY_BUF(l,buf,len,c);
+ cur += l;
+ c = CUR_SCHAR(cur, l);
+ while (xmlIsNameChar(ctxt, c)) {
COPY_BUF(l,buf,len,c);
cur += l;
c = CUR_SCHAR(cur, l);
@@ -2935,19 +3327,14 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
*/
xmlChar *buffer;
int max = len * 2;
-
+
buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar));
if (buffer == NULL) {
xmlErrMemory(ctxt, NULL);
return(NULL);
}
memcpy(buffer, buf, len);
- while ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
- /* test bigentname.xml */
- (c == '.') || (c == '-') ||
- (c == '_') || (c == ':') ||
- (IS_COMBINING(c)) ||
- (IS_EXTENDER(c))) {
+ while (xmlIsNameChar(ctxt, c)) {
if (len + 10 > max) {
xmlChar *tmp;
max *= 2;
@@ -2976,7 +3363,7 @@ xmlParseStringName(xmlParserCtxtPtr ctxt, const xmlChar** str) {
/**
* xmlParseNmtoken:
* @ctxt: an XML parser context
- *
+ *
* parse an XML Nmtoken.
*
* [7] Nmtoken ::= (NameChar)+
@@ -2993,14 +3380,12 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) {
int c;
int count = 0;
+ nbParseNmToken++;
+
GROW;
c = CUR_CHAR(l);
- while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigtoken.xml */
- (c == '.') || (c == '-') ||
- (c == '_') || (c == ':') ||
- (IS_COMBINING(c)) ||
- (IS_EXTENDER(c))) {
+ while (xmlIsNameChar(ctxt, c)) {
if (count++ > 100) {
count = 0;
GROW;
@@ -3015,18 +3400,14 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) {
*/
xmlChar *buffer;
int max = len * 2;
-
+
buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar));
if (buffer == NULL) {
xmlErrMemory(ctxt, NULL);
return(NULL);
}
memcpy(buffer, buf, len);
- while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigtoken.xml */
- (c == '.') || (c == '-') ||
- (c == '_') || (c == ':') ||
- (IS_COMBINING(c)) ||
- (IS_EXTENDER(c))) {
+ while (xmlIsNameChar(ctxt, c)) {
if (count++ > 100) {
count = 0;
GROW;
@@ -3255,7 +3636,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
if (val == '&') {
if (ctxt->replaceEntities) {
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
buf[len++] = '&';
} else {
@@ -3264,7 +3645,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
* called by the attribute() function in SAX.c
*/
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
buf[len++] = '&';
buf[len++] = '#';
@@ -3274,16 +3655,19 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
}
} else if (val != 0) {
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
len += xmlCopyChar(0, &buf[len], val);
}
} else {
ent = xmlParseEntityRef(ctxt);
+ ctxt->nbentities++;
+ if (ent != NULL)
+ ctxt->nbentities += ent->owner;
if ((ent != NULL) &&
(ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
if ((ctxt->replaceEntities == 0) &&
(ent->content[0] == '&')) {
@@ -3306,7 +3690,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
while (*current != 0) { /* non input consuming */
buf[len++] = *current++;
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
}
xmlFree(rep);
@@ -3314,7 +3698,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
}
} else {
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
if (ent->content != NULL)
buf[len++] = ent->content[0];
@@ -3341,8 +3725,8 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
* Just output the reference
*/
buf[len++] = '&';
- if (len > buf_size - i - 10) {
- growBuffer(buf);
+ while (len > buf_size - i - 10) {
+ growBuffer(buf, i + 10);
}
for (;i > 0;i--)
buf[len++] = *cur++;
@@ -3354,8 +3738,8 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
if ((len != 0) || (!normalize)) {
if ((!normalize) || (!in_space)) {
COPY_BUF(l,buf,len,0x20);
- if (len > buf_size - 10) {
- growBuffer(buf);
+ while (len > buf_size - 10) {
+ growBuffer(buf, 10);
}
}
in_space = 1;
@@ -3364,7 +3748,7 @@ xmlParseAttValueComplex(xmlParserCtxtPtr ctxt, int *attlen, int normalize) {
in_space = 0;
COPY_BUF(l,buf,len,c);
if (len > buf_size - 10) {
- growBuffer(buf);
+ growBuffer(buf, 10);
}
}
NEXTL(l);
@@ -3976,8 +4360,10 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf, int len, int size) {
int q, ql;
int r, rl;
int cur, l;
- xmlParserInputPtr input = ctxt->input;
int count = 0;
+ int inputid;
+
+ inputid = ctxt->input->id;
if (buf == NULL) {
len = 0;
@@ -4059,7 +4445,7 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf, int len, int size) {
"xmlParseComment: invalid xmlChar value %d\n",
cur);
} else {
- if (input != ctxt->input) {
+ if (inputid != ctxt->input->id) {
xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
"Comment doesn't start and stop in the same entity\n");
}
@@ -4095,15 +4481,16 @@ xmlParseComment(xmlParserCtxtPtr ctxt) {
xmlParserInputState state;
const xmlChar *in;
int nbchar = 0, ccol;
+ int inputid;
/*
* Check that there is a comment right here.
*/
if ((RAW != '<') || (NXT(1) != '!') ||
(NXT(2) != '-') || (NXT(3) != '-')) return;
-
state = ctxt->instate;
ctxt->instate = XML_PARSER_COMMENT;
+ inputid = ctxt->input->id;
SKIP(4);
SHRINK;
GROW;
@@ -4194,6 +4581,10 @@ get_more:
if (*in == '-') {
if (in[1] == '-') {
if (in[2] == '>') {
+ if (ctxt->input->id != inputid) {
+ xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
+ "comment doesn't start and stop in the same entity\n");
+ }
SKIP(3);
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
(!ctxt->disableSAX)) {
@@ -4267,6 +4658,10 @@ xmlParsePITarget(xmlParserCtxtPtr ctxt) {
"xmlParsePITarget: invalid name prefix 'xml'\n",
NULL, NULL);
}
+ if ((name != NULL) && (xmlStrchr(name, ':') != NULL)) {
+ xmlNsErr(ctxt, XML_NS_ERR_COLON,
+ "colon are forbidden from PI names '%s'\n", name, NULL, NULL);
+ }
return(name);
}
@@ -4510,6 +4905,11 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) {
"Space required after the NOTATION name'\n");
return;
}
+ if (xmlStrchr(name, ':') != NULL) {
+ xmlNsErr(ctxt, XML_NS_ERR_COLON,
+ "colon are forbidden from notation names '%s'\n",
+ name, NULL, NULL);
+ }
SKIP_BLANKS;
/*
@@ -4594,6 +4994,11 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
"xmlParseEntityDecl: no name\n");
return;
}
+ if (xmlStrchr(name, ':') != NULL) {
+ xmlNsErr(ctxt, XML_NS_ERR_COLON,
+ "colon are forbidden from entities names '%s'\n",
+ name, NULL, NULL);
+ }
skipped = SKIP_BLANKS;
if (skipped == 0) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
@@ -4669,6 +5074,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
xmlErrMemory(ctxt, "New Doc failed");
return;
}
+ ctxt->myDoc->properties = XML_DOC_INTERNAL;
}
if (ctxt->myDoc->intSubset == NULL)
ctxt->myDoc->intSubset = xmlNewDtd(ctxt->myDoc,
@@ -4741,6 +5147,7 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
xmlErrMemory(ctxt, "New Doc failed");
return;
}
+ ctxt->myDoc->properties = XML_DOC_INTERNAL;
}
if (ctxt->myDoc->intSubset == NULL)
@@ -4879,7 +5286,7 @@ xmlParseDefaultDecl(xmlParserCtxtPtr ctxt, xmlChar **value) {
xmlEnumerationPtr
xmlParseNotationType(xmlParserCtxtPtr ctxt) {
const xmlChar *name;
- xmlEnumerationPtr ret = NULL, last = NULL, cur;
+ xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
if (RAW != '(') {
xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
@@ -4895,12 +5302,26 @@ xmlParseNotationType(xmlParserCtxtPtr ctxt) {
"Name expected in NOTATION declaration\n");
return(ret);
}
- cur = xmlCreateEnumeration(name);
- if (cur == NULL) return(ret);
- if (last == NULL) ret = last = cur;
- else {
- last->next = cur;
- last = cur;
+ tmp = ret;
+ while (tmp != NULL) {
+ if (xmlStrEqual(name, tmp->name)) {
+ xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
+ "standalone: attribute notation value token %s duplicated\n",
+ name, NULL);
+ if (!xmlDictOwns(ctxt->dict, name))
+ xmlFree((xmlChar *) name);
+ break;
+ }
+ tmp = tmp->next;
+ }
+ if (tmp == NULL) {
+ cur = xmlCreateEnumeration(name);
+ if (cur == NULL) return(ret);
+ if (last == NULL) ret = last = cur;
+ else {
+ last->next = cur;
+ last = cur;
+ }
}
SKIP_BLANKS;
} while (RAW == '|');
@@ -4932,7 +5353,7 @@ xmlParseNotationType(xmlParserCtxtPtr ctxt) {
xmlEnumerationPtr
xmlParseEnumerationType(xmlParserCtxtPtr ctxt) {
xmlChar *name;
- xmlEnumerationPtr ret = NULL, last = NULL, cur;
+ xmlEnumerationPtr ret = NULL, last = NULL, cur, tmp;
if (RAW != '(') {
xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
@@ -4947,13 +5368,28 @@ xmlParseEnumerationType(xmlParserCtxtPtr ctxt) {
xmlFatalErr(ctxt, XML_ERR_NMTOKEN_REQUIRED, NULL);
return(ret);
}
- cur = xmlCreateEnumeration(name);
- xmlFree(name);
- if (cur == NULL) return(ret);
- if (last == NULL) ret = last = cur;
- else {
- last->next = cur;
- last = cur;
+ tmp = ret;
+ while (tmp != NULL) {
+ if (xmlStrEqual(name, tmp->name)) {
+ xmlValidityError(ctxt, XML_DTD_DUP_TOKEN,
+ "standalone: attribute enumeration value token %s duplicated\n",
+ name, NULL);
+ if (!xmlDictOwns(ctxt->dict, name))
+ xmlFree(name);
+ break;
+ }
+ tmp = tmp->next;
+ }
+ if (tmp == NULL) {
+ cur = xmlCreateEnumeration(name);
+ if (!xmlDictOwns(ctxt->dict, name))
+ xmlFree(name);
+ if (cur == NULL) return(ret);
+ if (last == NULL) ret = last = cur;
+ else {
+ last->next = cur;
+ last = cur;
+ }
}
SKIP_BLANKS;
} while (RAW == '|');
@@ -5200,8 +5636,9 @@ xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt) {
}
if (RAW == '>') {
if (input != ctxt->input) {
- xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
- "Attribute list declaration doesn't start and stop in the same entity\n");
+ xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
+ "Attribute list declaration doesn't start and stop in the same entity\n",
+ NULL, NULL);
}
NEXT;
}
@@ -5241,7 +5678,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
if ((ctxt->validate) && (ctxt->input->id != inputchk)) {
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
"Element content declaration doesn't start and stop in the same entity\n",
- NULL);
+ NULL, NULL);
}
NEXT;
ret = xmlNewDocElementContent(ctxt->myDoc, NULL, XML_ELEMENT_CONTENT_PCDATA);
@@ -5299,7 +5736,7 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
if ((ctxt->validate) && (ctxt->input->id != inputchk)) {
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
"Element content declaration doesn't start and stop in the same entity\n",
- NULL);
+ NULL, NULL);
}
SKIP(2);
} else {
@@ -5531,7 +5968,7 @@ xmlParseElementChildrenContentDecl (xmlParserCtxtPtr ctxt, int inputchk) {
if ((ctxt->validate) && (ctxt->input->id != inputchk)) {
xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
"Element content declaration doesn't start and stop in the same entity\n",
- NULL);
+ NULL, NULL);
}
NEXT;
if (RAW == '?') {
@@ -5773,6 +6210,8 @@ xmlParseElementDecl(xmlParserCtxtPtr ctxt) {
static void
xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
+ int id = ctxt->input->id;
+
SKIP(3);
SKIP_BLANKS;
if (CMP7(CUR_PTR, 'I', 'N', 'C', 'L', 'U', 'D', 'E')) {
@@ -5781,6 +6220,11 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
if (RAW != '[') {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
} else {
+ if (ctxt->input->id != id) {
+ xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
+ "All markup of the conditional section is not in the same entity\n",
+ NULL, NULL);
+ }
NEXT;
}
if (xmlParserDebugEntities) {
@@ -5836,6 +6280,11 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
if (RAW != '[') {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_INVALID, NULL);
} else {
+ if (ctxt->input->id != id) {
+ xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
+ "All markup of the conditional section is not in the same entity\n",
+ NULL, NULL);
+ }
NEXT;
}
if (xmlParserDebugEntities) {
@@ -5892,6 +6341,11 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
if (RAW == 0) {
xmlFatalErr(ctxt, XML_ERR_CONDSEC_NOT_FINISHED, NULL);
} else {
+ if (ctxt->input->id != id) {
+ xmlValidityError(ctxt, XML_ERR_ENTITY_BOUNDARY,
+ "All markup of the conditional section is not in the same entity\n",
+ NULL, NULL);
+ }
SKIP(3);
}
}
@@ -5970,12 +6424,10 @@ xmlParseMarkupDecl(xmlParserCtxtPtr ctxt) {
/**
* xmlParseTextDecl:
* @ctxt: an XML parser context
- *
+ *
* parse an XML declaration header for external entities
*
* [77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
- *
- * Question: Seems that EncodingDecl is mandatory ? Is that a typo ?
*/
void
@@ -6086,6 +6538,11 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
}
if (ctxt->myDoc == NULL) {
ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
+ if (ctxt->myDoc == NULL) {
+ xmlErrMemory(ctxt, "New Doc failed");
+ return;
+ }
+ ctxt->myDoc->properties = XML_DOC_INTERNAL;
}
if ((ctxt->myDoc != NULL) && (ctxt->myDoc->intSubset == NULL))
xmlCreateIntSubset(ctxt->myDoc, NULL, ExternalID, SystemID);
@@ -6129,7 +6586,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
/**
* xmlParseReference:
* @ctxt: an XML parser context
- *
+ *
* parse and handle entity references in content, depending on the SAX
* interface, this may end-up in a call to character() if this is a
* CharRef, a predefined entity, if there is no reference() callback.
@@ -6141,14 +6598,23 @@ void
xmlParseReference(xmlParserCtxtPtr ctxt) {
xmlEntityPtr ent;
xmlChar *val;
- if (RAW != '&') return;
+ int was_checked;
+ xmlNodePtr list = NULL;
+ xmlParserErrors ret = XML_ERR_OK;
+
+ if (RAW != '&')
+ return;
+
+ /*
+ * Simple case of a CharRef
+ */
if (NXT(1) == '#') {
int i = 0;
xmlChar out[10];
int hex = NXT(2);
int value = xmlParseCharRef(ctxt);
-
+
if (value == 0)
return;
if (ctxt->charset != XML_CHAR_ENCODING_UTF8) {
@@ -6182,360 +6648,342 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
(!ctxt->disableSAX))
ctxt->sax->characters(ctxt->userData, out, i);
}
- } else {
- int was_checked;
+ return;
+ }
- ent = xmlParseEntityRef(ctxt);
- if (ent == NULL) return;
- if (!ctxt->wellFormed)
- return;
- was_checked = ent->checked;
- if ((ent->name != NULL) &&
- (ent->etype != XML_INTERNAL_PREDEFINED_ENTITY)) {
- xmlNodePtr list = NULL;
- xmlParserErrors ret = XML_ERR_OK;
+ /*
+ * We are seeing an entity reference
+ */
+ ent = xmlParseEntityRef(ctxt);
+ if (ent == NULL) return;
+ if (!ctxt->wellFormed)
+ return;
+ was_checked = ent->checked;
+ /* special case of predefined entities */
+ if ((ent->name == NULL) ||
+ (ent->etype == XML_INTERNAL_PREDEFINED_ENTITY)) {
+ val = ent->content;
+ if (val == NULL) return;
+ /*
+ * inline the entity.
+ */
+ if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
+ (!ctxt->disableSAX))
+ ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
+ return;
+ }
- /*
- * The first reference to the entity trigger a parsing phase
- * where the ent->children is filled with the result from
- * the parsing.
- */
- if (ent->checked == 0) {
- xmlChar *value;
+ /*
+ * The first reference to the entity trigger a parsing phase
+ * where the ent->children is filled with the result from
+ * the parsing.
+ */
+ if (ent->checked == 0) {
+ unsigned long oldnbent = ctxt->nbentities;
- value = ent->content;
+ /*
+ * This is a bit hackish but this seems the best
+ * way to make sure both SAX and DOM entity support
+ * behaves okay.
+ */
+ void *user_data;
+ if (ctxt->userData == ctxt)
+ user_data = NULL;
+ else
+ user_data = ctxt->userData;
- /*
- * Check that this entity is well formed
- */
- if ((value != NULL) && (value[0] != 0) &&
- (value[1] == 0) && (value[0] == '<') &&
- (xmlStrEqual(ent->name, BAD_CAST "lt"))) {
- /*
- * DONE: get definite answer on this !!!
- * Lots of entity decls are used to declare a single
- * char
- * <!ENTITY lt "<">
- * Which seems to be valid since
- * 2.4: The ampersand character (&) and the left angle
- * bracket (<) may appear in their literal form only
- * when used ... They are also legal within the literal
- * entity value of an internal entity declaration;i
- * see "4.3.2 Well-Formed Parsed Entities".
- * IMHO 2.4 and 4.3.2 are directly in contradiction.
- * Looking at the OASIS test suite and James Clark
- * tests, this is broken. However the XML REC uses
- * it. Is the XML REC not well-formed ????
- * This is a hack to avoid this problem
- *
- * ANSWER: since lt gt amp .. are already defined,
- * this is a redefinition and hence the fact that the
- * content is not well balanced is not a Wf error, this
- * is lousy but acceptable.
- */
- list = xmlNewDocText(ctxt->myDoc, value);
- if (list != NULL) {
- if ((ent->etype == XML_INTERNAL_GENERAL_ENTITY) &&
- (ent->children == NULL)) {
- ent->children = list;
- ent->last = list;
- ent->owner = 1;
- list->parent = (xmlNodePtr) ent;
- } else {
- xmlFreeNodeList(list);
- }
- } else if (list != NULL) {
- xmlFreeNodeList(list);
- }
- } else {
- /*
- * 4.3.2: An internal general parsed entity is well-formed
- * if its replacement text matches the production labeled
- * content.
- */
+ /*
+ * Check that this entity is well formed
+ * 4.3.2: An internal general parsed entity is well-formed
+ * if its replacement text matches the production labeled
+ * content.
+ */
+ if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) {
+ ctxt->depth++;
+ ret = xmlParseBalancedChunkMemoryInternal(ctxt, ent->content,
+ user_data, &list);
+ ctxt->depth--;
+
+ } else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
+ ctxt->depth++;
+ ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt, ctxt->sax,
+ user_data, ctxt->depth, ent->URI,
+ ent->ExternalID, &list);
+ ctxt->depth--;
+ } else {
+ ret = XML_ERR_ENTITY_PE_INTERNAL;
+ xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "invalid entity type found\n", NULL);
+ }
+
+ /*
+ * Store the number of entities needing parsing for this entity
+ * content and do checkings
+ */
+ ent->checked = ctxt->nbentities - oldnbent;
+ if (ret == XML_ERR_ENTITY_LOOP) {
+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
+ xmlFreeNodeList(list);
+ return;
+ }
+ if (xmlParserEntityCheck(ctxt, 0, ent)) {
+ xmlFreeNodeList(list);
+ return;
+ }
- void *user_data;
+ if ((ret == XML_ERR_OK) && (list != NULL)) {
+ if (((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
+ (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY))&&
+ (ent->children == NULL)) {
+ ent->children = list;
+ if (ctxt->replaceEntities) {
/*
- * This is a bit hackish but this seems the best
- * way to make sure both SAX and DOM entity support
- * behaves okay.
+ * Prune it directly in the generated document
+ * except for single text nodes.
*/
- if (ctxt->userData == ctxt)
- user_data = NULL;
- else
- user_data = ctxt->userData;
-
- if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) {
- ctxt->depth++;
- ret = xmlParseBalancedChunkMemoryInternal(ctxt,
- value, user_data, &list);
- ctxt->depth--;
- } else if (ent->etype ==
- XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
- ctxt->depth++;
- ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt,
- ctxt->sax, user_data, ctxt->depth,
- ent->URI, ent->ExternalID, &list);
- ctxt->depth--;
+ if (((list->type == XML_TEXT_NODE) &&
+ (list->next == NULL)) ||
+ (ctxt->parseMode == XML_PARSE_READER)) {
+ list->parent = (xmlNodePtr) ent;
+ list = NULL;
+ ent->owner = 1;
} else {
- ret = XML_ERR_ENTITY_PE_INTERNAL;
- xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR,
- "invalid entity type found\n", NULL);
- }
- if (ret == XML_ERR_ENTITY_LOOP) {
- xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
- return;
- } else if ((ret == XML_ERR_OK) && (list != NULL)) {
- if (((ent->etype == XML_INTERNAL_GENERAL_ENTITY) ||
- (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;
+ 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;
- if (list->next == NULL)
- ent->last = list;
- list = list->next;
- }
- }
- } else {
- xmlFreeNodeList(list);
- list = NULL;
- }
- } else if ((ret != XML_ERR_OK) &&
- (ret != XML_WAR_UNDECLARED_ENTITY)) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
- "Entity '%s' failed to parse\n", ent->name);
- } else if (list != NULL) {
- xmlFreeNodeList(list);
- list = NULL;
+ }
+ } else {
+ ent->owner = 1;
+ while (list != NULL) {
+ list->parent = (xmlNodePtr) ent;
+ if (list->next == NULL)
+ ent->last = list;
+ list = list->next;
}
}
- ent->checked = 1;
+ } else {
+ xmlFreeNodeList(list);
+ list = NULL;
}
+ } else if ((ret != XML_ERR_OK) &&
+ (ret != XML_WAR_UNDECLARED_ENTITY)) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
+ "Entity '%s' failed to parse\n", ent->name);
+ } else if (list != NULL) {
+ xmlFreeNodeList(list);
+ list = NULL;
+ }
+ if (ent->checked == 0)
+ ent->checked = 1;
+ } else if (ent->checked != 1) {
+ ctxt->nbentities += ent->checked;
+ }
- if (ent->children == NULL) {
- /*
- * Probably running in SAX mode and the callbacks don't
- * build the entity content. So unless we already went
- * though parsing for first checking go though the entity
- * content to generate callbacks associated to the entity
- */
- if (was_checked == 1) {
- void *user_data;
- /*
- * This is a bit hackish but this seems the best
- * way to make sure both SAX and DOM entity support
- * behaves okay.
- */
- if (ctxt->userData == ctxt)
- user_data = NULL;
- else
- user_data = ctxt->userData;
-
- if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) {
- ctxt->depth++;
- ret = xmlParseBalancedChunkMemoryInternal(ctxt,
- ent->content, user_data, NULL);
- ctxt->depth--;
- } else if (ent->etype ==
- XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
- ctxt->depth++;
- ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt,
- ctxt->sax, user_data, ctxt->depth,
- ent->URI, ent->ExternalID, NULL);
- ctxt->depth--;
- } else {
- ret = XML_ERR_ENTITY_PE_INTERNAL;
- xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR,
- "invalid entity type found\n", NULL);
- }
- if (ret == XML_ERR_ENTITY_LOOP) {
- xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
- return;
- }
- }
- if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
- (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) {
- /*
- * Entity reference callback comes second, it's somewhat
- * superfluous but a compatibility to historical behaviour
- */
- ctxt->sax->reference(ctxt->userData, ent->name);
- }
- return;
+ /*
+ * Now that the entity content has been gathered
+ * provide it to the application, this can take different forms based
+ * on the parsing modes.
+ */
+ if (ent->children == NULL) {
+ /*
+ * Probably running in SAX mode and the callbacks don't
+ * build the entity content. So unless we already went
+ * though parsing for first checking go though the entity
+ * content to generate callbacks associated to the entity
+ */
+ if (was_checked != 0) {
+ void *user_data;
+ /*
+ * This is a bit hackish but this seems the best
+ * way to make sure both SAX and DOM entity support
+ * behaves okay.
+ */
+ if (ctxt->userData == ctxt)
+ user_data = NULL;
+ else
+ user_data = ctxt->userData;
+
+ if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) {
+ ctxt->depth++;
+ ret = xmlParseBalancedChunkMemoryInternal(ctxt,
+ ent->content, user_data, NULL);
+ ctxt->depth--;
+ } else if (ent->etype ==
+ XML_EXTERNAL_GENERAL_PARSED_ENTITY) {
+ ctxt->depth++;
+ ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt,
+ ctxt->sax, user_data, ctxt->depth,
+ ent->URI, ent->ExternalID, NULL);
+ ctxt->depth--;
+ } else {
+ ret = XML_ERR_ENTITY_PE_INTERNAL;
+ xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR,
+ "invalid entity type found\n", NULL);
}
- if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
- (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) {
- /*
- * Create a node.
- */
- ctxt->sax->reference(ctxt->userData, ent->name);
+ if (ret == XML_ERR_ENTITY_LOOP) {
+ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL);
return;
}
- if ((ctxt->replaceEntities) || (ent->children == NULL)) {
+ }
+ if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
+ (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) {
+ /*
+ * Entity reference callback comes second, it's somewhat
+ * superfluous but a compatibility to historical behaviour
+ */
+ ctxt->sax->reference(ctxt->userData, ent->name);
+ }
+ return;
+ }
+
+ /*
+ * If we didn't get any children for the entity being built
+ */
+ if ((ctxt->sax != NULL) && (ctxt->sax->reference != NULL) &&
+ (ctxt->replaceEntities == 0) && (!ctxt->disableSAX)) {
+ /*
+ * Create a node.
+ */
+ ctxt->sax->reference(ctxt->userData, ent->name);
+ return;
+ }
+
+ if ((ctxt->replaceEntities) || (ent->children == NULL)) {
+ /*
+ * There is a problem on the handling of _private for entities
+ * (bug 155816): Should we copy the content of the field from
+ * the entity (possibly overwriting some value set by the user
+ * when a copy is created), should we leave it alone, or should
+ * we try to take care of different situations? The problem
+ * is exacerbated by the usage of this field by the xmlReader.
+ * To fix this bug, we look at _private on the created node
+ * and, if it's NULL, we copy in whatever was in the entity.
+ * If it's not NULL we leave it alone. This is somewhat of a
+ * hack - maybe we should have further tests to determine
+ * what to do.
+ */
+ if ((ctxt->node != NULL) && (ent->children != NULL)) {
+ /*
+ * Seems we are generating the DOM content, do
+ * a simple tree copy for all references except the first
+ * In the first occurrence list contains the replacement.
+ * progressive == 2 means we are operating on the Reader
+ * and since nodes are discarded we must copy all the time.
+ */
+ if (((list == NULL) && (ent->owner == 0)) ||
+ (ctxt->parseMode == XML_PARSE_READER)) {
+ xmlNodePtr nw = NULL, cur, firstChild = NULL;
+
/*
- * There is a problem on the handling of _private for entities
- * (bug 155816): Should we copy the content of the field from
- * the entity (possibly overwriting some value set by the user
- * when a copy is created), should we leave it alone, or should
- * we try to take care of different situations? The problem
- * is exacerbated by the usage of this field by the xmlReader.
- * To fix this bug, we look at _private on the created node
- * and, if it's NULL, we copy in whatever was in the entity.
- * If it's not NULL we leave it alone. This is somewhat of a
- * hack - maybe we should have further tests to determine
- * what to do.
+ * when operating on a reader, the entities definitions
+ * are always owning the entities subtree.
+ if (ctxt->parseMode == XML_PARSE_READER)
+ ent->owner = 1;
*/
- if ((ctxt->node != NULL) && (ent->children != NULL)) {
- /*
- * Seems we are generating the DOM content, do
- * a simple tree copy for all references except the first
- * In the first occurrence list contains the replacement.
- * progressive == 2 means we are operating on the Reader
- * and since nodes are discarded we must copy all the time.
- */
- if (((list == NULL) && (ent->owner == 0)) ||
- (ctxt->parseMode == XML_PARSE_READER)) {
- xmlNodePtr nw = NULL, cur, firstChild = NULL;
+ cur = ent->children;
+ while (cur != NULL) {
+ nw = xmlDocCopyNode(cur, ctxt->myDoc, 1);
+ if (nw != NULL) {
+ if (nw->_private == NULL)
+ nw->_private = cur->_private;
+ if (firstChild == NULL){
+ firstChild = nw;
+ }
+ nw = xmlAddChild(ctxt->node, nw);
+ }
+ if (cur == ent->last) {
/*
- * when operating on a reader, the entities definitions
- * are always owning the entities subtree.
- if (ctxt->parseMode == XML_PARSE_READER)
- ent->owner = 1;
+ * needed to detect some strange empty
+ * node cases in the reader tests
*/
+ if ((ctxt->parseMode == XML_PARSE_READER) &&
+ (nw != NULL) &&
+ (nw->type == XML_ELEMENT_NODE) &&
+ (nw->children == NULL))
+ nw->extra = 1;
- cur = ent->children;
- while (cur != NULL) {
- nw = xmlDocCopyNode(cur, ctxt->myDoc, 1);
- if (nw != NULL) {
- if (nw->_private == NULL)
- nw->_private = cur->_private;
- if (firstChild == NULL){
- firstChild = nw;
- }
- nw = xmlAddChild(ctxt->node, nw);
- }
- if (cur == ent->last) {
- /*
- * needed to detect some strange empty
- * node cases in the reader tests
- */
- if ((ctxt->parseMode == XML_PARSE_READER) &&
- (nw != NULL) &&
- (nw->type == XML_ELEMENT_NODE) &&
- (nw->children == NULL))
- nw->extra = 1;
-
- break;
- }
- cur = cur->next;
- }
+ break;
+ }
+ cur = cur->next;
+ }
#ifdef LIBXML_LEGACY_ENABLED
- if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
- xmlAddEntityReference(ent, firstChild, nw);
+ if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
+ xmlAddEntityReference(ent, firstChild, nw);
#endif /* LIBXML_LEGACY_ENABLED */
- } else if (list == NULL) {
- xmlNodePtr nw = NULL, cur, next, last,
- firstChild = NULL;
- /*
- * Copy the entity child list and make it the new
- * entity child list. The goal is to make sure any
- * ID or REF referenced will be the one from the
- * document content and not the entity copy.
- */
- cur = ent->children;
- ent->children = NULL;
- last = ent->last;
- ent->last = NULL;
- while (cur != NULL) {
- next = cur->next;
- cur->next = NULL;
- cur->parent = NULL;
- nw = xmlDocCopyNode(cur, ctxt->myDoc, 1);
- if (nw != NULL) {
- if (nw->_private == NULL)
- nw->_private = cur->_private;
- if (firstChild == NULL){
- firstChild = cur;
- }
- xmlAddChild((xmlNodePtr) ent, nw);
- xmlAddChild(ctxt->node, cur);
- }
- if (cur == last)
- break;
- cur = next;
+ } else if (list == NULL) {
+ xmlNodePtr nw = NULL, cur, next, last,
+ firstChild = NULL;
+ /*
+ * Copy the entity child list and make it the new
+ * entity child list. The goal is to make sure any
+ * ID or REF referenced will be the one from the
+ * document content and not the entity copy.
+ */
+ cur = ent->children;
+ ent->children = NULL;
+ last = ent->last;
+ ent->last = NULL;
+ while (cur != NULL) {
+ next = cur->next;
+ cur->next = NULL;
+ cur->parent = NULL;
+ nw = xmlDocCopyNode(cur, ctxt->myDoc, 1);
+ if (nw != NULL) {
+ if (nw->_private == NULL)
+ nw->_private = cur->_private;
+ if (firstChild == NULL){
+ firstChild = cur;
}
- ent->owner = 1;
+ xmlAddChild((xmlNodePtr) ent, nw);
+ xmlAddChild(ctxt->node, cur);
+ }
+ if (cur == last)
+ break;
+ cur = next;
+ }
+ if (ent->owner == 0)
+ ent->owner = 1;
#ifdef LIBXML_LEGACY_ENABLED
- if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
- xmlAddEntityReference(ent, firstChild, nw);
+ if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)
+ xmlAddEntityReference(ent, firstChild, nw);
#endif /* LIBXML_LEGACY_ENABLED */
- } else {
- const xmlChar *nbktext;
-
- /*
- * the name change is to avoid coalescing of the
- * node with a possible previous text one which
- * would make ent->children a dangling pointer
- */
- nbktext = xmlDictLookup(ctxt->dict, BAD_CAST "nbktext",
- -1);
- if (ent->children->type == XML_TEXT_NODE)
- ent->children->name = nbktext;
- if ((ent->last != ent->children) &&
- (ent->last->type == XML_TEXT_NODE))
- ent->last->name = nbktext;
- xmlAddChildList(ctxt->node, ent->children);
- }
+ } else {
+ const xmlChar *nbktext;
- /*
- * This is to avoid a nasty side effect, see
- * characters() in SAX.c
- */
- ctxt->nodemem = 0;
- ctxt->nodelen = 0;
- return;
- }
+ /*
+ * the name change is to avoid coalescing of the
+ * node with a possible previous text one which
+ * would make ent->children a dangling pointer
+ */
+ nbktext = xmlDictLookup(ctxt->dict, BAD_CAST "nbktext",
+ -1);
+ if (ent->children->type == XML_TEXT_NODE)
+ ent->children->name = nbktext;
+ if ((ent->last != ent->children) &&
+ (ent->last->type == XML_TEXT_NODE))
+ ent->last->name = nbktext;
+ xmlAddChildList(ctxt->node, ent->children);
}
- } else {
- val = ent->content;
- if (val == NULL) return;
+
/*
- * inline the entity.
+ * This is to avoid a nasty side effect, see
+ * characters() in SAX.c
*/
- if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL) &&
- (!ctxt->disableSAX))
- ctxt->sax->characters(ctxt->userData, val, xmlStrlen(val));
+ ctxt->nodemem = 0;
+ ctxt->nodelen = 0;
+ return;
}
}
}
@@ -6574,132 +7022,140 @@ xmlParseEntityRef(xmlParserCtxtPtr ctxt) {
xmlEntityPtr ent = NULL;
GROW;
-
- if (RAW == '&') {
- NEXT;
- name = xmlParseName(ctxt);
- if (name == NULL) {
- xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
- "xmlParseEntityRef: no name\n");
- } else {
- if (RAW == ';') {
- NEXT;
- /*
- * Ask first SAX for entity resolution, otherwise try the
- * predefined set.
- */
- if (ctxt->sax != NULL) {
- if (ctxt->sax->getEntity != NULL)
- ent = ctxt->sax->getEntity(ctxt->userData, name);
- if ((ctxt->wellFormed == 1 ) && (ent == NULL))
- ent = xmlGetPredefinedEntity(name);
- if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
- (ctxt->userData==ctxt)) {
- ent = xmlSAX2GetEntity(ctxt, name);
- }
- }
- /*
- * [ WFC: Entity Declared ]
- * In a document without any DTD, a document with only an
- * internal DTD subset which contains no parameter entity
- * references, or a document with "standalone='yes'", the
- * Name given in the entity reference must match that in an
- * entity declaration, except that well-formed documents
- * need not declare any of the following entities: amp, lt,
- * gt, apos, quot.
- * The declaration of a parameter entity must precede any
- * reference to it.
- * Similarly, the declaration of a general entity must
- * precede any reference to it which appears in a default
- * value in an attribute-list declaration. Note that if
- * entities are declared in the external subset or in
- * external parameter entities, a non-validating processor
- * is not obligated to read and process their declarations;
- * for such documents, the rule that an entity must be
- * declared is a well-formedness constraint only if
- * standalone='yes'.
- */
- if (ent == NULL) {
- if ((ctxt->standalone == 1) ||
- ((ctxt->hasExternalSubset == 0) &&
- (ctxt->hasPErefs == 0))) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
- "Entity '%s' not defined\n", name);
- } else {
- xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
- "Entity '%s' not defined\n", name);
- if ((ctxt->inSubset == 0) &&
- (ctxt->sax != NULL) &&
- (ctxt->sax->reference != NULL)) {
- ctxt->sax->reference(ctxt->userData, name);
- }
- }
- ctxt->valid = 0;
- }
- /*
- * [ WFC: Parsed Entity ]
- * An entity reference must not contain the name of an
- * unparsed entity
- */
- else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
- "Entity reference to unparsed entity %s\n", name);
- }
-
- /*
- * [ WFC: No External Entity References ]
- * Attribute values cannot contain direct or indirect
- * entity references to external entities.
- */
- else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
- (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
- "Attribute references external entity '%s'\n", name);
- }
- /*
- * [ WFC: No < in Attribute Values ]
- * The replacement text of any entity referred to directly or
- * indirectly in an attribute value (other than "&lt;") must
- * not contain a <.
- */
- else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
- (ent != NULL) &&
- (!xmlStrEqual(ent->name, BAD_CAST "lt")) &&
- (ent->content != NULL) &&
- (xmlStrchr(ent->content, '<'))) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
- "'<' in entity '%s' is not allowed in attributes values\n", name);
- }
+ if (RAW != '&')
+ return(NULL);
+ NEXT;
+ name = xmlParseName(ctxt);
+ if (name == NULL) {
+ xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
+ "xmlParseEntityRef: no name\n");
+ return(NULL);
+ }
+ if (RAW != ';') {
+ xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
+ return(NULL);
+ }
+ NEXT;
- /*
- * Internal check, no parameter entities here ...
- */
- else {
- switch (ent->etype) {
- case XML_INTERNAL_PARAMETER_ENTITY:
- case XML_EXTERNAL_PARAMETER_ENTITY:
- xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_PARAMETER,
- "Attempt to reference the parameter entity '%s'\n",
- name);
- break;
- default:
- break;
- }
- }
+ /*
+ * Predefined entites override any extra definition
+ */
+ ent = xmlGetPredefinedEntity(name);
+ if (ent != NULL)
+ return(ent);
- /*
- * [ WFC: No Recursion ]
- * A parsed entity must not contain a recursive reference
- * to itself, either directly or indirectly.
- * Done somewhere else
- */
+ /*
+ * Increate the number of entity references parsed
+ */
+ ctxt->nbentities++;
- } else {
- xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
+ /*
+ * Ask first SAX for entity resolution, otherwise try the
+ * entities which may have stored in the parser context.
+ */
+ if (ctxt->sax != NULL) {
+ if (ctxt->sax->getEntity != NULL)
+ ent = ctxt->sax->getEntity(ctxt->userData, name);
+ if ((ctxt->wellFormed == 1 ) && (ent == NULL) &&
+ (ctxt->userData==ctxt)) {
+ ent = xmlSAX2GetEntity(ctxt, name);
+ }
+ }
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", the
+ * Name given in the entity reference must match that in an
+ * entity declaration, except that well-formed documents
+ * need not declare any of the following entities: amp, lt,
+ * gt, apos, quot.
+ * The declaration of a parameter entity must precede any
+ * reference to it.
+ * Similarly, the declaration of a general entity must
+ * precede any reference to it which appears in a default
+ * value in an attribute-list declaration. Note that if
+ * entities are declared in the external subset or in
+ * external parameter entities, a non-validating processor
+ * is not obligated to read and process their declarations;
+ * for such documents, the rule that an entity must be
+ * declared is a well-formedness constraint only if
+ * standalone='yes'.
+ */
+ if (ent == NULL) {
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
+ "Entity '%s' not defined\n", name);
+ } else {
+ xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
+ "Entity '%s' not defined\n", name);
+ if ((ctxt->inSubset == 0) &&
+ (ctxt->sax != NULL) &&
+ (ctxt->sax->reference != NULL)) {
+ ctxt->sax->reference(ctxt->userData, name);
}
}
+ ctxt->valid = 0;
+ }
+
+ /*
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an
+ * unparsed entity
+ */
+ else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
+ "Entity reference to unparsed entity %s\n", name);
+ }
+
+ /*
+ * [ WFC: No External Entity References ]
+ * Attribute values cannot contain direct or indirect
+ * entity references to external entities.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
+ "Attribute references external entity '%s'\n", name);
+ }
+ /*
+ * [ WFC: No < in Attribute Values ]
+ * The replacement text of any entity referred to directly or
+ * indirectly in an attribute value (other than "&lt;") must
+ * not contain a <.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent != NULL) && (ent->content != NULL) &&
+ (xmlStrchr(ent->content, '<'))) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
+ "'<' in entity '%s' is not allowed in attributes values\n", name);
+ }
+
+ /*
+ * Internal check, no parameter entities here ...
+ */
+ else {
+ switch (ent->etype) {
+ case XML_INTERNAL_PARAMETER_ENTITY:
+ case XML_EXTERNAL_PARAMETER_ENTITY:
+ xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_PARAMETER,
+ "Attempt to reference the parameter entity '%s'\n",
+ name);
+ break;
+ default:
+ break;
+ }
}
+
+ /*
+ * [ WFC: No Recursion ]
+ * A parsed entity must not contain a recursive reference
+ * to itself, either directly or indirectly.
+ * Done somewhere else
+ */
return(ent);
}
@@ -6745,129 +7201,143 @@ xmlParseStringEntityRef(xmlParserCtxtPtr ctxt, const xmlChar ** str) {
return(NULL);
ptr = *str;
cur = *ptr;
- if (cur == '&') {
- ptr++;
- cur = *ptr;
- name = xmlParseStringName(ctxt, &ptr);
- if (name == NULL) {
- xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
- "xmlParseStringEntityRef: no name\n");
- } else {
- if (*ptr == ';') {
- ptr++;
- /*
- * Ask first SAX for entity resolution, otherwise try the
- * predefined set.
- */
- if (ctxt->sax != NULL) {
- if (ctxt->sax->getEntity != NULL)
- ent = ctxt->sax->getEntity(ctxt->userData, name);
- if (ent == NULL)
- ent = xmlGetPredefinedEntity(name);
- if ((ent == NULL) && (ctxt->userData==ctxt)) {
- ent = xmlSAX2GetEntity(ctxt, name);
- }
- }
- /*
- * [ WFC: Entity Declared ]
- * In a document without any DTD, a document with only an
- * internal DTD subset which contains no parameter entity
- * references, or a document with "standalone='yes'", the
- * Name given in the entity reference must match that in an
- * entity declaration, except that well-formed documents
- * need not declare any of the following entities: amp, lt,
- * gt, apos, quot.
- * The declaration of a parameter entity must precede any
- * reference to it.
- * Similarly, the declaration of a general entity must
- * precede any reference to it which appears in a default
- * value in an attribute-list declaration. Note that if
- * entities are declared in the external subset or in
- * external parameter entities, a non-validating processor
- * is not obligated to read and process their declarations;
- * for such documents, the rule that an entity must be
- * declared is a well-formedness constraint only if
- * standalone='yes'.
- */
- if (ent == NULL) {
- if ((ctxt->standalone == 1) ||
- ((ctxt->hasExternalSubset == 0) &&
- (ctxt->hasPErefs == 0))) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
- "Entity '%s' not defined\n", name);
- } else {
- xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
- "Entity '%s' not defined\n",
- name);
- }
- /* TODO ? check regressions ctxt->valid = 0; */
- }
+ if (cur != '&')
+ return(NULL);
- /*
- * [ WFC: Parsed Entity ]
- * An entity reference must not contain the name of an
- * unparsed entity
- */
- else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
- "Entity reference to unparsed entity %s\n", name);
- }
+ ptr++;
+ cur = *ptr;
+ name = xmlParseStringName(ctxt, &ptr);
+ if (name == NULL) {
+ xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
+ "xmlParseStringEntityRef: no name\n");
+ *str = ptr;
+ return(NULL);
+ }
+ if (*ptr != ';') {
+ xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
+ *str = ptr;
+ return(NULL);
+ }
+ ptr++;
- /*
- * [ WFC: No External Entity References ]
- * Attribute values cannot contain direct or indirect
- * entity references to external entities.
- */
- else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
- (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
- "Attribute references external entity '%s'\n", name);
- }
- /*
- * [ WFC: No < in Attribute Values ]
- * The replacement text of any entity referred to directly or
- * indirectly in an attribute value (other than "&lt;") must
- * not contain a <.
- */
- else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
- (ent != NULL) &&
- (!xmlStrEqual(ent->name, BAD_CAST "lt")) &&
- (ent->content != NULL) &&
- (xmlStrchr(ent->content, '<'))) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
- "'<' in entity '%s' is not allowed in attributes values\n",
- name);
- }
- /*
- * Internal check, no parameter entities here ...
- */
- else {
- switch (ent->etype) {
- case XML_INTERNAL_PARAMETER_ENTITY:
- case XML_EXTERNAL_PARAMETER_ENTITY:
- xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_PARAMETER,
- "Attempt to reference the parameter entity '%s'\n",
- name);
- break;
- default:
- break;
- }
- }
+ /*
+ * Predefined entites override any extra definition
+ */
+ ent = xmlGetPredefinedEntity(name);
+ if (ent != NULL)
+ return(ent);
- /*
- * [ WFC: No Recursion ]
- * A parsed entity must not contain a recursive reference
- * to itself, either directly or indirectly.
- * Done somewhere else
- */
+ /*
+ * Increate the number of entity references parsed
+ */
+ ctxt->nbentities++;
- } else {
- xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
- }
- xmlFree(name);
+ /*
+ * Ask first SAX for entity resolution, otherwise try the
+ * entities which may have stored in the parser context.
+ */
+ if (ctxt->sax != NULL) {
+ if (ctxt->sax->getEntity != NULL)
+ ent = ctxt->sax->getEntity(ctxt->userData, name);
+ if ((ent == NULL) && (ctxt->userData==ctxt)) {
+ ent = xmlSAX2GetEntity(ctxt, name);
+ }
+ }
+
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", the
+ * Name given in the entity reference must match that in an
+ * entity declaration, except that well-formed documents
+ * need not declare any of the following entities: amp, lt,
+ * gt, apos, quot.
+ * The declaration of a parameter entity must precede any
+ * reference to it.
+ * Similarly, the declaration of a general entity must
+ * precede any reference to it which appears in a default
+ * value in an attribute-list declaration. Note that if
+ * entities are declared in the external subset or in
+ * external parameter entities, a non-validating processor
+ * is not obligated to read and process their declarations;
+ * for such documents, the rule that an entity must be
+ * declared is a well-formedness constraint only if
+ * standalone='yes'.
+ */
+ if (ent == NULL) {
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
+ "Entity '%s' not defined\n", name);
+ } else {
+ xmlErrMsgStr(ctxt, XML_WAR_UNDECLARED_ENTITY,
+ "Entity '%s' not defined\n",
+ name);
}
+ /* TODO ? check regressions ctxt->valid = 0; */
+ }
+
+ /*
+ * [ WFC: Parsed Entity ]
+ * An entity reference must not contain the name of an
+ * unparsed entity
+ */
+ else if (ent->etype == XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNPARSED_ENTITY,
+ "Entity reference to unparsed entity %s\n", name);
}
+
+ /*
+ * [ WFC: No External Entity References ]
+ * Attribute values cannot contain direct or indirect
+ * entity references to external entities.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY)) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_EXTERNAL,
+ "Attribute references external entity '%s'\n", name);
+ }
+ /*
+ * [ WFC: No < in Attribute Values ]
+ * The replacement text of any entity referred to directly or
+ * indirectly in an attribute value (other than "&lt;") must
+ * not contain a <.
+ */
+ else if ((ctxt->instate == XML_PARSER_ATTRIBUTE_VALUE) &&
+ (ent != NULL) && (ent->content != NULL) &&
+ (xmlStrchr(ent->content, '<'))) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_LT_IN_ATTRIBUTE,
+ "'<' in entity '%s' is not allowed in attributes values\n",
+ name);
+ }
+
+ /*
+ * Internal check, no parameter entities here ...
+ */
+ else {
+ switch (ent->etype) {
+ case XML_INTERNAL_PARAMETER_ENTITY:
+ case XML_EXTERNAL_PARAMETER_ENTITY:
+ xmlFatalErrMsgStr(ctxt, XML_ERR_ENTITY_IS_PARAMETER,
+ "Attempt to reference the parameter entity '%s'\n",
+ name);
+ break;
+ default:
+ break;
+ }
+ }
+
+ /*
+ * [ WFC: No Recursion ]
+ * A parsed entity must not contain a recursive reference
+ * to itself, either directly or indirectly.
+ * Done somewhere else
+ */
+
+ xmlFree(name);
*str = ptr;
return(ent);
}
@@ -6908,90 +7378,101 @@ xmlParsePEReference(xmlParserCtxtPtr ctxt)
xmlEntityPtr entity = NULL;
xmlParserInputPtr input;
- if (RAW == '%') {
- NEXT;
- name = xmlParseName(ctxt);
- if (name == NULL) {
- xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
- "xmlParsePEReference: no name\n");
- } else {
- if (RAW == ';') {
- NEXT;
- if ((ctxt->sax != NULL) &&
- (ctxt->sax->getParameterEntity != NULL))
- entity = ctxt->sax->getParameterEntity(ctxt->userData,
- name);
- if (entity == NULL) {
- /*
- * [ WFC: Entity Declared ]
- * In a document without any DTD, a document with only an
- * internal DTD subset which contains no parameter entity
- * references, or a document with "standalone='yes'", ...
- * ... The declaration of a parameter entity must precede
- * any reference to it...
- */
- if ((ctxt->standalone == 1) ||
- ((ctxt->hasExternalSubset == 0) &&
- (ctxt->hasPErefs == 0))) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
- "PEReference: %%%s; not found\n",
- name);
- } else {
- /*
- * [ VC: Entity Declared ]
- * In a document with an external subset or external
- * parameter entities with "standalone='no'", ...
- * ... The declaration of a parameter entity must
- * precede any reference to it...
- */
- xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
- "PEReference: %%%s; not found\n",
- name, NULL);
- ctxt->valid = 0;
- }
- } else {
- /*
- * Internal checking in case the entity quest barfed
- */
- if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
- (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
- xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
- "Internal: %%%s; is not a parameter entity\n",
- name, NULL);
- } else if (ctxt->input->free != deallocblankswrapper) {
- input =
- xmlNewBlanksWrapperInputStream(ctxt, entity);
- xmlPushInput(ctxt, input);
- } else {
- /*
- * TODO !!!
- * handle the extra spaces added before and after
- * c.f. http://www.w3.org/TR/REC-xml#as-PE
- */
- input = xmlNewEntityInputStream(ctxt, entity);
- xmlPushInput(ctxt, input);
- if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
- (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
- (IS_BLANK_CH(NXT(5)))) {
- xmlParseTextDecl(ctxt);
- if (ctxt->errNo ==
- XML_ERR_UNSUPPORTED_ENCODING) {
- /*
- * The XML REC instructs us to stop parsing
- * right here
- */
- ctxt->instate = XML_PARSER_EOF;
- return;
- }
- }
- }
- }
- ctxt->hasPErefs = 1;
- } else {
- xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
- }
- }
+ if (RAW != '%')
+ return;
+ NEXT;
+ name = xmlParseName(ctxt);
+ if (name == NULL) {
+ xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
+ "xmlParsePEReference: no name\n");
+ return;
+ }
+ if (RAW != ';') {
+ xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
+ return;
+ }
+
+ NEXT;
+
+ /*
+ * Increate the number of entity references parsed
+ */
+ ctxt->nbentities++;
+
+ /*
+ * Request the entity from SAX
+ */
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->getParameterEntity != NULL))
+ entity = ctxt->sax->getParameterEntity(ctxt->userData,
+ name);
+ if (entity == NULL) {
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) &&
+ (ctxt->hasPErefs == 0))) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
+ "PEReference: %%%s; not found\n",
+ name);
+ } else {
+ /*
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external
+ * parameter entities with "standalone='no'", ...
+ * ... The declaration of a parameter entity must
+ * precede any reference to it...
+ */
+ xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
+ "PEReference: %%%s; not found\n",
+ name, NULL);
+ ctxt->valid = 0;
+ }
+ } else {
+ /*
+ * Internal checking in case the entity quest barfed
+ */
+ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
+ xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
+ "Internal: %%%s; is not a parameter entity\n",
+ name, NULL);
+ } else if (ctxt->input->free != deallocblankswrapper) {
+ input = xmlNewBlanksWrapperInputStream(ctxt, entity);
+ if (xmlPushInput(ctxt, input) < 0)
+ return;
+ } else {
+ /*
+ * TODO !!!
+ * handle the extra spaces added before and after
+ * c.f. http://www.w3.org/TR/REC-xml#as-PE
+ */
+ input = xmlNewEntityInputStream(ctxt, entity);
+ if (xmlPushInput(ctxt, input) < 0)
+ return;
+ if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
+ (CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) &&
+ (IS_BLANK_CH(NXT(5)))) {
+ xmlParseTextDecl(ctxt);
+ if (ctxt->errNo ==
+ XML_ERR_UNSUPPORTED_ENCODING) {
+ /*
+ * The XML REC instructs us to stop parsing
+ * right here
+ */
+ ctxt->instate = XML_PARSER_EOF;
+ return;
+ }
+ }
+ }
}
+ ctxt->hasPErefs = 1;
}
/**
@@ -7044,7 +7525,11 @@ xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
* Push the entity as the current input, read char by char
* saving to the buffer until the end of the entity or an error
*/
- xmlPushInput(ctxt, input);
+ if (xmlPushInput(ctxt, input) < 0) {
+ xmlBufferFree(buf);
+ return(-1);
+ }
+
GROW;
c = CUR_CHAR(l);
while ((ctxt->input == input) && (ctxt->input->cur < ctxt->input->end) &&
@@ -7115,67 +7600,77 @@ xmlParseStringPEReference(xmlParserCtxtPtr ctxt, const xmlChar **str) {
if ((str == NULL) || (*str == NULL)) return(NULL);
ptr = *str;
cur = *ptr;
- if (cur == '%') {
- ptr++;
- cur = *ptr;
- name = xmlParseStringName(ctxt, &ptr);
- if (name == NULL) {
- xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
- "xmlParseStringPEReference: no name\n");
+ if (cur != '%')
+ return(NULL);
+ ptr++;
+ cur = *ptr;
+ name = xmlParseStringName(ctxt, &ptr);
+ if (name == NULL) {
+ xmlFatalErrMsg(ctxt, XML_ERR_NAME_REQUIRED,
+ "xmlParseStringPEReference: no name\n");
+ *str = ptr;
+ return(NULL);
+ }
+ cur = *ptr;
+ if (cur != ';') {
+ xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
+ xmlFree(name);
+ *str = ptr;
+ return(NULL);
+ }
+ ptr++;
+
+ /*
+ * Increate the number of entity references parsed
+ */
+ ctxt->nbentities++;
+
+ /*
+ * Request the entity from SAX
+ */
+ if ((ctxt->sax != NULL) &&
+ (ctxt->sax->getParameterEntity != NULL))
+ entity = ctxt->sax->getParameterEntity(ctxt->userData,
+ name);
+ if (entity == NULL) {
+ /*
+ * [ WFC: Entity Declared ]
+ * In a document without any DTD, a document with only an
+ * internal DTD subset which contains no parameter entity
+ * references, or a document with "standalone='yes'", ...
+ * ... The declaration of a parameter entity must precede
+ * any reference to it...
+ */
+ if ((ctxt->standalone == 1) ||
+ ((ctxt->hasExternalSubset == 0) && (ctxt->hasPErefs == 0))) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
+ "PEReference: %%%s; not found\n", name);
} else {
- cur = *ptr;
- if (cur == ';') {
- ptr++;
- cur = *ptr;
- if ((ctxt->sax != NULL) &&
- (ctxt->sax->getParameterEntity != NULL))
- entity = ctxt->sax->getParameterEntity(ctxt->userData,
- name);
- if (entity == NULL) {
- /*
- * [ WFC: Entity Declared ]
- * In a document without any DTD, a document with only an
- * internal DTD subset which contains no parameter entity
- * references, or a document with "standalone='yes'", ...
- * ... The declaration of a parameter entity must precede
- * any reference to it...
- */
- if ((ctxt->standalone == 1) ||
- ((ctxt->hasExternalSubset == 0) &&
- (ctxt->hasPErefs == 0))) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
- "PEReference: %%%s; not found\n", name);
- } else {
- /*
- * [ VC: Entity Declared ]
- * In a document with an external subset or external
- * parameter entities with "standalone='no'", ...
- * ... The declaration of a parameter entity must
- * precede any reference to it...
- */
- xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
- "PEReference: %%%s; not found\n",
- name, NULL);
- ctxt->valid = 0;
- }
- } else {
- /*
- * Internal checking in case the entity quest barfed
- */
- if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
- (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
- xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
- "%%%s; is not a parameter entity\n",
- name, NULL);
- }
- }
- ctxt->hasPErefs = 1;
- } else {
- xmlFatalErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING, NULL);
- }
- xmlFree(name);
+ /*
+ * [ VC: Entity Declared ]
+ * In a document with an external subset or external
+ * parameter entities with "standalone='no'", ...
+ * ... The declaration of a parameter entity must
+ * precede any reference to it...
+ */
+ xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
+ "PEReference: %%%s; not found\n",
+ name, NULL);
+ ctxt->valid = 0;
+ }
+ } else {
+ /*
+ * Internal checking in case the entity quest barfed
+ */
+ if ((entity->etype != XML_INTERNAL_PARAMETER_ENTITY) &&
+ (entity->etype != XML_EXTERNAL_PARAMETER_ENTITY)) {
+ xmlWarningMsg(ctxt, XML_WAR_UNDECLARED_ENTITY,
+ "%%%s; is not a parameter entity\n",
+ name, NULL);
}
}
+ ctxt->hasPErefs = 1;
+ xmlFree(name);
*str = ptr;
return(entity);
}
@@ -7652,38 +8147,6 @@ xmlParseEndTag(xmlParserCtxtPtr ctxt) {
* *
************************************************************************/
-static const xmlChar *
-xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
- int len = 0, l;
- int c;
- int count = 0;
-
- /*
- * Handler for more complex cases
- */
- GROW;
- c = CUR_CHAR(l);
- if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
- (!IS_LETTER(c) && (c != '_'))) {
- return(NULL);
- }
-
- while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
- ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
- (c == '.') || (c == '-') || (c == '_') ||
- (IS_COMBINING(c)) ||
- (IS_EXTENDER(c)))) {
- if (count++ > 100) {
- count = 0;
- GROW;
- }
- len += l;
- NEXTL(l);
- c = CUR_CHAR(l);
- }
- return(xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len));
-}
-
/*
* xmlGetNamespace:
* @ctxt: an XML parser context
@@ -7709,56 +8172,6 @@ xmlGetNamespace(xmlParserCtxtPtr ctxt, const xmlChar *prefix) {
}
/**
- * xmlParseNCName:
- * @ctxt: an XML parser context
- * @len: lenght of the string parsed
- *
- * parse an XML name.
- *
- * [4NS] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
- * CombiningChar | Extender
- *
- * [5NS] NCName ::= (Letter | '_') (NCNameChar)*
- *
- * Returns the Name parsed or NULL
- */
-
-static const xmlChar *
-xmlParseNCName(xmlParserCtxtPtr ctxt) {
- const xmlChar *in;
- const xmlChar *ret;
- int count = 0;
-
- /*
- * Accelerator for simple ASCII names
- */
- in = ctxt->input->cur;
- if (((*in >= 0x61) && (*in <= 0x7A)) ||
- ((*in >= 0x41) && (*in <= 0x5A)) ||
- (*in == '_')) {
- in++;
- while (((*in >= 0x61) && (*in <= 0x7A)) ||
- ((*in >= 0x41) && (*in <= 0x5A)) ||
- ((*in >= 0x30) && (*in <= 0x39)) ||
- (*in == '_') || (*in == '-') ||
- (*in == '.'))
- in++;
- if ((*in > 0) && (*in < 0x80)) {
- count = in - ctxt->input->cur;
- 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);
- }
- return(ret);
- }
- }
- return(xmlParseNCNameComplex(ctxt));
-}
-
-/**
* xmlParseQName:
* @ctxt: an XML parser context
* @prefix: pointer to store the prefix part
@@ -7800,7 +8213,13 @@ xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
xmlNsErr(ctxt, XML_NS_ERR_QNAME,
"Failed to parse QName '%s:'\n", p, NULL, NULL);
- tmp = xmlBuildQName(BAD_CAST "", p, NULL, 0);
+ l = xmlParseNmtoken(ctxt);
+ if (l == NULL)
+ tmp = xmlBuildQName(BAD_CAST "", p, NULL, 0);
+ else {
+ tmp = xmlBuildQName(l, p, NULL, 0);
+ xmlFree((char *)l);
+ }
p = xmlDictLookup(ctxt->dict, tmp, -1);
if (tmp != NULL) xmlFree(tmp);
*prefix = NULL;
@@ -8108,7 +8527,7 @@ xmlParseAttribute2(xmlParserCtxtPtr ctxt,
const xmlChar *val2;
val2 = xmlAttrNormalizeSpace2(ctxt, val, len);
- if (val2 != NULL) {
+ if ((val2 != NULL) && (val2 != val)) {
xmlFree(val);
val = (xmlChar *) val2;
}
@@ -8271,17 +8690,33 @@ reparse:
if (*URL != 0) {
uri = xmlParseURI((const char *) URL);
if (uri == NULL) {
- xmlWarningMsg(ctxt, XML_WAR_NS_URI,
- "xmlns: %s not a valid URI\n",
- URL, NULL);
+ xmlNsErr(ctxt, XML_WAR_NS_URI,
+ "xmlns: '%s' is not a valid URI\n",
+ URL, NULL, NULL);
} else {
- if (uri->scheme == NULL) {
- xmlWarningMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
- "xmlns: URI %s is not absolute\n",
- URL, NULL);
+ if ((ctxt->pedantic) && (uri->scheme == NULL)) {
+ xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
+ "xmlns: URI %s is not absolute\n",
+ URL, NULL, NULL);
}
xmlFreeURI(uri);
}
+ if (URL == ctxt->str_xml_ns) {
+ if (attname != ctxt->str_xml) {
+ xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+ "xml namespace URI cannot be the default namespace\n",
+ NULL, NULL, NULL);
+ }
+ goto skip_default_ns;
+ }
+ if ((len == 29) &&
+ (xmlStrEqual(URL,
+ BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
+ xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+ "reuse of the xmlns namespace name is forbidden\n",
+ NULL, NULL, NULL);
+ goto skip_default_ns;
+ }
}
/*
* check that it's not a defined namespace
@@ -8293,6 +8728,7 @@ reparse:
xmlErrAttributeDup(ctxt, NULL, attname);
else
if (nsPush(ctxt, NULL, URL) > 0) nbNs++;
+skip_default_ns:
if (alloc != 0) xmlFree(attvalue);
SKIP_BLANKS;
continue;
@@ -8310,22 +8746,49 @@ reparse:
/*
* Do not keep a namespace definition node
*/
- if (alloc != 0) xmlFree(attvalue);
- SKIP_BLANKS;
- continue;
+ goto skip_ns;
+ }
+ if (URL == ctxt->str_xml_ns) {
+ if (attname != ctxt->str_xml) {
+ xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+ "xml namespace URI mapped to wrong prefix\n",
+ NULL, NULL, NULL);
+ }
+ goto skip_ns;
+ }
+ if (attname == ctxt->str_xmlns) {
+ xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+ "redefinition of the xmlns prefix is forbidden\n",
+ NULL, NULL, NULL);
+ goto skip_ns;
}
- uri = xmlParseURI((const char *) URL);
- if (uri == NULL) {
- xmlWarningMsg(ctxt, XML_WAR_NS_URI,
- "xmlns:%s: '%s' is not a valid URI\n",
- attname, URL);
+ if ((len == 29) &&
+ (xmlStrEqual(URL,
+ BAD_CAST "http://www.w3.org/2000/xmlns/"))) {
+ xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+ "reuse of the xmlns namespace name is forbidden\n",
+ NULL, NULL, NULL);
+ goto skip_ns;
+ }
+ if ((URL == NULL) || (URL[0] == 0)) {
+ xmlNsErr(ctxt, XML_NS_ERR_XML_NAMESPACE,
+ "xmlns:%s: Empty XML namespace is not allowed\n",
+ attname, NULL, NULL);
+ goto skip_ns;
} else {
- if ((ctxt->pedantic) && (uri->scheme == NULL)) {
- xmlWarningMsg(ctxt, XML_WAR_NS_URI_RELATIVE,
+ uri = xmlParseURI((const char *) URL);
+ if (uri == NULL) {
+ xmlNsErr(ctxt, XML_WAR_NS_URI,
+ "xmlns:%s: '%s' is not a valid URI\n",
+ attname, URL, NULL);
+ } else {
+ if ((ctxt->pedantic) && (uri->scheme == NULL)) {
+ xmlNsWarn(ctxt, XML_WAR_NS_URI_RELATIVE,
"xmlns:%s: URI %s is not absolute\n",
- attname, URL);
+ attname, URL, NULL);
+ }
+ xmlFreeURI(uri);
}
- xmlFreeURI(uri);
}
/*
@@ -8338,6 +8801,7 @@ reparse:
xmlErrAttributeDup(ctxt, aprefix, attname);
else
if (nsPush(ctxt, attname, URL) > 0) nbNs++;
+skip_ns:
if (alloc != 0) xmlFree(attvalue);
SKIP_BLANKS;
if (ctxt->input->base != base) goto base_changed;
@@ -8372,7 +8836,7 @@ reparse:
xmlFree(attvalue);
}
-failed:
+failed:
GROW
if (ctxt->input->base != base) goto base_changed;
@@ -8403,8 +8867,8 @@ failed:
defaults = xmlHashLookup2(ctxt->attsDefault, localname, prefix);
if (defaults != NULL) {
for (i = 0;i < defaults->nbAttrs;i++) {
- attname = defaults->values[4 * i];
- aprefix = defaults->values[4 * i + 1];
+ attname = defaults->values[5 * i];
+ aprefix = defaults->values[5 * i + 1];
/*
* special work for namespaces defaulted defs
@@ -8419,9 +8883,9 @@ failed:
if (j <= nbNs) continue;
nsname = xmlGetNamespace(ctxt, NULL);
- if (nsname != defaults->values[4 * i + 2]) {
+ if (nsname != defaults->values[5 * i + 2]) {
if (nsPush(ctxt, NULL,
- defaults->values[4 * i + 2]) > 0)
+ defaults->values[5 * i + 2]) > 0)
nbNs++;
}
} else if (aprefix == ctxt->str_xmlns) {
@@ -8436,7 +8900,7 @@ failed:
nsname = xmlGetNamespace(ctxt, attname);
if (nsname != defaults->values[2]) {
if (nsPush(ctxt, attname,
- defaults->values[4 * i + 2]) > 0)
+ defaults->values[5 * i + 2]) > 0)
nbNs++;
}
} else {
@@ -8462,8 +8926,14 @@ failed:
atts[nbatts++] = NULL;
else
atts[nbatts++] = xmlGetNamespace(ctxt, aprefix);
- atts[nbatts++] = defaults->values[4 * i + 2];
- atts[nbatts++] = defaults->values[4 * i + 3];
+ atts[nbatts++] = defaults->values[5 * i + 2];
+ atts[nbatts++] = defaults->values[5 * i + 3];
+ if ((ctxt->standalone == 1) &&
+ (defaults->values[5 * i + 4] != NULL)) {
+ xmlValidityError(ctxt, XML_DTD_STANDALONE_DEFAULTED,
+ "standalone: attribute %s on %s defaulted from external subset\n",
+ attname, localname);
+ }
nbdef++;
}
}
@@ -8846,10 +9316,11 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
xmlNodePtr ret;
int nsNr = ctxt->nsNr;
- if ((unsigned int) ctxt->nameNr > xmlParserMaxDepth) {
- xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR,
- "Excessive depth in document: change xmlParserMaxDepth = %d\n",
- xmlParserMaxDepth);
+ if (((unsigned int) ctxt->nameNr > xmlParserMaxDepth) &&
+ ((ctxt->options & XML_PARSE_HUGE) == 0)) {
+ xmlFatalErrMsgInt(ctxt, XML_ERR_INTERNAL_ERROR,
+ "Excessive depth in document: %d use XML_PARSE_HUGE option\n",
+ xmlParserMaxDepth);
ctxt->instate = XML_PARSER_EOF;
return;
}
@@ -9003,7 +9474,9 @@ xmlParseElement(xmlParserCtxtPtr ctxt) {
*
* parse the XML version value.
*
- * [26] VersionNum ::= ([a-zA-Z0-9_.:] | '-')+
+ * [26] VersionNum ::= '1.' [0-9]+
+ *
+ * In practice allow [0-9].[0-9]+ at that level
*
* Returns the string giving the XML version number, or NULL
*/
@@ -9020,11 +9493,21 @@ xmlParseVersionNum(xmlParserCtxtPtr ctxt) {
return(NULL);
}
cur = CUR;
- while (((cur >= 'a') && (cur <= 'z')) ||
- ((cur >= 'A') && (cur <= 'Z')) ||
- ((cur >= '0') && (cur <= '9')) ||
- (cur == '_') || (cur == '.') ||
- (cur == ':') || (cur == '-')) {
+ if (!((cur >= '0') && (cur <= '9'))) {
+ xmlFree(buf);
+ return(NULL);
+ }
+ buf[len++] = cur;
+ NEXT;
+ cur=CUR;
+ if (cur != '.') {
+ xmlFree(buf);
+ return(NULL);
+ }
+ buf[len++] = cur;
+ NEXT;
+ cur=CUR;
+ while ((cur >= '0') && (cur <= '9')) {
if (len + 1 >= size) {
xmlChar *tmp;
@@ -9117,7 +9600,7 @@ xmlParseEncName(xmlParserCtxtPtr ctxt) {
xmlErrMemory(ctxt, NULL);
return(NULL);
}
-
+
buf[len++] = cur;
NEXT;
cur = CUR;
@@ -9205,6 +9688,18 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
if ((encoding != NULL) &&
((!xmlStrcasecmp(encoding, BAD_CAST "UTF-16")) ||
(!xmlStrcasecmp(encoding, BAD_CAST "UTF16")))) {
+ /*
+ * If no encoding was passed to the parser, that we are
+ * using UTF-16 and no decoder is present i.e. the
+ * document is apparently UTF-8 compatible, then raise an
+ * encoding mismatch fatal error
+ */
+ if ((ctxt->encoding == NULL) &&
+ (ctxt->input->buf != NULL) &&
+ (ctxt->input->buf->encoder == NULL)) {
+ xmlFatalErrMsg(ctxt, XML_ERR_INVALID_ENCODING,
+ "Document labelled UTF-16 but has UTF-8 content\n");
+ }
if (ctxt->encoding != NULL)
xmlFree((xmlChar *) ctxt->encoding);
ctxt->encoding = encoding;
@@ -9363,11 +9858,23 @@ xmlParseXMLDecl(xmlParserCtxtPtr ctxt) {
} else {
if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION)) {
/*
- * TODO: Blueberry should be detected here
+ * Changed here for XML-1.0 5th edition
*/
- xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
- "Unsupported version '%s'\n",
- version, NULL);
+ if (ctxt->options & XML_PARSE_OLD10) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
+ "Unsupported version '%s'\n",
+ version);
+ } else {
+ if ((version[0] == '1') && ((version[1] == '.'))) {
+ xmlWarningMsg(ctxt, XML_WAR_UNKNOWN_VERSION,
+ "Unsupported version '%s'\n",
+ version, NULL);
+ } else {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_UNKNOWN_VERSION,
+ "Unsupported version '%s'\n",
+ version);
+ }
+ }
}
if (ctxt->version != NULL)
xmlFree((void *) ctxt->version);
@@ -9601,6 +10108,15 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
ctxt->myDoc = NULL;
}
+ if ((ctxt->wellFormed) && (ctxt->myDoc != NULL)) {
+ ctxt->myDoc->properties |= XML_DOC_WELLFORMED;
+ if (ctxt->valid)
+ ctxt->myDoc->properties |= XML_DOC_DTDVALID;
+ if (ctxt->nsWellFormed)
+ ctxt->myDoc->properties |= XML_DOC_NSVALID;
+ if (ctxt->options & XML_PARSE_OLD10)
+ ctxt->myDoc->properties |= XML_DOC_OLD10;
+ }
if (! ctxt->wellFormed) {
ctxt->valid = 0;
return(-1);
@@ -11245,7 +11761,11 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
/*
* plug some encoding conversion routines here.
*/
- xmlPushInput(ctxt, pinput);
+ if (xmlPushInput(ctxt, pinput) < 0) {
+ if (sax != NULL) ctxt->sax = NULL;
+ xmlFreeParserCtxt(ctxt);
+ return(NULL);
+ }
if (enc != XML_CHAR_ENCODING_NONE) {
xmlSwitchEncoding(ctxt, enc);
}
@@ -11262,6 +11782,11 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
*/
ctxt->inSubset = 2;
ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
+ if (ctxt->myDoc == NULL) {
+ xmlErrMemory(ctxt, "New Doc failed");
+ return(NULL);
+ }
+ ctxt->myDoc->properties = XML_DOC_INTERNAL;
ctxt->myDoc->extSubset = xmlNewDtd(ctxt->myDoc, BAD_CAST "none",
BAD_CAST "none", BAD_CAST "none");
@@ -11374,7 +11899,13 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
/*
* plug some encoding conversion routines here.
*/
- xmlPushInput(ctxt, input);
+ if (xmlPushInput(ctxt, input) < 0) {
+ if (sax != NULL) ctxt->sax = NULL;
+ xmlFreeParserCtxt(ctxt);
+ if (systemIdCanonic != NULL)
+ xmlFree(systemIdCanonic);
+ return(NULL);
+ }
if ((ctxt->input->end - ctxt->input->cur) >= 4) {
enc = xmlDetectCharEncoding(ctxt->input->cur, 4);
xmlSwitchEncoding(ctxt, enc);
@@ -11395,6 +11926,13 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
*/
ctxt->inSubset = 2;
ctxt->myDoc = xmlNewDoc(BAD_CAST "1.0");
+ if (ctxt->myDoc == NULL) {
+ xmlErrMemory(ctxt, "New Doc failed");
+ if (sax != NULL) ctxt->sax = NULL;
+ xmlFreeParserCtxt(ctxt);
+ return(NULL);
+ }
+ ctxt->myDoc->properties = XML_DOC_INTERNAL;
ctxt->myDoc->extSubset = xmlNewDtd(ctxt->myDoc, BAD_CAST "none",
ExternalID, SystemID);
xmlParseExternalSubset(ctxt, ExternalID, SystemID);
@@ -11421,7 +11959,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
}
if (sax != NULL) ctxt->sax = NULL;
xmlFreeParserCtxt(ctxt);
-
+
return(ret);
}
@@ -11432,7 +11970,7 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
* @SystemID: a NAME* containing the URL to the DTD
*
* Load and parse an external subset.
- *
+ *
* Returns the resulting xmlDtdPtr or NULL in case of error.
*/
@@ -11480,7 +12018,8 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
if (ctx == NULL) return(-1);
- if (ctx->depth > 40) {
+ if (((ctx->depth > 40) && ((ctx->options & XML_PARSE_HUGE) == 0)) ||
+ (ctx->depth > 1024)) {
return(XML_ERR_ENTITY_LOOP);
}
@@ -11495,10 +12034,10 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
if (ctxt == NULL) {
return(-1);
}
-
+
ctxt->userData = ctxt;
ctxt->_private = ctx->_private;
-
+
inputStream = xmlLoadExternalEntity((char *)URL, (char *)ID, ctxt);
if (inputStream == NULL) {
xmlFreeParserCtxt(ctxt);
@@ -11511,7 +12050,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
directory = xmlParserGetDirectory((char *)URL);
if ((ctxt->directory == NULL) && (directory != NULL))
ctxt->directory = directory;
-
+
oldsax = ctxt->sax;
ctxt->sax = ctx->sax;
xmlDetectSAX2(ctxt);
@@ -11520,6 +12059,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
xmlFreeParserCtxt(ctxt);
return(-1);
}
+ newDoc->properties = XML_DOC_INTERNAL;
if (ctx->myDoc->dict) {
newDoc->dict = ctx->myDoc->dict;
xmlDictReference(newDoc->dict);
@@ -11549,7 +12089,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
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.
@@ -11571,6 +12111,14 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
*/
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");
+ }
}
/*
@@ -11604,7 +12152,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
ctxt->linenumbers = ctx->linenumbers;
xmlParseContent(ctxt);
-
+
ctx->validate = ctxt->validate;
ctx->valid = ctxt->valid;
if ((RAW == '<') && (NXT(1) == '/')) {
@@ -11647,7 +12195,7 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
newDoc->intSubset = NULL;
newDoc->extSubset = NULL;
xmlFreeDoc(newDoc);
-
+
return(ret);
}
@@ -11681,12 +12229,12 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
xmlChar start[4];
xmlCharEncoding enc;
- if (depth > 40) {
+ if (((depth > 40) &&
+ ((oldctxt == NULL) || (oldctxt->options & XML_PARSE_HUGE) == 0)) ||
+ (depth > 1024)) {
return(XML_ERR_ENTITY_LOOP);
}
-
-
if (list != NULL)
*list = NULL;
if ((URL == NULL) && (ID == NULL))
@@ -11732,6 +12280,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
xmlFreeParserCtxt(ctxt);
return(XML_ERR_INTERNAL_ERROR);
}
+ newDoc->properties = XML_DOC_INTERNAL;
newDoc->intSubset = doc->intSubset;
newDoc->extSubset = doc->extSubset;
newDoc->dict = doc->dict;
@@ -11758,7 +12307,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
ctxt->myDoc = doc;
newRoot->doc = doc;
- /*
+ /*
* Get the 4 first bytes and decode the charset
* if enc != XML_CHAR_ENCODING_NONE
* plug some encoding conversion routines.
@@ -11786,7 +12335,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
ctxt->depth = depth;
xmlParseContent(ctxt);
-
+
if ((RAW == '<') && (NXT(1) == '/')) {
xmlFatalErr(ctxt, XML_ERR_NOT_WELL_BALANCED, NULL);
} else if (RAW != 0) {
@@ -11819,6 +12368,25 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
}
ret = XML_ERR_OK;
}
+
+ /*
+ * Record in the parent context the number of entities replacement
+ * done when parsing that reference.
+ */
+ oldctxt->nbentities += ctxt->nbentities;
+ /*
+ * Also record the size of the entity parsed
+ */
+ if (ctxt->input != NULL) {
+ oldctxt->sizeentities += ctxt->input->consumed;
+ oldctxt->sizeentities += (ctxt->input->cur - ctxt->input->base);
+ }
+ /*
+ * And record the last error if any
+ */
+ if (ctxt->lastError.code != XML_ERR_OK)
+ xmlCopyError(&ctxt->lastError, &oldctxt->lastError);
+
if (sax != NULL)
ctxt->sax = oldsax;
oldctxt->node_seq.maximum = ctxt->node_seq.maximum;
@@ -11831,7 +12399,7 @@ xmlParseExternalEntityPrivate(xmlDocPtr doc, xmlParserCtxtPtr oldctxt,
newDoc->intSubset = NULL;
newDoc->extSubset = NULL;
xmlFreeDoc(newDoc);
-
+
return(ret);
}
@@ -11908,9 +12476,9 @@ xmlParseBalancedChunkMemory(xmlDocPtr doc, xmlSAXHandlerPtr sax,
*
* Returns XML_ERR_OK if the chunk is well balanced, 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.
+ * the parsed chunk is not well balanced.
*/
static xmlParserErrors
xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
@@ -11924,7 +12492,8 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
int size;
xmlParserErrors ret = XML_ERR_OK;
- if (oldctxt->depth > 40) {
+ if (((oldctxt->depth > 40) && ((oldctxt->options & XML_PARSE_HUGE) == 0)) ||
+ (oldctxt->depth > 1024)) {
return(XML_ERR_ENTITY_LOOP);
}
@@ -11953,7 +12522,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
xmlDetectSAX2(ctxt);
ctxt->replaceEntities = oldctxt->replaceEntities;
ctxt->options = oldctxt->options;
-
+
ctxt->_private = oldctxt->_private;
if (oldctxt->myDoc == NULL) {
newDoc = xmlNewDoc(BAD_CAST "1.0");
@@ -11963,6 +12532,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
xmlFreeParserCtxt(ctxt);
return(XML_ERR_INTERNAL_ERROR);
}
+ newDoc->properties = XML_DOC_INTERNAL;
newDoc->dict = ctxt->dict;
xmlDictReference(newDoc->dict);
ctxt->myDoc = newDoc;
@@ -12018,7 +12588,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
} else {
ret = XML_ERR_OK;
}
-
+
if ((lst != NULL) && (ret == XML_ERR_OK)) {
xmlNodePtr cur;
@@ -12047,7 +12617,18 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
ctxt->myDoc->children = content;
ctxt->myDoc->last = last;
}
-
+
+ /*
+ * Record in the parent context the number of entities replacement
+ * done when parsing that reference.
+ */
+ oldctxt->nbentities += ctxt->nbentities;
+ /*
+ * Also record the last error if any
+ */
+ if (ctxt->lastError.code != XML_ERR_OK)
+ xmlCopyError(&ctxt->lastError, &oldctxt->lastError);
+
ctxt->sax = oldsax;
ctxt->dict = NULL;
ctxt->attsDefault = NULL;
@@ -12056,7 +12637,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
if (newDoc != NULL) {
xmlFreeDoc(newDoc);
}
-
+
return(ret);
}
@@ -12157,7 +12738,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
} else
options |= XML_PARSE_NODICT;
- xmlCtxtUseOptions(ctxt, options);
+ xmlCtxtUseOptionsInternal(ctxt, options, NULL);
xmlDetectSAX2(ctxt);
ctxt->myDoc = doc;
@@ -12189,7 +12770,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
cur = cur->parent;
}
ctxt->instate = XML_PARSER_CONTENT;
- }
+ }
if ((ctxt->validate) || (ctxt->replaceEntities != 0)) {
/*
@@ -12224,12 +12805,12 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
} else {
ret = XML_ERR_OK;
}
-
+
/*
* Return the newly created nodeset after unlinking it from
* the pseudo sibling.
*/
-
+
cur = fake->next;
fake->next = NULL;
node->last = fake;
@@ -12257,7 +12838,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
if (doc->dict != NULL)
ctxt->dict = NULL;
xmlFreeParserCtxt(ctxt);
-
+
return(ret);
#else /* !SAX2 */
return(XML_ERR_INTERNAL_ERROR);
@@ -12327,6 +12908,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
xmlFreeParserCtxt(ctxt);
return(-1);
}
+ newDoc->properties = XML_DOC_INTERNAL;
if ((doc != NULL) && (doc->dict != NULL)) {
xmlDictFree(ctxt->dict);
ctxt->dict = doc->dict;
@@ -12336,7 +12918,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
ctxt->dictNames = 1;
} else {
- xmlCtxtUseOptions(ctxt, XML_PARSE_NODICT);
+ xmlCtxtUseOptionsInternal(ctxt, XML_PARSE_NODICT, NULL);
}
if (doc != NULL) {
newDoc->intSubset = doc->intSubset;
@@ -12399,7 +12981,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
} else {
ret = 0;
}
-
+
if ((lst != NULL) && ((ret == 0) || (recover == 1))) {
xmlNodePtr cur;
@@ -12416,15 +12998,15 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
}
newDoc->children->children = NULL;
}
-
- if (sax != NULL)
+
+ if (sax != NULL)
ctxt->sax = oldsax;
xmlFreeParserCtxt(ctxt);
newDoc->intSubset = NULL;
newDoc->extSubset = NULL;
newDoc->oldNs = NULL;
xmlFreeDoc(newDoc);
-
+
return(ret);
}
@@ -12472,7 +13054,7 @@ xmlSAXParseEntity(xmlSAXHandlerPtr sax, const char *filename) {
if (sax != NULL)
ctxt->sax = NULL;
xmlFreeParserCtxt(ctxt);
-
+
return(ret);
}
@@ -12514,7 +13096,7 @@ xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID,
xmlParserInputPtr inputStream;
char *directory = NULL;
xmlChar *uri;
-
+
ctxt = xmlNewParserCtxt();
if (ctxt == NULL) {
return(NULL);
@@ -12556,7 +13138,7 @@ xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID,
/************************************************************************
* *
- * Front ends when parsing from a file *
+ * Front ends when parsing from a file *
* *
************************************************************************/
@@ -12585,9 +13167,9 @@ xmlCreateURLParserCtxt(const char *filename, int options)
}
if (options)
- xmlCtxtUseOptions(ctxt, options);
+ xmlCtxtUseOptionsInternal(ctxt, options, NULL);
ctxt->linenumbers = 1;
-
+
inputStream = xmlLoadExternalEntity(filename, NULL, ctxt);
if (inputStream == NULL) {
xmlFreeParserCtxt(ctxt);
@@ -13363,6 +13945,8 @@ xmlCtxtReset(xmlParserCtxtPtr ctxt)
ctxt->depth = 0;
ctxt->charset = XML_CHAR_ENCODING_UTF8;
ctxt->catalogs = NULL;
+ ctxt->nbentities = 0;
+ ctxt->sizeentities = 0;
xmlInitNodeInfoSeq(&ctxt->node_seq);
if (ctxt->attsDefault != NULL) {
@@ -13474,6 +14058,10 @@ xmlCtxtResetPush(xmlParserCtxtPtr ctxt, const char *chunk,
if (encoding != NULL) {
xmlCharEncodingHandlerPtr hdlr;
+ if (ctxt->encoding != NULL)
+ xmlFree((xmlChar *) ctxt->encoding);
+ ctxt->encoding = xmlStrdup((const xmlChar *) encoding);
+
hdlr = xmlFindCharEncodingHandler(encoding);
if (hdlr != NULL) {
xmlSwitchToEncoding(ctxt, hdlr);
@@ -13488,50 +14076,63 @@ xmlCtxtResetPush(xmlParserCtxtPtr ctxt, const char *chunk,
return(0);
}
+
/**
- * xmlCtxtUseOptions:
+ * xmlCtxtUseOptionsInternal:
* @ctxt: an XML parser context
* @options: a combination of xmlParserOption
+ * @encoding: the user provided encoding to use
*
* Applies the options to the parser context
*
* Returns 0 in case of success, the set of unknown or unimplemented options
* in case of error.
*/
-int
-xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
+static int
+xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encoding)
{
if (ctxt == NULL)
return(-1);
+ if (encoding != NULL) {
+ if (ctxt->encoding != NULL)
+ xmlFree((xmlChar *) ctxt->encoding);
+ ctxt->encoding = xmlStrdup((const xmlChar *) encoding);
+ }
if (options & XML_PARSE_RECOVER) {
ctxt->recovery = 1;
options -= XML_PARSE_RECOVER;
+ ctxt->options |= XML_PARSE_RECOVER;
} else
ctxt->recovery = 0;
if (options & XML_PARSE_DTDLOAD) {
ctxt->loadsubset = XML_DETECT_IDS;
options -= XML_PARSE_DTDLOAD;
+ ctxt->options |= XML_PARSE_DTDLOAD;
} else
ctxt->loadsubset = 0;
if (options & XML_PARSE_DTDATTR) {
ctxt->loadsubset |= XML_COMPLETE_ATTRS;
options -= XML_PARSE_DTDATTR;
+ ctxt->options |= XML_PARSE_DTDATTR;
}
if (options & XML_PARSE_NOENT) {
ctxt->replaceEntities = 1;
/* ctxt->loadsubset |= XML_DETECT_IDS; */
options -= XML_PARSE_NOENT;
+ ctxt->options |= XML_PARSE_NOENT;
} else
ctxt->replaceEntities = 0;
if (options & XML_PARSE_PEDANTIC) {
ctxt->pedantic = 1;
options -= XML_PARSE_PEDANTIC;
+ ctxt->options |= XML_PARSE_PEDANTIC;
} else
ctxt->pedantic = 0;
if (options & XML_PARSE_NOBLANKS) {
ctxt->keepBlanks = 0;
ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
options -= XML_PARSE_NOBLANKS;
+ ctxt->options |= XML_PARSE_NOBLANKS;
} else
ctxt->keepBlanks = 1;
if (options & XML_PARSE_DTDVALID) {
@@ -13541,6 +14142,7 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
if (options & XML_PARSE_NOERROR)
ctxt->vctxt.error = NULL;
options -= XML_PARSE_DTDVALID;
+ ctxt->options |= XML_PARSE_DTDVALID;
} else
ctxt->validate = 0;
if (options & XML_PARSE_NOWARNING) {
@@ -13560,17 +14162,20 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
ctxt->sax->endElementNs = NULL;
ctxt->sax->initialized = 1;
options -= XML_PARSE_SAX1;
+ ctxt->options |= XML_PARSE_SAX1;
}
#endif /* LIBXML_SAX1_ENABLED */
if (options & XML_PARSE_NODICT) {
ctxt->dictNames = 0;
options -= XML_PARSE_NODICT;
+ ctxt->options |= XML_PARSE_NODICT;
} else {
ctxt->dictNames = 1;
}
if (options & XML_PARSE_NOCDATA) {
ctxt->sax->cdataBlock = NULL;
options -= XML_PARSE_NOCDATA;
+ ctxt->options |= XML_PARSE_NOCDATA;
}
if (options & XML_PARSE_NSCLEAN) {
ctxt->options |= XML_PARSE_NSCLEAN;
@@ -13584,11 +14189,39 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
ctxt->options |= XML_PARSE_COMPACT;
options -= XML_PARSE_COMPACT;
}
+ if (options & XML_PARSE_OLD10) {
+ ctxt->options |= XML_PARSE_OLD10;
+ options -= XML_PARSE_OLD10;
+ }
+ if (options & XML_PARSE_NOBASEFIX) {
+ ctxt->options |= XML_PARSE_NOBASEFIX;
+ options -= XML_PARSE_NOBASEFIX;
+ }
+ if (options & XML_PARSE_HUGE) {
+ ctxt->options |= XML_PARSE_HUGE;
+ options -= XML_PARSE_HUGE;
+ }
ctxt->linenumbers = 1;
return (options);
}
/**
+ * xmlCtxtUseOptions:
+ * @ctxt: an XML parser context
+ * @options: a combination of xmlParserOption
+ *
+ * Applies the options to the parser context
+ *
+ * Returns 0 in case of success, the set of unknown or unimplemented options
+ * in case of error.
+ */
+int
+xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
+{
+ return(xmlCtxtUseOptionsInternal(ctxt, options, NULL));
+}
+
+/**
* xmlDoRead:
* @ctxt: an XML parser context
* @URL: the base URL to use for the document
@@ -13597,7 +14230,7 @@ xmlCtxtUseOptions(xmlParserCtxtPtr ctxt, int options)
* @reuse: keep the context for reuse
*
* Common front-end for the xmlRead functions
- *
+ *
* Returns the resulting document tree or NULL
*/
static xmlDocPtr
@@ -13605,8 +14238,8 @@ xmlDoRead(xmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
int options, int reuse)
{
xmlDocPtr ret;
-
- xmlCtxtUseOptions(ctxt, options);
+
+ xmlCtxtUseOptionsInternal(ctxt, options, encoding);
if (encoding != NULL) {
xmlCharEncodingHandlerPtr hdlr;
diff --git a/parserInternals.c b/parserInternals.c
index d7aa4cf..758c6b3 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -1399,7 +1399,8 @@ xmlNewEntityInputStream(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
if (input == NULL) {
return(NULL);
}
- input->filename = (char *) entity->URI;
+ if (entity->URI != NULL)
+ input->filename = (char *) xmlStrdup((xmlChar *) entity->URI);
input->base = entity->content;
input->cur = entity->content;
input->length = entity->length;
@@ -1669,6 +1670,7 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
ctxt->depth = 0;
ctxt->charset = XML_CHAR_ENCODING_UTF8;
ctxt->catalogs = NULL;
+ ctxt->nbentities = 0;
xmlInitNodeInfoSeq(&ctxt->node_seq);
return(0);
}
diff --git a/pattern.c b/pattern.c
index ee51968..0e38c2d 100644
--- a/pattern.c
+++ b/pattern.c
@@ -2285,9 +2285,13 @@ xmlStreamPop(xmlStreamCtxtPtr stream) {
if (stream->blockLevel == stream->level)
stream->blockLevel = -1;
- stream->level--;
- if (stream->level < 0)
- return(-1);
+ /*
+ * stream->level can be zero when XML_FINAL_IS_ANY_NODE is set
+ * (see the thread at
+ * http://mail.gnome.org/archives/xslt/2008-July/msg00027.html)
+ */
+ if (stream->level)
+ stream->level--;
/*
* Check evolution of existing states
*/
diff --git a/python/Makefile.in b/python/Makefile.in
index 7ffe750..5f96636 100644
--- a/python/Makefile.in
+++ b/python/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -65,7 +65,7 @@ libxml2mod_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(libxml2mod_la_LDFLAGS) $(LDFLAGS) -o $@
@WITH_PYTHON_TRUE@am_libxml2mod_la_rpath = -rpath $(pythondir)
-DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -397,8 +397,8 @@ install-pythonLTLIBRARIES: $(python_LTLIBRARIES)
@list='$(python_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
f=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=install $(pythonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pythondir)/$$f'"; \
- $(LIBTOOL) --mode=install $(pythonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pythondir)/$$f"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pythonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pythondir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pythonLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pythondir)/$$f"; \
else :; fi; \
done
@@ -406,8 +406,8 @@ uninstall-pythonLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(python_LTLIBRARIES)'; for p in $$list; do \
p=$(am__strip_dir) \
- echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pythondir)/$$p'"; \
- $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pythondir)/$$p"; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pythondir)/$$p'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pythondir)/$$p"; \
done
clean-pythonLTLIBRARIES:
@@ -584,8 +584,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -610,8 +610,8 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -621,13 +621,12 @@ ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/python/generator.py b/python/generator.py
index 8cf327b..4e22815 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -409,10 +409,10 @@ def print_function_wrapper(name, output, export, include):
if skip_function(name) == 1:
return 0
if name in skip_impl:
- # Don't delete the function entry in the caller.
- return 1
+ # Don't delete the function entry in the caller.
+ return 1
- c_call = "";
+ c_call = ""
format=""
format_args=""
c_args=""
@@ -426,8 +426,8 @@ def print_function_wrapper(name, output, export, include):
c_args = c_args + " %s %s;\n" % (arg[1], arg[0])
if py_types.has_key(arg[1]):
(f, t, n, c) = py_types[arg[1]]
- if (f == 'z') and (name in foreign_encoding_args) and (num_bufs == 0):
- f = 't#'
+ if (f == 'z') and (name in foreign_encoding_args) and (num_bufs == 0):
+ f = 't#'
if f != None:
format = format + f
if t != None:
@@ -435,15 +435,15 @@ def print_function_wrapper(name, output, export, include):
c_args = c_args + " PyObject *pyobj_%s;\n" % (arg[0])
c_convert = c_convert + \
" %s = (%s) Py%s_Get(pyobj_%s);\n" % (arg[0],
- arg[1], t, arg[0]);
+ arg[1], t, arg[0])
else:
format_args = format_args + ", &%s" % (arg[0])
- if f == 't#':
- format_args = format_args + ", &py_buffsize%d" % num_bufs
- c_args = c_args + " int py_buffsize%d;\n" % num_bufs
- num_bufs = num_bufs + 1
+ if f == 't#':
+ format_args = format_args + ", &py_buffsize%d" % num_bufs
+ c_args = c_args + " int py_buffsize%d;\n" % num_bufs
+ num_bufs = num_bufs + 1
if c_call != "":
- c_call = c_call + ", ";
+ c_call = c_call + ", "
c_call = c_call + "%s" % (arg[0])
else:
if skipped_types.has_key(arg[1]):
@@ -459,16 +459,16 @@ def print_function_wrapper(name, output, export, include):
if ret[0] == 'void':
if file == "python_accessor":
- if args[1][1] == "char *" or args[1][1] == "xmlChar *":
- c_call = "\n if (%s->%s != NULL) xmlFree(%s->%s);\n" % (
- args[0][0], args[1][0], args[0][0], args[1][0])
- c_call = c_call + " %s->%s = (%s)xmlStrdup((const xmlChar *)%s);\n" % (args[0][0],
- args[1][0], args[1][1], args[1][0])
- else:
- c_call = "\n %s->%s = %s;\n" % (args[0][0], args[1][0],
- args[1][0])
+ if args[1][1] == "char *" or args[1][1] == "xmlChar *":
+ c_call = "\n if (%s->%s != NULL) xmlFree(%s->%s);\n" % (
+ args[0][0], args[1][0], args[0][0], args[1][0])
+ c_call = c_call + " %s->%s = (%s)xmlStrdup((const xmlChar *)%s);\n" % (args[0][0],
+ args[1][0], args[1][1], args[1][0])
+ else:
+ c_call = "\n %s->%s = %s;\n" % (args[0][0], args[1][0],
+ args[1][0])
else:
- c_call = "\n %s(%s);\n" % (name, c_call);
+ c_call = "\n %s(%s);\n" % (name, c_call)
ret_convert = " Py_INCREF(Py_None);\n return(Py_None);\n"
elif py_types.has_key(ret[0]):
(f, t, n, c) = py_types[ret[0]]
@@ -476,13 +476,13 @@ def print_function_wrapper(name, output, export, include):
if file == "python_accessor" and ret[2] != None:
c_call = "\n c_retval = %s->%s;\n" % (args[0][0], ret[2])
else:
- c_call = "\n c_retval = %s(%s);\n" % (name, c_call);
+ c_call = "\n c_retval = %s(%s);\n" % (name, c_call)
ret_convert = " py_retval = libxml_%sWrap((%s) c_retval);\n" % (n,c)
ret_convert = ret_convert + " return(py_retval);\n"
elif py_return_types.has_key(ret[0]):
(f, t, n, c) = py_return_types[ret[0]]
c_return = " %s c_retval;\n" % (ret[0])
- c_call = "\n c_retval = %s(%s);\n" % (name, c_call);
+ c_call = "\n c_retval = %s(%s);\n" % (name, c_call)
ret_convert = " py_retval = libxml_%sWrap((%s) c_retval);\n" % (n,c)
ret_convert = ret_convert + " return(py_retval);\n"
else:
@@ -501,31 +501,31 @@ def print_function_wrapper(name, output, export, include):
output.write("#if %s\n" % cond)
include.write("PyObject * ")
- include.write("libxml_%s(PyObject *self, PyObject *args);\n" % (name));
+ include.write("libxml_%s(PyObject *self, PyObject *args);\n" % (name))
export.write(" { (char *)\"%s\", libxml_%s, METH_VARARGS, NULL },\n" %
(name, name))
if file == "python":
# Those have been manually generated
- if cond != None and cond != "":
- include.write("#endif\n");
- export.write("#endif\n");
- output.write("#endif\n");
+ if cond != None and cond != "":
+ include.write("#endif\n")
+ export.write("#endif\n")
+ output.write("#endif\n")
return 1
if file == "python_accessor" and ret[0] != "void" and ret[2] is None:
# Those have been manually generated
- if cond != None and cond != "":
- include.write("#endif\n");
- export.write("#endif\n");
- output.write("#endif\n");
+ if cond != None and cond != "":
+ include.write("#endif\n")
+ export.write("#endif\n")
+ output.write("#endif\n")
return 1
output.write("PyObject *\n")
output.write("libxml_%s(PyObject *self ATTRIBUTE_UNUSED," % (name))
output.write(" PyObject *args")
if format == "":
- output.write(" ATTRIBUTE_UNUSED")
+ output.write(" ATTRIBUTE_UNUSED")
output.write(") {\n")
if ret[0] != 'void':
output.write(" PyObject *py_retval;\n")
@@ -555,38 +555,38 @@ def buildStubs():
global unknown_types
try:
- f = open(os.path.join(srcPref,"libxml2-api.xml"))
- data = f.read()
- (parser, target) = getparser()
- parser.feed(data)
- parser.close()
+ f = open(os.path.join(srcPref,"libxml2-api.xml"))
+ data = f.read()
+ (parser, target) = getparser()
+ parser.feed(data)
+ parser.close()
except IOError, msg:
- try:
- f = open(os.path.join(srcPref,"..","doc","libxml2-api.xml"))
- data = f.read()
- (parser, target) = getparser()
- parser.feed(data)
- parser.close()
- except IOError, msg:
- print file, ":", msg
- sys.exit(1)
+ try:
+ f = open(os.path.join(srcPref,"..","doc","libxml2-api.xml"))
+ data = f.read()
+ (parser, target) = getparser()
+ parser.feed(data)
+ parser.close()
+ except IOError, msg:
+ print file, ":", msg
+ sys.exit(1)
n = len(functions.keys())
print "Found %d functions in libxml2-api.xml" % (n)
py_types['pythonObject'] = ('O', "pythonObject", "pythonObject", "pythonObject")
try:
- f = open(os.path.join(srcPref,"libxml2-python-api.xml"))
- data = f.read()
- (parser, target) = getparser()
- parser.feed(data)
- parser.close()
+ f = open(os.path.join(srcPref,"libxml2-python-api.xml"))
+ data = f.read()
+ (parser, target) = getparser()
+ parser.feed(data)
+ parser.close()
except IOError, msg:
- print file, ":", msg
+ print file, ":", msg
print "Found %d functions in libxml2-python-api.xml" % (
- len(functions.keys()) - n)
+ len(functions.keys()) - n)
nb_wrap = 0
failed = 0
skipped = 0
@@ -604,24 +604,24 @@ def buildStubs():
wrapper.write("#include \"libxml_wrap.h\"\n")
wrapper.write("#include \"libxml2-py.h\"\n\n")
for function in functions.keys():
- ret = print_function_wrapper(function, wrapper, export, include)
- if ret < 0:
- failed = failed + 1
- del functions[function]
- if ret == 0:
- skipped = skipped + 1
- del functions[function]
- if ret == 1:
- nb_wrap = nb_wrap + 1
+ ret = print_function_wrapper(function, wrapper, export, include)
+ if ret < 0:
+ failed = failed + 1
+ del functions[function]
+ if ret == 0:
+ skipped = skipped + 1
+ del functions[function]
+ if ret == 1:
+ nb_wrap = nb_wrap + 1
include.close()
export.close()
wrapper.close()
print "Generated %d wrapper functions, %d failed, %d skipped\n" % (nb_wrap,
- failed, skipped);
+ failed, skipped)
print "Missing type converters: "
for type in unknown_types.keys():
- print "%s:%d " % (type, len(unknown_types[type])),
+ print "%s:%d " % (type, len(unknown_types[type])),
print
#######################################################################
@@ -713,9 +713,9 @@ classes_destructors = {
"relaxNgSchema": "xmlRelaxNGFree",
"relaxNgParserCtxt": "xmlRelaxNGFreeParserCtxt",
"relaxNgValidCtxt": "xmlRelaxNGFreeValidCtxt",
- "Schema": "xmlSchemaFree",
- "SchemaParserCtxt": "xmlSchemaFreeParserCtxt",
- "SchemaValidCtxt": "xmlSchemaFreeValidCtxt",
+ "Schema": "xmlSchemaFree",
+ "SchemaParserCtxt": "xmlSchemaFreeParserCtxt",
+ "SchemaValidCtxt": "xmlSchemaFreeValidCtxt",
"ValidCtxt": "xmlFreeValidCtxt",
}
@@ -730,7 +730,7 @@ functions_noexcept = {
reference_keepers = {
"xmlTextReader": [('inputBuffer', 'input')],
"relaxNgValidCtxt": [('relaxNgSchema', 'schema')],
- "SchemaValidCtxt": [('Schema', 'schema')],
+ "SchemaValidCtxt": [('Schema', 'schema')],
}
function_classes = {}
@@ -845,23 +845,23 @@ def writeDoc(name, args, indent, output):
if functions[name][0] is None or functions[name][0] == "":
return
val = functions[name][0]
- val = string.replace(val, "NULL", "None");
+ val = string.replace(val, "NULL", "None")
output.write(indent)
output.write('"""')
while len(val) > 60:
if val[0] == " ":
- val = val[1:]
- continue
+ val = val[1:]
+ continue
str = val[0:60]
- i = string.rfind(str, " ");
+ i = string.rfind(str, " ")
if i < 0:
i = 60
str = val[0:i]
val = val[i:]
output.write(str)
- output.write('\n ');
+ output.write('\n ')
output.write(indent)
- output.write(val);
+ output.write(val)
output.write(' """\n')
def buildWrappers():
@@ -884,7 +884,7 @@ def buildWrappers():
global functions_noexcept
for type in classes_type.keys():
- function_classes[classes_type[type][2]] = []
+ function_classes[classes_type[type][2]] = []
#
# Build the list of C types to look for ordered to start
@@ -895,63 +895,63 @@ def buildWrappers():
ctypes_processed = {}
classes_processed = {}
for classe in primary_classes:
- classes_list.append(classe)
- classes_processed[classe] = ()
- for type in classes_type.keys():
- tinfo = classes_type[type]
- if tinfo[2] == classe:
- ctypes.append(type)
- ctypes_processed[type] = ()
+ classes_list.append(classe)
+ classes_processed[classe] = ()
+ for type in classes_type.keys():
+ tinfo = classes_type[type]
+ if tinfo[2] == classe:
+ ctypes.append(type)
+ ctypes_processed[type] = ()
for type in classes_type.keys():
- if ctypes_processed.has_key(type):
- continue
- tinfo = classes_type[type]
- if not classes_processed.has_key(tinfo[2]):
- classes_list.append(tinfo[2])
- classes_processed[tinfo[2]] = ()
-
- ctypes.append(type)
- ctypes_processed[type] = ()
+ if ctypes_processed.has_key(type):
+ continue
+ tinfo = classes_type[type]
+ if not classes_processed.has_key(tinfo[2]):
+ classes_list.append(tinfo[2])
+ classes_processed[tinfo[2]] = ()
+
+ ctypes.append(type)
+ ctypes_processed[type] = ()
for name in functions.keys():
- found = 0;
- (desc, ret, args, file, cond) = functions[name]
- for type in ctypes:
- classe = classes_type[type][2]
-
- if name[0:3] == "xml" and len(args) >= 1 and args[0][1] == type:
- found = 1
- func = nameFixup(name, classe, type, file)
- info = (0, func, name, ret, args, file)
- function_classes[classe].append(info)
- elif name[0:3] == "xml" and len(args) >= 2 and args[1][1] == type \
- and file != "python_accessor":
- found = 1
- func = nameFixup(name, classe, type, file)
- info = (1, func, name, ret, args, file)
- function_classes[classe].append(info)
- elif name[0:4] == "html" and len(args) >= 1 and args[0][1] == type:
- found = 1
- func = nameFixup(name, classe, type, file)
- info = (0, func, name, ret, args, file)
- function_classes[classe].append(info)
- elif name[0:4] == "html" and len(args) >= 2 and args[1][1] == type \
- and file != "python_accessor":
- found = 1
- func = nameFixup(name, classe, type, file)
- info = (1, func, name, ret, args, file)
- function_classes[classe].append(info)
- if found == 1:
- continue
- if name[0:8] == "xmlXPath":
- continue
- if name[0:6] == "xmlStr":
- continue
- if name[0:10] == "xmlCharStr":
- continue
- func = nameFixup(name, "None", file, file)
- info = (0, func, name, ret, args, file)
- function_classes['None'].append(info)
+ found = 0
+ (desc, ret, args, file, cond) = functions[name]
+ for type in ctypes:
+ classe = classes_type[type][2]
+
+ if name[0:3] == "xml" and len(args) >= 1 and args[0][1] == type:
+ found = 1
+ func = nameFixup(name, classe, type, file)
+ info = (0, func, name, ret, args, file)
+ function_classes[classe].append(info)
+ elif name[0:3] == "xml" and len(args) >= 2 and args[1][1] == type \
+ and file != "python_accessor":
+ found = 1
+ func = nameFixup(name, classe, type, file)
+ info = (1, func, name, ret, args, file)
+ function_classes[classe].append(info)
+ elif name[0:4] == "html" and len(args) >= 1 and args[0][1] == type:
+ found = 1
+ func = nameFixup(name, classe, type, file)
+ info = (0, func, name, ret, args, file)
+ function_classes[classe].append(info)
+ elif name[0:4] == "html" and len(args) >= 2 and args[1][1] == type \
+ and file != "python_accessor":
+ found = 1
+ func = nameFixup(name, classe, type, file)
+ info = (1, func, name, ret, args, file)
+ function_classes[classe].append(info)
+ if found == 1:
+ continue
+ if name[0:8] == "xmlXPath":
+ continue
+ if name[0:6] == "xmlStr":
+ continue
+ if name[0:10] == "xmlCharStr":
+ continue
+ func = nameFixup(name, "None", file, file)
+ info = (0, func, name, ret, args, file)
+ function_classes['None'].append(info)
classes = open("libxml2class.py", "w")
txt = open("libxml2class.txt", "w")
@@ -959,261 +959,261 @@ def buildWrappers():
txt.write("#\n# Global functions of the module\n#\n\n")
if function_classes.has_key("None"):
- flist = function_classes["None"]
- flist.sort(functionCompare)
- oldfile = ""
- for info in flist:
- (index, func, name, ret, args, file) = info
- if file != oldfile:
- classes.write("#\n# Functions from module %s\n#\n\n" % file)
- txt.write("\n# functions from module %s\n" % file)
- oldfile = file
- classes.write("def %s(" % func)
- txt.write("%s()\n" % func);
- n = 0
- for arg in args:
- if n != 0:
- classes.write(", ")
- classes.write("%s" % arg[0])
- n = n + 1
- classes.write("):\n")
- writeDoc(name, args, ' ', classes);
-
- for arg in args:
- if classes_type.has_key(arg[1]):
- classes.write(" if %s is None: %s__o = None\n" %
- (arg[0], arg[0]))
- classes.write(" else: %s__o = %s%s\n" %
- (arg[0], arg[0], classes_type[arg[1]][0]))
- if ret[0] != "void":
- classes.write(" ret = ");
- else:
- classes.write(" ");
- classes.write("libxml2mod.%s(" % name)
- n = 0
- for arg in args:
- if n != 0:
- classes.write(", ");
- classes.write("%s" % arg[0])
- if classes_type.has_key(arg[1]):
- classes.write("__o");
- n = n + 1
- classes.write(")\n");
- if ret[0] != "void":
- if classes_type.has_key(ret[0]):
- #
- # Raise an exception
- #
- if functions_noexcept.has_key(name):
- classes.write(" if ret is None:return None\n");
- elif string.find(name, "URI") >= 0:
- classes.write(
- " if ret is None:raise uriError('%s() failed')\n"
- % (name))
- elif string.find(name, "XPath") >= 0:
- classes.write(
- " if ret is None:raise xpathError('%s() failed')\n"
- % (name))
- elif string.find(name, "Parse") >= 0:
- classes.write(
- " if ret is None:raise parserError('%s() failed')\n"
- % (name))
- else:
- classes.write(
- " if ret is None:raise treeError('%s() failed')\n"
- % (name))
- classes.write(" return ");
- classes.write(classes_type[ret[0]][1] % ("ret"));
- classes.write("\n");
- else:
- classes.write(" return ret\n");
- classes.write("\n");
+ flist = function_classes["None"]
+ flist.sort(functionCompare)
+ oldfile = ""
+ for info in flist:
+ (index, func, name, ret, args, file) = info
+ if file != oldfile:
+ classes.write("#\n# Functions from module %s\n#\n\n" % file)
+ txt.write("\n# functions from module %s\n" % file)
+ oldfile = file
+ classes.write("def %s(" % func)
+ txt.write("%s()\n" % func)
+ n = 0
+ for arg in args:
+ if n != 0:
+ classes.write(", ")
+ classes.write("%s" % arg[0])
+ n = n + 1
+ classes.write("):\n")
+ writeDoc(name, args, ' ', classes)
+
+ for arg in args:
+ if classes_type.has_key(arg[1]):
+ classes.write(" if %s is None: %s__o = None\n" %
+ (arg[0], arg[0]))
+ classes.write(" else: %s__o = %s%s\n" %
+ (arg[0], arg[0], classes_type[arg[1]][0]))
+ if ret[0] != "void":
+ classes.write(" ret = ")
+ else:
+ classes.write(" ")
+ classes.write("libxml2mod.%s(" % name)
+ n = 0
+ for arg in args:
+ if n != 0:
+ classes.write(", ")
+ classes.write("%s" % arg[0])
+ if classes_type.has_key(arg[1]):
+ classes.write("__o")
+ n = n + 1
+ classes.write(")\n")
+ if ret[0] != "void":
+ if classes_type.has_key(ret[0]):
+ #
+ # Raise an exception
+ #
+ if functions_noexcept.has_key(name):
+ classes.write(" if ret is None:return None\n")
+ elif string.find(name, "URI") >= 0:
+ classes.write(
+ " if ret is None:raise uriError('%s() failed')\n"
+ % (name))
+ elif string.find(name, "XPath") >= 0:
+ classes.write(
+ " if ret is None:raise xpathError('%s() failed')\n"
+ % (name))
+ elif string.find(name, "Parse") >= 0:
+ classes.write(
+ " if ret is None:raise parserError('%s() failed')\n"
+ % (name))
+ else:
+ classes.write(
+ " if ret is None:raise treeError('%s() failed')\n"
+ % (name))
+ classes.write(" return ")
+ classes.write(classes_type[ret[0]][1] % ("ret"))
+ classes.write("\n")
+ else:
+ classes.write(" return ret\n")
+ classes.write("\n")
txt.write("\n\n#\n# Set of classes of the module\n#\n\n")
for classname in classes_list:
- if classname == "None":
- pass
- else:
- if classes_ancestor.has_key(classname):
- txt.write("\n\nClass %s(%s)\n" % (classname,
- classes_ancestor[classname]))
- classes.write("class %s(%s):\n" % (classname,
- classes_ancestor[classname]))
- classes.write(" def __init__(self, _obj=None):\n")
- if classes_ancestor[classname] == "xmlCore" or \
- classes_ancestor[classname] == "xmlNode":
- classes.write(" if type(_obj).__name__ != ")
- classes.write("'PyCObject':\n")
- classes.write(" raise TypeError, ")
- classes.write("'%s needs a PyCObject argument'\n" % \
- classname)
- if reference_keepers.has_key(classname):
- rlist = reference_keepers[classname]
- for ref in rlist:
- classes.write(" self.%s = None\n" % ref[1])
- classes.write(" self._o = _obj\n")
- classes.write(" %s.__init__(self, _obj=_obj)\n\n" % (
- classes_ancestor[classname]))
- if classes_ancestor[classname] == "xmlCore" or \
- classes_ancestor[classname] == "xmlNode":
- classes.write(" def __repr__(self):\n")
- format = "<%s (%%s) object at 0x%%x>" % (classname)
- classes.write(" return \"%s\" %% (self.name, long(pos_id (self)))\n\n" % (
- format))
- else:
- txt.write("Class %s()\n" % (classname))
- classes.write("class %s:\n" % (classname))
- classes.write(" def __init__(self, _obj=None):\n")
- if reference_keepers.has_key(classname):
- list = reference_keepers[classname]
- for ref in list:
- classes.write(" self.%s = None\n" % ref[1])
- classes.write(" if _obj != None:self._o = _obj;return\n")
- classes.write(" self._o = None\n\n");
- destruct=None
- if classes_destructors.has_key(classname):
- classes.write(" def __del__(self):\n")
- classes.write(" if self._o != None:\n")
- classes.write(" libxml2mod.%s(self._o)\n" %
- classes_destructors[classname]);
- classes.write(" self._o = None\n\n");
- destruct=classes_destructors[classname]
- flist = function_classes[classname]
- flist.sort(functionCompare)
- oldfile = ""
- for info in flist:
- (index, func, name, ret, args, file) = info
- #
- # Do not provide as method the destructors for the class
- # to avoid double free
- #
- if name == destruct:
- continue;
- if file != oldfile:
- if file == "python_accessor":
- classes.write(" # accessors for %s\n" % (classname))
- txt.write(" # accessors\n")
- else:
- classes.write(" #\n")
- classes.write(" # %s functions from module %s\n" % (
- classname, file))
- txt.write("\n # functions from module %s\n" % file)
- classes.write(" #\n\n")
- oldfile = file
- classes.write(" def %s(self" % func)
- txt.write(" %s()\n" % func);
- n = 0
- for arg in args:
- if n != index:
- classes.write(", %s" % arg[0])
- n = n + 1
- classes.write("):\n")
- writeDoc(name, args, ' ', classes);
- n = 0
- for arg in args:
- if classes_type.has_key(arg[1]):
- if n != index:
- classes.write(" if %s is None: %s__o = None\n" %
- (arg[0], arg[0]))
- classes.write(" else: %s__o = %s%s\n" %
- (arg[0], arg[0], classes_type[arg[1]][0]))
- n = n + 1
- if ret[0] != "void":
- classes.write(" ret = ");
- else:
- classes.write(" ");
- classes.write("libxml2mod.%s(" % name)
- n = 0
- for arg in args:
- if n != 0:
- classes.write(", ");
- if n != index:
- classes.write("%s" % arg[0])
- if classes_type.has_key(arg[1]):
- classes.write("__o");
- else:
- classes.write("self");
- if classes_type.has_key(arg[1]):
- classes.write(classes_type[arg[1]][0])
- n = n + 1
- classes.write(")\n");
- if ret[0] != "void":
- if classes_type.has_key(ret[0]):
- #
- # Raise an exception
- #
- if functions_noexcept.has_key(name):
- classes.write(
- " if ret is None:return None\n");
- elif string.find(name, "URI") >= 0:
- classes.write(
- " if ret is None:raise uriError('%s() failed')\n"
- % (name))
- elif string.find(name, "XPath") >= 0:
- classes.write(
- " if ret is None:raise xpathError('%s() failed')\n"
- % (name))
- elif string.find(name, "Parse") >= 0:
- classes.write(
- " if ret is None:raise parserError('%s() failed')\n"
- % (name))
- else:
- classes.write(
- " if ret is None:raise treeError('%s() failed')\n"
- % (name))
-
- #
- # generate the returned class wrapper for the object
- #
- classes.write(" __tmp = ");
- classes.write(classes_type[ret[0]][1] % ("ret"));
- classes.write("\n");
+ if classname == "None":
+ pass
+ else:
+ if classes_ancestor.has_key(classname):
+ txt.write("\n\nClass %s(%s)\n" % (classname,
+ classes_ancestor[classname]))
+ classes.write("class %s(%s):\n" % (classname,
+ classes_ancestor[classname]))
+ classes.write(" def __init__(self, _obj=None):\n")
+ if classes_ancestor[classname] == "xmlCore" or \
+ classes_ancestor[classname] == "xmlNode":
+ classes.write(" if type(_obj).__name__ != ")
+ classes.write("'PyCObject':\n")
+ classes.write(" raise TypeError, ")
+ classes.write("'%s needs a PyCObject argument'\n" % \
+ classname)
+ if reference_keepers.has_key(classname):
+ rlist = reference_keepers[classname]
+ for ref in rlist:
+ classes.write(" self.%s = None\n" % ref[1])
+ classes.write(" self._o = _obj\n")
+ classes.write(" %s.__init__(self, _obj=_obj)\n\n" % (
+ classes_ancestor[classname]))
+ if classes_ancestor[classname] == "xmlCore" or \
+ classes_ancestor[classname] == "xmlNode":
+ classes.write(" def __repr__(self):\n")
+ format = "<%s (%%s) object at 0x%%x>" % (classname)
+ classes.write(" return \"%s\" %% (self.name, long(pos_id (self)))\n\n" % (
+ format))
+ else:
+ txt.write("Class %s()\n" % (classname))
+ classes.write("class %s:\n" % (classname))
+ classes.write(" def __init__(self, _obj=None):\n")
+ if reference_keepers.has_key(classname):
+ list = reference_keepers[classname]
+ for ref in list:
+ classes.write(" self.%s = None\n" % ref[1])
+ classes.write(" if _obj != None:self._o = _obj;return\n")
+ classes.write(" self._o = None\n\n")
+ destruct=None
+ if classes_destructors.has_key(classname):
+ classes.write(" def __del__(self):\n")
+ classes.write(" if self._o != None:\n")
+ classes.write(" libxml2mod.%s(self._o)\n" %
+ classes_destructors[classname])
+ classes.write(" self._o = None\n\n")
+ destruct=classes_destructors[classname]
+ flist = function_classes[classname]
+ flist.sort(functionCompare)
+ oldfile = ""
+ for info in flist:
+ (index, func, name, ret, args, file) = info
+ #
+ # Do not provide as method the destructors for the class
+ # to avoid double free
+ #
+ if name == destruct:
+ continue
+ if file != oldfile:
+ if file == "python_accessor":
+ classes.write(" # accessors for %s\n" % (classname))
+ txt.write(" # accessors\n")
+ else:
+ classes.write(" #\n")
+ classes.write(" # %s functions from module %s\n" % (
+ classname, file))
+ txt.write("\n # functions from module %s\n" % file)
+ classes.write(" #\n\n")
+ oldfile = file
+ classes.write(" def %s(self" % func)
+ txt.write(" %s()\n" % func)
+ n = 0
+ for arg in args:
+ if n != index:
+ classes.write(", %s" % arg[0])
+ n = n + 1
+ classes.write("):\n")
+ writeDoc(name, args, ' ', classes)
+ n = 0
+ for arg in args:
+ if classes_type.has_key(arg[1]):
+ if n != index:
+ classes.write(" if %s is None: %s__o = None\n" %
+ (arg[0], arg[0]))
+ classes.write(" else: %s__o = %s%s\n" %
+ (arg[0], arg[0], classes_type[arg[1]][0]))
+ n = n + 1
+ if ret[0] != "void":
+ classes.write(" ret = ")
+ else:
+ classes.write(" ")
+ classes.write("libxml2mod.%s(" % name)
+ n = 0
+ for arg in args:
+ if n != 0:
+ classes.write(", ")
+ if n != index:
+ classes.write("%s" % arg[0])
+ if classes_type.has_key(arg[1]):
+ classes.write("__o")
+ else:
+ classes.write("self")
+ if classes_type.has_key(arg[1]):
+ classes.write(classes_type[arg[1]][0])
+ n = n + 1
+ classes.write(")\n")
+ if ret[0] != "void":
+ if classes_type.has_key(ret[0]):
+ #
+ # Raise an exception
+ #
+ if functions_noexcept.has_key(name):
+ classes.write(
+ " if ret is None:return None\n")
+ elif string.find(name, "URI") >= 0:
+ classes.write(
+ " if ret is None:raise uriError('%s() failed')\n"
+ % (name))
+ elif string.find(name, "XPath") >= 0:
+ classes.write(
+ " if ret is None:raise xpathError('%s() failed')\n"
+ % (name))
+ elif string.find(name, "Parse") >= 0:
+ classes.write(
+ " if ret is None:raise parserError('%s() failed')\n"
+ % (name))
+ else:
+ classes.write(
+ " if ret is None:raise treeError('%s() failed')\n"
+ % (name))
#
- # Sometime one need to keep references of the source
- # class in the returned class object.
- # See reference_keepers for the list
- #
- tclass = classes_type[ret[0]][2]
- if reference_keepers.has_key(tclass):
- list = reference_keepers[tclass]
- for pref in list:
- if pref[0] == classname:
- classes.write(" __tmp.%s = self\n" %
- pref[1])
- #
- # return the class
- #
- classes.write(" return __tmp\n");
- elif converter_type.has_key(ret[0]):
- #
- # Raise an exception
- #
- if functions_noexcept.has_key(name):
- classes.write(
- " if ret is None:return None");
- elif string.find(name, "URI") >= 0:
- classes.write(
- " if ret is None:raise uriError('%s() failed')\n"
- % (name))
- elif string.find(name, "XPath") >= 0:
- classes.write(
- " if ret is None:raise xpathError('%s() failed')\n"
- % (name))
- elif string.find(name, "Parse") >= 0:
- classes.write(
- " if ret is None:raise parserError('%s() failed')\n"
- % (name))
- else:
- classes.write(
- " if ret is None:raise treeError('%s() failed')\n"
- % (name))
- classes.write(" return ");
- classes.write(converter_type[ret[0]] % ("ret"));
- classes.write("\n");
- else:
- classes.write(" return ret\n");
- classes.write("\n");
+ # generate the returned class wrapper for the object
+ #
+ classes.write(" __tmp = ")
+ classes.write(classes_type[ret[0]][1] % ("ret"))
+ classes.write("\n")
+
+ #
+ # Sometime one need to keep references of the source
+ # class in the returned class object.
+ # See reference_keepers for the list
+ #
+ tclass = classes_type[ret[0]][2]
+ if reference_keepers.has_key(tclass):
+ list = reference_keepers[tclass]
+ for pref in list:
+ if pref[0] == classname:
+ classes.write(" __tmp.%s = self\n" %
+ pref[1])
+ #
+ # return the class
+ #
+ classes.write(" return __tmp\n")
+ elif converter_type.has_key(ret[0]):
+ #
+ # Raise an exception
+ #
+ if functions_noexcept.has_key(name):
+ classes.write(
+ " if ret is None:return None")
+ elif string.find(name, "URI") >= 0:
+ classes.write(
+ " if ret is None:raise uriError('%s() failed')\n"
+ % (name))
+ elif string.find(name, "XPath") >= 0:
+ classes.write(
+ " if ret is None:raise xpathError('%s() failed')\n"
+ % (name))
+ elif string.find(name, "Parse") >= 0:
+ classes.write(
+ " if ret is None:raise parserError('%s() failed')\n"
+ % (name))
+ else:
+ classes.write(
+ " if ret is None:raise treeError('%s() failed')\n"
+ % (name))
+ classes.write(" return ")
+ classes.write(converter_type[ret[0]] % ("ret"))
+ classes.write("\n")
+ else:
+ classes.write(" return ret\n")
+ classes.write("\n")
#
# Generate enum constants
@@ -1224,7 +1224,7 @@ def buildWrappers():
items.sort(lambda i1,i2: cmp(long(i1[1]),long(i2[1])))
for name,value in items:
classes.write("%s = %s\n" % (name,value))
- classes.write("\n");
+ classes.write("\n")
txt.close()
classes.close()
diff --git a/python/libxml.c b/python/libxml.c
index 747e44c..95b3cb9 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -23,6 +23,7 @@
#include <libxml/xmlmemory.h>
#include <libxml/xmlIO.h>
#include <libxml/c14n.h>
+#include <libxml/xmlreader.h>
#include "libxml_wrap.h"
#include "libxml2-py.h"
@@ -1890,6 +1891,7 @@ libxml_xmlFreeValidCtxt(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) {
return(Py_None);
}
+#ifdef LIBXML_READER_ENABLED
/************************************************************************
* *
* Per xmlTextReader error handler *
@@ -2059,6 +2061,7 @@ libxml_xmlFreeTextReader(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
Py_INCREF(Py_None);
return(Py_None);
}
+#endif
/************************************************************************
* *
@@ -3750,9 +3753,11 @@ static PyMethodDef libxmlMethods[] = {
{(char *)"xmlParserCtxtSetErrorHandler", libxml_xmlParserCtxtSetErrorHandler, METH_VARARGS, NULL },
{(char *)"xmlParserCtxtGetErrorHandler", libxml_xmlParserCtxtGetErrorHandler, METH_VARARGS, NULL },
{(char *)"xmlFreeParserCtxt", libxml_xmlFreeParserCtxt, METH_VARARGS, NULL },
+#ifdef LIBXML_READER_ENABLED
{(char *)"xmlTextReaderSetErrorHandler", libxml_xmlTextReaderSetErrorHandler, METH_VARARGS, NULL },
{(char *)"xmlTextReaderGetErrorHandler", libxml_xmlTextReaderGetErrorHandler, METH_VARARGS, NULL },
{(char *)"xmlFreeTextReader", libxml_xmlFreeTextReader, METH_VARARGS, NULL },
+#endif
{(char *)"addLocalCatalog", libxml_addLocalCatalog, METH_VARARGS, NULL },
#ifdef LIBXML_SCHEMAS_ENABLED
{(char *)"xmlRelaxNGSetValidErrors", libxml_xmlRelaxNGSetValidErrors, METH_VARARGS, NULL},
diff --git a/python/libxml_wrap.h b/python/libxml_wrap.h
index 2758e99..eaa5e96 100644
--- a/python/libxml_wrap.h
+++ b/python/libxml_wrap.h
@@ -99,6 +99,7 @@ typedef struct {
} PyxmlReg_Object;
#endif /* LIBXML_REGEXP_ENABLED */
+#ifdef LIBXML_READER_ENABLED
#define PyxmlTextReader_Get(v) (((v) == Py_None) ? NULL : \
(((PyxmlTextReader_Object *)(v))->obj))
@@ -114,6 +115,7 @@ typedef struct {
PyObject_HEAD
xmlTextReaderLocatorPtr obj;
} PyxmlTextReaderLocator_Object;
+#endif
#define PyURI_Get(v) (((v) == Py_None) ? NULL : \
(((PyURI_Object *)(v))->obj))
@@ -229,8 +231,10 @@ PyObject * libxml_xmlParserInputBufferPtrWrap(xmlParserInputBufferPtr buffer);
#ifdef LIBXML_REGEXP_ENABLED
PyObject * libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp);
#endif /* LIBXML_REGEXP_ENABLED */
+#ifdef LIBXML_READER_ENABLED
PyObject * libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader);
PyObject * libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocatorPtr locator);
+#endif
xmlXPathObjectPtr libxml_xmlXPathObjectPtrConvert(PyObject * obj);
#ifdef LIBXML_SCHEMAS_ENABLED
diff --git a/python/setup.py b/python/setup.py
index b54da49..723a4c9 100755
--- a/python/setup.py
+++ b/python/setup.py
@@ -226,7 +226,7 @@ else:
setup (name = "libxml2-python",
# On *nix, the version number is created from setup.py.in
# On windows, it is set by configure.js
- version = "2.6.32",
+ version = "2.7.0",
description = descr,
author = "Daniel Veillard",
author_email = "veillard@redhat.com",
diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in
index 914e222..d7c00e5 100644
--- a/python/tests/Makefile.in
+++ b/python/tests/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
diff --git a/python/types.c b/python/types.c
index 80e4304..54b50de 100644
--- a/python/types.c
+++ b/python/types.c
@@ -720,6 +720,7 @@ libxml_xmlRegexpPtrWrap(xmlRegexpPtr regexp)
}
#endif /* LIBXML_REGEXP_ENABLED */
+#ifdef LIBXML_READER_ENABLED
PyObject *
libxml_xmlTextReaderPtrWrap(xmlTextReaderPtr reader)
{
@@ -755,6 +756,7 @@ libxml_xmlTextReaderLocatorPtrWrap(xmlTextReaderLocatorPtr locator)
(char *) "xmlTextReaderLocatorPtr", NULL);
return (ret);
}
+#endif /* LIBXML_READER_ENABLED */
#ifdef LIBXML_SCHEMAS_ENABLED
PyObject *
diff --git a/relaxng.c b/relaxng.c
index 60fdbab..6459769 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -6495,6 +6495,8 @@ xmlRelaxNGParseGrammar(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes)
ctxt);
}
+ /* @@@@ */
+
ctxt->grammar = old;
return (ret);
}
@@ -8812,6 +8814,8 @@ xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt,
}
case XML_RELAXNG_REF:
case XML_RELAXNG_PARENTREF:
+ if (define->content == NULL) {
+ }
ret = xmlRelaxNGValidateValue(ctxt, define->content);
break;
default:
diff --git a/runsuite.c b/runsuite.c
index 744875c..af8ee5e 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -358,7 +358,7 @@ done:
if (rng != NULL)
xmlRelaxNGFree(rng);
xmlResetLastError();
- if ((memt != xmlMemUsed()) && (extraMemoryFromResolver == 0)) {
+ if ((memt < xmlMemUsed()) && (extraMemoryFromResolver == 0)) {
test_log("Validation of tests starting line %ld leaked %d\n",
xmlGetLineNo(cur), xmlMemUsed() - memt);
nb_leaks++;
diff --git a/runtest.c b/runtest.c
index b694d56..c7d11fa 100644
--- a/runtest.c
+++ b/runtest.c
@@ -129,7 +129,7 @@ static int glob(const char *pattern, int flags,
int len;
if ((pattern == NULL) || (pglob == NULL)) return(-1);
-
+
strncpy(directory, pattern, 499);
for (len = strlen(directory);len >= 0;len--) {
if (directory[len] == '/') {
@@ -141,12 +141,12 @@ static int glob(const char *pattern, int flags,
if (len <= 0)
len = 0;
-
+
ret = pglob;
memset(ret, 0, sizeof(glob_t));
-
+
hFind = FindFirstFileA(pattern, &FindFileData);
- if (hFind == INVALID_HANDLE_VALUE)
+ if (hFind == INVALID_HANDLE_VALUE)
return(0);
nb_paths = 20;
ret->gl_pathv = (char **) malloc(nb_paths * sizeof(char *));
@@ -181,14 +181,14 @@ done:
FindClose(hFind);
return(0);
}
-
+
static void globfree(glob_t *pglob) {
unsigned int i;
if (pglob == NULL)
return;
-
+
for (i = 0;i < pglob->gl_pathc;i++) {
if (pglob->gl_pathv[i] != NULL)
free(pglob->gl_pathv[i]);
@@ -222,7 +222,7 @@ fatalError(void) {
* which is shared to the current running test. We also don't want to have
* network downloads modifying tests.
*/
-static xmlParserInputPtr
+static xmlParserInputPtr
testExternalEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt) {
xmlParserInputPtr ret;
@@ -234,7 +234,7 @@ testExternalEntityLoader(const char *URL, const char *ID,
ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
extraMemoryFromResolver += xmlMemUsed() - memused;
}
-
+
return(ret);
}
@@ -292,12 +292,12 @@ channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {
/**
* xmlParserPrintFileContext:
* @input: an xmlParserInputPtr input
- *
+ *
* Displays current context within the input content for error tracking
*/
static void
-xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
+xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
xmlGenericErrorFunc chanl, void *data ) {
const xmlChar *cur, *base;
unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */
@@ -313,8 +313,8 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
}
n = 0;
/* search backwards for beginning-of-line (to max buff size) */
- while ((n++ < (sizeof(content)-1)) && (cur > base) &&
- (*(cur) != '\n') && (*(cur) != '\r'))
+ while ((n++ < (sizeof(content)-1)) && (cur > base) &&
+ (*(cur) != '\n') && (*(cur) != '\r'))
cur--;
if ((*(cur) == '\n') || (*(cur) == '\r')) cur++;
/* calculate the error position in terms of the current position */
@@ -323,8 +323,8 @@ xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
n = 0;
ctnt = content;
/* copy selected text to our buffer */
- while ((*cur != 0) && (*(cur) != '\n') &&
- (*(cur) != '\r') && (n < sizeof(content)-1)) {
+ while ((*cur != 0) && (*(cur) != '\n') &&
+ (*(cur) != '\r') && (n < sizeof(content)-1)) {
*ctnt++ = *cur++;
n++;
}
@@ -573,7 +573,7 @@ static char *resultFilename(const char *filename, const char *out,
(filename[4] == '/'))
filename = &filename[5];
*************/
-
+
base = baseFilename(filename);
if (suffix == NULL)
suffix = ".tmp";
@@ -650,7 +650,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) {
int idx = 0;
struct stat info;
- if (stat(filename, &info) < 0)
+ if (stat(filename, &info) < 0)
return(-1);
if (info.st_size != size)
return(-1);
@@ -661,7 +661,7 @@ static int compareFileMem(const char *filename, const char *mem, int size) {
res = read(fd, bytes, 4096);
if (res <= 0)
break;
- if (res + idx > size)
+ if (res + idx > size)
break;
if (memcmp(bytes, &mem[idx], res) != 0) {
int ix;
@@ -683,7 +683,7 @@ static int loadMem(const char *filename, const char **mem, int *size) {
struct stat info;
char *base;
int siz = 0;
- if (stat(filename, &info) < 0)
+ if (stat(filename, &info) < 0)
return(-1);
base = malloc(info.st_size + 1);
if (base == NULL)
@@ -893,7 +893,7 @@ resolveEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *publicId, const xm
return(NULL);
/* xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; */
-
+
fprintf(SAXdebug, "SAX.resolveEntity(");
if (publicId != NULL)
fprintf(SAXdebug, "%s", (char *)publicId);
@@ -953,8 +953,8 @@ getParameterEntityDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
/**
* entityDeclDebug:
* @ctxt: An XML parser context
- * @name: the entity name
- * @type: the entity type
+ * @name: the entity name
+ * @type: the entity type
* @publicId: The public ID of the entity
* @systemId: The system ID of the entity
* @content: the entity value (without processing).
@@ -983,8 +983,8 @@ const xmlChar *nullstr = BAD_CAST "(null)";
/**
* attributeDeclDebug:
* @ctxt: An XML parser context
- * @name: the attribute name
- * @type: the attribute type
+ * @name: the attribute name
+ * @type: the attribute type
*
* An attribute definition has been parsed
*/
@@ -1008,8 +1008,8 @@ attributeDeclDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar * elem,
/**
* elementDeclDebug:
* @ctxt: An XML parser context
- * @name: the element name
- * @type: the element type
+ * @name: the element name
+ * @type: the element type
* @content: the element value (without processing).
*
* An element definition has been parsed
@@ -1195,7 +1195,7 @@ charactersDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *ch, int len)
* @ctxt: An XML parser context
* @name: The entity name
*
- * called when an entity reference is detected.
+ * called when an entity reference is detected.
*/
static void
referenceDebug(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name)
@@ -1431,7 +1431,7 @@ startElementNsDebug(void *ctx ATTRIBUTE_UNUSED,
else
fprintf(SAXdebug, ", '%s'", (char *) URI);
fprintf(SAXdebug, ", %d", nb_namespaces);
-
+
if (namespaces != NULL) {
for (i = 0;i < nb_namespaces * 2;i++) {
fprintf(SAXdebug, ", xmlns");
@@ -1707,7 +1707,7 @@ saxParseTest(const char *filename, const char *result,
} else
unlink(temp);
free(temp);
-
+
/* switch back to structured error handling */
xmlSetGenericErrorFunc(NULL, NULL);
xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler);
@@ -1814,7 +1814,7 @@ pushParseTest(const char *filename, const char *result,
fprintf(stderr, "Failed to load %s\n", filename);
return(-1);
}
-
+
#ifdef LIBXML_HTML_ENABLED
if (options & XML_PARSE_HTML)
ctxt = htmlCreatePushParserCtxt(NULL, NULL, base + cur, 4, filename,
@@ -1911,7 +1911,7 @@ memParseTest(const char *filename, const char *result,
fprintf(stderr, "Failed to load %s\n", filename);
return(-1);
}
-
+
doc = xmlReadMemory(base, size, filename, NULL, 0);
unloadMem(base);
if (doc == NULL) {
@@ -2076,8 +2076,8 @@ static void processNode(FILE *out, xmlTextReaderPtr reader) {
value = xmlTextReaderConstValue(reader);
-
- fprintf(out, "%d %d %s %d %d",
+
+ fprintf(out, "%d %d %s %d %d",
xmlTextReaderDepth(reader),
type,
name,
@@ -2265,7 +2265,7 @@ static void
testXPath(const char *str, int xptr, int expr) {
xmlXPathObjectPtr res;
xmlXPathContextPtr ctxt;
-
+
nb_tests++;
#if defined(LIBXML_XPTR_ENABLED)
if (xptr) {
@@ -2336,10 +2336,10 @@ xpathCommonTest(const char *filename, const char *result,
while (fgets(expression, 4500, input) != NULL) {
len = strlen(expression);
len--;
- while ((len >= 0) &&
+ while ((len >= 0) &&
((expression[len] == '\n') || (expression[len] == '\t') ||
(expression[len] == '\r') || (expression[len] == ' '))) len--;
- expression[len + 1] = 0;
+ expression[len + 1] = 0;
if (len >= 0) {
fprintf(xpathOutput,
"\n========================\nExpression: %s\n",
@@ -3217,7 +3217,7 @@ rngTest(const char *filename,
* @result: the file with expected result
* @err: the file with error messages
*
- * Parse a set of files with streaming, applying an RNG schemas
+ * Parse a set of files with streaming, applying an RNG schemas
*
* Returns 0 in case of success, an error code otherwise
*/
@@ -3257,7 +3257,7 @@ rngStreamTest(const char *filename,
* hack is also done in the Makefile
*/
if ((!strcmp(prefix, "tutor10_1")) || (!strcmp(prefix, "tutor10_2")) ||
- (!strcmp(prefix, "tutor3_2")) || (!strcmp(prefix, "307377")))
+ (!strcmp(prefix, "tutor3_2")) || (!strcmp(prefix, "307377")))
disable_err = 1;
snprintf(pattern, 499, "./test/relaxng/%s_?.xml", prefix);
@@ -3321,7 +3321,7 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader,
type = xmlTextReaderNodeType(reader);
empty = xmlTextReaderIsEmptyElement(reader);
-
+
if (type == XML_READER_TYPE_ELEMENT) {
/* do the check only on element start */
match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader));
@@ -3353,9 +3353,9 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader,
" pattern %s node %s\n",
pattern, path);
}
-
- }
+
+ }
if ((type == XML_READER_TYPE_END_ELEMENT) ||
((type == XML_READER_TYPE_ELEMENT) && (empty))) {
ret = xmlStreamPop(patstream);
@@ -3376,7 +3376,7 @@ static void patternNode(FILE *out, xmlTextReaderPtr reader,
* @result: the file with expected result
* @err: the file with error messages
*
- * Parse a set of files with streaming, applying an RNG schemas
+ * Parse a set of files with streaming, applying an RNG schemas
*
* Returns 0 in case of success, an error code otherwise
*/
@@ -3525,13 +3525,13 @@ patternTest(const char *filename,
************************************************************************/
static xmlXPathObjectPtr
load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
- xmlXPathObjectPtr xpath;
+ xmlXPathObjectPtr xpath;
xmlDocPtr doc;
xmlChar *expr;
- xmlXPathContextPtr ctx;
+ xmlXPathContextPtr ctx;
xmlNodePtr node;
xmlNsPtr ns;
-
+
/*
* load XPath expr as a file
*/
@@ -3543,10 +3543,10 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
fprintf(stderr, "Error: unable to parse file \"%s\"\n", filename);
return(NULL);
}
-
+
/*
* Check the document is of the right kind
- */
+ */
if(xmlDocGetRootElement(doc) == NULL) {
fprintf(stderr,"Error: empty document for file \"%s\"\n", filename);
xmlFreeDoc(doc);
@@ -3557,8 +3557,8 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
while(node != NULL && !xmlStrEqual(node->name, (const xmlChar *)"XPath")) {
node = node->next;
}
-
- if(node == NULL) {
+
+ if(node == NULL) {
fprintf(stderr,"Error: XPath element expected in the file \"%s\"\n", filename);
xmlFreeDoc(doc);
return(NULL);
@@ -3574,8 +3574,8 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
ctx = xmlXPathNewContext(parent_doc);
if(ctx == NULL) {
fprintf(stderr,"Error: unable to create new context\n");
- xmlFree(expr);
- xmlFreeDoc(doc);
+ xmlFree(expr);
+ xmlFreeDoc(doc);
return(NULL);
}
@@ -3586,31 +3586,31 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
while(ns != NULL) {
if(xmlXPathRegisterNs(ctx, ns->prefix, ns->href) != 0) {
fprintf(stderr,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", ns->prefix, ns->href);
- xmlFree(expr);
- xmlXPathFreeContext(ctx);
- xmlFreeDoc(doc);
+ xmlFree(expr);
+ xmlXPathFreeContext(ctx);
+ xmlFreeDoc(doc);
return(NULL);
}
ns = ns->next;
}
- /*
+ /*
* Evaluate xpath
*/
xpath = xmlXPathEvalExpression(expr, ctx);
if(xpath == NULL) {
fprintf(stderr,"Error: unable to evaluate xpath expression\n");
- xmlFree(expr);
- xmlXPathFreeContext(ctx);
- xmlFreeDoc(doc);
+xmlFree(expr);
+ xmlXPathFreeContext(ctx);
+ xmlFreeDoc(doc);
return(NULL);
}
/* print_xpath_nodes(xpath->nodesetval); */
- xmlFree(expr);
- xmlXPathFreeContext(ctx);
- xmlFreeDoc(doc);
+ xmlFree(expr);
+ xmlXPathFreeContext(ctx);
+ xmlFreeDoc(doc);
return(xpath);
}
@@ -3620,7 +3620,7 @@ load_xpath_expr (xmlDocPtr parent_doc, const char* filename) {
#define xxx_growBufferReentrant() { \
buffer_size *= 2; \
buffer = (xmlChar **) \
- xmlRealloc(buffer, buffer_size * sizeof(xmlChar*)); \
+ xmlRealloc(buffer, buffer_size * sizeof(xmlChar*)); \
if (buffer == NULL) { \
perror("realloc failed"); \
return(NULL); \
@@ -3654,7 +3654,7 @@ parse_list(xmlChar *str) {
return(NULL);
}
out = buffer;
-
+
while(*str != '\0') {
if (out - buffer > buffer_size - 10) {
int indx = out - buffer;
@@ -3670,12 +3670,12 @@ parse_list(xmlChar *str) {
return buffer;
}
-static int
+static int
c14nRunTest(const char* xml_filename, int with_comments, int exclusive,
const char* xpath_filename, const char *ns_filename,
const char* result_file) {
xmlDocPtr doc;
- xmlXPathObjectPtr xpath = NULL;
+ xmlXPathObjectPtr xpath = NULL;
xmlChar *result = NULL;
int ret;
xmlChar **inclusive_namespaces = NULL;
@@ -3695,24 +3695,24 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive,
fprintf(stderr, "Error: unable to parse file \"%s\"\n", xml_filename);
return(-1);
}
-
+
/*
* Check the document is of the right kind
- */
+ */
if(xmlDocGetRootElement(doc) == NULL) {
fprintf(stderr,"Error: empty document for file \"%s\"\n", xml_filename);
xmlFreeDoc(doc);
return(-1);
}
- /*
- * load xpath file if specified
+ /*
+ * load xpath file if specified
*/
if(xpath_filename) {
xpath = load_xpath_expr(doc, xpath_filename);
if(xpath == NULL) {
fprintf(stderr,"Error: unable to evaluate xpath expression\n");
- xmlFreeDoc(doc);
+ xmlFreeDoc(doc);
return(-1);
}
}
@@ -3721,7 +3721,7 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive,
if (loadMem(ns_filename, &nslist, &nssize)) {
fprintf(stderr,"Error: unable to evaluate xpath expression\n");
if(xpath != NULL) xmlXPathFreeObject(xpath);
- xmlFreeDoc(doc);
+ xmlFreeDoc(doc);
return(-1);
}
inclusive_namespaces = parse_list((xmlChar *) nslist);
@@ -3729,10 +3729,10 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive,
/*
* Canonical form
- */
+ */
/* fprintf(stderr,"File \"%s\" loaded: start canonization\n", xml_filename); */
- ret = xmlC14NDocDumpMemory(doc,
- (xpath) ? xpath->nodesetval : NULL,
+ ret = xmlC14NDocDumpMemory(doc,
+ (xpath) ? xpath->nodesetval : NULL,
exclusive, inclusive_namespaces,
with_comments, &result);
if (ret >= 0) {
@@ -3746,15 +3746,15 @@ c14nRunTest(const char* xml_filename, int with_comments, int exclusive,
fprintf(stderr,"Error: failed to canonicalize XML file \"%s\" (ret=%d)\n", xml_filename, ret);
ret = -1;
}
-
+
/*
* Cleanup
- */
+ */
if (result != NULL) xmlFree(result);
if(xpath != NULL) xmlXPathFreeObject(xpath);
if (inclusive_namespaces != NULL) xmlFree(inclusive_namespaces);
if (nslist != NULL) free((char *) nslist);
- xmlFreeDoc(doc);
+ xmlFreeDoc(doc);
return(ret);
}
@@ -3903,7 +3903,7 @@ thread_specific_data(void *private_data)
return ((void *) Okay);
}
-#if defined(linux) || defined(solaris)
+#if defined(linux) || defined(solaris) || defined(__APPLE_CC__)
#include <pthread.h>
@@ -3917,7 +3917,7 @@ testThread(void)
void *results[MAX_ARGC];
int ret;
int res = 0;
-
+
xmlInitParser();
for (repeat = 0; repeat < 500; repeat++) {
@@ -3993,7 +3993,7 @@ testThread(void)
DWORD useless;
tid[i] = CreateThread(NULL, 0,
- win32_thread_specific_data,
+ win32_thread_specific_data,
(void *) testfiles[i], 0,
&useless);
if (tid[i] == NULL) {
@@ -4091,7 +4091,7 @@ testThread(void)
return (-1);
}
#endif
-static int
+static int
threadsTest(const char *filename ATTRIBUTE_UNUSED,
const char *resul ATTRIBUTE_UNUSED,
const char *err ATTRIBUTE_UNUSED,
@@ -4183,19 +4183,23 @@ testDesc testDescriptions[] = {
errParseTest, "./test/XInclude/docs/*", "result/XInclude/", "", NULL,
/* Ignore errors at this point ".err", */
XML_PARSE_XINCLUDE },
+#ifdef LIBXML_READER_ENABLED
{ "XInclude xmlReader regression tests",
streamParseTest, "./test/XInclude/docs/*", "result/XInclude/", ".rdr",
/* Ignore errors at this point ".err", */
NULL, XML_PARSE_XINCLUDE },
+#endif
{ "XInclude regression tests stripping include nodes" ,
errParseTest, "./test/XInclude/docs/*", "result/XInclude/", "", NULL,
/* Ignore errors at this point ".err", */
XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE },
+#ifdef LIBXML_READER_ENABLED
{ "XInclude xmlReader regression tests stripping include nodes",
streamParseTest, "./test/XInclude/docs/*", "result/XInclude/", ".rdr",
/* Ignore errors at this point ".err", */
NULL, XML_PARSE_XINCLUDE | XML_PARSE_NOXINCNODE },
#endif
+#endif
#ifdef LIBXML_XPATH_ENABLED
#ifdef LIBXML_DEBUG_ENABLED
{ "XPath expressions regression tests" ,
@@ -4388,7 +4392,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
initializeLibxml2();
-
for (a = 1; a < argc;a++) {
if (!strcmp(argv[a], "-v"))
verbose = 1;
diff --git a/runxmlconf.c b/runxmlconf.c
new file mode 100644
index 0000000..0529058
--- /dev/null
+++ b/runxmlconf.c
@@ -0,0 +1,603 @@
+/*
+ * runsuite.c: C program to run libxml2 againts published testsuites
+ *
+ * See Copyright for the status of this software.
+ *
+ * daniel@veillard.com
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "libxml.h"
+#else
+#include <stdio.h>
+#endif
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#include <unistd.h>
+#endif
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+#include <libxml/tree.h>
+#include <libxml/uri.h>
+#include <libxml/xmlreader.h>
+
+#include <libxml/xpath.h>
+#include <libxml/xpathInternals.h>
+
+#define LOGFILE "runxmlconf.log"
+static FILE *logfile = NULL;
+static int verbose = 0;
+
+
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#define vsnprintf _vsnprintf
+
+#define snprintf _snprintf
+
+#endif
+
+const char *skipped_tests[] = {
+/* http://lists.w3.org/Archives/Public/public-xml-testsuite/2008Jul/0000.html */
+ "rmt-ns10-035",
+ NULL
+};
+
+/************************************************************************
+ * *
+ * File name and path utilities *
+ * *
+ ************************************************************************/
+
+static int checkTestFile(const char *filename) {
+ struct stat buf;
+
+ if (stat(filename, &buf) == -1)
+ return(0);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!(buf.st_mode & _S_IFREG))
+ return(0);
+#else
+ if (!S_ISREG(buf.st_mode))
+ return(0);
+#endif
+
+ return(1);
+}
+
+static xmlChar *composeDir(const xmlChar *dir, const xmlChar *path) {
+ char buf[500];
+
+ if (dir == NULL) return(xmlStrdup(path));
+ if (path == NULL) return(NULL);
+
+ snprintf(buf, 500, "%s/%s", (const char *) dir, (const char *) path);
+ return(xmlStrdup((const xmlChar *) buf));
+}
+
+/************************************************************************
+ * *
+ * Libxml2 specific routines *
+ * *
+ ************************************************************************/
+
+static int nb_skipped = 0;
+static int nb_tests = 0;
+static int nb_errors = 0;
+static int nb_leaks = 0;
+
+/*
+ * We need to trap calls to the resolver to not account memory for the catalog
+ * and not rely on any external resources.
+ */
+static xmlParserInputPtr
+testExternalEntityLoader(const char *URL, const char *ID ATTRIBUTE_UNUSED,
+ xmlParserCtxtPtr ctxt) {
+ xmlParserInputPtr ret;
+
+ ret = xmlNewInputFromFile(ctxt, (const char *) URL);
+
+ return(ret);
+}
+
+/*
+ * Trapping the error messages at the generic level to grab the equivalent of
+ * stderr messages on CLI tools.
+ */
+static char testErrors[32769];
+static int testErrorsSize = 0;
+static int nbError = 0;
+static int nbFatal = 0;
+
+static void test_log(const char *msg, ...) {
+ va_list args;
+ if (logfile != NULL) {
+ fprintf(logfile, "\n------------\n");
+ va_start(args, msg);
+ vfprintf(logfile, msg, args);
+ va_end(args);
+ fprintf(logfile, "%s", testErrors);
+ testErrorsSize = 0; testErrors[0] = 0;
+ }
+ if (verbose) {
+ va_start(args, msg);
+ vfprintf(stderr, msg, args);
+ va_end(args);
+ }
+}
+
+static void
+testErrorHandler(void *userData ATTRIBUTE_UNUSED, xmlErrorPtr error) {
+ int res;
+
+ if (testErrorsSize >= 32768)
+ return;
+ res = snprintf(&testErrors[testErrorsSize],
+ 32768 - testErrorsSize,
+ "%s:%d: %s\n", (error->file ? error->file : "entity"),
+ error->line, error->message);
+ if (error->level == XML_ERR_FATAL)
+ nbFatal++;
+ else if (error->level == XML_ERR_ERROR)
+ nbError++;
+ if (testErrorsSize + res >= 32768) {
+ /* buffer is full */
+ testErrorsSize = 32768;
+ testErrors[testErrorsSize] = 0;
+ } else {
+ testErrorsSize += res;
+ }
+ testErrors[testErrorsSize] = 0;
+}
+
+static xmlXPathContextPtr ctxtXPath;
+
+static void
+initializeLibxml2(void) {
+ xmlGetWarningsDefaultValue = 0;
+ xmlPedanticParserDefault(0);
+
+ xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup);
+ xmlInitParser();
+ xmlSetExternalEntityLoader(testExternalEntityLoader);
+ ctxtXPath = xmlXPathNewContext(NULL);
+ /*
+ * Deactivate the cache if created; otherwise we have to create/free it
+ * for every test, since it will confuse the memory leak detection.
+ * Note that normally this need not be done, since the cache is not
+ * created until set explicitely with xmlXPathContextSetCache();
+ * but for test purposes it is sometimes usefull to activate the
+ * cache by default for the whole library.
+ */
+ if (ctxtXPath->cache != NULL)
+ xmlXPathContextSetCache(ctxtXPath, 0, -1, 0);
+ xmlSetStructuredErrorFunc(NULL, testErrorHandler);
+}
+
+/************************************************************************
+ * *
+ * Run the xmlconf test if found *
+ * *
+ ************************************************************************/
+
+static int
+xmlconfTestInvalid(const char *id, const char *filename, int options) {
+ xmlDocPtr doc;
+ xmlParserCtxtPtr ctxt;
+ int ret = 1;
+
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ test_log("test %s : %s out of memory\n",
+ id, filename);
+ return(0);
+ }
+ doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
+ if (doc == NULL) {
+ test_log("test %s : %s invalid document turned not well-formed too\n",
+ id, filename);
+ } else {
+ /* invalidity should be reported both in the context and in the document */
+ if ((ctxt->valid != 0) || (doc->properties & XML_DOC_DTDVALID)) {
+ test_log("test %s : %s failed to detect invalid document\n",
+ id, filename);
+ nb_errors++;
+ ret = 0;
+ }
+ xmlFreeDoc(doc);
+ }
+ xmlFreeParserCtxt(ctxt);
+ return(ret);
+}
+
+static int
+xmlconfTestValid(const char *id, const char *filename, int options) {
+ xmlDocPtr doc;
+ xmlParserCtxtPtr ctxt;
+ int ret = 1;
+
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ test_log("test %s : %s out of memory\n",
+ id, filename);
+ return(0);
+ }
+ doc = xmlCtxtReadFile(ctxt, filename, NULL, options);
+ if (doc == NULL) {
+ test_log("test %s : %s failed to parse a valid document\n",
+ id, filename);
+ nb_errors++;
+ ret = 0;
+ } else {
+ /* validity should be reported both in the context and in the document */
+ if ((ctxt->valid == 0) || ((doc->properties & XML_DOC_DTDVALID) == 0)) {
+ test_log("test %s : %s failed to validate a valid document\n",
+ id, filename);
+ nb_errors++;
+ ret = 0;
+ }
+ xmlFreeDoc(doc);
+ }
+ xmlFreeParserCtxt(ctxt);
+ return(ret);
+}
+
+static int
+xmlconfTestNotNSWF(const char *id, const char *filename, int options) {
+ xmlDocPtr doc;
+ int ret = 1;
+
+ /*
+ * In case of Namespace errors, libxml2 will still parse the document
+ * but log a Namesapce error.
+ */
+ doc = xmlReadFile(filename, NULL, options);
+ if (doc == NULL) {
+ test_log("test %s : %s failed to parse the XML\n",
+ id, filename);
+ nb_errors++;
+ ret = 0;
+ } else {
+ if ((xmlLastError.code == XML_ERR_OK) ||
+ (xmlLastError.domain != XML_FROM_NAMESPACE)) {
+ test_log("test %s : %s failed to detect namespace error\n",
+ id, filename);
+ nb_errors++;
+ ret = 0;
+ }
+ xmlFreeDoc(doc);
+ }
+ return(ret);
+}
+
+static int
+xmlconfTestNotWF(const char *id, const char *filename, int options) {
+ xmlDocPtr doc;
+ int ret = 1;
+
+ doc = xmlReadFile(filename, NULL, options);
+ if (doc != NULL) {
+ test_log("test %s : %s failed to detect not well formedness\n",
+ id, filename);
+ nb_errors++;
+ xmlFreeDoc(doc);
+ ret = 0;
+ }
+ return(ret);
+}
+
+static int
+xmlconfTestItem(xmlDocPtr doc, xmlNodePtr cur) {
+ int ret = -1;
+ xmlChar *type = NULL;
+ xmlChar *filename = NULL;
+ xmlChar *uri = NULL;
+ xmlChar *base = NULL;
+ xmlChar *id = NULL;
+ xmlChar *rec = NULL;
+ xmlChar *version = NULL;
+ xmlChar *entities = NULL;
+ xmlChar *edition = NULL;
+ int options = 0;
+ int nstest = 0;
+ int mem, final;
+ int i;
+
+ testErrorsSize = 0; testErrors[0] = 0;
+ nbError = 0;
+ nbFatal = 0;
+ id = xmlGetProp(cur, BAD_CAST "ID");
+ if (id == NULL) {
+ test_log("test missing ID, line %ld\n", xmlGetLineNo(cur));
+ goto error;
+ }
+ for (i = 0;skipped_tests[i] != NULL;i++) {
+ if (!strcmp(skipped_tests[i], (char *) id)) {
+ test_log("Skipping test %s from skipped list\n", (char *) id);
+ ret = 0;
+ nb_skipped++;
+ goto error;
+ }
+ }
+ type = xmlGetProp(cur, BAD_CAST "TYPE");
+ if (type == NULL) {
+ test_log("test %s missing TYPE\n", (char *) id);
+ goto error;
+ }
+ uri = xmlGetProp(cur, BAD_CAST "URI");
+ if (uri == NULL) {
+ test_log("test %s missing URI\n", (char *) id);
+ goto error;
+ }
+ base = xmlNodeGetBase(doc, cur);
+ filename = composeDir(base, uri);
+ if (!checkTestFile((char *) filename)) {
+ test_log("test %s missing file %s \n", id,
+ (filename ? (char *)filename : "NULL"));
+ goto error;
+ }
+
+ version = xmlGetProp(cur, BAD_CAST "VERSION");
+
+ entities = xmlGetProp(cur, BAD_CAST "ENTITIES");
+ if (!xmlStrEqual(entities, BAD_CAST "none")) {
+ options |= XML_PARSE_DTDLOAD;
+ options |= XML_PARSE_NOENT;
+ }
+ rec = xmlGetProp(cur, BAD_CAST "RECOMMENDATION");
+ if ((rec == NULL) ||
+ (xmlStrEqual(rec, BAD_CAST "XML1.0")) ||
+ (xmlStrEqual(rec, BAD_CAST "XML1.0-errata2e")) ||
+ (xmlStrEqual(rec, BAD_CAST "XML1.0-errata3e")) ||
+ (xmlStrEqual(rec, BAD_CAST "XML1.0-errata4e"))) {
+ if ((version != NULL) && (!xmlStrEqual(version, BAD_CAST "1.0"))) {
+ test_log("Skipping test %s for %s\n", (char *) id,
+ (char *) version);
+ ret = 0;
+ nb_skipped++;
+ goto error;
+ }
+ ret = 1;
+ } else if ((xmlStrEqual(rec, BAD_CAST "NS1.0")) ||
+ (xmlStrEqual(rec, BAD_CAST "NS1.0-errata1e"))) {
+ ret = 1;
+ nstest = 1;
+ } else {
+ test_log("Skipping test %s for REC %s\n", (char *) id, (char *) rec);
+ ret = 0;
+ nb_skipped++;
+ goto error;
+ }
+ edition = xmlGetProp(cur, BAD_CAST "EDITION");
+ if ((edition != NULL) && (xmlStrchr(edition, '5') == NULL)) {
+ /* test limited to all versions before 5th */
+ options |= XML_PARSE_OLD10;
+ }
+
+ /*
+ * Reset errors and check memory usage before the test
+ */
+ xmlResetLastError();
+ testErrorsSize = 0; testErrors[0] = 0;
+ mem = xmlMemUsed();
+
+ if (xmlStrEqual(type, BAD_CAST "not-wf")) {
+ if (nstest == 0)
+ xmlconfTestNotWF((char *) id, (char *) filename, options);
+ else
+ xmlconfTestNotNSWF((char *) id, (char *) filename, options);
+ } else if (xmlStrEqual(type, BAD_CAST "valid")) {
+ options |= XML_PARSE_DTDVALID;
+ xmlconfTestValid((char *) id, (char *) filename, options);
+ } else if (xmlStrEqual(type, BAD_CAST "invalid")) {
+ options |= XML_PARSE_DTDVALID;
+ xmlconfTestInvalid((char *) id, (char *) filename, options);
+ } else if (xmlStrEqual(type, BAD_CAST "error")) {
+ test_log("Skipping error test %s \n", (char *) id);
+ ret = 0;
+ nb_skipped++;
+ goto error;
+ } else {
+ test_log("test %s unknown TYPE value %s\n", (char *) id, (char *)type);
+ ret = -1;
+ goto error;
+ }
+
+ /*
+ * Reset errors and check memory usage after the test
+ */
+ xmlResetLastError();
+ final = xmlMemUsed();
+ if (final > mem) {
+ test_log("test %s : %s leaked %d bytes\n",
+ id, filename, final - mem);
+ nb_leaks++;
+ xmlMemDisplayLast(logfile, final - mem);
+ }
+ nb_tests++;
+
+error:
+ if (type != NULL)
+ xmlFree(type);
+ if (entities != NULL)
+ xmlFree(entities);
+ if (edition != NULL)
+ xmlFree(edition);
+ if (version != NULL)
+ xmlFree(version);
+ if (filename != NULL)
+ xmlFree(filename);
+ if (uri != NULL)
+ xmlFree(uri);
+ if (base != NULL)
+ xmlFree(base);
+ if (id != NULL)
+ xmlFree(id);
+ if (rec != NULL)
+ xmlFree(rec);
+ return(ret);
+}
+
+static int
+xmlconfTestCases(xmlDocPtr doc, xmlNodePtr cur, int level) {
+ xmlChar *profile;
+ int ret = 0;
+ int tests = 0;
+ int output = 0;
+
+ if (level == 1) {
+ profile = xmlGetProp(cur, BAD_CAST "PROFILE");
+ if (profile != NULL) {
+ output = 1;
+ level++;
+ printf("Test cases: %s\n", (char *) profile);
+ xmlFree(profile);
+ }
+ }
+ cur = cur->children;
+ while (cur != NULL) {
+ /* look only at elements we ignore everything else */
+ if (cur->type == XML_ELEMENT_NODE) {
+ if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) {
+ ret += xmlconfTestCases(doc, cur, level);
+ } else if (xmlStrEqual(cur->name, BAD_CAST "TEST")) {
+ if (xmlconfTestItem(doc, cur) >= 0)
+ ret++;
+ tests++;
+ } else {
+ fprintf(stderr, "Unhandled element %s\n", (char *)cur->name);
+ }
+ }
+ cur = cur->next;
+ }
+ if (output == 1) {
+ if (tests > 0)
+ printf("Test cases: %d tests\n", tests);
+ }
+ return(ret);
+}
+
+static int
+xmlconfTestSuite(xmlDocPtr doc, xmlNodePtr cur) {
+ xmlChar *profile;
+ int ret = 0;
+
+ profile = xmlGetProp(cur, BAD_CAST "PROFILE");
+ if (profile != NULL) {
+ printf("Test suite: %s\n", (char *) profile);
+ xmlFree(profile);
+ } else
+ printf("Test suite\n");
+ cur = cur->children;
+ while (cur != NULL) {
+ /* look only at elements we ignore everything else */
+ if (cur->type == XML_ELEMENT_NODE) {
+ if (xmlStrEqual(cur->name, BAD_CAST "TESTCASES")) {
+ ret += xmlconfTestCases(doc, cur, 1);
+ } else {
+ fprintf(stderr, "Unhandled element %s\n", (char *)cur->name);
+ }
+ }
+ cur = cur->next;
+ }
+ return(ret);
+}
+
+static void
+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/xmlts20080205.tar.gz\n");
+ fprintf(stderr, " see http://www.w3.org/XML/Test/ for informations\n");
+}
+
+static int
+xmlconfTest(void) {
+ const char *confxml = "xmlconf/xmlconf.xml";
+ xmlDocPtr doc;
+ xmlNodePtr cur;
+ int ret = 0;
+
+ if (!checkTestFile(confxml)) {
+ fprintf(stderr, "%s is missing \n", confxml);
+ xmlconfInfo();
+ return(-1);
+ }
+ doc = xmlReadFile(confxml, NULL, XML_PARSE_NOENT);
+ if (doc == NULL) {
+ fprintf(stderr, "%s is corrupted \n", confxml);
+ xmlconfInfo();
+ return(-1);
+ }
+
+ cur = xmlDocGetRootElement(doc);
+ if ((cur == NULL) || (!xmlStrEqual(cur->name, BAD_CAST "TESTSUITE"))) {
+ fprintf(stderr, "Unexpected format %s\n", confxml);
+ xmlconfInfo();
+ ret = -1;
+ } else {
+ ret = xmlconfTestSuite(doc, cur);
+ }
+ xmlFreeDoc(doc);
+ return(ret);
+}
+
+/************************************************************************
+ * *
+ * The driver for the tests *
+ * *
+ ************************************************************************/
+
+int
+main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
+ int ret = 0;
+ int old_errors, old_tests, old_leaks;
+
+ logfile = fopen(LOGFILE, "w");
+ if (logfile == NULL) {
+ fprintf(stderr,
+ "Could not open the log file, running in verbose mode\n");
+ verbose = 1;
+ }
+ initializeLibxml2();
+
+ if ((argc >= 2) && (!strcmp(argv[1], "-v")))
+ verbose = 1;
+
+
+ old_errors = nb_errors;
+ old_tests = nb_tests;
+ old_leaks = nb_leaks;
+ xmlconfTest();
+ if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
+ printf("Ran %d tests, no errors\n", nb_tests - old_tests);
+ else
+ printf("Ran %d tests, %d errors, %d leaks\n",
+ nb_tests - old_tests,
+ nb_errors - old_errors,
+ nb_leaks - old_leaks);
+ if ((nb_errors == 0) && (nb_leaks == 0)) {
+ ret = 0;
+ printf("Total %d tests, no errors\n",
+ nb_tests);
+ } else {
+ ret = 1;
+ printf("Total %d tests, %d errors, %d leaks\n",
+ nb_tests, nb_errors, nb_leaks);
+ printf("See %s for detailed output\n", LOGFILE);
+ }
+ xmlXPathFreeContext(ctxtXPath);
+ xmlCleanupParser();
+ xmlMemoryDump();
+
+ if (logfile != NULL)
+ fclose(logfile);
+ return(ret);
+}
diff --git a/testapi.c b/testapi.c
index 8a50e88..037f7e4 100644
--- a/testapi.c
+++ b/testapi.c
@@ -212,7 +212,7 @@ void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
name resolution delays, so we use these
*/
#define REMOTE1GOOD "http://localhost/"
-#define REMOTE1BAD "http://missing. example.org/"
+#define REMOTE1BAD "http:http://http"
#define REMOTE2GOOD "ftp://localhost/foo"
#define gen_nb_void_ptr 2
@@ -494,10 +494,11 @@ static void des_xmlParserInputBufferPtr(int no ATTRIBUTE_UNUSED, xmlParserInputB
xmlFreeParserInputBuffer(val);
}
-#define gen_nb_xmlDocPtr 3
+#define gen_nb_xmlDocPtr 4
static xmlDocPtr gen_xmlDocPtr(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 0) return(xmlNewDoc(BAD_CAST "1.0"));
if (no == 1) return(xmlReadMemory("<foo/>", 6, "test", NULL, 0));
+ if (no == 2) return(xmlReadMemory("<!DOCTYPE foo []> <foo/>", 24, "test", NULL, 0));
return(NULL);
}
static void des_xmlDocPtr(int no ATTRIBUTE_UNUSED, xmlDocPtr val, int nr ATTRIBUTE_UNUSED) {
@@ -720,6 +721,23 @@ static void des_xmlExpNodePtr(int no ATTRIBUTE_UNUSED, xmlExpNodePtr val ATTRIBU
#endif
+#if defined(LIBXML_SCHEMAS_ENABLED)
+#define gen_nb_xmlSchemaPtr 1
+static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#define gen_nb_xmlSchemaValidCtxtPtr 1
+static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+ return(NULL);
+}
+static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
+}
+
+#endif /* LIBXML_SCHEMAS_ENABLED */
+
#define gen_nb_xmlHashDeallocator 2
static void
test_xmlHashDeallocator(void *payload ATTRIBUTE_UNUSED, xmlChar *name ATTRIBUTE_UNUSED) {
@@ -1010,11 +1028,12 @@ static xmlAttributeType gen_xmlAttributeType(int no, int nr ATTRIBUTE_UNUSED) {
static void des_xmlAttributeType(int no ATTRIBUTE_UNUSED, xmlAttributeType val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
}
-#define gen_nb_xmlBufferAllocationScheme 3
+#define gen_nb_xmlBufferAllocationScheme 4
static xmlBufferAllocationScheme gen_xmlBufferAllocationScheme(int no, int nr ATTRIBUTE_UNUSED) {
if (no == 1) return(XML_BUFFER_ALLOC_DOUBLEIT);
if (no == 2) return(XML_BUFFER_ALLOC_EXACT);
if (no == 3) return(XML_BUFFER_ALLOC_IMMUTABLE);
+ if (no == 4) return(XML_BUFFER_ALLOC_IO);
return(0);
}
@@ -6164,7 +6183,6 @@ test_xmlCatalogResolve(void) {
int test_ret = 0;
#if defined(LIBXML_CATALOG_ENABLED)
- int mem_base;
xmlChar * ret_val;
xmlChar * pubID; /* the public ID string */
int n_pubID;
@@ -6173,7 +6191,6 @@ test_xmlCatalogResolve(void) {
for (n_pubID = 0;n_pubID < gen_nb_const_xmlChar_ptr;n_pubID++) {
for (n_sysID = 0;n_sysID < gen_nb_const_xmlChar_ptr;n_sysID++) {
- mem_base = xmlMemBlocks();
pubID = gen_const_xmlChar_ptr(n_pubID, 0);
sysID = gen_const_xmlChar_ptr(n_sysID, 1);
@@ -6183,14 +6200,6 @@ test_xmlCatalogResolve(void) {
des_const_xmlChar_ptr(n_pubID, (const xmlChar *)pubID, 0);
des_const_xmlChar_ptr(n_sysID, (const xmlChar *)sysID, 1);
xmlResetLastError();
- if (mem_base != xmlMemBlocks()) {
- printf("Leak of %d blocks found in xmlCatalogResolve",
- xmlMemBlocks() - mem_base);
- test_ret++;
- printf(" %d", n_pubID);
- printf(" %d", n_sysID);
- printf("\n");
- }
}
}
function_tests++;
@@ -9607,11 +9616,78 @@ test_xmlInitializePredefinedEntities(void) {
return(test_ret);
}
+
+static int
+test_xmlNewEntity(void) {
+ int test_ret = 0;
+
+ int mem_base;
+ xmlEntityPtr ret_val;
+ xmlDocPtr doc; /* the document */
+ int n_doc;
+ xmlChar * name; /* the entity name */
+ int n_name;
+ int type; /* the entity type XML_xxx_yyy_ENTITY */
+ int n_type;
+ xmlChar * ExternalID; /* the entity external ID if available */
+ int n_ExternalID;
+ xmlChar * SystemID; /* the entity system ID if available */
+ int n_SystemID;
+ xmlChar * content; /* the entity content */
+ int n_content;
+
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
+ for (n_name = 0;n_name < gen_nb_const_xmlChar_ptr;n_name++) {
+ for (n_type = 0;n_type < gen_nb_int;n_type++) {
+ for (n_ExternalID = 0;n_ExternalID < gen_nb_const_xmlChar_ptr;n_ExternalID++) {
+ for (n_SystemID = 0;n_SystemID < gen_nb_const_xmlChar_ptr;n_SystemID++) {
+ for (n_content = 0;n_content < gen_nb_const_xmlChar_ptr;n_content++) {
+ mem_base = xmlMemBlocks();
+ doc = gen_xmlDocPtr(n_doc, 0);
+ name = gen_const_xmlChar_ptr(n_name, 1);
+ type = gen_int(n_type, 2);
+ ExternalID = gen_const_xmlChar_ptr(n_ExternalID, 3);
+ SystemID = gen_const_xmlChar_ptr(n_SystemID, 4);
+ content = gen_const_xmlChar_ptr(n_content, 5);
+
+ ret_val = xmlNewEntity(doc, (const xmlChar *)name, type, (const xmlChar *)ExternalID, (const xmlChar *)SystemID, (const xmlChar *)content);
+ desret_xmlEntityPtr(ret_val);
+ call_tests++;
+ des_xmlDocPtr(n_doc, doc, 0);
+ des_const_xmlChar_ptr(n_name, (const xmlChar *)name, 1);
+ des_int(n_type, type, 2);
+ des_const_xmlChar_ptr(n_ExternalID, (const xmlChar *)ExternalID, 3);
+ des_const_xmlChar_ptr(n_SystemID, (const xmlChar *)SystemID, 4);
+ des_const_xmlChar_ptr(n_content, (const xmlChar *)content, 5);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlNewEntity",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_doc);
+ printf(" %d", n_name);
+ printf(" %d", n_type);
+ printf(" %d", n_ExternalID);
+ printf(" %d", n_SystemID);
+ printf(" %d", n_content);
+ printf("\n");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ function_tests++;
+
+ return(test_ret);
+}
+
static int
test_entities(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing entities : 12 of 16 functions ...\n");
+ if (quiet == 0) printf("Testing entities : 13 of 17 functions ...\n");
test_ret += test_xmlAddDocEntity();
test_ret += test_xmlAddDtdEntity();
test_ret += test_xmlCleanupPredefinedEntities();
@@ -9626,6 +9702,7 @@ test_entities(void) {
test_ret += test_xmlGetParameterEntity();
test_ret += test_xmlGetPredefinedEntity();
test_ret += test_xmlInitializePredefinedEntities();
+ test_ret += test_xmlNewEntity();
if (test_ret != 0)
printf("Module entities: %d errors\n", test_ret);
@@ -13136,7 +13213,6 @@ test_xmlIOParseDTD(void) {
#if defined(LIBXML_VALID_ENABLED)
#ifdef LIBXML_VALID_ENABLED
- int mem_base;
xmlDtdPtr ret_val;
xmlSAXHandlerPtr sax; /* the SAX handler block or NULL */
int n_sax;
@@ -13148,7 +13224,6 @@ test_xmlIOParseDTD(void) {
for (n_sax = 0;n_sax < gen_nb_xmlSAXHandlerPtr;n_sax++) {
for (n_input = 0;n_input < gen_nb_xmlParserInputBufferPtr;n_input++) {
for (n_enc = 0;n_enc < gen_nb_xmlCharEncoding;n_enc++) {
- mem_base = xmlMemBlocks();
sax = gen_xmlSAXHandlerPtr(n_sax, 0);
input = gen_xmlParserInputBufferPtr(n_input, 1);
enc = gen_xmlCharEncoding(n_enc, 2);
@@ -13161,15 +13236,6 @@ test_xmlIOParseDTD(void) {
des_xmlParserInputBufferPtr(n_input, input, 1);
des_xmlCharEncoding(n_enc, enc, 2);
xmlResetLastError();
- if (mem_base != xmlMemBlocks()) {
- printf("Leak of %d blocks found in xmlIOParseDTD",
- xmlMemBlocks() - mem_base);
- test_ret++;
- printf(" %d", n_sax);
- printf(" %d", n_input);
- printf(" %d", n_enc);
- printf("\n");
- }
}
}
}
@@ -16294,6 +16360,7 @@ test_xmlPushInput(void) {
int test_ret = 0;
int mem_base;
+ int ret_val;
xmlParserCtxtPtr ctxt; /* an XML parser context */
int n_ctxt;
xmlParserInputPtr input; /* an XML parser input fragment (entity, XML fragment ...). */
@@ -16305,7 +16372,8 @@ test_xmlPushInput(void) {
ctxt = gen_xmlParserCtxtPtr(n_ctxt, 0);
input = gen_xmlParserInputPtr(n_input, 1);
- xmlPushInput(ctxt, input);
+ ret_val = xmlPushInput(ctxt, input);
+ desret_int(ret_val);
call_tests++;
des_xmlParserCtxtPtr(n_ctxt, ctxt, 0);
des_xmlParserInputPtr(n_input, input, 1);
@@ -25899,9 +25967,9 @@ test_xmlValidateAttributeValue(void) {
#if defined(LIBXML_VALID_ENABLED)
int mem_base;
int ret_val;
- xmlAttributeType type; /* an attribute type */
+ xmlAttributeType type; /* */
int n_type;
- xmlChar * value; /* an attribute value */
+ xmlChar * value; /* */
int n_value;
for (n_type = 0;n_type < gen_nb_xmlAttributeType;n_type++) {
@@ -32068,16 +32136,6 @@ test_xmlTextReaderSchemaValidate(void) {
return(test_ret);
}
-#ifdef LIBXML_READER_ENABLED
-
-#define gen_nb_xmlSchemaValidCtxtPtr 1
-static xmlSchemaValidCtxtPtr gen_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
- return(NULL);
-}
-static void des_xmlSchemaValidCtxtPtr(int no ATTRIBUTE_UNUSED, xmlSchemaValidCtxtPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
-}
-#endif
-
static int
test_xmlTextReaderSchemaValidateCtxt(void) {
@@ -32184,16 +32242,6 @@ test_xmlTextReaderSetParserProp(void) {
return(test_ret);
}
-#ifdef LIBXML_READER_ENABLED
-
-#define gen_nb_xmlSchemaPtr 1
-static xmlSchemaPtr gen_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
- return(NULL);
-}
-static void des_xmlSchemaPtr(int no ATTRIBUTE_UNUSED, xmlSchemaPtr val ATTRIBUTE_UNUSED, int nr ATTRIBUTE_UNUSED) {
-}
-#endif
-
static int
test_xmlTextReaderSetSchema(void) {
@@ -33725,13 +33773,13 @@ test_xmlSchemaGetValidErrors(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a XML-Schema validation context */
int n_ctxt;
- xmlSchemaValidityErrorFunc * err; /* */
+ xmlSchemaValidityErrorFunc * err; /* the error function result */
int n_err;
- xmlSchemaValidityWarningFunc * warn; /* */
+ xmlSchemaValidityWarningFunc * warn; /* the warning function result */
int n_warn;
- void ** ctx; /* */
+ void ** ctx; /* the functions context result */
int n_ctx;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -33780,7 +33828,7 @@ test_xmlSchemaIsValid(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* the schema validation context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -33973,7 +34021,7 @@ test_xmlSchemaSAXUnplug(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaSAXPlugPtr plug; /* */
+ xmlSchemaSAXPlugPtr plug; /* a data structure returned by xmlSchemaSAXPlug */
int n_plug;
for (n_plug = 0;n_plug < gen_nb_xmlSchemaSAXPlugPtr;n_plug++) {
@@ -34037,9 +34085,9 @@ test_xmlSchemaSetValidOptions(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
int n_ctxt;
- int options; /* */
+ int options; /* a combination of xmlSchemaValidOption */
int n_options;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -34088,7 +34136,7 @@ test_xmlSchemaValidCtxtGetOptions(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
int n_ctxt;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -34116,35 +34164,69 @@ test_xmlSchemaValidCtxtGetOptions(void) {
static int
+test_xmlSchemaValidCtxtGetParserCtxt(void) {
+ int test_ret = 0;
+
+#if defined(LIBXML_SCHEMAS_ENABLED)
+ int mem_base;
+ xmlParserCtxtPtr ret_val;
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
+ int n_ctxt;
+
+ for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
+ mem_base = xmlMemBlocks();
+ ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
+
+ ret_val = xmlSchemaValidCtxtGetParserCtxt(ctxt);
+ desret_xmlParserCtxtPtr(ret_val);
+ call_tests++;
+ des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
+ xmlResetLastError();
+ if (mem_base != xmlMemBlocks()) {
+ printf("Leak of %d blocks found in xmlSchemaValidCtxtGetParserCtxt",
+ xmlMemBlocks() - mem_base);
+ test_ret++;
+ printf(" %d", n_ctxt);
+ printf("\n");
+ }
+ }
+ function_tests++;
+#endif
+
+ return(test_ret);
+}
+
+
+static int
test_xmlSchemaValidateDoc(void) {
int test_ret = 0;
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
int n_ctxt;
- xmlDocPtr instance; /* */
- int n_instance;
+ xmlDocPtr doc; /* a parsed document tree */
+ int n_doc;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
- for (n_instance = 0;n_instance < gen_nb_xmlDocPtr;n_instance++) {
+ for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlSchemaValidCtxtPtr(n_ctxt, 0);
- instance = gen_xmlDocPtr(n_instance, 1);
+ doc = gen_xmlDocPtr(n_doc, 1);
- ret_val = xmlSchemaValidateDoc(ctxt, instance);
+ ret_val = xmlSchemaValidateDoc(ctxt, doc);
desret_int(ret_val);
call_tests++;
des_xmlSchemaValidCtxtPtr(n_ctxt, ctxt, 0);
- des_xmlDocPtr(n_instance, instance, 1);
+ des_xmlDocPtr(n_doc, doc, 1);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlSchemaValidateDoc",
xmlMemBlocks() - mem_base);
test_ret++;
printf(" %d", n_ctxt);
- printf(" %d", n_instance);
+ printf(" %d", n_doc);
printf("\n");
}
}
@@ -34163,11 +34245,11 @@ test_xmlSchemaValidateFile(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
int n_ctxt;
- const char * filename; /* */
+ const char * filename; /* the URI of the instance */
int n_filename;
- int options; /* */
+ int options; /* a future set of options, currently unused */
int n_options;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -34211,9 +34293,9 @@ test_xmlSchemaValidateOneElement(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
int n_ctxt;
- xmlNodePtr elem; /* */
+ xmlNodePtr elem; /* an element node */
int n_elem;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -34252,15 +34334,15 @@ test_xmlSchemaValidateStream(void) {
#if defined(LIBXML_SCHEMAS_ENABLED)
int mem_base;
int ret_val;
- xmlSchemaValidCtxtPtr ctxt; /* */
+ xmlSchemaValidCtxtPtr ctxt; /* a schema validation context */
int n_ctxt;
- xmlParserInputBufferPtr input; /* */
+ xmlParserInputBufferPtr input; /* the input to use for reading the data */
int n_input;
- xmlCharEncoding enc; /* */
+ xmlCharEncoding enc; /* an optional encoding information */
int n_enc;
- xmlSAXHandlerPtr sax; /* */
+ xmlSAXHandlerPtr sax; /* a SAX handler for the resulting events */
int n_sax;
- void * user_data; /* */
+ void * user_data; /* the context to provide to the SAX handler. */
int n_user_data;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlSchemaValidCtxtPtr;n_ctxt++) {
@@ -34310,7 +34392,7 @@ static int
test_xmlschemas(void) {
int test_ret = 0;
- if (quiet == 0) printf("Testing xmlschemas : 14 of 24 functions ...\n");
+ if (quiet == 0) printf("Testing xmlschemas : 15 of 25 functions ...\n");
test_ret += test_xmlSchemaDump();
test_ret += test_xmlSchemaGetParserErrors();
test_ret += test_xmlSchemaGetValidErrors();
@@ -34328,6 +34410,7 @@ test_xmlschemas(void) {
test_ret += test_xmlSchemaSetValidOptions();
test_ret += test_xmlSchemaSetValidStructuredErrors();
test_ret += test_xmlSchemaValidCtxtGetOptions();
+ test_ret += test_xmlSchemaValidCtxtGetParserCtxt();
test_ret += test_xmlSchemaValidateDoc();
test_ret += test_xmlSchemaValidateFile();
test_ret += test_xmlSchemaValidateOneElement();
diff --git a/testchar.c b/testchar.c
new file mode 100644
index 0000000..3bfd9c0
--- /dev/null
+++ b/testchar.c
@@ -0,0 +1,615 @@
+/**
+ * Test the UTF-8 decoding routines
+ *
+ * author: Daniel Veillard
+ * copy: see Copyright for the status of this software.
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <libxml/parser.h>
+#include <libxml/parserInternals.h>
+
+int lastError;
+
+static void errorHandler(void *unused, xmlErrorPtr err) {
+ if ((unused == NULL) && (err != NULL) && (lastError == 0)) {
+ lastError = err->code;
+ }
+}
+
+char document1[100] = "<doc>XXXX</doc>";
+char document2[100] = "<doc foo='XXXX'/>";
+
+static void testDocumentRangeByte1(xmlParserCtxtPtr ctxt, char *document,
+ int len, char *data, int forbid1, int forbid2) {
+ int i;
+ xmlDocPtr res;
+
+ for (i = 0;i <= 0xFF;i++) {
+ lastError = 0;
+ xmlCtxtReset(ctxt);
+
+ data[0] = i;
+
+ res = xmlReadMemory(document, len, "test", NULL, 0);
+
+ if ((i == forbid1) || (i == forbid2)) {
+ if ((lastError == 0) || (res != NULL))
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X: %c\n",
+ i, i);
+ }
+
+ else if ((i == '<') || (i == '&')) {
+ if ((lastError == 0) || (res != NULL))
+ fprintf(stderr,
+ "Failed to detect illegal char %c for Byte 0x%02X\n", i, i);
+ }
+ else if (((i < 0x20) || (i >= 0x80)) &&
+ (i != 0x9) && (i != 0xA) && (i != 0xD)) {
+ if ((lastError != XML_ERR_INVALID_CHAR) && (res != NULL))
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X\n", i);
+ }
+ else if (res == NULL) {
+ fprintf(stderr,
+ "Failed to parse valid char for Byte 0x%02X : %c\n", i, i);
+ }
+ if (res != NULL)
+ xmlFreeDoc(res);
+ }
+}
+
+static void testDocumentRangeByte2(xmlParserCtxtPtr ctxt, char *document,
+ int len, char *data) {
+ int i, j;
+ xmlDocPtr res;
+
+ for (i = 0x80;i <= 0xFF;i++) {
+ for (j = 0;j <= 0xFF;j++) {
+ lastError = 0;
+ xmlCtxtReset(ctxt);
+
+ data[0] = i;
+ data[1] = j;
+
+ res = xmlReadMemory(document, len, "test", NULL, 0);
+
+ /* if first bit of first char is set, then second bit must too */
+ if ((i & 0x80) && ((i & 0x40) == 0)) {
+ if ((lastError == 0) || (res != NULL))
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
+ }
+
+ /*
+ * if first bit of first char is set, then second char first
+ * bits must be 10
+ */
+ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+ if ((lastError == 0) || (res != NULL))
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
+ }
+
+ /*
+ * if using a 2 byte encoding then the value must be greater
+ * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ */
+ else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+ if ((lastError == 0) || (res != NULL))
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
+ }
+
+ /*
+ * if third bit of first char is set, then the sequence would need
+ * at least 3 bytes, but we give only 2 !
+ */
+ else if ((i & 0xE0) == 0xE0) {
+ if ((lastError == 0) || (res != NULL))
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ i, j);
+ }
+
+ /*
+ * We should see no error in remaning cases
+ */
+ else if ((lastError != 0) || (res == NULL)) {
+ fprintf(stderr,
+ "Failed to parse document for Bytes 0x%02X 0x%02X\n", i, j);
+ }
+ if (res != NULL)
+ xmlFreeDoc(res);
+ }
+ }
+}
+
+/**
+ * testDocumentRanges:
+ *
+ * Test the correct UTF8 character parsing in context of XML documents
+ * Those are in-context injection tests checking the parser behaviour on
+ * edge case values at different point in content, beginning and end of
+ * CDATA in text or in attribute values.
+ */
+
+static void testDocumentRanges(void) {
+ xmlParserCtxtPtr ctxt;
+ char *data;
+
+ /*
+ * Set up a parsing context using the first document as
+ * the current input source.
+ */
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ fprintf(stderr, "Failed to allocate parser context\n");
+ return;
+ }
+
+ printf("testing 1 byte char in document: 1");
+ fflush(stdout);
+ data = &document1[5];
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at beginning of area */
+ testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+ data, -1, -1);
+ printf(" 2");
+ fflush(stdout);
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at end of area */
+ testDocumentRangeByte1(ctxt, &document1[0], strlen(document1),
+ data + 3, -1, -1);
+
+ printf(" 3");
+ fflush(stdout);
+ data = &document2[10];
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at beginning of area */
+ testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+ data, '\'', -1);
+ printf(" 4");
+ fflush(stdout);
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 1 byte injection at end of area */
+ testDocumentRangeByte1(ctxt, &document2[0], strlen(document2),
+ data + 3, '\'', -1);
+ printf(" done\n");
+
+ printf("testing 2 byte char in document: 1");
+ fflush(stdout);
+ data = &document1[5];
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at beginning of area */
+ testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+ data);
+ printf(" 2");
+ fflush(stdout);
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at end of area */
+ testDocumentRangeByte2(ctxt, &document1[0], strlen(document1),
+ data + 2);
+
+ printf(" 3");
+ fflush(stdout);
+ data = &document2[10];
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at beginning of area */
+ testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+ data);
+ printf(" 4");
+ fflush(stdout);
+ data[0] = ' ';
+ data[1] = ' ';
+ data[2] = ' ';
+ data[3] = ' ';
+ /* test 2 byte injection at end of area */
+ testDocumentRangeByte2(ctxt, &document2[0], strlen(document2),
+ data + 2);
+ printf(" done\n");
+
+ xmlFreeParserCtxt(ctxt);
+}
+
+static void testCharRangeByte1(xmlParserCtxtPtr ctxt, char *data) {
+ int i = 0;
+ int len, c;
+
+ data[1] = 0;
+ data[2] = 0;
+ data[3] = 0;
+ for (i = 0;i <= 0xFF;i++) {
+ data[0] = i;
+ ctxt->charset = XML_CHAR_ENCODING_UTF8;
+
+ lastError = 0;
+ c = xmlCurrentChar(ctxt, &len);
+ if ((i == 0) || (i >= 0x80)) {
+ /* we must see an error there */
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Byte 0x%02X\n", i);
+ } else if (i == 0xD) {
+ if ((c != 0xA) || (len != 1))
+ fprintf(stderr, "Failed to convert char for Byte 0x%02X\n", i);
+ } else if ((c != i) || (len != 1)) {
+ fprintf(stderr, "Failed to parse char for Byte 0x%02X\n", i);
+ }
+ }
+}
+
+static void testCharRangeByte2(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j;
+ int len, c;
+
+ data[2] = 0;
+ data[3] = 0;
+ for (i = 0x80;i <= 0xFF;i++) {
+ for (j = 0;j <= 0xFF;j++) {
+ data[0] = i;
+ data[1] = j;
+ ctxt->charset = XML_CHAR_ENCODING_UTF8;
+
+ lastError = 0;
+ c = xmlCurrentChar(ctxt, &len);
+
+ /* if first bit of first char is set, then second bit must too */
+ if ((i & 0x80) && ((i & 0x40) == 0)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X\n",
+ i, j);
+ }
+
+ /*
+ * if first bit of first char is set, then second char first
+ * bits must be 10
+ */
+ else if ((i & 0x80) && ((j & 0xC0) != 0x80)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ i, j, c);
+ }
+
+ /*
+ * if using a 2 byte encoding then the value must be greater
+ * than 0x80, i.e. one of bits 5 to 1 of i must be set
+ */
+ else if ((i & 0x80) && ((i & 0x1E) == 0)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X: %d\n",
+ i, j, c);
+ }
+
+ /*
+ * if third bit of first char is set, then the sequence would need
+ * at least 3 bytes, but we give only 2 !
+ */
+ else if ((i & 0xE0) == 0xE0) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x00\n",
+ i, j);
+ }
+
+ /*
+ * We should see no error in remaning cases
+ */
+ else if ((lastError != 0) || (len != 2)) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X\n", i, j);
+ }
+
+ /*
+ * Finally check the value is right
+ */
+ else if (c != (j & 0x3F) + ((i & 0x1F) << 6)) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, ((j & 0x3F) + ((i & 0x1F) << 6)), c);
+ }
+ }
+ }
+}
+
+static void testCharRangeByte3(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j, k, K;
+ int len, c;
+ unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+ int value;
+
+ data[3] = 0;
+ for (i = 0xE0;i <= 0xFF;i++) {
+ for (j = 0;j <= 0xFF;j++) {
+ for (k = 0;k < 6;k++) {
+ data[0] = i;
+ data[1] = j;
+ K = lows[k];
+ data[2] = (char) K;
+ value = (K & 0x3F) + ((j & 0x3F) << 6) + ((i & 0xF) << 12);
+ ctxt->charset = XML_CHAR_ENCODING_UTF8;
+
+ lastError = 0;
+ c = xmlCurrentChar(ctxt, &len);
+
+ /*
+ * if fourth bit of first char is set, then the sequence would need
+ * at least 4 bytes, but we give only 3 !
+ */
+ if ((i & 0xF0) == 0xF0) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, data[3]);
+ }
+
+ /*
+ * The second and the third bytes must start with 10
+ */
+ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
+ }
+
+ /*
+ * if using a 3 byte encoding then the value must be greater
+ * than 0x800, i.e. one of bits 4 to 0 of i must be set or
+ * the 6th byte of data[1] must be set
+ */
+ else if (((i & 0xF) == 0) && ((j & 0x20) == 0)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
+ }
+
+ /*
+ * There are values in that range that are not allowed in XML-1.0
+ */
+ else if (((value > 0xD7FF) && (value <0xE000)) ||
+ ((value > 0xFFFD) && (value <0x10000))) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X\n",
+ value, i, j, K);
+ }
+
+ /*
+ * We should see no error in remaining cases
+ */
+ else if ((lastError != 0) || (len != 3)) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
+ }
+
+ /*
+ * Finally check the value is right
+ */
+ else if (c != value) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, data[2], value, c);
+ }
+ }
+ }
+ }
+}
+
+static void testCharRangeByte4(xmlParserCtxtPtr ctxt, char *data) {
+ int i, j, k, K, l, L;
+ int len, c;
+ unsigned char lows[6] = {0, 0x80, 0x81, 0xC1, 0xFF, 0xBF};
+ int value;
+
+ data[4] = 0;
+ for (i = 0xF0;i <= 0xFF;i++) {
+ for (j = 0;j <= 0xFF;j++) {
+ for (k = 0;k < 6;k++) {
+ for (l = 0;l < 6;l++) {
+ data[0] = i;
+ data[1] = j;
+ K = lows[k];
+ data[2] = (char) K;
+ L = lows[l];
+ data[3] = (char) L;
+ value = (L & 0x3F) + ((K & 0x3F) << 6) + ((j & 0x3F) << 12) +
+ ((i & 0x7) << 18);
+ ctxt->charset = XML_CHAR_ENCODING_UTF8;
+
+ lastError = 0;
+ c = xmlCurrentChar(ctxt, &len);
+
+ /*
+ * if fifth bit of first char is set, then the sequence would need
+ * at least 5 bytes, but we give only 4 !
+ */
+ if ((i & 0xF8) == 0xF8) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, data[3]);
+ }
+
+ /*
+ * The second, third and fourth bytes must start with 10
+ */
+ else if (((j & 0xC0) != 0x80) || ((K & 0xC0) != 0x80) ||
+ ((L & 0xC0) != 0x80)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, L);
+ }
+
+ /*
+ * if using a 3 byte encoding then the value must be greater
+ * than 0x10000, i.e. one of bits 3 to 0 of i must be set or
+ * the 6 or 5th byte of j must be set
+ */
+ else if (((i & 0x7) == 0) && ((j & 0x30) == 0)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+ "Failed to detect invalid char for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ i, j, K, L);
+ }
+
+ /*
+ * There are values in that range that are not allowed in XML-1.0
+ */
+ else if (((value > 0xD7FF) && (value <0xE000)) ||
+ ((value > 0xFFFD) && (value <0x10000)) ||
+ (value > 0x10FFFF)) {
+ if (lastError != XML_ERR_INVALID_CHAR)
+ fprintf(stderr,
+"Failed to detect invalid char 0x%04X for Bytes 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ value, i, j, K, L);
+ }
+
+ /*
+ * We should see no error in remaining cases
+ */
+ else if ((lastError != 0) || (len != 4)) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X\n",
+ i, j, K);
+ }
+
+ /*
+ * Finally check the value is right
+ */
+ else if (c != value) {
+ fprintf(stderr,
+ "Failed to parse char for Bytes 0x%02X 0x%02X 0x%02X: expect %d got %d\n",
+ i, j, data[2], value, c);
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ * testCharRanges:
+ *
+ * Test the correct UTF8 character parsing in isolation i.e.
+ * not when parsing a full document, this is less expensive and we can
+ * cover the full range of UTF-8 chars accepted by XML-1.0
+ */
+
+static void testCharRanges(void) {
+ char data[5];
+ xmlParserCtxtPtr ctxt;
+ xmlParserInputBufferPtr buf;
+ xmlParserInputPtr input;
+
+ memset(data, 0, 5);
+
+ /*
+ * Set up a parsing context using the above data buffer as
+ * the current input source.
+ */
+ ctxt = xmlNewParserCtxt();
+ if (ctxt == NULL) {
+ fprintf(stderr, "Failed to allocate parser context\n");
+ return;
+ }
+ buf = xmlParserInputBufferCreateStatic(data, sizeof(data),
+ XML_CHAR_ENCODING_NONE);
+ if (buf == NULL) {
+ fprintf(stderr, "Failed to allocate input buffer\n");
+ goto error;
+ }
+ input = xmlNewInputStream(ctxt);
+ if (input == NULL) {
+ xmlFreeParserInputBuffer(buf);
+ goto error;
+ }
+ input->filename = NULL;
+ input->buf = buf;
+ input->base = input->buf->buffer->content;
+ input->cur = input->buf->buffer->content;
+ input->end = &input->buf->buffer->content[4];
+ inputPush(ctxt, input);
+
+ printf("testing char range: 1");
+ fflush(stdout);
+ testCharRangeByte1(ctxt, data);
+ printf(" 2");
+ fflush(stdout);
+ testCharRangeByte2(ctxt, data);
+ printf(" 3");
+ fflush(stdout);
+ testCharRangeByte3(ctxt, data);
+ printf(" 4");
+ fflush(stdout);
+ testCharRangeByte4(ctxt, data);
+ printf(" done\n");
+ fflush(stdout);
+
+error:
+ xmlFreeParserCtxt(ctxt);
+}
+
+int main(void) {
+
+ /*
+ * this initialize the library and check potential ABI mismatches
+ * between the version it was compiled for and the actual shared
+ * library used.
+ */
+ LIBXML_TEST_VERSION
+
+ /*
+ * Catch errors separately
+ */
+
+ xmlSetStructuredErrorFunc(NULL, errorHandler);
+
+ /*
+ * Run the tests
+ */
+ testCharRanges();
+ testDocumentRanges();
+
+ /*
+ * Cleanup function for the XML library.
+ */
+ xmlCleanupParser();
+ /*
+ * this is to debug memory for regression tests
+ */
+ xmlMemoryDump();
+ return(0);
+}
diff --git a/testdict.c b/testdict.c
new file mode 100644
index 0000000..4e8581f
--- /dev/null
+++ b/testdict.c
@@ -0,0 +1,444 @@
+#include <string.h>
+#include <libxml/parser.h>
+#include <libxml/dict.h>
+
+/* #define WITH_PRINT */
+
+static const char *seeds1[] = {
+ "a", "b", "c",
+ "d", "e", "f",
+ "g", "h", "i",
+ "j", "k", "l",
+
+ NULL
+};
+
+static const char *seeds2[] = {
+ "m", "n", "o",
+ "p", "q", "r",
+ "s", "t", "u",
+ "v", "w", "x",
+
+ NULL
+};
+
+#define NB_STRINGS_NS 100
+#define NB_STRINGS_MAX 10000
+#define NB_STRINGS_MIN 10
+
+static xmlChar *strings1[NB_STRINGS_MAX];
+static xmlChar *strings2[NB_STRINGS_MAX];
+static const xmlChar *test1[NB_STRINGS_MAX];
+static const xmlChar *test2[NB_STRINGS_MAX];
+static int nbErrors = 0;
+
+static void fill_strings(void) {
+ int i, j, k;
+
+ /*
+ * That's a bit nasty but the output is fine and it doesn't take hours
+ * there is a small but sufficient number of duplicates, and we have
+ * ":xxx" and full QNames in the last NB_STRINGS_NS values
+ */
+ for (i = 0; seeds1[i] != NULL; i++) {
+ strings1[i] = xmlStrdup((const xmlChar *) seeds1[i]);
+ if (strings1[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings1\n");
+ exit(1);
+ }
+ }
+ for (j = 0, k = 0;i < NB_STRINGS_MAX - NB_STRINGS_NS;i++,j++) {
+ strings1[i] = xmlStrncatNew(strings1[j], strings1[k], -1);
+ if (strings1[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings1\n");
+ exit(1);
+ }
+ if (j >= 50) {
+ j = 0;
+ k++;
+ }
+ }
+ for (j = 0; (j < 50) && (i < NB_STRINGS_MAX); i++, j+=2) {
+ strings1[i] = xmlStrncatNew(strings1[j], (const xmlChar *) ":", -1);
+ if (strings1[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings1\n");
+ exit(1);
+ }
+ }
+ for (j = NB_STRINGS_MAX - NB_STRINGS_NS, k = 0;
+ i < NB_STRINGS_MAX;i++,j++) {
+ strings1[i] = xmlStrncatNew(strings1[j], strings1[k], -1);
+ if (strings1[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings1\n");
+ exit(1);
+ }
+ k += 3;
+ if (k >= 50) k = 0;
+ }
+
+ /*
+ * Now do the same with the second pool of strings
+ */
+ for (i = 0; seeds2[i] != NULL; i++) {
+ strings2[i] = xmlStrdup((const xmlChar *) seeds2[i]);
+ if (strings2[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings2\n");
+ exit(1);
+ }
+ }
+ for (j = 0, k = 0;i < NB_STRINGS_MAX - NB_STRINGS_NS;i++,j++) {
+ strings2[i] = xmlStrncatNew(strings2[j], strings2[k], -1);
+ if (strings2[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings2\n");
+ exit(1);
+ }
+ if (j >= 50) {
+ j = 0;
+ k++;
+ }
+ }
+ for (j = 0; (j < 50) && (i < NB_STRINGS_MAX); i++, j+=2) {
+ strings2[i] = xmlStrncatNew(strings2[j], (const xmlChar *) ":", -1);
+ if (strings2[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings2\n");
+ exit(1);
+ }
+ }
+ for (j = NB_STRINGS_MAX - NB_STRINGS_NS, k = 0;
+ i < NB_STRINGS_MAX;i++,j++) {
+ strings2[i] = xmlStrncatNew(strings2[j], strings2[k], -1);
+ if (strings2[i] == NULL) {
+ fprintf(stderr, "Out of memory while generating strings2\n");
+ exit(1);
+ }
+ k += 3;
+ if (k >= 50) k = 0;
+ }
+
+}
+
+#ifdef WITH_PRINT
+static void print_strings(void) {
+ int i;
+
+ for (i = 0; i < NB_STRINGS_MAX;i++) {
+ printf("%s\n", strings1[i]);
+ }
+ for (i = 0; i < NB_STRINGS_MAX;i++) {
+ printf("%s\n", strings2[i]);
+ }
+}
+#endif
+
+static void clean_strings(void) {
+ int i;
+
+ for (i = 0; i < NB_STRINGS_MAX; i++) {
+ if (strings1[i] != NULL) /* really should not happen */
+ xmlFree(strings1[i]);
+ }
+ for (i = 0; i < NB_STRINGS_MAX; i++) {
+ if (strings2[i] != NULL) /* really should not happen */
+ xmlFree(strings2[i]);
+ }
+}
+
+/*
+ * This tests the sub-dictionary support
+ */
+static int run_test2(xmlDictPtr parent) {
+ int i, j;
+ xmlDictPtr dict;
+ int ret = 0;
+ xmlChar prefix[40];
+ xmlChar *cur, *pref;
+ const xmlChar *tmp;
+
+ dict = xmlDictCreateSub(parent);
+ if (dict == NULL) {
+ fprintf(stderr, "Out of memory while creating sub-dictionary\n");
+ exit(1);
+ }
+ memset(test2, 0, sizeof(test2));
+
+ /*
+ * Fill in NB_STRINGS_MIN, at this point the dictionary should not grow
+ * and we allocate all those doing the fast key computations
+ * All the strings are based on a different seeds subset so we know
+ * they are allocated in the main dictionary, not coming from the parent
+ */
+ for (i = 0;i < NB_STRINGS_MIN;i++) {
+ test2[i] = xmlDictLookup(dict, strings2[i], -1);
+ if (test2[i] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings2[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+ j = NB_STRINGS_MAX - NB_STRINGS_NS;
+ /* ":foo" like strings2 */
+ for (i = 0;i < NB_STRINGS_MIN;i++, j++) {
+ test2[j] = xmlDictLookup(dict, strings2[j], xmlStrlen(strings2[j]));
+ if (test2[j] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings2[j]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+ /* "a:foo" like strings2 */
+ j = NB_STRINGS_MAX - NB_STRINGS_MIN;
+ for (i = 0;i < NB_STRINGS_MIN;i++, j++) {
+ test2[j] = xmlDictLookup(dict, strings2[j], xmlStrlen(strings2[j]));
+ if (test2[j] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings2[j]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * At this point allocate all the strings
+ * the dictionary will grow in the process, reallocate more string tables
+ * and switch to the better key generator
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (test2[i] != NULL)
+ continue;
+ test2[i] = xmlDictLookup(dict, strings2[i], -1);
+ if (test2[i] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings2[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * Now we can start to test things, first that all strings2 belongs to
+ * the dict, and that none of them was actually allocated in the parent
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (!xmlDictOwns(dict, test2[i])) {
+ fprintf(stderr, "Failed ownership failure for '%s'\n",
+ strings2[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ if (xmlDictOwns(parent, test2[i])) {
+ fprintf(stderr, "Failed parent ownership failure for '%s'\n",
+ strings2[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * Also verify that all strings from the parent are seen from the subdict
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (!xmlDictOwns(dict, test1[i])) {
+ fprintf(stderr, "Failed sub-ownership failure for '%s'\n",
+ strings1[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * Then that another lookup to the string in sub will return the same
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (xmlDictLookup(dict, strings2[i], -1) != test2[i]) {
+ fprintf(stderr, "Failed re-lookup check for %d, '%s'\n",
+ i, strings2[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+ /*
+ * But also that any lookup for a string in the parent will be provided
+ * as in the parent
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (xmlDictLookup(dict, strings1[i], -1) != test1[i]) {
+ fprintf(stderr, "Failed parent string lookup check for %d, '%s'\n",
+ i, strings1[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * check the QName lookups
+ */
+ for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) {
+ cur = strings2[i];
+ pref = &prefix[0];
+ while (*cur != ':') *pref++ = *cur++;
+ cur++;
+ *pref = 0;
+ tmp = xmlDictQLookup(dict, &prefix[0], cur);
+ if (xmlDictQLookup(dict, &prefix[0], cur) != test2[i]) {
+ fprintf(stderr, "Failed lookup check for '%s':'%s'\n",
+ &prefix[0], cur);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+ /*
+ * check the QName lookups for strings from the parent
+ */
+ for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) {
+ cur = strings1[i];
+ pref = &prefix[0];
+ while (*cur != ':') *pref++ = *cur++;
+ cur++;
+ *pref = 0;
+ tmp = xmlDictQLookup(dict, &prefix[0], cur);
+ if (xmlDictQLookup(dict, &prefix[0], cur) != test1[i]) {
+ fprintf(stderr, "Failed parent lookup check for '%s':'%s'\n",
+ &prefix[0], cur);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ xmlDictFree(dict);
+ return(ret);
+}
+
+/*
+ * Test a single dictionary
+ */
+static int run_test1(void) {
+ int i, j;
+ xmlDictPtr dict;
+ int ret = 0;
+ xmlChar prefix[40];
+ xmlChar *cur, *pref;
+ const xmlChar *tmp;
+
+ dict = xmlDictCreate();
+ if (dict == NULL) {
+ fprintf(stderr, "Out of memory while creating dictionary\n");
+ exit(1);
+ }
+ memset(test1, 0, sizeof(test1));
+
+ /*
+ * Fill in NB_STRINGS_MIN, at this point the dictionary should not grow
+ * and we allocate all those doing the fast key computations
+ */
+ for (i = 0;i < NB_STRINGS_MIN;i++) {
+ test1[i] = xmlDictLookup(dict, strings1[i], -1);
+ if (test1[i] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings1[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+ j = NB_STRINGS_MAX - NB_STRINGS_NS;
+ /* ":foo" like strings1 */
+ for (i = 0;i < NB_STRINGS_MIN;i++, j++) {
+ test1[j] = xmlDictLookup(dict, strings1[j], xmlStrlen(strings1[j]));
+ if (test1[j] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings1[j]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+ /* "a:foo" like strings1 */
+ j = NB_STRINGS_MAX - NB_STRINGS_MIN;
+ for (i = 0;i < NB_STRINGS_MIN;i++, j++) {
+ test1[j] = xmlDictLookup(dict, strings1[j], xmlStrlen(strings1[j]));
+ if (test1[j] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings1[j]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * At this point allocate all the strings
+ * the dictionary will grow in the process, reallocate more string tables
+ * and switch to the better key generator
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (test1[i] != NULL)
+ continue;
+ test1[i] = xmlDictLookup(dict, strings1[i], -1);
+ if (test1[i] == NULL) {
+ fprintf(stderr, "Failed lookup for '%s'\n", strings1[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * Now we can start to test things, first that all strings1 belongs to
+ * the dict
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (!xmlDictOwns(dict, test1[i])) {
+ fprintf(stderr, "Failed ownership failure for '%s'\n",
+ strings1[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * Then that another lookup to the string will return the same
+ */
+ for (i = 0;i < NB_STRINGS_MAX;i++) {
+ if (xmlDictLookup(dict, strings1[i], -1) != test1[i]) {
+ fprintf(stderr, "Failed re-lookup check for %d, '%s'\n",
+ i, strings1[i]);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ /*
+ * More complex, check the QName lookups
+ */
+ for (i = NB_STRINGS_MAX - NB_STRINGS_NS;i < NB_STRINGS_MAX;i++) {
+ cur = strings1[i];
+ pref = &prefix[0];
+ while (*cur != ':') *pref++ = *cur++;
+ cur++;
+ *pref = 0;
+ tmp = xmlDictQLookup(dict, &prefix[0], cur);
+ if (xmlDictQLookup(dict, &prefix[0], cur) != test1[i]) {
+ fprintf(stderr, "Failed lookup check for '%s':'%s'\n",
+ &prefix[0], cur);
+ ret = 1;
+ nbErrors++;
+ }
+ }
+
+ run_test2(dict);
+
+ xmlDictFree(dict);
+ return(ret);
+}
+
+int main(void)
+{
+ int ret;
+
+ LIBXML_TEST_VERSION
+ fill_strings();
+#ifdef WITH_PRINT
+ print_strings();
+#endif
+ ret = run_test1();
+ if (ret == 0) {
+ printf("dictionary tests succeeded %d strings\n", 2 * NB_STRINGS_MAX);
+ } else {
+ printf("dictionary tests failed with %d errors\n", nbErrors);
+ }
+ clean_strings();
+ xmlCleanupParser();
+ xmlMemoryDump();
+ return(ret);
+}
diff --git a/testrecurse.c b/testrecurse.c
new file mode 100644
index 0000000..3515048
--- /dev/null
+++ b/testrecurse.c
@@ -0,0 +1,973 @@
+/*
+ * testrecurse.c: C program to run libxml2 regression tests checking entities
+ * recursions
+ *
+ * To compile on Unixes:
+ * cc -o testrecurse `xml2-config --cflags` testrecurse.c `xml2-config --libs` -lpthread
+ *
+ * See Copyright for the status of this software.
+ *
+ * daniel@veillard.com
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "libxml.h"
+#else
+#include <stdio.h>
+#endif
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#include <unistd.h>
+#endif
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <libxml/parser.h>
+#include <libxml/tree.h>
+#include <libxml/uri.h>
+#ifdef LIBXML_READER_ENABLED
+#include <libxml/xmlreader.h>
+#endif
+
+/*
+ * O_BINARY is just for Windows compatibility - if it isn't defined
+ * on this system, avoid any compilation error
+ */
+#ifdef O_BINARY
+#define RD_FLAGS O_RDONLY | O_BINARY
+#else
+#define RD_FLAGS O_RDONLY
+#endif
+
+typedef int (*functest) (const char *filename, const char *result,
+ const char *error, int options);
+
+typedef struct testDesc testDesc;
+typedef testDesc *testDescPtr;
+struct testDesc {
+ const char *desc; /* descripton of the test */
+ functest func; /* function implementing the test */
+ const char *in; /* glob to path for input files */
+ const char *out; /* output directory */
+ const char *suffix;/* suffix for output files */
+ const char *err; /* suffix for error output files */
+ int options; /* parser options for the test */
+};
+
+static int checkTestFile(const char *filename);
+
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+
+#include <windows.h>
+#include <io.h>
+
+typedef struct
+{
+ size_t gl_pathc; /* Count of paths matched so far */
+ char **gl_pathv; /* List of matched pathnames. */
+ size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
+} glob_t;
+
+#define GLOB_DOOFFS 0
+static int glob(const char *pattern, int flags,
+ int errfunc(const char *epath, int eerrno),
+ glob_t *pglob) {
+ glob_t *ret;
+ WIN32_FIND_DATA FindFileData;
+ HANDLE hFind;
+ unsigned int nb_paths = 0;
+ char directory[500];
+ int len;
+
+ if ((pattern == NULL) || (pglob == NULL)) return(-1);
+
+ strncpy(directory, pattern, 499);
+ for (len = strlen(directory);len >= 0;len--) {
+ if (directory[len] == '/') {
+ len++;
+ directory[len] = 0;
+ break;
+ }
+ }
+ if (len <= 0)
+ len = 0;
+
+
+ ret = pglob;
+ memset(ret, 0, sizeof(glob_t));
+
+ hFind = FindFirstFileA(pattern, &FindFileData);
+ if (hFind == INVALID_HANDLE_VALUE)
+ return(0);
+ nb_paths = 20;
+ ret->gl_pathv = (char **) malloc(nb_paths * sizeof(char *));
+ if (ret->gl_pathv == NULL) {
+ FindClose(hFind);
+ return(-1);
+ }
+ strncpy(directory + len, FindFileData.cFileName, 499 - len);
+ ret->gl_pathv[ret->gl_pathc] = strdup(directory);
+ if (ret->gl_pathv[ret->gl_pathc] == NULL)
+ goto done;
+ ret->gl_pathc++;
+ while(FindNextFileA(hFind, &FindFileData)) {
+ if (FindFileData.cFileName[0] == '.')
+ continue;
+ if (ret->gl_pathc + 2 > nb_paths) {
+ char **tmp = realloc(ret->gl_pathv, nb_paths * 2 * sizeof(char *));
+ if (tmp == NULL)
+ break;
+ ret->gl_pathv = tmp;
+ nb_paths *= 2;
+ }
+ strncpy(directory + len, FindFileData.cFileName, 499 - len);
+ ret->gl_pathv[ret->gl_pathc] = strdup(directory);
+ if (ret->gl_pathv[ret->gl_pathc] == NULL)
+ break;
+ ret->gl_pathc++;
+ }
+ ret->gl_pathv[ret->gl_pathc] = NULL;
+
+done:
+ FindClose(hFind);
+ return(0);
+}
+
+
+
+static void globfree(glob_t *pglob) {
+ unsigned int i;
+ if (pglob == NULL)
+ return;
+
+ for (i = 0;i < pglob->gl_pathc;i++) {
+ if (pglob->gl_pathv[i] != NULL)
+ free(pglob->gl_pathv[i]);
+ }
+}
+#define vsnprintf _vsnprintf
+#define snprintf _snprintf
+#else
+#include <glob.h>
+#endif
+
+/************************************************************************
+ * *
+ * Huge document generator *
+ * *
+ ************************************************************************/
+
+#include <libxml/xmlIO.h>
+
+
+static const char *start = "<!DOCTYPE foo [\
+<!ENTITY f 'some internal data'> \
+<!ENTITY e '&f;&f;'> \
+<!ENTITY d '&e;&e;'> \
+]> \
+<foo>";
+
+static const char *segment = " <bar>&e; &f; &d;</bar>\n";
+static const char *finish = "</foo>";
+
+static int curseg = 0;
+static const char *current;
+static int rlen;
+
+/**
+ * hugeMatch:
+ * @URI: an URI to test
+ *
+ * Check for an huge: query
+ *
+ * Returns 1 if yes and 0 if another Input module should be used
+ */
+static int
+hugeMatch(const char * URI) {
+ if ((URI != NULL) && (!strncmp(URI, "huge:", 4)))
+ return(1);
+ return(0);
+}
+
+/**
+ * hugeOpen:
+ * @URI: an URI to test
+ *
+ * Return a pointer to the huge: query handler, in this example simply
+ * the current pointer...
+ *
+ * Returns an Input context or NULL in case or error
+ */
+static void *
+hugeOpen(const char * URI) {
+ if ((URI == NULL) || (strncmp(URI, "huge:", 4)))
+ return(NULL);
+ rlen = strlen(start);
+ current = start;
+ return((void *) current);
+}
+
+/**
+ * hugeClose:
+ * @context: the read context
+ *
+ * Close the huge: query handler
+ *
+ * Returns 0 or -1 in case of error
+ */
+static int
+hugeClose(void * context) {
+ if (context == NULL) return(-1);
+ return(0);
+}
+
+#define MAX_NODES 1000000
+
+/**
+ * hugeRead:
+ * @context: the read context
+ * @buffer: where to store data
+ * @len: number of bytes to read
+ *
+ * Implement an huge: query read.
+ *
+ * Returns the number of bytes read or -1 in case of error
+ */
+static int
+hugeRead(void *context, char *buffer, int len)
+{
+ if ((context == NULL) || (buffer == NULL) || (len < 0))
+ return (-1);
+
+ if (len >= rlen) {
+ if (curseg >= MAX_NODES + 1) {
+ rlen = 0;
+ return(0);
+ }
+ len = rlen;
+ rlen = 0;
+ memcpy(buffer, current, len);
+ curseg ++;
+ if (curseg == MAX_NODES) {
+ fprintf(stderr, "\n");
+ rlen = strlen(finish);
+ current = finish;
+ } else {
+ if (curseg % (MAX_NODES / 10) == 0)
+ fprintf(stderr, ".");
+ rlen = strlen(segment);
+ current = segment;
+ }
+ } else {
+ memcpy(buffer, current, len);
+ rlen -= len;
+ current += len;
+ }
+ return (len);
+}
+
+/************************************************************************
+ * *
+ * Libxml2 specific routines *
+ * *
+ ************************************************************************/
+
+static int nb_tests = 0;
+static int nb_errors = 0;
+static int nb_leaks = 0;
+static int extraMemoryFromResolver = 0;
+
+static int
+fatalError(void) {
+ fprintf(stderr, "Exitting tests on fatal error\n");
+ exit(1);
+}
+
+/*
+ * We need to trap calls to the resolver to not account memory for the catalog
+ * which is shared to the current running test. We also don't want to have
+ * network downloads modifying tests.
+ */
+static xmlParserInputPtr
+testExternalEntityLoader(const char *URL, const char *ID,
+ xmlParserCtxtPtr ctxt) {
+ xmlParserInputPtr ret;
+
+ if (checkTestFile(URL)) {
+ ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
+ } else {
+ int memused = xmlMemUsed();
+ ret = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
+ extraMemoryFromResolver += xmlMemUsed() - memused;
+ }
+
+ return(ret);
+}
+
+/*
+ * Trapping the error messages at the generic level to grab the equivalent of
+ * stderr messages on CLI tools.
+ */
+static char testErrors[32769];
+static int testErrorsSize = 0;
+
+static void XMLCDECL
+channel(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {
+ va_list args;
+ int res;
+
+ if (testErrorsSize >= 32768)
+ return;
+ va_start(args, msg);
+ res = vsnprintf(&testErrors[testErrorsSize],
+ 32768 - testErrorsSize,
+ msg, args);
+ va_end(args);
+ if (testErrorsSize + res >= 32768) {
+ /* buffer is full */
+ testErrorsSize = 32768;
+ testErrors[testErrorsSize] = 0;
+ } else {
+ testErrorsSize += res;
+ }
+ testErrors[testErrorsSize] = 0;
+}
+
+/**
+ * xmlParserPrintFileContext:
+ * @input: an xmlParserInputPtr input
+ *
+ * Displays current context within the input content for error tracking
+ */
+
+static void
+xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
+ xmlGenericErrorFunc chanl, void *data ) {
+ const xmlChar *cur, *base;
+ unsigned int n, col; /* GCC warns if signed, because compared with sizeof() */
+ xmlChar content[81]; /* space for 80 chars + line terminator */
+ xmlChar *ctnt;
+
+ if (input == NULL) return;
+ cur = input->cur;
+ base = input->base;
+ /* skip backwards over any end-of-lines */
+ while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) {
+ cur--;
+ }
+ n = 0;
+ /* search backwards for beginning-of-line (to max buff size) */
+ while ((n++ < (sizeof(content)-1)) && (cur > base) &&
+ (*(cur) != '\n') && (*(cur) != '\r'))
+ cur--;
+ if ((*(cur) == '\n') || (*(cur) == '\r')) cur++;
+ /* calculate the error position in terms of the current position */
+ col = input->cur - cur;
+ /* search forward for end-of-line (to max buff size) */
+ n = 0;
+ ctnt = content;
+ /* copy selected text to our buffer */
+ while ((*cur != 0) && (*(cur) != '\n') &&
+ (*(cur) != '\r') && (n < sizeof(content)-1)) {
+ *ctnt++ = *cur++;
+ n++;
+ }
+ *ctnt = 0;
+ /* print out the selected text */
+ chanl(data ,"%s\n", content);
+ /* create blank line with problem pointer */
+ n = 0;
+ ctnt = content;
+ /* (leave buffer space for pointer + line terminator) */
+ while ((n<col) && (n++ < sizeof(content)-2) && (*ctnt != 0)) {
+ if (*(ctnt) != '\t')
+ *(ctnt) = ' ';
+ ctnt++;
+ }
+ *ctnt++ = '^';
+ *ctnt = 0;
+ chanl(data ,"%s\n", content);
+}
+
+static void
+testStructuredErrorHandler(void *ctx ATTRIBUTE_UNUSED, xmlErrorPtr err) {
+ char *file = NULL;
+ int line = 0;
+ int code = -1;
+ int domain;
+ void *data = NULL;
+ const char *str;
+ const xmlChar *name = NULL;
+ xmlNodePtr node;
+ xmlErrorLevel level;
+ xmlParserInputPtr input = NULL;
+ xmlParserInputPtr cur = NULL;
+ xmlParserCtxtPtr ctxt = NULL;
+
+ if (err == NULL)
+ return;
+
+ file = err->file;
+ line = err->line;
+ code = err->code;
+ domain = err->domain;
+ level = err->level;
+ node = err->node;
+ if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
+ (domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||
+ (domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
+ ctxt = err->ctxt;
+ }
+ str = err->message;
+
+ if (code == XML_ERR_OK)
+ return;
+
+ if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
+ name = node->name;
+
+ /*
+ * Maintain the compatibility with the legacy error handling
+ */
+ if (ctxt != NULL) {
+ input = ctxt->input;
+ if ((input != NULL) && (input->filename == NULL) &&
+ (ctxt->inputNr > 1)) {
+ cur = input;
+ input = ctxt->inputTab[ctxt->inputNr - 2];
+ }
+ if (input != NULL) {
+ if (input->filename)
+ channel(data, "%s:%d: ", input->filename, input->line);
+ else if ((line != 0) && (domain == XML_FROM_PARSER))
+ channel(data, "Entity: line %d: ", input->line);
+ }
+ } else {
+ if (file != NULL)
+ channel(data, "%s:%d: ", file, line);
+ else if ((line != 0) && (domain == XML_FROM_PARSER))
+ channel(data, "Entity: line %d: ", line);
+ }
+ if (name != NULL) {
+ channel(data, "element %s: ", name);
+ }
+ if (code == XML_ERR_OK)
+ return;
+ switch (domain) {
+ case XML_FROM_PARSER:
+ channel(data, "parser ");
+ break;
+ case XML_FROM_NAMESPACE:
+ channel(data, "namespace ");
+ break;
+ case XML_FROM_DTD:
+ case XML_FROM_VALID:
+ channel(data, "validity ");
+ break;
+ case XML_FROM_HTML:
+ channel(data, "HTML parser ");
+ break;
+ case XML_FROM_MEMORY:
+ channel(data, "memory ");
+ break;
+ case XML_FROM_OUTPUT:
+ channel(data, "output ");
+ break;
+ case XML_FROM_IO:
+ channel(data, "I/O ");
+ break;
+ case XML_FROM_XINCLUDE:
+ channel(data, "XInclude ");
+ break;
+ case XML_FROM_XPATH:
+ channel(data, "XPath ");
+ break;
+ case XML_FROM_XPOINTER:
+ channel(data, "parser ");
+ break;
+ case XML_FROM_REGEXP:
+ channel(data, "regexp ");
+ break;
+ case XML_FROM_MODULE:
+ channel(data, "module ");
+ break;
+ case XML_FROM_SCHEMASV:
+ channel(data, "Schemas validity ");
+ break;
+ case XML_FROM_SCHEMASP:
+ channel(data, "Schemas parser ");
+ break;
+ case XML_FROM_RELAXNGP:
+ channel(data, "Relax-NG parser ");
+ break;
+ case XML_FROM_RELAXNGV:
+ channel(data, "Relax-NG validity ");
+ break;
+ case XML_FROM_CATALOG:
+ channel(data, "Catalog ");
+ break;
+ case XML_FROM_C14N:
+ channel(data, "C14N ");
+ break;
+ case XML_FROM_XSLT:
+ channel(data, "XSLT ");
+ break;
+ default:
+ break;
+ }
+ if (code == XML_ERR_OK)
+ return;
+ switch (level) {
+ case XML_ERR_NONE:
+ channel(data, ": ");
+ break;
+ case XML_ERR_WARNING:
+ channel(data, "warning : ");
+ break;
+ case XML_ERR_ERROR:
+ channel(data, "error : ");
+ break;
+ case XML_ERR_FATAL:
+ channel(data, "error : ");
+ break;
+ }
+ if (code == XML_ERR_OK)
+ return;
+ if (str != NULL) {
+ int len;
+ len = xmlStrlen((const xmlChar *)str);
+ if ((len > 0) && (str[len - 1] != '\n'))
+ channel(data, "%s\n", str);
+ else
+ channel(data, "%s", str);
+ } else {
+ channel(data, "%s\n", "out of memory error");
+ }
+ if (code == XML_ERR_OK)
+ return;
+
+ if (ctxt != NULL) {
+ xmlParserPrintFileContextInternal(input, channel, data);
+ if (cur != NULL) {
+ if (cur->filename)
+ channel(data, "%s:%d: \n", cur->filename, cur->line);
+ else if ((line != 0) && (domain == XML_FROM_PARSER))
+ channel(data, "Entity: line %d: \n", cur->line);
+ xmlParserPrintFileContextInternal(cur, channel, data);
+ }
+ }
+ if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) &&
+ (err->int1 < 100) &&
+ (err->int1 < xmlStrlen((const xmlChar *)err->str1))) {
+ xmlChar buf[150];
+ int i;
+
+ channel(data, "%s\n", err->str1);
+ for (i=0;i < err->int1;i++)
+ buf[i] = ' ';
+ buf[i++] = '^';
+ buf[i] = 0;
+ channel(data, "%s\n", buf);
+ }
+}
+
+static void
+initializeLibxml2(void) {
+ xmlGetWarningsDefaultValue = 0;
+ xmlPedanticParserDefault(0);
+
+ xmlMemSetup(xmlMemFree, xmlMemMalloc, xmlMemRealloc, xmlMemoryStrdup);
+ xmlInitParser();
+ xmlSetExternalEntityLoader(testExternalEntityLoader);
+ xmlSetStructuredErrorFunc(NULL, testStructuredErrorHandler);
+ /*
+ * register the new I/O handlers
+ */
+ if (xmlRegisterInputCallbacks(hugeMatch, hugeOpen,
+ hugeRead, hugeClose) < 0) {
+ fprintf(stderr, "failed to register Huge handler\n");
+ exit(1);
+ }
+}
+
+/************************************************************************
+ * *
+ * File name and path utilities *
+ * *
+ ************************************************************************/
+
+static const char *baseFilename(const char *filename) {
+ const char *cur;
+ if (filename == NULL)
+ return(NULL);
+ cur = &filename[strlen(filename)];
+ while ((cur > filename) && (*cur != '/'))
+ cur--;
+ if (*cur == '/')
+ return(cur + 1);
+ return(cur);
+}
+
+static char *resultFilename(const char *filename, const char *out,
+ const char *suffix) {
+ const char *base;
+ char res[500];
+ char suffixbuff[500];
+
+/*************
+ if ((filename[0] == 't') && (filename[1] == 'e') &&
+ (filename[2] == 's') && (filename[3] == 't') &&
+ (filename[4] == '/'))
+ filename = &filename[5];
+ *************/
+
+ base = baseFilename(filename);
+ if (suffix == NULL)
+ suffix = ".tmp";
+ if (out == NULL)
+ out = "";
+
+ strncpy(suffixbuff,suffix,499);
+#ifdef VMS
+ if(strstr(base,".") && suffixbuff[0]=='.')
+ suffixbuff[0]='_';
+#endif
+
+ snprintf(res, 499, "%s%s%s", out, base, suffixbuff);
+ res[499] = 0;
+ return(strdup(res));
+}
+
+static int checkTestFile(const char *filename) {
+ struct stat buf;
+
+ if (stat(filename, &buf) == -1)
+ return(0);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!(buf.st_mode & _S_IFREG))
+ return(0);
+#else
+ if (!S_ISREG(buf.st_mode))
+ return(0);
+#endif
+
+ return(1);
+}
+
+
+
+/************************************************************************
+ * *
+ * Test to detect or not recursive entities *
+ * *
+ ************************************************************************/
+/**
+ * recursiveDetectTest:
+ * @filename: the file to parse
+ * @result: the file with expected result
+ * @err: the file with error messages: unused
+ *
+ * Parse a file loading DTD and replacing entities check it fails for
+ * lol cases
+ *
+ * Returns 0 in case of success, an error code otherwise
+ */
+static int
+recursiveDetectTest(const char *filename,
+ const char *result ATTRIBUTE_UNUSED,
+ const char *err ATTRIBUTE_UNUSED,
+ int options ATTRIBUTE_UNUSED) {
+ xmlDocPtr doc;
+ xmlParserCtxtPtr ctxt;
+ int res = 0;
+ int mem;
+
+ nb_tests++;
+
+ ctxt = xmlNewParserCtxt();
+ mem = xmlMemUsed();
+ /*
+ * base of the test, parse with the old API
+ */
+ doc = xmlCtxtReadFile(ctxt, filename, NULL,
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+ if ((doc != NULL) || (ctxt->lastError.code != XML_ERR_ENTITY_LOOP)) {
+ fprintf(stderr, "Failed to detect recursion in %s\n", filename);
+ xmlFreeParserCtxt(ctxt);
+ xmlFreeDoc(doc);
+ return(1);
+ }
+ xmlFreeParserCtxt(ctxt);
+
+ return(res);
+}
+
+/**
+ * notRecursiveDetectTest:
+ * @filename: the file to parse
+ * @result: the file with expected result
+ * @err: the file with error messages: unused
+ *
+ * Parse a file loading DTD and replacing entities check it works for
+ * good cases
+ *
+ * Returns 0 in case of success, an error code otherwise
+ */
+static int
+notRecursiveDetectTest(const char *filename,
+ const char *result ATTRIBUTE_UNUSED,
+ const char *err ATTRIBUTE_UNUSED,
+ int options ATTRIBUTE_UNUSED) {
+ xmlDocPtr doc;
+ xmlParserCtxtPtr ctxt;
+ int res = 0;
+ int mem;
+
+ nb_tests++;
+
+ ctxt = xmlNewParserCtxt();
+ mem = xmlMemUsed();
+ /*
+ * base of the test, parse with the old API
+ */
+ doc = xmlCtxtReadFile(ctxt, filename, NULL,
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+ if (doc == NULL) {
+ fprintf(stderr, "Failed to parse correct file %s\n", filename);
+ xmlFreeParserCtxt(ctxt);
+ return(1);
+ }
+ xmlFreeDoc(doc);
+ xmlFreeParserCtxt(ctxt);
+
+ return(res);
+}
+
+#ifdef LIBXML_READER_ENABLED
+/**
+ * notRecursiveHugeTest:
+ * @filename: the file to parse
+ * @result: the file with expected result
+ * @err: the file with error messages: unused
+ *
+ * Parse a memory generated file
+ * good cases
+ *
+ * Returns 0 in case of success, an error code otherwise
+ */
+static int
+notRecursiveHugeTest(const char *filename ATTRIBUTE_UNUSED,
+ const char *result ATTRIBUTE_UNUSED,
+ const char *err ATTRIBUTE_UNUSED,
+ int options ATTRIBUTE_UNUSED) {
+ xmlTextReaderPtr reader;
+ int res = 0;
+ int ret;
+
+ nb_tests++;
+
+ reader = xmlReaderForFile("huge:test" , NULL,
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+ if (reader == NULL) {
+ fprintf(stderr, "Failed to open huge:test\n");
+ return(1);
+ }
+ ret = xmlTextReaderRead(reader);
+ while (ret == 1) {
+ ret = xmlTextReaderRead(reader);
+ }
+ if (ret != 0) {
+ fprintf(stderr, "Failed to parser huge:test with entities\n");
+ res = 1;
+ }
+ xmlFreeTextReader(reader);
+
+ return(res);
+}
+#endif
+
+/************************************************************************
+ * *
+ * Tests Descriptions *
+ * *
+ ************************************************************************/
+
+static
+testDesc testDescriptions[] = {
+ { "Parsing recursive test cases" ,
+ recursiveDetectTest, "./test/recurse/lol*.xml", NULL, NULL, NULL,
+ 0 },
+ { "Parsing non-recursive test cases" ,
+ notRecursiveDetectTest, "./test/recurse/good*.xml", NULL, NULL, NULL,
+ 0 },
+#ifdef LIBXML_READER_ENABLED
+ { "Parsing non-recursive huge case" ,
+ notRecursiveHugeTest, NULL, NULL, NULL, NULL,
+ 0 },
+#endif
+ {NULL, NULL, NULL, NULL, NULL, NULL, 0}
+};
+
+/************************************************************************
+ * *
+ * The main code driving the tests *
+ * *
+ ************************************************************************/
+
+static int
+launchTests(testDescPtr tst) {
+ int res = 0, err = 0;
+ size_t i;
+ char *result;
+ char *error;
+ int mem;
+
+ if (tst == NULL) return(-1);
+ if (tst->in != NULL) {
+ glob_t globbuf;
+
+ globbuf.gl_offs = 0;
+ glob(tst->in, GLOB_DOOFFS, NULL, &globbuf);
+ for (i = 0;i < globbuf.gl_pathc;i++) {
+ if (!checkTestFile(globbuf.gl_pathv[i]))
+ continue;
+ if (tst->suffix != NULL) {
+ result = resultFilename(globbuf.gl_pathv[i], tst->out,
+ tst->suffix);
+ if (result == NULL) {
+ fprintf(stderr, "Out of memory !\n");
+ fatalError();
+ }
+ } else {
+ result = NULL;
+ }
+ if (tst->err != NULL) {
+ error = resultFilename(globbuf.gl_pathv[i], tst->out,
+ tst->err);
+ if (error == NULL) {
+ fprintf(stderr, "Out of memory !\n");
+ fatalError();
+ }
+ } else {
+ error = NULL;
+ }
+ if ((result) &&(!checkTestFile(result))) {
+ fprintf(stderr, "Missing result file %s\n", result);
+ } else if ((error) &&(!checkTestFile(error))) {
+ fprintf(stderr, "Missing error file %s\n", error);
+ } else {
+ mem = xmlMemUsed();
+ extraMemoryFromResolver = 0;
+ testErrorsSize = 0;
+ testErrors[0] = 0;
+ res = tst->func(globbuf.gl_pathv[i], result, error,
+ tst->options | XML_PARSE_COMPACT);
+ xmlResetLastError();
+ if (res != 0) {
+ fprintf(stderr, "File %s generated an error\n",
+ globbuf.gl_pathv[i]);
+ nb_errors++;
+ err++;
+ }
+ else if (xmlMemUsed() != mem) {
+ if ((xmlMemUsed() != mem) &&
+ (extraMemoryFromResolver == 0)) {
+ fprintf(stderr, "File %s leaked %d bytes\n",
+ globbuf.gl_pathv[i], xmlMemUsed() - mem);
+ nb_leaks++;
+ err++;
+ }
+ }
+ testErrorsSize = 0;
+ }
+ if (result)
+ free(result);
+ if (error)
+ free(error);
+ }
+ globfree(&globbuf);
+ } else {
+ testErrorsSize = 0;
+ testErrors[0] = 0;
+ extraMemoryFromResolver = 0;
+ res = tst->func(NULL, NULL, NULL, tst->options);
+ if (res != 0) {
+ nb_errors++;
+ err++;
+ }
+ }
+ return(err);
+}
+
+static int verbose = 0;
+static int tests_quiet = 0;
+
+static int
+runtest(int i) {
+ int ret = 0, res;
+ int old_errors, old_tests, old_leaks;
+
+ old_errors = nb_errors;
+ old_tests = nb_tests;
+ old_leaks = nb_leaks;
+ if ((tests_quiet == 0) && (testDescriptions[i].desc != NULL))
+ printf("## %s\n", testDescriptions[i].desc);
+ res = launchTests(&testDescriptions[i]);
+ if (res != 0)
+ ret++;
+ if (verbose) {
+ if ((nb_errors == old_errors) && (nb_leaks == old_leaks))
+ printf("Ran %d tests, no errors\n", nb_tests - old_tests);
+ else
+ printf("Ran %d tests, %d errors, %d leaks\n",
+ nb_tests - old_tests,
+ nb_errors - old_errors,
+ nb_leaks - old_leaks);
+ }
+ return(ret);
+}
+
+int
+main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
+ int i, a, ret = 0;
+ int subset = 0;
+
+ initializeLibxml2();
+
+ for (a = 1; a < argc;a++) {
+ if (!strcmp(argv[a], "-v"))
+ verbose = 1;
+ else if (!strcmp(argv[a], "-quiet"))
+ tests_quiet = 1;
+ else {
+ for (i = 0; testDescriptions[i].func != NULL; i++) {
+ if (strstr(testDescriptions[i].desc, argv[a])) {
+ ret += runtest(i);
+ subset++;
+ }
+ }
+ }
+ }
+ if (subset == 0) {
+ for (i = 0; testDescriptions[i].func != NULL; i++) {
+ ret += runtest(i);
+ }
+ }
+ if ((nb_errors == 0) && (nb_leaks == 0)) {
+ ret = 0;
+ printf("Total %d tests, no errors\n",
+ nb_tests);
+ } else {
+ ret = 1;
+ printf("Total %d tests, %d errors, %d leaks\n",
+ nb_tests, nb_errors, nb_leaks);
+ }
+ xmlCleanupParser();
+ xmlMemoryDump();
+
+ return(ret);
+}
diff --git a/threads.c b/threads.c
index 6481b40..23cb200 100644
--- a/threads.c
+++ b/threads.c
@@ -1,5 +1,5 @@
/**
- * threads.c: set of generic threading related routines
+ * threads.c: set of generic threading related routines
*
* See Copyright for the status of this software.
*
@@ -73,6 +73,10 @@ extern int pthread_mutex_unlock ()
__attribute((weak));
extern int pthread_cond_init ()
__attribute((weak));
+extern int pthread_cond_destroy ()
+ __attribute((weak));
+extern int pthread_cond_wait ()
+ __attribute((weak));
extern int pthread_equal ()
__attribute((weak));
extern pthread_t pthread_self ()
@@ -860,6 +864,8 @@ xmlInitThreads(void)
(pthread_mutex_lock != NULL) &&
(pthread_mutex_unlock != NULL) &&
(pthread_cond_init != NULL) &&
+ (pthread_cond_destroy != NULL) &&
+ (pthread_cond_wait != NULL) &&
(pthread_equal != NULL) &&
(pthread_self != NULL) &&
(pthread_cond_signal != NULL)) {
diff --git a/tree.c b/tree.c
index 763381b..f26748e 100644
--- a/tree.c
+++ b/tree.c
@@ -45,7 +45,7 @@ int __xmlRegisterCallbacks = 0;
/************************************************************************
* *
- * Forward declarations *
+ * Forward declarations *
* *
************************************************************************/
@@ -55,7 +55,7 @@ static xmlChar* xmlGetPropNodeValueInternal(xmlAttrPtr prop);
/************************************************************************
* *
- * Tree memory error handler *
+ * Tree memory error handler *
* *
************************************************************************/
/**
@@ -103,7 +103,7 @@ xmlTreeErr(int code, xmlNodePtr node, const char *extra)
/************************************************************************
* *
- * A few static variables and macros *
+ * A few static variables and macros *
* *
************************************************************************/
/* #undef xmlStringText */
@@ -123,7 +123,7 @@ static int xmlCheckDTD = 1;
(n)->last = NULL; \
} else { \
while (ulccur->next != NULL) { \
- ulccur->parent = (n); \
+ ulccur->parent = (n); \
ulccur = ulccur->next; \
} \
ulccur->parent = (n); \
@@ -138,12 +138,12 @@ static int xmlCheckDTD = 1;
/************************************************************************
* *
- * Functions to move to entities.c once the *
+ * Functions to move to entities.c once the *
* API freeze is smoothen and they can be made public. *
* *
************************************************************************/
#include <libxml/hash.h>
-
+
#ifdef LIBXML_TREE_ENABLED
/**
* xmlGetEntityFromDtd:
@@ -152,17 +152,17 @@ static int xmlCheckDTD = 1;
*
* Do an entity lookup in the DTD entity hash table and
* return the corresponding entity, if found.
- *
+ *
* Returns A pointer to the entity structure or NULL if not found.
*/
static xmlEntityPtr
xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
xmlEntitiesTablePtr table;
-
+
if((dtd != NULL) && (dtd->entities != NULL)) {
table = (xmlEntitiesTablePtr) dtd->entities;
return((xmlEntityPtr) xmlHashLookup(table, name));
- /* return(xmlGetEntityFromTable(table, name)); */
+ /* return(xmlGetEntityFromTable(table, name)); */
}
return(NULL);
}
@@ -170,7 +170,7 @@ xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
* xmlGetParameterEntityFromDtd:
* @dtd: A pointer to the DTD to search
* @name: The entity name
- *
+ *
* Do an entity lookup in the DTD pararmeter entity hash table and
* return the corresponding entity, if found.
*
@@ -179,7 +179,7 @@ xmlGetEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
static xmlEntityPtr
xmlGetParameterEntityFromDtd(xmlDtdPtr dtd, const xmlChar *name) {
xmlEntitiesTablePtr table;
-
+
if ((dtd != NULL) && (dtd->pentities != NULL)) {
table = (xmlEntitiesTablePtr) dtd->pentities;
return((xmlEntityPtr) xmlHashLookup(table, name));
@@ -240,7 +240,7 @@ xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix,
/**
* xmlSplitQName2:
* @name: the full QName
- * @prefix: a xmlChar **
+ * @prefix: a xmlChar **
*
* parse an XML qualified name string
*
@@ -278,9 +278,9 @@ xmlSplitQName2(const xmlChar *name, xmlChar **prefix) {
* we are not trying to validate but just to cut, and yes it will
* work even if this is as set of UTF-8 encoded chars
*/
- while ((name[len] != 0) && (name[len] != ':'))
+ while ((name[len] != 0) && (name[len] != ':'))
len++;
-
+
if (name[len] == 0)
return(NULL);
@@ -329,9 +329,9 @@ xmlSplitQName3(const xmlChar *name, int *len) {
* we are not trying to validate but just to cut, and yes it will
* work even if this is as set of UTF-8 encoded chars
*/
- while ((name[l] != 0) && (name[l] != ':'))
+ while ((name[l] != 0) && (name[l] != ':'))
l++;
-
+
if (name[l] == 0)
return(NULL);
@@ -345,7 +345,7 @@ xmlSplitQName3(const xmlChar *name, int *len) {
* Check Name, NCName and QName strings *
* *
************************************************************************/
-
+
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
@@ -668,14 +668,14 @@ try_complex:
* Allocation and deallocation of basic structures *
* *
************************************************************************/
-
+
/**
* xmlSetBufferAllocationScheme:
* @scheme: allocation method to use
- *
+ *
* Set the buffer allocation method. Types are
* XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down
- * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed,
+ * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed,
* improves performance
*/
void
@@ -688,9 +688,9 @@ xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme) {
*
* Types are
* XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down
- * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed,
+ * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed,
* improves performance
- *
+ *
* Returns the current allocation scheme
*/
xmlBufferAllocationScheme
@@ -733,9 +733,9 @@ xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) {
cur->type = XML_LOCAL_NAMESPACE;
if (href != NULL)
- cur->href = xmlStrdup(href);
+ cur->href = xmlStrdup(href);
if (prefix != NULL)
- cur->prefix = xmlStrdup(prefix);
+ cur->prefix = xmlStrdup(prefix);
/*
* Add it at the end to preserve parsing order ...
@@ -751,14 +751,14 @@ xmlNewNs(xmlNodePtr node, const xmlChar *href, const xmlChar *prefix) {
(xmlStrEqual(prev->prefix, cur->prefix))) {
xmlFreeNs(cur);
return(NULL);
- }
+ }
while (prev->next != NULL) {
prev = prev->next;
if (((prev->prefix == NULL) && (cur->prefix == NULL)) ||
(xmlStrEqual(prev->prefix, cur->prefix))) {
xmlFreeNs(cur);
return(NULL);
- }
+ }
}
prev->next = cur;
}
@@ -867,11 +867,11 @@ xmlNewDtd(xmlDocPtr doc, const xmlChar *name,
cur->type = XML_DTD_NODE;
if (name != NULL)
- cur->name = xmlStrdup(name);
+ cur->name = xmlStrdup(name);
if (ExternalID != NULL)
- cur->ExternalID = xmlStrdup(ExternalID);
+ cur->ExternalID = xmlStrdup(ExternalID);
if (SystemID != NULL)
- cur->SystemID = xmlStrdup(SystemID);
+ cur->SystemID = xmlStrdup(SystemID);
if (doc != NULL)
doc->extSubset = cur;
cur->doc = doc;
@@ -949,7 +949,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name,
}
}
if (ExternalID != NULL) {
- cur->ExternalID = xmlStrdup(ExternalID);
+ cur->ExternalID = xmlStrdup(ExternalID);
if (cur->ExternalID == NULL) {
xmlTreeErrMemory("building internal subset");
if (cur->name != NULL)
@@ -959,7 +959,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name,
}
}
if (SystemID != NULL) {
- cur->SystemID = xmlStrdup(SystemID);
+ cur->SystemID = xmlStrdup(SystemID);
if (cur->SystemID == NULL) {
xmlTreeErrMemory("building internal subset");
if (cur->name != NULL)
@@ -1022,7 +1022,7 @@ xmlCreateIntSubset(xmlDocPtr doc, const xmlChar *name,
* current scope
*/
#define DICT_FREE(str) \
- if ((str) && ((!dict) || \
+ if ((str) && ((!dict) || \
(xmlDictOwns(dict, (const xmlChar *)(str)) == 0))) \
xmlFree((char *)(str));
@@ -1105,7 +1105,7 @@ xmlFreeDtd(xmlDtdPtr cur) {
/* TODO !!! */
if (cur->notations != NULL)
xmlFreeNotationTable((xmlNotationTablePtr) cur->notations);
-
+
if (cur->elements != NULL)
xmlFreeElementTable((xmlElementTablePtr) cur->elements);
if (cur->attributes != NULL)
@@ -1144,15 +1144,17 @@ xmlNewDoc(const xmlChar *version) {
memset(cur, 0, sizeof(xmlDoc));
cur->type = XML_DOCUMENT_NODE;
- cur->version = xmlStrdup(version);
+ cur->version = xmlStrdup(version);
if (cur->version == NULL) {
xmlTreeErrMemory("building doc");
xmlFree(cur);
- return(NULL);
+ return(NULL);
}
cur->standalone = -1;
cur->compression = -1; /* not initialized */
cur->doc = cur;
+ cur->parseFlags = 0;
+ cur->properties = XML_DOC_USERBUILT;
/*
* The in memory encoding is always UTF8
* This field will never change and would
@@ -1280,7 +1282,7 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) {
else
tmp = 0;
while (tmp != ';') { /* Non input consuming loop */
- if ((tmp >= '0') && (tmp <= '9'))
+ if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 16 + (tmp - '0');
else if ((tmp >= 'a') && (tmp <= 'f'))
charval = charval * 16 + (tmp - 'a') + 10;
@@ -1308,7 +1310,7 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) {
else
tmp = 0;
while (tmp != ';') { /* Non input consuming loops */
- if ((tmp >= '0') && (tmp <= '9'))
+ if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 10 + (tmp - '0');
else {
xmlTreeErr(XML_TREE_INVALID_DEC, (xmlNodePtr) doc,
@@ -1353,7 +1355,7 @@ xmlStringLenGetNodeList(xmlDocPtr doc, const xmlChar *value, int len) {
last = xmlAddNextSibling(last, node);
} else
xmlNodeAddContent(last, ent->content);
-
+
} else {
/*
* Create a new REFERENCE_REF node
@@ -1474,7 +1476,7 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) {
cur += 3;
tmp = *cur;
while (tmp != ';') { /* Non input consuming loop */
- if ((tmp >= '0') && (tmp <= '9'))
+ if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 16 + (tmp - '0');
else if ((tmp >= 'a') && (tmp <= 'f'))
charval = charval * 16 + (tmp - 'a') + 10;
@@ -1496,7 +1498,7 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) {
cur += 2;
tmp = *cur;
while (tmp != ';') { /* Non input consuming loops */
- if ((tmp >= '0') && (tmp <= '9'))
+ if ((tmp >= '0') && (tmp <= '9'))
charval = charval * 10 + (tmp - '0');
else {
xmlTreeErr(XML_TREE_INVALID_DEC, (xmlNodePtr) doc,
@@ -1538,7 +1540,7 @@ xmlStringGetNodeList(xmlDocPtr doc, const xmlChar *value) {
last = xmlAddNextSibling(last, node);
} else
xmlNodeAddContent(last, ent->content);
-
+
} else {
/*
* Create a new REFERENCE_REF node
@@ -1976,7 +1978,7 @@ xmlNewDocProp(xmlDocPtr doc, const xmlChar *name, const xmlChar *value) {
cur->name = xmlDictLookup(doc->dict, name, -1);
else
cur->name = xmlStrdup(name);
- cur->doc = doc;
+ cur->doc = doc;
if (value != NULL) {
xmlNodePtr tmp;
@@ -2183,7 +2185,7 @@ xmlNewNode(xmlNsPtr ns, const xmlChar *name) {
}
memset(cur, 0, sizeof(xmlNode));
cur->type = XML_ELEMENT_NODE;
-
+
cur->name = xmlStrdup(name);
cur->ns = ns;
@@ -2226,7 +2228,7 @@ xmlNewNodeEatName(xmlNsPtr ns, xmlChar *name) {
}
memset(cur, 0, sizeof(xmlNode));
cur->type = XML_ELEMENT_NODE;
-
+
cur->name = name;
cur->ns = ns;
@@ -2414,9 +2416,9 @@ xmlNewText(const xmlChar *content) {
* a child TEXT node will be created containing the string @content.
* NOTE: Use xmlNewChild() if @content will contain entities that need to be
* preserved. Use this function, xmlNewTextChild(), if you need to ensure that
- * reserved XML chars that might appear in @content, such as the ampersand,
- * greater-than or less-than signs, are automatically replaced by their XML
- * escaped entity representations.
+ * reserved XML chars that might appear in @content, such as the ampersand,
+ * greater-than or less-than signs, are automatically replaced by their XML
+ * escaped entity representations.
*
* Returns a pointer to the new node object.
*/
@@ -2864,14 +2866,14 @@ xmlNewChild(xmlNodePtr parent, xmlNsPtr ns,
/**
* xmlAddPropSibling:
- * @prev: the attribute to which @prop is added after
+ * @prev: the attribute to which @prop is added after
* @cur: the base attribute passed to calling function
* @prop: the new attribute
*
* Add a new attribute after @prev using @cur as base attribute.
* When inserting before @cur, @prev is passed as @cur->prev.
* When inserting after @cur, @prev is passed as @cur.
- * If an existing attribute is found it is detroyed prior to adding @prop.
+ * If an existing attribute is found it is detroyed prior to adding @prop.
*
* Returns the attribute being inserted or NULL in case of error.
*/
@@ -2921,7 +2923,7 @@ xmlAddPropSibling(xmlNodePtr prev, xmlNodePtr cur, xmlNodePtr prop) {
* first unlinked from its existing context.
* As a result of text merging @elem may be freed.
* If the new node is ATTRIBUTE, it is added into properties instead of children.
- * If there is an attribute with equal name, it is first destroyed.
+ * If there is an attribute with equal name, it is first destroyed.
*
* Returns the new node or NULL in case of error.
*/
@@ -2999,7 +3001,7 @@ xmlAddNextSibling(xmlNodePtr cur, xmlNodePtr elem) {
* If the new node was already inserted in a document it is
* first unlinked from its existing context.
* If the new node is ATTRIBUTE, it is added into properties instead of children.
- * If there is an attribute with equal name, it is first destroyed.
+ * If there is an attribute with equal name, it is first destroyed.
*
* Returns the new node or NULL in case of error.
*/
@@ -3103,7 +3105,7 @@ xmlAddSibling(xmlNodePtr cur, xmlNodePtr elem) {
* Constant time is we can rely on the ->parent->last to find
* the last sibling.
*/
- if ((cur->type != XML_ATTRIBUTE_NODE) && (cur->parent != NULL) &&
+ if ((cur->type != XML_ATTRIBUTE_NODE) && (cur->parent != NULL) &&
(cur->parent->children != NULL) &&
(cur->parent->last != NULL) &&
(cur->parent->last->next == NULL)) {
@@ -3185,10 +3187,10 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) {
/*
* If cur and parent->last both are TEXT nodes, then merge them.
*/
- if ((cur->type == XML_TEXT_NODE) &&
+ if ((cur->type == XML_TEXT_NODE) &&
(parent->last->type == XML_TEXT_NODE) &&
(cur->name == parent->last->name)) {
- xmlNodeAddContent(parent->last, cur->content);
+ xmlNodeAddContent(parent->last, cur->content);
/*
* if it's the only child, nothing more to be done.
*/
@@ -3226,7 +3228,7 @@ xmlAddChildList(xmlNodePtr parent, xmlNodePtr cur) {
* Add a new node to @parent, at the end of the child (or property) list
* merging adjacent TEXT nodes (in which case @cur is freed)
* If the new node is ATTRIBUTE, it is added into properties instead of children.
- * If there is an attribute with equal name, it is first destroyed.
+ * If there is an attribute with equal name, it is first destroyed.
*
* Returns the child or NULL in case of error.
*/
@@ -3465,6 +3467,11 @@ xmlFreeNode(xmlNodePtr cur) {
if (cur->doc != NULL) dict = cur->doc->dict;
+ if (cur->type == XML_ENTITY_DECL) {
+ xmlEntityPtr ent = (xmlEntityPtr) cur;
+ DICT_FREE(ent->SystemID);
+ DICT_FREE(ent->ExternalID);
+ }
if ((cur->children != NULL) &&
(cur->type != XML_ENTITY_REF_NODE))
xmlFreeNodeList(cur->children);
@@ -3525,6 +3532,28 @@ xmlUnlinkNode(xmlNodePtr cur) {
doc->extSubset = NULL;
}
}
+ if (cur->type == XML_ENTITY_DECL) {
+ xmlDocPtr doc;
+ doc = cur->doc;
+ if (doc != NULL) {
+ if (doc->intSubset != NULL) {
+ if (xmlHashLookup(doc->intSubset->entities, cur->name) == cur)
+ xmlHashRemoveEntry(doc->intSubset->entities, cur->name,
+ NULL);
+ if (xmlHashLookup(doc->intSubset->pentities, cur->name) == cur)
+ xmlHashRemoveEntry(doc->intSubset->pentities, cur->name,
+ NULL);
+ }
+ if (doc->extSubset != NULL) {
+ if (xmlHashLookup(doc->extSubset->entities, cur->name) == cur)
+ xmlHashRemoveEntry(doc->extSubset->entities, cur->name,
+ NULL);
+ if (xmlHashLookup(doc->extSubset->pentities, cur->name) == cur)
+ xmlHashRemoveEntry(doc->extSubset->pentities, cur->name,
+ NULL);
+ }
+ }
+ }
if (cur->parent != NULL) {
xmlNodePtr parent;
parent = cur->parent;
@@ -3620,7 +3649,7 @@ xmlReplaceNode(xmlNodePtr old, xmlNodePtr cur) {
* Copy operations *
* *
************************************************************************/
-
+
/**
* xmlCopyNamespace:
* @cur: the namespace
@@ -3737,7 +3766,7 @@ xmlCopyPropInternal(xmlDocPtr doc, xmlNodePtr target, xmlAttrPtr cur) {
ret->ns = xmlNewReconciliedNs(target->doc, target, cur->ns);
}
}
-
+
} else
ret->ns = NULL;
@@ -3858,7 +3887,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
return((xmlNodePtr) xmlCopyPropInternal(doc, parent, (xmlAttrPtr) node));
case XML_NAMESPACE_DECL:
return((xmlNodePtr) xmlCopyNamespaceList((xmlNsPtr) node));
-
+
case XML_DOCUMENT_NODE:
case XML_HTML_DOCUMENT_NODE:
#ifdef LIBXML_DOCB_ENABLED
@@ -3888,7 +3917,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
ret->type = node->type;
ret->doc = doc;
- ret->parent = parent;
+ ret->parent = parent;
if (node->name == xmlStringText)
ret->name = xmlStringText;
else if (node->name == xmlStringTextNoenc)
@@ -3927,7 +3956,7 @@ xmlStaticCopyNode(const xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent,
if (tmp != ret)
return(tmp);
}
-
+
if (!extended)
goto out;
if ((node->type == XML_ELEMENT_NODE) && (node->nsDef != NULL))
@@ -4123,7 +4152,7 @@ xmlCopyDtd(xmlDtdPtr dtd) {
if (dtd->pentities != NULL)
ret->pentities = (void *) xmlCopyEntitiesTable(
(xmlEntitiesTablePtr) dtd->pentities);
-
+
cur = dtd->children;
while (cur != NULL) {
q = NULL;
@@ -4138,7 +4167,7 @@ xmlCopyDtd(xmlDtdPtr dtd) {
break;
case XML_INTERNAL_PARAMETER_ENTITY:
case XML_EXTERNAL_PARAMETER_ENTITY:
- q = (xmlNodePtr)
+ q = (xmlNodePtr)
xmlGetParameterEntityFromDtd(ret, tmp->name);
break;
case XML_INTERNAL_PREDEFINED_ENTITY:
@@ -4150,27 +4179,27 @@ xmlCopyDtd(xmlDtdPtr dtd) {
xmlGetDtdQElementDesc(ret, tmp->name, tmp->prefix);
} else if (cur->type == XML_ATTRIBUTE_DECL) {
xmlAttributePtr tmp = (xmlAttributePtr) cur;
- q = (xmlNodePtr)
+ q = (xmlNodePtr)
xmlGetDtdQAttrDesc(ret, tmp->elem, tmp->name, tmp->prefix);
} else if (cur->type == XML_COMMENT_NODE) {
q = xmlCopyNode(cur, 0);
}
-
+
if (q == NULL) {
cur = cur->next;
continue;
}
-
+
if (p == NULL)
ret->children = q;
else
- p->next = q;
-
- q->prev = p;
- q->parent = (xmlNodePtr) ret;
+ p->next = q;
+
+ q->prev = p;
+ q->parent = (xmlNodePtr) ret;
q->next = NULL;
ret->last = q;
- p = q;
+ p = q;
cur = cur->next;
}
@@ -4220,7 +4249,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
ret->oldNs = xmlCopyNamespaceList(doc->oldNs);
if (doc->children != NULL) {
xmlNodePtr tmp;
-
+
ret->children = xmlStaticCopyNodeList(doc->children, ret,
(xmlNodePtr)ret);
ret->last = NULL;
@@ -4240,7 +4269,7 @@ xmlCopyDoc(xmlDocPtr doc, int recursive) {
* Content access functions *
* *
************************************************************************/
-
+
/**
* xmlGetLineNo:
* @node: valid node
@@ -4332,7 +4361,7 @@ xmlGetNodePath(xmlNodePtr node)
if (cur->ns) {
if (cur->ns->prefix != NULL) {
snprintf(nametemp, sizeof(nametemp) - 1, "%s:%s",
- (char *)cur->ns->prefix, (char *)cur->name);
+ (char *)cur->ns->prefix, (char *)cur->name);
nametemp[sizeof(nametemp) - 1] = 0;
name = nametemp;
} else {
@@ -4342,7 +4371,7 @@ xmlGetNodePath(xmlNodePtr node)
*/
generic = 1;
name = "*";
- }
+ }
}
next = cur->parent;
@@ -4430,7 +4459,7 @@ xmlGetNodePath(xmlNodePtr node)
{
occur = 1;
break;
- }
+ }
tmp = tmp->next;
}
} else
@@ -4473,10 +4502,10 @@ xmlGetNodePath(xmlNodePtr node)
if (cur->ns) {
if (cur->ns->prefix != NULL)
snprintf(nametemp, sizeof(nametemp) - 1, "%s:%s",
- (char *)cur->ns->prefix, (char *)cur->name);
+ (char *)cur->ns->prefix, (char *)cur->name);
else
snprintf(nametemp, sizeof(nametemp) - 1, "%s",
- (char *)cur->name);
+ (char *)cur->name);
nametemp[sizeof(nametemp) - 1] = 0;
name = nametemp;
}
@@ -4544,7 +4573,7 @@ xmlDocGetRootElement(xmlDocPtr doc) {
}
return(ret);
}
-
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
/**
* xmlDocSetRootElement:
@@ -4586,7 +4615,7 @@ xmlDocSetRootElement(xmlDocPtr doc, xmlNodePtr root) {
return(old);
}
#endif
-
+
#if defined(LIBXML_TREE_ENABLED)
/**
* xmlNodeSetLang:
@@ -4634,7 +4663,7 @@ xmlNodeSetLang(xmlNodePtr cur, const xmlChar *lang) {
xmlSetNsProp(cur, ns, BAD_CAST "lang", lang);
}
#endif /* LIBXML_TREE_ENABLED */
-
+
/**
* xmlNodeGetLang:
* @cur: the node being checked
@@ -4657,7 +4686,7 @@ xmlNodeGetLang(xmlNodePtr cur) {
}
return(NULL);
}
-
+
#ifdef LIBXML_TREE_ENABLED
/**
@@ -4745,7 +4774,7 @@ xmlNodeGetSpacePreserve(xmlNodePtr cur) {
}
return(-1);
}
-
+
#ifdef LIBXML_TREE_ENABLED
/**
* xmlNodeSetName:
@@ -4803,7 +4832,7 @@ xmlNodeSetName(xmlNodePtr cur, const xmlChar *name) {
}
}
#endif
-
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
/**
* xmlNodeSetBase:
@@ -4856,7 +4885,7 @@ xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri) {
return;
}
}
-
+
ns = xmlSearchNsByHref(cur->doc, cur, XML_XML_NAMESPACE);
if (ns == NULL)
return;
@@ -4892,9 +4921,9 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) {
xmlChar *oldbase = NULL;
xmlChar *base, *newbase;
- if ((cur == NULL) && (doc == NULL))
+ if ((cur == NULL) && (doc == NULL))
return(NULL);
- if (doc == NULL) doc = cur->doc;
+ if (doc == NULL) doc = cur->doc;
if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
cur = doc->children;
while ((cur != NULL) && (cur->name != NULL)) {
@@ -4956,7 +4985,7 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) {
}
return(oldbase);
}
-
+
/**
* xmlNodeBufGetContent:
* @buffer: a buffer
@@ -4967,7 +4996,7 @@ xmlNodeGetBase(xmlDocPtr doc, xmlNodePtr cur) {
* of the values carried by this node child's (TEXT and ENTITY_REF).
* Entity references are substituted.
* Fills up the buffer @buffer with this value
- *
+ *
* Returns 0 in case of success and -1 in case of error.
*/
int
@@ -5246,12 +5275,12 @@ xmlNodeSetContent(xmlNodePtr cur, const xmlChar *content) {
if (!((cur->doc != NULL) && (cur->doc->dict != NULL) &&
(xmlDictOwns(cur->doc->dict, cur->content))))
xmlFree(cur->content);
- }
+ }
if (cur->children != NULL) xmlFreeNodeList(cur->children);
cur->last = cur->children = NULL;
if (content != NULL) {
cur->content = xmlStrdup(content);
- } else
+ } else
cur->content = NULL;
cur->properties = NULL;
cur->nsDef = NULL;
@@ -5324,12 +5353,12 @@ xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) {
if (!((cur->doc != NULL) && (cur->doc->dict != NULL) &&
(xmlDictOwns(cur->doc->dict, cur->content))))
xmlFree(cur->content);
- }
+ }
if (cur->children != NULL) xmlFreeNodeList(cur->children);
cur->children = cur->last = NULL;
if (content != NULL) {
cur->content = xmlStrndup(content, len);
- } else
+ } else
cur->content = NULL;
cur->properties = NULL;
cur->nsDef = NULL;
@@ -5363,7 +5392,7 @@ xmlNodeSetContentLen(xmlNodePtr cur, const xmlChar *content, int len) {
* @cur: the node being modified
* @content: extra content
* @len: the size of @content
- *
+ *
* Append the extra substring to the node content.
* NOTE: In contrast to xmlNodeSetContentLen(), @content is supposed to be
* raw text, so unescaped XML special chars are allowed, entity
@@ -5438,7 +5467,7 @@ xmlNodeAddContentLen(xmlNodePtr cur, const xmlChar *content, int len) {
* xmlNodeAddContent:
* @cur: the node being modified
* @content: extra content
- *
+ *
* Append the extra substring to the node content.
* NOTE: In contrast to xmlNodeSetContent(), @content is supposed to be
* raw text, so unescaped XML special chars are allowed, entity
@@ -5464,7 +5493,7 @@ xmlNodeAddContent(xmlNodePtr cur, const xmlChar *content) {
* xmlTextMerge:
* @first: the first text node
* @second: the second text node being merged
- *
+ *
* Merge two text nodes into one
* Returns the first text node augmented
*/
@@ -5549,9 +5578,9 @@ xmlGetNsList(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node)
/*
* xmlTreeEnsureXMLDecl:
* @doc: the doc
-*
+*
* Ensures that there is an XML namespace declaration on the doc.
-*
+*
* Returns the XML ns-struct or NULL on API and internal errors.
*/
static xmlNsPtr
@@ -5571,7 +5600,7 @@ xmlTreeEnsureXMLDecl(xmlDocPtr doc)
}
memset(ns, 0, sizeof(xmlNs));
ns->type = XML_LOCAL_NAMESPACE;
- ns->href = xmlStrdup(XML_XML_NAMESPACE);
+ ns->href = xmlStrdup(XML_XML_NAMESPACE);
ns->prefix = xmlStrdup((const xmlChar *)"xml");
doc->oldNs = ns;
return (ns);
@@ -5596,7 +5625,7 @@ xmlTreeEnsureXMLDecl(xmlDocPtr doc)
*/
xmlNsPtr
xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
-
+
xmlNsPtr cur;
xmlNodePtr orig = node;
@@ -5616,8 +5645,8 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
}
memset(cur, 0, sizeof(xmlNs));
cur->type = XML_LOCAL_NAMESPACE;
- cur->href = xmlStrdup(XML_XML_NAMESPACE);
- cur->prefix = xmlStrdup((const xmlChar *)"xml");
+ cur->href = xmlStrdup(XML_XML_NAMESPACE);
+ cur->prefix = xmlStrdup((const xmlChar *)"xml");
cur->next = node->nsDef;
node->nsDef = cur;
return(cur);
@@ -5652,7 +5681,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
return(cur);
cur = cur->next;
}
- if (orig != node) {
+ if (orig != node) {
cur = node->ns;
if (cur != NULL) {
if ((cur->prefix == NULL) && (nameSpace == NULL) &&
@@ -5663,7 +5692,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
(xmlStrEqual(cur->prefix, nameSpace)))
return(cur);
}
- }
+ }
}
node = node->parent;
}
@@ -5679,7 +5708,7 @@ xmlSearchNs(xmlDocPtr doc, xmlNodePtr node, const xmlChar *nameSpace) {
*
* Verify that the given namespace held on @ancestor is still in scope
* on node.
- *
+ *
* Returns 1 if true, 0 if false and -1 in case of error.
*/
static int
@@ -5712,7 +5741,7 @@ xmlNsInScope(xmlDocPtr doc ATTRIBUTE_UNUSED, xmlNodePtr node,
return (-1);
return (1);
}
-
+
/**
* xmlSearchNsByHref:
* @doc: the document
@@ -5766,7 +5795,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
if (doc->oldNs == NULL)
return(xmlTreeEnsureXMLDecl(doc));
else
- return(doc->oldNs);
+ return(doc->oldNs);
}
is_attr = (node->type == XML_ATTRIBUTE_NODE);
while (node != NULL) {
@@ -5795,7 +5824,7 @@ xmlSearchNsByHref(xmlDocPtr doc, xmlNodePtr node, const xmlChar * href)
return (cur);
}
}
- }
+ }
}
node = node->parent;
}
@@ -5858,7 +5887,7 @@ xmlNewReconciliedNs(xmlDocPtr doc, xmlNodePtr tree, xmlNsPtr ns) {
snprintf((char *) prefix, sizeof(prefix), "default%d", counter++);
else
snprintf((char *) prefix, sizeof(prefix), "%.20s%d",
- (char *)ns->prefix, counter++);
+ (char *)ns->prefix, counter++);
def = xmlSearchNs(doc, tree, prefix);
}
@@ -6053,7 +6082,7 @@ xmlReconciliateNs(xmlDocPtr doc, xmlNodePtr tree) {
}
}
/* exit condition */
- if (node == tree)
+ if (node == tree)
node = NULL;
} else
break;
@@ -6109,14 +6138,14 @@ xmlGetPropNodeInternal(xmlNodePtr node, const xmlChar *name,
/*
* Check if there is a default/fixed attribute declaration in
* the internal or external subset.
- */
+ */
if ((node->doc != NULL) && (node->doc->intSubset != NULL)) {
xmlDocPtr doc = node->doc;
xmlAttributePtr attrDecl = NULL;
xmlChar *elemQName, *tmpstr = NULL;
/*
- * We need the QName of the element for the DTD-lookup.
+ * We need the QName of the element for the DTD-lookup.
*/
if ((node->ns != NULL) && (node->ns->prefix != NULL)) {
tmpstr = xmlStrdup(node->ns->prefix);
@@ -6167,7 +6196,7 @@ xmlGetPropNodeInternal(xmlNodePtr node, const xmlChar *name,
cur++;
}
xmlFree(nsList);
- }
+ }
if (tmpstr != NULL)
xmlFree(tmpstr);
/*
@@ -6211,7 +6240,7 @@ xmlGetPropNodeValueInternal(xmlAttrPtr prop)
} else if (prop->type == XML_ATTRIBUTE_DECL) {
return(xmlStrdup(((xmlAttributePtr)prop)->defaultValue));
}
- return(NULL);
+ return(NULL);
}
/**
@@ -6223,7 +6252,7 @@ xmlGetPropNodeValueInternal(xmlAttrPtr prop)
* This function also looks in DTD attribute declaration for #FIXED or
* default declaration values unless DTD use has been turned off.
*
- * Returns the attribute or the attribute declaration or NULL if
+ * Returns the attribute or the attribute declaration or NULL if
* neither was found.
*/
xmlAttrPtr
@@ -6305,12 +6334,12 @@ xmlHasNsProp(xmlNodePtr node, const xmlChar *name, const xmlChar *nameSpace) {
*/
xmlChar *
xmlGetProp(xmlNodePtr node, const xmlChar *name) {
- xmlAttrPtr prop;
+ xmlAttrPtr prop;
prop = xmlHasProp(node, name);
if (prop == NULL)
return(NULL);
- return(xmlGetPropNodeValueInternal(prop));
+ return(xmlGetPropNodeValueInternal(prop));
}
/**
@@ -6331,7 +6360,7 @@ xmlGetProp(xmlNodePtr node, const xmlChar *name) {
xmlChar *
xmlGetNoNsProp(xmlNodePtr node, const xmlChar *name) {
xmlAttrPtr prop;
-
+
prop = xmlGetPropNodeInternal(node, name, NULL, xmlCheckDTD);
if (prop == NULL)
return(NULL);
@@ -6397,7 +6426,7 @@ xmlUnsetProp(xmlNodePtr node, const xmlChar *name) {
int
xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) {
xmlAttrPtr prop;
-
+
prop = xmlGetPropNodeInternal(node, name, (ns != NULL) ? ns->href : NULL, 0);
if (prop == NULL)
return(-1);
@@ -6420,7 +6449,7 @@ xmlUnsetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name) {
* error it there's no such ns-binding for the prefix in
* scope.
* Returns the attribute pointer.
- *
+ *
*/
xmlAttrPtr
xmlSetProp(xmlNodePtr node, const xmlChar *name, const xmlChar *value) {
@@ -6463,7 +6492,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
const xmlChar *value)
{
xmlAttrPtr prop;
-
+
if (ns && (ns->href == NULL))
return(NULL);
prop = xmlGetPropNodeInternal(node, name, (ns != NULL) ? ns->href : NULL, 0);
@@ -6475,14 +6504,14 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
xmlRemoveID(node->doc, prop);
prop->atype = XML_ATTRIBUTE_ID;
}
- if (prop->children != NULL)
+ if (prop->children != NULL)
xmlFreeNodeList(prop->children);
prop->children = NULL;
prop->last = NULL;
prop->ns = ns;
if (value != NULL) {
xmlNodePtr tmp;
-
+
if(!xmlCheckUTF8(value)) {
xmlTreeErr(XML_TREE_NOT_UTF8, (xmlNodePtr) node->doc,
NULL);
@@ -6514,7 +6543,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name,
/**
* xmlNodeIsText:
* @node: the node
- *
+ *
* Is this node a Text node ?
* Returns 1 yes, 0 no
*/
@@ -6529,7 +6558,7 @@ xmlNodeIsText(xmlNodePtr node) {
/**
* xmlIsBlankNode:
* @node: the node
- *
+ *
* Checks whether this node is an empty or whitespace only
* (and possibly ignorable) text-node.
*
@@ -6558,7 +6587,7 @@ xmlIsBlankNode(xmlNodePtr node) {
* @node: the node
* @content: the content
* @len: @content length
- *
+ *
* Concat the given string at the end of the existing node content
*
* Returns -1 in case of error, 0 otherwise
@@ -6623,6 +6652,7 @@ xmlBufferCreate(void) {
return(NULL);
}
ret->content[0] = 0;
+ ret->contentIO = NULL;
return(ret);
}
@@ -6655,6 +6685,7 @@ xmlBufferCreateSize(size_t size) {
ret->content[0] = 0;
} else
ret->content = NULL;
+ ret->contentIO = NULL;
return(ret);
}
@@ -6696,7 +6727,7 @@ xmlBufferCreateStatic(void *mem, size_t size) {
* Sets the allocation scheme for this buffer
*/
void
-xmlBufferSetAllocationScheme(xmlBufferPtr buf,
+xmlBufferSetAllocationScheme(xmlBufferPtr buf,
xmlBufferAllocationScheme scheme) {
if (buf == NULL) {
#ifdef DEBUG_BUFFER
@@ -6727,7 +6758,10 @@ xmlBufferFree(xmlBufferPtr buf) {
return;
}
- if ((buf->content != NULL) &&
+ if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
+ (buf->contentIO != NULL)) {
+ xmlFree(buf->contentIO);
+ } else if ((buf->content != NULL) &&
(buf->alloc != XML_BUFFER_ALLOC_IMMUTABLE)) {
xmlFree(buf->content);
}
@@ -6747,8 +6781,15 @@ xmlBufferEmpty(xmlBufferPtr buf) {
buf->use = 0;
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) {
buf->content = BAD_CAST "";
+ } else if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
+ (buf->contentIO != NULL)) {
+ size_t start_buf = buf->content - buf->contentIO;
+
+ buf->size += start_buf;
+ buf->content = buf->contentIO;
+ buf->content[0] = 0;
} else {
- memset(buf->content, 0, buf->size);
+ buf->content[0] = 0;
}
}
@@ -6768,10 +6809,30 @@ xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
if (len > buf->use) return(-1);
buf->use -= len;
- if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) {
+ if ((buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) ||
+ ((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
+ */
buf->content += len;
+ buf->size -= len;
+
+ /*
+ * sometimes though it maybe be better to really shrink
+ * on IO buffers
+ */
+ if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
+ size_t start_buf = buf->content - buf->contentIO;
+ if (start_buf >= buf->size) {
+ memmove(buf->contentIO, &buf->content[0], buf->use);
+ buf->content = buf->contentIO;
+ buf->content[buf->use] = 0;
+ buf->size += start_buf;
+ }
+ }
} else {
- memmove(buf->content, &buf->content[len], buf->use * sizeof(xmlChar));
+ memmove(buf->content, &buf->content[len], buf->use);
buf->content[buf->use] = 0;
}
return(len);
@@ -6809,12 +6870,24 @@ xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
size = buf->use + len + 100;
#endif
- newbuf = (xmlChar *) xmlRealloc(buf->content, size);
- if (newbuf == NULL) {
- xmlTreeErrMemory("growing buffer");
- return(-1);
+ if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
+ size_t start_buf = buf->content - buf->contentIO;
+
+ newbuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + size);
+ if (newbuf == NULL) {
+ xmlTreeErrMemory("growing buffer");
+ return(-1);
+ }
+ buf->contentIO = newbuf;
+ buf->content = newbuf + start_buf;
+ } else {
+ newbuf = (xmlChar *) xmlRealloc(buf->content, size);
+ if (newbuf == NULL) {
+ xmlTreeErrMemory("growing buffer");
+ return(-1);
+ }
+ buf->content = newbuf;
}
- buf->content = newbuf;
buf->size = size;
return(buf->size - buf->use);
}
@@ -6871,7 +6944,7 @@ xmlBufferContent(const xmlBufferPtr buf)
/**
* xmlBufferLength:
- * @buf: the buffer
+ * @buf: the buffer
*
* Function to get the length of a buffer
*
@@ -6901,6 +6974,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
{
unsigned int newSize;
xmlChar* rebuf = NULL;
+ size_t start_buf;
if (buf == NULL)
return(0);
@@ -6913,42 +6987,62 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
/* figure out new size */
switch (buf->alloc){
- case XML_BUFFER_ALLOC_DOUBLEIT:
- /*take care of empty case*/
- newSize = (buf->size ? buf->size*2 : size + 10);
- while (size > newSize) newSize *= 2;
- break;
- case XML_BUFFER_ALLOC_EXACT:
- newSize = size+10;
- break;
- default:
- newSize = size+10;
- break;
- }
-
- if (buf->content == NULL)
- rebuf = (xmlChar *) xmlMallocAtomic(newSize * sizeof(xmlChar));
- else if (buf->size - buf->use < 100) {
- rebuf = (xmlChar *) xmlRealloc(buf->content,
- newSize * sizeof(xmlChar));
- } else {
- /*
- * if we are reallocating a buffer far from being full, it's
- * better to make a new allocation and copy only the used range
- * and free the old one.
- */
- rebuf = (xmlChar *) xmlMallocAtomic(newSize * sizeof(xmlChar));
- if (rebuf != NULL) {
- memcpy(rebuf, buf->content, buf->use);
- xmlFree(buf->content);
- rebuf[buf->use] = 0;
- }
+ case XML_BUFFER_ALLOC_IO:
+ case XML_BUFFER_ALLOC_DOUBLEIT:
+ /*take care of empty case*/
+ newSize = (buf->size ? buf->size*2 : size + 10);
+ while (size > newSize) newSize *= 2;
+ break;
+ case XML_BUFFER_ALLOC_EXACT:
+ newSize = size+10;
+ break;
+ default:
+ newSize = size+10;
+ break;
}
- if (rebuf == NULL) {
- xmlTreeErrMemory("growing buffer");
- return 0;
+
+ if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
+ start_buf = buf->content - buf->contentIO;
+
+ if (start_buf > newSize) {
+ /* move data back to start */
+ memmove(buf->contentIO, buf->content, buf->use);
+ buf->content = buf->contentIO;
+ buf->content[buf->use] = 0;
+ buf->size += start_buf;
+ } else {
+ rebuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + newSize);
+ if (rebuf == NULL) {
+ xmlTreeErrMemory("growing buffer");
+ return 0;
+ }
+ buf->contentIO = rebuf;
+ buf->content = rebuf + start_buf;
+ }
+ } else {
+ if (buf->content == NULL) {
+ rebuf = (xmlChar *) xmlMallocAtomic(newSize);
+ } else if (buf->size - buf->use < 100) {
+ rebuf = (xmlChar *) xmlRealloc(buf->content, newSize);
+ } else {
+ /*
+ * if we are reallocating a buffer far from being full, it's
+ * better to make a new allocation and copy only the used range
+ * and free the old one.
+ */
+ rebuf = (xmlChar *) xmlMallocAtomic(newSize);
+ if (rebuf != NULL) {
+ memcpy(rebuf, buf->content, buf->use);
+ xmlFree(buf->content);
+ rebuf[buf->use] = 0;
+ }
+ }
+ if (rebuf == NULL) {
+ xmlTreeErrMemory("growing buffer");
+ return 0;
+ }
+ buf->content = rebuf;
}
- buf->content = rebuf;
buf->size = newSize;
return 1;
@@ -7043,6 +7137,20 @@ xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
if (len <= 0) return -1;
+ if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
+ size_t start_buf = buf->content - buf->contentIO;
+
+ if (start_buf > (unsigned int) len) {
+ /*
+ * We can add it in the space previously shrinked
+ */
+ buf->content -= len;
+ memmove(&buf->content[0], str, len);
+ buf->use += len;
+ buf->size += len;
+ return(0);
+ }
+ }
needSize = buf->use + len + 2;
if (needSize > buf->size){
if (!xmlBufferResize(buf, needSize)){
@@ -7051,8 +7159,8 @@ xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
}
}
- memmove(&buf->content[len], &buf->content[0], buf->use * sizeof(xmlChar));
- memmove(&buf->content[0], str, len * sizeof(xmlChar));
+ memmove(&buf->content[len], &buf->content[0], buf->use);
+ memmove(&buf->content[0], str, len);
buf->use += len;
buf->content[buf->use] = 0;
return 0;
@@ -7299,7 +7407,7 @@ struct xmlNsMap {
/*
* xmlDOMWrapNsMapFree:
* @map: the ns-map
-*
+*
* Frees the ns-map
*/
static void
@@ -7330,7 +7438,7 @@ xmlDOMWrapNsMapFree(xmlNsMapPtr nsmap)
* @oldNs: the old ns-struct
* @newNs: the new ns-struct
* @depth: depth and ns-kind information
-*
+*
* Adds an ns-mapping item.
*/
static xmlNsMapItemPtr
@@ -7358,7 +7466,7 @@ xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position,
memset(map, 0, sizeof(struct xmlNsMap));
*nsmap = map;
}
-
+
if (map->pool != NULL) {
/*
* Reuse an item from the pool.
@@ -7377,11 +7485,11 @@ xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position,
}
memset(ret, 0, sizeof(struct xmlNsMapItem));
}
-
+
if (map->first == NULL) {
/*
* First ever.
- */
+ */
map->first = ret;
map->last = ret;
} else if (position == -1) {
@@ -7390,14 +7498,14 @@ xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position,
*/
ret->prev = map->last;
map->last->next = ret;
- map->last = ret;
+ map->last = ret;
} else if (position == 0) {
/*
* Set on first position.
*/
map->first->prev = ret;
- ret->next = map->first;
- map->first = ret;
+ ret->next = map->first;
+ map->first = ret;
} else
return(NULL);
@@ -7413,10 +7521,10 @@ xmlDOMWrapNsMapAddItem(xmlNsMapPtr *nsmap, int position,
* @doc: the doc
* @nsName: the namespace name
* @prefix: the prefix
-*
+*
* Creates or reuses an xmlNs struct on doc->oldNs with
* the given prefix and namespace name.
-*
+*
* Returns the aquired ns struct or NULL in case of an API
* or internal error.
*/
@@ -7456,7 +7564,7 @@ xmlDOMWrapStoreNs(xmlDocPtr doc,
*
* Allocates and initializes a new DOM-wrapper context.
*
-* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror.
+* Returns the xmlDOMWrapCtxtPtr or NULL in case of an internal errror.
*/
xmlDOMWrapCtxtPtr
xmlDOMWrapNewCtxt(void)
@@ -7495,9 +7603,9 @@ xmlDOMWrapFreeCtxt(xmlDOMWrapCtxtPtr ctxt)
* xmlTreeLookupNsListByPrefix:
* @nsList: a list of ns-structs
* @prefix: the searched prefix
-*
+*
* Searches for a ns-decl with the given prefix in @nsList.
-*
+*
* Returns the ns-decl if found, NULL if not found and on
* API errors.
*/
@@ -7525,9 +7633,9 @@ xmlTreeNSListLookupByPrefix(xmlNsPtr nsList, const xmlChar *prefix)
* xmlDOMWrapNSNormGatherInScopeNs:
* @map: the namespace map
* @node: the node to start with
-*
+*
* Puts in-scope namespaces into the ns-map.
-*
+*
* Returns 0 on success, -1 on API or internal errors.
*/
static int
@@ -7619,7 +7727,7 @@ xmlDOMWrapNSNormGatherInScopeNs(xmlNsMapPtr *map,
*
* For internal use. Adds a ns-decl mapping.
*
-* Returns 0 on success, -1 on internal errors.
+* Returns 0 on success, -1 on internal errors.
*/
static int
xmlDOMWrapNSNormAddNsMapItem2(xmlNsPtr **list, int *size, int *number,
@@ -7663,7 +7771,7 @@ xmlDOMWrapNSNormAddNsMapItem2(xmlNsPtr **list, int *size, int *number,
* NOTE: This function was not intensively tested.
*
* Returns 0 on success, 1 if the node is not supported,
-* -1 on API and internal errors.
+* -1 on API and internal errors.
*/
int
xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc,
@@ -7680,7 +7788,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc,
if (node->parent == NULL)
return (0);
- switch (node->type) {
+ switch (node->type) {
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
case XML_ENTITY_REF_NODE:
@@ -7688,7 +7796,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc,
case XML_COMMENT_NODE:
xmlUnlinkNode(node);
return (0);
- case XML_ELEMENT_NODE:
+ case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
break;
default:
@@ -7712,7 +7820,7 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc,
}
/* No break on purpose. */
case XML_ATTRIBUTE_NODE:
- if (node->ns != NULL) {
+ if (node->ns != NULL) {
/*
* Find a mapping.
*/
@@ -7756,14 +7864,14 @@ xmlDOMWrapRemoveNode(xmlDOMWrapCtxtPtr ctxt, xmlDocPtr doc,
break;
default:
goto next_sibling;
- }
-next_node:
+ }
+next_node:
if ((node->type == XML_ELEMENT_NODE) &&
(node->children != NULL)) {
node = node->children;
continue;
}
-next_sibling:
+next_sibling:
if (node == NULL)
break;
if (node->next != NULL)
@@ -7856,7 +7964,7 @@ xmlSearchNsByNamespaceStrict(xmlDocPtr doc, xmlNodePtr node,
*/
if (out) {
int ret;
-
+
ret = xmlNsInScope(doc, node, prev, ns->prefix);
if (ret < 0)
return (-1);
@@ -7924,7 +8032,7 @@ xmlSearchNsByPrefixStrict(xmlDocPtr doc, xmlNodePtr node,
if (cur->type == XML_ELEMENT_NODE) {
if (cur->nsDef != NULL) {
ns = cur->nsDef;
- do {
+ do {
if ((prefix == ns->prefix) ||
xmlStrEqual(prefix, ns->prefix))
{
@@ -7938,7 +8046,7 @@ xmlSearchNsByPrefixStrict(xmlDocPtr doc, xmlNodePtr node,
return (1);
}
ns = ns->next;
- } while (ns != NULL);
+ } while (ns != NULL);
}
} else if ((cur->type == XML_ENTITY_NODE) ||
(cur->type == XML_ENTITY_DECL))
@@ -8045,12 +8153,12 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc,
xmlNsPtr ns,
xmlNsPtr *retNs,
xmlNsMapPtr *nsMap,
-
+
int depth,
int ancestorsOnly,
int prefixed)
{
- xmlNsMapItemPtr mi;
+ xmlNsMapItemPtr mi;
if ((doc == NULL) || (ns == NULL) || (retNs == NULL) ||
(nsMap == NULL))
@@ -8075,13 +8183,13 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc,
*/
if ((XML_NSMAP_NOTEMPTY(*nsMap)) &&
(! (ancestorsOnly && (elem == NULL))))
- {
+ {
/*
* Try to find an equal ns-name in in-scope ns-decls.
*/
XML_NSMAP_FOREACH(*nsMap, mi) {
- if ((mi->depth >= XML_TREE_NSMAP_PARENT) &&
- /*
+ if ((mi->depth >= XML_TREE_NSMAP_PARENT) &&
+ /*
* ancestorsOnly: This should be turned on to gain speed,
* if one knows that the branch itself was already
* ns-wellformed and no stale references existed.
@@ -8089,10 +8197,10 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc,
*/
((! ancestorsOnly) || (mi->depth == XML_TREE_NSMAP_PARENT)) &&
/* Skip shadowed prefixes. */
- (mi->shadowDepth == -1) &&
+ (mi->shadowDepth == -1) &&
/* Skip xmlns="" or xmlns:foo="". */
((mi->newNs->href != NULL) &&
- (mi->newNs->href[0] != 0)) &&
+ (mi->newNs->href[0] != 0)) &&
/* Ensure a prefix if wanted. */
((! prefixed) || (mi->newNs->prefix != NULL)) &&
/* Equal ns name */
@@ -8119,7 +8227,7 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc,
return (-1);
/*
* Insert mapping.
- */
+ */
if (xmlDOMWrapNsMapAddItem(nsMap, -1, ns,
tmpns, XML_TREE_NSMAP_DOC) == NULL) {
xmlFreeNs(tmpns);
@@ -8161,7 +8269,7 @@ xmlDOMWrapNSNormAquireNormalizedNs(xmlDocPtr doc,
}
typedef enum {
- XML_DOM_RECONNS_REMOVEREDUND = 1<<0
+ XML_DOM_RECONNS_REMOVEREDUND = 1<<0
} xmlDOMReconcileNSOptions;
/*
@@ -8179,7 +8287,7 @@ typedef enum {
* NOTE: This function was not intensively tested.
*
* Returns 0 if succeeded, -1 otherwise and on API/internal errors.
-*/
+*/
int
xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
@@ -8194,7 +8302,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
xmlNsMapItemPtr /* topmi = NULL, */ mi;
/* @ancestorsOnly should be set by an option flag. */
int ancestorsOnly = 0;
- int optRemoveRedundantNS =
+ int optRemoveRedundantNS =
((xmlDOMReconcileNSOptions) options & XML_DOM_RECONNS_REMOVEREDUND) ? 1 : 0;
xmlNsPtr *listRedund = NULL;
int sizeRedund = 0, nbRedund = 0, ret, i, j;
@@ -8230,7 +8338,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
}
parnsdone = 1;
}
-
+
/*
* Lookup the ns ancestor-axis for equal ns-decls in scope.
*/
@@ -8242,7 +8350,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
xmlStrEqual(ns->prefix, mi->newNs->prefix)) &&
((ns->href == mi->newNs->href) ||
xmlStrEqual(ns->href, mi->newNs->href)))
- {
+ {
/*
* A redundant ns-decl was found.
* Add it to the list of redundant ns-decls.
@@ -8252,11 +8360,11 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
goto internal_error;
/*
* Remove the ns-decl from the element-node.
- */
+ */
if (prevns)
prevns->next = ns->next;
else
- cur->nsDef = ns->next;
+ cur->nsDef = ns->next;
goto next_ns_decl;
}
}
@@ -8267,7 +8375,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
* ns-decl is declared on the same element.
*/
if ((cur->ns != NULL) && adoptns && (cur->ns == ns))
- adoptns = 0;
+ adoptns = 0;
/*
* Does it shadow any ns-decl?
*/
@@ -8277,7 +8385,7 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
(mi->shadowDepth == -1) &&
((ns->prefix == mi->newNs->prefix) ||
xmlStrEqual(ns->prefix, mi->newNs->prefix))) {
-
+
mi->shadowDepth = depth;
}
}
@@ -8287,11 +8395,11 @@ xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt ATTRIBUTE_UNUSED,
*/
if (xmlDOMWrapNsMapAddItem(&nsMap, -1, ns, ns,
depth) == NULL)
- goto internal_error;
+ goto internal_error;
prevns = ns;
next_ns_decl:
- ns = ns->next;
+ ns = ns->next;
}
}
if (! adoptns)
@@ -8301,7 +8409,7 @@ next_ns_decl:
/* No ns, no fun. */
if (cur->ns == NULL)
goto ns_end;
-
+
if (! parnsdone) {
if ((elem->parent) &&
((xmlNodePtr) elem->parent->doc != elem->parent)) {
@@ -8320,7 +8428,7 @@ next_ns_decl:
cur->ns = listRedund[++j];
break;
}
- }
+ }
}
/*
* Adopt ns-references.
@@ -8358,7 +8466,7 @@ ns_end:
cur = (xmlNodePtr) cur->properties;
continue;
}
- break;
+ break;
default:
goto next_sibling;
}
@@ -8371,18 +8479,18 @@ into_content:
cur = cur->children;
continue;
}
-next_sibling:
+next_sibling:
if (cur == elem)
break;
if (cur->type == XML_ELEMENT_NODE) {
- if (XML_NSMAP_NOTEMPTY(nsMap)) {
+ if (XML_NSMAP_NOTEMPTY(nsMap)) {
/*
* Pop mappings.
*/
while ((nsMap->last != NULL) &&
(nsMap->last->depth >= depth))
{
- XML_NSMAP_POP(nsMap, mi)
+ XML_NSMAP_POP(nsMap, mi)
}
/*
* Unshadow.
@@ -8391,7 +8499,7 @@ next_sibling:
if (mi->shadowDepth >= depth)
mi->shadowDepth = -1;
}
- }
+ }
depth--;
}
if (cur->next != NULL)
@@ -8405,13 +8513,13 @@ next_sibling:
goto next_sibling;
}
} while (cur != NULL);
-
+
ret = 0;
goto exit;
internal_error:
ret = -1;
exit:
- if (listRedund) {
+ if (listRedund) {
for (i = 0, j = 0; i < nbRedund; i++, j += 2) {
xmlFreeNs(listRedund[j]);
}
@@ -8462,7 +8570,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt,
int parnsdone;
/* @ancestorsOnly should be set per option. */
int ancestorsOnly = 0;
-
+
/*
* Optimize string adoption for equal or none dicts.
*/
@@ -8516,17 +8624,17 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt,
}
cur->doc = destDoc;
switch (cur->type) {
- case XML_XINCLUDE_START:
+ case XML_XINCLUDE_START:
case XML_XINCLUDE_END:
/*
* TODO
*/
return (-1);
- case XML_ELEMENT_NODE:
+ case XML_ELEMENT_NODE:
curElem = cur;
depth++;
/*
- * Namespace declarations.
+ * Namespace declarations.
* - ns->href and ns->prefix are never in the dict, so
* we need not move the values over to the destination dict.
* - Note that for custom handling of ns-references,
@@ -8550,10 +8658,10 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt,
* NOTE: ns->prefix and ns->href are never in the dict.
* XML_TREE_ADOPT_STR(ns->prefix)
* XML_TREE_ADOPT_STR(ns->href)
- */
+ */
/*
* Does it shadow any ns-decl?
- */
+ */
if (XML_NSMAP_NOTEMPTY(nsMap)) {
XML_NSMAP_FOREACH(nsMap, mi) {
if ((mi->depth >= XML_TREE_NSMAP_PARENT) &&
@@ -8561,7 +8669,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt,
((ns->prefix == mi->newNs->prefix) ||
xmlStrEqual(ns->prefix,
mi->newNs->prefix))) {
-
+
mi->shadowDepth = depth;
}
}
@@ -8624,7 +8732,7 @@ xmlDOMWrapAdoptBranch(xmlDOMWrapCtxtPtr ctxt,
* Aquire a normalized ns-decl and add it to the map.
*/
if (xmlDOMWrapNSNormAquireNormalizedNs(destDoc,
- /* ns-decls on curElem or on destDoc->oldNs */
+ /* ns-decls on curElem or on destDoc->oldNs */
destParent ? curElem : NULL,
cur->ns, &ns,
&nsMap, depth,
@@ -8660,7 +8768,7 @@ ns_end:
*/
if ((sourceDoc != NULL) &&
(((xmlAttrPtr) cur)->atype == XML_ATTRIBUTE_ID))
- {
+ {
xmlRemoveID(sourceDoc, (xmlAttrPtr) cur);
}
((xmlAttrPtr) cur)->atype = 0;
@@ -8668,13 +8776,13 @@ ns_end:
}
break;
case XML_TEXT_NODE:
- case XML_CDATA_SECTION_NODE:
+ case XML_CDATA_SECTION_NODE:
/*
* This puts the content in the dest dict, only if
* it was previously in the source dict.
*/
- XML_TREE_ADOPT_STR_2(cur->content)
- goto leave_node;
+ XML_TREE_ADOPT_STR_2(cur->content)
+ goto leave_node;
case XML_ENTITY_REF_NODE:
/*
* Remove reference to the entitity-node.
@@ -8699,7 +8807,7 @@ ns_end:
XML_TREE_ADOPT_STR(cur->name)
XML_TREE_ADOPT_STR_2(cur->content)
break;
- case XML_COMMENT_NODE:
+ case XML_COMMENT_NODE:
break;
default:
goto internal_error;
@@ -8722,15 +8830,15 @@ leave_node:
/*
* TODO: Do we expect nsDefs on XML_XINCLUDE_START?
*/
- if (XML_NSMAP_NOTEMPTY(nsMap)) {
+ if (XML_NSMAP_NOTEMPTY(nsMap)) {
/*
* Pop mappings.
*/
while ((nsMap->last != NULL) &&
(nsMap->last->depth >= depth))
{
- XML_NSMAP_POP(nsMap, mi)
- }
+ XML_NSMAP_POP(nsMap, mi)
+ }
/*
* Unshadow.
*/
@@ -8752,10 +8860,10 @@ leave_node:
goto leave_node;
}
}
-
+
goto exit;
-internal_error:
+internal_error:
ret = -1;
exit:
@@ -8773,7 +8881,7 @@ exit:
nsMap->pool = nsMap->first;
nsMap->first = NULL;
}
- } else
+ } else
xmlDOMWrapNsMapFree(nsMap);
}
return(ret);
@@ -8795,7 +8903,7 @@ exit:
* 2) If *no* @destParent is given, then @destDoc->oldNs entries are used.
* This is the case when you don't know already where the cloned branch
* will be added to.
-*
+*
* If @destParent is given, it ensures that the tree is namespace
* wellformed by creating additional ns-decls where needed.
* Note that, since prefixes of already existent ns-decls can be
@@ -8829,7 +8937,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/* gather @parent's ns-decls. */
int parnsdone = 0;
/*
- * @ancestorsOnly:
+ * @ancestorsOnly:
* TODO: @ancestorsOnly should be set per option.
*
*/
@@ -8856,7 +8964,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
return (-1);
}
if (sourceDoc == NULL)
- sourceDoc = node->doc;
+ sourceDoc = node->doc;
if (sourceDoc == NULL)
return (-1);
@@ -8868,7 +8976,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
nsMap = (xmlNsMapPtr) ctxt->namespaceMap;
*resNode = NULL;
-
+
cur = node;
while (cur != NULL) {
if (cur->doc != sourceDoc) {
@@ -8877,7 +8985,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
* TODO: Do we need to reconciliate XIncluded nodes?
* TODO: This here returns -1 in this case.
*/
- goto internal_error;
+ goto internal_error;
}
/*
* Create a new node.
@@ -8892,9 +9000,9 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
break;
case XML_ELEMENT_NODE:
case XML_TEXT_NODE:
- case XML_CDATA_SECTION_NODE:
+ case XML_CDATA_SECTION_NODE:
case XML_COMMENT_NODE:
- case XML_PI_NODE:
+ case XML_PI_NODE:
case XML_DOCUMENT_FRAG_NODE:
case XML_ENTITY_REF_NODE:
case XML_ENTITY_NODE:
@@ -8906,20 +9014,20 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating a node");
goto internal_error;
}
- memset(clone, 0, sizeof(xmlNode));
+ memset(clone, 0, sizeof(xmlNode));
/*
* Set hierachical links.
*/
- if (resultClone != NULL) {
+ if (resultClone != NULL) {
clone->parent = parentClone;
if (prevClone) {
prevClone->next = clone;
clone->prev = prevClone;
- } else
+ } else
parentClone->children = clone;
} else
resultClone = clone;
-
+
break;
case XML_ATTRIBUTE_NODE:
/*
@@ -8930,7 +9038,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
xmlTreeErrMemory("xmlDOMWrapCloneNode(): allocating an attr-node");
goto internal_error;
}
- memset(clone, 0, sizeof(xmlAttr));
+ memset(clone, 0, sizeof(xmlAttr));
/*
* Set hierachical links.
* TODO: Change this to add to the end of attributes.
@@ -8940,7 +9048,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
if (prevClone) {
prevClone->next = clone;
clone->prev = prevClone;
- } else
+ } else
parentClone->properties = (xmlAttrPtr) clone;
} else
resultClone = clone;
@@ -8953,8 +9061,8 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
}
clone->type = cur->type;
- clone->doc = destDoc;
-
+ clone->doc = destDoc;
+
/*
* Clone the name of the node if any.
*/
@@ -8964,14 +9072,14 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/*
* NOTE: Although xmlStringTextNoenc is never assigned to a node
* in tree.c, it might be set in Libxslt via
- * "xsl:disable-output-escaping".
+ * "xsl:disable-output-escaping".
*/
clone->name = xmlStringTextNoenc;
else if (cur->name == xmlStringComment)
clone->name = xmlStringComment;
else if (cur->name != NULL) {
DICT_CONST_COPY(cur->name, clone->name);
- }
+ }
switch (cur->type) {
case XML_XINCLUDE_START:
@@ -8994,7 +9102,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
*/
if (xmlDOMWrapNSNormGatherInScopeNs(&nsMap,
destParent) == -1)
- goto internal_error;
+ goto internal_error;
}
parnsdone = 1;
}
@@ -9014,7 +9122,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
}
memset(cloneNs, 0, sizeof(xmlNs));
cloneNs->type = XML_LOCAL_NAMESPACE;
-
+
if (ns->href != NULL)
cloneNs->href = xmlStrdup(ns->href);
if (ns->prefix != NULL)
@@ -9035,7 +9143,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
* Does it shadow any ns-decl?
*/
if (XML_NSMAP_NOTEMPTY(nsMap)) {
- XML_NSMAP_FOREACH(nsMap, mi) {
+ XML_NSMAP_FOREACH(nsMap, mi) {
if ((mi->depth >= XML_TREE_NSMAP_PARENT) &&
(mi->shadowDepth == -1) &&
((ns->prefix == mi->newNs->prefix) ||
@@ -9060,7 +9168,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
}
/* cur->ns will be processed further down. */
break;
- case XML_ATTRIBUTE_NODE:
+ case XML_ATTRIBUTE_NODE:
/* IDs will be processed further down. */
/* cur->ns will be processed further down. */
break;
@@ -9069,12 +9177,12 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/*
* Note that this will also cover the values of attributes.
*/
- DICT_COPY(cur->content, clone->content);
+ DICT_COPY(cur->content, clone->content);
goto leave_node;
case XML_ENTITY_NODE:
/* TODO: What to do here? */
goto leave_node;
- case XML_ENTITY_REF_NODE:
+ case XML_ENTITY_REF_NODE:
if (sourceDoc != destDoc) {
if ((destDoc->intSubset) || (destDoc->extSubset)) {
xmlEntityPtr ent;
@@ -9114,13 +9222,13 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/* handle_ns_reference: */
/*
** The following will take care of references to ns-decls ********
- ** and is intended only for element- and attribute-nodes.
+ ** and is intended only for element- and attribute-nodes.
**
*/
if (! parnsdone) {
if (destParent && (ctxt == NULL)) {
if (xmlDOMWrapNSNormGatherInScopeNs(&nsMap, destParent) == -1)
- goto internal_error;
+ goto internal_error;
}
parnsdone = 1;
}
@@ -9131,7 +9239,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/*
* Search for a mapping.
*/
- XML_NSMAP_FOREACH(nsMap, mi) {
+ XML_NSMAP_FOREACH(nsMap, mi) {
if ((mi->shadowDepth == -1) &&
(cur->ns == mi->oldNs)) {
/*
@@ -9163,7 +9271,7 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
* Aquire a normalized ns-decl and add it to the map.
*/
if (xmlDOMWrapNSNormAquireNormalizedNs(destDoc,
- /* ns-decls on curElem or on destDoc->oldNs */
+ /* ns-decls on curElem or on destDoc->oldNs */
destParent ? curElem : NULL,
cur->ns, &ns,
&nsMap, depth,
@@ -9186,9 +9294,9 @@ end_ns_reference:
(clone->parent != NULL))
{
if (xmlIsID(destDoc, clone->parent, (xmlAttrPtr) clone)) {
-
+
xmlChar *idVal;
-
+
idVal = xmlNodeListGetString(cur->doc, cur->children, 1);
if (idVal != NULL) {
if (xmlAddID(NULL, destDoc, idVal, (xmlAttrPtr) cur) == NULL) {
@@ -9204,12 +9312,12 @@ end_ns_reference:
**
** The following will traverse the tree **************************
**
- *
+ *
* Walk the element's attributes before descending into child-nodes.
*/
if ((cur->type == XML_ELEMENT_NODE) && (cur->properties != NULL)) {
prevClone = NULL;
- parentClone = clone;
+ parentClone = clone;
cur = (xmlNodePtr) cur->properties;
continue;
}
@@ -9239,14 +9347,14 @@ leave_node:
/*
* TODO: Do we expect nsDefs on XML_XINCLUDE_START?
*/
- if (XML_NSMAP_NOTEMPTY(nsMap)) {
+ if (XML_NSMAP_NOTEMPTY(nsMap)) {
/*
* Pop mappings.
*/
while ((nsMap->last != NULL) &&
(nsMap->last->depth >= depth))
{
- XML_NSMAP_POP(nsMap, mi)
+ XML_NSMAP_POP(nsMap, mi)
}
/*
* Unshadow.
@@ -9255,7 +9363,7 @@ leave_node:
if (mi->shadowDepth >= depth)
mi->shadowDepth = -1;
}
- }
+ }
depth--;
}
if (cur->next != NULL) {
@@ -9268,7 +9376,7 @@ leave_node:
if (clone->parent != NULL)
clone->parent->last = clone;
clone = clone->parent;
- parentClone = clone->parent;
+ parentClone = clone->parent;
/*
* Process parent --> next;
*/
@@ -9277,14 +9385,14 @@ leave_node:
} else {
/* This is for attributes only. */
clone = clone->parent;
- parentClone = clone->parent;
+ parentClone = clone->parent;
/*
* Process parent-element --> children.
*/
cur = cur->parent;
- goto into_content;
+ goto into_content;
}
- }
+ }
goto exit;
internal_error:
@@ -9305,7 +9413,7 @@ exit:
nsMap->pool = nsMap->first;
nsMap->first = NULL;
}
- } else
+ } else
xmlDOMWrapNsMapFree(nsMap);
}
/*
@@ -9345,7 +9453,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt,
if ((attr == NULL) || (destDoc == NULL))
return (-1);
-
+
attr->doc = destDoc;
if (attr->ns != NULL) {
xmlNsPtr ns = NULL;
@@ -9372,13 +9480,13 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt,
ns = xmlDOMWrapNSNormDeclareNsForced(destDoc, destParent,
attr->ns->href, attr->ns->prefix, 1);
}
- }
+ }
if (ns == NULL)
goto internal_error;
attr->ns = ns;
- }
-
- XML_TREE_ADOPT_STR(attr->name);
+ }
+
+ XML_TREE_ADOPT_STR(attr->name);
attr->atype = 0;
attr->psvi = NULL;
/*
@@ -9393,7 +9501,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt,
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
XML_TREE_ADOPT_STR_2(cur->content)
- break;
+ break;
case XML_ENTITY_REF_NODE:
/*
* Remove reference to the entitity-node.
@@ -9411,7 +9519,7 @@ xmlDOMWrapAdoptAttr(xmlDOMWrapCtxtPtr ctxt,
cur->content = ent->content;
cur->children = (xmlNodePtr) ent;
cur->last = (xmlNodePtr) ent;
- }
+ }
}
break;
default:
@@ -9449,8 +9557,8 @@ internal_error:
* 1) If @destParent is given, then nsDef entries on element-nodes are used
* 2) If *no* @destParent is given, then @destDoc->oldNs entries are used
* This is the case when you have an unliked node and just want to move it
-* to the context of
-*
+* to the context of
+*
* If @destParent is given, it ensures that the tree is namespace
* wellformed by creating additional ns-decls where needed.
* Note that, since prefixes of already existent ns-decls can be
@@ -9467,7 +9575,7 @@ int
xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt,
xmlDocPtr sourceDoc,
xmlNodePtr node,
- xmlDocPtr destDoc,
+ xmlDocPtr destDoc,
xmlNodePtr destParent,
int options)
{
@@ -9476,7 +9584,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt,
return(-1);
/*
* Check node->doc sanity.
- */
+ */
if ((node->doc != NULL) && (sourceDoc != NULL) &&
(node->doc != sourceDoc)) {
/*
@@ -9489,7 +9597,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt,
if (sourceDoc == destDoc)
return (-1);
switch (node->type) {
- case XML_ELEMENT_NODE:
+ case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
@@ -9515,7 +9623,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt,
} else if (node->type == XML_ATTRIBUTE_NODE) {
return (xmlDOMWrapAdoptAttr(ctxt, sourceDoc,
(xmlAttrPtr) node, destDoc, destParent, options));
- } else {
+ } else {
xmlNodePtr cur = node;
int adoptStr = 1;
@@ -9527,7 +9635,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt,
(sourceDoc->dict == destDoc->dict))
adoptStr = 0;
switch (node->type) {
- case XML_TEXT_NODE:
+ case XML_TEXT_NODE:
case XML_CDATA_SECTION_NODE:
XML_TREE_ADOPT_STR_2(node->content)
break;
@@ -9560,7 +9668,7 @@ xmlDOMWrapAdoptNode(xmlDOMWrapCtxtPtr ctxt,
default:
break;
}
- }
+ }
return (0);
}
diff --git a/uri.c b/uri.c
index fafd112..28401c8 100644
--- a/uri.c
+++ b/uri.c
@@ -1,7 +1,7 @@
/**
* uri.c: set of generic URI related routines
*
- * Reference: RFCs 2396, 2732 and 2373
+ * Reference: RFCs 3986, 2732 and 2373
*
* See Copyright for the status of this software.
*
@@ -18,14 +18,10 @@
#include <libxml/globals.h>
#include <libxml/xmlerror.h>
-/************************************************************************
- * *
- * Macros to differentiate various character type *
- * directly extracted from RFC 2396 *
- * *
- ************************************************************************/
+static void xmlCleanURI(xmlURIPtr uri);
/*
+ * Old rule from 2396 used in legacy handling code
* alpha = lowalpha | upalpha
*/
#define IS_ALPHA(x) (IS_LOWALPHA(x) || IS_UPALPHA(x))
@@ -61,31 +57,30 @@
#define IS_ALPHANUM(x) (IS_ALPHA(x) || IS_DIGIT(x))
/*
- * hex = digit | "A" | "B" | "C" | "D" | "E" | "F" |
- * "a" | "b" | "c" | "d" | "e" | "f"
- */
-
-#define IS_HEX(x) ((IS_DIGIT(x)) || (((x) >= 'a') && ((x) <= 'f')) || \
- (((x) >= 'A') && ((x) <= 'F')))
-
-/*
* mark = "-" | "_" | "." | "!" | "~" | "*" | "'" | "(" | ")"
*/
-#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') || \
- ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') || \
+#define IS_MARK(x) (((x) == '-') || ((x) == '_') || ((x) == '.') || \
+ ((x) == '!') || ((x) == '~') || ((x) == '*') || ((x) == '\'') || \
((x) == '(') || ((x) == ')'))
+/*
+ * unwise = "{" | "}" | "|" | "\" | "^" | "`"
+ */
+#define IS_UNWISE(p) \
+ (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) || \
+ ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) || \
+ ((*(p) == ']')) || ((*(p) == '`')))
/*
* reserved = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | "," |
- * "[" | "]"
+ * "[" | "]"
*/
-#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
- ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
- ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
- ((x) == ']'))
+#define IS_RESERVED(x) (((x) == ';') || ((x) == '/') || ((x) == '?') || \
+ ((x) == ':') || ((x) == '@') || ((x) == '&') || ((x) == '=') || \
+ ((x) == '+') || ((x) == '$') || ((x) == ',') || ((x) == '[') || \
+ ((x) == ']'))
/*
* unreserved = alphanum | mark
@@ -94,98 +89,861 @@
#define IS_UNRESERVED(x) (IS_ALPHANUM(x) || IS_MARK(x))
/*
- * escaped = "%" hex hex
+ * Skip to next pointer char, handle escaped sequences
*/
-#define IS_ESCAPED(p) ((*(p) == '%') && (IS_HEX((p)[1])) && \
- (IS_HEX((p)[2])))
+#define NEXT(p) ((*p == '%')? p += 3 : p++)
/*
- * uric_no_slash = unreserved | escaped | ";" | "?" | ":" | "@" |
- * "&" | "=" | "+" | "$" | ","
+ * Productions from the spec.
+ *
+ * authority = server | reg_name
+ * reg_name = 1*( unreserved | escaped | "$" | "," |
+ * ";" | ":" | "@" | "&" | "=" | "+" )
+ *
+ * path = [ abs_path | opaque_part ]
*/
-#define IS_URIC_NO_SLASH(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) ||\
- ((*(p) == ';')) || ((*(p) == '?')) || ((*(p) == ':')) ||\
- ((*(p) == '@')) || ((*(p) == '&')) || ((*(p) == '=')) ||\
- ((*(p) == '+')) || ((*(p) == '$')) || ((*(p) == ',')))
+
+#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
+
+/************************************************************************
+ * *
+ * RFC 3986 parser *
+ * *
+ ************************************************************************/
+
+#define ISA_DIGIT(p) ((*(p) >= '0') && (*(p) <= '9'))
+#define ISA_ALPHA(p) (((*(p) >= 'a') && (*(p) <= 'z')) || \
+ ((*(p) >= 'A') && (*(p) <= 'Z')))
+#define ISA_HEXDIG(p) \
+ (ISA_DIGIT(p) || ((*(p) >= 'a') && (*(p) <= 'f')) || \
+ ((*(p) >= 'A') && (*(p) <= 'F')))
/*
- * pchar = unreserved | escaped | ":" | "@" | "&" | "=" | "+" | "$" | ","
+ * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
+ * / "*" / "+" / "," / ";" / "="
*/
-#define IS_PCHAR(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) || \
- ((*(p) == ':')) || ((*(p) == '@')) || ((*(p) == '&')) ||\
- ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) ||\
- ((*(p) == ',')))
+#define ISA_SUB_DELIM(p) \
+ (((*(p) == '!')) || ((*(p) == '$')) || ((*(p) == '&')) || \
+ ((*(p) == '(')) || ((*(p) == ')')) || ((*(p) == '*')) || \
+ ((*(p) == '+')) || ((*(p) == ',')) || ((*(p) == ';')) || \
+ ((*(p) == '=')))
/*
- * rel_segment = 1*( unreserved | escaped |
- * ";" | "@" | "&" | "=" | "+" | "$" | "," )
+ * gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
*/
+#define ISA_GEN_DELIM(p) \
+ (((*(p) == ':')) || ((*(p) == '/')) || ((*(p) == '?')) || \
+ ((*(p) == '#')) || ((*(p) == '[')) || ((*(p) == ']')) || \
+ ((*(p) == '@')))
-#define IS_SEGMENT(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) || \
- ((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) || \
- ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) || \
- ((*(p) == ',')))
+/*
+ * reserved = gen-delims / sub-delims
+ */
+#define ISA_RESERVED(p) (ISA_GEN_DELIM(p) || (ISA_SUB_DELIM(p)))
/*
- * scheme = alpha *( alpha | digit | "+" | "-" | "." )
+ * unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
*/
+#define ISA_UNRESERVED(p) \
+ ((ISA_ALPHA(p)) || (ISA_DIGIT(p)) || ((*(p) == '-')) || \
+ ((*(p) == '.')) || ((*(p) == '_')) || ((*(p) == '~')))
-#define IS_SCHEME(x) ((IS_ALPHA(x)) || (IS_DIGIT(x)) || \
- ((x) == '+') || ((x) == '-') || ((x) == '.'))
+/*
+ * pct-encoded = "%" HEXDIG HEXDIG
+ */
+#define ISA_PCT_ENCODED(p) \
+ ((*(p) == '%') && (ISA_HEXDIG(p + 1)) && (ISA_HEXDIG(p + 2)))
/*
- * reg_name = 1*( unreserved | escaped | "$" | "," |
- * ";" | ":" | "@" | "&" | "=" | "+" )
+ * pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
*/
+#define ISA_PCHAR(p) \
+ (ISA_UNRESERVED(p) || ISA_PCT_ENCODED(p) || ISA_SUB_DELIM(p) || \
+ ((*(p) == ':')) || ((*(p) == '@')))
-#define IS_REG_NAME(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) || \
- ((*(p) == '$')) || ((*(p) == ',')) || ((*(p) == ';')) || \
- ((*(p) == ':')) || ((*(p) == '@')) || ((*(p) == '&')) || \
- ((*(p) == '=')) || ((*(p) == '+')))
+/**
+ * xmlParse3986Scheme:
+ * @uri: pointer to an URI structure
+ * @str: pointer to the string to analyze
+ *
+ * Parse an URI scheme
+ *
+ * ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986Scheme(xmlURIPtr uri, const char **str) {
+ const char *cur;
-/*
- * userinfo = *( unreserved | escaped | ";" | ":" | "&" | "=" |
- * "+" | "$" | "," )
+ if (str == NULL)
+ return(-1);
+
+ cur = *str;
+ if (!ISA_ALPHA(cur))
+ return(2);
+ cur++;
+ while (ISA_ALPHA(cur) || ISA_DIGIT(cur) ||
+ (*cur == '+') || (*cur == '-') || (*cur == '.')) cur++;
+ if (uri != NULL) {
+ if (uri->scheme != NULL) xmlFree(uri->scheme);
+ uri->scheme = STRNDUP(*str, cur - *str);
+ }
+ *str = cur;
+ return(0);
+}
+
+/**
+ * xmlParse3986Fragment:
+ * @uri: pointer to an URI structure
+ * @str: pointer to the string to analyze
+ *
+ * Parse the query part of an URI
+ *
+ * fragment = *( pchar / "/" / "?" )
+ * NOTE: the strict syntax as defined by 3986 does not allow '[' and ']'
+ * in the fragment identifier but this is used very broadly for
+ * xpointer scheme selection, so we are allowing it here to not break
+ * for example all the DocBook processing chains.
+ *
+ * Returns 0 or the error code
*/
-#define IS_USERINFO(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) || \
- ((*(p) == ';')) || ((*(p) == ':')) || ((*(p) == '&')) || \
- ((*(p) == '=')) || ((*(p) == '+')) || ((*(p) == '$')) || \
- ((*(p) == ',')))
+static int
+xmlParse3986Fragment(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
-/*
- * uric = reserved | unreserved | escaped
+ if (str == NULL)
+ return (-1);
+
+ cur = *str;
+
+ while ((ISA_PCHAR(cur)) || (*cur == '/') || (*cur == '?') ||
+ (*cur == '[') || (*cur == ']') ||
+ ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
+ NEXT(cur);
+ if (uri != NULL) {
+ if (uri->fragment != NULL)
+ xmlFree(uri->fragment);
+ if (uri->cleanup & 2)
+ uri->fragment = STRNDUP(*str, cur - *str);
+ else
+ uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986Query:
+ * @uri: pointer to an URI structure
+ * @str: pointer to the string to analyze
+ *
+ * Parse the query part of an URI
+ *
+ * query = *uric
+ *
+ * Returns 0 or the error code
*/
+static int
+xmlParse3986Query(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
-#define IS_URIC(p) ((IS_UNRESERVED(*(p))) || (IS_ESCAPED(p)) || \
- (IS_RESERVED(*(p))))
+ if (str == NULL)
+ return (-1);
-/*
-* unwise = "{" | "}" | "|" | "\" | "^" | "`"
-*/
+ cur = *str;
-#define IS_UNWISE(p) \
- (((*(p) == '{')) || ((*(p) == '}')) || ((*(p) == '|')) || \
- ((*(p) == '\\')) || ((*(p) == '^')) || ((*(p) == '[')) || \
- ((*(p) == ']')) || ((*(p) == '`')))
+ while ((ISA_PCHAR(cur)) || (*cur == '/') || (*cur == '?') ||
+ ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
+ NEXT(cur);
+ if (uri != NULL) {
+ if (uri->query != NULL)
+ xmlFree(uri->query);
+ if (uri->cleanup & 2)
+ uri->query = STRNDUP(*str, cur - *str);
+ else
+ uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
-/*
- * Skip to next pointer char, handle escaped sequences
+ /* Save the raw bytes of the query as well.
+ * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
+ */
+ if (uri->query_raw != NULL)
+ xmlFree (uri->query_raw);
+ uri->query_raw = STRNDUP (*str, cur - *str);
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986Port:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse a port part and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * port = *DIGIT
+ *
+ * Returns 0 or the error code
*/
+static int
+xmlParse3986Port(xmlURIPtr uri, const char **str)
+{
+ const char *cur = *str;
-#define NEXT(p) ((*p == '%')? p += 3 : p++)
+ if (ISA_DIGIT(cur)) {
+ if (uri != NULL)
+ uri->port = 0;
+ while (ISA_DIGIT(cur)) {
+ if (uri != NULL)
+ uri->port = uri->port * 10 + (*cur - '0');
+ cur++;
+ }
+ *str = cur;
+ return(0);
+ }
+ return(1);
+}
-/*
- * Productions from the spec.
+/**
+ * xmlParse3986Userinfo:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
*
- * authority = server | reg_name
- * reg_name = 1*( unreserved | escaped | "$" | "," |
- * ";" | ":" | "@" | "&" | "=" | "+" )
+ * Parse an user informations part and fills in the appropriate fields
+ * of the @uri structure
*
- * path = [ abs_path | opaque_part ]
+ * userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
+ *
+ * Returns 0 or the error code
*/
+static int
+xmlParse3986Userinfo(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
-#define STRNDUP(s, n) (char *) xmlStrndup((const xmlChar *)(s), (n))
+ cur = *str;
+ while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) ||
+ ISA_SUB_DELIM(cur) || (*cur == ':'))
+ NEXT(cur);
+ if (*cur == '@') {
+ if (uri != NULL) {
+ if (uri->user != NULL) xmlFree(uri->user);
+ if (uri->cleanup & 2)
+ uri->user = STRNDUP(*str, cur - *str);
+ else
+ uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
+ }
+ *str = cur;
+ return(0);
+ }
+ return(1);
+}
+
+/**
+ * xmlParse3986DecOctet:
+ * @str: the string to analyze
+ *
+ * dec-octet = DIGIT ; 0-9
+ * / %x31-39 DIGIT ; 10-99
+ * / "1" 2DIGIT ; 100-199
+ * / "2" %x30-34 DIGIT ; 200-249
+ * / "25" %x30-35 ; 250-255
+ *
+ * Skip a dec-octet.
+ *
+ * Returns 0 if found and skipped, 1 otherwise
+ */
+static int
+xmlParse3986DecOctet(const char **str) {
+ const char *cur = *str;
+
+ if (!(ISA_DIGIT(cur)))
+ return(1);
+ if (!ISA_DIGIT(cur+1))
+ cur++;
+ else if ((*cur != '0') && (ISA_DIGIT(cur + 1)) && (!ISA_DIGIT(cur+2)))
+ cur += 2;
+ else if ((*cur == '1') && (ISA_DIGIT(cur + 1)) && (ISA_DIGIT(cur + 2)))
+ cur += 3;
+ else if ((*cur == '2') && (*(cur + 1) >= '0') &&
+ (*(cur + 1) <= '4') && (ISA_DIGIT(cur + 2)))
+ cur += 3;
+ else if ((*cur == '2') && (*(cur + 1) == '5') &&
+ (*(cur + 2) >= '0') && (*(cur + 1) <= '5'))
+ cur += 3;
+ else
+ return(1);
+ *str = cur;
+ return(0);
+}
+/**
+ * xmlParse3986Host:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an host part and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * host = IP-literal / IPv4address / reg-name
+ * IP-literal = "[" ( IPv6address / IPvFuture ) "]"
+ * IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
+ * reg-name = *( unreserved / pct-encoded / sub-delims )
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986Host(xmlURIPtr uri, const char **str)
+{
+ const char *cur = *str;
+ const char *host;
+
+ host = cur;
+ /*
+ * IPv6 and future adressing scheme are enclosed between brackets
+ */
+ if (*cur == '[') {
+ cur++;
+ while ((*cur != ']') && (*cur != 0))
+ cur++;
+ if (*cur != ']')
+ return(1);
+ cur++;
+ goto found;
+ }
+ /*
+ * try to parse an IPv4
+ */
+ if (ISA_DIGIT(cur)) {
+ if (xmlParse3986DecOctet(&cur) != 0)
+ goto not_ipv4;
+ if (*cur != '.')
+ goto not_ipv4;
+ cur++;
+ if (xmlParse3986DecOctet(&cur) != 0)
+ goto not_ipv4;
+ if (*cur != '.')
+ goto not_ipv4;
+ if (xmlParse3986DecOctet(&cur) != 0)
+ goto not_ipv4;
+ if (*cur != '.')
+ goto not_ipv4;
+ if (xmlParse3986DecOctet(&cur) != 0)
+ goto not_ipv4;
+ goto found;
+not_ipv4:
+ cur = *str;
+ }
+ /*
+ * then this should be a hostname which can be empty
+ */
+ while (ISA_UNRESERVED(cur) || ISA_PCT_ENCODED(cur) || ISA_SUB_DELIM(cur))
+ NEXT(cur);
+found:
+ if (uri != NULL) {
+ if (uri->authority != NULL) xmlFree(uri->authority);
+ uri->authority = NULL;
+ if (uri->server != NULL) xmlFree(uri->server);
+ if (cur != host) {
+ if (uri->cleanup & 2)
+ uri->server = STRNDUP(host, cur - host);
+ else
+ uri->server = xmlURIUnescapeString(host, cur - host, NULL);
+ } else
+ uri->server = NULL;
+ }
+ *str = cur;
+ return(0);
+}
+
+/**
+ * xmlParse3986Authority:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an authority part and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * authority = [ userinfo "@" ] host [ ":" port ]
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986Authority(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
+ int ret;
+
+ cur = *str;
+ /*
+ * try to parse an userinfo and check for the trailing @
+ */
+ ret = xmlParse3986Userinfo(uri, &cur);
+ if ((ret != 0) || (*cur != '@'))
+ cur = *str;
+ else
+ cur++;
+ ret = xmlParse3986Host(uri, &cur);
+ if (ret != 0) return(ret);
+ if (*cur == ':') {
+ cur++;
+ ret = xmlParse3986Port(uri, &cur);
+ if (ret != 0) return(ret);
+ }
+ *str = cur;
+ return(0);
+}
+
+/**
+ * xmlParse3986Segment:
+ * @str: the string to analyze
+ * @forbid: an optional forbidden character
+ * @empty: allow an empty segment
+ *
+ * Parse a segment and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * segment = *pchar
+ * segment-nz = 1*pchar
+ * segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
+ * ; non-zero-length segment without any colon ":"
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986Segment(const char **str, char forbid, int empty)
+{
+ const char *cur;
+
+ cur = *str;
+ if (!ISA_PCHAR(cur)) {
+ if (empty)
+ return(0);
+ return(1);
+ }
+ while (ISA_PCHAR(cur) && (*cur != forbid))
+ NEXT(cur);
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986PathAbEmpty:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an path absolute or empty and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * path-abempty = *( "/" segment )
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
+ int ret;
+
+ cur = *str;
+
+ while (*cur == '/') {
+ cur++;
+ ret = xmlParse3986Segment(&cur, 0, 1);
+ if (ret != 0) return(ret);
+ }
+ if (uri != NULL) {
+ if (uri->path != NULL) xmlFree(uri->path);
+ if (uri->cleanup & 2)
+ uri->path = STRNDUP(*str, cur - *str);
+ else
+ uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986PathAbsolute:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an path absolute and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * path-absolute = "/" [ segment-nz *( "/" segment ) ]
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986PathAbsolute(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
+ int ret;
+
+ cur = *str;
+
+ if (*cur != '/')
+ return(1);
+ cur++;
+ ret = xmlParse3986Segment(&cur, 0, 0);
+ if (ret == 0) {
+ while (*cur == '/') {
+ cur++;
+ ret = xmlParse3986Segment(&cur, 0, 1);
+ if (ret != 0) return(ret);
+ }
+ }
+ if (uri != NULL) {
+ if (uri->path != NULL) xmlFree(uri->path);
+ if (uri->cleanup & 2)
+ uri->path = STRNDUP(*str, cur - *str);
+ else
+ uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986PathRootless:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an path without root and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * path-rootless = segment-nz *( "/" segment )
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986PathRootless(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
+ int ret;
+
+ cur = *str;
+
+ ret = xmlParse3986Segment(&cur, 0, 0);
+ if (ret != 0) return(ret);
+ while (*cur == '/') {
+ cur++;
+ ret = xmlParse3986Segment(&cur, 0, 1);
+ if (ret != 0) return(ret);
+ }
+ if (uri != NULL) {
+ if (uri->path != NULL) xmlFree(uri->path);
+ if (uri->cleanup & 2)
+ uri->path = STRNDUP(*str, cur - *str);
+ else
+ uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986PathNoScheme:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an path which is not a scheme and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * path-noscheme = segment-nz-nc *( "/" segment )
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986PathNoScheme(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
+ int ret;
+
+ cur = *str;
+
+ ret = xmlParse3986Segment(&cur, ':', 0);
+ if (ret != 0) return(ret);
+ while (*cur == '/') {
+ cur++;
+ ret = xmlParse3986Segment(&cur, 0, 1);
+ if (ret != 0) return(ret);
+ }
+ if (uri != NULL) {
+ if (uri->path != NULL) xmlFree(uri->path);
+ if (uri->cleanup & 2)
+ uri->path = STRNDUP(*str, cur - *str);
+ else
+ uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986HierPart:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an hierarchical part and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * hier-part = "//" authority path-abempty
+ * / path-absolute
+ * / path-rootless
+ * / path-empty
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986HierPart(xmlURIPtr uri, const char **str)
+{
+ const char *cur;
+ int ret;
+
+ cur = *str;
+
+ if ((*cur == '/') && (*(cur + 1) == '/')) {
+ cur += 2;
+ ret = xmlParse3986Authority(uri, &cur);
+ if (ret != 0) return(ret);
+ ret = xmlParse3986PathAbEmpty(uri, &cur);
+ if (ret != 0) return(ret);
+ *str = cur;
+ return(0);
+ } else if (*cur == '/') {
+ ret = xmlParse3986PathAbsolute(uri, &cur);
+ if (ret != 0) return(ret);
+ } else if (ISA_PCHAR(cur)) {
+ ret = xmlParse3986PathRootless(uri, &cur);
+ if (ret != 0) return(ret);
+ } else {
+ /* path-empty is effectively empty */
+ if (uri != NULL) {
+ if (uri->path != NULL) xmlFree(uri->path);
+ uri->path = NULL;
+ }
+ }
+ *str = cur;
+ return (0);
+}
+
+/**
+ * xmlParse3986RelativeRef:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an URI string and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * relative-ref = relative-part [ "?" query ] [ "#" fragment ]
+ * relative-part = "//" authority path-abempty
+ * / path-absolute
+ * / path-noscheme
+ * / path-empty
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986RelativeRef(xmlURIPtr uri, const char *str) {
+ int ret;
+
+ if ((*str == '/') && (*(str + 1) == '/')) {
+ str += 2;
+ ret = xmlParse3986Authority(uri, &str);
+ if (ret != 0) return(ret);
+ ret = xmlParse3986PathAbEmpty(uri, &str);
+ if (ret != 0) return(ret);
+ } else if (*str == '/') {
+ ret = xmlParse3986PathAbsolute(uri, &str);
+ if (ret != 0) return(ret);
+ } else if (ISA_PCHAR(str)) {
+ ret = xmlParse3986PathNoScheme(uri, &str);
+ if (ret != 0) return(ret);
+ } else {
+ /* path-empty is effectively empty */
+ if (uri != NULL) {
+ if (uri->path != NULL) xmlFree(uri->path);
+ uri->path = NULL;
+ }
+ }
+
+ if (*str == '?') {
+ str++;
+ ret = xmlParse3986Query(uri, &str);
+ if (ret != 0) return(ret);
+ }
+ if (*str == '#') {
+ str++;
+ ret = xmlParse3986Fragment(uri, &str);
+ if (ret != 0) return(ret);
+ }
+ if (*str != 0) {
+ xmlCleanURI(uri);
+ return(1);
+ }
+ return(0);
+}
+
+
+/**
+ * xmlParse3986URI:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an URI string and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * scheme ":" hier-part [ "?" query ] [ "#" fragment ]
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986URI(xmlURIPtr uri, const char *str) {
+ int ret;
+
+ ret = xmlParse3986Scheme(uri, &str);
+ if (ret != 0) return(ret);
+ if (*str != ':') {
+ return(1);
+ }
+ str++;
+ ret = xmlParse3986HierPart(uri, &str);
+ if (ret != 0) return(ret);
+ if (*str == '?') {
+ str++;
+ ret = xmlParse3986Query(uri, &str);
+ if (ret != 0) return(ret);
+ }
+ if (*str == '#') {
+ str++;
+ ret = xmlParse3986Fragment(uri, &str);
+ if (ret != 0) return(ret);
+ }
+ if (*str != 0) {
+ xmlCleanURI(uri);
+ return(1);
+ }
+ return(0);
+}
+
+/**
+ * xmlParse3986URIReference:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an URI reference string and fills in the appropriate fields
+ * of the @uri structure
+ *
+ * URI-reference = URI / relative-ref
+ *
+ * Returns 0 or the error code
+ */
+static int
+xmlParse3986URIReference(xmlURIPtr uri, const char *str) {
+ int ret;
+
+ if (str == NULL)
+ return(-1);
+ xmlCleanURI(uri);
+
+ /*
+ * Try first to parse absolute refs, then fallback to relative if
+ * it fails.
+ */
+ ret = xmlParse3986URI(uri, str);
+ if (ret != 0) {
+ xmlCleanURI(uri);
+ ret = xmlParse3986RelativeRef(uri, str);
+ if (ret != 0) {
+ xmlCleanURI(uri);
+ return(ret);
+ }
+ }
+ return(0);
+}
+
+/**
+ * xmlParseURI:
+ * @str: the URI string to analyze
+ *
+ * Parse an URI based on RFC 3986
+ *
+ * URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
+ *
+ * Returns a newly built xmlURIPtr or NULL in case of error
+ */
+xmlURIPtr
+xmlParseURI(const char *str) {
+ xmlURIPtr uri;
+ int ret;
+
+ if (str == NULL)
+ return(NULL);
+ uri = xmlCreateURI();
+ if (uri != NULL) {
+ ret = xmlParse3986URIReference(uri, str);
+ if (ret) {
+ xmlFreeURI(uri);
+ return(NULL);
+ }
+ }
+ return(uri);
+}
+
+/**
+ * xmlParseURIReference:
+ * @uri: pointer to an URI structure
+ * @str: the string to analyze
+ *
+ * Parse an URI reference string based on RFC 3986 and fills in the
+ * appropriate fields of the @uri structure
+ *
+ * URI-reference = URI / relative-ref
+ *
+ * Returns 0 or the error code
+ */
+int
+xmlParseURIReference(xmlURIPtr uri, const char *str) {
+ return(xmlParse3986URIReference(uri, str));
+}
+
+/**
+ * xmlParseURIRaw:
+ * @str: the URI string to analyze
+ * @raw: if 1 unescaping of URI pieces are disabled
+ *
+ * Parse an URI but allows to keep intact the original fragments.
+ *
+ * URI-reference = URI / relative-ref
+ *
+ * Returns a newly built xmlURIPtr or NULL in case of error
+ */
+xmlURIPtr
+xmlParseURIRaw(const char *str, int raw) {
+ xmlURIPtr uri;
+ int ret;
+
+ if (str == NULL)
+ return(NULL);
+ uri = xmlCreateURI();
+ if (uri != NULL) {
+ if (raw) {
+ uri->cleanup |= 2;
+ }
+ ret = xmlParseURIReference(uri, str);
+ if (ret) {
+ xmlFreeURI(uri);
+ return(NULL);
+ }
+ }
+ return(uri);
+}
/************************************************************************
* *
@@ -225,6 +983,7 @@ xmlCreateURI(void) {
xmlChar *
xmlSaveUri(xmlURIPtr uri) {
xmlChar *ret = NULL;
+ xmlChar *temp;
const char *p;
int len;
int max;
@@ -246,23 +1005,27 @@ xmlSaveUri(xmlURIPtr uri) {
while (*p != 0) {
if (len >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ret[len++] = *p++;
}
if (len >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ret[len++] = ':';
}
@@ -271,12 +1034,14 @@ xmlSaveUri(xmlURIPtr uri) {
while (*p != 0) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
if (IS_RESERVED(*(p)) || IS_UNRESERVED(*(p)))
ret[len++] = *p++;
@@ -292,12 +1057,14 @@ xmlSaveUri(xmlURIPtr uri) {
if (uri->server != NULL) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ret[len++] = '/';
ret[len++] = '/';
@@ -306,13 +1073,15 @@ xmlSaveUri(xmlURIPtr uri) {
while (*p != 0) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
if ((IS_UNRESERVED(*(p))) ||
((*(p) == ';')) || ((*(p) == ':')) ||
@@ -330,13 +1099,15 @@ xmlSaveUri(xmlURIPtr uri) {
}
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ret[len++] = '@';
}
@@ -344,39 +1115,45 @@ xmlSaveUri(xmlURIPtr uri) {
while (*p != 0) {
if (len >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ret[len++] = *p++;
}
if (uri->port > 0) {
if (len + 10 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
}
} else if (uri->authority != NULL) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
ret[len++] = '/';
ret[len++] = '/';
@@ -384,13 +1161,15 @@ xmlSaveUri(xmlURIPtr uri) {
while (*p != 0) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
if ((IS_UNRESERVED(*(p))) ||
((*(p) == '$')) || ((*(p) == ',')) || ((*(p) == ';')) ||
@@ -408,13 +1187,15 @@ xmlSaveUri(xmlURIPtr uri) {
} else if (uri->scheme != NULL) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
ret[len++] = '/';
ret[len++] = '/';
@@ -430,7 +1211,7 @@ xmlSaveUri(xmlURIPtr uri) {
(((p[1] >= 'a') && (p[1] <= 'z')) ||
((p[1] >= 'A') && (p[1] <= 'Z'))) &&
(p[2] == ':') &&
- (xmlStrEqual(uri->scheme, BAD_CAST "file"))) {
+ (xmlStrEqual(BAD_CAST uri->scheme, BAD_CAST "file"))) {
if (len + 3 >= max) {
max *= 2;
ret = (xmlChar *) xmlRealloc(ret,
@@ -448,13 +1229,15 @@ xmlSaveUri(xmlURIPtr uri) {
while (*p != 0) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
if ((IS_UNRESERVED(*(p))) || ((*(p) == '/')) ||
((*(p) == ';')) || ((*(p) == '@')) || ((*(p) == '&')) ||
@@ -473,52 +1256,60 @@ xmlSaveUri(xmlURIPtr uri) {
if (uri->query_raw != NULL) {
if (len + 1 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
ret[len++] = '?';
p = uri->query_raw;
while (*p != 0) {
if (len + 1 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ret[len++] = *p++;
}
} else if (uri->query != NULL) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
ret[len++] = '?';
p = uri->query;
while (*p != 0) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlSaveUri: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
ret[len++] = *p++;
@@ -535,26 +1326,30 @@ xmlSaveUri(xmlURIPtr uri) {
if (uri->fragment != NULL) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
ret[len++] = '#';
p = uri->fragment;
while (*p != 0) {
if (len + 3 >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret,
+ temp = (xmlChar *) xmlRealloc(ret,
(max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
if ((IS_UNRESERVED(*(p))) || (IS_RESERVED(*(p))))
ret[len++] = *p++;
@@ -569,12 +1364,14 @@ xmlSaveUri(xmlURIPtr uri) {
}
if (len >= max) {
max *= 2;
- ret = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
- if (ret == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlSaveUri: out of memory\n");
- return(NULL);
- }
+ temp = (xmlChar *) xmlRealloc(ret, (max + 1) * sizeof(xmlChar));
+ if (temp == NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlSaveUri: out of memory\n");
+ xmlFree(ret);
+ return(NULL);
+ }
+ ret = temp;
}
ret[len++] = 0;
return(ret);
@@ -928,6 +1725,7 @@ xmlURIUnescapeString(const char *str, int len, char *target) {
xmlChar *
xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
xmlChar *ret, ch;
+ xmlChar *temp;
const xmlChar *in;
unsigned int len, out;
@@ -951,12 +1749,14 @@ xmlURIEscapeStr(const xmlChar *str, const xmlChar *list) {
while(*in != 0) {
if (len - out <= 3) {
len += 20;
- ret = (xmlChar *) xmlRealloc(ret, len);
- if (ret == NULL) {
+ temp = (xmlChar *) xmlRealloc(ret, len);
+ if (temp == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlURIEscapeStr: out of memory\n");
+ xmlFree(ret);
return(NULL);
}
+ ret = temp;
}
ch = *in;
@@ -1009,7 +1809,8 @@ xmlURIEscape(const xmlChar * str)
#define NULLCHK(p) if(!p) { \
xmlGenericError(xmlGenericErrorContext, \
"xmlURIEscape: out of memory\n"); \
- return NULL; }
+ xmlFreeURI(uri); \
+ return NULL; } \
if (str == NULL)
return (NULL);
@@ -1062,7 +1863,7 @@ xmlURIEscape(const xmlChar * str)
segment = xmlURIEscapeStr(BAD_CAST uri->server, BAD_CAST "/?;:@");
NULLCHK(segment)
if (uri->user == NULL)
- ret = xmlStrcat(ret, BAD_CAST "//");
+ ret = xmlStrcat(ret, BAD_CAST "//");
ret = xmlStrcat(ret, segment);
xmlFree(segment);
}
@@ -1119,787 +1920,6 @@ xmlURIEscape(const xmlChar * str)
/************************************************************************
* *
- * Escaped URI parsing *
- * *
- ************************************************************************/
-
-/**
- * xmlParseURIFragment:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an URI fragment string and fills in the appropriate fields
- * of the @uri structure.
- *
- * fragment = *uric
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIFragment(xmlURIPtr uri, const char **str)
-{
- const char *cur;
-
- if (str == NULL)
- return (-1);
-
- cur = *str;
-
- while (IS_URIC(cur) || IS_UNWISE(cur))
- NEXT(cur);
- if (uri != NULL) {
- if (uri->fragment != NULL)
- xmlFree(uri->fragment);
- if (uri->cleanup & 2)
- uri->fragment = STRNDUP(*str, cur - *str);
- else
- uri->fragment = xmlURIUnescapeString(*str, cur - *str, NULL);
- }
- *str = cur;
- return (0);
-}
-
-/**
- * xmlParseURIQuery:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse the query part of an URI
- *
- * query = *uric
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIQuery(xmlURIPtr uri, const char **str)
-{
- const char *cur;
-
- if (str == NULL)
- return (-1);
-
- cur = *str;
-
- while ((IS_URIC(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
- NEXT(cur);
- if (uri != NULL) {
- if (uri->query != NULL)
- xmlFree(uri->query);
- if (uri->cleanup & 2)
- uri->query = STRNDUP(*str, cur - *str);
- else
- uri->query = xmlURIUnescapeString(*str, cur - *str, NULL);
-
- /* Save the raw bytes of the query as well.
- * See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00114
- */
- if (uri->query_raw != NULL)
- xmlFree (uri->query_raw);
- uri->query_raw = STRNDUP (*str, cur - *str);
- }
- *str = cur;
- return (0);
-}
-
-/**
- * xmlParseURIScheme:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an URI scheme
- *
- * scheme = alpha *( alpha | digit | "+" | "-" | "." )
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIScheme(xmlURIPtr uri, const char **str) {
- const char *cur;
-
- if (str == NULL)
- return(-1);
-
- cur = *str;
- if (!IS_ALPHA(*cur))
- return(2);
- cur++;
- while (IS_SCHEME(*cur)) cur++;
- if (uri != NULL) {
- if (uri->scheme != NULL) xmlFree(uri->scheme);
- uri->scheme = STRNDUP(*str, cur - *str);
- }
- *str = cur;
- return(0);
-}
-
-/**
- * xmlParseURIOpaquePart:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an URI opaque part
- *
- * opaque_part = uric_no_slash *uric
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIOpaquePart(xmlURIPtr uri, const char **str)
-{
- const char *cur;
-
- if (str == NULL)
- return (-1);
-
- cur = *str;
- if (!((IS_URIC_NO_SLASH(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))) {
- return (3);
- }
- NEXT(cur);
- while ((IS_URIC(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
- NEXT(cur);
- if (uri != NULL) {
- if (uri->opaque != NULL)
- xmlFree(uri->opaque);
- if (uri->cleanup & 2)
- uri->opaque = STRNDUP(*str, cur - *str);
- else
- uri->opaque = xmlURIUnescapeString(*str, cur - *str, NULL);
- }
- *str = cur;
- return (0);
-}
-
-/**
- * xmlParseURIServer:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse a server subpart of an URI, it's a finer grain analysis
- * of the authority part.
- *
- * server = [ [ userinfo "@" ] hostport ]
- * userinfo = *( unreserved | escaped |
- * ";" | ":" | "&" | "=" | "+" | "$" | "," )
- * hostport = host [ ":" port ]
- * host = hostname | IPv4address | IPv6reference
- * hostname = *( domainlabel "." ) toplabel [ "." ]
- * domainlabel = alphanum | alphanum *( alphanum | "-" ) alphanum
- * toplabel = alpha | alpha *( alphanum | "-" ) alphanum
- * IPv6reference = "[" IPv6address "]"
- * IPv6address = hexpart [ ":" IPv4address ]
- * IPv4address = 1*3digit "." 1*3digit "." 1*3digit "." 1*3digit
- * hexpart = hexseq | hexseq "::" [ hexseq ]| "::" [ hexseq ]
- * hexseq = hex4 *( ":" hex4)
- * hex4 = 1*4hexdig
- * port = *digit
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIServer(xmlURIPtr uri, const char **str) {
- const char *cur;
- const char *host, *tmp;
- const int IPV4max = 4;
- const int IPV6max = 8;
- int oct;
-
- if (str == NULL)
- return(-1);
-
- cur = *str;
-
- /*
- * is there a userinfo ?
- */
- while (IS_USERINFO(cur)) NEXT(cur);
- if (*cur == '@') {
- if (uri != NULL) {
- if (uri->user != NULL) xmlFree(uri->user);
- if (uri->cleanup & 2)
- uri->user = STRNDUP(*str, cur - *str);
- else
- uri->user = xmlURIUnescapeString(*str, cur - *str, NULL);
- }
- cur++;
- } else {
- if (uri != NULL) {
- if (uri->user != NULL) xmlFree(uri->user);
- uri->user = NULL;
- }
- cur = *str;
- }
- /*
- * This can be empty in the case where there is no server
- */
- host = cur;
- if (*cur == '/') {
- if (uri != NULL) {
- if (uri->authority != NULL) xmlFree(uri->authority);
- uri->authority = NULL;
- if (uri->server != NULL) xmlFree(uri->server);
- uri->server = NULL;
- uri->port = 0;
- }
- return(0);
- }
- /*
- * host part of hostport can denote an IPV4 address, an IPV6 address
- * or an unresolved name. Check the IP first, its easier to detect
- * errors if wrong one.
- * An IPV6 address must start with a '[' and end with a ']'.
- */
- if (*cur == '[') {
- int compress=0;
- cur++;
- for (oct = 0; oct < IPV6max; ++oct) {
- if (*cur == ':') {
- if (compress)
- return(3); /* multiple compression attempted */
- if (!oct) { /* initial char is compression */
- if (*++cur != ':')
- return(3);
- }
- compress = 1; /* set compression-encountered flag */
- cur++; /* skip over the second ':' */
- continue;
- }
- while(IS_HEX(*cur)) cur++;
- if (oct == (IPV6max-1))
- continue;
- if (*cur != ':')
- break;
- cur++;
- }
- if ((!compress) && (oct != IPV6max))
- return(3);
- if (*cur != ']')
- return(3);
- if (uri != NULL) {
- if (uri->server != NULL) xmlFree(uri->server);
- uri->server = (char *)xmlStrndup((xmlChar *)host+1,
- (cur-host)-1);
- }
- cur++;
- } else {
- /*
- * Not IPV6, maybe IPV4
- */
- for (oct = 0; oct < IPV4max; ++oct) {
- if (*cur == '.')
- return(3); /* e.g. http://.xml/ or http://18.29..30/ */
- while(IS_DIGIT(*cur)) cur++;
- if (oct == (IPV4max-1))
- continue;
- if (*cur != '.')
- break;
- cur++;
- }
- }
- if ((host[0] != '[') && (oct < IPV4max || (*cur == '.' && cur++) ||
- IS_ALPHA(*cur))) {
- /* maybe host_name */
- if (!IS_ALPHANUM(*cur))
- return(4); /* e.g. http://xml.$oft */
- do {
- do ++cur; while (IS_ALPHANUM(*cur));
- if (*cur == '-') {
- --cur;
- if (*cur == '.')
- return(5); /* e.g. http://xml.-soft */
- ++cur;
- continue;
- }
- if (*cur == '.') {
- --cur;
- if (*cur == '-')
- return(6); /* e.g. http://xml-.soft */
- if (*cur == '.')
- return(7); /* e.g. http://xml..soft */
- ++cur;
- continue;
- }
- break;
- } while (1);
- tmp = cur;
- if (tmp[-1] == '.')
- --tmp; /* e.g. http://xml.$Oft/ */
- do --tmp; while (tmp >= host && IS_ALPHANUM(*tmp));
- if ((++tmp == host || tmp[-1] == '.') && !IS_ALPHA(*tmp))
- return(8); /* e.g. http://xmlsOft.0rg/ */
- }
- if (uri != NULL) {
- if (uri->authority != NULL) xmlFree(uri->authority);
- uri->authority = NULL;
- if (host[0] != '[') { /* it's not an IPV6 addr */
- if (uri->server != NULL) xmlFree(uri->server);
- if (uri->cleanup & 2)
- uri->server = STRNDUP(host, cur - host);
- else
- uri->server = xmlURIUnescapeString(host, cur - host, NULL);
- }
- }
- /*
- * finish by checking for a port presence.
- */
- if (*cur == ':') {
- cur++;
- if (IS_DIGIT(*cur)) {
- if (uri != NULL)
- uri->port = 0;
- while (IS_DIGIT(*cur)) {
- if (uri != NULL)
- uri->port = uri->port * 10 + (*cur - '0');
- cur++;
- }
- }
- }
- *str = cur;
- return(0);
-}
-
-/**
- * xmlParseURIRelSegment:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an URI relative segment
- *
- * rel_segment = 1*( unreserved | escaped | ";" | "@" | "&" | "=" |
- * "+" | "$" | "," )
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIRelSegment(xmlURIPtr uri, const char **str)
-{
- const char *cur;
-
- if (str == NULL)
- return (-1);
-
- cur = *str;
- if (!((IS_SEGMENT(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))) {
- return (3);
- }
- NEXT(cur);
- while ((IS_SEGMENT(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
- NEXT(cur);
- if (uri != NULL) {
- if (uri->path != NULL)
- xmlFree(uri->path);
- if (uri->cleanup & 2)
- uri->path = STRNDUP(*str, cur - *str);
- else
- uri->path = xmlURIUnescapeString(*str, cur - *str, NULL);
- }
- *str = cur;
- return (0);
-}
-
-/**
- * xmlParseURIPathSegments:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- * @slash: should we add a leading slash
- *
- * Parse an URI set of path segments
- *
- * path_segments = segment *( "/" segment )
- * segment = *pchar *( ";" param )
- * param = *pchar
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIPathSegments(xmlURIPtr uri, const char **str, int slash)
-{
- const char *cur;
-
- if (str == NULL)
- return (-1);
-
- cur = *str;
-
- do {
- while ((IS_PCHAR(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
- NEXT(cur);
- while (*cur == ';') {
- cur++;
- while ((IS_PCHAR(cur)) ||
- ((uri != NULL) && (uri->cleanup & 1) && (IS_UNWISE(cur))))
- NEXT(cur);
- }
- if (*cur != '/')
- break;
- cur++;
- } while (1);
- if (uri != NULL) {
- int len, len2 = 0;
- char *path;
-
- /*
- * Concat the set of path segments to the current path
- */
- len = cur - *str;
- if (slash)
- len++;
-
- if (uri->path != NULL) {
- len2 = strlen(uri->path);
- len += len2;
- }
- path = (char *) xmlMallocAtomic(len + 1);
- if (path == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "xmlParseURIPathSegments: out of memory\n");
- *str = cur;
- return (-1);
- }
- if (uri->path != NULL)
- memcpy(path, uri->path, len2);
- if (slash) {
- path[len2] = '/';
- len2++;
- }
- path[len2] = 0;
- if (cur - *str > 0) {
- if (uri->cleanup & 2) {
- memcpy(&path[len2], *str, cur - *str);
- path[len2 + (cur - *str)] = 0;
- } else
- xmlURIUnescapeString(*str, cur - *str, &path[len2]);
- }
- if (uri->path != NULL)
- xmlFree(uri->path);
- uri->path = path;
- }
- *str = cur;
- return (0);
-}
-
-/**
- * xmlParseURIAuthority:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse the authority part of an URI.
- *
- * authority = server | reg_name
- * server = [ [ userinfo "@" ] hostport ]
- * reg_name = 1*( unreserved | escaped | "$" | "," | ";" | ":" |
- * "@" | "&" | "=" | "+" )
- *
- * Note : this is completely ambiguous since reg_name is allowed to
- * use the full set of chars in use by server:
- *
- * 3.2.1. Registry-based Naming Authority
- *
- * The structure of a registry-based naming authority is specific
- * to the URI scheme, but constrained to the allowed characters
- * for an authority component.
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIAuthority(xmlURIPtr uri, const char **str) {
- const char *cur;
- int ret;
-
- if (str == NULL)
- return(-1);
-
- cur = *str;
-
- /*
- * try first to parse it as a server string.
- */
- ret = xmlParseURIServer(uri, str);
- if ((ret == 0) && (*str != NULL) &&
- ((**str == 0) || (**str == '/') || (**str == '?')))
- return(0);
- *str = cur;
-
- /*
- * failed, fallback to reg_name
- */
- if (!IS_REG_NAME(cur)) {
- return(5);
- }
- NEXT(cur);
- while (IS_REG_NAME(cur)) NEXT(cur);
- if (uri != NULL) {
- if (uri->server != NULL) xmlFree(uri->server);
- uri->server = NULL;
- if (uri->user != NULL) xmlFree(uri->user);
- uri->user = NULL;
- if (uri->authority != NULL) xmlFree(uri->authority);
- if (uri->cleanup & 2)
- uri->authority = STRNDUP(*str, cur - *str);
- else
- uri->authority = xmlURIUnescapeString(*str, cur - *str, NULL);
- }
- *str = cur;
- return(0);
-}
-
-/**
- * xmlParseURIHierPart:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an URI hierarchical part
- *
- * hier_part = ( net_path | abs_path ) [ "?" query ]
- * abs_path = "/" path_segments
- * net_path = "//" authority [ abs_path ]
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseURIHierPart(xmlURIPtr uri, const char **str) {
- int ret;
- const char *cur;
-
- if (str == NULL)
- return(-1);
-
- cur = *str;
-
- if ((cur[0] == '/') && (cur[1] == '/')) {
- cur += 2;
- ret = xmlParseURIAuthority(uri, &cur);
- if (ret != 0)
- return(ret);
- if (cur[0] == '/') {
- cur++;
- ret = xmlParseURIPathSegments(uri, &cur, 1);
- }
- } else if (cur[0] == '/') {
- cur++;
- ret = xmlParseURIPathSegments(uri, &cur, 1);
- } else {
- return(4);
- }
- if (ret != 0)
- return(ret);
- if (*cur == '?') {
- cur++;
- ret = xmlParseURIQuery(uri, &cur);
- if (ret != 0)
- return(ret);
- }
- *str = cur;
- return(0);
-}
-
-/**
- * xmlParseAbsoluteURI:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an URI reference string and fills in the appropriate fields
- * of the @uri structure
- *
- * absoluteURI = scheme ":" ( hier_part | opaque_part )
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseAbsoluteURI(xmlURIPtr uri, const char **str) {
- int ret;
- const char *cur;
-
- if (str == NULL)
- return(-1);
-
- cur = *str;
-
- ret = xmlParseURIScheme(uri, str);
- if (ret != 0) return(ret);
- if (**str != ':') {
- *str = cur;
- return(1);
- }
- (*str)++;
- if (**str == '/')
- return(xmlParseURIHierPart(uri, str));
- return(xmlParseURIOpaquePart(uri, str));
-}
-
-/**
- * xmlParseRelativeURI:
- * @uri: pointer to an URI structure
- * @str: pointer to the string to analyze
- *
- * Parse an relative URI string and fills in the appropriate fields
- * of the @uri structure
- *
- * relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
- * abs_path = "/" path_segments
- * net_path = "//" authority [ abs_path ]
- * rel_path = rel_segment [ abs_path ]
- *
- * Returns 0 or the error code
- */
-static int
-xmlParseRelativeURI(xmlURIPtr uri, const char **str) {
- int ret = 0;
- const char *cur;
-
- if (str == NULL)
- return(-1);
-
- cur = *str;
- if ((cur[0] == '/') && (cur[1] == '/')) {
- cur += 2;
- ret = xmlParseURIAuthority(uri, &cur);
- if (ret != 0)
- return(ret);
- if (cur[0] == '/') {
- cur++;
- ret = xmlParseURIPathSegments(uri, &cur, 1);
- }
- } else if (cur[0] == '/') {
- cur++;
- ret = xmlParseURIPathSegments(uri, &cur, 1);
- } else if (cur[0] != '#' && cur[0] != '?') {
- ret = xmlParseURIRelSegment(uri, &cur);
- if (ret != 0)
- return(ret);
- if (cur[0] == '/') {
- cur++;
- ret = xmlParseURIPathSegments(uri, &cur, 1);
- }
- }
- if (ret != 0)
- return(ret);
- if (*cur == '?') {
- cur++;
- ret = xmlParseURIQuery(uri, &cur);
- if (ret != 0)
- return(ret);
- }
- *str = cur;
- return(ret);
-}
-
-/**
- * xmlParseURIReference:
- * @uri: pointer to an URI structure
- * @str: the string to analyze
- *
- * Parse an URI reference string and fills in the appropriate fields
- * of the @uri structure
- *
- * URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
- *
- * Returns 0 or the error code
- */
-int
-xmlParseURIReference(xmlURIPtr uri, const char *str) {
- int ret;
- const char *tmp = str;
-
- if (str == NULL)
- return(-1);
- xmlCleanURI(uri);
-
- /*
- * Try first to parse absolute refs, then fallback to relative if
- * it fails.
- */
- ret = xmlParseAbsoluteURI(uri, &str);
- if (ret != 0) {
- xmlCleanURI(uri);
- str = tmp;
- ret = xmlParseRelativeURI(uri, &str);
- }
- if (ret != 0) {
- xmlCleanURI(uri);
- return(ret);
- }
-
- if (*str == '#') {
- str++;
- ret = xmlParseURIFragment(uri, &str);
- if (ret != 0) return(ret);
- }
- if (*str != 0) {
- xmlCleanURI(uri);
- return(1);
- }
- return(0);
-}
-
-/**
- * xmlParseURI:
- * @str: the URI string to analyze
- *
- * Parse an URI
- *
- * URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
- *
- * Returns a newly built xmlURIPtr or NULL in case of error
- */
-xmlURIPtr
-xmlParseURI(const char *str) {
- xmlURIPtr uri;
- int ret;
-
- if (str == NULL)
- return(NULL);
- uri = xmlCreateURI();
- if (uri != NULL) {
- ret = xmlParseURIReference(uri, str);
- if (ret) {
- xmlFreeURI(uri);
- return(NULL);
- }
- }
- return(uri);
-}
-
-/**
- * xmlParseURIRaw:
- * @str: the URI string to analyze
- * @raw: if 1 unescaping of URI pieces are disabled
- *
- * Parse an URI but allows to keep intact the original fragments.
- *
- * URI-reference = [ absoluteURI | relativeURI ] [ "#" fragment ]
- *
- * Returns a newly built xmlURIPtr or NULL in case of error
- */
-xmlURIPtr
-xmlParseURIRaw(const char *str, int raw) {
- xmlURIPtr uri;
- int ret;
-
- if (str == NULL)
- return(NULL);
- uri = xmlCreateURI();
- if (uri != NULL) {
- if (raw) {
- uri->cleanup |= 2;
- }
- ret = xmlParseURIReference(uri, str);
- if (ret) {
- xmlFreeURI(uri);
- return(NULL);
- }
- }
- return(uri);
-}
-
-/************************************************************************
- * *
* Public functions *
* *
************************************************************************/
diff --git a/valid.c b/valid.c
index 2510b8d..49fb720 100644
--- a/valid.c
+++ b/valid.c
@@ -36,6 +36,11 @@ static xmlElementPtr xmlGetDtdElementDesc2(xmlDtdPtr dtd, const xmlChar *name,
"Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);
+#ifdef LIBXML_VALID_ENABLED
+static int
+xmlValidateAttributeValueInternal(xmlDocPtr doc, xmlAttributeType type,
+ const xmlChar *value);
+#endif
/************************************************************************
* *
* Error handling routines *
@@ -2024,7 +2029,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt,
return(NULL);
}
if ((defaultValue != NULL) &&
- (!xmlValidateAttributeValue(type, defaultValue))) {
+ (!xmlValidateAttributeValueInternal(dtd->doc, type, defaultValue))) {
xmlErrValidNode(ctxt, (xmlNodePtr) dtd, XML_DTD_ATTRIBUTE_DEFAULT,
"Attribute %s of %s: invalid default value\n",
elem, name, defaultValue);
@@ -2042,8 +2047,10 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt,
(dtd->doc->intSubset != NULL) &&
(dtd->doc->intSubset->attributes != NULL)) {
ret = xmlHashLookup3(dtd->doc->intSubset->attributes, name, ns, elem);
- if (ret != NULL)
+ if (ret != NULL) {
+ xmlFreeEnumeration(tree);
return(NULL);
+ }
}
/*
@@ -2057,6 +2064,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt,
if (table == NULL) {
xmlVErrMemory(ctxt,
"xmlAddAttributeDecl: Table creation failed!\n");
+ xmlFreeEnumeration(tree);
return(NULL);
}
@@ -2064,6 +2072,7 @@ xmlAddAttributeDecl(xmlValidCtxtPtr ctxt,
ret = (xmlAttributePtr) xmlMalloc(sizeof(xmlAttribute));
if (ret == NULL) {
xmlVErrMemory(ctxt, "malloc failed");
+ xmlFreeEnumeration(tree);
return(NULL);
}
memset(ret, 0, sizeof(xmlAttribute));
@@ -3445,8 +3454,78 @@ xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
}
#ifdef LIBXML_VALID_ENABLED
+
+static int
+xmlIsDocNameStartChar(xmlDocPtr doc, int c) {
+ if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
+ /*
+ * Use the new checks of production [4] [4a] amd [5] of the
+ * Update 5 of XML-1.0
+ */
+ if (((c >= 'a') && (c <= 'z')) ||
+ ((c >= 'A') && (c <= 'Z')) ||
+ (c == '_') || (c == ':') ||
+ ((c >= 0xC0) && (c <= 0xD6)) ||
+ ((c >= 0xD8) && (c <= 0xF6)) ||
+ ((c >= 0xF8) && (c <= 0x2FF)) ||
+ ((c >= 0x370) && (c <= 0x37D)) ||
+ ((c >= 0x37F) && (c <= 0x1FFF)) ||
+ ((c >= 0x200C) && (c <= 0x200D)) ||
+ ((c >= 0x2070) && (c <= 0x218F)) ||
+ ((c >= 0x2C00) && (c <= 0x2FEF)) ||
+ ((c >= 0x3001) && (c <= 0xD7FF)) ||
+ ((c >= 0xF900) && (c <= 0xFDCF)) ||
+ ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
+ ((c >= 0x10000) && (c <= 0xEFFFF)))
+ return(1);
+ } else {
+ if (IS_LETTER(c) || (c == '_') || (c == ':'))
+ return(1);
+ }
+ return(0);
+}
+
+static int
+xmlIsDocNameChar(xmlDocPtr doc, int c) {
+ if ((doc == NULL) || (doc->properties & XML_DOC_OLD10) == 0) {
+ /*
+ * Use the new checks of production [4] [4a] amd [5] of the
+ * Update 5 of XML-1.0
+ */
+ if (((c >= 'a') && (c <= 'z')) ||
+ ((c >= 'A') && (c <= 'Z')) ||
+ ((c >= '0') && (c <= '9')) || /* !start */
+ (c == '_') || (c == ':') ||
+ (c == '-') || (c == '.') || (c == 0xB7) || /* !start */
+ ((c >= 0xC0) && (c <= 0xD6)) ||
+ ((c >= 0xD8) && (c <= 0xF6)) ||
+ ((c >= 0xF8) && (c <= 0x2FF)) ||
+ ((c >= 0x300) && (c <= 0x36F)) || /* !start */
+ ((c >= 0x370) && (c <= 0x37D)) ||
+ ((c >= 0x37F) && (c <= 0x1FFF)) ||
+ ((c >= 0x200C) && (c <= 0x200D)) ||
+ ((c >= 0x203F) && (c <= 0x2040)) || /* !start */
+ ((c >= 0x2070) && (c <= 0x218F)) ||
+ ((c >= 0x2C00) && (c <= 0x2FEF)) ||
+ ((c >= 0x3001) && (c <= 0xD7FF)) ||
+ ((c >= 0xF900) && (c <= 0xFDCF)) ||
+ ((c >= 0xFDF0) && (c <= 0xFFFD)) ||
+ ((c >= 0x10000) && (c <= 0xEFFFF)))
+ return(1);
+ } else {
+ if ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
+ (c == '.') || (c == '-') ||
+ (c == '_') || (c == ':') ||
+ (IS_COMBINING(c)) ||
+ (IS_EXTENDER(c)))
+ return(1);
+ }
+ return(0);
+}
+
/**
* xmlValidateNameValue:
+ * @doc: pointer to the document or NULL
* @value: an Name value
*
* Validate that the given value match Name production
@@ -3454,8 +3533,8 @@ xmlIsMixedElement(xmlDocPtr doc, const xmlChar *name) {
* returns 1 if valid or 0 otherwise
*/
-int
-xmlValidateNameValue(const xmlChar *value) {
+static int
+xmlValidateNameValueInternal(xmlDocPtr doc, const xmlChar *value) {
const xmlChar *cur;
int val, len;
@@ -3463,18 +3542,12 @@ xmlValidateNameValue(const xmlChar *value) {
cur = value;
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
- if (!IS_LETTER(val) && (val != '_') &&
- (val != ':')) {
+ if (!xmlIsDocNameStartChar(doc, val))
return(0);
- }
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
- while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
- (val == '.') || (val == '-') ||
- (val == '_') || (val == ':') ||
- (IS_COMBINING(val)) ||
- (IS_EXTENDER(val))) {
+ while (xmlIsDocNameChar(doc, val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
@@ -3485,7 +3558,22 @@ xmlValidateNameValue(const xmlChar *value) {
}
/**
- * xmlValidateNamesValue:
+ * xmlValidateNameValue:
+ * @value: an Name value
+ *
+ * Validate that the given value match Name production
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNameValue(const xmlChar *value) {
+ return(xmlValidateNameValueInternal(NULL, value));
+}
+
+/**
+ * xmlValidateNamesValueInternal:
+ * @doc: pointer to the document or NULL
* @value: an Names value
*
* Validate that the given value match Names production
@@ -3493,8 +3581,8 @@ xmlValidateNameValue(const xmlChar *value) {
* returns 1 if valid or 0 otherwise
*/
-int
-xmlValidateNamesValue(const xmlChar *value) {
+static int
+xmlValidateNamesValueInternal(xmlDocPtr doc, const xmlChar *value) {
const xmlChar *cur;
int val, len;
@@ -3502,19 +3590,13 @@ xmlValidateNamesValue(const xmlChar *value) {
cur = value;
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
-
- if (!IS_LETTER(val) && (val != '_') &&
- (val != ':')) {
+
+ if (!xmlIsDocNameStartChar(doc, val))
return(0);
- }
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
- while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
- (val == '.') || (val == '-') ||
- (val == '_') || (val == ':') ||
- (IS_COMBINING(val)) ||
- (IS_EXTENDER(val))) {
+ while (xmlIsDocNameChar(doc, val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
@@ -3526,18 +3608,13 @@ xmlValidateNamesValue(const xmlChar *value) {
cur += len;
}
- if (!IS_LETTER(val) && (val != '_') &&
- (val != ':')) {
+ if (!xmlIsDocNameStartChar(doc, val))
return(0);
- }
+
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
- while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
- (val == '.') || (val == '-') ||
- (val == '_') || (val == ':') ||
- (IS_COMBINING(val)) ||
- (IS_EXTENDER(val))) {
+ while (xmlIsDocNameChar(doc, val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
@@ -3549,18 +3626,33 @@ xmlValidateNamesValue(const xmlChar *value) {
}
/**
- * xmlValidateNmtokenValue:
+ * xmlValidateNamesValue:
+ * @value: an Names value
+ *
+ * Validate that the given value match Names production
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNamesValue(const xmlChar *value) {
+ return(xmlValidateNamesValueInternal(NULL, value));
+}
+
+/**
+ * xmlValidateNmtokenValueInternal:
+ * @doc: pointer to the document or NULL
* @value: an Nmtoken value
*
* Validate that the given value match Nmtoken production
*
* [ VC: Name Token ]
- *
+ *
* returns 1 if valid or 0 otherwise
*/
-int
-xmlValidateNmtokenValue(const xmlChar *value) {
+static int
+xmlValidateNmtokenValueInternal(xmlDocPtr doc, const xmlChar *value) {
const xmlChar *cur;
int val, len;
@@ -3568,19 +3660,13 @@ xmlValidateNmtokenValue(const xmlChar *value) {
cur = value;
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
-
- if (!IS_LETTER(val) && !IS_DIGIT(val) &&
- (val != '.') && (val != '-') &&
- (val != '_') && (val != ':') &&
- (!IS_COMBINING(val)) &&
- (!IS_EXTENDER(val)))
+
+ if (!xmlIsDocNameChar(doc, val))
return(0);
- while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
- (val == '.') || (val == '-') ||
- (val == '_') || (val == ':') ||
- (IS_COMBINING(val)) ||
- (IS_EXTENDER(val))) {
+ val = xmlStringCurrentChar(NULL, cur, &len);
+ cur += len;
+ while (xmlIsDocNameChar(doc, val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
@@ -3591,18 +3677,35 @@ xmlValidateNmtokenValue(const xmlChar *value) {
}
/**
- * xmlValidateNmtokensValue:
+ * xmlValidateNmtokenValue:
+ * @value: an Nmtoken value
+ *
+ * Validate that the given value match Nmtoken production
+ *
+ * [ VC: Name Token ]
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNmtokenValue(const xmlChar *value) {
+ return(xmlValidateNmtokenValueInternal(NULL, value));
+}
+
+/**
+ * xmlValidateNmtokensValueInternal:
+ * @doc: pointer to the document or NULL
* @value: an Nmtokens value
*
* Validate that the given value match Nmtokens production
*
* [ VC: Name Token ]
- *
+ *
* returns 1 if valid or 0 otherwise
*/
-int
-xmlValidateNmtokensValue(const xmlChar *value) {
+static int
+xmlValidateNmtokensValueInternal(xmlDocPtr doc, const xmlChar *value) {
const xmlChar *cur;
int val, len;
@@ -3610,24 +3713,16 @@ xmlValidateNmtokensValue(const xmlChar *value) {
cur = value;
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
-
+
while (IS_BLANK(val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
- if (!IS_LETTER(val) && !IS_DIGIT(val) &&
- (val != '.') && (val != '-') &&
- (val != '_') && (val != ':') &&
- (!IS_COMBINING(val)) &&
- (!IS_EXTENDER(val)))
+ if (!xmlIsDocNameChar(doc, val))
return(0);
- while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
- (val == '.') || (val == '-') ||
- (val == '_') || (val == ':') ||
- (IS_COMBINING(val)) ||
- (IS_EXTENDER(val))) {
+ while (xmlIsDocNameChar(doc, val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
@@ -3640,18 +3735,13 @@ xmlValidateNmtokensValue(const xmlChar *value) {
}
if (val == 0) return(1);
- if (!IS_LETTER(val) && !IS_DIGIT(val) &&
- (val != '.') && (val != '-') &&
- (val != '_') && (val != ':') &&
- (!IS_COMBINING(val)) &&
- (!IS_EXTENDER(val)))
+ if (!xmlIsDocNameChar(doc, val))
return(0);
- while ((IS_LETTER(val)) || (IS_DIGIT(val)) ||
- (val == '.') || (val == '-') ||
- (val == '_') || (val == ':') ||
- (IS_COMBINING(val)) ||
- (IS_EXTENDER(val))) {
+ val = xmlStringCurrentChar(NULL, cur, &len);
+ cur += len;
+
+ while (xmlIsDocNameChar(doc, val)) {
val = xmlStringCurrentChar(NULL, cur, &len);
cur += len;
}
@@ -3663,6 +3753,22 @@ xmlValidateNmtokensValue(const xmlChar *value) {
}
/**
+ * xmlValidateNmtokensValue:
+ * @value: an Nmtokens value
+ *
+ * Validate that the given value match Nmtokens production
+ *
+ * [ VC: Name Token ]
+ *
+ * returns 1 if valid or 0 otherwise
+ */
+
+int
+xmlValidateNmtokensValue(const xmlChar *value) {
+ return(xmlValidateNmtokensValueInternal(NULL, value));
+}
+
+/**
* xmlValidateNotationDecl:
* @ctxt: the validation context
* @doc: a document instance
@@ -3710,28 +3816,34 @@ xmlValidateNotationDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED, xmlDocPtr doc ATT
* returns 1 if valid or 0 otherwise
*/
-int
-xmlValidateAttributeValue(xmlAttributeType type, const xmlChar *value) {
+static int
+xmlValidateAttributeValueInternal(xmlDocPtr doc, xmlAttributeType type,
+ const xmlChar *value) {
switch (type) {
case XML_ATTRIBUTE_ENTITIES:
case XML_ATTRIBUTE_IDREFS:
- return(xmlValidateNamesValue(value));
+ return(xmlValidateNamesValueInternal(doc, value));
case XML_ATTRIBUTE_ENTITY:
case XML_ATTRIBUTE_IDREF:
case XML_ATTRIBUTE_ID:
case XML_ATTRIBUTE_NOTATION:
- return(xmlValidateNameValue(value));
+ return(xmlValidateNameValueInternal(doc, value));
case XML_ATTRIBUTE_NMTOKENS:
case XML_ATTRIBUTE_ENUMERATION:
- return(xmlValidateNmtokensValue(value));
+ return(xmlValidateNmtokensValueInternal(doc, value));
case XML_ATTRIBUTE_NMTOKEN:
- return(xmlValidateNmtokenValue(value));
+ return(xmlValidateNmtokenValueInternal(doc, value));
case XML_ATTRIBUTE_CDATA:
break;
}
return(1);
}
+int
+xmlValidateAttributeValue(xmlAttributeType type, const xmlChar *value) {
+ return(xmlValidateAttributeValueInternal(NULL, type, value));
+}
+
/**
* xmlValidateAttributeValue2:
* @ctxt: the validation context
@@ -4047,11 +4159,12 @@ xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
int val;
CHECK_DTD;
if(attr == NULL) return(1);
-
+
/* Attribute Default Legal */
/* Enumeration */
if (attr->defaultValue != NULL) {
- val = xmlValidateAttributeValue(attr->atype, attr->defaultValue);
+ val = xmlValidateAttributeValueInternal(doc, attr->atype,
+ attr->defaultValue);
if (val == 0) {
xmlErrValidNode(ctxt, (xmlNodePtr) attr, XML_DTD_ATTRIBUTE_DEFAULT,
"Syntax of default value for attribute %s of %s is not valid\n",
@@ -4332,7 +4445,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc,
}
attr->atype = attrDecl->atype;
- val = xmlValidateAttributeValue(attrDecl->atype, value);
+ val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
if (val == 0) {
xmlErrValidNode(ctxt, elem, XML_DTD_ATTRIBUTE_VALUE,
"Syntax of value for attribute %s of %s is not valid\n",
@@ -4517,7 +4630,7 @@ xmlNodePtr elem, const xmlChar *prefix, xmlNsPtr ns, const xmlChar *value) {
return(0);
}
- val = xmlValidateAttributeValue(attrDecl->atype, value);
+ val = xmlValidateAttributeValueInternal(doc, attrDecl->atype, value);
if (val == 0) {
if (ns->prefix != NULL) {
xmlErrValidNode(ctxt, elem, XML_DTD_INVALID_DEFAULT,
@@ -6673,7 +6786,7 @@ xmlValidateDtdFinal(xmlValidCtxtPtr ctxt, xmlDocPtr doc) {
xmlAttributeTablePtr table;
xmlEntitiesTablePtr entities;
- if (doc == NULL) return(0);
+ if ((doc == NULL) || (ctxt == NULL)) return(0);
if ((doc->intSubset == NULL) && (doc->extSubset == NULL))
return(0);
ctxt->doc = doc;
diff --git a/win32/Makefile.msvc.orig b/win32/Makefile.msvc.orig
deleted file mode 100644
index ec1950c..0000000
--- a/win32/Makefile.msvc.orig
+++ /dev/null
@@ -1,462 +0,0 @@
-# Makefile for libxml2, specific for Windows, MSVC and NMAKE.
-#
-# Take a look at the beginning and modify the variables to suit your
-# environment. Having done that, you can do a
-#
-# nmake [all] to build the libxml and the accompanying utilities.
-# nmake clean to remove all compiler output files and return to a
-# clean state.
-# nmake rebuild to rebuild everything from scratch. This basically does
-# a 'nmake clean' and then a 'nmake all'.
-# nmake install to install the library and its header files.
-#
-# March 2002, Igor Zlatkovic <igor@zlatkovic.com>
-
-# There should never be a need to modify anything below this line.
-# ----------------------------------------------------------------
-
-AUTOCONF = .\config.msvc
-!include $(AUTOCONF)
-
-# Names of various input and output components.
-XML_NAME = xml2
-XML_BASENAME = lib$(XML_NAME)
-XML_SO = $(XML_BASENAME).dll
-XML_IMP = $(XML_BASENAME).lib
-XML_DEF = $(XML_BASENAME).def
-XML_A = $(XML_BASENAME)_a.lib
-XML_A_DLL = $(XML_BASENAME)_a_dll.lib
-
-# Place where we let the compiler put its output.
-BINDIR = bin.msvc
-XML_INTDIR = int.msvc
-XML_INTDIR_A = int.a.msvc
-XML_INTDIR_A_DLL = int.a.dll.msvc
-UTILS_INTDIR = int.utils.msvc
-
-# The preprocessor and its options.
-CPP = cl.exe /EP
-CPPFLAGS = /nologo /I$(XML_SRCDIR)\include
-!if "$(WITH_THREADS)" != "no"
-CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT"
-!endif
-
-# The compiler and its options.
-CC = cl.exe
-CFLAGS = /nologo /D "WIN32" /D "_WINDOWS" /D "_MBCS" /W1 $(CRUNTIME)
-CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX)
-!if "$(WITH_THREADS)" != "no"
-CFLAGS = $(CFLAGS) /D "_REENTRANT"
-!endif
-!if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls"
-CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS" /D "HAVE_COMPILER_TLS"
-!else if "$(WITH_THREADS)" == "native"
-CFLAGS = $(CFLAGS) /D "HAVE_WIN32_THREADS"
-!else if "$(WITH_THREADS)" == "posix"
-CFLAGS = $(CFLAGS) /D "HAVE_PTHREAD_H"
-!endif
-!if "$(WITH_ZLIB)" == "1"
-CFLAGS = $(CFLAGS) /D "HAVE_ZLIB_H"
-!endif
-CFLAGS = $(CFLAGS) /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
-
-# The linker and its options.
-LD = link.exe
-LDFLAGS = /nologo /VERSION:$(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION)
-LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX)
-LIBS =
-!if "$(WITH_FTP)" == "1" || "$(WITH_HTTP)" == "1"
-LIBS = $(LIBS) wsock32.lib ws2_32.lib
-!endif
-!if "$(WITH_ICONV)" == "1"
-LIBS = $(LIBS) iconv.lib
-!endif
-!if "$(WITH_ZLIB)" == "1"
-LIBS = $(LIBS) zdll.lib
-!endif
-!if "$(WITH_THREADS)" == "posix"
-LIBS = $(LIBS) pthreadVC.lib
-!endif
-!if "$(WITH_MODULES)" == "1"
-LIBS = $(LIBS) kernel32.lib
-!endif
-
-# The archiver and its options.
-AR = lib.exe
-ARFLAGS = /nologo
-
-# Optimisation and debug symbols.
-!if "$(DEBUG)" == "1"
-CFLAGS = $(CFLAGS) /D "_DEBUG" /Od /Z7
-LDFLAGS = $(LDFLAGS) /DEBUG
-!else
-CFLAGS = $(CFLAGS) /D "NDEBUG" /O2
-LDFLAGS = $(LDFLAGS) /OPT:NOWIN98
-!endif
-
-# Libxml object files.
-XML_OBJS = $(XML_INTDIR)\c14n.obj\
- $(XML_INTDIR)\catalog.obj\
- $(XML_INTDIR)\chvalid.obj\
- $(XML_INTDIR)\debugXML.obj\
- $(XML_INTDIR)\dict.obj\
- $(XML_INTDIR)\DOCBparser.obj\
- $(XML_INTDIR)\encoding.obj\
- $(XML_INTDIR)\entities.obj\
- $(XML_INTDIR)\error.obj\
- $(XML_INTDIR)\globals.obj\
- $(XML_INTDIR)\hash.obj\
- $(XML_INTDIR)\HTMLparser.obj\
- $(XML_INTDIR)\HTMLtree.obj\
- $(XML_INTDIR)\legacy.obj\
- $(XML_INTDIR)\list.obj\
- $(XML_INTDIR)\nanoftp.obj\
- $(XML_INTDIR)\nanohttp.obj\
- $(XML_INTDIR)\parser.obj\
- $(XML_INTDIR)\parserInternals.obj\
- $(XML_INTDIR)\pattern.obj\
- $(XML_INTDIR)\relaxng.obj\
- $(XML_INTDIR)\SAX2.obj\
- $(XML_INTDIR)\SAX.obj\
- $(XML_INTDIR)\schematron.obj\
- $(XML_INTDIR)\threads.obj\
- $(XML_INTDIR)\tree.obj\
- $(XML_INTDIR)\uri.obj\
- $(XML_INTDIR)\valid.obj\
- $(XML_INTDIR)\xinclude.obj\
- $(XML_INTDIR)\xlink.obj\
- $(XML_INTDIR)\xmlIO.obj\
- $(XML_INTDIR)\xmlmemory.obj\
- $(XML_INTDIR)\xmlreader.obj\
- $(XML_INTDIR)\xmlregexp.obj\
- $(XML_INTDIR)\xmlmodule.obj\
- $(XML_INTDIR)\xmlsave.obj\
- $(XML_INTDIR)\xmlschemas.obj\
- $(XML_INTDIR)\xmlschemastypes.obj\
- $(XML_INTDIR)\xmlunicode.obj\
- $(XML_INTDIR)\xmlwriter.obj\
- $(XML_INTDIR)\xpath.obj\
- $(XML_INTDIR)\xpointer.obj\
- $(XML_INTDIR)\xmlstring.obj
-
-# Static libxml object files.
-XML_OBJS_A = $(XML_INTDIR_A)\c14n.obj\
- $(XML_INTDIR_A)\catalog.obj\
- $(XML_INTDIR_A)\chvalid.obj\
- $(XML_INTDIR_A)\debugXML.obj\
- $(XML_INTDIR_A)\dict.obj\
- $(XML_INTDIR_A)\DOCBparser.obj\
- $(XML_INTDIR_A)\encoding.obj\
- $(XML_INTDIR_A)\entities.obj\
- $(XML_INTDIR_A)\error.obj\
- $(XML_INTDIR_A)\globals.obj\
- $(XML_INTDIR_A)\hash.obj\
- $(XML_INTDIR_A)\HTMLparser.obj\
- $(XML_INTDIR_A)\HTMLtree.obj\
- $(XML_INTDIR_A)\legacy.obj\
- $(XML_INTDIR_A)\list.obj\
- $(XML_INTDIR_A)\nanoftp.obj\
- $(XML_INTDIR_A)\nanohttp.obj\
- $(XML_INTDIR_A)\parser.obj\
- $(XML_INTDIR_A)\parserInternals.obj\
- $(XML_INTDIR_A)\pattern.obj\
- $(XML_INTDIR_A)\relaxng.obj\
- $(XML_INTDIR_A)\SAX2.obj\
- $(XML_INTDIR_A)\SAX.obj\
- $(XML_INTDIR_A)\schematron.obj\
- $(XML_INTDIR_A)\threads.obj\
- $(XML_INTDIR_A)\tree.obj\
- $(XML_INTDIR_A)\uri.obj\
- $(XML_INTDIR_A)\valid.obj\
- $(XML_INTDIR_A)\xinclude.obj\
- $(XML_INTDIR_A)\xlink.obj\
- $(XML_INTDIR_A)\xmlIO.obj\
- $(XML_INTDIR_A)\xmlmemory.obj\
- $(XML_INTDIR_A)\xmlreader.obj\
- $(XML_INTDIR_A)\xmlregexp.obj\
- $(XML_INTDIR_A)\xmlmodule.obj\
- $(XML_INTDIR_A)\xmlsave.obj\
- $(XML_INTDIR_A)\xmlschemas.obj\
- $(XML_INTDIR_A)\xmlschemastypes.obj\
- $(XML_INTDIR_A)\xmlunicode.obj\
- $(XML_INTDIR_A)\xmlwriter.obj\
- $(XML_INTDIR_A)\xpath.obj\
- $(XML_INTDIR_A)\xpointer.obj\
- $(XML_INTDIR_A)\xmlstring.obj
-
-# Static libxml object files.
-XML_OBJS_A_DLL = $(XML_INTDIR_A_DLL)\c14n.obj\
- $(XML_INTDIR_A_DLL)\catalog.obj\
- $(XML_INTDIR_A_DLL)\chvalid.obj\
- $(XML_INTDIR_A_DLL)\debugXML.obj\
- $(XML_INTDIR_A_DLL)\dict.obj\
- $(XML_INTDIR_A_DLL)\DOCBparser.obj\
- $(XML_INTDIR_A_DLL)\encoding.obj\
- $(XML_INTDIR_A_DLL)\entities.obj\
- $(XML_INTDIR_A_DLL)\error.obj\
- $(XML_INTDIR_A_DLL)\globals.obj\
- $(XML_INTDIR_A_DLL)\hash.obj\
- $(XML_INTDIR_A_DLL)\HTMLparser.obj\
- $(XML_INTDIR_A_DLL)\HTMLtree.obj\
- $(XML_INTDIR_A_DLL)\legacy.obj\
- $(XML_INTDIR_A_DLL)\list.obj\
- $(XML_INTDIR_A_DLL)\nanoftp.obj\
- $(XML_INTDIR_A_DLL)\nanohttp.obj\
- $(XML_INTDIR_A_DLL)\parser.obj\
- $(XML_INTDIR_A_DLL)\parserInternals.obj\
- $(XML_INTDIR_A_DLL)\pattern.obj\
- $(XML_INTDIR_A_DLL)\relaxng.obj\
- $(XML_INTDIR_A_DLL)\SAX2.obj\
- $(XML_INTDIR_A_DLL)\SAX.obj\
- $(XML_INTDIR_A_DLL)\schematron.obj\
- $(XML_INTDIR_A_DLL)\threads.obj\
- $(XML_INTDIR_A_DLL)\tree.obj\
- $(XML_INTDIR_A_DLL)\uri.obj\
- $(XML_INTDIR_A_DLL)\valid.obj\
- $(XML_INTDIR_A_DLL)\xinclude.obj\
- $(XML_INTDIR_A_DLL)\xlink.obj\
- $(XML_INTDIR_A_DLL)\xmlIO.obj\
- $(XML_INTDIR_A_DLL)\xmlmemory.obj\
- $(XML_INTDIR_A_DLL)\xmlreader.obj\
- $(XML_INTDIR_A_DLL)\xmlregexp.obj\
- $(XML_INTDIR_A_DLL)\xmlmodule.obj\
- $(XML_INTDIR_A_DLL)\xmlsave.obj\
- $(XML_INTDIR_A_DLL)\xmlschemas.obj\
- $(XML_INTDIR_A_DLL)\xmlschemastypes.obj\
- $(XML_INTDIR_A_DLL)\xmlunicode.obj\
- $(XML_INTDIR_A_DLL)\xmlwriter.obj\
- $(XML_INTDIR_A_DLL)\xpath.obj\
- $(XML_INTDIR_A_DLL)\xpointer.obj\
- $(XML_INTDIR_A_DLL)\xmlstring.obj
-
-# Xmllint and friends executables.
-UTILS = $(BINDIR)\xmllint.exe\
- $(BINDIR)\xmlcatalog.exe\
- $(BINDIR)\testAutomata.exe\
- $(BINDIR)\testC14N.exe\
- $(BINDIR)\testDocbook.exe\
- $(BINDIR)\testHTML.exe\
- $(BINDIR)\testReader.exe\
- $(BINDIR)\testRelax.exe\
- $(BINDIR)\testRegexp.exe\
- $(BINDIR)\testModule.exe\
- $(BINDIR)\testSAX.exe\
- $(BINDIR)\testSchemas.exe\
- $(BINDIR)\testURI.exe\
- $(BINDIR)\testXPath.exe\
- $(BINDIR)\runtest.exe\
- $(BINDIR)\runsuite.exe\
- $(BINDIR)\testapi.exe
-
-!if "$(WITH_THREADS)" == "yes" || "$(WITH_THREADS)" == "ctls" || "$(WITH_THREADS)" == "native"
-UTILS = $(UTILS) $(BINDIR)\testThreadsWin32.exe
-!else if "$(WITH_THREADS)" == "posix"
-UTILS = $(UTILS) $(BINDIR)\testThreads.exe
-!endif
-
-!if "$(VCMANIFEST)" == "1"
-_VC_MANIFEST_EMBED_EXE= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;1
-_VC_MANIFEST_EMBED_DLL= if exist $@.manifest mt.exe -nologo -manifest $@.manifest -outputresource:$@;2
-!else
-_VC_MANIFEST_EMBED_EXE=
-_VC_MANIFEST_EMBED_DLL=
-!endif
-
-all : libxml libxmla libxmladll utils
-
-libxml : $(BINDIR)\$(XML_SO)
-
-libxmla : $(BINDIR)\$(XML_A)
-
-libxmladll : $(BINDIR)\$(XML_A_DLL)
-
-utils : $(UTILS)
-
-clean :
- if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)
- if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)
- if exist $(XML_INTDIR_A_DLL) rmdir /S /Q $(XML_INTDIR_A_DLL)
- if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)
- if exist $(BINDIR) rmdir /S /Q $(BINDIR)
-
-distclean : clean
- if exist config.* del config.*
- if exist Makefile del Makefile
-
-rebuild : clean all
-
-install-libs : all
- if not exist $(INCPREFIX)\libxml mkdir $(INCPREFIX)\libxml
- if not exist $(BINPREFIX) mkdir $(BINPREFIX)
- if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)
- if not exist $(SOPREFIX) mkdir $(SOPREFIX)
- copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml
- copy $(BINDIR)\$(XML_SO) $(SOPREFIX)
- copy $(BINDIR)\$(XML_A) $(LIBPREFIX)
- copy $(BINDIR)\$(XML_A_DLL) $(LIBPREFIX)
- copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)
-
-install : install-libs
- copy $(BINDIR)\*.exe $(BINPREFIX)
- -copy $(BINDIR)\*.pdb $(BINPREFIX)
-
-install-dist : install-libs
- copy $(BINDIR)\xml*.exe $(BINPREFIX)
- -copy $(BINDIR)\xml*.pdb $(BINPREFIX)
-
-# This is a target for me, to make a binary distribution. Not for the public use,
-# keep your hands off :-)
-BDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION)
-BDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32
-bindist : all
- $(MAKE) /nologo PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)\bin install-dist
- cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
-
-
-# Makes the output directory.
-$(BINDIR) :
- if not exist $(BINDIR) mkdir $(BINDIR)
-
-
-# Makes the libxml intermediate directory.
-$(XML_INTDIR) :
- if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
-
-# Makes the static libxml intermediate directory.
-$(XML_INTDIR_A) :
- if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
-
-# Makes the static for dll libxml intermediate directory.
-$(XML_INTDIR_A_DLL) :
- if not exist $(XML_INTDIR_A_DLL) mkdir $(XML_INTDIR_A_DLL)
-
-# An implicit rule for libxml compilation.
-{$(XML_SRCDIR)}.c{$(XML_INTDIR)}.obj::
- $(CC) $(CFLAGS) /Fo$(XML_INTDIR)\ /c $<
-
-# An implicit rule for static libxml compilation.
-{$(XML_SRCDIR)}.c{$(XML_INTDIR_A)}.obj::
- $(CC) $(CFLAGS) /D "LIBXML_STATIC" /Fo$(XML_INTDIR_A)\ /c $<
-
-# An implicit rule for static for dll libxml compilation.
-{$(XML_SRCDIR)}.c{$(XML_INTDIR_A_DLL)}.obj::
- $(CC) $(CFLAGS) /D "LIBXML_STATIC" /D "LIBXML_STATIC_FOR_DLL" /Fo$(XML_INTDIR_A_DLL)\ /c $<
-
-# Compiles libxml source. Uses the implicit rule for commands.
-$(XML_OBJS) : $(XML_INTDIR)
-
-# Compiles static libxml source. Uses the implicit rule for commands.
-$(XML_OBJS_A) : $(XML_INTDIR_A)
-
-# Compiles static for dll libxml source. Uses the implicit rule for commands.
-$(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
-
-# Creates the export definition file (DEF) for libxml.
-$(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
- $(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF)
-
-# Creates the libxml shared object.
-$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
- $(LD) $(LDFLAGS) /DLL \
- /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
- @$(_VC_MANIFEST_EMBED_DLL)
-
-#$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
-# $(LD) $(LDFLAGS) /DLL /DEF:$(XML_INTDIR)\$(XML_DEF) \
-# /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
-
-# Creates the libxml archive.
-$(BINDIR)\$(XML_A) : $(BINDIR) $(XML_OBJS_A)
- $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A) $(XML_OBJS_A)
-
-# Creates the libxml static for dll archive.
-$(BINDIR)\$(XML_A_DLL) : $(BINDIR) $(XML_OBJS_A_DLL)
- $(AR) $(ARFLAGS) /OUT:$(BINDIR)\$(XML_A_DLL) $(XML_OBJS_A_DLL)
-
-# Makes the utils intermediate directory.
-$(UTILS_INTDIR) :
- if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
-
-# An implicit rule for xmllint and friends.
-!if "$(STATIC)" == "1"
-{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
- $(CC) /D "LIBXML_STATIC" $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
- $(LD) $(LDFLAGS) /OUT:$@ $(XML_A) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
- @$(_VC_MANIFEST_EMBED_EXE)
-!else
-{$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe:
- $(CC) $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $<
- $(LD) $(LDFLAGS) /OUT:$@ $(XML_IMP) $(LIBS) $(UTILS_INTDIR)\$(<B).obj
- @$(_VC_MANIFEST_EMBED_EXE)
-!endif
-
-# Builds xmllint and friends. Uses the implicit rule for commands.
-$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla libxmladll
-
-# Source dependences should be autogenerated somehow here, but how to
-# do it? I have no clue.
-
-# TESTS
-
-tests : XPathtests
-
-XPathtests : $(BINDIR)\testXPath.exe
- @echo. 2> .memdump
- @echo ## XPath regression tests
- @-$(BINDIR)\testXPath.exe | find /C "support not compiled in" 1>nul
- @if %ERRORLEVEL% NEQ 0 @( \
- echo Skipping debug not compiled in\
- @exit 0 \
- )
- @for %%I in ($(XML_SRCDIR)\test\XPath\expr\*.*) do @( \
- @IF NOT EXIST $(XML_SRCDIR)\result\XPath\expr\%%~nxI ( \
- @echo New test %%~nxI &&\
- @echo %%~nxI &&\
- $(BINDIR)\testXPath.exe -f --expr %%I > $(XML_SRCDIR)/result/XPath/expr/%%~nxI &&\
- findstr /C:"MEMORY ALLOCATED : 0" \
- ) ELSE ( \
- $(BINDIR)\testXPath.exe -f --expr %%I 2>&1 > result.%%~nxI &&\
- fc $(XML_SRCDIR)\result\XPath\expr\%%~nxI result.%%~nxI >nul &\
- iF ERRORLEVEL 1 exit 1 & \
- findstr "MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" >nul &&\
- del result.%%~nxI \
- ) \
- )
- @for %%I in ($(XML_SRCDIR)\test\XPath\docs\*.*) do @( \
- for %%J in ($(XML_SRCDIR)\test\XPath\tests\%%~nxI*.*) do @( \
- if not exist $(XML_SRCDIR)\result\XPath\tests\%%~nxJ ( \
- $(BINDIR)\testXPath.exe -f -i %%I %%J > $(XML_SRCDIR)\result\XPath\tests\%%~nxJ &&\
- findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > nul \
- ) ELSE ( \
- $(BINDIR)\testXPAth.exe -f -i %%I %%J 2>&1 > result.%%~nxJ &&\
- findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0">null &&\
- fc $(XML_SRCDIR)\result\XPath\tests\%%~nxJ result.%%~nxJ >null & \
- IF ERRORLEVEL 1 (echo Error: %%I %%J & exit 1) & \
- del result.%%~nxJ \
- )\
- )\
- )
-
-XMLtests : $(BINDIR)\xmllint.exe
- @echo. 2> .memdump
- @echo ## XML regression tests
- -@for %%I in ($(XML_SRCDIR)\test\*) do @( \
- if not exist $(XML_SRCDIR)\result\%%~nxI ( \
- echo New test file %%~nxI &\
- $(BINDIR)\xmllint.exe %%I > $(XML_SRCDIR)\result\%%~nxI && \
- findstr /C:"MEMORY ALLOCATED" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null \
- ) ELSE ( \
- $(BINDIR)\xmllint.exe %%I 2>&1 > result.%%~nxI && \
- findstr /C:"MEMORY ALLOC" .memdump | findstr /C:"MEMORY ALLOCATED : 0" > null && \
- fc $(XML_SRCDIR)\result\%%~nxI result.%%~nxI > null && \
- $(BINDIR)\xmllint.exe result.%%~nxI 2>&1 > result2.%%~nxI | findstr /V /C:"failed to load external entity" && \
- fc result.%%~nxI result2.%%~nxI & \
- del result.%%~nxI result2.%%~nxI\
- ) \
- )
-
-
-
-
-
-
diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src
index db05ad4..f4c2c63 100644
--- a/win32/libxml2.def.src
+++ b/win32/libxml2.def.src
@@ -1732,6 +1732,9 @@ xmlSchemaValPredefTypeNodeNoNorm
xmlSchemaValidCtxtGetOptions
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
+xmlSchemaValidCtxtGetParserCtxt
+#endif
+#ifdef LIBXML_SCHEMAS_ENABLED
xmlSchemaValidateDoc
#endif
#ifdef LIBXML_SCHEMAS_ENABLED
diff --git a/xinclude.c b/xinclude.c
index bb41180..ae449f8 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -1678,7 +1678,9 @@ loaded:
/*
* Do the xml:base fixup if needed
*/
- if ((doc != NULL) && (URL != NULL) && (xmlStrchr(URL, (xmlChar) '/'))) {
+ if ((doc != NULL) && (URL != NULL) && (xmlStrchr(URL, (xmlChar) '/')) &&
+ (!(ctxt->parseFlags & XML_PARSE_NOBASEFIX)) &&
+ (!(doc->parseFlags & XML_PARSE_NOBASEFIX))) {
xmlNodePtr node;
xmlChar *base;
xmlChar *curBase;
diff --git a/xmlIO.c b/xmlIO.c
index dd4f7e7..aa97c44 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -2274,10 +2274,21 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) {
xmlFree(ret);
return(NULL);
}
- ret->buffer->alloc = XML_BUFFER_ALLOC_DOUBLEIT;
+
+ /*
+ * For conversion buffers we use the special IO handling
+ */
+ ret->buffer->alloc = XML_BUFFER_ALLOC_IO;
+ ret->buffer->contentIO = ret->buffer->content;
+
ret->encoder = encoder;
if (encoder != NULL) {
ret->conv = xmlBufferCreateSize(4000);
+ if (ret->conv == NULL) {
+ xmlFree(ret);
+ return(NULL);
+ }
+
/*
* This call is designed to initiate the encoder state
*/
@@ -3320,9 +3331,10 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
* not the case force a flush, but make sure we stay in the loop
*/
if (chunk < 40) {
- nbchars = 0;
- oldwritten = -1;
- goto flush;
+ if (xmlBufferGrow(out->buffer, out->buffer->size + 100) < 0)
+ return(-1);
+ oldwritten = -1;
+ continue;
}
/*
@@ -3370,7 +3382,6 @@ xmlOutputBufferWriteEscape(xmlOutputBufferPtr out, const xmlChar *str,
if ((nbchars < MINLEN) && (len <= 0))
goto done;
-flush:
if (out->writecallback) {
/*
* second write the stuff to the I/O channel
diff --git a/xmllint.c b/xmllint.c
index ee41697..6955fde 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -202,6 +202,7 @@ static xmlStreamCtxtPtr patstream = NULL;
#endif
static int options = XML_PARSE_COMPACT;
static int sax = 0;
+static int oldxml10 = 0;
/************************************************************************
* *
@@ -2832,6 +2833,7 @@ static void usage(const char *name) {
printf("\t--copy : used to test the internal copy implementation\n");
#endif /* LIBXML_TREE_ENABLED */
printf("\t--recover : output what was parsable on broken XML documents\n");
+ printf("\t--huge : remove any internal arbitrary parser limits\n");
printf("\t--noent : substitute entity references by their value\n");
printf("\t--noout : don't output the result tree\n");
printf("\t--path 'paths': provide a set of paths for resources\n");
@@ -2890,6 +2892,7 @@ static void usage(const char *name) {
#ifdef LIBXML_XINCLUDE_ENABLED
printf("\t--xinclude : do XInclude processing\n");
printf("\t--noxincludenode : same but do not generate XInclude nodes\n");
+ printf("\t--nofixup-base-uris : do not fixup xml:base uris\n");
#endif
printf("\t--loaddtd : fetch external DTD\n");
printf("\t--dtdattr : loaddtd + populate the tree with inherited attributes \n");
@@ -2912,6 +2915,7 @@ static void usage(const char *name) {
printf("\t--sax1: use the old SAX1 interfaces for processing\n");
#endif
printf("\t--sax: do not build a tree but work just at the SAX level\n");
+ printf("\t--oldxml10: use XML-1.0 parsing rules before the 5th edition\n");
printf("\nLibxml project home page: http://xmlsoft.org/\n");
printf("To report bugs or get some help check: http://xmlsoft.org/bugs.html\n");
@@ -2969,6 +2973,9 @@ main(int argc, char **argv) {
(!strcmp(argv[i], "--recover"))) {
recovery++;
options |= XML_PARSE_RECOVER;
+ } else if ((!strcmp(argv[i], "-huge")) ||
+ (!strcmp(argv[i], "--huge"))) {
+ options |= XML_PARSE_HUGE;
} else if ((!strcmp(argv[i], "-noent")) ||
(!strcmp(argv[i], "--noent"))) {
noent++;
@@ -3091,6 +3098,12 @@ main(int argc, char **argv) {
options |= XML_PARSE_XINCLUDE;
options |= XML_PARSE_NOXINCNODE;
}
+ else if ((!strcmp(argv[i], "-nofixup-base-uris")) ||
+ (!strcmp(argv[i], "--nofixup-base-uris"))) {
+ xinclude++;
+ options |= XML_PARSE_XINCLUDE;
+ options |= XML_PARSE_NOBASEFIX;
+ }
#endif
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
@@ -3237,6 +3250,10 @@ main(int argc, char **argv) {
i++;
pattern = argv[i];
#endif
+ } else if ((!strcmp(argv[i], "-oldxml10")) ||
+ (!strcmp(argv[i], "--oldxml10"))) {
+ oldxml10++;
+ options |= XML_PARSE_OLD10;
} else {
fprintf(stderr, "Unknown option %s\n", argv[i]);
usage(argv[0]);
diff --git a/xmlmemory.c b/xmlmemory.c
index f9019a4..510d4ce 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -34,7 +34,7 @@
/**
* MEM_LIST:
*
- * keep track of all allocated blocks for error reporting
+ * keep track of all allocated blocks for error reporting
* Always build the memory list !
*/
#ifdef DEBUG_MEMORY_LOCATION
@@ -162,7 +162,7 @@ xmlMallocLoc(size_t size, const char * file, int line)
{
MEMHDR *p;
void *ret;
-
+
if (!xmlMemInitialized) xmlInitMemory();
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
@@ -170,7 +170,7 @@ xmlMallocLoc(size_t size, const char * file, int line)
#endif
TEST_POINT
-
+
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
if (!p) {
@@ -178,7 +178,7 @@ xmlMallocLoc(size_t size, const char * file, int line)
"xmlMallocLoc : Out of free space\n");
xmlMemoryDump();
return(NULL);
- }
+ }
p->mh_tag = MEMTAG;
p->mh_size = size;
p->mh_type = MALLOC_TYPE;
@@ -193,12 +193,12 @@ xmlMallocLoc(size_t size, const char * file, int line)
debugmem_list_add(p);
#endif
xmlMutexUnlock(xmlMemMutex);
-
+
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"Malloc(%d) Ok\n",size);
#endif
-
+
if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
ret = HDR_2_CLIENT(p);
@@ -230,7 +230,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
{
MEMHDR *p;
void *ret;
-
+
if (!xmlMemInitialized) xmlInitMemory();
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
@@ -238,7 +238,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
#endif
TEST_POINT
-
+
p = (MEMHDR *) malloc(RESERVE_SIZE+size);
if (!p) {
@@ -246,7 +246,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
"xmlMallocLoc : Out of free space\n");
xmlMemoryDump();
return(NULL);
- }
+ }
p->mh_tag = MEMTAG;
p->mh_size = size;
p->mh_type = MALLOC_ATOMIC_TYPE;
@@ -266,7 +266,7 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
xmlGenericError(xmlGenericErrorContext,
"Malloc(%d) Ok\n",size);
#endif
-
+
if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
ret = HDR_2_CLIENT(p);
@@ -341,7 +341,7 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
debugmem_list_delete(p);
#endif
xmlMutexUnlock(xmlMemMutex);
-
+
p = (MEMHDR *) realloc(p,RESERVE_SIZE+size);
if (!p) {
goto error;
@@ -374,8 +374,8 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
"Realloced(%d to %d) Ok\n", oldsize, size);
#endif
return(HDR_2_CLIENT(p));
-
-error:
+
+error:
return(NULL);
}
@@ -455,10 +455,10 @@ xmlMemFree(void *ptr)
xmlGenericError(xmlGenericErrorContext,
"Freed(%d) Ok\n", size);
#endif
-
+
return;
-
-error:
+
+error:
xmlGenericError(xmlGenericErrorContext,
"xmlMemFree(%lX) error\n", (unsigned long) ptr);
xmlMallocBreakpoint();
@@ -504,16 +504,16 @@ xmlMemStrdupLoc(const char *str, const char *file, int line)
debugmem_list_add(p);
#endif
xmlMutexUnlock(xmlMemMutex);
-
+
s = (char *) HDR_2_CLIENT(p);
-
+
if (xmlMemStopAtBlock == p->mh_number) xmlMallocBreakpoint();
if (s != NULL)
strcpy(s,str);
else
goto error;
-
+
TEST_POINT
if (xmlMemTraceBlockAt == s) {
@@ -617,7 +617,7 @@ xmlMemContentShow(FILE *fp, MEMHDR *p)
} else if ((i == 0) && (buf[i] == 0)) {
fprintf(fp," null");
} else {
- if (buf[i] == 0) fprintf(fp," \"%.25s\"", buf);
+ if (buf[i] == 0) fprintf(fp," \"%.25s\"", buf);
else {
fprintf(fp," [");
for (j = 0;j < i;j++)
@@ -629,6 +629,79 @@ xmlMemContentShow(FILE *fp, MEMHDR *p)
#endif
/**
+ * xmlMemDisplayLast:
+ * @fp: a FILE descriptor used as the output file, if NULL, the result is
+ * written to the file .memorylist
+ * @nbBytes: the amount of memory to dump
+ *
+ * the last nbBytes of memory allocated and not freed, useful for dumping
+ * the memory left allocated between two places at runtime.
+ */
+
+void
+xmlMemDisplayLast(FILE *fp, long nbBytes)
+{
+#ifdef MEM_LIST
+ MEMHDR *p;
+ unsigned idx;
+ int nb = 0;
+#endif
+ FILE *old_fp = fp;
+
+ if (nbBytes <= 0)
+ return;
+
+ if (fp == NULL) {
+ fp = fopen(".memorylist", "w");
+ if (fp == NULL)
+ return;
+ }
+
+#ifdef MEM_LIST
+ fprintf(fp," Last %li MEMORY ALLOCATED : %lu, MAX was %lu\n",
+ nbBytes, debugMemSize, debugMaxMemSize);
+ fprintf(fp,"BLOCK NUMBER SIZE TYPE\n");
+ idx = 0;
+ xmlMutexLock(xmlMemMutex);
+ p = memlist;
+ while ((p) && (nbBytes > 0)) {
+ fprintf(fp,"%-5u %6lu %6lu ",idx++,p->mh_number,
+ (unsigned long)p->mh_size);
+ switch (p->mh_type) {
+ case STRDUP_TYPE:fprintf(fp,"strdup() in ");break;
+ case MALLOC_TYPE:fprintf(fp,"malloc() in ");break;
+ case REALLOC_TYPE:fprintf(fp,"realloc() in ");break;
+ case MALLOC_ATOMIC_TYPE:fprintf(fp,"atomicmalloc() in ");break;
+ case REALLOC_ATOMIC_TYPE:fprintf(fp,"atomicrealloc() in ");break;
+ default:
+ fprintf(fp,"Unknown memory block, may be corrupted");
+ xmlMutexUnlock(xmlMemMutex);
+ if (old_fp == NULL)
+ fclose(fp);
+ return;
+ }
+ if (p->mh_file != NULL) fprintf(fp,"%s(%u)", p->mh_file, p->mh_line);
+ if (p->mh_tag != MEMTAG)
+ fprintf(fp," INVALID");
+ nb++;
+ if (nb < 100)
+ xmlMemContentShow(fp, p);
+ else
+ fprintf(fp," skip");
+
+ fprintf(fp,"\n");
+ nbBytes -= (unsigned long)p->mh_size;
+ p = p->mh_next;
+ }
+ xmlMutexUnlock(xmlMemMutex);
+#else
+ fprintf(fp,"Memory list not compiled (MEM_LIST not defined !)\n");
+#endif
+ if (old_fp == NULL)
+ fclose(fp);
+}
+
+/**
* xmlMemDisplay:
* @fp: a FILE descriptor used as the output file, if NULL, the result is
* written to the file .memorylist
@@ -665,7 +738,7 @@ xmlMemDisplay(FILE *fp)
fprintf(fp," %s\n\n", buf);
#endif
-
+
fprintf(fp," MEMORY ALLOCATED : %lu, MAX was %lu\n",
debugMemSize, debugMaxMemSize);
fprintf(fp,"BLOCK NUMBER SIZE TYPE\n");
@@ -742,7 +815,7 @@ static void debugmem_list_delete(MEMHDR *p)
*
* internal error function.
*/
-
+
static void debugmem_tag_error(void *p)
{
xmlGenericError(xmlGenericErrorContext,
@@ -802,7 +875,7 @@ xmlMemShow(FILE *fp, int nr ATTRIBUTE_UNUSED)
}
}
xmlMutexUnlock(xmlMemMutex);
-#endif /* MEM_LIST */
+#endif /* MEM_LIST */
}
/**
@@ -849,11 +922,11 @@ xmlInitMemory(void)
{
#ifdef HAVE_STDLIB_H
char *breakpoint;
-#endif
+#endif
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlInitMemory()\n");
-#endif
+#endif
/*
This is really not good code (see Bug 130419). Suggestions for
improvement will be welcome!
@@ -867,18 +940,18 @@ xmlInitMemory(void)
if (breakpoint != NULL) {
sscanf(breakpoint, "%ud", &xmlMemStopAtBlock);
}
-#endif
+#endif
#ifdef HAVE_STDLIB_H
breakpoint = getenv("XML_MEM_TRACE");
if (breakpoint != NULL) {
sscanf(breakpoint, "%p", &xmlMemTraceBlockAt);
}
-#endif
-
+#endif
+
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlInitMemory() Ok\n");
-#endif
+#endif
return(0);
}
@@ -893,7 +966,7 @@ xmlCleanupMemory(void) {
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlCleanupMemory()\n");
-#endif
+#endif
if (xmlMemInitialized == 0)
return;
@@ -903,7 +976,7 @@ xmlCleanupMemory(void) {
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlCleanupMemory() Ok\n");
-#endif
+#endif
}
/**
@@ -927,7 +1000,7 @@ xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlMemSetup()\n");
-#endif
+#endif
if (freeFunc == NULL)
return(-1);
if (mallocFunc == NULL)
@@ -944,7 +1017,7 @@ xmlMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlMemSetup() Ok\n");
-#endif
+#endif
return(0);
}
@@ -994,7 +1067,7 @@ xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlGcMemSetup()\n");
-#endif
+#endif
if (freeFunc == NULL)
return(-1);
if (mallocFunc == NULL)
@@ -1013,7 +1086,7 @@ xmlGcMemSetup(xmlFreeFunc freeFunc, xmlMallocFunc mallocFunc,
#ifdef DEBUG_MEMORY
xmlGenericError(xmlGenericErrorContext,
"xmlGcMemSetup() Ok\n");
-#endif
+#endif
return(0);
}
diff --git a/xmlreader.c b/xmlreader.c
index 92b053e..bd47ea5 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -1847,17 +1847,22 @@ xmlTextReaderNextTree(xmlTextReaderPtr reader)
}
if (reader->state != XML_TEXTREADER_BACKTRACK) {
- if (reader->node->children != 0) {
- reader->node = reader->node->children;
- reader->depth++;
+ /* Here removed traversal to child, because we want to skip the subtree,
+ replace with traversal to sibling to skip subtree */
+ if (reader->node->next != 0) {
+ /* Move to sibling if present,skipping sub-tree */
+ reader->node = reader->node->next;
reader->state = XML_TEXTREADER_START;
return(1);
}
+ /* if reader->node->next is NULL mean no subtree for current node,
+ so need to move to sibling of parent node if present */
if ((reader->node->type == XML_ELEMENT_NODE) ||
(reader->node->type == XML_ATTRIBUTE_NODE)) {
reader->state = XML_TEXTREADER_BACKTRACK;
- return(1);
+ /* This will move to parent if present */
+ xmlTextReaderRead(reader);
}
}
@@ -1876,7 +1881,8 @@ xmlTextReaderNextTree(xmlTextReaderPtr reader)
reader->node = reader->node->parent;
reader->depth--;
reader->state = XML_TEXTREADER_BACKTRACK;
- return(1);
+ /* Repeat process to move to sibling of parent node if present */
+ xmlTextReaderNextTree(reader);
}
reader->state = XML_TEXTREADER_END;
diff --git a/xmlregexp.c b/xmlregexp.c
index 389453b..73598a5 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -3162,7 +3162,8 @@ xmlFARegExec(xmlRegexpPtr comp, const xmlChar *content) {
exec->counts = NULL;
while ((exec->status == 0) &&
((exec->inputString[exec->index] != 0) ||
- (exec->state->type != XML_REGEXP_FINAL_STATE))) {
+ ((exec->state != NULL) &&
+ (exec->state->type != XML_REGEXP_FINAL_STATE)))) {
xmlRegTransPtr trans;
xmlRegAtomPtr atom;
@@ -4906,64 +4907,6 @@ xmlFAParseCharClassEsc(xmlRegParserCtxtPtr ctxt) {
}
/**
- * xmlFAParseCharRef:
- * @ctxt: a regexp parser context
- *
- * [19] XmlCharRef ::= ( '&#' [0-9]+ ';' ) | (' &#x' [0-9a-fA-F]+ ';' )
- */
-static int
-xmlFAParseCharRef(xmlRegParserCtxtPtr ctxt) {
- int ret = 0, cur;
-
- if ((CUR != '&') || (NXT(1) != '#'))
- return(-1);
- NEXT;
- NEXT;
- cur = CUR;
- if (cur == 'x') {
- NEXT;
- cur = CUR;
- if (((cur >= '0') && (cur <= '9')) ||
- ((cur >= 'a') && (cur <= 'f')) ||
- ((cur >= 'A') && (cur <= 'F'))) {
- while (((cur >= '0') && (cur <= '9')) ||
- ((cur >= 'a') && (cur <= 'f')) ||
- ((cur >= 'A') && (cur <= 'F'))) {
- if ((cur >= '0') && (cur <= '9'))
- ret = ret * 16 + cur - '0';
- else if ((cur >= 'a') && (cur <= 'f'))
- ret = ret * 16 + 10 + (cur - 'a');
- else
- ret = ret * 16 + 10 + (cur - 'A');
- NEXT;
- cur = CUR;
- }
- } else {
- ERROR("Char ref: expecting [0-9A-F]");
- return(-1);
- }
- } else {
- if ((cur >= '0') && (cur <= '9')) {
- while ((cur >= '0') && (cur <= '9')) {
- ret = ret * 10 + cur - '0';
- NEXT;
- cur = CUR;
- }
- } else {
- ERROR("Char ref: expecting [0-9]");
- return(-1);
- }
- }
- if (cur != ';') {
- ERROR("Char ref: expecting ';'");
- return(-1);
- } else {
- NEXT;
- }
- return(ret);
-}
-
-/**
* xmlFAParseCharRange:
* @ctxt: a regexp parser context
*
@@ -4984,12 +4927,6 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
return;
}
- if ((CUR == '&') && (NXT(1) == '#')) {
- end = start = xmlFAParseCharRef(ctxt);
- xmlRegAtomAddRange(ctxt, ctxt->atom, ctxt->neg,
- XML_REGEXP_CHARVAL, start, end, NULL);
- return;
- }
cur = CUR;
if (cur == '\\') {
NEXT;
diff --git a/xmlschemas.c b/xmlschemas.c
index d57ba9f..c90b171 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -90,7 +90,7 @@
#ifndef DEBUG_IDC_NODE_TABLE
#define DEBUG_IDC_NODE_TABLE
#endif
-#endif
+#endif
/* #define ENABLE_PARTICLE_RESTRICTION 1 */
@@ -374,7 +374,7 @@ typedef xmlSchemaBucket *xmlSchemaBucketPtr;
#define XML_SCHEMA_SCHEMA_REDEFINE 3
/**
- * xmlSchemaSchemaRelation:
+ * xmlSchemaSchemaRelation:
*
* Used to create a graph of schema relationships.
*/
@@ -402,12 +402,12 @@ struct _xmlSchemaBucket {
int parsed;
int imported;
int preserveDoc;
- xmlSchemaItemListPtr globals; /* Global components. */
+ xmlSchemaItemListPtr globals; /* Global components. */
xmlSchemaItemListPtr locals; /* Local components. */
};
/**
- * xmlSchemaImport:
+ * xmlSchemaImport:
* (extends xmlSchemaBucket)
*
* Reflects a schema. Holds some information
@@ -422,9 +422,9 @@ struct _xmlSchemaImport {
const xmlChar *schemaLocation; /* The URI of the schema document. */
/* For chameleon includes, @origTargetNamespace will be NULL */
const xmlChar *origTargetNamespace;
- /*
+ /*
* For chameleon includes, @targetNamespace will be the
- * targetNamespace of the including schema.
+ * targetNamespace of the including schema.
*/
const xmlChar *targetNamespace;
xmlDocPtr doc; /* The schema node-tree. */
@@ -457,7 +457,7 @@ struct _xmlSchemaInclude {
int parsed;
int imported;
int preserveDoc;
- xmlSchemaItemListPtr globals; /* Global components. */
+ xmlSchemaItemListPtr globals; /* Global components. */
xmlSchemaItemListPtr locals; /* Local components. */
/* The owning main or import schema bucket. */
@@ -517,7 +517,7 @@ struct _xmlSchemaAttributeUse {
xmlSchemaTypeType type;
xmlSchemaAnnotPtr annot;
xmlSchemaAttributeUsePtr next; /* The next attr. use. */
- /*
+ /*
* The attr. decl. OR a QName-ref. to an attr. decl. OR
* a QName-ref. to an attribute group definition.
*/
@@ -573,7 +573,7 @@ struct _xmlSchemaConstructionCtxt {
xmlDictPtr dict;
xmlSchemaItemListPtr buckets; /* List of schema buckets. */
/* xmlSchemaItemListPtr relations; */ /* List of schema relations. */
- xmlSchemaBucketPtr bucket; /* The current schema bucket */
+ xmlSchemaBucketPtr bucket; /* The current schema bucket */
xmlSchemaItemListPtr pending; /* All Components of all schemas that
need to be fixed. */
xmlHashTablePtr substGroups;
@@ -629,7 +629,7 @@ struct _xmlSchemaParserCtxt {
xmlSchemaBucketPtr redefined; /* The schema to be redefined. */
xmlSchemaRedefPtr redef; /* Used for redefinitions. */
- int redefCounter; /* Used for redefinitions. */
+ int redefCounter; /* Used for redefinitions. */
xmlSchemaItemListPtr attrProhibs;
};
@@ -783,7 +783,7 @@ struct _xmlSchemaPSVIIDCNode {
xmlNodePtr node;
xmlSchemaPSVIIDCKeyPtr *keys;
int nodeLine;
- int nodeQNameID;
+ int nodeQNameID;
};
@@ -879,7 +879,7 @@ struct _xmlSchemaIDCMatcher {
struct _xmlSchemaNodeInfo {
int nodeType;
xmlNodePtr node;
- int nodeLine;
+ int nodeLine;
const xmlChar *localName;
const xmlChar *nsName;
const xmlChar *value;
@@ -901,7 +901,7 @@ struct _xmlSchemaNodeInfo {
const xmlChar **nsBindings; /* Namespace bindings on this element */
int nbNsBindings;
- int sizeNsBindings;
+ int sizeNsBindings;
int hasKeyrefs;
int appliedXPath; /* Indicates that an XPath has been applied. */
@@ -938,7 +938,7 @@ typedef xmlSchemaAttrInfo *xmlSchemaAttrInfoPtr;
struct _xmlSchemaAttrInfo {
int nodeType;
xmlNodePtr node;
- int nodeLine;
+ int nodeLine;
const xmlChar *localName;
const xmlChar *nsName;
const xmlChar *value;
@@ -1172,7 +1172,7 @@ xmlSchemaGetComponentTypeStr(xmlSchemaBasicItemPtr item)
if (WXS_IS_COMPLEX(WXS_TYPE_CAST item))
return(BAD_CAST "complex type definition");
else
- return(BAD_CAST "simple type definition");
+ return(BAD_CAST "simple type definition");
default:
return(xmlSchemaItemTypeToStr(item->type));
}
@@ -1300,11 +1300,11 @@ xmlSchemaFormatQName(xmlChar **buf,
*buf = xmlStrcat(*buf, localName);
} else {
*buf = xmlStrcat(*buf, BAD_CAST "(NULL)");
- }
+ }
return ((const xmlChar *) *buf);
}
-static const xmlChar*
+static const xmlChar*
xmlSchemaFormatQNameNs(xmlChar **buf, xmlNsPtr ns, const xmlChar *localName)
{
if (ns != NULL)
@@ -1480,16 +1480,16 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
int list;
xmlSchemaValType valType;
const xmlChar *value, *value2 = NULL;
-
+
if ((retValue == NULL) || (val == NULL))
return (-1);
list = xmlSchemaValueGetNext(val) ? 1 : 0;
*retValue = NULL;
do {
- value = NULL;
- valType = xmlSchemaGetValType(val);
- switch (valType) {
+ value = NULL;
+ valType = xmlSchemaGetValType(val);
+ switch (valType) {
case XML_SCHEMAS_STRING:
case XML_SCHEMAS_NORMSTRING:
case XML_SCHEMAS_ANYSIMPLETYPE:
@@ -1502,7 +1502,7 @@ xmlSchemaGetCanonValueWhtspExt(xmlSchemaValPtr val,
if (value2 != NULL)
value = value2;
}
- break;
+ break;
default:
if (xmlSchemaGetCanonValue(val, &value2) == -1) {
if (value2 != NULL)
@@ -1540,29 +1540,29 @@ internal_error:
* @buf: the string buffer
* @itemDes: the designation of the item
* @itemName: the name of the item
- * @item: the item as an object
+ * @item: the item as an object
* @itemNode: the node of the item
* @local: the local name
* @parsing: if the function is used during the parse
*
* Returns a representation of the given item used
- * for error reports.
+ * for error reports.
*
- * The following order is used to build the resulting
+ * The following order is used to build the resulting
* designation if the arguments are not NULL:
* 1a. If itemDes not NULL -> itemDes
* 1b. If (itemDes not NULL) and (itemName not NULL)
* -> itemDes + itemName
* 2. If the preceding was NULL and (item not NULL) -> item
* 3. If the preceding was NULL and (itemNode not NULL) -> itemNode
- *
+ *
* If the itemNode is an attribute node, the name of the attribute
* will be appended to the result.
*
* Returns the formatted string and sets @buf to the resulting value.
- */
-static xmlChar*
-xmlSchemaFormatItemForReport(xmlChar **buf,
+ */
+static xmlChar*
+xmlSchemaFormatItemForReport(xmlChar **buf,
const xmlChar *itemDes,
xmlSchemaBasicItemPtr item,
xmlNodePtr itemNode)
@@ -1574,9 +1574,9 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
xmlFree(*buf);
*buf = NULL;
}
-
+
if (itemDes != NULL) {
- *buf = xmlStrdup(itemDes);
+ *buf = xmlStrdup(itemDes);
} else if (item != NULL) {
switch (item->type) {
case XML_SCHEMA_TYPE_BASIC: {
@@ -1634,7 +1634,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
break;
case XML_SCHEMA_TYPE_ATTRIBUTE_USE: {
xmlSchemaAttributeUsePtr ause;
-
+
ause = WXS_ATTR_USE_CAST item;
*buf = xmlStrdup(BAD_CAST "attribute use ");
if (WXS_ATTRUSE_DECL(ause) != NULL) {
@@ -1650,7 +1650,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
break;
case XML_SCHEMA_TYPE_ATTRIBUTE: {
xmlSchemaAttributePtr attr;
-
+
attr = (xmlSchemaAttributePtr) item;
*buf = xmlStrdup(BAD_CAST "attribute decl.");
*buf = xmlStrcat(*buf, BAD_CAST " '");
@@ -1666,7 +1666,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
case XML_SCHEMA_TYPE_ELEMENT: {
xmlSchemaElementPtr elem;
- elem = (xmlSchemaElementPtr) item;
+ elem = (xmlSchemaElementPtr) item;
*buf = xmlStrdup(BAD_CAST "element decl.");
*buf = xmlStrcat(*buf, BAD_CAST " '");
*buf = xmlStrcat(*buf, xmlSchemaFormatQName(&str,
@@ -1676,7 +1676,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
break;
case XML_SCHEMA_TYPE_IDC_UNIQUE:
case XML_SCHEMA_TYPE_IDC_KEY:
- case XML_SCHEMA_TYPE_IDC_KEYREF:
+ case XML_SCHEMA_TYPE_IDC_KEYREF:
if (item->type == XML_SCHEMA_TYPE_IDC_UNIQUE)
*buf = xmlStrdup(BAD_CAST "unique '");
else if (item->type == XML_SCHEMA_TYPE_IDC_KEY)
@@ -1732,7 +1732,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
default:
named = 0;
}
- } else
+ } else
named = 0;
if ((named == 0) && (itemNode != NULL)) {
@@ -1740,7 +1740,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
if (itemNode->type == XML_ATTRIBUTE_NODE)
elem = itemNode->parent;
- else
+ else
elem = itemNode;
*buf = xmlStrdup(BAD_CAST "Element '");
if (elem->ns != NULL) {
@@ -1750,7 +1750,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
} else
*buf = xmlStrcat(*buf, elem->name);
*buf = xmlStrcat(*buf, BAD_CAST "'");
-
+
}
if ((itemNode != NULL) && (itemNode->type == XML_ATTRIBUTE_NODE)) {
*buf = xmlStrcat(*buf, BAD_CAST ", attribute '");
@@ -1763,7 +1763,7 @@ xmlSchemaFormatItemForReport(xmlChar **buf,
*buf = xmlStrcat(*buf, BAD_CAST "'");
}
FREE_AND_NULL(str)
-
+
return (*buf);
}
@@ -1786,13 +1786,13 @@ xmlSchemaFormatFacetEnumSet(xmlSchemaAbstractCtxtPtr actxt,
int res, found = 0;
if (*buf != NULL)
- xmlFree(*buf);
+ xmlFree(*buf);
*buf = NULL;
do {
/*
* Use the whitespace type of the base type.
- */
+ */
ws = xmlSchemaGetWhiteSpaceFacetValue(type->baseType);
for (facet = type->facets; facet != NULL; facet = facet->next) {
if (facet->type != XML_SCHEMA_FACET_ENUMERATION)
@@ -1881,7 +1881,7 @@ xmlSchemaPErrMemory(xmlSchemaParserCtxtPtr ctxt,
* @msg: the error message
* @str1: extra data
* @str2: extra data
- *
+ *
* Handle a parser error
*/
static void
@@ -1914,7 +1914,7 @@ xmlSchemaPErr(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
* @msg: the error message
* @str1: extra data
* @str2: extra data
- *
+ *
* Handle a parser error
*/
static void
@@ -1933,7 +1933,7 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
* xmlSchemaPErrExt:
* @ctxt: the parsing context
* @node: the context node
- * @error: the error code
+ * @error: the error code
* @strData1: extra data
* @strData2: extra data
* @strData3: extra data
@@ -1943,13 +1943,13 @@ xmlSchemaPErr2(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node,
* @str3: extra parameter for the message display
* @str4: extra parameter for the message display
* @str5: extra parameter for the message display
- *
+ *
* Handle a parser error
*/
static void
xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
- const xmlChar * strData1, const xmlChar * strData2,
- const xmlChar * strData3, const char *msg, const xmlChar * str1,
+ const xmlChar * strData1, const xmlChar * strData2,
+ const xmlChar * strData3, const char *msg, const xmlChar * str1,
const xmlChar * str2, const xmlChar * str3, const xmlChar * str4,
const xmlChar * str5)
{
@@ -1967,8 +1967,8 @@ xmlSchemaPErrExt(xmlSchemaParserCtxtPtr ctxt, xmlNodePtr node, int error,
}
__xmlRaiseError(schannel, channel, data, ctxt, node, XML_FROM_SCHEMASP,
error, XML_ERR_ERROR, NULL, 0,
- (const char *) strData1, (const char *) strData2,
- (const char *) strData3, 0, 0, msg, str1, str2,
+ (const char *) strData1, (const char *) strData2,
+ (const char *) strData3, 0, 0, msg, str1, str2,
str3, str4, str5);
}
@@ -2016,7 +2016,7 @@ xmlSchemaPSimpleInternalErr(xmlNodePtr node,
* @str1: extra data
* @str2: extra data
* @str3: extra data
- *
+ *
* Handle a validation error
*/
static void
@@ -2028,8 +2028,8 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
{
xmlStructuredErrorFunc schannel = NULL;
xmlGenericErrorFunc channel = NULL;
- void *data = NULL;
-
+ void *data = NULL;
+
if (ctxt != NULL) {
if (ctxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctxt;
@@ -2037,7 +2037,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
if (errorLevel != XML_ERR_WARNING) {
vctxt->nberrors++;
vctxt->err = error;
- channel = vctxt->error;
+ channel = vctxt->error;
} else {
channel = vctxt->warning;
}
@@ -2077,7 +2077,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
else if ((vctxt->parserCtxt != NULL) &&
(vctxt->parserCtxt->input != NULL))
file = vctxt->parserCtxt->input->filename;
- }
+ }
__xmlRaiseError(schannel, channel, data, ctxt,
node, XML_FROM_SCHEMASV,
error, errorLevel, file, line,
@@ -2089,7 +2089,7 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
if (errorLevel != XML_ERR_WARNING) {
pctxt->nberrors++;
pctxt->err = error;
- channel = pctxt->error;
+ channel = pctxt->error;
} else {
channel = pctxt->warning;
}
@@ -2115,11 +2115,11 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
* @str1: extra data
* @str2: extra data
* @str3: extra data
- *
+ *
* Handle a validation error
*/
static void
-xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
+xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
int error, xmlNodePtr node, const char *msg,
const xmlChar *str1, const xmlChar *str2, const xmlChar *str3)
{
@@ -2128,7 +2128,7 @@ xmlSchemaErr3(xmlSchemaAbstractCtxtPtr actxt,
}
static void
-xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
+xmlSchemaErr4(xmlSchemaAbstractCtxtPtr actxt,
int error, xmlNodePtr node, const char *msg,
const xmlChar *str1, const xmlChar *str2,
const xmlChar *str3, const xmlChar *str4)
@@ -2157,7 +2157,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
(node->type != XML_ELEMENT_NODE) &&
(node->type != XML_ATTRIBUTE_NODE))
{
- /*
+ /*
* Don't try to format other nodes than element and
* attribute nodes.
* Play save and return an empty string.
@@ -2171,7 +2171,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
*/
if (node->type == XML_ATTRIBUTE_NODE) {
xmlNodePtr elem = node->parent;
-
+
*msg = xmlStrdup(BAD_CAST "Element '");
if (elem->ns != NULL)
*msg = xmlStrcat(*msg, xmlSchemaFormatQName(&str,
@@ -2181,7 +2181,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
NULL, elem->name));
FREE_AND_NULL(str);
*msg = xmlStrcat(*msg, BAD_CAST "', ");
- *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
+ *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
} else {
*msg = xmlStrdup(BAD_CAST "Element '");
}
@@ -2197,7 +2197,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) actxt;
/*
* Work on node infos.
- */
+ */
if (vctxt->inode->nodeType == XML_ATTRIBUTE_NODE) {
xmlSchemaNodeInfoPtr ielem =
vctxt->elemInfos[vctxt->depth];
@@ -2207,7 +2207,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
ielem->nsName, ielem->localName));
FREE_AND_NULL(str);
*msg = xmlStrcat(*msg, BAD_CAST "', ");
- *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
+ *msg = xmlStrcat(*msg, BAD_CAST "attribute '");
} else {
*msg = xmlStrdup(BAD_CAST "Element '");
}
@@ -2216,7 +2216,7 @@ xmlSchemaFormatNodeForError(xmlChar ** msg,
FREE_AND_NULL(str);
*msg = xmlStrcat(*msg, BAD_CAST "': ");
} else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
- /*
+ /*
* Hmm, no node while parsing?
* Return an empty string, in case NULL will break something.
*/
@@ -2254,7 +2254,7 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
return;
msg = xmlStrdup(BAD_CAST "Internal error: ");
msg = xmlStrcat(msg, BAD_CAST funcName);
- msg = xmlStrcat(msg, BAD_CAST ", ");
+ msg = xmlStrcat(msg, BAD_CAST ", ");
msg = xmlStrcat(msg, BAD_CAST message);
msg = xmlStrcat(msg, BAD_CAST ".\n");
@@ -2262,7 +2262,7 @@ xmlSchemaInternalErr2(xmlSchemaAbstractCtxtPtr actxt,
xmlSchemaErr(actxt, XML_SCHEMAV_INTERNAL, NULL,
(const char *) msg, str1, str2);
- else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
+ else if (actxt->type == XML_SCHEMA_CTXT_PARSER)
xmlSchemaErr(actxt, XML_SCHEMAP_INTERNAL, NULL,
(const char *) msg, str1, str2);
@@ -2309,7 +2309,7 @@ xmlSchemaCustomErr4(xmlSchemaAbstractCtxtPtr actxt,
} else
xmlSchemaFormatNodeForError(&msg, actxt, node);
msg = xmlStrcat(msg, (const xmlChar *) message);
- msg = xmlStrcat(msg, BAD_CAST ".\n");
+ msg = xmlStrcat(msg, BAD_CAST ".\n");
xmlSchemaErr4(actxt, error, node,
(const char *) msg, str1, str2, str3, str4);
FREE_AND_NULL(msg)
@@ -2325,7 +2325,7 @@ xmlSchemaCustomErr(xmlSchemaAbstractCtxtPtr actxt,
const xmlChar *str2)
{
xmlSchemaCustomErr4(actxt, error, node, item,
- message, str1, str2, NULL, NULL);
+ message, str1, str2, NULL, NULL);
}
@@ -2344,8 +2344,8 @@ xmlSchemaCustomWarning(xmlSchemaAbstractCtxtPtr actxt,
xmlSchemaFormatNodeForError(&msg, actxt, node);
msg = xmlStrcat(msg, (const xmlChar *) message);
- msg = xmlStrcat(msg, BAD_CAST ".\n");
-
+ msg = xmlStrcat(msg, BAD_CAST ".\n");
+
/* URGENT TODO: Set the error code to something sane. */
xmlSchemaErr4Line(actxt, XML_ERR_WARNING, error, node, 0,
(const char *) msg, str1, str2, str3, NULL);
@@ -2365,15 +2365,15 @@ xmlSchemaKeyrefErr(xmlSchemaValidCtxtPtr vctxt,
const xmlChar *str2)
{
xmlChar *msg = NULL, *qname = NULL;
-
- msg = xmlStrdup(BAD_CAST "Element '%s': ");
+
+ msg = xmlStrdup(BAD_CAST "Element '%s': ");
msg = xmlStrcat(msg, (const xmlChar *) message);
msg = xmlStrcat(msg, BAD_CAST ".\n");
xmlSchemaErr4Line(ACTXT_CAST vctxt, XML_ERR_ERROR,
error, NULL, idcNode->nodeLine, (const char *) msg,
xmlSchemaFormatQName(&qname,
vctxt->nodeQNames->items[idcNode->nodeQNameID +1],
- vctxt->nodeQNames->items[idcNode->nodeQNameID]),
+ vctxt->nodeQNames->items[idcNode->nodeQNameID]),
str1, str2, NULL);
FREE_AND_NULL(qname);
FREE_AND_NULL(msg);
@@ -2456,7 +2456,7 @@ xmlSchemaSimpleTypeErr(xmlSchemaAbstractCtxtPtr actxt,
if (type->builtInType != 0) {
msg = xmlStrcat(msg, BAD_CAST "xs:");
msg = xmlStrcat(msg, type->name);
- } else
+ } else
msg = xmlStrcat(msg,
xmlSchemaFormatQName(&str,
type->targetNamespace, type->name));
@@ -2494,12 +2494,12 @@ xmlSchemaIllegalAttrErr(xmlSchemaAbstractCtxtPtr actxt,
xmlNodePtr node)
{
xmlChar *msg = NULL, *str = NULL;
-
+
xmlSchemaFormatNodeForError(&msg, actxt, node);
msg = xmlStrcat(msg, BAD_CAST "The attribute '%s' is not allowed.\n");
xmlSchemaErr(actxt, error, node, (const char *) msg,
xmlSchemaFormatErrorNodeQName(&str, (xmlSchemaNodeInfoPtr) ni, node),
- NULL);
+ NULL);
FREE_AND_NULL(str)
FREE_AND_NULL(msg)
}
@@ -2518,7 +2518,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
xmlChar *localName, *nsName;
const xmlChar *cur, *end;
int i;
-
+
xmlSchemaFormatNodeForError(&msg, actxt, node);
msg = xmlStrcat(msg, (const xmlChar *) message);
msg = xmlStrcat(msg, BAD_CAST ".");
@@ -2533,7 +2533,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
} else
str = xmlStrdup(BAD_CAST " Expected is ( ");
nsName = NULL;
-
+
for (i = 0; i < nbval + nbneg; i++) {
cur = values[i];
if (cur == NULL)
@@ -2547,7 +2547,7 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
* Get the local name.
*/
localName = NULL;
-
+
end = cur;
if (*end == '*') {
localName = xmlStrdup(BAD_CAST "*");
@@ -2556,8 +2556,8 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
while ((*end != 0) && (*end != '|'))
end++;
localName = xmlStrncat(localName, BAD_CAST cur, end - cur);
- }
- if (*end != 0) {
+ }
+ if (*end != 0) {
end++;
/*
* Skip "*|*" if they come with negated expressions, since
@@ -2573,12 +2573,12 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
} else {
while (*end != 0)
end++;
-
+
if (i >= nbval)
nsName = xmlStrdup(BAD_CAST "{##other:");
else
nsName = xmlStrdup(BAD_CAST "{");
-
+
nsName = xmlStrncat(nsName, BAD_CAST cur, end - cur);
nsName = xmlStrcat(nsName, BAD_CAST "}");
}
@@ -2588,13 +2588,13 @@ xmlSchemaComplexTypeErr(xmlSchemaAbstractCtxtPtr actxt,
FREE_AND_NULL(localName);
continue;
}
- }
+ }
str = xmlStrcat(str, BAD_CAST localName);
FREE_AND_NULL(localName);
-
+
if (i < nbval + nbneg -1)
str = xmlStrcat(str, BAD_CAST ", ");
- }
+ }
str = xmlStrcat(str, BAD_CAST " ).\n");
msg = xmlStrcat(msg, BAD_CAST str);
FREE_AND_NULL(str)
@@ -2626,8 +2626,8 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
/*
* If enumerations are validated, one must not expect the
* facet to be given.
- */
- } else
+ */
+ } else
facetType = facet->type;
msg = xmlStrcat(msg, BAD_CAST "[");
msg = xmlStrcat(msg, BAD_CAST "facet '");
@@ -2655,31 +2655,31 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
snprintf(actLen, 24, "%lu", length);
if (facetType == XML_SCHEMA_FACET_LENGTH)
- msg = xmlStrcat(msg,
- BAD_CAST "this differs from the allowed length of '%s'.\n");
+ msg = xmlStrcat(msg,
+ BAD_CAST "this differs from the allowed length of '%s'.\n");
else if (facetType == XML_SCHEMA_FACET_MAXLENGTH)
- msg = xmlStrcat(msg,
+ msg = xmlStrcat(msg,
BAD_CAST "this exceeds the allowed maximum length of '%s'.\n");
else if (facetType == XML_SCHEMA_FACET_MINLENGTH)
- msg = xmlStrcat(msg,
+ msg = xmlStrcat(msg,
BAD_CAST "this underruns the allowed minimum length of '%s'.\n");
-
+
if (nodeType == XML_ATTRIBUTE_NODE)
xmlSchemaErr3(actxt, error, node, (const char *) msg,
value, (const xmlChar *) actLen, (const xmlChar *) len);
- else
+ else
xmlSchemaErr(actxt, error, node, (const char *) msg,
(const xmlChar *) actLen, (const xmlChar *) len);
-
+
} else if (facetType == XML_SCHEMA_FACET_ENUMERATION) {
msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not an element "
"of the set {%s}.\n");
- xmlSchemaErr(actxt, error, node, (const char *) msg, value,
+ xmlSchemaErr(actxt, error, node, (const char *) msg, value,
xmlSchemaFormatFacetEnumSet(actxt, &str, type));
} else if (facetType == XML_SCHEMA_FACET_PATTERN) {
msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not accepted "
"by the pattern '%s'.\n");
- xmlSchemaErr(actxt, error, node, (const char *) msg, value,
+ xmlSchemaErr(actxt, error, node, (const char *) msg, value,
facet->value);
} else if (facetType == XML_SCHEMA_FACET_MININCLUSIVE) {
msg = xmlStrcat(msg, BAD_CAST "The value '%s' is less than the "
@@ -2711,10 +2711,10 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
"digits than are allowed ('%s').\n");
xmlSchemaErr(actxt, error, node, (const char*) msg, value,
facet->value);
- } else if (nodeType == XML_ATTRIBUTE_NODE) {
+ } else if (nodeType == XML_ATTRIBUTE_NODE) {
msg = xmlStrcat(msg, BAD_CAST "The value '%s' is not facet-valid.\n");
- xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL);
- } else {
+ xmlSchemaErr(actxt, error, node, (const char *) msg, value, NULL);
+ } else {
msg = xmlStrcat(msg, BAD_CAST "The value is not facet-valid.\n");
xmlSchemaErr(actxt, error, node, (const char *) msg, NULL, NULL);
}
@@ -2722,7 +2722,7 @@ xmlSchemaFacetErr(xmlSchemaAbstractCtxtPtr actxt,
msg = xmlStrcat(msg, (const xmlChar *) message);
msg = xmlStrcat(msg, BAD_CAST ".\n");
xmlSchemaErr(actxt, error, node, (const char *) msg, str1, str2);
- }
+ }
FREE_AND_NULL(str)
xmlFree(msg);
}
@@ -2967,9 +2967,9 @@ xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
const xmlChar *str3,const xmlChar *str4)
{
xmlChar *str = NULL, *msg = NULL;
-
+
xmlSchemaFormatItemForReport(&msg, NULL, ownerItem, NULL);
- msg = xmlStrcat(msg, BAD_CAST ", ");
+ msg = xmlStrcat(msg, BAD_CAST ", ");
msg = xmlStrcat(msg,
BAD_CAST xmlSchemaFormatItemForReport(&str, NULL,
WXS_BASIC_CAST attruse, NULL));
@@ -2977,7 +2977,7 @@ xmlSchemaPAttrUseErr4(xmlSchemaParserCtxtPtr ctxt,
msg = xmlStrcat(msg, BAD_CAST ": ");
msg = xmlStrcat(msg, (const xmlChar *) message);
msg = xmlStrcat(msg, BAD_CAST ".\n");
- xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
+ xmlSchemaErr4(ACTXT_CAST ctxt, error, node,
(const char *) msg, str1, str2, str3, str4);
xmlFree(msg);
}
@@ -3071,7 +3071,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
* @error: the error code
* @type: the type specifier
* @ownerDes: the designation of the owner
- * @ownerItem: the schema object if existent
+ * @ownerItem: the schema object if existent
* @node: the validated node
* @value: the validated value
*
@@ -3079,7 +3079,7 @@ xmlSchemaPMutualExclAttrErr(xmlSchemaParserCtxtPtr ctxt,
* TODO: Should this report the value of an element as well?
*/
static void
-xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
+xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
xmlParserErrors error,
xmlSchemaBasicItemPtr ownerItem ATTRIBUTE_UNUSED,
xmlNodePtr node,
@@ -3091,37 +3091,37 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
const xmlChar *str2)
{
xmlChar *msg = NULL;
-
+
xmlSchemaFormatNodeForError(&msg, ACTXT_CAST ctxt, node);
if (message == NULL) {
/*
* Use default messages.
- */
+ */
if (type != NULL) {
if (node->type == XML_ATTRIBUTE_NODE)
msg = xmlStrcat(msg, BAD_CAST "'%s' is not a valid value of ");
else
msg = xmlStrcat(msg, BAD_CAST "The character content is not a "
- "valid value of ");
+ "valid value of ");
if (! xmlSchemaIsGlobalItem(type))
msg = xmlStrcat(msg, BAD_CAST "the local ");
else
msg = xmlStrcat(msg, BAD_CAST "the ");
-
+
if (WXS_IS_ATOMIC(type))
msg = xmlStrcat(msg, BAD_CAST "atomic type");
else if (WXS_IS_LIST(type))
msg = xmlStrcat(msg, BAD_CAST "list type");
else if (WXS_IS_UNION(type))
msg = xmlStrcat(msg, BAD_CAST "union type");
-
+
if (xmlSchemaIsGlobalItem(type)) {
xmlChar *str = NULL;
msg = xmlStrcat(msg, BAD_CAST " '");
if (type->builtInType != 0) {
msg = xmlStrcat(msg, BAD_CAST "xs:");
msg = xmlStrcat(msg, type->name);
- } else
+ } else
msg = xmlStrcat(msg,
xmlSchemaFormatQName(&str,
type->targetNamespace, type->name));
@@ -3134,7 +3134,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
else
msg = xmlStrcat(msg, BAD_CAST "The character content is not "
"valid.");
- }
+ }
if (expected) {
msg = xmlStrcat(msg, BAD_CAST " Expected is '");
msg = xmlStrcat(msg, BAD_CAST expected);
@@ -3151,7 +3151,7 @@ xmlSchemaPSimpleTypeErr(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaPErrExt(ctxt, node, error, NULL, NULL, NULL,
(const char*) msg, str1, str2, NULL, NULL, NULL);
}
- /* Cleanup. */
+ /* Cleanup. */
FREE_AND_NULL(msg)
}
@@ -3372,7 +3372,7 @@ xmlSchemaItemListAddSize(xmlSchemaItemListPtr list,
static int
xmlSchemaItemListInsert(xmlSchemaItemListPtr list, void *item, int idx)
-{
+{
if (list->items == NULL) {
list->items = (void **) xmlMalloc(
20 * sizeof(void *));
@@ -3412,7 +3412,7 @@ xmlSchemaItemListInsertSize(xmlSchemaItemListPtr list,
int initialSize,
void *item,
int idx)
-{
+{
if (list->items == NULL) {
if (initialSize <= 0)
initialSize = 1;
@@ -3467,7 +3467,7 @@ xmlSchemaItemListRemove(xmlSchemaItemListPtr list, int idx)
list->sizeItems = 0;
} else if (list->nbItems -1 == idx) {
list->nbItems--;
- } else {
+ } else {
for (i = idx; i < list->nbItems -1; i++)
list->items[i] = list->items[i+1];
list->nbItems--;
@@ -3502,19 +3502,19 @@ xmlSchemaBucketFree(xmlSchemaBucketPtr bucket)
}
if (bucket->locals != NULL) {
xmlSchemaComponentListFree(bucket->locals);
- xmlSchemaItemListFree(bucket->locals);
+ xmlSchemaItemListFree(bucket->locals);
}
if (bucket->relations != NULL) {
xmlSchemaSchemaRelationPtr prev, cur = bucket->relations;
do {
- prev = cur;
+ prev = cur;
cur = cur->next;
xmlFree(prev);
} while (cur != NULL);
}
if ((! bucket->preserveDoc) && (bucket->doc != NULL)) {
xmlFreeDoc(bucket->doc);
- }
+ }
if (bucket->type == XML_SCHEMA_SCHEMA_IMPORT) {
if (WXS_IMPBUCKET(bucket)->schema != NULL)
xmlSchemaFree(WXS_IMPBUCKET(bucket)->schema);
@@ -3559,7 +3559,7 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
xmlFree(ret);
return(NULL);
}
- /*
+ /*
* The following will assure that only the first bucket is marked as
* XML_SCHEMA_SCHEMA_MAIN and it points to the *main* schema.
* For each following import buckets an xmlSchema will be created.
@@ -3573,7 +3573,7 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaBucketFree(ret);
return(NULL);
}
- /* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */
+ /* Force the type to be XML_SCHEMA_SCHEMA_MAIN. */
ret->type = XML_SCHEMA_SCHEMA_MAIN;
/* Point to the *main* schema. */
WXS_CONSTRUCTOR(pctxt)->mainBucket = ret;
@@ -3583,12 +3583,12 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
*/
mainSchema->targetNamespace = targetNamespace;
} else {
- if (type == XML_SCHEMA_SCHEMA_MAIN) {
+ if (type == XML_SCHEMA_SCHEMA_MAIN) {
PERROR_INT("xmlSchemaBucketCreate",
"main bucket but it's not the first one");
xmlSchemaBucketFree(ret);
return(NULL);
- } else if (type == XML_SCHEMA_SCHEMA_IMPORT) {
+ } else if (type == XML_SCHEMA_SCHEMA_IMPORT) {
/*
* Create a schema for imports and assign the
* targetNamespace.
@@ -3600,7 +3600,7 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
}
WXS_IMPBUCKET(ret)->schema->targetNamespace = targetNamespace;
}
- }
+ }
if (WXS_IS_BUCKET_IMPMAIN(type)) {
int res;
/*
@@ -3643,11 +3643,11 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
if (mainSchema->includes == NULL) {
xmlSchemaBucketFree(ret);
return(NULL);
- }
+ }
}
xmlSchemaItemListAdd(mainSchema->includes, ret);
}
- /*
+ /*
* Add to list of all buckets; this is used for lookup
* during schema construction time only.
*/
@@ -4015,7 +4015,7 @@ xmlSchemaComponentListFree(xmlSchemaItemListPtr list)
for (i = 0; i < list->nbItems; i++) {
item = items[i];
if (item == NULL)
- continue;
+ continue;
switch (item->type) {
case XML_SCHEMA_TYPE_SIMPLE:
case XML_SCHEMA_TYPE_COMPLEX:
@@ -4122,7 +4122,7 @@ xmlSchemaFree(xmlSchemaPtr schema)
xmlSchemaItemListPtr list = (xmlSchemaItemListPtr) schema->includes;
int i;
for (i = 0; i < list->nbItems; i++) {
- xmlSchemaBucketFree((xmlSchemaBucketPtr) list->items[i]);
+ xmlSchemaBucketFree((xmlSchemaBucketPtr) list->items[i]);
}
xmlSchemaItemListFree(list);
}
@@ -4330,7 +4330,7 @@ xmlSchemaContentModelDump(xmlSchemaParticlePtr particle, FILE * output, int dept
/**
* xmlSchemaAttrUsesDump:
* @uses: attribute uses list
- * @output: the file output
+ * @output: the file output
*
* Dumps a list of attribute use components.
*/
@@ -4347,7 +4347,7 @@ xmlSchemaAttrUsesDump(xmlSchemaItemListPtr uses, FILE * output)
if ((uses == NULL) || (uses->nbItems == 0))
return;
- fprintf(output, " attributes:\n");
+ fprintf(output, " attributes:\n");
for (i = 0; i < uses->nbItems; i++) {
use = uses->items[i];
if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
@@ -4533,7 +4533,7 @@ xmlSchemaDebugDumpIDCTable(FILE * output,
return;
do {
fprintf(output, "IDC: BINDING '%s' (%d)\n",
- xmlSchemaGetComponentQName(&str,
+ xmlSchemaGetComponentQName(&str,
bind->definition), bind->nbNodes);
FREE_AND_NULL(str)
for (i = 0; i < bind->nbNodes; i++) {
@@ -4634,7 +4634,7 @@ xmlSchemaGetPropNodeNs(xmlNodePtr node, const char *uri, const char *name)
xmlAttrPtr prop;
if ((node == NULL) || (name == NULL))
- return(NULL);
+ return(NULL);
prop = node->properties;
while (prop != NULL) {
if ((prop->ns != NULL) &&
@@ -4729,12 +4729,12 @@ xmlSchemaGetElem(xmlSchemaPtr schema, const xmlChar * name,
const xmlChar * nsName)
{
xmlSchemaElementPtr ret = NULL;
-
+
if ((name == NULL) || (schema == NULL))
return(NULL);
if (schema != NULL) {
WXS_FIND_GLOBAL_ITEM(elemDecl)
- }
+ }
exit:
#ifdef DEBUG
if (ret == NULL) {
@@ -4765,9 +4765,9 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name,
xmlSchemaTypePtr ret = NULL;
if (name == NULL)
- return (NULL);
+ return (NULL);
/* First try the built-in types. */
- if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) {
+ if ((nsName != NULL) && xmlStrEqual(nsName, xmlSchemaNs)) {
ret = xmlSchemaGetPredefinedType(name, nsName);
if (ret != NULL)
goto exit;
@@ -4780,7 +4780,7 @@ xmlSchemaGetType(xmlSchemaPtr schema, const xmlChar * name,
}
if (schema != NULL) {
WXS_FIND_GLOBAL_ITEM(typeDecl)
- }
+ }
exit:
#ifdef DEBUG
@@ -4891,7 +4891,7 @@ xmlSchemaGetGroup(xmlSchemaPtr schema, const xmlChar * name,
WXS_FIND_GLOBAL_ITEM(groupDecl)
}
exit:
-
+
#ifdef DEBUG
if (ret == NULL) {
if (nsName == NULL)
@@ -5000,7 +5000,7 @@ xmlSchemaIsBlank(xmlChar * str, int len)
str++;
len--;
}
-
+
return (1);
}
@@ -5061,7 +5061,7 @@ xmlSchemaFindRedefCompInGraph(xmlSchemaBucketPtr bucket,
default:
/* Should not be hit. */
return(NULL);
- }
+ }
}
}
subschemas:
@@ -5209,7 +5209,7 @@ xmlSchemaAddAttributeUse(xmlSchemaParserCtxtPtr pctxt,
* resolve references to the redefined components and to check constraints.
*/
static xmlSchemaRedefPtr
-xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt,
+xmlSchemaAddRedef(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaBucketPtr targetBucket,
void *item,
const xmlChar *refName,
@@ -5272,7 +5272,7 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
ret->type = XML_SCHEMA_TYPE_ATTRIBUTEGROUP;
ret->name = name;
ret->targetNamespace = nsName;
- ret->node = node;
+ ret->node = node;
/* TODO: Remove the flag. */
ret->flags |= XML_SCHEMAS_ATTRGROUP_GLOBAL;
@@ -5282,7 +5282,7 @@ xmlSchemaAddAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
if (pctxt->redef == NULL) {
xmlFree(ret);
return(NULL);
- }
+ }
pctxt->redefCounter = 0;
}
WXS_ADD_GLOBAL(pctxt, ret);
@@ -5371,13 +5371,13 @@ xmlSchemaAddType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
if (ctxt->redef == NULL) {
xmlFree(ret);
return(NULL);
- }
+ }
ctxt->redefCounter = 0;
}
WXS_ADD_GLOBAL(ctxt, ret);
} else
WXS_ADD_LOCAL(ctxt, ret);
- WXS_ADD_PENDING(ctxt, ret);
+ WXS_ADD_PENDING(ctxt, ret);
return (ret);
}
@@ -5509,7 +5509,7 @@ xmlSchemaAddParticle(xmlSchemaParserCtxtPtr ctxt,
ret->children = NULL;
WXS_ADD_LOCAL(ctxt, ret);
- /*
+ /*
* Note that addition to pending components will be done locally
* to the specific parsing function, since the most particles
* need not to be fixed up (i.e. the reference to be resolved).
@@ -5558,7 +5558,7 @@ xmlSchemaAddModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
if (ctxt->redef == NULL) {
xmlFree(ret);
return(NULL);
- }
+ }
ctxt->redefCounter = 0;
}
WXS_ADD_GLOBAL(ctxt, ret);
@@ -5595,7 +5595,7 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
const xmlChar *name, const xmlChar *nsName,
int category, xmlNodePtr node)
{
- xmlSchemaIDCPtr ret = NULL;
+ xmlSchemaIDCPtr ret = NULL;
if ((ctxt == NULL) || (schema == NULL) || (name == NULL))
return (NULL);
@@ -5611,8 +5611,8 @@ xmlSchemaAddIDC(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
ret->targetNamespace = nsName;
ret->name = name;
ret->type = category;
- ret->node = node;
-
+ ret->node = node;
+
WXS_ADD_GLOBAL(ctxt, ret);
/*
* Only keyrefs need to be fixup up.
@@ -5648,7 +5648,7 @@ xmlSchemaAddWildcard(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
}
memset(ret, 0, sizeof(xmlSchemaWildcard));
ret->type = type;
- ret->node = node;
+ ret->node = node;
WXS_ADD_LOCAL(ctxt, ret);
return (ret);
}
@@ -5704,7 +5704,7 @@ xmlSchemaSubstGroupAdd(xmlSchemaParserCtxtPtr pctxt,
static xmlSchemaSubstGroupPtr
xmlSchemaSubstGroupGet(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaElementPtr head)
-{
+{
if (WXS_SUBST_GROUPS(pctxt) == NULL)
return(NULL);
return(xmlHashLookup2(WXS_SUBST_GROUPS(pctxt),
@@ -6120,7 +6120,7 @@ xmlSchemaPGetBoolNodeValue(xmlSchemaParserCtxtPtr ctxt,
value = xmlNodeGetContent(node);
/*
* 3.2.2.1 Lexical representation
- * An instance of a datatype that is defined as ·boolean·
+ * An instance of a datatype that is defined as �boolean�
* can have the following legal literals {true, false, 1, 0}.
*/
if (xmlStrEqual(BAD_CAST value, BAD_CAST "true"))
@@ -6168,7 +6168,7 @@ xmlGetBooleanProp(xmlSchemaParserCtxtPtr ctxt,
return (def);
/*
* 3.2.2.1 Lexical representation
- * An instance of a datatype that is defined as ·boolean·
+ * An instance of a datatype that is defined as �boolean�
* can have the following legal literals {true, false, 1, 0}.
*/
if (xmlStrEqual(val, BAD_CAST "true"))
@@ -6288,7 +6288,7 @@ xmlSchemaPValAttrNodeValue(xmlSchemaParserCtxtPtr pctxt,
ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
else
ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
- xmlSchemaPSimpleTypeErr(pctxt,
+ xmlSchemaPSimpleTypeErr(pctxt,
ret, ownerItem, (xmlNodePtr) attr,
type, NULL, value, NULL, NULL, NULL);
}
@@ -6352,7 +6352,7 @@ xmlSchemaPValAttrNode(xmlSchemaParserCtxtPtr ctxt,
* number otherwise and -1 in case of an internal or API error.
*/
static int
-xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
+xmlSchemaPValAttr(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaBasicItemPtr ownerItem,
xmlNodePtr ownerElem,
const char *name,
@@ -6442,7 +6442,7 @@ xmlSchemaCheckReference(xmlSchemaParserCtxtPtr pctxt,
* @type: the hosting type where the attributes will be anchored
*
* Parses attribute uses and attribute declarations and
- * attribute group references.
+ * attribute group references.
*/
static int
xmlSchemaParseLocalAttributes(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
@@ -7085,7 +7085,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt,
int parentType)
{
const xmlChar *attrValue, *name = NULL, *ns = NULL;
- xmlSchemaAttributeUsePtr use = NULL;
+ xmlSchemaAttributeUsePtr use = NULL;
xmlNodePtr child = NULL;
xmlAttrPtr attr;
const xmlChar *tmpNs = NULL, *tmpName = NULL, *defValue = NULL;
@@ -7139,7 +7139,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt,
/*
* Evaluate the target namespace
*/
- hasForm = 1;
+ hasForm = 1;
attrValue = xmlSchemaGetNodeContent(pctxt,
(xmlNodePtr) attr);
if (xmlStrEqual(attrValue, BAD_CAST "qualified")) {
@@ -7210,7 +7210,7 @@ xmlSchemaParseLocalAttribute(xmlSchemaParserCtxtPtr pctxt,
attr_next:
attr = attr->next;
- }
+ }
/*
* 3.2.3 : 2
* If default and use are both present, use must have
@@ -7236,7 +7236,7 @@ attr_next:
/* TODO: move XML_SCHEMAS_QUALIF_ATTR to the parser. */
if ((! hasForm) && (schema->flags & XML_SCHEMAS_QUALIF_ATTR))
- ns = pctxt->targetNamespace;
+ ns = pctxt->targetNamespace;
/*
* 3.2.6 Schema Component Constraint: xsi: Not Allowed
* TODO: Move this to the component layer.
@@ -7293,7 +7293,7 @@ attr_next:
use->attrDecl = attrDecl;
/*
* Value constraint.
- */
+ */
if (defValue != NULL) {
attrDecl->defValue = defValue;
if (defValueType == WXS_ATTR_DEF_VAL_FIXED)
@@ -7333,14 +7333,14 @@ attr_next:
if (defValueType == WXS_ATTR_DEF_VAL_FIXED)
use->flags |= XML_SCHEMA_ATTR_USE_FIXED;
}
-
+
check_children:
/*
* And now for the children...
*/
child = node->children;
if (occurs == XML_SCHEMAS_ATTR_USE_PROHIBITED) {
- xmlSchemaAttributeUseProhibPtr prohib;
+ xmlSchemaAttributeUseProhibPtr prohib;
if (IS_SCHEMA(child, "annotation")) {
xmlSchemaParseAnnotation(pctxt, child, 0);
@@ -7355,7 +7355,7 @@ check_children:
/*
* Check for pointlessness of attribute prohibitions.
*/
- if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) {
+ if (parentType == XML_SCHEMA_TYPE_ATTRIBUTEGROUP) {
xmlSchemaCustomWarning(ACTXT_CAST pctxt,
XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH,
node, NULL,
@@ -7373,7 +7373,7 @@ check_children:
return(NULL);
}
if (! isRef) {
- tmpName = name;
+ tmpName = name;
tmpNs = ns;
}
/*
@@ -7381,7 +7381,7 @@ check_children:
*/
if (uses) {
int i;
-
+
for (i = 0; i < uses->nbItems; i++) {
use = uses->items[i];
if ((use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) &&
@@ -7389,16 +7389,16 @@ check_children:
(tmpNs == (WXS_ATTR_PROHIB_CAST use)->targetNamespace))
{
xmlChar *str = NULL;
-
+
xmlSchemaCustomWarning(ACTXT_CAST pctxt,
XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH,
node, NULL,
"Skipping duplicate attribute use prohibition '%s'",
xmlSchemaFormatQName(&str, tmpNs, tmpName),
NULL, NULL);
- FREE_AND_NULL(str)
+ FREE_AND_NULL(str)
return(NULL);
- }
+ }
}
}
/*
@@ -7417,7 +7417,7 @@ check_children:
WXS_ADD_PENDING(pctxt, prohib);
}
return(WXS_BASIC_CAST prohib);
- } else {
+ } else {
if (IS_SCHEMA(child, "annotation")) {
/*
* TODO: Should this go into the attr decl?
@@ -7464,7 +7464,7 @@ check_children:
NULL, node, child, NULL,
"(annotation?, simpleType?)");
}
- }
+ }
return (WXS_BASIC_CAST use);
}
@@ -7486,7 +7486,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
* 3.2.3 Constraints on XML Representations of Attribute Declarations
*/
if ((pctxt == NULL) || (schema == NULL) || (node == NULL))
- return (NULL);
+ return (NULL);
/*
* 3.2.3 : 3.1
* One of ref or name must be present, but not both
@@ -7532,7 +7532,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
if (ret == NULL)
return (NULL);
ret->flags |= XML_SCHEMAS_ATTR_GLOBAL;
-
+
/*
* Check for illegal attributes.
*/
@@ -7546,7 +7546,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
(!xmlStrEqual(attr->name, BAD_CAST "type")))
{
xmlSchemaPIllegalAttrErr(pctxt,
- XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
+ XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
}
} else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
xmlSchemaPIllegalAttrErr(pctxt,
@@ -7556,7 +7556,7 @@ xmlSchemaParseGlobalAttribute(xmlSchemaParserCtxtPtr pctxt,
}
xmlSchemaPValAttrQName(pctxt, schema, NULL,
node, "type", &ret->typeNs, &ret->typeName);
-
+
xmlSchemaPValAttrID(pctxt, node, BAD_CAST "id");
/*
* Attribute "fixed".
@@ -7641,12 +7641,12 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
XML_SCHEMAP_S4S_ATTR_MISSING,
NULL, node, "ref", NULL);
return (NULL);
- }
+ }
xmlSchemaPValAttrNodeQName(pctxt, schema,
NULL, attr, &refNs, &ref);
if (xmlSchemaCheckReference(pctxt, schema, node, attr, refNs) != 0)
return(NULL);
-
+
/*
* Check for illegal attributes.
*/
@@ -7698,13 +7698,13 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
/*
* SPEC src-redefine:
* (7.1) "If it has an <attributeGroup> among its contents
- * the ·actual value· of whose ref [attribute] is the same
- * as the ·actual value· of its own name attribute plus
+ * the �actual value� of whose ref [attribute] is the same
+ * as the �actual value� of its own name attribute plus
* target namespace, then it must have exactly one such group."
*/
if (pctxt->redefCounter != 0) {
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_SRC_REDEFINE, node, NULL,
"The redefining attribute group definition "
@@ -7738,7 +7738,7 @@ xmlSchemaParseAttributeGroupRef(xmlSchemaParserCtxtPtr pctxt,
ret->node = node;
/* Add to pending items, to be able to resolve the reference. */
WXS_ADD_PENDING(pctxt, ret);
- }
+ }
return (ret);
}
@@ -7785,7 +7785,7 @@ xmlSchemaParseAttributeGroupDefinition(xmlSchemaParserCtxtPtr pctxt,
ret = xmlSchemaAddAttributeGroupDefinition(pctxt, schema,
name, pctxt->targetNamespace, node);
if (ret == NULL)
- return (NULL);
+ return (NULL);
/*
* Check for illegal attributes.
*/
@@ -8185,7 +8185,7 @@ xmlSchemaAddAnnotation(xmlSchemaAnnotItemPtr annItem,
* Returns the parsed identity-constraint definition.
*/
static xmlSchemaIDCSelectPtr
-xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
+xmlSchemaParseIDCSelectorAndField(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaIDCPtr idc,
xmlNodePtr node,
int isField)
@@ -8848,7 +8848,7 @@ xmlSchemaParseUnion(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
type->flags |= XML_SCHEMAS_TYPE_VARIETY_UNION;
/*
* SPEC (Base type) (2) "If the <list> or <union> alternative is chosen,
- * then the ·simple ur-type definition·."
+ * then the �simple ur-type definition�."
*/
type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE);
/*
@@ -9016,7 +9016,7 @@ xmlSchemaParseList(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
type->flags |= XML_SCHEMAS_TYPE_VARIETY_LIST;
/*
* SPEC (Base type) (2) "If the <list> or <union> alternative is chosen,
- * then the ·simple ur-type definition·."
+ * then the �simple ur-type definition�."
*/
type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYSIMPLETYPE);
/*
@@ -9161,9 +9161,9 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
}
/*
* TargetNamespace:
- * SPEC "The ·actual value· of the targetNamespace [attribute]
+ * SPEC "The �actual value� of the targetNamespace [attribute]
* of the <schema> ancestor element information item if present,
- * otherwise ·absent·.
+ * otherwise �absent�.
*/
if (topLevel == 0) {
#ifdef ENABLE_NAMED_LOCALS
@@ -9195,7 +9195,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
if (attr->ns == NULL) {
if (!xmlStrEqual(attr->name, BAD_CAST "id")) {
xmlSchemaPIllegalAttrErr(ctxt,
- XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
+ XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
}
} else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
xmlSchemaPIllegalAttrErr(ctxt,
@@ -9266,9 +9266,9 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
* And now for the children...
*/
oldCtxtType = ctxt->ctxtType;
-
+
ctxt->ctxtType = type;
-
+
child = node->children;
if (IS_SCHEMA(child, "annotation")) {
type->annot = xmlSchemaParseAnnotation(ctxt, child, 1);
@@ -9278,10 +9278,10 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
xmlSchemaPContentErr(ctxt, XML_SCHEMAP_S4S_ELEM_MISSING,
NULL, node, child, NULL,
"(annotation?, (restriction | list | union))");
- } else if (IS_SCHEMA(child, "restriction")) {
+ } else if (IS_SCHEMA(child, "restriction")) {
xmlSchemaParseRestriction(ctxt, schema, child,
- XML_SCHEMA_TYPE_SIMPLE);
- hasRestriction = 1;
+ XML_SCHEMA_TYPE_SIMPLE);
+ hasRestriction = 1;
child = child->next;
} else if (IS_SCHEMA(child, "list")) {
xmlSchemaParseList(ctxt, schema, child);
@@ -9298,8 +9298,8 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
/*
* REDEFINE: SPEC src-redefine (5)
* "Within the [children], each <simpleType> must have a
- * <restriction> among its [children] ... the ·actual value· of whose
- * base [attribute] must be the same as the ·actual value· of its own
+ * <restriction> among its [children] ... the �actual value� of whose
+ * base [attribute] must be the same as the �actual value� of its own
* name attribute plus target namespace;"
*/
if (topLevel && ctxt->isRedefine && (! hasRestriction)) {
@@ -9307,7 +9307,7 @@ xmlSchemaParseSimpleType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
NULL, node, "This is a redefinition, thus the "
"<simpleType> must have a <restriction> child", NULL);
}
-
+
ctxt->ctxtType = oldCtxtType;
return (type);
}
@@ -9373,13 +9373,13 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
item = xmlSchemaAddParticle(ctxt, node, min, max);
if (item == NULL)
- return (NULL);
+ return (NULL);
/*
* Create a qname-reference and set as the term; it will be substituted
* for the model group after the reference has been resolved.
*/
item->children = (xmlSchemaTreeItemPtr)
- xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
+ xmlSchemaNewQNameRef(ctxt, XML_SCHEMA_TYPE_GROUP, ref, refNs);
xmlSchemaPCheckParticleCorrect_2(ctxt, item, node, min, max);
/*
* And now for the children...
@@ -9419,7 +9419,7 @@ xmlSchemaParseModelGroupDefRef(xmlSchemaParserCtxtPtr ctxt,
* Note that the contraint src-redefine (6.2) can't be applied until
* references have been resolved. So we will do this at the
* component fixup level.
- *
+ *
* *WARNING* this interface is highly subject to change
*
* Returns -1 in case of error, 0 if the declaration is improper and
@@ -9493,7 +9493,7 @@ xmlSchemaParseModelGroupDefinition(xmlSchemaParserCtxtPtr ctxt,
child = child->next;
}
-
+
if (child != NULL) {
xmlSchemaPContentErr(ctxt,
@@ -9631,7 +9631,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt,
attr = xmlSchemaGetPropNode(node, "version");
if (attr != NULL) {
res = xmlSchemaPValAttrNode(ctxt, NULL, NULL, attr,
- xmlSchemaGetBuiltInType(XML_SCHEMAS_TOKEN), &val);
+ xmlSchemaGetBuiltInType(XML_SCHEMAS_TOKEN), &val);
HFAILURE;
}
*/
@@ -9691,7 +9691,7 @@ xmlSchemaParseSchemaElement(xmlSchemaParserCtxtPtr ctxt,
}
attr = xmlSchemaGetPropNode(node, "blockDefault");
if (attr != NULL) {
- val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
+ val = xmlSchemaGetNodeContent(ctxt, (xmlNodePtr) attr);
res = xmlSchemaPValAttrBlockFinal(val, &(schema->flags), -1,
XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION,
XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION,
@@ -9752,14 +9752,14 @@ xmlSchemaParseSchemaTopLevel(xmlSchemaParserCtxtPtr ctxt,
HFAILURE;
HSTOP(ctxt);
if (tmpOldErrs != ctxt->nberrors)
- goto exit;
+ goto exit;
} else if (IS_SCHEMA(child, "include")) {
tmpOldErrs = ctxt->nberrors;
res = xmlSchemaParseInclude(ctxt, schema, child);
HFAILURE;
HSTOP(ctxt);
if (tmpOldErrs != ctxt->nberrors)
- goto exit;
+ goto exit;
} else if (IS_SCHEMA(child, "redefine")) {
tmpOldErrs = ctxt->nberrors;
res = xmlSchemaParseRedefine(ctxt, schema, child);
@@ -9884,7 +9884,7 @@ xmlSchemaConstructionCtxtFree(xmlSchemaConstructionCtxtPtr con)
xmlFree(con);
}
-static xmlSchemaConstructionCtxtPtr
+static xmlSchemaConstructionCtxtPtr
xmlSchemaConstructionCtxtCreate(xmlDictPtr dict)
{
xmlSchemaConstructionCtxtPtr ret;
@@ -9954,10 +9954,10 @@ xmlSchemaNewParserCtxtUseDict(const char *URL, xmlDictPtr dict)
xmlSchemaParserCtxtPtr ret;
ret = xmlSchemaParserCtxtCreate();
- if (ret == NULL)
+ if (ret == NULL)
return (NULL);
ret->dict = dict;
- xmlDictReference(dict);
+ xmlDictReference(dict);
if (URL != NULL)
ret->URL = xmlDictLookup(dict, (const xmlChar *) URL, -1);
return (ret);
@@ -10082,8 +10082,8 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
xmlNodePtr node;
int ret, oldErrs;
xmlSchemaBucketPtr oldbucket = pctxt->constructor->bucket;
-
- /*
+
+ /*
* Save old values; reset the *main* schema.
* URGENT TODO: This is not good; move the per-document information
* to the parser. Get rid of passing the main schema to the
@@ -10093,9 +10093,9 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
oldDoc = schema->doc;
if (schema->flags != 0)
xmlSchemaClearSchemaDefaults(schema);
- schema->doc = bucket->doc;
+ schema->doc = bucket->doc;
pctxt->schema = schema;
- /*
+ /*
* Keep the current target namespace on the parser *not* on the
* main schema.
*/
@@ -10108,7 +10108,7 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
* We are parsing the schema for schemas!
*/
pctxt->isS4S = 1;
- }
+ }
/* Mark it as parsed, even if parsing fails. */
bucket->parsed++;
/* Compile the schema doc. */
@@ -10132,7 +10132,7 @@ xmlSchemaParseNewDocWithContext(xmlSchemaParserCtxtPtr pctxt,
ret = pctxt->err;
goto exit;
}
-
+
exit:
WXS_CONSTRUCTOR(pctxt)->bucket = oldbucket;
/* Restore schema values. */
@@ -10165,7 +10165,7 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt,
PERROR_INT("xmlSchemaParseNewDoc",
"no constructor");
return(-1);
- }
+ }
/* Create and init the temporary parser context. */
newpctxt = xmlSchemaNewParserCtxtUseDict(
(const char *) bucket->schemaLocation, pctxt->dict);
@@ -10173,7 +10173,7 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt,
return(-1);
newpctxt->constructor = pctxt->constructor;
/*
- * TODO: Can we avoid that the parser knows about the main schema?
+ * TODO: Can we avoid that the parser knows about the main schema?
* It would be better if he knows about the current schema bucket
* only.
*/
@@ -10183,16 +10183,16 @@ xmlSchemaParseNewDoc(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaSetParserStructuredErrors(newpctxt, pctxt->serror,
pctxt->errCtxt);
newpctxt->counter = pctxt->counter;
-
+
res = xmlSchemaParseNewDocWithContext(newpctxt, schema, bucket);
-
+
/* Channel back errors and cleanup the temporary parser context. */
if (res != 0)
pctxt->err = res;
pctxt->nberrors += newpctxt->nberrors;
pctxt->counter = newpctxt->counter;
- newpctxt->constructor = NULL;
+ newpctxt->constructor = NULL;
/* Free the parser context. */
xmlSchemaFreeParserCtxt(newpctxt);
return(res);
@@ -10217,11 +10217,11 @@ xmlSchemaSchemaRelationAddChild(xmlSchemaBucketPtr bucket,
static const xmlChar *
xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location,
xmlNodePtr ctxtNode)
-{
+{
/*
* Build an absolue location URI.
*/
- if (location != NULL) {
+ if (location != NULL) {
if (ctxtNode == NULL)
return(location);
else {
@@ -10244,7 +10244,7 @@ xmlSchemaBuildAbsoluteURI(xmlDictPtr dict, const xmlChar* location,
}
return(NULL);
}
-
+
/**
@@ -10267,8 +10267,8 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
const char *schemaBuffer,
int schemaBufferLen,
xmlNodePtr invokingNode,
- const xmlChar *sourceTargetNamespace,
- const xmlChar *importNamespace,
+ const xmlChar *sourceTargetNamespace,
+ const xmlChar *importNamespace,
xmlSchemaBucketPtr *bucket)
{
const xmlChar *targetNamespace = NULL;
@@ -10279,7 +10279,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
if (bucket != NULL)
*bucket = NULL;
-
+
switch (type) {
case XML_SCHEMA_SCHEMA_IMPORT:
case XML_SCHEMA_SCHEMA_MAIN:
@@ -10291,23 +10291,23 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
case XML_SCHEMA_SCHEMA_REDEFINE:
err = XML_SCHEMAP_SRC_REDEFINE;
break;
- }
-
+ }
+
/* Special handling for the main schema:
* skip the location and relation logic and just parse the doc.
* We need just a bucket to be returned in this case.
- */
+ */
if ((type == XML_SCHEMA_SCHEMA_MAIN) || (! WXS_HAS_BUCKETS(pctxt)))
- goto doc_load;
+ goto doc_load;
- /* Note that we expect the location to be an absulute URI. */
+ /* Note that we expect the location to be an absulute URI. */
if (schemaLocation != NULL) {
bkt = xmlSchemaGetSchemaBucket(pctxt, schemaLocation);
if ((bkt != NULL) &&
(pctxt->constructor->bucket == bkt)) {
/* Report self-imports/inclusions/redefinitions. */
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt, err,
invokingNode, NULL,
"The schema must not import/include/redefine itself",
@@ -10320,7 +10320,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
*/
relation = xmlSchemaSchemaRelationCreate();
if (relation == NULL)
- return(-1);
+ return(-1);
xmlSchemaSchemaRelationAddChild(pctxt->constructor->bucket,
relation);
relation->type = type;
@@ -10329,7 +10329,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
* Save the namespace import information.
*/
if (WXS_IS_BUCKET_IMPMAIN(type)) {
- relation->importNamespace = importNamespace;
+ relation->importNamespace = importNamespace;
if (schemaLocation == NULL) {
/*
* No location; this is just an import of the namespace.
@@ -10342,7 +10342,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
}
/* Did we already fetch the doc? */
- if (bkt != NULL) {
+ if (bkt != NULL) {
/* TODO: The following nasty cases will produce an error. */
if ((WXS_IS_BUCKET_IMPMAIN(type)) && (! bkt->imported)) {
/* We included/redefined and then try to import a schema. */
@@ -10364,14 +10364,14 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
"redefined, since it was already imported",
schemaLocation, NULL);
goto exit;
- }
+ }
}
-
+
if (WXS_IS_BUCKET_IMPMAIN(type)) {
/*
* Given that the schemaLocation [attribute] is only a hint, it is open
* to applications to ignore all but the first <import> for a given
- * namespace, regardless of the ·actual value· of schemaLocation, but
+ * namespace, regardless of the �actual value� of schemaLocation, but
* such a strategy risks missing useful information when new
* schemaLocations are offered.
*
@@ -10387,7 +10387,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
* 5 Attempt to resolve the namespace name to locate such a resource.
*
* NOTE: (3) and (5) are not supported.
- */
+ */
if (bkt != NULL) {
relation->bucket = bkt;
goto exit;
@@ -10395,7 +10395,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
bkt = xmlSchemaGetSchemaBucketByTNS(pctxt,
importNamespace, 1);
- if (bkt != NULL) {
+ if (bkt != NULL) {
relation->bucket = bkt;
if (bkt->schemaLocation == NULL) {
/* First given location of the schema; load the doc. */
@@ -10421,19 +10421,19 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
}
goto exit;
}
- }
- /*
+ }
+ /*
* No bucket + first location: load the doc and create a
* bucket.
*/
} else {
/* <include> and <redefine> */
if (bkt != NULL) {
-
+
if ((bkt->origTargetNamespace == NULL) &&
(bkt->targetNamespace != sourceTargetNamespace)) {
xmlSchemaBucketPtr chamel;
-
+
/*
* Chameleon include/redefine: skip loading only if it was
* aleady build for the targetNamespace of the including
@@ -10458,7 +10458,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
relation->bucket = chamel;
goto exit;
}
- /*
+ /*
* We need to parse the chameleon again for a different
* targetNamespace.
* CHAMELEON TODO: Optimize this by only parsing the
@@ -10469,7 +10469,7 @@ xmlSchemaAddSchemaDoc(xmlSchemaParserCtxtPtr pctxt,
} else {
relation->bucket = bkt;
goto exit;
- }
+ }
}
}
if ((bkt != NULL) && (bkt->doc != NULL)) {
@@ -10521,7 +10521,7 @@ doc_load:
NULL, NULL, SCHEMAS_PARSE_OPTIONS);
schemaLocation = xmlStrdup(BAD_CAST "in_memory_buffer");
if (doc != NULL)
- doc->URL = schemaLocation;
+ doc->URL = schemaLocation;
}
/*
* For <import>:
@@ -10575,11 +10575,11 @@ doc_load:
if (doc != NULL) {
xmlNodePtr docElem = NULL;
- located = 1;
+ located = 1;
docElem = xmlDocGetRootElement(doc);
if (docElem == NULL) {
xmlSchemaCustomErr(ACTXT_CAST pctxt, XML_SCHEMAP_NOROOT,
- invokingNode, NULL,
+ invokingNode, NULL,
"The document '%s' has no document element",
schemaLocation, NULL);
goto exit_error;
@@ -10598,14 +10598,14 @@ doc_load:
schemaLocation, NULL);
goto exit_error;
}
- /*
+ /*
* Note that we don't apply a type check for the
* targetNamespace value here.
*/
targetNamespace = xmlSchemaGetProp(pctxt, docElem,
"targetNamespace");
}
-
+
/* after_doc_loading: */
if ((bkt == NULL) && located) {
/* Only create a bucket if the schema was located. */
@@ -10632,14 +10632,14 @@ doc_load:
if (relation != NULL)
relation->bucket = bkt;
}
-
+
exit:
/*
* Return the bucket explicitely; this is needed for the
* main schema.
*/
if (bucket != NULL)
- *bucket = bkt;
+ *bucket = bkt;
return (0);
exit_error:
@@ -10655,7 +10655,7 @@ exit_failure:
xmlFreeDoc(doc);
if (bkt != NULL)
bkt->doc = NULL;
- }
+ }
return (-1);
}
@@ -10755,8 +10755,8 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
thisTargetNamespace = WXS_BUCKET(pctxt)->origTargetNamespace;
if (namespaceName != NULL) {
/*
- * 1.1 If the namespace [attribute] is present, then its ·actual value·
- * must not match the ·actual value· of the enclosing <schema>'s
+ * 1.1 If the namespace [attribute] is present, then its �actual value�
+ * must not match the �actual value� of the enclosing <schema>'s
* targetNamespace [attribute].
*/
if (xmlStrEqual(thisTargetNamespace, namespaceName)) {
@@ -10810,11 +10810,11 @@ xmlSchemaParseImport(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
"Failed to locate a schema at location '%s'. "
"Skipping the import", schemaLocation, NULL, NULL);
}
-
- if ((bucket != NULL) && CAN_PARSE_SCHEMA(bucket)) {
+
+ if ((bucket != NULL) && CAN_PARSE_SCHEMA(bucket)) {
ret = xmlSchemaParseNewDoc(pctxt, schema, bucket);
}
-
+
return (ret);
}
@@ -10896,7 +10896,7 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt,
XML_SCHEMAP_SRC_REDEFINE,
NULL, node,
"The schema document '%s' cannot redefine itself.",
- *schemaLocation);
+ *schemaLocation);
} else {
xmlSchemaPCustomErr(pctxt,
XML_SCHEMAP_SRC_INCLUDE,
@@ -10906,7 +10906,7 @@ xmlSchemaParseIncludeOrRedefineAttrs(xmlSchemaParserCtxtPtr pctxt,
}
goto exit_error;
}
-
+
return(0);
exit_error:
return(pctxt->err);
@@ -10936,19 +10936,19 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
res = xmlSchemaParseIncludeOrRedefineAttrs(pctxt, schema,
node, (xmlChar **) (&schemaLocation), type);
if (res != 0)
- return(res);
+ return(res);
/*
* Load and add the schema document.
*/
res = xmlSchemaAddSchemaDoc(pctxt, type, schemaLocation, NULL,
NULL, 0, node, pctxt->targetNamespace, NULL, &bucket);
if (res != 0)
- return(res);
+ return(res);
/*
* If we get no schema bucket back, then this means that the schema
* document could not be located or was broken XML or was not
* a schema document.
- */
+ */
if ((bucket == NULL) || (bucket->doc == NULL)) {
if (type == XML_SCHEMA_SCHEMA_INCLUDE) {
/*
@@ -10957,7 +10957,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
* for inclusions, since the that was the feedback from the
* schema people. I.e. the following spec piece will *not* be
* satisfied:
- * SPEC src-include: "It is not an error for the ·actual value· of the
+ * SPEC src-include: "It is not an error for the �actual value� of the
* schemaLocation [attribute] to fail to resolve it all, in which
* case no corresponding inclusion is performed.
* So do we need a warning report here?"
@@ -10974,7 +10974,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
*
* SPEC src-redefine (1)
* "If there are any element information items among the [children]
- * other than <annotation> then the ·actual value· of the
+ * other than <annotation> then the �actual value� of the
* schemaLocation [attribute] must successfully resolve."
* TODO: Ask the WG if a the location has always to resolve
* here as well!
@@ -10990,13 +10990,13 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
* Check targetNamespace sanity before parsing the new schema.
* TODO: Note that we won't check further content if the
* targetNamespace was bad.
- */
- if (bucket->origTargetNamespace != NULL) {
+ */
+ if (bucket->origTargetNamespace != NULL) {
/*
* SPEC src-include (2.1)
- * "SII has a targetNamespace [attribute], and its ·actual
- * value· is identical to the ·actual value· of the targetNamespace
- * [attribute] of SII’ (which must have such an [attribute])."
+ * "SII has a targetNamespace [attribute], and its �actual
+ * value� is identical to the �actual value� of the targetNamespace
+ * [attribute] of SIIďż˝ (which must have such an [attribute])."
*/
if (pctxt->targetNamespace == NULL) {
xmlSchemaCustomErr(ACTXT_CAST pctxt,
@@ -11020,7 +11020,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
pctxt->targetNamespace);
goto exit_error;
}
- } else if (pctxt->targetNamespace != NULL) {
+ } else if (pctxt->targetNamespace != NULL) {
/*
* Chameleons: the original target namespace will
* differ from the resulting namespace.
@@ -11038,10 +11038,10 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
}
bucket->targetNamespace = pctxt->targetNamespace;
}
- }
+ }
/*
* Parse the schema.
- */
+ */
if (bucket && (!bucket->parsed) && (bucket->doc != NULL)) {
if (isChameleon) {
/* TODO: Get rid of this flag on the schema itself. */
@@ -11058,8 +11058,8 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
/*
* And now for the children...
*/
- child = node->children;
- if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
+ child = node->children;
+ if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
/*
* Parse (simpleType | complexType | group | attributeGroup))*
*/
@@ -11082,7 +11082,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
} else if (IS_SCHEMA(child, "complexType")) {
xmlSchemaParseComplexType(pctxt, schema, child, 1);
/* hasRedefinitions = 1; */
- } else if (IS_SCHEMA(child, "group")) {
+ } else if (IS_SCHEMA(child, "group")) {
/* hasRedefinitions = 1; */
xmlSchemaParseModelGroupDefinition(pctxt,
schema, child);
@@ -11102,7 +11102,7 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
*/
child = child->next;
}
- }
+ }
if (child != NULL) {
res = XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED;
if (type == XML_SCHEMA_SCHEMA_REDEFINE) {
@@ -11113,8 +11113,8 @@ xmlSchemaParseIncludeOrRedefine(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaPContentErr(pctxt, res,
NULL, node, child, NULL,
"(annotation?)");
- }
- }
+ }
+ }
return(res);
exit_error:
@@ -11164,7 +11164,7 @@ xmlSchemaParseInclude(xmlSchemaParserCtxtPtr pctxt, xmlSchemaPtr schema,
* Redefinition Constraints and Semantics (src-redefine)
* (6.1), (6.1.1), (6.1.2)
*
- * Schema Component Constraint:
+ * Schema Component Constraint:
* All Group Limited (cos-all-limited) (2)
* TODO: Actually this should go to component-level checks,
* but is done here due to performance. Move it to an other layer
@@ -11343,8 +11343,8 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
/*
* SPEC src-redefine:
* (6.1) "If it has a <group> among its contents at
- * some level the ·actual value· of whose ref
- * [attribute] is the same as the ·actual value· of
+ * some level the �actual value� of whose ref
+ * [attribute] is the same as the �actual value� of
* its own name attribute plus target namespace, then
* all of the following must be true:"
* (6.1.1) "It must have exactly one such group."
@@ -11369,9 +11369,9 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
xmlChar *str = NULL;
/*
* SPEC src-redefine:
- * (6.1.2) "The ·actual value· of both that
+ * (6.1.2) "The �actual value� of both that
* group's minOccurs and maxOccurs [attribute]
- * must be 1 (or ·absent·).
+ * must be 1 (or �absent�).
*/
xmlSchemaCustomErr(ACTXT_CAST ctxt,
XML_SCHEMAP_SRC_REDEFINE, child, NULL,
@@ -11388,7 +11388,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
}
ctxt->redef->reference = WXS_BASIC_CAST part;
ctxt->redefCounter++;
- }
+ }
}
} else if (IS_SCHEMA(child, "any")) {
part = (xmlSchemaTreeItemPtr)
@@ -11425,7 +11425,7 @@ xmlSchemaParseModelGroup(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
WXS_ADD_PENDING(ctxt, item);
}
if (withParticle)
- return ((xmlSchemaTreeItemPtr) particle);
+ return ((xmlSchemaTreeItemPtr) particle);
else
return ((xmlSchemaTreeItemPtr) item);
}
@@ -11477,7 +11477,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
*/
xmlSchemaPValAttrID(ctxt, node, BAD_CAST "id");
/*
- * Attribute
+ * Attribute
*/
/*
* Extract the base type. The "base" attribute is mandatory if inside
@@ -11485,8 +11485,8 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
*
* SPEC (1.2) "...otherwise (<restriction> has no <simpleType> "
* among its [children]), the simple type definition which is
- * the {content type} of the type definition ·resolved· to by
- * the ·actual value· of the base [attribute]"
+ * the {content type} of the type definition �resolved� to by
+ * the �actual value� of the base [attribute]"
*/
if (xmlSchemaPValAttrQName(ctxt, schema, NULL, node, "base",
&(type->baseNs), &(type->base)) == 0)
@@ -11509,8 +11509,8 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
/*
* REDEFINE: SPEC src-redefine (5)
* "Within the [children], each <simpleType> must have a
- * <restriction> among its [children] ... the ·actual value· of
- * whose base [attribute] must be the same as the ·actual value·
+ * <restriction> among its [children] ... the �actual value� of
+ * whose base [attribute] must be the same as the �actual value�
* of its own name attribute plus target namespace;"
*/
xmlSchemaPCustomErrExt(ctxt, XML_SCHEMAP_SRC_REDEFINE,
@@ -11526,7 +11526,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
type->base = NULL;
type->baseNs = NULL;
}
- }
+ }
}
/*
* And now for the children...
@@ -11593,7 +11593,7 @@ xmlSchemaParseRestriction(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
/*
* Model group reference <group>.
*/
- } else if (IS_SCHEMA(child, "group")) {
+ } else if (IS_SCHEMA(child, "group")) {
type->subtypes = (xmlSchemaTypePtr)
xmlSchemaParseModelGroupDefRef(ctxt, schema, child);
/*
@@ -11931,13 +11931,13 @@ xmlSchemaParseSimpleContent(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaPContentErr(ctxt,
XML_SCHEMAP_S4S_ELEM_MISSING,
NULL, node, NULL, NULL,
- "(annotation?, (restriction | extension))");
+ "(annotation?, (restriction | extension))");
}
if (child == NULL) {
xmlSchemaPContentErr(ctxt,
XML_SCHEMAP_S4S_ELEM_MISSING,
NULL, node, NULL, NULL,
- "(annotation?, (restriction | extension))");
+ "(annotation?, (restriction | extension))");
}
if (IS_SCHEMA(child, "restriction")) {
xmlSchemaParseRestriction(ctxt, schema, child,
@@ -12094,7 +12094,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
} else if (xmlSchemaPValAttrNode(ctxt, NULL, attr,
xmlSchemaGetBuiltInType(XML_SCHEMAS_NCNAME), &name) != 0) {
return (NULL);
- }
+ }
}
if (topLevel == 0) {
@@ -12183,7 +12183,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
NULL, (xmlNodePtr) attr, NULL,
"(#all | List of (extension | restriction))",
attrValue, NULL, NULL, NULL);
- } else
+ } else
final = 1;
} else if (xmlStrEqual(attr->name, BAD_CAST "block")) {
/*
@@ -12201,7 +12201,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
NULL, (xmlNodePtr) attr, NULL,
"(#all | List of (extension | restriction)) ",
attrValue, NULL, NULL, NULL);
- } else
+ } else
block = 1;
} else {
xmlSchemaPIllegalAttrErr(ctxt,
@@ -12212,7 +12212,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
}
} else if (xmlStrEqual(attr->ns->href, xmlSchemaNs)) {
- xmlSchemaPIllegalAttrErr(ctxt,
+ xmlSchemaPIllegalAttrErr(ctxt,
XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, NULL, attr);
}
attr = attr->next;
@@ -12271,7 +12271,7 @@ xmlSchemaParseComplexType(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
* SPEC
* "...the third alternative (neither <simpleContent> nor
* <complexContent>) is chosen. This case is understood as shorthand
- * for complex content restricting the ·ur-type definition·, and the
+ * for complex content restricting the �ur-type definition�, and the
* details of the mappings should be modified as necessary.
*/
type->baseType = xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE);
@@ -12448,7 +12448,7 @@ xmlSchemaNewMemParserCtxt(const char *buffer, int size)
return(NULL);
ret->buffer = buffer;
ret->size = size;
- ret->dict = xmlDictCreate();
+ ret->dict = xmlDictCreate();
return (ret);
}
@@ -12491,7 +12491,7 @@ xmlSchemaFreeParserCtxt(xmlSchemaParserCtxtPtr ctxt)
if (ctxt == NULL)
return;
if (ctxt->doc != NULL && !ctxt->preserve)
- xmlFreeDoc(ctxt->doc);
+ xmlFreeDoc(ctxt->doc);
if (ctxt->vctxt != NULL) {
xmlSchemaFreeValidCtxt(ctxt->vctxt);
}
@@ -12573,7 +12573,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
* was incorrectly used instead of xmlAutomataNewTransition2()
* (seems like a copy&paste bug from the XML_SCHEMA_TYPE_ALL
* section in xmlSchemaBuildAContentModel() ).
- * TODO: Check if xmlAutomataNewOnceTrans2() was instead
+ * TODO: Check if xmlAutomataNewOnceTrans2() was instead
* intended for the above "counter" section originally. I.e.,
* check xs:all with subst-groups.
*
@@ -12582,7 +12582,7 @@ xmlSchemaBuildContentModelForSubstGroup(xmlSchemaParserCtxtPtr pctxt,
* 1, 1, member);
*/
tmp = xmlAutomataNewTransition2(pctxt->am, start, NULL,
- member->name, member->targetNamespace, member);
+ member->name, member->targetNamespace, member);
xmlAutomataNewEpsilon(pctxt->am, tmp, end);
}
} else {
@@ -12645,11 +12645,11 @@ xmlSchemaBuildContentModelForElement(xmlSchemaParserCtxtPtr ctxt,
} else if ((particle->maxOccurs >= UNBOUNDED) &&
(particle->minOccurs < 2)) {
/* Special case. */
- start = ctxt->state;
+ start = ctxt->state;
ctxt->state = xmlAutomataNewTransition2(ctxt->am, start, NULL,
- elemDecl->name, elemDecl->targetNamespace, elemDecl);
+ elemDecl->name, elemDecl->targetNamespace, elemDecl);
ctxt->state = xmlAutomataNewTransition2(ctxt->am, ctxt->state, ctxt->state,
- elemDecl->name, elemDecl->targetNamespace, elemDecl);
+ elemDecl->name, elemDecl->targetNamespace, elemDecl);
} else {
int counter;
int maxOccurs = particle->maxOccurs == UNBOUNDED ?
@@ -12684,7 +12684,7 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaParticlePtr particle)
{
if (particle == NULL) {
- PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
+ PERROR_INT("xmlSchemaBuildAContentModel", "particle is NULL");
return;
}
if (particle->children == NULL) {
@@ -13115,8 +13115,8 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl,
if ((elemDecl->subtypes == NULL) && (elemDecl->namedType != NULL)) {
xmlSchemaTypePtr type;
- /* (type definition) ... otherwise the type definition ·resolved·
- * to by the ·actual value· of the type [attribute] ...
+ /* (type definition) ... otherwise the type definition �resolved�
+ * to by the �actual value� of the type [attribute] ...
*/
type = xmlSchemaGetType(ctxt->schema, elemDecl->namedType,
elemDecl->namedTypeNs);
@@ -13154,7 +13154,7 @@ xmlSchemaResolveElementReferences(xmlSchemaElementPtr elemDecl,
/*
* The type definitions is set to:
* SPEC "...the {type definition} of the element
- * declaration ·resolved· to by the ·actual value·
+ * declaration �resolved� to by the �actual value�
* of the substitutionGroup [attribute], if present"
*/
if (elemDecl->subtypes == NULL)
@@ -13192,8 +13192,8 @@ xmlSchemaResolveUnionMemberTypes(xmlSchemaParserCtxtPtr ctxt,
/*
* SPEC (1) "If the <union> alternative is chosen, then [Definition:]
- * define the explicit members as the type definitions ·resolved·
- * to by the items in the ·actual value· of the memberTypes [attribute],
+ * define the explicit members as the type definitions �resolved�
+ * to by the items in the �actual value� of the memberTypes [attribute],
* if any, followed by the type definitions corresponding to the
* <simpleType>s among the [children] of <union>, if any."
*/
@@ -13306,7 +13306,6 @@ xmlSchemaIsUserDerivedFromBuiltInType(xmlSchemaTypePtr type, int valType)
return (0);
}
-#endif
static xmlSchemaTypePtr
xmlSchemaQueryBuiltInType(xmlSchemaTypePtr type)
@@ -13319,6 +13318,7 @@ xmlSchemaQueryBuiltInType(xmlSchemaTypePtr type)
return(type);
return(xmlSchemaQueryBuiltInType(type->subtypes));
}
+#endif
/**
* xmlSchemaGetPrimitiveType:
@@ -13488,7 +13488,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
return (0);
}
/*
- * 3 If both O1 and O2 are sets of (namespace names or ·absent·),
+ * 3 If both O1 and O2 are sets of (namespace names or �absent�),
* then the union of those sets must be the value.
*/
if ((completeWild->nsSet != NULL) && (curWild->nsSet != NULL)) {
@@ -13522,7 +13522,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
}
/*
* 4 If the two are negations of different values (namespace names
- * or ·absent·), then a pair of not and ·absent· must be the value.
+ * or �absent�), then a pair of not and �absent� must be the value.
*/
if ((completeWild->negNsSet != NULL) &&
(curWild->negNsSet != NULL) &&
@@ -13564,7 +13564,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
if (nsFound && absentFound) {
/*
* 5.1 If the set S includes both the negated namespace
- * name and ·absent·, then any must be the value.
+ * name and �absent�, then any must be the value.
*/
completeWild->any = 1;
if (completeWild->nsSet != NULL) {
@@ -13578,7 +13578,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
} else if (nsFound && (!absentFound)) {
/*
* 5.2 If the set S includes the negated namespace name
- * but not ·absent·, then a pair of not and ·absent· must
+ * but not �absent�, then a pair of not and �absent� must
* be the value.
*/
if (completeWild->nsSet != NULL) {
@@ -13593,7 +13593,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
completeWild->negNsSet->value = NULL;
} else if ((!nsFound) && absentFound) {
/*
- * 5.3 If the set S includes ·absent· but not the negated
+ * 5.3 If the set S includes �absent� but not the negated
* namespace name, then the union is not expressible.
*/
xmlSchemaPErr(ctxt, completeWild->node,
@@ -13604,7 +13604,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
} else if ((!nsFound) && (!absentFound)) {
/*
* 5.4 If the set S does not include either the negated namespace
- * name or ·absent·, then whichever of O1 or O2 is a pair of not
+ * name or �absent�, then whichever of O1 or O2 is a pair of not
* and a namespace name must be the value.
*/
if (completeWild->negNsSet == NULL) {
@@ -13638,7 +13638,7 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
while (cur != NULL) {
if (cur->value == NULL) {
/*
- * 6.1 If the set S includes ·absent·, then any must be the
+ * 6.1 If the set S includes �absent�, then any must be the
* value.
*/
completeWild->any = 1;
@@ -13656,8 +13656,8 @@ xmlSchemaUnionWildcards(xmlSchemaParserCtxtPtr ctxt,
}
if (completeWild->negNsSet == NULL) {
/*
- * 6.2 If the set S does not include ·absent·, then a pair of not
- * and ·absent· must be the value.
+ * 6.2 If the set S does not include �absent�, then a pair of not
+ * and �absent� must be the value.
*/
if (completeWild->nsSet != NULL) {
xmlSchemaFreeWildcardNsSet(completeWild->nsSet);
@@ -13740,9 +13740,9 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
}
/*
* 3 If either O1 or O2 is a pair of not and a value (a namespace
- * name or ·absent·) and the other is a set of (namespace names or
- * ·absent·), then that set, minus the negated value if it was in
- * the set, minus ·absent· if it was in the set, must be the value.
+ * name or �absent�) and the other is a set of (namespace names or
+ * �absent�), then that set, minus the negated value if it was in
+ * the set, minus �absent� if it was in the set, must be the value.
*/
if (((completeWild->negNsSet != NULL) && (curWild->nsSet != NULL)) ||
((curWild->negNsSet != NULL) && (completeWild->nsSet != NULL))) {
@@ -13791,7 +13791,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
return(0);
}
/*
- * 4 If both O1 and O2 are sets of (namespace names or ·absent·),
+ * 4 If both O1 and O2 are sets of (namespace names or �absent�),
* then the intersection of those sets must be the value.
*/
if ((completeWild->nsSet != NULL) && (curWild->nsSet != NULL)) {
@@ -13841,7 +13841,7 @@ xmlSchemaIntersectWildcards(xmlSchemaParserCtxtPtr ctxt,
}
/*
* 6 If the one is a negation of a namespace name and the other
- * is a negation of ·absent·, then the one which is the negation
+ * is a negation of �absent�, then the one which is the negation
* of a namespace name must be the value.
*/
if ((completeWild->negNsSet != NULL) && (curWild->negNsSet != NULL) &&
@@ -13873,7 +13873,7 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
if (super->any)
return (0);
/*
- * 2.1 sub must be a pair of not and a namespace name or ·absent·.
+ * 2.1 sub must be a pair of not and a namespace name or �absent�.
* 2.2 super must be a pair of not and the same value.
*/
if ((sub->negNsSet != NULL) &&
@@ -13881,7 +13881,7 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
(sub->negNsSet->value == sub->negNsSet->value))
return (0);
/*
- * 3.1 sub must be a set whose members are either namespace names or ·absent·.
+ * 3.1 sub must be a set whose members are either namespace names or �absent�.
*/
if (sub->nsSet != NULL) {
/*
@@ -13912,7 +13912,7 @@ xmlSchemaCheckCOSNSSubset(xmlSchemaWildcardPtr sub,
xmlSchemaWildcardNsPtr cur;
/*
* 3.2.2 super must be a pair of not and a namespace name or
- * ·absent· and that value must not be in sub's set.
+ * �absent� and that value must not be in sub's set.
*/
cur = sub->nsSet;
while (cur != NULL) {
@@ -13937,7 +13937,7 @@ xmlSchemaGetEffectiveValueConstraint(xmlSchemaAttributeUsePtr attruse,
if (val != 0)
*val = NULL;
- if (attruse->defValue != NULL) {
+ if (attruse->defValue != NULL) {
*value = attruse->defValue;
if (val != NULL)
*val = attruse->defVal;
@@ -14017,12 +14017,12 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaItemListPtr baseUses,
xmlSchemaWildcardPtr wild,
xmlSchemaWildcardPtr baseWild)
-{
+{
xmlSchemaAttributeUsePtr cur = NULL, bcur;
int i, j, found; /* err = 0; */
const xmlChar *bEffValue;
int effFixed;
-
+
if (uses != NULL) {
for (i = 0; i < uses->nbItems; i++) {
cur = uses->items[i];
@@ -14030,7 +14030,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
if (baseUses == NULL)
goto not_found;
for (j = 0; j < baseUses->nbItems; j++) {
- bcur = baseUses->items[j];
+ bcur = baseUses->items[j];
if ((WXS_ATTRUSE_DECL_NAME(cur) ==
WXS_ATTRUSE_DECL_NAME(bcur)) &&
(WXS_ATTRUSE_DECL_TNS(cur) ==
@@ -14043,7 +14043,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
* namespace}, then all of the following must be true:"
*/
found = 1;
-
+
if ((cur->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) &&
(bcur->occurs == XML_SCHEMAS_ATTR_USE_REQUIRED))
{
@@ -14069,12 +14069,12 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
WXS_ATTRUSE_TYPEDEF(bcur), 0) != 0)
{
xmlChar *strA = NULL, *strB = NULL, *strC = NULL;
-
+
/*
* SPEC (2.1.2) "R's {attribute declaration}'s
* {type definition} must be validly derived from
* B's {type definition} given the empty set as
- * defined in Type Derivation OK (Simple) (§3.14.6)."
+ * defined in Type Derivation OK (Simple) (�3.14.6)."
*/
xmlSchemaPAttrUseErr4(pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2,
@@ -14106,17 +14106,17 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
/*
* 2.1.3 ... one of the following must be true
*
- * 2.1.3.1 B's ·effective value constraint· is
- * ·absent· or default.
+ * 2.1.3.1 B's �effective value constraint� is
+ * �absent� or default.
*/
if ((bEffValue != NULL) &&
(effFixed == 1)) {
const xmlChar *rEffValue = NULL;
-
+
xmlSchemaGetEffectiveValueConstraint(bcur,
&effFixed, &rEffValue, NULL);
/*
- * 2.1.3.2 R's ·effective value constraint· is
+ * 2.1.3.2 R's �effective value constraint� is
* fixed with the same string as B's.
* MAYBE TODO: Compare the computed values.
* Hmm, it says "same string" so
@@ -14126,7 +14126,7 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
(! WXS_ARE_DEFAULT_STR_EQUAL(rEffValue, bEffValue)))
{
xmlChar *str = NULL;
-
+
xmlSchemaPAttrUseErr4(pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3,
WXS_ITEM_NODE(item), item, cur,
@@ -14145,21 +14145,21 @@ xmlSchemaCheckDerivationOKRestriction2to4(xmlSchemaParserCtxtPtr pctxt,
break;
}
}
-not_found:
+not_found:
if (!found) {
/*
* (2.2) "otherwise the {base type definition} must have an
* {attribute wildcard} and the {target namespace} of the
- * R's {attribute declaration} must be ·valid· with respect
+ * R's {attribute declaration} must be �valid� with respect
* to that wildcard, as defined in Wildcard allows Namespace
- * Name (§3.10.4)."
+ * Name (�3.10.4)."
*/
if ((baseWild == NULL) ||
(xmlSchemaCheckCVCWildcardNamespace(baseWild,
(WXS_ATTRUSE_DECL(cur))->targetNamespace) != 0))
{
xmlChar *str = NULL;
-
+
xmlSchemaPAttrUseErr4(pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2,
WXS_ITEM_NODE(item), item, cur,
@@ -14175,7 +14175,7 @@ not_found:
}
}
/*
- * SPEC derivation-ok-restriction (3):
+ * SPEC derivation-ok-restriction (3):
* (3) "For each attribute use in the {attribute uses} of the {base type
* definition} whose {required} is true, there must be an attribute
* use with an {attribute declaration} with the same {name} and
@@ -14190,7 +14190,7 @@ not_found:
found = 0;
if (uses != NULL) {
for (i = 0; i < uses->nbItems; i++) {
- cur = uses->items[i];
+ cur = uses->items[i];
if ((WXS_ATTRUSE_DECL_NAME(cur) ==
WXS_ATTRUSE_DECL_NAME(bcur)) &&
(WXS_ATTRUSE_DECL_TNS(cur) ==
@@ -14202,7 +14202,7 @@ not_found:
}
if (!found) {
xmlChar *strA = NULL, *strB = NULL;
-
+
xmlSchemaCustomErr4(ACTXT_CAST pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3,
NULL, item,
@@ -14224,19 +14224,19 @@ not_found:
/*
* (4) "If there is an {attribute wildcard}, all of the
* following must be true:"
- */
+ */
if (baseWild == NULL) {
xmlChar *str = NULL;
/*
* (4.1) "The {base type definition} must also have one."
- */
+ */
xmlSchemaCustomErr4(ACTXT_CAST pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1,
NULL, item,
"The %s has an attribute wildcard, "
"but the %s %s '%s' does not have one",
- WXS_ITEM_TYPE_NAME(item),
+ WXS_ITEM_TYPE_NAME(item),
WXS_ACTION_STR(action),
WXS_ITEM_TYPE_NAME(baseItem),
xmlSchemaGetComponentQName(&str, baseItem));
@@ -14250,7 +14250,7 @@ not_found:
* (4.2) "The complex type definition's {attribute wildcard}'s
* {namespace constraint} must be a subset of the {base type
* definition}'s {attribute wildcard}'s {namespace constraint},
- * as defined by Wildcard Subset (§3.10.6)."
+ * as defined by Wildcard Subset (�3.10.6)."
*/
xmlSchemaCustomErr4(ACTXT_CAST pctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2,
@@ -14264,8 +14264,8 @@ not_found:
FREE_AND_NULL(str);
return(pctxt->err);
}
- /* 4.3 Unless the {base type definition} is the ·ur-type
- * definition·, the complex type definition's {attribute
+ /* 4.3 Unless the {base type definition} is the �ur-type
+ * definitionďż˝, the complex type definition's {attribute
* wildcard}'s {process contents} must be identical to or
* stronger than the {base type definition}'s {attribute
* wildcard}'s {process contents}, where strict is stronger
@@ -14316,7 +14316,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaTypePtr type)
{
xmlSchemaTypePtr baseType = NULL;
- xmlSchemaAttributeUsePtr use;
+ xmlSchemaAttributeUsePtr use;
xmlSchemaItemListPtr uses, baseUses, prohibs = NULL;
if (type->baseType == NULL) {
@@ -14324,7 +14324,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
"no base type");
return (-1);
}
- baseType = type->baseType;
+ baseType = type->baseType;
if (WXS_IS_TYPE_NOT_FIXED(baseType))
if (xmlSchemaTypeFixup(baseType, ACTXT_CAST pctxt) == -1)
return(-1);
@@ -14336,7 +14336,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
* wildcard, i.e. intersect multiple wildcards.
* Move attribute prohibitions into a separate list.
*/
- if (uses != NULL) {
+ if (uses != NULL) {
if (WXS_IS_RESTRICTION(type)) {
/*
* This one will transfer all attr. prohibitions
@@ -14370,7 +14370,7 @@ xmlSchemaFixupTypeAttributeUses(xmlSchemaParserCtxtPtr pctxt,
if (WXS_IS_RESTRICTION(type)) {
int usesCount;
- xmlSchemaAttributeUsePtr tmp;
+ xmlSchemaAttributeUsePtr tmp;
if (uses != NULL)
usesCount = uses->nbItems;
@@ -14420,15 +14420,15 @@ inherit_next: {}
}
} else {
/* Extension. */
- for (i = 0; i < baseUses->nbItems; i++) {
- use = baseUses->items[i];
+ for (i = 0; i < baseUses->nbItems; i++) {
+ use = baseUses->items[i];
if (uses == NULL) {
type->attrUses = xmlSchemaItemListCreate();
if (type->attrUses == NULL)
goto exit_failure;
uses = type->attrUses;
}
- xmlSchemaItemListAddSize(uses, baseUses->nbItems, use);
+ xmlSchemaItemListAddSize(uses, baseUses->nbItems, use);
}
}
}
@@ -14448,10 +14448,10 @@ inherit_next: {}
/*
* Compute the complete wildcard.
*/
- if (WXS_IS_EXTENSION(type)) {
+ if (WXS_IS_EXTENSION(type)) {
if (baseType->attributeWildcard != NULL) {
/*
- * (3.2.2.1) "If the ·base wildcard· is non-·absent·, then
+ * (3.2.2.1) "If the �base wildcard� is non-�absent�, then
* the appropriate case among the following:"
*/
if (type->attributeWildcard != NULL) {
@@ -14459,26 +14459,26 @@ inherit_next: {}
* Union the complete wildcard with the base wildcard.
* SPEC {attribute wildcard}
* (3.2.2.1.2) "otherwise a wildcard whose {process contents}
- * and {annotation} are those of the ·complete wildcard·,
+ * and {annotation} are those of the �complete wildcard�,
* and whose {namespace constraint} is the intensional union
- * of the {namespace constraint} of the ·complete wildcard·
- * and of the ·base wildcard·, as defined in Attribute
- * Wildcard Union (§3.10.6)."
+ * of the {namespace constraint} of the �complete wildcard�
+ * and of the �base wildcard�, as defined in Attribute
+ * Wildcard Union (�3.10.6)."
*/
if (xmlSchemaUnionWildcards(pctxt, type->attributeWildcard,
baseType->attributeWildcard) == -1)
- goto exit_failure;
+ goto exit_failure;
} else {
/*
- * (3.2.2.1.1) "If the ·complete wildcard· is ·absent·,
- * then the ·base wildcard·."
+ * (3.2.2.1.1) "If the �complete wildcard� is �absent�,
+ * then the �base wildcard�."
*/
type->attributeWildcard = baseType->attributeWildcard;
- }
+ }
} else {
/*
- * (3.2.2.2) "otherwise (the ·base wildcard· is ·absent·) the
- * ·complete wildcard"
+ * (3.2.2.2) "otherwise (the �base wildcard� is �absent�) the
+ * �complete wildcard"
* NOOP
*/
}
@@ -14486,11 +14486,11 @@ inherit_next: {}
/*
* SPEC {attribute wildcard}
* (3.1) "If the <restriction> alternative is chosen, then the
- * ·complete wildcard·;"
+ * �complete wildcard�;"
* NOOP
*/
}
-
+
return (0);
exit_failure:
@@ -14594,6 +14594,7 @@ xmlSchemaGetParticleTotalRangeMin(xmlSchemaParticlePtr particle)
}
}
+#if 0
/**
* xmlSchemaGetParticleTotalRangeMax:
* @particle: the particle
@@ -14653,6 +14654,7 @@ xmlSchemaGetParticleTotalRangeMax(xmlSchemaParticlePtr particle)
return (particle->maxOccurs * sum);
}
}
+#endif
/**
* xmlSchemaIsParticleEmptiable:
@@ -14733,12 +14735,12 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
/* 2.2 */
if (type->baseType == baseType) {
/*
- * 2.2.1 D's ·base type definition· is B.
+ * 2.2.1 D's �base type definition� is B.
*/
return (0);
}
/*
- * 2.2.2 D's ·base type definition· is not the ·ur-type definition·
+ * 2.2.2 D's �base type definition� is not the �ur-type definition�
* and is validly derived from B given the subset, as defined by this
* constraint.
*/
@@ -14748,8 +14750,8 @@ xmlSchemaCheckCOSSTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
return (0);
}
/*
- * 2.2.3 D's {variety} is list or union and B is the ·simple ur-type
- * definition·.
+ * 2.2.3 D's {variety} is list or union and B is the �simple ur-type
+ * definitionďż˝.
*/
if (WXS_IS_ANY_SIMPLE_TYPE(baseType) &&
(WXS_IS_LIST(type) || WXS_IS_UNION(type))) {
@@ -14865,10 +14867,10 @@ static int
xmlSchemaCheckUnionTypeDefCircularRecur(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaTypePtr ctxType,
xmlSchemaTypeLinkPtr members)
-{
+{
xmlSchemaTypeLinkPtr member;
xmlSchemaTypePtr memberType;
-
+
member = members;
while (member != NULL) {
memberType = member->type;
@@ -14969,7 +14971,7 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef,
}
return;
}
- }
+ }
/*
* The ball of letters below means, that if we have a particle
* which has a QName-helper component as its {term}, we want
@@ -15012,7 +15014,7 @@ xmlSchemaResolveTypeReferences(xmlSchemaTypePtr typeDef,
* particle's {term}.
*/
WXS_TYPE_PARTICLE_TERM(typeDef) = WXS_MODELGROUPDEF_MODEL(groupDef);
-
+
if (WXS_MODELGROUPDEF_MODEL(groupDef)->type == XML_SCHEMA_TYPE_ALL) {
/*
* SPEC cos-all-limited (1.2)
@@ -15061,14 +15063,14 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
* NOTE: This is somehow redundant, since we actually built a simple type
* to have all the needed information; this acts as an self test.
*/
- /* Base type: If the datatype has been ·derived· by ·restriction·
- * then the Simple Type Definition component from which it is ·derived·,
- * otherwise the Simple Type Definition for anySimpleType (§4.1.6).
+ /* Base type: If the datatype has been �derived� by �restriction�
+ * then the Simple Type Definition component from which it is �derived�,
+ * otherwise the Simple Type Definition for anySimpleType (�4.1.6).
*/
if (baseType == NULL) {
/*
* TODO: Think about: "modulo the impact of Missing
- * Sub-components (§5.3)."
+ * Sub-components (�5.3)."
*/
xmlSchemaPCustomErr(ctxt,
XML_SCHEMAP_ST_PROPS_CORRECT_1,
@@ -15092,7 +15094,7 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
xmlSchemaPCustomErr(ctxt,
XML_SCHEMAP_ST_PROPS_CORRECT_1,
WXS_BASIC_CAST type, NULL,
- "A type, derived by list or union, must have"
+ "A type, derived by list or union, must have "
"the simple ur-type definition as base type, not '%s'",
xmlSchemaGetComponentQName(&str, baseType));
FREE_AND_NULL(str)
@@ -15127,10 +15129,10 @@ xmlSchemaCheckSTPropsCorrect(xmlSchemaParserCtxtPtr ctxt,
}
/*
- * 2 All simple type definitions must be derived ultimately from the ·simple
- * ur-type definition (so· circular definitions are disallowed). That is, it
- * must be possible to reach a built-in primitive datatype or the ·simple
- * ur-type definition· by repeatedly following the {base type definition}.
+ * 2 All simple type definitions must be derived ultimately from the �simple
+ * ur-type definition (soďż˝ circular definitions are disallowed). That is, it
+ * must be possible to reach a built-in primitive datatype or the �simple
+ * ur-type definitionďż˝ by repeatedly following the {base type definition}.
*
* NOTE: this is done in xmlSchemaCheckTypeDefCircular().
*/
@@ -15314,10 +15316,10 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
}
/*
* MAYBE TODO: (Hmm, not really) Datatypes states:
- * A ·list· datatype can be ·derived· from an ·atomic· datatype
- * whose ·lexical space· allows space (such as string or anyURI)or
- * a ·union· datatype any of whose {member type definitions}'s
- * ·lexical space· allows space.
+ * A �list� datatype can be �derived� from an �atomic� datatype
+ * whose �lexical space� allows space (such as string or anyURI)or
+ * a �union� datatype any of whose {member type definitions}'s
+ * �lexical space� allows space.
*/
} else {
/*
@@ -15354,7 +15356,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
/*
* 2.3.2.3 The {item type definition} must be validly derived
* from the {base type definition}'s {item type definition} given
- * the empty set, as defined in Type Derivation OK (Simple) (§3.14.6).
+ * the empty set, as defined in Type Derivation OK (Simple) (�3.14.6).
*/
{
xmlSchemaTypePtr baseItemType;
@@ -15401,7 +15403,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
case XML_SCHEMA_FACET_WHITESPACE:
/*
* TODO: 2.5.1.2 List datatypes
- * The value of ·whiteSpace· is fixed to the value collapse.
+ * The value of �whiteSpace� is fixed to the value collapse.
*/
case XML_SCHEMA_FACET_PATTERN:
case XML_SCHEMA_FACET_ENUMERATION:
@@ -15454,8 +15456,8 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
member = member->next;
}
/*
- * 3.3.1 If the {base type definition} is the ·simple ur-type
- * definition·
+ * 3.3.1 If the {base type definition} is the �simple ur-type
+ * definitionďż˝
*/
if (type->baseType->builtInType == XML_SCHEMAS_ANYSIMPLETYPE) {
/*
@@ -15517,7 +15519,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
* 3.3.2.3 The {member type definitions}, in order, must be validly
* derived from the corresponding type definitions in the {base
* type definition}'s {member type definitions} given the empty set,
- * as defined in Type Derivation OK (Simple) (§3.14.6).
+ * as defined in Type Derivation OK (Simple) (�3.14.6).
*/
{
xmlSchemaTypeLinkPtr baseMember;
@@ -15609,7 +15611,7 @@ xmlSchemaCheckCOSSTRestricts(xmlSchemaParserCtxtPtr pctxt,
* @ctxt: the schema parser context
* @type: the simple type definition
*
- * Checks crc-simple-type constraints.
+ * Checks crc-simple-type constraints.
*
* Returns 0 if the constraints are satisfied,
* if not a positive error code and -1 on internal
@@ -15623,8 +15625,8 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
/*
* src-simple-type.1 The corresponding simple type definition, if any,
* must satisfy the conditions set out in Constraints on Simple Type
- * Definition Schema Components (§3.14.6).
- */
+ * Definition Schema Components (�3.14.6).
+ */
if (WXS_IS_RESTRICTION(type)) {
/*
* src-simple-type.2 "If the <restriction> alternative is chosen,
@@ -15633,7 +15635,7 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
* NOTE: This is checked in the parse function of <restriction>.
*/
/*
- *
+ *
*/
} else if (WXS_IS_LIST(type)) {
/* src-simple-type.3 "If the <list> alternative is chosen, either it must have
@@ -15642,8 +15644,8 @@ xmlSchemaCheckSRCSimpleType(xmlSchemaParserCtxtPtr ctxt,
*
* NOTE: This is checked in the parse function of <list>.
*/
- } else if (WXS_IS_UNION(type)) {
- /*
+ } else if (WXS_IS_UNION(type)) {
+ /*
* src-simple-type.4 is checked in xmlSchemaCheckUnionTypeDefCircular().
*/
}
@@ -15721,8 +15723,8 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt,
* SPEC (2.1) "its {content type} must be a simple type definition
* or mixed."
* SPEC (2.2.2) "If the {content type} is mixed, then the {content
- * type}'s particle must be ·emptiable· as defined by
- * Particle Emptiable (§3.9.6)."
+ * type}'s particle must be �emptiable� as defined by
+ * Particle Emptiable (�3.9.6)."
*/
if ((! WXS_HAS_SIMPLE_CONTENT(type)) &&
((! WXS_HAS_MIXED_CONTENT(type)) || (! WXS_EMPTIABLE(type)))) {
@@ -15738,14 +15740,14 @@ xmlSchemaParseCheckCOSValidDefault(xmlSchemaParserCtxtPtr pctxt,
}
/*
* 1 If the type definition is a simple type definition, then the string
- * must be ·valid· with respect to that definition as defined by String
- * Valid (§3.14.4).
+ * must be �valid� with respect to that definition as defined by String
+ * Valid (�3.14.4).
*
* AND
*
* 2.2.1 If the {content type} is a simple type definition, then the
- * string must be ·valid· with respect to that simple type definition
- * as defined by String Valid (§3.14.4).
+ * string must be �valid� with respect to that simple type definition
+ * as defined by String Valid (�3.14.4).
*/
if (WXS_IS_SIMPLE(type))
ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST pctxt, node,
@@ -15786,8 +15788,8 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
*
* SPEC (1) "The values of the properties of a complex type definition must
* be as described in the property tableau in The Complex Type Definition
- * Schema Component (§3.4.1), modulo the impact of Missing
- * Sub-components (§5.3)."
+ * Schema Component (�3.4.1), modulo the impact of Missing
+ * Sub-components (�5.3)."
*/
if ((type->baseType != NULL) &&
(WXS_IS_SIMPLE(type->baseType)) &&
@@ -15798,14 +15800,14 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
*/
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_SRC_CT_1,
- NULL, WXS_BASIC_CAST type,
+ NULL, WXS_BASIC_CAST type,
"If the base type is a simple type, the derivation method must be "
"'extension'", NULL, NULL);
return (XML_SCHEMAP_SRC_CT_1);
}
/*
- * SPEC (3) "Circular definitions are disallowed, except for the ·ur-type
- * definition·. That is, it must be possible to reach the ·ur-type
+ * SPEC (3) "Circular definitions are disallowed, except for the �ur-type
+ * definition�. That is, it must be possible to reach the �ur-type
* definition by repeatedly following the {base type definition}."
*
* NOTE (3) is done in xmlSchemaCheckTypeDefCircular().
@@ -15815,7 +15817,7 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
* - attribute uses need to be already inherited (apply attr. prohibitions)
* - attribute group references need to be expanded already
* - simple types need to be typefixed already
- */
+ */
if (type->attrUses &&
(((xmlSchemaItemListPtr) type->attrUses)->nbItems > 1))
{
@@ -15825,8 +15827,8 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
for (i = uses->nbItems -1; i >= 0; i--) {
use = uses->items[i];
-
- /*
+
+ /*
* SPEC ct-props-correct
* (4) "Two distinct attribute declarations in the
* {attribute uses} must not have identical {name}s and
@@ -15867,10 +15869,10 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
if (xmlSchemaIsDerivedFromBuiltInType(
WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID))
- {
+ {
if (hasId) {
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_AG_PROPS_CORRECT,
NULL, WXS_BASIC_CAST type,
@@ -15884,7 +15886,7 @@ xmlSchemaCheckCTPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
if (xmlSchemaItemListRemove(uses, i) == -1)
goto exit_failure;
}
-
+
hasId = 1;
}
}
@@ -15958,8 +15960,8 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
if (type->baseType == baseType)
return (0);
/*
- * SPEC (2.3.1) "D's {base type definition} must not be the ·ur-type
- * definition·."
+ * SPEC (2.3.1) "D's {base type definition} must not be the �ur-type
+ * definitionďż˝."
*/
if (WXS_IS_ANYTYPE(type->baseType))
return (1);
@@ -15976,7 +15978,7 @@ xmlSchemaCheckCOSCTDerivedOK(xmlSchemaAbstractCtxtPtr actxt,
/*
* SPEC (2.3.2.2) "If D's {base type definition} is simple, then it
* must be validly derived from B given the subset as defined in Type
- * Derivation OK (Simple) (§3.14.6).
+ * Derivation OK (Simple) (�3.14.6).
*/
return (xmlSchemaCheckCOSSTDerivedOK(actxt, type->baseType,
baseType, set));
@@ -16037,7 +16039,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
* SPEC (1) "If the {base type definition} is a complex type definition,
* then all of the following must be true:"
*/
- if (WXS_IS_COMPLEX(base)) {
+ if (WXS_IS_COMPLEX(base)) {
/*
* SPEC (1.1) "The {final} of the {base type definition} must not
* contain extension."
@@ -16050,7 +16052,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
"contains 'extension'", NULL);
return (XML_SCHEMAP_COS_CT_EXTENDS_1_1);
}
-
+
/*
* ATTENTION: The constrains (1.2) and (1.3) are not applied,
* since they are automatically satisfied through the
@@ -16094,11 +16096,11 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
}
if (! found) {
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST ctxt,
XML_SCHEMAP_COS_CT_EXTENDS_1_2,
NULL, WXS_BASIC_CAST type,
- /*
+ /*
* TODO: The report does not indicate that also the
* type needs to be the same.
*/
@@ -16116,9 +16118,9 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
* definition must also have one, and the base type definition's
* {attribute wildcard}'s {namespace constraint} must be a subset
* of the complex type definition's {attribute wildcard}'s {namespace
- * constraint}, as defined by Wildcard Subset (§3.10.6)."
+ * constraint}, as defined by Wildcard Subset (�3.10.6)."
*/
-
+
/*
* MAYBE TODO: Enable if ever needed. But this will be needed only
* if created the type via a schema construction API.
@@ -16126,7 +16128,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
if (base->attributeWildcard != NULL) {
if (type->attributeWilcard == NULL) {
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_COS_CT_EXTENDS_1_3,
NULL, type,
@@ -16139,7 +16141,7 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
base->attributeWildcard, type->attributeWildcard))
{
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_COS_CT_EXTENDS_1_3,
NULL, type,
@@ -16213,9 +16215,9 @@ xmlSchemaCheckCOSCTExtends(xmlSchemaParserCtxtPtr ctxt,
}
/*
* URGENT TODO SPEC (1.4.3.2.2.2) "The particle of the
- * complex type definition must be a ·valid extension·
+ * complex type definition must be a �valid extension�
* of the {base type definition}'s particle, as defined
- * in Particle Valid (Extension) (§3.9.6)."
+ * in Particle Valid (Extension) (�3.9.6)."
*
* NOTE that we won't check "Particle Valid (Extension)",
* since it is ensured by the derivation process in
@@ -16293,7 +16295,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
*/
base = type->baseType;
if (! WXS_IS_COMPLEX(base)) {
- xmlSchemaCustomErr(ACTXT_CAST ctxt,
+ xmlSchemaCustomErr(ACTXT_CAST ctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1,
type->node, WXS_BASIC_CAST type,
"The base type must be a complex type", NULL, NULL);
@@ -16304,7 +16306,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
* SPEC (1) "The {base type definition} must be a complex type
* definition whose {final} does not contain restriction."
*/
- xmlSchemaCustomErr(ACTXT_CAST ctxt,
+ xmlSchemaCustomErr(ACTXT_CAST ctxt,
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1,
type->node, WXS_BASIC_CAST type,
"The 'final' of the base type definition "
@@ -16332,7 +16334,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
if (base->builtInType == XML_SCHEMAS_ANYTYPE) {
/*
* SPEC (5.1) "The {base type definition} must be the
- * ·ur-type definition·."
+ * �ur-type definition�."
* PASS
*/
} else if ((type->contentType == XML_SCHEMA_CONTENT_SIMPLE) ||
@@ -16351,11 +16353,11 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
* SPEC (5.2.2.1) "The {content type} of the {base type
* definition} must be a simple type definition from which
* the {content type} is validly derived given the empty
- * set as defined in Type Derivation OK (Simple) (§3.14.6)."
+ * set as defined in Type Derivation OK (Simple) (�3.14.6)."
*
* ATTENTION TODO: This seems not needed if the type implicitely
* derived from the base type.
- *
+ *
*/
err = xmlSchemaCheckCOSSTDerivedOK(ACTXT_CAST ctxt,
type->contentTypeDef, base->contentTypeDef, 0);
@@ -16382,8 +16384,8 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
(xmlSchemaParticlePtr) base->subtypes))) {
/*
* SPEC (5.2.2.2) "The {base type definition} must be mixed
- * and have a particle which is ·emptiable· as defined in
- * Particle Emptiable (§3.9.6)."
+ * and have a particle which is �emptiable� as defined in
+ * Particle Emptiable (�3.9.6)."
* PASS
*/
} else {
@@ -16412,7 +16414,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
/*
* SPEC (5.3.2.2) "The {content type} of the {base type
* definition} must be elementOnly or mixed and have a particle
- * which is ·emptiable· as defined in Particle Emptiable (§3.9.6)."
+ * which is �emptiable� as defined in Particle Emptiable (�3.9.6)."
* PASS
*/
} else {
@@ -16429,7 +16431,7 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
/*
* SPEC (5.4.1.1) "The {content type} of the complex type definition
* itself must be element-only"
- */
+ */
if (WXS_HAS_MIXED_CONTENT(type) && (! WXS_HAS_MIXED_CONTENT(base))) {
/*
* SPEC (5.4.1.2) "The {content type} of the complex type
@@ -16445,9 +16447,9 @@ xmlSchemaCheckDerivationOKRestriction(xmlSchemaParserCtxtPtr ctxt,
}
/*
* SPEC (5.4.2) "The particle of the complex type definition itself
- * must be a ·valid restriction· of the particle of the {content
+ * must be a �valid restriction� of the particle of the {content
* type} of the {base type definition} as defined in Particle Valid
- * (Restriction) (§3.9.6).
+ * (Restriction) (�3.9.6).
*
* URGENT TODO: (5.4.2)
*/
@@ -16516,7 +16518,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
if (! WXS_HAS_SIMPLE_CONTENT(type)) {
/*
* 1 If the <complexContent> alternative is chosen, the type definition
- * ·resolved· to by the ·actual value· of the base [attribute]
+ * �resolved� to by the �actual value� of the base [attribute]
* must be a complex type definition;
*/
if (! WXS_IS_COMPLEX(base)) {
@@ -16536,7 +16538,7 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
* SPEC
* 2 If the <simpleContent> alternative is chosen, all of the
* following must be true:
- * 2.1 The type definition ·resolved· to by the ·actual value· of the
+ * 2.1 The type definition �resolved� to by the �actual value� of the
* base [attribute] must be one of the following:
*/
if (WXS_IS_SIMPLE(base)) {
@@ -16586,11 +16588,11 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
if (! xmlSchemaIsParticleEmptiable(
(xmlSchemaParticlePtr) base->subtypes)) {
ret = XML_SCHEMAP_SRC_CT_1;
- } else
+ } else
/*
* Attention: at this point the <simpleType> child is in
* ->contentTypeDef (put there during parsing).
- */
+ */
if (type->contentTypeDef == NULL) {
xmlChar *str = NULL;
/*
@@ -16642,14 +16644,14 @@ xmlSchemaCheckSRCCT(xmlSchemaParserCtxtPtr ctxt,
/*
* SPEC (3) "The corresponding complex type definition component must
* satisfy the conditions set out in Constraints on Complex Type
- * Definition Schema Components (§3.4.6);"
+ * Definition Schema Components (�3.4.6);"
* NOTE (3) will be done in xmlSchemaTypeFixup().
*/
/*
* SPEC (4) If clause 2.2.1 or clause 2.2.2 in the correspondence specification
* above for {attribute wildcard} is satisfied, the intensional
* intersection must be expressible, as defined in Attribute Wildcard
- * Intersection (§3.10.6).
+ * Intersection (�3.10.6).
* NOTE (4) is done in xmlSchemaFixupTypeAttributeUses().
*/
return (ret);
@@ -16720,7 +16722,7 @@ xmlSchemaCheckRCaseNameAndTypeOK(xmlSchemaParserCtxtPtr ctxt,
return (1);
/*
* SPEC (2) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (§3.9.6)."
+ * occurrence range as defined by Occurrence Range OK (�3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs) != 0)
@@ -16812,19 +16814,19 @@ xmlSchemaCheckRCaseNSCompat(xmlSchemaParserCtxtPtr ctxt,
{
/* TODO:Error codes (rcase-NSCompat). */
/*
- * SPEC "For an element declaration particle to be a ·valid restriction·
+ * SPEC "For an element declaration particle to be a �valid restriction�
* of a wildcard particle all of the following must be true:"
*
- * SPEC (1) "The element declaration's {target namespace} is ·valid·
+ * SPEC (1) "The element declaration's {target namespace} is �valid�
* with respect to the wildcard's {namespace constraint} as defined by
- * Wildcard allows Namespace Name (§3.10.4)."
+ * Wildcard allows Namespace Name (�3.10.4)."
*/
if (xmlSchemaCheckCVCWildcardNamespace((xmlSchemaWildcardPtr) b->children,
((xmlSchemaElementPtr) r->children)->targetNamespace) != 0)
return (1);
/*
* SPEC (2) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (§3.9.6)."
+ * occurrence range as defined by Occurrence Range OK (�3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs) != 0)
@@ -16884,21 +16886,21 @@ xmlSchemaCheckRCaseNSSubset(xmlSchemaParserCtxtPtr ctxt,
/* TODO: Error codes (rcase-NSSubset). */
/*
* SPEC (1) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (§3.9.6)."
+ * occurrence range as defined by Occurrence Range OK (�3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs))
return (1);
/*
* SPEC (2) "R's {namespace constraint} must be an intensional subset
- * of B's {namespace constraint} as defined by Wildcard Subset (§3.10.6)."
+ * of B's {namespace constraint} as defined by Wildcard Subset (�3.10.6)."
*/
if (xmlSchemaCheckCOSNSSubset((xmlSchemaWildcardPtr) r->children,
(xmlSchemaWildcardPtr) b->children))
return (1);
/*
- * SPEC (3) "Unless B is the content model wildcard of the ·ur-type
- * definition·, R's {process contents} must be identical to or stronger
+ * SPEC (3) "Unless B is the content model wildcard of the �ur-type
+ * definitionďż˝, R's {process contents} must be identical to or stronger
* than B's {process contents}, where strict is stronger than lax is
* stronger than skip."
*/
@@ -16948,6 +16950,7 @@ xmlSchemaCheckCOSParticleRestrict(xmlSchemaParserCtxtPtr ctxt,
return (0);
}
+#if 0
/**
* xmlSchemaCheckRCaseNSRecurseCheckCardinality:
* @ctxt: the schema parser context
@@ -16975,12 +16978,12 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
if ((r->children == NULL) || (r->children->children == NULL))
return (-1);
/*
- * SPEC "For a group particle to be a ·valid restriction· of a
+ * SPEC "For a group particle to be a �valid restriction� of a
* wildcard particle..."
*
- * SPEC (1) "Every member of the {particles} of the group is a ·valid
- * restriction· of the wildcard as defined by
- * Particle Valid (Restriction) (§3.9.6)."
+ * SPEC (1) "Every member of the {particles} of the group is a �valid
+ * restrictionďż˝ of the wildcard as defined by
+ * Particle Valid (Restriction) (�3.9.6)."
*/
part = (xmlSchemaParticlePtr) r->children->children;
do {
@@ -16991,7 +16994,7 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
/*
* SPEC (2) "The effective total range of the group [...] is a
* valid restriction of B's occurrence range as defined by
- * Occurrence Range OK (§3.9.6)."
+ * Occurrence Range OK (�3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(
xmlSchemaGetParticleTotalRangeMin(r),
@@ -17000,6 +17003,7 @@ xmlSchemaCheckRCaseNSRecurseCheckCardinality(xmlSchemaParserCtxtPtr ctxt,
return (1);
return (0);
}
+#endif
/**
* xmlSchemaCheckRCaseRecurse:
@@ -17030,11 +17034,11 @@ xmlSchemaCheckRCaseRecurse(xmlSchemaParserCtxtPtr ctxt,
(r->children->type != b->children->type))
return (-1);
/*
- * SPEC "For an all or sequence group particle to be a ·valid
- * restriction· of another group particle with the same {compositor}..."
+ * SPEC "For an all or sequence group particle to be a �valid
+ * restrictionďż˝ of another group particle with the same {compositor}..."
*
* SPEC (1) "R's occurrence range is a valid restriction of B's
- * occurrence range as defined by Occurrence Range OK (§3.9.6)."
+ * occurrence range as defined by Occurrence Range OK (�3.9.6)."
*/
if (xmlSchemaCheckParticleRangeOK(r->minOccurs, r->maxOccurs,
b->minOccurs, b->maxOccurs))
@@ -17131,7 +17135,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt,
/*
* SPEC st-restrict-facets 1:
- * "The {variety} of R is the same as that of B."
+ * "The {variety} of R is the same as that of B."
*/
/*
* SPEC st-restrict-facets 2:
@@ -17603,7 +17607,7 @@ xmlSchemaDeriveAndValidateFacets(xmlSchemaParserCtxtPtr pctxt,
* The whitespace must be stronger.
*/
if (facet->whitespace < bfacet->whitespace) {
- FACET_RESTR_ERR(flength,
+ FACET_RESTR_ERR(facet,
"The 'whitespace' value has to be equal to "
"or stronger than the 'whitespace' value of "
"the base type")
@@ -17658,7 +17662,7 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaTypeLinkPtr link, lastLink, prevLink, subLink, newLink;
/*
* The actual value is then formed by replacing any union type
- * definition in the ·explicit members· with the members of their
+ * definition in the �explicit members� with the members of their
* {member type definitions}, in order.
*
* TODO: There's a bug entry at
@@ -17704,7 +17708,7 @@ xmlSchemaFinishMemberTypeDefinitionsProperty(xmlSchemaParserCtxtPtr pctxt,
static void
xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
-{
+{
int has = 0, needVal = 0, normVal = 0;
has = (type->baseType->flags & XML_SCHEMAS_TYPE_HAS_FACETS) ? 1 : 0;
@@ -17716,7 +17720,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
}
if (type->facets != NULL) {
xmlSchemaFacetPtr fac;
-
+
for (fac = type->facets; fac != NULL; fac = fac->next) {
switch (fac->type) {
case XML_SCHEMA_FACET_WHITESPACE:
@@ -17734,7 +17738,7 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
has = 1;
break;
}
- }
+ }
}
if (normVal)
type->flags |= XML_SCHEMAS_TYPE_NORMVALUENEEDED;
@@ -17751,24 +17755,24 @@ xmlSchemaTypeFixupOptimFacets(xmlSchemaTypePtr type)
if ((prim->builtInType != XML_SCHEMAS_ANYSIMPLETYPE) &&
(prim->builtInType != XML_SCHEMAS_STRING)) {
type->flags |= XML_SCHEMAS_TYPE_FACETSNEEDVALUE;
- }
- }
+ }
+ }
}
static int
xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type)
{
-
-
+
+
/*
* Evaluate the whitespace-facet value.
- */
+ */
if (WXS_IS_LIST(type)) {
type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE;
return (0);
} else if (WXS_IS_UNION(type))
return (0);
-
+
if (type->facetSet != NULL) {
xmlSchemaFacetLinkPtr lin;
@@ -17792,23 +17796,23 @@ xmlSchemaTypeFixupWhitespace(xmlSchemaTypePtr type)
}
}
/*
- * For all ·atomic· datatypes other than string (and types ·derived·
- * by ·restriction· from it) the value of whiteSpace is fixed to
+ * For all �atomic� datatypes other than string (and types �derived�
+ * by �restriction� from it) the value of whiteSpace is fixed to
* collapse
*/
{
xmlSchemaTypePtr anc;
- for (anc = type->baseType; anc != NULL &&
+ for (anc = type->baseType; anc != NULL &&
anc->builtInType != XML_SCHEMAS_ANYTYPE;
anc = anc->baseType) {
if (anc->type == XML_SCHEMA_TYPE_BASIC) {
- if (anc->builtInType == XML_SCHEMAS_NORMSTRING) {
+ if (anc->builtInType == XML_SCHEMAS_NORMSTRING) {
type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_REPLACE;
} else if ((anc->builtInType == XML_SCHEMAS_STRING) ||
- (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) {
+ (anc->builtInType == XML_SCHEMAS_ANYSIMPLETYPE)) {
type->flags |= XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE;
} else
@@ -17845,7 +17849,7 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt,
} else if (WXS_IS_UNION(type)) {
/*
* Corresponds to <simpleType><union>...
- */
+ */
if (type->memberTypes == NULL) {
/*
* This one is really needed, so get out.
@@ -17853,8 +17857,8 @@ xmlSchemaFixupSimpleTypeStageOne(xmlSchemaParserCtxtPtr pctxt,
PERROR_INT("xmlSchemaFixupSimpleTypeStageOne",
"union type has no member-types assigned");
return(-1);
- }
- } else {
+ }
+ } else {
/*
* Corresponds to <simpleType><restriction>...
*/
@@ -17969,7 +17973,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
}
if (WXS_IS_TYPE_NOT_FIXED(type->baseType))
xmlSchemaTypeFixup(type->baseType, ACTXT_CAST pctxt);
- /*
+ /*
* If a member type of a union is a union itself, we need to substitute
* that member type for its member types.
* NOTE that this might change in WXS 1.1; i.e. we will keep the union
@@ -17977,12 +17981,12 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
*/
if ((type->memberTypes != NULL) &&
(xmlSchemaFinishMemberTypeDefinitionsProperty(pctxt, type) == -1))
- return(-1);
+ return(-1);
/*
- * SPEC src-simple-type 1
+ * SPEC src-simple-type 1
* "The corresponding simple type definition, if any, must satisfy
* the conditions set out in Constraints on Simple Type Definition
- * Schema Components (§3.14.6)."
+ * Schema Components (�3.14.6)."
*/
/*
* Schema Component Constraint: Simple Type Definition Properties Correct
@@ -17990,7 +17994,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
*/
res = xmlSchemaCheckSTPropsCorrect(pctxt, type);
HFAILURE HERROR
- /*
+ /*
* Schema Component Constraint: Derivation Valid (Restriction, Simple)
* (cos-st-restricts)
*/
@@ -18023,7 +18027,7 @@ xmlSchemaFixupSimpleTypeStageTwo(xmlSchemaParserCtxtPtr pctxt,
*/
res = xmlSchemaTypeFixupWhitespace(type);
HFAILURE HERROR
- xmlSchemaTypeFixupOptimFacets(type);
+ xmlSchemaTypeFixupOptimFacets(type);
exit_error:
#ifdef DEBUG_TYPE
@@ -18054,7 +18058,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
PERROR_INT("xmlSchemaFixupComplexType",
"missing baseType");
goto exit_failure;
- }
+ }
/*
* Fixup the base type.
*/
@@ -18066,12 +18070,12 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
* TODO: Generate a warning!
*/
return(0);
- }
+ }
/*
* This basically checks if the base type can be derived.
*/
res = xmlSchemaCheckSRCCT(pctxt, type);
- HFAILURE HERROR
+ HFAILURE HERROR
/*
* Fixup the content type.
*/
@@ -18145,7 +18149,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
type->facets = NULL;
content->facetSet = type->facetSet;
type->facetSet = NULL;
-
+
type->contentTypeDef = content;
if (WXS_IS_TYPE_NOT_FIXED(contentBase))
xmlSchemaTypeFixup(contentBase, ACTXT_CAST pctxt);
@@ -18154,10 +18158,10 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
* for circularity here.
*/
res = xmlSchemaFixupSimpleTypeStageOne(pctxt, content);
- HFAILURE HERROR
+ HFAILURE HERROR
res = xmlSchemaFixupSimpleTypeStageTwo(pctxt, content);
- HFAILURE HERROR
-
+ HFAILURE HERROR
+
} else if ((WXS_IS_COMPLEX(baseType)) &&
(baseType->contentType == XML_SCHEMA_CONTENT_MIXED) &&
(WXS_IS_RESTRICTION(type))) {
@@ -18242,7 +18246,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
( ((xmlSchemaTreeItemPtr) particle->children)->children == NULL))) {
if (type->flags & XML_SCHEMAS_TYPE_MIXED) {
/*
- * SPEC (2.1.4) "If the ·effective mixed· is true, then
+ * SPEC (2.1.4) "If the �effective mixed� is true, then
* a particle whose properties are as follows:..."
*
* Empty sequence model group with
@@ -18267,7 +18271,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
XML_SCHEMA_TYPE_SEQUENCE, type->node);
if (particle->children == NULL)
goto exit_failure;
-
+
type->subtypes = (xmlSchemaTypePtr) particle;
}
dummySequence = 1;
@@ -18304,7 +18308,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
if (type->contentType == XML_SCHEMA_CONTENT_EMPTY) {
/*
* SPEC (3.2.1)
- * "If the ·effective content· is empty, then the
+ * "If the �effective content� is empty, then the
* {content type} of the [...] base ..."
*/
type->contentType = baseType->contentType;
@@ -18411,7 +18415,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
particle->children =
((xmlSchemaParticlePtr) baseType->subtypes)->children;
/*
- * SPEC "followed by the ·effective content·."
+ * SPEC "followed by the �effective content�."
*/
particle->next = effectiveContent;
/*
@@ -18555,12 +18559,12 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
/* 4.3.5.5 Constraints on enumeration Schema Components
* Schema Component Constraint: enumeration valid restriction
- * It is an ·error· if any member of {value} is not in the
- * ·value space· of {base type definition}.
+ * It is an �error� if any member of {value} is not in the
+ * �value space� of {base type definition}.
*
* minInclusive, maxInclusive, minExclusive, maxExclusive:
- * The value ·must· be in the
- * ·value space· of the ·base type·.
+ * The value �must� be in the
+ * �value space� of the �base type�.
*/
/*
* This function is intended to deliver a compiled value
@@ -18580,11 +18584,11 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
}
} else
base = typeDecl;
-
+
if (! ctxtGiven) {
/*
* A context is needed if called from RelaxNG.
- */
+ */
pctxt = xmlSchemaNewParserCtxt("*");
if (pctxt == NULL)
return (-1);
@@ -18595,17 +18599,17 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
* facet->node is just the node holding the facet
* definition, *not* the attribute holding the *value*
* of the facet.
- */
+ */
ret = xmlSchemaVCheckCVCSimpleType(
ACTXT_CAST pctxt, facet->node, base,
facet->value, &(facet->val), 1, 1, 0);
if (ret != 0) {
if (ret < 0) {
/* No error message for RelaxNG. */
- if (ctxtGiven) {
+ if (ctxtGiven) {
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_INTERNAL, facet->node, NULL,
- "Internal error: xmlSchemaCheckFacet, "
+ "Internal error: xmlSchemaCheckFacet, "
"failed to validate the value '%s' of the "
"facet '%s' against the base type",
facet->value, xmlSchemaFacetTypeToString(facet->type));
@@ -18680,17 +18684,17 @@ xmlSchemaCheckFacet(xmlSchemaFacetPtr facet,
/* error code */
xmlSchemaCustomErr4(ACTXT_CAST pctxt,
ret, facet->node, WXS_BASIC_CAST typeDecl,
- "The value '%s' of the facet '%s' is not a valid '%s'",
+ "The value '%s' of the facet '%s' is not a valid '%s'",
facet->value,
xmlSchemaFacetTypeToString(facet->type),
- (facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ?
+ (facet->type != XML_SCHEMA_FACET_TOTALDIGITS) ?
BAD_CAST "nonNegativeInteger" :
BAD_CAST "positiveInteger",
NULL);
}
}
break;
-
+
case XML_SCHEMA_FACET_WHITESPACE:{
if (xmlStrEqual(facet->value, BAD_CAST "preserve")) {
facet->whitespace = XML_SCHEMAS_FACET_PRESERVE;
@@ -18903,7 +18907,7 @@ xmlSchemaModelGroupToModelGroupDefFixup(
{
particle = WXS_PTC_CAST particle->next;
continue;
- }
+ }
if (WXS_MODELGROUPDEF_MODEL(WXS_PARTICLE_TERM(particle)) == NULL) {
/*
* TODO: Remove the particle.
@@ -18953,7 +18957,7 @@ xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr,
if (gr == ctxtGr)
return(ref);
if (gr->flags & XML_SCHEMAS_ATTRGROUP_MARKED)
- continue;
+ continue;
/*
* Mark as visited to avoid infinite recursion on
* circular references not yet examined.
@@ -18963,12 +18967,12 @@ xmlSchemaCheckAttrGroupCircularRecur(xmlSchemaAttributeGroupPtr ctxtGr,
{
gr->flags |= XML_SCHEMAS_ATTRGROUP_MARKED;
circ = xmlSchemaCheckAttrGroupCircularRecur(ctxtGr,
- (xmlSchemaItemListPtr) gr->attrUses);
+ (xmlSchemaItemListPtr) gr->attrUses);
gr->flags ^= XML_SCHEMAS_ATTRGROUP_MARKED;
if (circ != NULL)
return (circ);
}
-
+
}
}
return (NULL);
@@ -18995,9 +18999,9 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr,
* not be an <attributeGroup> with ref [attribute] which resolves
* to the component corresponding to this <attributeGroup>. Indirect
* circularity is also ruled out. That is, when QName resolution
- * (Schema Document) (§3.15.3) is applied to a ·QName· arising from
+ * (Schema Document) (�3.15.3) is applied to a �QName� arising from
* any <attributeGroup>s with a ref [attribute] among the [children],
- * it must not be the case that a ·QName· is encountered at any depth
+ * it must not be the case that a �QName� is encountered at any depth
* which resolves to the component corresponding to this <attributeGroup>.
*/
if (attrGr->attrUses == NULL)
@@ -19006,9 +19010,9 @@ xmlSchemaCheckAttrGroupCircular(xmlSchemaAttributeGroupPtr attrGr,
return(0);
else {
xmlSchemaQNameRefPtr circ;
-
+
circ = xmlSchemaCheckAttrGroupCircularRecur(attrGr,
- (xmlSchemaItemListPtr) attrGr->attrUses);
+ (xmlSchemaItemListPtr) attrGr->attrUses);
if (circ != NULL) {
xmlChar *str = NULL;
/*
@@ -19040,7 +19044,7 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
* xmlSchemaExpandAttributeGroupRefs:
* @pctxt: the parser context
* @node: the node of the component holding the attribute uses
- * @completeWild: the intersected wildcard to be returned
+ * @completeWild: the intersected wildcard to be returned
* @list: the attribute uses
*
* Substitutes contained attribute group references
@@ -19069,7 +19073,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
for (i = 0; i < list->nbItems; i++) {
use = list->items[i];
- if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
+ if (use->type == XML_SCHEMA_EXTRA_ATTR_USE_PROHIB) {
if (prohibs == NULL) {
PERROR_INT("xmlSchemaExpandAttributeGroupRefs",
"unexpected attr prohibition found");
@@ -19084,7 +19088,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
/*
* Note that duplicate prohibitions were already
* handled at parsing time.
- */
+ */
/*
* Add to list of prohibitions.
*/
@@ -19137,7 +19141,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
*completeWild = tmpWild;
created = 1;
}
-
+
if (xmlSchemaIntersectWildcards(pctxt, *completeWild,
gr->attributeWildcard) == -1)
return(-1);
@@ -19211,7 +19215,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
/**
* xmlSchemaAttributeGroupExpandRefs:
* @pctxt: the parser context
- * @attrGr: the attribute group definition
+ * @attrGr: the attribute group definition
*
* Computation of:
* {attribute uses} property
@@ -19223,7 +19227,7 @@ xmlSchemaExpandAttributeGroupRefs(xmlSchemaParserCtxtPtr pctxt,
static int
xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaAttributeGroupPtr attrGr)
-{
+{
if ((attrGr->attrUses == NULL) ||
(attrGr->flags & XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED))
return(0);
@@ -19231,33 +19235,33 @@ xmlSchemaAttributeGroupExpandRefs(xmlSchemaParserCtxtPtr pctxt,
attrGr->flags |= XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED;
if (xmlSchemaExpandAttributeGroupRefs(pctxt, WXS_BASIC_CAST attrGr,
&(attrGr->attributeWildcard), attrGr->attrUses, NULL) == -1)
- return(-1);
+ return(-1);
return(0);
}
/**
* xmlSchemaAttributeGroupExpandRefs:
* @pctxt: the parser context
- * @attrGr: the attribute group definition
+ * @attrGr: the attribute group definition
*
* Substitutes contained attribute group references
* for their attribute uses. Wilcards are intersected.
- *
+ *
* Schema Component Constraint:
- * Attribute Group Definition Properties Correct (ag-props-correct)
+ * Attribute Group Definition Properties Correct (ag-props-correct)
*/
static int
xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaAttributeGroupPtr attrGr)
-{
+{
/*
* SPEC ag-props-correct
* (1) "The values of the properties of an attribute group definition
* must be as described in the property tableau in The Attribute
- * Group Definition Schema Component (§3.6.1), modulo the impact of
- * Missing Sub-components (§5.3);"
+ * Group Definition Schema Component (�3.6.1), modulo the impact of
+ * Missing Sub-components (�5.3);"
*/
-
+
if ((attrGr->attrUses != NULL) &&
(WXS_LIST_CAST attrGr->attrUses)->nbItems > 1)
{
@@ -19266,7 +19270,7 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
int i, j, hasId = 0;
for (i = uses->nbItems -1; i >= 0; i--) {
- use = uses->items[i];
+ use = uses->items[i];
/*
* SPEC ag-props-correct
* (2) "Two distinct members of the {attribute uses} must not have
@@ -19282,7 +19286,7 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
WXS_ATTRUSE_DECL_TNS(tmp)))
{
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_AG_PROPS_CORRECT,
attrGr->node, WXS_BASIC_CAST attrGr,
@@ -19306,13 +19310,13 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
* are derived from ID."
* TODO: Does 'derived' include member-types of unions?
*/
- if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
+ if (WXS_ATTRUSE_TYPEDEF(use) != NULL) {
if (xmlSchemaIsDerivedFromBuiltInType(
WXS_ATTRUSE_TYPEDEF(use), XML_SCHEMAS_ID))
- {
+ {
if (hasId) {
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_AG_PROPS_CORRECT,
attrGr->node, WXS_BASIC_CAST attrGr,
@@ -19325,7 +19329,7 @@ xmlSchemaCheckAGPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
FREE_AND_NULL(str);
if (xmlSchemaItemListRemove(uses, i) == -1)
return(-1);
- }
+ }
hasId = 1;
}
}
@@ -19389,10 +19393,10 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
* SPEC a-props-correct (1)
* "The values of the properties of an attribute declaration must
* be as described in the property tableau in The Attribute
- * Declaration Schema Component (§3.2.1), modulo the impact of
- * Missing Sub-components (§5.3)."
+ * Declaration Schema Component (�3.2.1), modulo the impact of
+ * Missing Sub-components (�5.3)."
*/
-
+
if (WXS_ATTR_TYPEDEF(attr) == NULL)
return(0);
@@ -19418,8 +19422,8 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
/*
* SPEC a-props-correct (2)
* "if there is a {value constraint}, the canonical lexical
- * representation of its value must be ·valid· with respect
- * to the {type definition} as defined in String Valid (§3.14.4)."
+ * representation of its value must be �valid� with respect
+ * to the {type definition} as defined in String Valid (�3.14.4)."
* TODO: Don't care about the *cononical* stuff here, this requirement
* will be removed in WXS 1.1 anyway.
*/
@@ -19441,7 +19445,7 @@ xmlSchemaCheckAttrPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
return(pctxt->err);
}
}
-
+
return(0);
}
@@ -19487,15 +19491,15 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
/*
* SPEC (1) "The values of the properties of an element declaration
* must be as described in the property tableau in The Element
- * Declaration Schema Component (§3.3.1), modulo the impact of Missing
- * Sub-components (§5.3)."
+ * Declaration Schema Component (�3.3.1), modulo the impact of Missing
+ * Sub-components (�5.3)."
*/
if (WXS_SUBST_HEAD(elemDecl) != NULL) {
xmlSchemaElementPtr head = WXS_SUBST_HEAD(elemDecl), circ;
xmlSchemaCheckElementDeclComponent(head, pctxt);
/*
- * SPEC (3) "If there is a non-·absent· {substitution group
+ * SPEC (3) "If there is a non-�absent� {substitution group
* affiliation}, then {scope} must be global."
*/
if ((elemDecl->flags & XML_SCHEMAS_ELEM_GLOBAL) == 0) {
@@ -19539,9 +19543,9 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
* of the element declaration must be validly derived from the {type
* definition} of the {substitution group affiliation}, given the value
* of the {substitution group exclusions} of the {substitution group
- * affiliation}, as defined in Type Derivation OK (Complex) (§3.4.6)
+ * affiliation}, as defined in Type Derivation OK (Complex) (�3.4.6)
* (if the {type definition} is complex) or as defined in
- * Type Derivation OK (Simple) (§3.14.6) (if the {type definition} is
+ * Type Derivation OK (Simple) (�3.14.6) (if the {type definition} is
* simple)."
*
* NOTE: {substitution group exclusions} means the values of the
@@ -19605,9 +19609,9 @@ xmlSchemaCheckElemPropsCorrect(xmlSchemaParserCtxtPtr pctxt,
/*
* SPEC (2) "If there is a {value constraint}, the canonical lexical
- * representation of its value must be ·valid· with respect to the
+ * representation of its value must be �valid� with respect to the
* {type definition} as defined in Element Default Valid (Immediate)
- * (§3.3.6)."
+ * (�3.3.6)."
*/
if (typeDef == NULL) {
xmlSchemaPErr(pctxt, elemDecl->node,
@@ -19675,7 +19679,7 @@ xmlSchemaCheckElemSubstGroup(xmlSchemaParserCtxtPtr ctxt,
/*
* SPEC (2) "It is validly substitutable for HEAD subject to HEAD's
* {disallowed substitutions} as the blocking constraint, as defined in
- * Substitution Group OK (Transitive) (§3.3.6)."
+ * Substitution Group OK (Transitive) (�3.3.6)."
*/
for (head = WXS_SUBST_HEAD(elemDecl); head != NULL;
head = WXS_SUBST_HEAD(head)) {
@@ -19767,12 +19771,12 @@ add_member:
* @ctxtParticle: the first particle of the context component
* @searchParticle: the element declaration particle to be analysed
*
- * Schema Component Constraint: Element Declarations Consistent
+ * Schema Component Constraint: Element Declarations Consistent
*/
static int
xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
xmlSchemaBasicItemPtr ctxtComponent,
- xmlSchemaParticlePtr ctxtParticle,
+ xmlSchemaParticlePtr ctxtParticle,
xmlSchemaParticlePtr searchParticle,
xmlSchemaParticlePtr curParticle,
int search)
@@ -19781,7 +19785,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
int ret = 0;
xmlSchemaParticlePtr cur = curParticle;
- if (curParticle == NULL) {
+ if (curParticle == NULL) {
return(0);
}
if (WXS_PARTICLE_TERM(curParticle) == NULL) {
@@ -19790,7 +19794,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
* might arise due to an invalid "term" component.
*/
return(0);
- }
+ }
while (cur != NULL) {
switch (WXS_PARTICLE_TERM(cur)->type) {
case XML_SCHEMA_TYPE_ANY:
@@ -19800,7 +19804,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
ret = xmlSchemaCheckElementDeclConsistent(pctxt,
ctxtComponent, ctxtParticle, cur, ctxtParticle, 1);
if (ret != 0)
- return(ret);
+ return(ret);
} else {
xmlSchemaElementPtr elem =
WXS_ELEM_CAST(WXS_PARTICLE_TERM(cur));
@@ -19808,7 +19812,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
* SPEC Element Declarations Consistent:
* "If the {particles} contains, either directly,
* indirectly (that is, within the {particles} of a
- * contained model group, recursively) or ·implicitly·
+ * contained model group, recursively) or �implicitly�
* two or more element declaration particles with
* the same {name} and {target namespace}, then
* all their type definitions must be the same
@@ -19820,7 +19824,7 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
WXS_PARTICLE_TERM_AS_ELEM(searchParticle)->targetNamespace))
{
xmlChar *strA = NULL, *strB = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
/* TODO: error code */
XML_SCHEMAP_COS_NONAMBIG,
@@ -19837,16 +19841,16 @@ xmlSchemaCheckElementDeclConsistent(xmlSchemaParserCtxtPtr pctxt,
FREE_AND_NULL(strB);
return(XML_SCHEMAP_COS_NONAMBIG);
}
- }
+ }
break;
- case XML_SCHEMA_TYPE_SEQUENCE: {
+ case XML_SCHEMA_TYPE_SEQUENCE: {
break;
}
case XML_SCHEMA_TYPE_CHOICE:{
/*
xmlSchemaTreeItemPtr sub;
-
- sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
+
+ sub = WXS_PARTICLE_TERM(particle)->children; (xmlSchemaParticlePtr)
while (sub != NULL) {
ret = xmlSchemaCheckElementDeclConsistent(pctxt, ctxtComponent,
ctxtParticle, ctxtElem);
@@ -19883,7 +19887,7 @@ exit:
* @name: the name of the attribute
*
* Validates the value constraints of an element declaration.
- * Adds substitution group members.
+ * Adds substitution group members.
*/
static void
xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl,
@@ -19898,7 +19902,7 @@ xmlSchemaCheckElementDeclComponent(xmlSchemaElementPtr elemDecl,
/*
* Adds substitution group members.
*/
- xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
+ xmlSchemaCheckElemSubstGroup(ctxt, elemDecl);
}
}
@@ -19928,7 +19932,7 @@ xmlSchemaResolveModelGroupParticleReferences(
XML_SCHEMA_EXTRA_QNAMEREF))
{
goto next_particle;
- }
+ }
ref = WXS_QNAME_CAST WXS_PARTICLE_TERM(particle);
/*
* Resolve the reference.
@@ -19944,7 +19948,7 @@ xmlSchemaResolveModelGroupParticleReferences(
ref->targetNamespace, ref->itemType, NULL);
/* TODO: remove the particle. */
goto next_particle;
- }
+ }
if (refItem->type == XML_SCHEMA_TYPE_GROUP) {
if (WXS_MODELGROUPDEF_MODEL(refItem) == NULL)
/* TODO: remove the particle. */
@@ -19994,9 +19998,9 @@ next_particle:
static int
xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
- xmlSchemaValPtr y)
-{
- xmlSchemaTypePtr tx, ty, ptx, pty;
+ xmlSchemaValPtr y)
+{
+ xmlSchemaTypePtr tx, ty, ptx, pty;
int ret;
while (x != NULL) {
@@ -20006,12 +20010,12 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
ptx = xmlSchemaGetPrimitiveType(tx);
pty = xmlSchemaGetPrimitiveType(ty);
/*
- * (1) if a datatype T' is ·derived· by ·restriction· from an
- * atomic datatype T then the ·value space· of T' is a subset of
- * the ·value space· of T. */
+ * (1) if a datatype T' is �derived� by �restriction� from an
+ * atomic datatype T then the �value space� of T' is a subset of
+ * the �value space� of T. */
/*
- * (2) if datatypes T' and T'' are ·derived· by ·restriction·
- * from a common atomic ancestor T then the ·value space·s of T'
+ * (2) if datatypes T' and T'' are �derived� by �restriction�
+ * from a common atomic ancestor T then the �value space�s of T'
* and T'' may overlap.
*/
if (ptx != pty)
@@ -20042,7 +20046,7 @@ xmlSchemaAreValuesEqual(xmlSchemaValPtr x,
if (x != NULL) {
y = xmlSchemaValueGetNext(y);
if (y == NULL)
- return (0);
+ return (0);
} else if (xmlSchemaValueGetNext(y) != NULL)
return (0);
else
@@ -20092,11 +20096,11 @@ xmlSchemaResolveAttrUseReferences(xmlSchemaAttributeUsePtr ause,
/**
* xmlSchemaCheckAttrUsePropsCorrect:
* @ctxt: a parser context
- * @use: an attribute use
+ * @use: an attribute use
*
* Schema Component Constraint:
* Attribute Use Correct (au-props-correct)
- *
+ *
*/
static int
xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
@@ -20106,16 +20110,16 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
return(-1);
if ((use->defValue == NULL) || (WXS_ATTRUSE_DECL(use) == NULL) ||
((WXS_ATTRUSE_DECL(use))->type != XML_SCHEMA_TYPE_ATTRIBUTE))
- return(0);
+ return(0);
/*
* SPEC au-props-correct (1)
* "The values of the properties of an attribute use must be as
* described in the property tableau in The Attribute Use Schema
- * Component (§3.5.1), modulo the impact of Missing
- * Sub-components (§5.3)."
+ * Component (�3.5.1), modulo the impact of Missing
+ * Sub-components (�5.3)."
*/
-
+
if (((WXS_ATTRUSE_DECL(use))->defValue != NULL) &&
((WXS_ATTRUSE_DECL(use))->flags & XML_SCHEMAS_ATTR_FIXED) &&
((use->flags & XML_SCHEMA_ATTR_USE_FIXED) == 0))
@@ -20135,7 +20139,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
if ((use->defVal != NULL) && (WXS_ATTRUSE_TYPEDEF(use) != NULL)) {
int ret;
/*
- * TODO: The spec seems to be missing a check of the
+ * TODO: The spec seems to be missing a check of the
* value constraint of the attribute use. We will do it here.
*/
/*
@@ -20152,7 +20156,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
NULL, NULL);
return(ctxt->err);
}
-
+
ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST ctxt,
use->node, WXS_ATTRUSE_TYPEDEF(use),
use->defValue, &(use->defVal),
@@ -20203,7 +20207,7 @@ xmlSchemaCheckAttrUsePropsCorrect(xmlSchemaParserCtxtPtr ctxt,
/**
* xmlSchemaResolveAttrTypeReferences:
* @item: an attribute declaration
- * @ctxt: a parser context
+ * @ctxt: a parser context
*
* Resolves the referenced type definition component.
*/
@@ -20214,8 +20218,8 @@ xmlSchemaResolveAttrTypeReferences(xmlSchemaAttributePtr item,
/*
* The simple type definition corresponding to the <simpleType> element
* information item in the [children], if present, otherwise the simple
- * type definition ·resolved· to by the ·actual value· of the type
- * [attribute], if present, otherwise the ·simple ur-type definition·.
+ * type definition �resolved� to by the �actual value� of the type
+ * [attribute], if present, otherwise the �simple ur-type definition�.
*/
if (item->flags & XML_SCHEMAS_ATTR_INTERNAL_RESOLVED)
return(0);
@@ -20294,7 +20298,7 @@ xmlSchemaResolveIDCKeyReferences(xmlSchemaIDCPtr idc,
((xmlSchemaIDCPtr) idc->ref->item)->nbFields) {
xmlChar *str = NULL;
xmlSchemaIDCPtr refer;
-
+
refer = (xmlSchemaIDCPtr) idc->ref->item;
/*
* SPEC c-props-correct(2)
@@ -20353,7 +20357,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
int wasRedefined;
if (redef == NULL)
- return(0);
+ return(0);
do {
item = redef->item;
@@ -20368,7 +20372,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
* <redefine>d schema. Currenlty we latter approach is used.
* SUPPLEMENT: It seems that the WG moves towards the latter
* approach, so we are doing it right.
- *
+ *
*/
prev = xmlSchemaFindRedefCompInGraph(
redef->targetBucket, item->type,
@@ -20379,11 +20383,11 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
/*
* SPEC src-redefine:
- * (6.2.1) "The ·actual value· of its own name attribute plus
- * target namespace must successfully ·resolve· to a model
+ * (6.2.1) "The �actual value� of its own name attribute plus
+ * target namespace must successfully �resolve� to a model
* group definition in I."
- * (7.2.1) "The ·actual value· of its own name attribute plus
- * target namespace must successfully ·resolve· to an attribute
+ * (7.2.1) "The �actual value� of its own name attribute plus
+ * target namespace must successfully �resolve� to an attribute
* group definition in I."
*
@@ -20400,7 +20404,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
/*
* TODO: error code.
* Probably XML_SCHEMAP_SRC_RESOLVE, if this is using the
- * reference kind.
+ * reference kind.
*/
XML_SCHEMAP_SRC_REDEFINE, node, NULL,
"The %s '%s' to be redefined could not be found in "
@@ -20408,7 +20412,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
WXS_ITEM_TYPE_NAME(item),
xmlSchemaFormatQName(&str, redef->refTargetNs,
redef->refName));
- FREE_AND_NULL(str);
+ FREE_AND_NULL(str);
err = pctxt->err;
redef = redef->next;
continue;
@@ -20434,7 +20438,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
* base type of the redefining type.
* TODO: How
*/
- ((xmlSchemaTypePtr) item)->baseType =
+ ((xmlSchemaTypePtr) item)->baseType =
(xmlSchemaTypePtr) prev;
break;
case XML_SCHEMA_TYPE_GROUP:
@@ -20489,7 +20493,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
default:
PERROR_INT("xmlSchemaResolveRedefReferences",
"Unexpected redefined component type");
- return(-1);
+ return(-1);
}
if (wasRedefined) {
xmlChar *str = NULL;
@@ -20499,7 +20503,7 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
node = WXS_ITEM_NODE(redef->reference);
else
node = WXS_ITEM_NODE(redef->item);
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
/* TODO: error code. */
XML_SCHEMAP_SRC_REDEFINE,
@@ -20508,12 +20512,12 @@ xmlSchemaCheckSRCRedefineFirst(xmlSchemaParserCtxtPtr pctxt)
"redefinition of the same component is not supported",
xmlSchemaGetComponentDesignation(&str, prev),
NULL);
- FREE_AND_NULL(str)
+ FREE_AND_NULL(str)
err = pctxt->err;
redef = redef->next;
continue;
}
- redef = redef->next;
+ redef = redef->next;
} while (redef != NULL);
return(err);
@@ -20527,7 +20531,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
xmlSchemaBasicItemPtr item;
if (redef == NULL)
- return(0);
+ return(0);
do {
if (redef->target == NULL) {
@@ -20535,7 +20539,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
continue;
}
item = redef->item;
-
+
switch (item->type) {
case XML_SCHEMA_TYPE_SIMPLE:
case XML_SCHEMA_TYPE_COMPLEX:
@@ -20544,7 +20548,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
* type to be 'absent', we'll NULL it.
*/
(WXS_TYPE_CAST redef->target)->name = NULL;
-
+
/*
* TODO: Seems like there's nothing more to do. The normal
* inheritance mechanism is used. But not 100% sure.
@@ -20556,10 +20560,10 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
* SPEC src-redefine:
* (6.2.2) "The {model group} of the model group definition
* which corresponds to it per XML Representation of Model
- * Group Definition Schema Components (§3.7.2) must be a
- * ·valid restriction· of the {model group} of that model
+ * Group Definition Schema Components (�3.7.2) must be a
+ * �valid restriction� of the {model group} of that model
* group definition in I, as defined in Particle Valid
- * (Restriction) (§3.9.6)."
+ * (Restriction) (�3.9.6)."
*/
break;
case XML_SCHEMA_TYPE_ATTRIBUTEGROUP:
@@ -20568,11 +20572,11 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
* (7.2.2) "The {attribute uses} and {attribute wildcard} of
* the attribute group definition which corresponds to it
* per XML Representation of Attribute Group Definition Schema
- * Components (§3.6.2) must be ·valid restrictions· of the
+ * Components (�3.6.2) must be �valid restrictions� of the
* {attribute uses} and {attribute wildcard} of that attribute
* group definition in I, as defined in clause 2, clause 3 and
* clause 4 of Derivation Valid (Restriction, Complex)
- * (§3.4.6) (where references to the base type definition are
+ * (�3.4.6) (where references to the base type definition are
* understood as references to the attribute group definition
* in I)."
*/
@@ -20593,7 +20597,7 @@ xmlSchemaCheckSRCRedefineSecond(xmlSchemaParserCtxtPtr pctxt)
} while (redef != NULL);
return(0);
}
-
+
static int
xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
@@ -20627,8 +20631,8 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
return(-1);
if (bucket->flags & XML_SCHEMA_BUCKET_COMPS_ADDED)
return(0);
- bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED;
-
+ bucket->flags |= XML_SCHEMA_BUCKET_COMPS_ADDED;
+
for (i = 0; i < bucket->globals->nbItems; i++) {
item = bucket->globals->items[i];
table = NULL;
@@ -20669,12 +20673,12 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
case XML_SCHEMA_TYPE_NOTATION:
name = ((xmlSchemaNotationPtr) item)->name;
WXS_GET_GLOBAL_HASH(bucket, notaDecl)
- break;
+ break;
default:
PERROR_INT("xmlSchemaAddComponents",
"Unexpected global component type");
- continue;
- }
+ continue;
+ }
if (*table == NULL) {
*table = xmlHashCreateDict(10, pctxt->dict);
if (*table == NULL) {
@@ -20682,11 +20686,11 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
"failed to create a component hash table");
return(-1);
}
- }
+ }
err = xmlHashAddEntry(*table, name, item);
- if (err != 0) {
+ if (err != 0) {
xmlChar *str = NULL;
-
+
xmlSchemaCustomErr(ACTXT_CAST pctxt,
XML_SCHEMAP_REDEFINED_TYPE,
WXS_ITEM_NODE(item),
@@ -20694,7 +20698,7 @@ xmlSchemaAddComponents(xmlSchemaParserCtxtPtr pctxt,
"A global %s '%s' does already exist",
WXS_ITEM_TYPE_NAME(item),
xmlSchemaGetComponentQName(&str, item));
- FREE_AND_NULL(str);
+ FREE_AND_NULL(str);
}
}
/*
@@ -20728,34 +20732,34 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
if ((con->pending == NULL) ||
(con->pending->nbItems == 0))
- return(0);
+ return(0);
/*
* Since xmlSchemaFixupComplexType() will create new particles
* (local components), and those particle components need a bucket
* on the constructor, we'll assure here that the constructor has
* a bucket.
- * TODO: Think about storing locals _only_ on the main bucket.
- */
+ * TODO: Think about storing locals _only_ on the main bucket.
+ */
if (con->bucket == NULL)
- con->bucket = rootBucket;
+ con->bucket = rootBucket;
/* TODO:
* SPEC (src-redefine):
* (6.2) "If it has no such self-reference, then all of the
* following must be true:"
-
+
* (6.2.2) The {model group} of the model group definition which
* corresponds to it per XML Representation of Model Group
- * Definition Schema Components (§3.7.2) must be a ·valid
- * restriction· of the {model group} of that model group definition
- * in I, as defined in Particle Valid (Restriction) (§3.9.6)."
+ * Definition Schema Components (�3.7.2) must be a �valid
+ * restrictionďż˝ of the {model group} of that model group definition
+ * in I, as defined in Particle Valid (Restriction) (�3.9.6)."
*/
xmlSchemaCheckSRCRedefineFirst(pctxt);
/*
* Add global components to the schemata's hash tables.
- */
+ */
xmlSchemaAddComponents(pctxt, rootBucket);
pctxt->ctxtType = NULL;
@@ -20765,7 +20769,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
* Now that we have parsed *all* the schema document(s) and converted
* them to schema components, we can resolve references, apply component
* constraints, create the FSA from the content model, etc.
- */
+ */
/*
* Resolve references of..
*
@@ -20786,7 +20790,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
* 6. IDC key-references:
* - the referenced IDC 'key' or 'unique' definition
* 7. Attribute prohibitions which had a "ref" attribute.
- */
+ */
for (i = 0; i < nbItems; i++) {
item = items[i];
switch (item->type) {
@@ -20812,7 +20816,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
FIXHFAILURE;
break;
case XML_SCHEMA_EXTRA_QNAMEREF:
- if ((WXS_QNAME_CAST item)->itemType ==
+ if ((WXS_QNAME_CAST item)->itemType ==
XML_SCHEMA_TYPE_ATTRIBUTEGROUP)
{
xmlSchemaResolveAttrGroupReferences(
@@ -20849,11 +20853,11 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
}
if (pctxt->nberrors != 0)
goto exit_error;
-
+
/*
* Now that all references are resolved we
* can check for circularity of...
- * 1. the base axis of type definitions
+ * 1. the base axis of type definitions
* 2. nested model group definitions
* 3. nested attribute group definitions
* TODO: check for circual substitution groups.
@@ -20888,7 +20892,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
break;
default:
break;
- }
+ }
}
if (pctxt->nberrors != 0)
goto exit_error;
@@ -20904,7 +20908,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
item = items[i];
switch (item->type) {
case XML_SCHEMA_TYPE_SEQUENCE:
- case XML_SCHEMA_TYPE_CHOICE:
+ case XML_SCHEMA_TYPE_CHOICE:
xmlSchemaModelGroupToModelGroupDefFixup(pctxt,
WXS_MODEL_GROUP_CAST item);
break;
@@ -20935,7 +20939,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
}
if (pctxt->nberrors != 0)
goto exit_error;
- /*
+ /*
* First compute the variety of simple types. This is needed as
* a seperate step, since otherwise we won't be able to detect
* circular union types in all cases.
@@ -20965,7 +20969,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
switch (item->type) {
case XML_SCHEMA_TYPE_SIMPLE:
if (((xmlSchemaTypePtr) item)->memberTypes != NULL) {
- xmlSchemaCheckUnionTypeDefCircular(pctxt,
+ xmlSchemaCheckUnionTypeDefCircular(pctxt,
(xmlSchemaTypePtr) item);
FIXHFAILURE;
}
@@ -20976,7 +20980,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
}
if (pctxt->nberrors != 0)
goto exit_error;
-
+
/*
* Do the complete type fixup for simple types.
*/
@@ -21004,10 +21008,10 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
for (i = 0; i < nbItems; i++) {
item = items[i];
switch (item->type) {
- case XML_SCHEMA_TYPE_ATTRIBUTE:
+ case XML_SCHEMA_TYPE_ATTRIBUTE:
xmlSchemaCheckAttrPropsCorrect(pctxt, WXS_ATTR_CAST item);
FIXHFAILURE;
- break;
+ break;
default:
break;
}
@@ -21016,7 +21020,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
goto exit_error;
/*
* Apply constraints for attribute uses.
- */
+ */
for (i = 0; i < nbItems; i++) {
item = items[i];
switch (item->type) {
@@ -21063,7 +21067,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
if (pctxt->nberrors != 0)
goto exit_error;
- /*
+ /*
* Complex types are builded and checked.
*/
for (i = 0; i < nbItems; i++) {
@@ -21087,8 +21091,8 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
* will create particles and model groups in some cases.
*/
items = (xmlSchemaTreeItemPtr *) con->pending->items;
- nbItems = con->pending->nbItems;
-
+ nbItems = con->pending->nbItems;
+
/*
* Apply some constraints for element declarations.
*/
@@ -21097,7 +21101,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
switch (item->type) {
case XML_SCHEMA_TYPE_ELEMENT:
elemDecl = (xmlSchemaElementPtr) item;
-
+
if ((elemDecl->flags & XML_SCHEMAS_ELEM_INTERNAL_CHECKED) == 0)
{
xmlSchemaCheckElementDeclComponent(
@@ -21127,7 +21131,7 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
}
if (pctxt->nberrors != 0)
goto exit_error;
-
+
/*
* Finally we can build the automaton from the content model of
* complex types.
@@ -21148,10 +21152,10 @@ xmlSchemaFixupComponents(xmlSchemaParserCtxtPtr pctxt,
goto exit_error;
/*
* URGENT TODO: cos-element-consistent
- */
- goto exit;
+ */
+ goto exit;
-exit_error:
+exit_error:
ret = pctxt->err;
goto exit;
@@ -21165,12 +21169,12 @@ exit:
* if not cleared here.
*/
con->bucket = oldbucket;
- con->pending->nbItems = 0;
+ con->pending->nbItems = 0;
if (con->substGroups != NULL) {
xmlHashFree(con->substGroups,
(xmlHashDeallocator) xmlSchemaSubstGroupFree);
con->substGroups = NULL;
- }
+ }
if (con->redefs != NULL) {
xmlSchemaRedefListFree(con->redefs);
con->redefs = NULL;
@@ -21233,11 +21237,11 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
if (res == -1)
goto exit_failure;
if (res != 0)
- goto exit;
+ goto exit;
if (bucket == NULL) {
/* TODO: Error code, actually we failed to *locate* the schema. */
- if (ctxt->URL)
+ if (ctxt->URL)
xmlSchemaCustomErr(ACTXT_CAST ctxt, XML_SCHEMAP_FAILED_LOAD,
NULL, NULL,
"Failed to locate the main schema resource at '%s'",
@@ -21248,16 +21252,16 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
"Failed to locate the main schema resource",
NULL, NULL);
goto exit;
- }
+ }
/* Then do the parsing for good. */
if (xmlSchemaParseNewDocWithContext(ctxt, mainSchema, bucket) == -1)
goto exit_failure;
if (ctxt->nberrors != 0)
goto exit;
-
+
mainSchema->doc = bucket->doc;
mainSchema->preserve = ctxt->preserve;
-
+
ctxt->schema = mainSchema;
if (xmlSchemaFixupComponents(ctxt, WXS_CONSTRUCTOR(ctxt)->mainBucket) == -1)
@@ -21267,8 +21271,8 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
* TODO: This is not nice, since we cannot distinguish from the
* result if there was an internal error or not.
*/
-exit:
- if (ctxt->nberrors != 0) {
+exit:
+ if (ctxt->nberrors != 0) {
if (mainSchema) {
xmlSchemaFree(mainSchema);
mainSchema = NULL;
@@ -21282,7 +21286,7 @@ exit:
ctxt->schema = NULL;
return(mainSchema);
exit_failure:
- /*
+ /*
* Quite verbose, but should catch internal errors, which were
* not communitated.
*/
@@ -21296,7 +21300,7 @@ exit_failure:
ctxt->ownsConstructor = 0;
}
PERROR_INT2("xmlSchemaParse",
- "An internal error occured");
+ "An internal error occured");
ctxt->schema = NULL;
return(NULL);
}
@@ -21433,8 +21437,8 @@ xmlSchemaGetWhiteSpaceFacetValue(xmlSchemaTypePtr type)
return(XML_SCHEMA_WHITESPACE_REPLACE);
else {
/*
- * For all ·atomic· datatypes other than string (and types ·derived·
- * by ·restriction· from it) the value of whiteSpace is fixed to
+ * For all �atomic� datatypes other than string (and types �derived�
+ * by �restriction� from it) the value of whiteSpace is fixed to
* collapse
* Note that this includes built-in list datatypes.
*/
@@ -21521,11 +21525,11 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
* XML_SCHEMA_SCHEMA_MAIN if it is the first schema document.
*/
ret = xmlSchemaAddSchemaDoc(pctxt, XML_SCHEMA_SCHEMA_IMPORT,
- location, NULL, NULL, 0, node, NULL, nsName,
+ location, NULL, NULL, 0, node, NULL, nsName,
&bucket);
if (ret != 0)
- return(ret);
- if (bucket == NULL) {
+ return(ret);
+ if (bucket == NULL) {
/*
* Generate a warning that the document could not be located.
*/
@@ -21555,17 +21559,17 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
pctxt->nberrors = 0;
pctxt->err = 0;
pctxt->doc = bucket->doc;
-
- ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
+
+ ret = xmlSchemaParseNewDocWithContext(pctxt, schema, bucket);
if (ret == -1) {
pctxt->doc = NULL;
goto exit_failure;
}
/* Paranoid error channelling. */
if ((ret == 0) && (pctxt->nberrors != 0))
- ret = pctxt->err;
- if (pctxt->nberrors == 0) {
- /*
+ ret = pctxt->err;
+ if (pctxt->nberrors == 0) {
+ /*
* Only bother to fixup pending components, if there was
* no error yet.
* For every XSI acquired schema (and its sub-schemata) we will
@@ -21581,7 +21585,7 @@ xmlSchemaAssembleByLocation(xmlSchemaValidCtxtPtr vctxt,
vctxt->err = ret;
vctxt->nberrors += pctxt->nberrors;
} else {
- /* Add to validation error sum. */
+ /* Add to validation error sum. */
vctxt->nberrors += pctxt->nberrors;
}
pctxt->doc = NULL;
@@ -21592,7 +21596,7 @@ exit_failure:
}
static xmlSchemaAttrInfoPtr
-xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
+xmlSchemaGetMetaAttrInfo(xmlSchemaValidCtxtPtr vctxt,
int metaType)
{
if (vctxt->nbAttrInfos == 0)
@@ -21682,7 +21686,7 @@ xmlSchemaAssembleByXSI(xmlSchemaValidCtxtPtr vctxt)
/*
* If using @schemaLocation then tuples are expected.
* I.e. the namespace name *and* the document's URI.
- */
+ */
xmlSchemaCustomWarning(ACTXT_CAST vctxt, XML_SCHEMAV_MISC,
iattr->node, NULL,
"The value must consist of tuples: the target namespace "
@@ -21711,7 +21715,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
if (vctxt->sax != NULL) {
int i, j;
xmlSchemaNodeInfoPtr inode;
-
+
for (i = vctxt->depth; i >= 0; i--) {
if (vctxt->elemInfos[i]->nbNsBindings != 0) {
inode = vctxt->elemInfos[i];
@@ -21725,16 +21729,16 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
* Note that the namespace bindings are already
* in a string dict.
*/
- return (inode->nsBindings[j+1]);
+ return (inode->nsBindings[j+1]);
}
}
}
}
return (NULL);
-#ifdef LIBXML_WRITER_ENABLED
+#ifdef LIBXML_READER_ENABLED
} else if (vctxt->reader != NULL) {
xmlChar *nsName;
-
+
nsName = xmlTextReaderLookupNamespace(vctxt->reader, prefix);
if (nsName != NULL) {
const xmlChar *ret;
@@ -21766,7 +21770,7 @@ xmlSchemaLookupNamespace(xmlSchemaValidCtxtPtr vctxt,
* This one works on the schema of the validation context.
*/
static int
-xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
+xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
xmlSchemaPtr schema,
xmlNodePtr node,
const xmlChar *value,
@@ -21791,7 +21795,7 @@ xmlSchemaValidateNotation(xmlSchemaValidCtxtPtr vctxt,
if (prefix != NULL) {
const xmlChar *nsName = NULL;
- if (vctxt != NULL)
+ if (vctxt != NULL)
nsName = xmlSchemaLookupNamespace(vctxt, BAD_CAST prefix);
else if (node != NULL) {
xmlNsPtr ns = xmlSearchNs(node->doc, node, prefix);
@@ -22143,7 +22147,7 @@ xmlSchemaIDCFreeBinding(xmlSchemaPSVIIDCBindingPtr bind)
if (bind->nodeTable != NULL)
xmlFree(bind->nodeTable);
if (bind->dupls != NULL)
- xmlSchemaItemListFree(bind->dupls);
+ xmlSchemaItemListFree(bind->dupls);
xmlFree(bind);
}
@@ -22178,12 +22182,12 @@ xmlSchemaIDCFreeMatcherList(xmlSchemaIDCMatcherPtr matcher)
while (matcher != NULL) {
next = matcher->next;
- if (matcher->keySeqs != NULL) {
+ if (matcher->keySeqs != NULL) {
int i;
for (i = 0; i < matcher->sizeKeySeqs; i++)
if (matcher->keySeqs[i] != NULL)
xmlFree(matcher->keySeqs[i]);
- xmlFree(matcher->keySeqs);
+ xmlFree(matcher->keySeqs);
}
if (matcher->targets != NULL) {
if (matcher->idcType == XML_SCHEMA_TYPE_IDC_KEYREF) {
@@ -22223,7 +22227,7 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
while (matcher != NULL) {
next = matcher->next;
- if (matcher->keySeqs != NULL) {
+ if (matcher->keySeqs != NULL) {
int i;
/*
* Don't free the array, but only the content.
@@ -22252,7 +22256,7 @@ xmlSchemaIDCReleaseMatcherList(xmlSchemaValidCtxtPtr vctxt,
}
xmlSchemaItemListFree(matcher->targets);
matcher->targets = NULL;
- }
+ }
matcher->next = NULL;
/*
* Cache the matcher.
@@ -22294,7 +22298,7 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
sto = vctxt->xpathStatePool;
vctxt->xpathStatePool = sto->next;
sto->next = NULL;
- } else {
+ } else {
/*
* Create a new state object.
*/
@@ -22305,10 +22309,10 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
return (-1);
}
memset(sto, 0, sizeof(xmlSchemaIDCStateObj));
- }
+ }
/*
- * Add to global list.
- */
+ * Add to global list.
+ */
if (vctxt->xpathStates != NULL)
sto->next = vctxt->xpathStates;
vctxt->xpathStates = sto;
@@ -22328,13 +22332,13 @@ xmlSchemaIDCAddStateObject(xmlSchemaValidCtxtPtr vctxt,
VERROR_INT("xmlSchemaIDCAddStateObject",
"failed to create an XPath validation context");
return (-1);
- }
+ }
sto->type = type;
sto->depth = vctxt->depth;
sto->matcher = matcher;
sto->sel = sel;
sto->nbHistory = 0;
-
+
#ifdef DEBUG_IDC
xmlGenericError(xmlGenericErrorContext, "IDC: STO push '%s'\n",
sto->sel->xpath);
@@ -22358,7 +22362,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
{
xmlSchemaIDCStateObjPtr sto, head = NULL, first;
int res, resolved = 0, depth = vctxt->depth;
-
+
if (vctxt->xpathStates == NULL)
return (0);
@@ -22367,8 +22371,8 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
#ifdef DEBUG_IDC
{
xmlChar *str = NULL;
- xmlGenericError(xmlGenericErrorContext,
- "IDC: EVAL on %s, depth %d, type %d\n",
+ xmlGenericError(xmlGenericErrorContext,
+ "IDC: EVAL on %s, depth %d, type %d\n",
xmlSchemaFormatQName(&str, vctxt->inode->nsName,
vctxt->inode->localName), depth, nodeType);
FREE_AND_NULL(str)
@@ -22382,10 +22386,10 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
while (sto != head) {
#ifdef DEBUG_IDC
if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR)
- xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n",
+ xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] selector '%s'\n",
sto->matcher->aidc->def->name, sto->sel->xpath);
else
- xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] field '%s'\n",
+ xmlGenericError(xmlGenericErrorContext, "IDC: ['%s'] field '%s'\n",
sto->matcher->aidc->def->name, sto->sel->xpath);
#endif
if (nodeType == XML_ELEMENT_NODE)
@@ -22415,7 +22419,7 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
if (sto->history == NULL) {
sto->history = (int *) xmlMalloc(5 * sizeof(int));
if (sto->history == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"allocating the state object history", NULL);
return(-1);
}
@@ -22425,11 +22429,11 @@ xmlSchemaXPathEvaluate(xmlSchemaValidCtxtPtr vctxt,
sto->history = (int *) xmlRealloc(sto->history,
sto->sizeHistory * sizeof(int));
if (sto->history == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"re-allocating the state object history", NULL);
return(-1);
}
- }
+ }
sto->history[sto->nbHistory++] = depth;
#ifdef DEBUG_IDC
@@ -22498,7 +22502,7 @@ xmlSchemaFormatIDCKeySequence(xmlSchemaValidCtxtPtr vctxt,
*buf = xmlStrdup(BAD_CAST "[");
for (i = 0; i < count; i++) {
*buf = xmlStrcat(*buf, BAD_CAST "'");
- res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
+ res = xmlSchemaGetCanonValueWhtspExt(seq[i]->val,
xmlSchemaGetWhiteSpaceFacetValue(seq[i]->type),
&value);
if (res == 0)
@@ -22556,7 +22560,7 @@ xmlSchemaXPathPop(xmlSchemaValidCtxtPtr vctxt)
*
* Processes and pops the history items of the IDC state objects.
* IDC key-sequences are validated/created on IDC bindings.
- *
+ *
* Returns 0 on success and -1 on internal errors.
*/
static int
@@ -22575,13 +22579,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
#ifdef DEBUG_IDC
{
xmlChar *str = NULL;
- xmlGenericError(xmlGenericErrorContext,
+ xmlGenericError(xmlGenericErrorContext,
"IDC: BACK on %s, depth %d\n",
xmlSchemaFormatQName(&str, vctxt->inode->nsName,
vctxt->inode->localName), vctxt->depth);
FREE_AND_NULL(str)
}
-#endif
+#endif
/*
* Evaluate the state objects.
*/
@@ -22607,14 +22611,14 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
if (matchDepth != depth) {
sto = sto->next;
continue;
- }
+ }
if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_FIELD) {
/*
* NOTE: According to
* http://www.w3.org/Bugs/Public/show_bug.cgi?id=2198
* ... the simple-content of complex types is also allowed.
*/
-
+
if (WXS_IS_COMPLEX(type)) {
if (WXS_HAS_SIMPLE_CONTENT(type)) {
/*
@@ -22629,17 +22633,17 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
}
} else
simpleType = NULL;
- } else
+ } else
simpleType = type;
if (simpleType == NULL) {
xmlChar *str = NULL;
-
+
/*
* Not qualified if the field resolves to a node of non
* simple type.
- */
+ */
xmlSchemaCustomErr(ACTXT_CAST vctxt,
- XML_SCHEMAV_CVC_IDC, NULL,
+ XML_SCHEMAV_CVC_IDC, NULL,
WXS_BASIC_CAST sto->matcher->aidc->def,
"The XPath '%s' of a field of %s does evaluate to a node of "
"non-simple type",
@@ -22649,7 +22653,7 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
sto->nbHistory--;
goto deregister_check;
}
-
+
if ((key == NULL) && (vctxt->inode->val == NULL)) {
/*
* Failed to provide the normalized value; maybe
@@ -22665,13 +22669,13 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
xmlSchemaIDCMatcherPtr matcher = sto->matcher;
xmlSchemaPSVIIDCKeyPtr *keySeq;
int pos, idx;
-
+
/*
* The key will be anchored on the matcher's list of
* key-sequences. The position in this list is determined
* by the target node's depth relative to the matcher's
* depth of creation (i.e. the depth of the scope element).
- *
+ *
* Element Depth Pos List-entries
* <scope> 0 NULL
* <bar> 1 NULL
@@ -22682,23 +22686,23 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
* The size of the list is only dependant on the depth of
* the tree.
* An entry will be NULLed in selector_leave, i.e. when
- * we hit the target's
- */
+ * we hit the target's
+ */
pos = sto->depth - matcher->depth;
idx = sto->sel->index;
-
+
/*
* Create/grow the array of key-sequences.
*/
if (matcher->keySeqs == NULL) {
- if (pos > 9)
+ if (pos > 9)
matcher->sizeKeySeqs = pos * 2;
else
matcher->sizeKeySeqs = 10;
- matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
+ matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
xmlMalloc(matcher->sizeKeySeqs *
- sizeof(xmlSchemaPSVIIDCKeyPtr *));
- if (matcher->keySeqs == NULL) {
+ sizeof(xmlSchemaPSVIIDCKeyPtr *));
+ if (matcher->keySeqs == NULL) {
xmlSchemaVErrMemory(NULL,
"allocating an array of key-sequences",
NULL);
@@ -22707,9 +22711,9 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
memset(matcher->keySeqs, 0,
matcher->sizeKeySeqs *
sizeof(xmlSchemaPSVIIDCKeyPtr *));
- } else if (pos >= matcher->sizeKeySeqs) {
+ } else if (pos >= matcher->sizeKeySeqs) {
int i = matcher->sizeKeySeqs;
-
+
matcher->sizeKeySeqs *= 2;
matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **)
xmlRealloc(matcher->keySeqs,
@@ -22725,29 +22729,29 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
* The array needs to be NULLed.
* TODO: Use memset?
*/
- for (; i < matcher->sizeKeySeqs; i++)
- matcher->keySeqs[i] = NULL;
+ for (; i < matcher->sizeKeySeqs; i++)
+ matcher->keySeqs[i] = NULL;
}
-
+
/*
* Get/create the key-sequence.
*/
- keySeq = matcher->keySeqs[pos];
- if (keySeq == NULL) {
+ keySeq = matcher->keySeqs[pos];
+ if (keySeq == NULL) {
goto create_sequence;
} else if (keySeq[idx] != NULL) {
xmlChar *str = NULL;
/*
* cvc-identity-constraint:
- * 3 For each node in the ·target node set· all
+ * 3 For each node in the �target node set� all
* of the {fields}, with that node as the context
* node, evaluate to either an empty node-set or
* a node-set with exactly one member, which must
* have a simple type.
- *
+ *
* The key was already set; report an error.
*/
- xmlSchemaCustomErr(ACTXT_CAST vctxt,
+ xmlSchemaCustomErr(ACTXT_CAST vctxt,
XML_SCHEMAV_CVC_IDC, NULL,
WXS_BASIC_CAST matcher->aidc->def,
"The XPath '%s' of a field of %s evaluates to a "
@@ -22758,27 +22762,27 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt,
sto->nbHistory--;
goto deregister_check;
} else
- goto create_key;
-
+ goto create_key;
+
create_sequence:
/*
* Create a key-sequence.
*/
keySeq = (xmlSchemaPSVIIDCKeyPtr *) xmlMalloc(
- matcher->aidc->def->nbFields *
+ matcher->aidc->def->nbFields *
sizeof(xmlSchemaPSVIIDCKeyPtr));
if (keySeq == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"allocating an IDC key-sequence", NULL);
- return(-1);
- }
- memset(keySeq, 0, matcher->aidc->def->nbFields *
+ return(-1);
+ }
+ memset(keySeq, 0, matcher->aidc->def->nbFields *
sizeof(xmlSchemaPSVIIDCKeyPtr));
matcher->keySeqs[pos] = keySeq;
create_key:
/*
* Create a key once per node only.
- */
+ */
if (key == NULL) {
key = (xmlSchemaPSVIIDCKeyPtr) xmlMalloc(
sizeof(xmlSchemaPSVIIDCKey));
@@ -22787,7 +22791,7 @@ create_key:
"allocating a IDC key", NULL);
xmlFree(keySeq);
matcher->keySeqs[pos] = NULL;
- return(-1);
+ return(-1);
}
/*
* Consume the compiled value.
@@ -22803,10 +22807,10 @@ create_key:
return (-1);
}
}
- keySeq[idx] = key;
+ keySeq[idx] = key;
}
} else if (sto->type == XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) {
-
+
xmlSchemaPSVIIDCKeyPtr **keySeq = NULL;
/* xmlSchemaPSVIIDCBindingPtr bind; */
xmlSchemaPSVIIDCNodePtr ntItem;
@@ -22817,22 +22821,22 @@ create_key:
/*
* Here we have the following scenario:
* An IDC 'selector' state object resolved to a target node,
- * during the time this target node was in the
- * ancestor-or-self axis, the 'field' state object(s) looked
- * out for matching nodes to create a key-sequence for this
+ * during the time this target node was in the
+ * ancestor-or-self axis, the 'field' state object(s) looked
+ * out for matching nodes to create a key-sequence for this
* target node. Now we are back to this target node and need
- * to put the key-sequence, together with the target node
- * itself, into the node-table of the corresponding IDC
+ * to put the key-sequence, together with the target node
+ * itself, into the node-table of the corresponding IDC
* binding.
*/
matcher = sto->matcher;
idc = matcher->aidc->def;
nbKeys = idc->nbFields;
- pos = depth - matcher->depth;
+ pos = depth - matcher->depth;
/*
* Check if the matcher has any key-sequences at all, plus
* if it has a key-sequence for the current target node.
- */
+ */
if ((matcher->keySeqs == NULL) ||
(matcher->sizeKeySeqs <= pos)) {
if (idc->type == XML_SCHEMA_TYPE_IDC_KEY)
@@ -22840,15 +22844,15 @@ create_key:
else
goto selector_leave;
}
-
- keySeq = &(matcher->keySeqs[pos]);
+
+ keySeq = &(matcher->keySeqs[pos]);
if (*keySeq == NULL) {
if (idc->type == XML_SCHEMA_TYPE_IDC_KEY)
goto selector_key_error;
else
goto selector_leave;
}
-
+
for (i = 0; i < nbKeys; i++) {
if ((*keySeq)[i] == NULL) {
/*
@@ -22859,18 +22863,18 @@ create_key:
* All fields of a "key" IDC must resolve.
*/
goto selector_key_error;
- }
+ }
goto selector_leave;
}
}
/*
* All fields did resolve.
*/
-
+
/*
* 4.1 If the {identity-constraint category} is unique(/key),
- * then no two members of the ·qualified node set· have
- * ·key-sequences· whose members are pairwise equal, as
+ * then no two members of the �qualified node set� have
+ * �key-sequences� whose members are pairwise equal, as
* defined by Equal in [XML Schemas: Datatypes].
*
* Get the IDC binding from the matcher and check for
@@ -22880,10 +22884,10 @@ create_key:
bind = xmlSchemaIDCAcquireBinding(vctxt, matcher);
#endif
targets = xmlSchemaIDCAcquireTargetList(vctxt, matcher);
- if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
+ if ((idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) &&
(targets->nbItems != 0)) {
xmlSchemaPSVIIDCKeyPtr ckey, bkey, *bkeySeq;
-
+
i = 0;
res = 0;
/*
@@ -22894,7 +22898,7 @@ create_key:
((xmlSchemaPSVIIDCNodePtr) targets->items[i])->keys;
for (j = 0; j < nbKeys; j++) {
ckey = (*keySeq)[j];
- bkey = bkeySeq[j];
+ bkey = bkeySeq[j];
res = xmlSchemaAreValuesEqual(ckey->val, bkey->val);
if (res == -1) {
return (-1);
@@ -22916,10 +22920,10 @@ create_key:
} while (i < targets->nbItems);
if (i != targets->nbItems) {
xmlChar *str = NULL, *strB = NULL;
- /*
+ /*
* TODO: Try to report the key-sequence.
*/
- xmlSchemaCustomErr(ACTXT_CAST vctxt,
+ xmlSchemaCustomErr(ACTXT_CAST vctxt,
XML_SCHEMAV_CVC_IDC, NULL,
WXS_BASIC_CAST idc,
"Duplicate key-sequence %s in %s",
@@ -22937,15 +22941,15 @@ create_key:
ntItem = (xmlSchemaPSVIIDCNodePtr) xmlMalloc(
sizeof(xmlSchemaPSVIIDCNode));
if (ntItem == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"allocating an IDC node-table item", NULL);
xmlFree(*keySeq);
*keySeq = NULL;
return(-1);
- }
+ }
memset(ntItem, 0, sizeof(xmlSchemaPSVIIDCNode));
-
- /*
+
+ /*
* Store the node-table item in a global list.
*/
if (idc->type != XML_SCHEMA_TYPE_IDC_KEYREF) {
@@ -22967,7 +22971,7 @@ create_key:
xmlFree(ntItem);
xmlFree(*keySeq);
*keySeq = NULL;
- return (-1);
+ return (-1);
}
}
/*
@@ -22979,11 +22983,11 @@ create_key:
ntItem->keys = *keySeq;
*keySeq = NULL;
#if 0
- if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1) {
+ if (xmlSchemaIDCAppendNodeTableItem(bind, ntItem) == -1)
#endif
if (xmlSchemaItemListAdd(targets, ntItem) == -1) {
if (idc->type == XML_SCHEMA_TYPE_IDC_KEYREF) {
- /*
+ /*
* Free the item, since keyref items won't be
* put on a global list.
*/
@@ -22992,18 +22996,18 @@ create_key:
}
return (-1);
}
-
+
goto selector_leave;
selector_key_error:
{
xmlChar *str = NULL;
/*
- * 4.2.1 (KEY) The ·target node set· and the
- * ·qualified node set· are equal, that is, every
- * member of the ·target node set· is also a member
- * of the ·qualified node set· and vice versa.
+ * 4.2.1 (KEY) The �target node set� and the
+ * �qualified node set� are equal, that is, every
+ * member of the �target node set� is also a member
+ * of the �qualified node set� and vice versa.
*/
- xmlSchemaCustomErr(ACTXT_CAST vctxt,
+ xmlSchemaCustomErr(ACTXT_CAST vctxt,
XML_SCHEMAV_CVC_IDC, NULL,
WXS_BASIC_CAST idc,
"Not all fields of %s evaluate to a node",
@@ -23019,7 +23023,7 @@ selector_leave:
*keySeq = NULL;
}
} /* if selector */
-
+
sto->nbHistory--;
deregister_check:
@@ -23070,15 +23074,15 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
xmlSchemaIDCMatcherPtr matcher, last = NULL;
xmlSchemaIDCPtr idc, refIdc;
xmlSchemaIDCAugPtr aidc;
-
+
idc = (xmlSchemaIDCPtr) elemDecl->idcs;
if (idc == NULL)
return (0);
-
+
#ifdef DEBUG_IDC
{
xmlChar *str = NULL;
- xmlGenericError(xmlGenericErrorContext,
+ xmlGenericError(xmlGenericErrorContext,
"IDC: REGISTER on %s, depth %d\n",
(char *) xmlSchemaFormatQName(&str, vctxt->inode->nsName,
vctxt->inode->localName), vctxt->depth);
@@ -23119,7 +23123,7 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
"Could not find an augmented IDC item for an IDC "
"definition");
return (-1);
- }
+ }
if ((aidc->keyrefDepth == -1) ||
(vctxt->depth < aidc->keyrefDepth))
aidc->keyrefDepth = vctxt->depth;
@@ -23150,10 +23154,10 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
vctxt->idcMatcherCache = matcher->nextCached;
matcher->nextCached = NULL;
} else {
- matcher = (xmlSchemaIDCMatcherPtr)
+ matcher = (xmlSchemaIDCMatcherPtr)
xmlMalloc(sizeof(xmlSchemaIDCMatcher));
if (matcher == NULL) {
- xmlSchemaVErrMemory(vctxt,
+ xmlSchemaVErrMemory(vctxt,
"allocating an IDC matcher", NULL);
return (-1);
}
@@ -23166,16 +23170,16 @@ xmlSchemaIDCRegisterMatchers(xmlSchemaValidCtxtPtr vctxt,
last = matcher;
matcher->type = IDC_MATCHER;
- matcher->depth = vctxt->depth;
+ matcher->depth = vctxt->depth;
matcher->aidc = aidc;
matcher->idcType = aidc->def->type;
-#ifdef DEBUG_IDC
+#ifdef DEBUG_IDC
xmlGenericError(xmlGenericErrorContext, "IDC: register matcher\n");
-#endif
+#endif
/*
- * Init the automaton state object.
+ * Init the automaton state object.
*/
- if (xmlSchemaIDCAddStateObject(vctxt, matcher,
+ if (xmlSchemaIDCAddStateObject(vctxt, matcher,
idc->selector, XPATH_STATE_OBJ_TYPE_IDC_SELECTOR) == -1)
return (-1);
@@ -23192,7 +23196,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
int res, i, j, k, nbTargets, nbFields, nbDupls, nbNodeTable;
xmlSchemaPSVIIDCKeyPtr *keys, *ntkeys;
xmlSchemaPSVIIDCNodePtr *targets, *dupls;
-
+
xmlSchemaIDCMatcherPtr matcher = ielem->idcMatchers;
/* vctxt->createIDCNodeTables */
while (matcher != NULL) {
@@ -23226,7 +23230,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
nbDupls = bind->dupls->nbItems;
} else {
dupls = NULL;
- nbDupls = 0;
+ nbDupls = 0;
}
if (bind->nodeTable != NULL) {
nbNodeTable = bind->nbNodes;
@@ -23239,29 +23243,29 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
* Transfer all IDC target-nodes to the IDC node-table.
*/
bind->nodeTable =
- (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
+ (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
bind->sizeNodes = matcher->targets->sizeItems;
bind->nbNodes = matcher->targets->nbItems;
matcher->targets->items = NULL;
matcher->targets->sizeItems = 0;
- matcher->targets->nbItems = 0;
+ matcher->targets->nbItems = 0;
} else {
/*
* Compare the key-sequences and add to the IDC node-table.
*/
nbTargets = matcher->targets->nbItems;
- targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
+ targets = (xmlSchemaPSVIIDCNodePtr *) matcher->targets->items;
nbFields = matcher->aidc->def->nbFields;
i = 0;
do {
keys = targets[i]->keys;
- if (nbDupls) {
+ if (nbDupls) {
/*
* Search in already found duplicates first.
*/
j = 0;
- do {
+ do {
if (nbFields == 1) {
res = xmlSchemaAreValuesEqual(keys[0]->val,
dupls[j]->keys[0]->val);
@@ -23296,11 +23300,11 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
}
}
j++;
- } while (j < nbDupls);
+ } while (j < nbDupls);
}
if (nbNodeTable) {
j = 0;
- do {
+ do {
if (nbFields == 1) {
res = xmlSchemaAreValuesEqual(keys[0]->val,
bind->nodeTable[j]->keys[0]->val);
@@ -23327,7 +23331,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
goto next_node_table_entry;
}
}
- }
+ }
/*
* Add the duplicate to the list of duplicates.
*/
@@ -23335,7 +23339,7 @@ xmlSchemaIDCFillNodeTables(xmlSchemaValidCtxtPtr vctxt,
bind->dupls = xmlSchemaItemListCreate();
if (bind->dupls == NULL)
goto internal_error;
- }
+ }
if (xmlSchemaItemListAdd(bind->dupls, bind->nodeTable[j]) == -1)
goto internal_error;
/*
@@ -23370,12 +23374,12 @@ internal_error:
}
/**
- * xmlSchemaBubbleIDCNodeTables:
+ * xmlSchemaBubbleIDCNodeTables:
* @depth: the current tree depth
*
- * Merges IDC bindings of an element at @depth into the corresponding IDC
- * bindings of its parent element. If a duplicate note-table entry is found,
- * both, the parent node-table entry and child entry are discarded from the
+ * Merges IDC bindings of an element at @depth into the corresponding IDC
+ * bindings of its parent element. If a duplicate note-table entry is found,
+ * both, the parent node-table entry and child entry are discarded from the
* node-table of the parent.
*
* Returns 0 if OK and -1 on internal errors.
@@ -23389,19 +23393,19 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
xmlSchemaIDCAugPtr aidc;
int i, j, k, ret = 0, nbFields, oldNum, oldDupls;
- bind = vctxt->inode->idcTable;
+ bind = vctxt->inode->idcTable;
if (bind == NULL) {
/* Fine, no table, no bubbles. */
return (0);
}
-
+
parTable = &(vctxt->elemInfos[vctxt->depth -1]->idcTable);
/*
* Walk all bindings; create new or add to existing bindings.
* Remove duplicate key-sequences.
*/
while (bind != NULL) {
-
+
if ((bind->nbNodes == 0) && WXS_ILIST_IS_EMPTY(bind->dupls))
goto next_binding;
/*
@@ -23411,7 +23415,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
aidc = vctxt->aidcs;
do {
if (aidc->def == bind->definition) {
- if ((aidc->keyrefDepth == -1) ||
+ if ((aidc->keyrefDepth == -1) ||
(aidc->keyrefDepth >= vctxt->depth)) {
goto next_binding;
}
@@ -23427,7 +23431,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
* Search a matching parent binding for the
* IDC definition.
*/
- while (parBind != NULL) {
+ while (parBind != NULL) {
if (parBind->definition == bind->definition)
break;
parBind = parBind->next;
@@ -23435,7 +23439,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
if (parBind != NULL) {
/*
- * Compare every node-table entry of the child node,
+ * Compare every node-table entry of the child node,
* i.e. the key-sequence within, ...
*/
oldNum = parBind->nbNodes; /* Skip newly added items. */
@@ -23445,12 +23449,12 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
dupls = (xmlSchemaPSVIIDCNodePtr *) parBind->dupls->items;
} else {
dupls = NULL;
- oldDupls = 0;
+ oldDupls = 0;
}
-
+
parNodes = parBind->nodeTable;
nbFields = bind->definition->nbFields;
-
+
for (i = 0; i < bind->nbNodes; i++) {
node = bind->nodeTable[i];
if (node == NULL)
@@ -23460,7 +23464,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
* evaluated to be a duplicate key-sequence.
*/
if (oldDupls) {
- j = 0;
+ j = 0;
while (j < oldDupls) {
if (nbFields == 1) {
ret = xmlSchemaAreValuesEqual(
@@ -23493,12 +23497,12 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
/* Duplicate found. Skip this entry. */
continue;
}
- }
+ }
/*
* ... and with every key-sequence of the parent node.
*/
if (oldNum) {
- j = 0;
+ j = 0;
while (j < oldNum) {
parNode = parNodes[j];
if (nbFields == 1) {
@@ -23511,7 +23515,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
j++;
continue;
}
- } else {
+ } else {
for (k = 0; k < nbFields; k++) {
ret = xmlSchemaAreValuesEqual(
node->keys[k]->val,
@@ -23532,20 +23536,20 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
* Handle duplicates. Move the duplicate in
* the parent's node-table to the list of
* duplicates.
- */
+ */
oldNum--;
parBind->nbNodes--;
/*
* Move last old item to pos of duplicate.
*/
parNodes[j] = parNodes[oldNum];
-
+
if (parBind->nbNodes != oldNum) {
/*
- * If new items exist, move last new item to
+ * If new items exist, move last new item to
* last of old items.
*/
- parNodes[oldNum] =
+ parNodes[oldNum] =
parNodes[parBind->nbNodes];
}
if (parBind->dupls == NULL) {
@@ -23553,31 +23557,31 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
if (parBind->dupls == NULL)
goto internal_error;
}
- xmlSchemaItemListAdd(parBind->dupls, parNode);
+ xmlSchemaItemListAdd(parBind->dupls, parNode);
} else {
/*
- * Add the node-table entry (node and key-sequence) of
+ * Add the node-table entry (node and key-sequence) of
* the child node to the node table of the parent node.
*/
- if (parBind->nodeTable == NULL) {
- parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
+ if (parBind->nodeTable == NULL) {
+ parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
xmlMalloc(10 * sizeof(xmlSchemaPSVIIDCNodePtr));
if (parBind->nodeTable == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"allocating IDC list of node-table items", NULL);
goto internal_error;
}
parBind->sizeNodes = 1;
} else if (parBind->nbNodes >= parBind->sizeNodes) {
parBind->sizeNodes *= 2;
- parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
- xmlRealloc(parBind->nodeTable, parBind->sizeNodes *
+ parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
+ xmlRealloc(parBind->nodeTable, parBind->sizeNodes *
sizeof(xmlSchemaPSVIIDCNodePtr));
if (parBind->nodeTable == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"re-allocating IDC list of node-table items", NULL);
goto internal_error;
- }
+ }
}
parNodes = parBind->nodeTable;
/*
@@ -23587,9 +23591,9 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
parNodes[parBind->nbNodes++] = node;
}
- }
-
- }
+ }
+
+ }
} else {
/*
* No binding for the IDC was found: create a new one and
@@ -23598,7 +23602,7 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
parBind = xmlSchemaIDCNewBinding(bind->definition);
if (parBind == NULL)
goto internal_error;
-
+
/*
* TODO: Hmm, how to optimize the initial number of
* allocated entries?
@@ -23624,11 +23628,11 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
/*
* Copy the entries.
*/
- parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
+ parBind->nodeTable = (xmlSchemaPSVIIDCNodePtr *)
xmlMalloc(bind->nbNodes *
sizeof(xmlSchemaPSVIIDCNodePtr));
if (parBind->nodeTable == NULL) {
- xmlSchemaVErrMemory(NULL,
+ xmlSchemaVErrMemory(NULL,
"allocating an array of IDC node-table "
"items", NULL);
xmlSchemaIDCFreeBinding(parBind);
@@ -23647,15 +23651,15 @@ xmlSchemaBubbleIDCNodeTables(xmlSchemaValidCtxtPtr vctxt)
if (parBind->dupls != NULL)
xmlSchemaItemListFree(parBind->dupls);
parBind->dupls = bind->dupls;
- bind->dupls = NULL;
+ bind->dupls = NULL;
}
if (*parTable == NULL)
*parTable = parBind;
else {
parBind->next = *parTable;
*parTable = parBind;
- }
- }
+ }
+ }
next_binding:
bind = bind->next;
@@ -23678,7 +23682,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
{
xmlSchemaIDCMatcherPtr matcher;
xmlSchemaPSVIIDCBindingPtr bind;
-
+
matcher = vctxt->inode->idcMatchers;
/*
* Find a keyref.
@@ -23699,7 +23703,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
*/
bind = vctxt->inode->idcTable;
while (bind != NULL) {
- if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item ==
+ if ((xmlSchemaIDCPtr) matcher->aidc->def->ref->item ==
bind->definition)
break;
bind = bind->next;
@@ -23768,7 +23772,7 @@ xmlSchemaCheckCVCIDCKeyRef(xmlSchemaValidCtxtPtr vctxt)
}
}
}
-
+
if (res == 0) {
xmlChar *str = NULL, *strB = NULL;
xmlSchemaKeyrefErr(vctxt,
@@ -23852,7 +23856,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt,
xmlNodePtr attrNode,
int nodeLine,
const xmlChar *localName,
- const xmlChar *nsName,
+ const xmlChar *nsName,
int ownedNames,
xmlChar *value,
int ownedValue)
@@ -23878,7 +23882,7 @@ xmlSchemaValidatorPushAttribute(xmlSchemaValidCtxtPtr vctxt,
if (nsName != NULL) {
if (xmlStrEqual(localName, BAD_CAST "nil")) {
if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) {
- attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL;
+ attr->metaType = XML_SCHEMA_ATTR_INFO_META_XSI_NIL;
}
} else if (xmlStrEqual(localName, BAD_CAST "type")) {
if (xmlStrEqual(attr->nsName, xmlSchemaInstanceNs)) {
@@ -24099,7 +24103,7 @@ xmlSchemaValidateFacets(xmlSchemaAbstractCtxtPtr actxt,
valType = valType;
else
valType = xmlSchemaGetValType(val);
-
+
ret = 0;
for (facetLink = type->facetSet; facetLink != NULL;
facetLink = facetLink->next) {
@@ -24148,11 +24152,11 @@ WXS_IS_LIST:
ret = 0;
for (facetLink = type->facetSet; facetLink != NULL;
facetLink = facetLink->next) {
-
+
switch (facetLink->facet->type) {
case XML_SCHEMA_FACET_LENGTH:
case XML_SCHEMA_FACET_MINLENGTH:
- case XML_SCHEMA_FACET_MAXLENGTH:
+ case XML_SCHEMA_FACET_MAXLENGTH:
ret = xmlSchemaValidateListSimpleTypeFacet(facetLink->facet,
value, length, NULL);
break;
@@ -24164,7 +24168,7 @@ WXS_IS_LIST:
"validating against a list type facet");
return (-1);
} else if (ret > 0) {
- if (fireErrors)
+ if (fireErrors)
xmlSchemaFacetErr(actxt, ret, node,
value, length, type, facetLink->facet, NULL, NULL, NULL);
else
@@ -24241,7 +24245,7 @@ pattern_and_enum:
if (facetLink->facet->type != XML_SCHEMA_FACET_PATTERN)
continue;
found = 1;
- /*
+ /*
* NOTE that for patterns, @value needs to be the
* normalized vaule.
*/
@@ -24253,7 +24257,7 @@ pattern_and_enum:
"validating against a pattern facet");
return (-1);
} else {
- /*
+ /*
* Save the last non-validating facet.
*/
facet = facetLink->facet;
@@ -24276,12 +24280,12 @@ pattern_and_enum:
return (error);
}
-
+
static xmlChar *
xmlSchemaNormalizeValue(xmlSchemaTypePtr type,
const xmlChar *value)
{
- switch (xmlSchemaGetWhiteSpaceFacetValue(type)) {
+ switch (xmlSchemaGetWhiteSpaceFacetValue(type)) {
case XML_SCHEMA_WHITESPACE_COLLAPSE:
return (xmlSchemaCollapseString(value));
case XML_SCHEMA_WHITESPACE_REPLACE:
@@ -24300,7 +24304,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
int ret;
const xmlChar *nsName;
xmlChar *local, *prefix = NULL;
-
+
ret = xmlValidateQName(value, 1);
if (ret != 0) {
if (ret == -1) {
@@ -24323,7 +24327,7 @@ xmlSchemaValidateQName(xmlSchemaValidCtxtPtr vctxt,
* - is there a default namespace?
*/
nsName = xmlSchemaLookupNamespace(vctxt, prefix);
-
+
if (prefix != NULL) {
xmlFree(prefix);
/*
@@ -24380,7 +24384,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
value = normValue; \
isNormalized = 1; \
}
-
+
if ((retVal != NULL) && (*retVal != NULL)) {
xmlSchemaFreeValue(*retVal);
*retVal = NULL;
@@ -24395,14 +24399,14 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
*/
/*
* 2.1 If The definition is ENTITY or is validly derived from ENTITY given
- * the empty set, as defined in Type Derivation OK (Simple) (§3.14.6), then
- * the string must be a ·declared entity name·.
+ * the empty set, as defined in Type Derivation OK (Simple) (�3.14.6), then
+ * the string must be a �declared entity name�.
*/
/*
* 2.2 If The definition is ENTITIES or is validly derived from ENTITIES
- * given the empty set, as defined in Type Derivation OK (Simple) (§3.14.6),
- * then every whitespace-delimited substring of the string must be a ·declared
- * entity name·.
+ * given the empty set, as defined in Type Derivation OK (Simple) (�3.14.6),
+ * then every whitespace-delimited substring of the string must be a �declared
+ * entity nameďż˝.
*/
/*
* 2.3 otherwise no further condition applies.
@@ -24414,8 +24418,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
if (WXS_IS_ANY_SIMPLE_TYPE(type) || WXS_IS_ATOMIC(type)) {
xmlSchemaTypePtr biType; /* The built-in type. */
/*
- * SPEC (1.2.1) "if {variety} is ·atomic· then the string must ·match·
- * a literal in the ·lexical space· of {base type definition}"
+ * SPEC (1.2.1) "if {variety} is �atomic� then the string must �match�
+ * a literal in the �lexical space� of {base type definition}"
*/
/*
* Whitespace-normalize.
@@ -24441,9 +24445,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
* NOTATIONs need to be processed here, since they need
* to lookup in the hashtable of NOTATION declarations of the schema.
*/
- if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
- switch (biType->builtInType) {
- case XML_SCHEMAS_NOTATION:
+ if (actxt->type == XML_SCHEMA_CTXT_VALIDATOR) {
+ switch (biType->builtInType) {
+ case XML_SCHEMAS_NOTATION:
ret = xmlSchemaValidateNotation(
(xmlSchemaValidCtxtPtr) actxt,
((xmlSchemaValidCtxtPtr) actxt)->schema,
@@ -24463,8 +24467,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
value, NULL, NULL);
break;
}
- } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
- switch (biType->builtInType) {
+ } else if (actxt->type == XML_SCHEMA_CTXT_PARSER) {
+ switch (biType->builtInType) {
case XML_SCHEMAS_NOTATION:
ret = xmlSchemaValidateNotation(NULL,
((xmlSchemaParserCtxtPtr) actxt)->schema, node,
@@ -24479,7 +24483,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
ret = xmlSchemaValPredefTypeNodeNoNorm(biType,
value, NULL, node);
break;
- }
+ }
} else {
/*
* Validation via a public API is not implemented yet.
@@ -24496,7 +24500,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
if (WXS_IS_LIST(type))
ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
else
- ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
+ ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
}
if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) {
/*
@@ -24511,10 +24515,10 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
"validating facets of atomic simple type");
goto internal_error;
}
- if (WXS_IS_LIST(type))
+ if (WXS_IS_LIST(type))
ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
else
- ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
+ ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1;
}
}
if (fireErrors && (ret > 0))
@@ -24526,9 +24530,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
xmlChar *tmpValue = NULL;
unsigned long len = 0;
xmlSchemaValPtr prevVal = NULL, curVal = NULL;
- /* 1.2.2 if {variety} is ·list· then the string must be a sequence
- * of white space separated tokens, each of which ·match·es a literal
- * in the ·lexical space· of {item type definition}
+ /* 1.2.2 if {variety} is �list� then the string must be a sequence
+ * of white space separated tokens, each of which �match�es a literal
+ * in the �lexical space� of {item type definition}
*/
/*
* Note that XML_SCHEMAS_TYPE_NORMVALUENEEDED will be set if
@@ -24539,7 +24543,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
* VAL TODO: Optimize validation of empty values.
* VAL TODO: We do not have computed values for lists.
*/
- itemType = WXS_LIST_ITEMTYPE(type);
+ itemType = WXS_LIST_ITEMTYPE(type);
cur = value;
do {
while (IS_BLANK_CH(*cur))
@@ -24578,7 +24582,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
}
ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2;
break;
- }
+ }
cur = end;
} while (*cur != 0);
FREE_AND_NULL(tmpValue);
@@ -24599,7 +24603,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
}
}
if (fireErrors && (ret > 0)) {
- /*
+ /*
* Report the normalized value.
*/
normalize = 1;
@@ -24609,10 +24613,10 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
} else if (WXS_IS_UNION(type)) {
xmlSchemaTypeLinkPtr memberLink;
/*
- * TODO: For all datatypes ·derived· by ·union· whiteSpace does
- * not apply directly; however, the normalization behavior of ·union·
+ * TODO: For all datatypes �derived� by �union� whiteSpace does
+ * not apply directly; however, the normalization behavior of �union�
* types is controlled by the value of whiteSpace on that one of the
- * ·memberTypes· against which the ·union· is successfully validated.
+ * �memberTypes� against which the �union� is successfully validated.
*
* This means that the value is normalized by the first validating
* member type, then the facets of the union type are applied. This
@@ -24620,8 +24624,8 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
*/
/*
- * 1.2.3 if {variety} is ·union· then the string must ·match· a
- * literal in the ·lexical space· of at least one member of
+ * 1.2.3 if {variety} is �union� then the string must �match� a
+ * literal in the �lexical space� of at least one member of
* {member type definitions}
*/
memberLink = xmlSchemaGetUnionSimpleTypeMemberTypes(type);
@@ -24629,7 +24633,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
AERROR_INT("xmlSchemaVCheckCVCSimpleType",
"union simple type has no member types");
goto internal_error;
- }
+ }
/*
* Always normalize union type values, since we currently
* cannot store the whitespace information with the value
@@ -24637,7 +24641,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
* not possible.
*/
while (memberLink != NULL) {
- if (valNeeded)
+ if (valNeeded)
ret = xmlSchemaVCheckCVCSimpleType(actxt, node,
memberLink->type, value, &val, 0, 1, 0);
else
@@ -24660,9 +24664,9 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
*/
if ((ret == 0) && (type->flags & XML_SCHEMAS_TYPE_HAS_FACETS)) {
/*
- * The normalization behavior of ·union· types is controlled by
- * the value of whiteSpace on that one of the ·memberTypes·
- * against which the ·union· is successfully validated.
+ * The normalization behavior of �union� types is controlled by
+ * the value of whiteSpace on that one of the �memberTypes�
+ * against which the �union� is successfully validated.
*/
NORMALIZE(memberLink->type);
ret = xmlSchemaValidateFacets(actxt, node, type,
@@ -24674,7 +24678,7 @@ xmlSchemaVCheckCVCSimpleType(xmlSchemaAbstractCtxtPtr actxt,
"validating facets of union simple type");
goto internal_error;
}
- ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3;
+ ret = XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3;
}
}
if (fireErrors && (ret > 0))
@@ -24822,14 +24826,14 @@ xmlSchemaProcessXSIType(xmlSchemaValidCtxtPtr vctxt,
/*
* SPEC cvc-elt (3.3.4) : (4.3) (Type Derivation OK)
- * "The ·local type definition· must be validly
+ * "The �local type definition� must be validly
* derived from the {type definition} given the union of
* the {disallowed substitutions} and the {type definition}'s
* {prohibited substitutions}, as defined in
- * Type Derivation OK (Complex) (§3.4.6)
+ * Type Derivation OK (Complex) (�3.4.6)
* (if it is a complex type definition),
* or given {disallowed substitutions} as defined in Type
- * Derivation OK (Simple) (§3.14.6) (if it is a simple type
+ * Derivation OK (Simple) (�3.14.6) (if it is a simple type
* definition)."
*
* {disallowed substitutions}: the "block" on the element decl.
@@ -25089,19 +25093,19 @@ xmlSchemaClearAttrInfos(xmlSchemaValidCtxtPtr vctxt)
static int
xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
{
- xmlSchemaTypePtr type = vctxt->inode->typeDef;
+ xmlSchemaTypePtr type = vctxt->inode->typeDef;
xmlSchemaItemListPtr attrUseList;
xmlSchemaAttributeUsePtr attrUse = NULL;
xmlSchemaAttributePtr attrDecl = NULL;
- xmlSchemaAttrInfoPtr iattr, tmpiattr;
+ xmlSchemaAttrInfoPtr iattr, tmpiattr;
int i, j, found, nbAttrs, nbUses;
int xpathRes = 0, res, wildIDs = 0, fixed;
xmlNodePtr defAttrOwnerElem = NULL;
/*
* SPEC (cvc-attribute)
- * (1) "The declaration must not be ·absent· (see Missing
- * Sub-components (§5.3) for how this can fail to be
+ * (1) "The declaration must not be �absent� (see Missing
+ * Sub-components (�5.3) for how this can fail to be
* the case)."
* (2) "Its {type definition} must not be absent."
*
@@ -25151,15 +25155,15 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
* use with an {attribute declaration} whose {name} matches
* the attribute information item's [local name] and whose
* {target namespace} is identical to the attribute information
- * item's [namespace name] (where an ·absent· {target namespace}
+ * item's [namespace name] (where an �absent� {target namespace}
* is taken to be identical to a [namespace name] with no value),
- * then the attribute information must be ·valid· with respect
+ * then the attribute information must be �valid� with respect
* to that attribute use as per Attribute Locally Valid (Use)
- * (§3.5.4). In this case the {attribute declaration} of that
- * attribute use is the ·context-determined declaration· for the
+ * (�3.5.4). In this case the {attribute declaration} of that
+ * attribute use is the �context-determined declaration� for the
* attribute information item with respect to Schema-Validity
- * Assessment (Attribute) (§3.2.4) and
- * Assessment Outcome (Attribute) (§3.2.5).
+ * Assessment (Attribute) (�3.2.4) and
+ * Assessment Outcome (Attribute) (�3.2.5).
*/
iattr->state = XML_SCHEMAS_ATTR_ASSESSED;
iattr->use = attrUse;
@@ -25193,7 +25197,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
}
tmpiattr->state = XML_SCHEMAS_ATTR_ERR_MISSING;
tmpiattr->use = attrUse;
- tmpiattr->decl = attrDecl;
+ tmpiattr->decl = attrDecl;
} else if ((attrUse->occurs == XML_SCHEMAS_ATTR_USE_OPTIONAL) &&
((attrUse->defValue != NULL) ||
(attrDecl->defValue != NULL))) {
@@ -25237,13 +25241,13 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
continue;
/*
* SPEC (cvc-complex-type)
- * (3.2.2) "The attribute information item must be ·valid· with
- * respect to it as defined in Item Valid (Wildcard) (§3.10.4)."
+ * (3.2.2) "The attribute information item must be �valid� with
+ * respect to it as defined in Item Valid (Wildcard) (�3.10.4)."
*
* SPEC Item Valid (Wildcard) (cvc-wildcard)
- * "... its [namespace name] must be ·valid· with respect to
+ * "... its [namespace name] must be �valid� with respect to
* the wildcard constraint, as defined in Wildcard allows
- * Namespace Name (§3.10.4)."
+ * Namespace Name (�3.10.4)."
*/
if (xmlSchemaCheckCVCWildcardNamespace(type->attributeWildcard,
iattr->nsName) == 0) {
@@ -25279,11 +25283,11 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
* SPEC (cvc-complex-type)
* (5) "Let [Definition:] the wild IDs be the set of
* all attribute information item to which clause 3.2
- * applied and whose ·validation· resulted in a
- * ·context-determined declaration· of mustFind or no
- * ·context-determined declaration· at all, and whose
+ * applied and whose �validation� resulted in a
+ * �context-determined declaration� of mustFind or no
+ * �context-determined declaration� at all, and whose
* [local name] and [namespace name] resolve (as
- * defined by QName resolution (Instance) (§3.15.4)) to
+ * defined by QName resolution (Instance) (�3.15.4)) to
* an attribute declaration whose {type definition} is
* or is derived from ID. Then all of the following
* must be true:"
@@ -25293,7 +25297,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
iattr->typeDef, XML_SCHEMAS_ID)) {
/*
* SPEC (5.1) "There must be no more than one
- * item in ·wild IDs·."
+ * item in �wild IDs�."
*/
if (wildIDs != 0) {
/* VAL TODO */
@@ -25304,7 +25308,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
wildIDs++;
/*
* SPEC (cvc-complex-type)
- * (5.2) "If ·wild IDs· is non-empty, there must not
+ * (5.2) "If �wild IDs� is non-empty, there must not
* be any attribute uses among the {attribute uses}
* whose {attribute declaration}'s {type definition}
* is or is derived from ID."
@@ -25421,7 +25425,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
* VAL TODO: Should we use the *normalized* value? This currently
* uses the *initial* value.
*/
-
+
if (defAttrOwnerElem) {
xmlChar *normValue;
const xmlChar *value;
@@ -25512,9 +25516,9 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
fixed = 0;
/*
* SPEC (cvc-attribute)
- * (3) "The item's ·normalized value· must be locally ·valid·
- * with respect to that {type definition} as per
- * String Valid (§3.14.4)."
+ * (3) "The item's �normalized value� must be locally �valid�
+ * with respect to that {type definition} as per
+ * String Valid (�3.14.4)."
*
* VAL TODO: Do we already have the
* "normalized attribute value" here?
@@ -25534,7 +25538,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
iattr->node, iattr->typeDef, iattr->value, NULL,
1, 0, 0);
}
-
+
if (res != 0) {
if (res == -1) {
VERROR_INT("xmlSchemaVAttributesComplex",
@@ -25549,12 +25553,12 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
goto eval_idcs;
}
- if (fixed) {
+ if (fixed) {
/*
* SPEC Attribute Locally Valid (Use) (cvc-au)
- * "For an attribute information item to be·valid·
+ * "For an attribute information item to be�valid�
* with respect to an attribute use its *normalized*
- * value· must match the *canonical* lexical
+ * valueďż˝ must match the *canonical* lexical
* representation of the attribute use's {value
* constraint}value, if it is present and fixed."
*
@@ -25563,7 +25567,7 @@ xmlSchemaVAttributesComplex(xmlSchemaValidCtxtPtr vctxt)
*/
/*
* SPEC Attribute Locally Valid (cvc-attribute)
- * (4) "The item's *actual* value· must match the *value* of
+ * (4) "The item's *actual* valueďż˝ must match the *value* of
* the {value constraint}, if it is present and fixed."
*/
if (iattr->val == NULL) {
@@ -25655,8 +25659,8 @@ eval_idcs:
xmlSchemaCustomErr(ACTXT_CAST vctxt,
XML_SCHEMAV_CVC_AU, NULL, NULL,
"The value '%s' does not match the fixed "
- "value constraint '%s'",
- iattr->value, iattr->vcValue);
+ "value constraint '%s'",
+ iattr->value, iattr->vcValue);
break;
case XML_SCHEMAS_ATTR_ERR_WILD_STRICT_NO_DECL:
VERROR(XML_SCHEMAV_CVC_WILDCARD, NULL,
@@ -25718,7 +25722,7 @@ xmlSchemaValidateElemWildcard(xmlSchemaValidCtxtPtr vctxt,
xmlSchemaElementPtr decl = NULL;
decl = xmlSchemaGetElem(vctxt->schema,
- vctxt->inode->localName, vctxt->inode->nsName);
+ vctxt->inode->localName, vctxt->inode->nsName);
if (decl != NULL) {
vctxt->inode->decl = decl;
return (0);
@@ -25776,16 +25780,16 @@ static int
xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
const xmlChar *value,
xmlSchemaValPtr *val)
-{
+{
int ret = 0;
xmlSchemaNodeInfoPtr inode = vctxt->inode;
/*
* cos-valid-default:
* Schema Component Constraint: Element Default Valid (Immediate)
- * For a string to be a valid default with respect to a type
+ * For a string to be a valid default with respect to a type
* definition the appropriate case among the following must be true:
- */
+ */
if WXS_IS_COMPLEX(inode->typeDef) {
/*
* Complex type.
@@ -25793,8 +25797,8 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
* SPEC (2.1) "its {content type} must be a simple type definition
* or mixed."
* SPEC (2.2.2) "If the {content type} is mixed, then the {content
- * type}'s particle must be ·emptiable· as defined by
- * Particle Emptiable (§3.9.6)."
+ * type}'s particle must be �emptiable� as defined by
+ * Particle Emptiable (�3.9.6)."
*/
if ((! WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) &&
((! WXS_HAS_MIXED_CONTENT(inode->typeDef)) ||
@@ -25807,18 +25811,18 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
"or mixed content and a particle emptiable");
return(ret);
}
- }
+ }
/*
- * 1 If the type definition is a simple type definition, then the string
- * must be ·valid· with respect to that definition as defined by String
- * Valid (§3.14.4).
+ * 1 If the type definition is a simple type definition, then the string
+ * must be �valid� with respect to that definition as defined by String
+ * Valid (�3.14.4).
*
* AND
*
- * 2.2.1 If the {content type} is a simple type definition, then the
- * string must be ·valid· with respect to that simple type definition
- * as defined by String Valid (§3.14.4).
- */
+ * 2.2.1 If the {content type} is a simple type definition, then the
+ * string must be �valid� with respect to that simple type definition
+ * as defined by String Valid (�3.14.4).
+ */
if (WXS_IS_SIMPLE(inode->typeDef)) {
ret = xmlSchemaVCheckCVCSimpleType(ACTXT_CAST vctxt,
@@ -25832,7 +25836,7 @@ xmlSchemaCheckCOSValidDefault(xmlSchemaValidCtxtPtr vctxt,
if (ret < 0) {
VERROR_INT("xmlSchemaCheckCOSValidDefault",
"calling xmlSchemaVCheckCVCSimpleType()");
- }
+ }
return (ret);
}
@@ -25866,13 +25870,13 @@ xmlSchemaVContentModelCallback(xmlSchemaValidCtxtPtr vctxt ATTRIBUTE_UNUSED,
static int
xmlSchemaValidatorPushElem(xmlSchemaValidCtxtPtr vctxt)
-{
+{
vctxt->inode = xmlSchemaGetFreshElemInfo(vctxt);
if (vctxt->inode == NULL) {
VERROR_INT("xmlSchemaValidatorPushElem",
"calling xmlSchemaGetFreshElemInfo()");
return (-1);
- }
+ }
vctxt->nbAttrInfos = 0;
return (0);
}
@@ -25895,7 +25899,7 @@ xmlSchemaVCheckINodeDataType(xmlSchemaValidCtxtPtr vctxt,
-/*
+/*
* Process END of element.
*/
static int
@@ -25914,7 +25918,7 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
*/
vctxt->skipDepth = vctxt->depth -1;
goto end_elem;
- }
+ }
if ((inode->typeDef == NULL) ||
(inode->flags & XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE)) {
/*
@@ -25934,8 +25938,8 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
* Workaround for "anyType".
*/
if (inode->typeDef->builtInType == XML_SCHEMAS_ANYTYPE)
- goto character_content;
-
+ goto character_content;
+
if ((inode->flags & XML_SCHEMA_ELEM_INFO_ERR_BAD_CONTENT) == 0) {
xmlChar *values[10];
int terminal, nbval = 10, nbneg;
@@ -25956,12 +25960,12 @@ xmlSchemaValidatorPopElem(xmlSchemaValidCtxtPtr vctxt)
#ifdef DEBUG_AUTOMATA
xmlGenericError(xmlGenericErrorContext,
"AUTOMATON create on '%s'\n", inode->localName);
-#endif
+#endif
}
/*
* Get hold of the still expected content, since a further
* call to xmlRegExecPushString() will loose this information.
- */
+ */
xmlRegExecNextValues(inode->regexCtxt,
&nbval, &nbneg, &values[0], &terminal);
ret = xmlRegExecPushString(inode->regexCtxt, NULL, NULL);
@@ -26011,14 +26015,14 @@ character_content:
/*
* Speedup if no declaration exists.
*/
- if (WXS_IS_SIMPLE(inode->typeDef)) {
+ if (WXS_IS_SIMPLE(inode->typeDef)) {
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef, inode->value);
} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef->contentTypeDef,
inode->value);
- }
+ }
if (ret < 0) {
VERROR_INT("xmlSchemaValidatorPopElem",
"calling xmlSchemaVCheckCVCSimpleType()");
@@ -26027,26 +26031,26 @@ character_content:
goto end_elem;
}
/*
- * cvc-elt (3.3.4) : 5
+ * cvc-elt (3.3.4) : 5
* The appropriate case among the following must be true:
*/
/*
- * cvc-elt (3.3.4) : 5.1
- * If the declaration has a {value constraint},
- * the item has neither element nor character [children] and
+ * cvc-elt (3.3.4) : 5.1
+ * If the declaration has a {value constraint},
+ * the item has neither element nor character [children] and
* clause 3.2 has not applied, then all of the following must be true:
*/
if ((inode->decl->value != NULL) &&
- (inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) &&
+ (inode->flags & XML_SCHEMA_ELEM_INFO_EMPTY) &&
(! INODE_NILLED(inode))) {
/*
- * cvc-elt (3.3.4) : 5.1.1
- * If the ·actual type definition· is a ·local type definition·
+ * cvc-elt (3.3.4) : 5.1.1
+ * If the �actual type definition� is a �local type definition�
* then the canonical lexical representation of the {value constraint}
- * value must be a valid default for the ·actual type definition· as
- * defined in Element Default Valid (Immediate) (§3.3.6).
+ * value must be a valid default for the �actual type definition� as
+ * defined in Element Default Valid (Immediate) (�3.3.6).
*/
- /*
+ /*
* NOTE: 'local' above means types acquired by xsi:type.
* NOTE: Although the *canonical* value is stated, it is not
* relevant if canonical or not. Additionally XML Schema 1.1
@@ -26069,22 +26073,22 @@ character_content:
* (see following).
*/
goto default_psvi;
- }
- /*
- * cvc-elt (3.3.4) : 5.1.2
- * The element information item with the canonical lexical
- * representation of the {value constraint} value used as its
- * ·normalized value· must be ·valid· with respect to the
- * ·actual type definition· as defined by Element Locally Valid (Type)
- * (§3.3.4).
- */
+ }
+ /*
+ * cvc-elt (3.3.4) : 5.1.2
+ * The element information item with the canonical lexical
+ * representation of the {value constraint} value used as its
+ * �normalized value� must be �valid� with respect to the
+ * �actual type definition� as defined by Element Locally Valid (Type)
+ * (�3.3.4).
+ */
if (WXS_IS_SIMPLE(inode->typeDef)) {
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef, inode->decl->value);
} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef->contentTypeDef,
- inode->decl->value);
+ inode->decl->value);
}
if (ret != 0) {
if (ret < 0) {
@@ -26105,7 +26109,7 @@ default_psvi:
xmlChar *normValue;
/*
* VAL TODO: Normalize the value.
- */
+ */
normValue = xmlSchemaNormalizeValue(inode->typeDef,
inode->decl->value);
if (normValue != NULL) {
@@ -26118,42 +26122,42 @@ default_psvi:
"calling xmlNewText()");
goto internal_error;
} else
- xmlAddChild(inode->node, textChild);
+ xmlAddChild(inode->node, textChild);
}
-
- } else if (! INODE_NILLED(inode)) {
+
+ } else if (! INODE_NILLED(inode)) {
/*
- * 5.2.1 The element information item must be ·valid· with respect
- * to the ·actual type definition· as defined by Element Locally
- * Valid (Type) (§3.3.4).
- */
+ * 5.2.1 The element information item must be �valid� with respect
+ * to the �actual type definition� as defined by Element Locally
+ * Valid (Type) (�3.3.4).
+ */
if (WXS_IS_SIMPLE(inode->typeDef)) {
/*
* SPEC (cvc-type) (3.1)
* "If the type definition is a simple type definition, ..."
* (3.1.3) "If clause 3.2 of Element Locally Valid
- * (Element) (§3.3.4) did not apply, then the ·normalized value·
- * must be ·valid· with respect to the type definition as defined
- * by String Valid (§3.14.4).
- */
+ * (Element) (�3.3.4) did not apply, then the �normalized value�
+ * must be �valid� with respect to the type definition as defined
+ * by String Valid (�3.14.4).
+ */
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef, inode->value);
} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
/*
* SPEC (cvc-type) (3.2) "If the type definition is a complex type
* definition, then the element information item must be
- * ·valid· with respect to the type definition as per
- * Element Locally Valid (Complex Type) (§3.4.4);"
+ * �valid� with respect to the type definition as per
+ * Element Locally Valid (Complex Type) (�3.4.4);"
*
* SPEC (cvc-complex-type) (2.2)
- * "If the {content type} is a simple type definition, ...
- * the ·normalized value· of the element information item is
- * ·valid· with respect to that simple type definition as
- * defined by String Valid (§3.14.4)."
+ * "If the {content type} is a simple type definition, ...
+ * the �normalized value� of the element information item is
+ * �valid� with respect to that simple type definition as
+ * defined by String Valid (�3.14.4)."
*/
ret = xmlSchemaVCheckINodeDataType(vctxt,
inode, inode->typeDef->contentTypeDef, inode->value);
- }
+ }
if (ret != 0) {
if (ret < 0) {
VERROR_INT("xmlSchemaValidatorPopElem",
@@ -26163,7 +26167,7 @@ default_psvi:
goto end_elem;
}
/*
- * 5.2.2 If there is a fixed {value constraint} and clause 3.2 has
+ * 5.2.2 If there is a fixed {value constraint} and clause 3.2 has
* not applied, all of the following must be true:
*/
if ((inode->decl->value != NULL) &&
@@ -26174,7 +26178,7 @@ default_psvi:
* done on computed values.
*/
/*
- * 5.2.2.1 The element information item must have no element
+ * 5.2.2.1 The element information item must have no element
* information item [children].
*/
if (inode->flags &
@@ -26186,28 +26190,28 @@ default_psvi:
goto end_elem;
} else {
/*
- * 5.2.2.2 The appropriate case among the following must
+ * 5.2.2.2 The appropriate case among the following must
* be true:
- */
+ */
if (WXS_HAS_MIXED_CONTENT(inode->typeDef)) {
/*
- * 5.2.2.2.1 If the {content type} of the ·actual type
- * definition· is mixed, then the *initial value* of the
- * item must match the canonical lexical representation
+ * 5.2.2.2.1 If the {content type} of the �actual type
+ * definitionďż˝ is mixed, then the *initial value* of the
+ * item must match the canonical lexical representation
* of the {value constraint} value.
*
- * ... the *initial value* of an element information
- * item is the string composed of, in order, the
- * [character code] of each character information item in
+ * ... the *initial value* of an element information
+ * item is the string composed of, in order, the
+ * [character code] of each character information item in
* the [children] of that element information item.
- */
+ */
if (! xmlStrEqual(inode->value, inode->decl->value)){
- /*
+ /*
* VAL TODO: Report invalid & expected values as well.
* VAL TODO: Implement the canonical stuff.
*/
ret = XML_SCHEMAV_CVC_ELT_5_2_2_2_1;
- xmlSchemaCustomErr(ACTXT_CAST vctxt,
+ xmlSchemaCustomErr(ACTXT_CAST vctxt,
ret, NULL, NULL,
"The initial value '%s' does not match the fixed "
"value constraint '%s'",
@@ -26216,9 +26220,9 @@ default_psvi:
}
} else if (WXS_HAS_SIMPLE_CONTENT(inode->typeDef)) {
/*
- * 5.2.2.2.2 If the {content type} of the ·actual type
- * definition· is a simple type definition, then the
- * *actual value* of the item must match the canonical
+ * 5.2.2.2.2 If the {content type} of the �actual type
+ * definitionďż˝ is a simple type definition, then the
+ * *actual value* of the item must match the canonical
* lexical representation of the {value constraint} value.
*/
/*
@@ -26233,16 +26237,16 @@ default_psvi:
xmlSchemaCustomErr(ACTXT_CAST vctxt,
ret, NULL, NULL,
"The actual value '%s' does not match the fixed "
- "value constraint '%s'",
+ "value constraint '%s'",
inode->value,
inode->decl->value);
goto end_elem;
- }
+ }
}
- }
+ }
}
}
-
+
end_elem:
if (vctxt->depth < 0) {
/* TODO: raise error? */
@@ -26252,15 +26256,15 @@ end_elem:
vctxt->skipDepth = -1;
/*
* Evaluate the history of XPath state objects.
- */
+ */
if (inode->appliedXPath &&
(xmlSchemaXPathProcessHistory(vctxt, vctxt->depth) == -1))
goto internal_error;
/*
* MAYBE TODO:
- * SPEC (6) "The element information item must be ·valid· with
+ * SPEC (6) "The element information item must be �valid� with
* respect to each of the {identity-constraint definitions} as per
- * Identity-constraint Satisfied (§3.11.4)."
+ * Identity-constraint Satisfied (�3.11.4)."
*/
/*
* PSVI TODO: If we expose IDC node-tables via PSVI then the tables
@@ -26268,7 +26272,7 @@ end_elem:
* We will currently build IDC node-tables and bubble them only if
* keyrefs do exist.
*/
-
+
/*
* Add the current IDC target-nodes to the IDC node-tables.
*/
@@ -26302,7 +26306,7 @@ end_elem:
*/
if (xmlSchemaBubbleIDCNodeTables(vctxt) == -1)
goto internal_error;
- }
+ }
}
/*
* Clear the current ielem.
@@ -26335,11 +26339,11 @@ end_elem:
aidc = aidc->next;
} while (aidc != NULL);
}
- vctxt->depth--;
+ vctxt->depth--;
vctxt->inode = vctxt->elemInfos[vctxt->depth];
/*
- * VAL TODO: 7 If the element information item is the ·validation root·, it must be
- * ·valid· per Validation Root Valid (ID/IDREF) (§3.3.4).
+ * VAL TODO: 7 If the element information item is the �validation root�, it must be
+ * �valid� per Validation Root Valid (ID/IDREF) (�3.3.4).
*/
return (ret);
@@ -26420,11 +26424,11 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt)
* Fallback to "anyType".
*
* SPEC (cvc-assess-elt)
- * "If the item cannot be ·strictly assessed·, [...]
+ * "If the item cannot be �strictly assessed�, [...]
* an element information item's schema validity may be laxly
- * assessed if its ·context-determined declaration· is not
- * skip by ·validating· with respect to the ·ur-type
- * definition· as per Element Locally Valid (Type) (§3.3.4)."
+ * assessed if its �context-determined declaration� is not
+ * skip by �validating� with respect to the �ur-type
+ * definition� as per Element Locally Valid (Type) (�3.3.4)."
*/
vctxt->inode->typeDef =
xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYTYPE);
@@ -26496,9 +26500,9 @@ xmlSchemaValidateChildElem(xmlSchemaValidCtxtPtr vctxt)
* SPEC (2.4) "If the {content type} is element-only or mixed,
* then the sequence of the element information item's
* element information item [children], if any, taken in
- * order, is ·valid· with respect to the {content type}'s
+ * order, is �valid� with respect to the {content type}'s
* particle, as defined in Element Sequence Locally Valid
- * (Particle) (§3.9.4)."
+ * (Particle) (�3.9.4)."
*/
ret = xmlRegExecPushString2(regexCtxt,
vctxt->inode->localName,
@@ -26595,7 +26599,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
if (consumed != NULL)
*consumed = 0;
if (INODE_NILLED(vctxt->inode)) {
- /*
+ /*
* SPEC cvc-elt (3.3.4 - 3.2.1)
* "The element information item must have no character or
* element information item [children]."
@@ -26611,7 +26615,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
* information item [children]."
*/
if (vctxt->inode->typeDef->contentType ==
- XML_SCHEMA_CONTENT_EMPTY) {
+ XML_SCHEMA_CONTENT_EMPTY) {
VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, NULL,
"Character content is not allowed, "
"because the content type is empty");
@@ -26622,12 +26626,12 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
XML_SCHEMA_CONTENT_ELEMENTS) {
if ((nodeType != XML_TEXT_NODE) ||
(! xmlSchemaIsBlank((xmlChar *) value, len))) {
- /*
- * SPEC cvc-complex-type (2.3)
- * "If the {content type} is element-only, then the
- * element information item has no character information
- * item [children] other than those whose [character
- * code] is defined as a white space in [XML 1.0 (Second
+ /*
+ * SPEC cvc-complex-type (2.3)
+ * "If the {content type} is element-only, then the
+ * element information item has no character information
+ * item [children] other than those whose [character
+ * code] is defined as a white space in [XML 1.0 (Second
* Edition)]."
*/
VERROR(XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, NULL,
@@ -26637,7 +26641,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
}
return (0);
}
-
+
if ((value == NULL) || (value[0] == 0))
return (0);
/*
@@ -26649,7 +26653,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
((vctxt->inode->decl == NULL) ||
(vctxt->inode->decl->value == NULL)))
return (0);
-
+
if (vctxt->inode->value == NULL) {
/*
* Set the value.
@@ -26692,7 +26696,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
len = xmlStrlen(value);
/*
* Concat the value.
- */
+ */
if (vctxt->inode->flags & XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES) {
vctxt->inode->value = BAD_CAST xmlStrncat(
(xmlChar *) vctxt->inode->value, value, len);
@@ -26701,7 +26705,7 @@ xmlSchemaVPushText(xmlSchemaValidCtxtPtr vctxt,
BAD_CAST xmlStrncatNew(vctxt->inode->value, value, len);
vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_FLAG_OWNED_VALUES;
}
- }
+ }
return (0);
}
@@ -26718,7 +26722,7 @@ xmlSchemaValidateElem(xmlSchemaValidCtxtPtr vctxt)
goto internal_error;
}
if (vctxt->xsiAssemble) {
- /*
+ /*
* We will stop validation if there was an error during
* dynamic schema construction.
* Note that we simply set @skipDepth to 0, this could
@@ -26831,12 +26835,12 @@ type_validation:
VERROR(ret, NULL,
"The type definition is absent");
goto exit;
- }
+ }
if (vctxt->inode->typeDef->flags & XML_SCHEMAS_TYPE_ABSTRACT) {
vctxt->inode->flags |= XML_SCHEMA_NODE_INFO_ERR_BAD_TYPE;
ret = XML_SCHEMAV_CVC_TYPE_2;
VERROR(ret, NULL,
- "The type definition is abstract");
+ "The type definition is abstract");
goto exit;
}
/*
@@ -26917,7 +26921,7 @@ root_found:
nodeType = xmlTextReaderNodeType(vctxt->reader);
if (nodeType == XML_ELEMENT_NODE) {
-
+
vctxt->depth++;
if (xmlSchemaValidatorPushElem(vctxt) == -1) {
VERROR_INT("xmlSchemaVReaderWalk",
@@ -27092,8 +27096,8 @@ internal_error:
* Process text content.
*/
static void
-xmlSchemaSAXHandleText(void *ctx,
- const xmlChar * ch,
+xmlSchemaSAXHandleText(void *ctx,
+ const xmlChar * ch,
int len)
{
xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
@@ -27117,10 +27121,10 @@ xmlSchemaSAXHandleText(void *ctx,
* Process CDATA content.
*/
static void
-xmlSchemaSAXHandleCDataSection(void *ctx,
- const xmlChar * ch,
+xmlSchemaSAXHandleCDataSection(void *ctx,
+ const xmlChar * ch,
int len)
-{
+{
xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
if (vctxt->depth < 0)
@@ -27154,20 +27158,20 @@ xmlSchemaSAXHandleReference(void *ctx ATTRIBUTE_UNUSED,
static void
xmlSchemaSAXHandleStartElementNs(void *ctx,
- const xmlChar * localname,
- const xmlChar * prefix ATTRIBUTE_UNUSED,
- const xmlChar * URI,
- int nb_namespaces,
- const xmlChar ** namespaces,
- int nb_attributes,
- int nb_defaulted ATTRIBUTE_UNUSED,
+ const xmlChar * localname,
+ const xmlChar * prefix ATTRIBUTE_UNUSED,
+ const xmlChar * URI,
+ int nb_namespaces,
+ const xmlChar ** namespaces,
+ int nb_attributes,
+ int nb_defaulted ATTRIBUTE_UNUSED,
const xmlChar ** attributes)
-{
+{
xmlSchemaValidCtxtPtr vctxt = (xmlSchemaValidCtxtPtr) ctx;
int ret;
xmlSchemaNodeInfoPtr ielem;
int i, j;
-
+
/*
* SAX VAL TODO: What to do with nb_defaulted?
*/
@@ -27195,16 +27199,16 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
ielem->flags |= XML_SCHEMA_ELEM_INFO_EMPTY;
/*
* Register namespaces on the elem info.
- */
+ */
if (nb_namespaces != 0) {
/*
* Although the parser builds its own namespace list,
* we have no access to it, so we'll use an own one.
*/
- for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) {
+ for (i = 0, j = 0; i < nb_namespaces; i++, j += 2) {
/*
* Store prefix and namespace name.
- */
+ */
if (ielem->nsBindings == NULL) {
ielem->nsBindings =
(const xmlChar **) xmlMalloc(10 *
@@ -27240,7 +27244,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
} else
ielem->nsBindings[ielem->nbNsBindings * 2 + 1] =
namespaces[j+1];
- ielem->nbNsBindings++;
+ ielem->nbNsBindings++;
}
}
/*
@@ -27254,7 +27258,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
for (j = 0, i = 0; i < nb_attributes; i++, j += 5) {
/*
* Duplicate the value.
- */
+ */
value = xmlStrndup(attributes[j+3],
attributes[j+4] - attributes[j+3]);
/*
@@ -27281,7 +27285,7 @@ xmlSchemaSAXHandleStartElementNs(void *ctx,
goto internal_error;
}
goto exit;
- }
+ }
exit:
return;
@@ -27391,7 +27395,7 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
#ifdef LIBXML_READER_ENABLED
vctxt->reader = NULL;
#endif
- vctxt->hasKeyrefs = 0;
+ vctxt->hasKeyrefs = 0;
if (vctxt->value != NULL) {
xmlSchemaFreeValue(vctxt->value);
@@ -27461,7 +27465,7 @@ xmlSchemaClearValidCtxt(xmlSchemaValidCtxtPtr vctxt)
break;
xmlSchemaClearElemInfo(vctxt, ei);
}
- }
+ }
xmlSchemaItemListClear(vctxt->nodeQNames);
/* Recreate the dict. */
xmlDictFree(vctxt->dict);
@@ -27563,7 +27567,7 @@ xmlSchemaFreeValidCtxt(xmlSchemaValidCtxtPtr ctxt)
* @ctxt: the schema validation context
*
* Check if any error was detected during validation.
- *
+ *
* Returns 1 if valid so far, 0 if errors were detected, and -1 in case
* of internal error.
*/
@@ -27622,7 +27626,7 @@ xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
/**
* xmlSchemaGetValidErrors:
- * @ctxt: a XML-Schema validation context
+ * @ctxt: a XML-Schema validation context
* @err: the error function result
* @warn: the warning function result
* @ctx: the functions context result
@@ -27683,7 +27687,7 @@ xmlSchemaSetValidOptions(xmlSchemaValidCtxtPtr ctxt,
/**
* xmlSchemaValidCtxtGetOptions:
- * @ctxt: a schema validation context
+ * @ctxt: a schema validation context
*
* Get the validation context options.
*
@@ -27751,7 +27755,7 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
nsName = NULL;
ret = xmlSchemaValidatorPushAttribute(vctxt,
(xmlNodePtr) attr,
- /*
+ /*
* Note that we give it the line number of the
* parent element.
*/
@@ -27807,7 +27811,7 @@ xmlSchemaVDocWalk(xmlSchemaValidCtxtPtr vctxt)
(node->type == XML_ENTITY_REF_NODE)) {
/*
* DOC VAL TODO: What to do with entities?
- */
+ */
VERROR_INT("xmlSchemaVDocWalk",
"there is at least one entity reference in the node-tree "
"currently being validated. Processing of entities with "
@@ -27867,7 +27871,7 @@ static int
xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
/*
* Some initialization.
- */
+ */
vctxt->err = 0;
vctxt->nberrors = 0;
vctxt->depth = -1;
@@ -27884,9 +27888,9 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
*/
if (vctxt->schema == NULL) {
xmlSchemaParserCtxtPtr pctxt;
-
+
vctxt->xsiAssemble = 1;
- /*
+ /*
* If not schema was given then we will create a schema
* dynamically using XSI schema locations.
*
@@ -27902,8 +27906,8 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
*/
vctxt->schema = xmlSchemaNewSchema(pctxt);
if (vctxt->schema == NULL)
- return (-1);
- /*
+ return (-1);
+ /*
* Create the schema construction context.
*/
pctxt->constructor = xmlSchemaConstructionCtxtCreate(pctxt->dict);
@@ -27914,13 +27918,13 @@ xmlSchemaPreRun(xmlSchemaValidCtxtPtr vctxt) {
* Take ownership of the constructor to be able to free it.
*/
pctxt->ownsConstructor = 1;
- }
- /*
- * Augment the IDC definitions for the main schema and all imported ones
+ }
+ /*
+ * Augment the IDC definitions for the main schema and all imported ones
* NOTE: main schema if the first in the imported list
*/
xmlHashScan(vctxt->schema->schemasImports,(xmlHashScanner)xmlSchemaAugmentImportedIDC, vctxt);
-
+
return(0);
}
@@ -28335,10 +28339,10 @@ referenceSplit(void *ctx, const xmlChar *name)
}
static void
-startElementNsSplit(void *ctx, const xmlChar * localname,
- const xmlChar * prefix, const xmlChar * URI,
- int nb_namespaces, const xmlChar ** namespaces,
- int nb_attributes, int nb_defaulted,
+startElementNsSplit(void *ctx, const xmlChar * localname,
+ const xmlChar * prefix, const xmlChar * URI,
+ int nb_namespaces, const xmlChar ** namespaces,
+ int nb_attributes, int nb_defaulted,
const xmlChar ** attributes) {
xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
if (ctxt == NULL)
@@ -28357,7 +28361,7 @@ startElementNsSplit(void *ctx, const xmlChar * localname,
}
static void
-endElementNsSplit(void *ctx, const xmlChar * localname,
+endElementNsSplit(void *ctx, const xmlChar * localname,
const xmlChar * prefix, const xmlChar * URI) {
xmlSchemaSAXPlugPtr ctxt = (xmlSchemaSAXPlugPtr) ctx;
if (ctxt == NULL)
@@ -28398,7 +28402,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
old_sax = *sax;
if ((old_sax != NULL) && (old_sax->initialized != XML_SAX2_MAGIC))
return(NULL);
- if ((old_sax != NULL) &&
+ if ((old_sax != NULL) &&
(old_sax->startElementNs == NULL) && (old_sax->endElementNs == NULL) &&
((old_sax->startElement != NULL) || (old_sax->endElement != NULL)))
return(NULL);
@@ -28416,7 +28420,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
ret->ctxt = ctxt;
ret->user_sax_ptr = sax;
ret->user_sax = old_sax;
- if (old_sax == NULL) {
+ if (old_sax == NULL) {
/*
* go direct, no need for the split block and functions.
*/
@@ -28437,7 +28441,7 @@ xmlSchemaSAXPlug(xmlSchemaValidCtxtPtr ctxt,
} else {
/*
* for each callback unused by Schemas initialize it to the Split
- * routine only if non NULL in the user block, this can speed up
+ * routine only if non NULL in the user block, this can speed up
* things at the SAX level.
*/
if (old_sax->internalSubset != NULL)
@@ -28590,7 +28594,7 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
if (options)
xmlCtxtUseOptions(pctxt, options);
#endif
- pctxt->linenumbers = 1;
+ pctxt->linenumbers = 1;
inputStream = xmlNewIOInputStream(pctxt, input, enc);;
if (inputStream == NULL) {
@@ -28619,7 +28623,7 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
ret = ctxt->parserCtxt->errNo;
if (ret == 0)
ret = 1;
- }
+ }
done:
ctxt->parserCtxt = NULL;
@@ -28658,16 +28662,33 @@ xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt,
if ((ctxt == NULL) || (filename == NULL))
return (-1);
-
+
input = xmlParserInputBufferCreateFilename(filename,
XML_CHAR_ENCODING_NONE);
if (input == NULL)
return (-1);
ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE,
- NULL, NULL);
+ NULL, NULL);
return (ret);
}
+/**
+ * xmlSchemaValidCtxtGetParserCtxt:
+ * @ctxt: a schema validation context
+ *
+ * allow access to the parser context of the schema validation context
+ *
+ * Returns the parser context of the schema validation context or NULL
+ * in case of error.
+ */
+xmlParserCtxtPtr
+xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt)
+{
+ if (ctxt == NULL)
+ return(NULL);
+ return (ctxt->parserCtxt);
+}
+
#define bottom_xmlschemas
#include "elfgcchack.h"
#endif /* LIBXML_SCHEMAS_ENABLED */
diff --git a/xpath.c b/xpath.c
index a52c44a..cfa3f69 100644
--- a/xpath.c
+++ b/xpath.c
@@ -59,7 +59,7 @@
#define XPATH_STREAMING
#endif
-#define TODO \
+#define TODO \
xmlGenericError(xmlGenericErrorContext, \
"Unimplemented block at %s:%d\n", \
__FILE__, __LINE__);
@@ -79,7 +79,7 @@
* XP_OPTIMIZED_FILTER_FIRST:
* If defined, this will optimize expressions like "key('foo', 'val')[b][1]"
* in a way, that it stop evaluation at the first node.
-*/
+*/
#define XP_OPTIMIZED_FILTER_FIRST
/*
@@ -99,9 +99,9 @@
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
/************************************************************************
- * *
- * Floating point stuff *
- * *
+ * *
+ * Floating point stuff *
+ * *
************************************************************************/
#ifndef TRIO_REPLACE_STDIO
@@ -142,7 +142,7 @@ xmlXPathInit(void) {
* Provides a portable isnan() function to detect whether a double
* is a NotaNumber. Based on trio code
* http://sourceforge.net/projects/ctrio/
- *
+ *
* Returns 1 if the value is a NaN, 0 otherwise
*/
int
@@ -157,7 +157,7 @@ xmlXPathIsNaN(double val) {
* Provides a portable isinf() function to detect whether a double
* is a +Infinite or -Infinite. Based on trio code
* http://sourceforge.net/projects/ctrio/
- *
+ *
* Returns 1 vi the value is +Infinite, -1 if -Infinite, 0 otherwise
*/
int
@@ -174,7 +174,7 @@ xmlXPathIsInf(double val) {
* Provides a portable function to detect the sign of a double
* Modified from trio code
* http://sourceforge.net/projects/ctrio/
- *
+ *
* Returns 1 if the value is Negative, 0 if positive
*/
static int
@@ -203,7 +203,7 @@ static xmlNs xmlXPathXMLNamespaceStruct = {
};
static xmlNsPtr xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct;
#ifndef LIBXML_THREAD_ENABLED
-/*
+/*
* Optimizer is disabled only when threaded apps are detected while
* the library ain't compiled for thread safety.
*/
@@ -350,7 +350,7 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int error)
}
/* cleanup current last error */
- xmlResetError(&ctxt->context->lastError);
+ xmlResetError(&ctxt->context->lastError);
ctxt->context->lastError.domain = XML_FROM_XPATH;
ctxt->context->lastError.code = error + XML_XPATH_EXPRESSION_OK -
@@ -390,9 +390,9 @@ xmlXPatherror(xmlXPathParserContextPtr ctxt, const char *file ATTRIBUTE_UNUSED,
}
/************************************************************************
- * *
- * Utilities *
- * *
+ * *
+ * Utilities *
+ * *
************************************************************************/
/**
@@ -412,7 +412,7 @@ struct _xmlPointerList {
* and here, we should make the functions public.
*/
static int
-xmlPointerListAddSize(xmlPointerListPtr list,
+xmlPointerListAddSize(xmlPointerListPtr list,
void *item,
int initialSize)
{
@@ -486,9 +486,9 @@ xmlPointerListFree(xmlPointerListPtr list)
}
/************************************************************************
- * *
- * Parser Types *
- * *
+ * *
+ * Parser Types *
+ * *
************************************************************************/
/*
@@ -533,7 +533,7 @@ typedef enum {
AXIS_PARENT,
AXIS_PRECEDING,
AXIS_PRECEDING_SIBLING,
- AXIS_SELF
+ AXIS_SELF
} xmlXPathAxisVal;
typedef enum {
@@ -549,7 +549,7 @@ typedef enum {
NODE_TYPE_NODE = 0,
NODE_TYPE_COMMENT = XML_COMMENT_NODE,
NODE_TYPE_TEXT = XML_TEXT_NODE,
- NODE_TYPE_PI = XML_PI_NODE
+ NODE_TYPE_PI = XML_PI_NODE
} xmlXPathTypeVal;
#define XP_REWRITE_DOS_CHILD_ELEM 1
@@ -587,9 +587,9 @@ struct _xmlXPathCompExpr {
};
/************************************************************************
- * *
- * Forward declarations *
- * *
+ * *
+ * Forward declarations *
+ * *
************************************************************************/
static void
xmlXPathFreeValueTree(xmlNodeSetPtr obj);
@@ -604,9 +604,9 @@ xmlXPathCompOpEvalToBoolean(xmlXPathParserContextPtr ctxt,
int isPredicate);
/************************************************************************
- * *
- * Parser Type functions *
- * *
+ * *
+ * Parser Type functions *
+ * *
************************************************************************/
/**
@@ -796,19 +796,19 @@ xmlXPathCompSwap(xmlXPathStepOpPtr op) {
xmlXPathCompExprAdd(ctxt->comp, ctxt->comp->last, -1, \
(op), (val), (val2), (val3), (val4), (val5))
-#define PUSH_LEAVE_EXPR(op, val, val2) \
+#define PUSH_LEAVE_EXPR(op, val, val2) \
xmlXPathCompExprAdd(ctxt->comp, -1, -1, (op), (val), (val2), 0 ,NULL ,NULL)
-#define PUSH_UNARY_EXPR(op, ch, val, val2) \
+#define PUSH_UNARY_EXPR(op, ch, val, val2) \
xmlXPathCompExprAdd(ctxt->comp, (ch), -1, (op), (val), (val2), 0 ,NULL ,NULL)
-#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2) \
+#define PUSH_BINARY_EXPR(op, ch1, ch2, val, val2) \
xmlXPathCompExprAdd(ctxt->comp, (ch1), (ch2), (op), \
(val), (val2), 0 ,NULL ,NULL)
/************************************************************************
* *
- * XPath object cache structures *
+ * XPath object cache structures *
* *
************************************************************************/
@@ -840,8 +840,8 @@ struct _xmlXPathContextCache {
int dbgCachedLocset;
int dbgCachedUsers;
int dbgCachedXSLTTree;
- int dbgCachedUndefined;
-
+ int dbgCachedUndefined;
+
int dbgReusedAll;
int dbgReusedNodeset;
@@ -860,11 +860,11 @@ struct _xmlXPathContextCache {
/************************************************************************
* *
- * Debugging related functions *
+ * Debugging related functions *
* *
************************************************************************/
-#define STRANGE \
+#define STRANGE \
xmlGenericError(xmlGenericErrorContext, \
"Internal error at %s:%d\n", \
__FILE__, __LINE__);
@@ -882,7 +882,7 @@ xmlXPathDebugDumpNode(FILE *output, xmlNodePtr cur, int depth) {
fprintf(output, shift);
fprintf(output, "Node is NULL !\n");
return;
-
+
}
if ((cur->type == XML_DOCUMENT_NODE) ||
@@ -907,7 +907,7 @@ xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) {
fprintf(output, shift);
fprintf(output, "Node is NULL !\n");
return;
-
+
}
while (cur != NULL) {
@@ -930,7 +930,7 @@ xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) {
fprintf(output, shift);
fprintf(output, "NodeSet is NULL !\n");
return;
-
+
}
if (cur != NULL) {
@@ -956,7 +956,7 @@ xmlXPathDebugDumpValueTree(FILE *output, xmlNodeSetPtr cur, int depth) {
fprintf(output, shift);
fprintf(output, "Value Tree is NULL !\n");
return;
-
+
}
fprintf(output, shift);
@@ -977,7 +977,7 @@ xmlXPathDebugDumpLocationSet(FILE *output, xmlLocationSetPtr cur, int depth) {
fprintf(output, shift);
fprintf(output, "LocationSet is NULL !\n");
return;
-
+
}
for (i = 0;i < cur->locNr;i++) {
@@ -1008,7 +1008,7 @@ xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
shift[2 * i] = shift[2 * i + 1] = 0;
- fprintf(output, shift);
+ fprintf(output, shift);
if (cur == NULL) {
fprintf(output, "Object is empty (NULL)\n");
@@ -1333,7 +1333,7 @@ static int xmlXPathDebugObjTotalRange = 0;
static int xmlXPathDebugObjTotalLocset = 0;
static int xmlXPathDebugObjTotalUsers = 0;
static int xmlXPathDebugObjTotalXSLTTree = 0;
-static int xmlXPathDebugObjTotalAll = 0;
+static int xmlXPathDebugObjTotalAll = 0;
static int xmlXPathDebugObjMaxUndefined = 0;
static int xmlXPathDebugObjMaxNodeset = 0;
@@ -1366,7 +1366,7 @@ xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
cache->dbgCachedLocset = 0;
cache->dbgCachedUsers = 0;
cache->dbgCachedXSLTTree = 0;
- cache->dbgCachedUndefined = 0;
+ cache->dbgCachedUndefined = 0;
cache->dbgReusedAll = 0;
cache->dbgReusedNodeset = 0;
@@ -1380,7 +1380,7 @@ xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
cache->dbgReusedXSLTTree = 0;
cache->dbgReusedUndefined = 0;
}
- }
+ }
xmlXPathDebugObjCounterUndefined = 0;
xmlXPathDebugObjCounterNodeset = 0;
@@ -1393,7 +1393,7 @@ xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
xmlXPathDebugObjCounterUsers = 0;
xmlXPathDebugObjCounterXSLTTree = 0;
xmlXPathDebugObjCounterAll = 0;
-
+
xmlXPathDebugObjTotalUndefined = 0;
xmlXPathDebugObjTotalNodeset = 0;
xmlXPathDebugObjTotalBool = 0;
@@ -1404,7 +1404,7 @@ xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
xmlXPathDebugObjTotalLocset = 0;
xmlXPathDebugObjTotalUsers = 0;
xmlXPathDebugObjTotalXSLTTree = 0;
- xmlXPathDebugObjTotalAll = 0;
+ xmlXPathDebugObjTotalAll = 0;
xmlXPathDebugObjMaxUndefined = 0;
xmlXPathDebugObjMaxNodeset = 0;
@@ -1430,10 +1430,10 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
if (ctxt->cache != NULL) {
xmlXPathContextCachePtr cache =
(xmlXPathContextCachePtr) ctxt->cache;
-
+
isCached = 1;
-
- cache->dbgReusedAll++;
+
+ cache->dbgReusedAll++;
switch (objType) {
case XPATH_UNDEFINED:
cache->dbgReusedUndefined++;
@@ -1467,7 +1467,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
break;
default:
break;
- }
+ }
}
}
@@ -1475,7 +1475,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_UNDEFINED:
if (! isCached)
xmlXPathDebugObjTotalUndefined++;
- xmlXPathDebugObjCounterUndefined++;
+ xmlXPathDebugObjCounterUndefined++;
if (xmlXPathDebugObjCounterUndefined >
xmlXPathDebugObjMaxUndefined)
xmlXPathDebugObjMaxUndefined =
@@ -1484,7 +1484,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_NODESET:
if (! isCached)
xmlXPathDebugObjTotalNodeset++;
- xmlXPathDebugObjCounterNodeset++;
+ xmlXPathDebugObjCounterNodeset++;
if (xmlXPathDebugObjCounterNodeset >
xmlXPathDebugObjMaxNodeset)
xmlXPathDebugObjMaxNodeset =
@@ -1493,7 +1493,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_BOOLEAN:
if (! isCached)
xmlXPathDebugObjTotalBool++;
- xmlXPathDebugObjCounterBool++;
+ xmlXPathDebugObjCounterBool++;
if (xmlXPathDebugObjCounterBool >
xmlXPathDebugObjMaxBool)
xmlXPathDebugObjMaxBool =
@@ -1502,7 +1502,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_NUMBER:
if (! isCached)
xmlXPathDebugObjTotalNumber++;
- xmlXPathDebugObjCounterNumber++;
+ xmlXPathDebugObjCounterNumber++;
if (xmlXPathDebugObjCounterNumber >
xmlXPathDebugObjMaxNumber)
xmlXPathDebugObjMaxNumber =
@@ -1511,7 +1511,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_STRING:
if (! isCached)
xmlXPathDebugObjTotalString++;
- xmlXPathDebugObjCounterString++;
+ xmlXPathDebugObjCounterString++;
if (xmlXPathDebugObjCounterString >
xmlXPathDebugObjMaxString)
xmlXPathDebugObjMaxString =
@@ -1520,7 +1520,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_POINT:
if (! isCached)
xmlXPathDebugObjTotalPoint++;
- xmlXPathDebugObjCounterPoint++;
+ xmlXPathDebugObjCounterPoint++;
if (xmlXPathDebugObjCounterPoint >
xmlXPathDebugObjMaxPoint)
xmlXPathDebugObjMaxPoint =
@@ -1547,7 +1547,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_USERS:
if (! isCached)
xmlXPathDebugObjTotalUsers++;
- xmlXPathDebugObjCounterUsers++;
+ xmlXPathDebugObjCounterUsers++;
if (xmlXPathDebugObjCounterUsers >
xmlXPathDebugObjMaxUsers)
xmlXPathDebugObjMaxUsers =
@@ -1556,7 +1556,7 @@ xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
case XPATH_XSLT_TREE:
if (! isCached)
xmlXPathDebugObjTotalXSLTTree++;
- xmlXPathDebugObjCounterXSLTTree++;
+ xmlXPathDebugObjCounterXSLTTree++;
if (xmlXPathDebugObjCounterXSLTTree >
xmlXPathDebugObjMaxXSLTTree)
xmlXPathDebugObjMaxXSLTTree =
@@ -1585,8 +1585,8 @@ xmlXPathDebugObjUsageReleased(xmlXPathContextPtr ctxt,
xmlXPathContextCachePtr cache =
(xmlXPathContextCachePtr) ctxt->cache;
- isCached = 1;
-
+ isCached = 1;
+
cache->dbgCachedAll++;
switch (objType) {
case XPATH_UNDEFINED:
@@ -1622,7 +1622,7 @@ xmlXPathDebugObjUsageReleased(xmlXPathContextPtr ctxt,
default:
break;
}
-
+
}
}
switch (objType) {
@@ -1658,7 +1658,7 @@ xmlXPathDebugObjUsageReleased(xmlXPathContextPtr ctxt,
break;
default:
break;
- }
+ }
xmlXPathDebugObjCounterAll--;
}
@@ -1681,7 +1681,7 @@ xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
reqNumber = xmlXPathDebugObjTotalNumber;
reqXSLTTree = xmlXPathDebugObjTotalXSLTTree;
reqUndefined = xmlXPathDebugObjTotalUndefined;
-
+
printf("# XPath object usage:\n");
if (ctxt != NULL) {
@@ -1703,7 +1703,7 @@ xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
reqXSLTTree += reXSLTTree;
reUndefined = cache->dbgReusedUndefined;
reqUndefined += reUndefined;
-
+
caAll = cache->dbgCachedAll;
caBool = cache->dbgCachedBool;
caNodeset = cache->dbgCachedNodeset;
@@ -1711,7 +1711,7 @@ xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
caNumber = cache->dbgCachedNumber;
caXSLTTree = cache->dbgCachedXSLTTree;
caUndefined = cache->dbgCachedUndefined;
-
+
if (cache->nodesetObjs)
leftObjs -= cache->nodesetObjs->number;
if (cache->stringObjs)
@@ -1724,8 +1724,8 @@ xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
leftObjs -= cache->miscObjs->number;
}
}
-
- printf("# all\n");
+
+ printf("# all\n");
printf("# total : %d\n", reqAll);
printf("# left : %d\n", leftObjs);
printf("# created: %d\n", xmlXPathDebugObjTotalAll);
@@ -1848,7 +1848,7 @@ xmlXPathFreeCache(xmlXPathContextCachePtr cache)
if (cache->numberObjs)
xmlXPathCacheFreeObjectList(cache->numberObjs);
if (cache->miscObjs)
- xmlXPathCacheFreeObjectList(cache->miscObjs);
+ xmlXPathCacheFreeObjectList(cache->miscObjs);
xmlFree(cache);
}
@@ -1857,7 +1857,7 @@ xmlXPathFreeCache(xmlXPathContextCachePtr cache)
*
* @ctxt: the XPath context
* @active: enables/disables (creates/frees) the cache
- * @value: a value with semantics dependant on @options
+ * @value: a value with semantics dependant on @options
* @options: options (currently only the value 0 is used)
*
* Creates/frees an object cache on the XPath context.
@@ -1884,7 +1884,7 @@ xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
return(-1);
if (active) {
xmlXPathContextCachePtr cache;
-
+
if (ctxt->cache == NULL) {
ctxt->cache = xmlXPathNewCache();
if (ctxt->cache == NULL)
@@ -1919,7 +1919,7 @@ xmlXPathContextSetCache(xmlXPathContextPtr ctxt,
*/
static xmlXPathObjectPtr
xmlXPathCacheWrapNodeSet(xmlXPathContextPtr ctxt, xmlNodeSetPtr val)
-{
+{
if ((ctxt != NULL) && (ctxt->cache != NULL)) {
xmlXPathContextCachePtr cache =
(xmlXPathContextCachePtr) ctxt->cache;
@@ -1928,7 +1928,7 @@ xmlXPathCacheWrapNodeSet(xmlXPathContextPtr ctxt, xmlNodeSetPtr val)
(cache->miscObjs->number != 0))
{
xmlXPathObjectPtr ret;
-
+
ret = (xmlXPathObjectPtr)
cache->miscObjs->items[--cache->miscObjs->number];
ret->type = XPATH_NODESET;
@@ -1936,12 +1936,12 @@ xmlXPathCacheWrapNodeSet(xmlXPathContextPtr ctxt, xmlNodeSetPtr val)
#ifdef XP_DEBUG_OBJ_USAGE
xmlXPathDebugObjUsageRequested(ctxt, XPATH_NODESET);
#endif
- return(ret);
+ return(ret);
}
}
-
+
return(xmlXPathWrapNodeSet(val));
-
+
}
/**
@@ -1956,16 +1956,16 @@ xmlXPathCacheWrapNodeSet(xmlXPathContextPtr ctxt, xmlNodeSetPtr val)
*/
static xmlXPathObjectPtr
xmlXPathCacheWrapString(xmlXPathContextPtr ctxt, xmlChar *val)
-{
+{
if ((ctxt != NULL) && (ctxt->cache != NULL)) {
xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
if ((cache->stringObjs != NULL) &&
(cache->stringObjs->number != 0))
{
-
+
xmlXPathObjectPtr ret;
-
+
ret = (xmlXPathObjectPtr)
cache->stringObjs->items[--cache->stringObjs->number];
ret->type = XPATH_STRING;
@@ -2014,20 +2014,20 @@ xmlXPathCacheNewNodeSet(xmlXPathContextPtr ctxt, xmlNodePtr val)
if ((cache->nodesetObjs != NULL) &&
(cache->nodesetObjs->number != 0))
- {
+ {
xmlXPathObjectPtr ret;
/*
* Use the nodset-cache.
- */
+ */
ret = (xmlXPathObjectPtr)
cache->nodesetObjs->items[--cache->nodesetObjs->number];
ret->type = XPATH_NODESET;
ret->boolval = 0;
- if (val) {
+ if (val) {
if ((ret->nodesetval->nodeMax == 0) ||
(val->type == XML_NAMESPACE_DECL))
{
- xmlXPathNodeSetAddUnique(ret->nodesetval, val);
+ xmlXPathNodeSetAddUnique(ret->nodesetval, val);
} else {
ret->nodesetval->nodeTab[0] = val;
ret->nodesetval->nodeNr = 1;
@@ -2072,15 +2072,15 @@ xmlXPathCacheNewNodeSet(xmlXPathContextPtr ctxt, xmlNodePtr val)
*/
static xmlXPathObjectPtr
xmlXPathCacheNewCString(xmlXPathContextPtr ctxt, const char *val)
-{
+{
if ((ctxt != NULL) && (ctxt->cache)) {
xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
if ((cache->stringObjs != NULL) &&
(cache->stringObjs->number != 0))
- {
+ {
xmlXPathObjectPtr ret;
-
+
ret = (xmlXPathObjectPtr)
cache->stringObjs->items[--cache->stringObjs->number];
@@ -2121,15 +2121,15 @@ xmlXPathCacheNewCString(xmlXPathContextPtr ctxt, const char *val)
*/
static xmlXPathObjectPtr
xmlXPathCacheNewString(xmlXPathContextPtr ctxt, const xmlChar *val)
-{
+{
if ((ctxt != NULL) && (ctxt->cache)) {
xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
if ((cache->stringObjs != NULL) &&
(cache->stringObjs->number != 0))
- {
+ {
xmlXPathObjectPtr ret;
-
+
ret = (xmlXPathObjectPtr)
cache->stringObjs->items[--cache->stringObjs->number];
ret->type = XPATH_STRING;
@@ -2175,15 +2175,15 @@ xmlXPathCacheNewString(xmlXPathContextPtr ctxt, const xmlChar *val)
*/
static xmlXPathObjectPtr
xmlXPathCacheNewBoolean(xmlXPathContextPtr ctxt, int val)
-{
+{
if ((ctxt != NULL) && (ctxt->cache)) {
xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
if ((cache->booleanObjs != NULL) &&
(cache->booleanObjs->number != 0))
- {
+ {
xmlXPathObjectPtr ret;
-
+
ret = (xmlXPathObjectPtr)
cache->booleanObjs->items[--cache->booleanObjs->number];
ret->type = XPATH_BOOLEAN;
@@ -2229,9 +2229,9 @@ xmlXPathCacheNewFloat(xmlXPathContextPtr ctxt, double val)
if ((cache->numberObjs != NULL) &&
(cache->numberObjs->number != 0))
- {
+ {
xmlXPathObjectPtr ret;
-
+
ret = (xmlXPathObjectPtr)
cache->numberObjs->items[--cache->numberObjs->number];
ret->type = XPATH_NUMBER;
@@ -2273,7 +2273,7 @@ xmlXPathCacheNewFloat(xmlXPathContextPtr ctxt, double val)
static xmlXPathObjectPtr
xmlXPathCacheConvertString(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val) {
- xmlChar *res = NULL;
+ xmlChar *res = NULL;
if (val == NULL)
return(xmlXPathCacheNewCString(ctxt, ""));
@@ -2357,7 +2357,7 @@ xmlXPathCacheObjectCopy(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val)
static xmlXPathObjectPtr
xmlXPathCacheConvertBoolean(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val) {
xmlXPathObjectPtr ret;
-
+
if (val == NULL)
return(xmlXPathCacheNewBoolean(ctxt, 0));
if (val->type == XPATH_BOOLEAN)
@@ -2381,7 +2381,7 @@ xmlXPathCacheConvertBoolean(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val) {
static xmlXPathObjectPtr
xmlXPathCacheConvertNumber(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val) {
xmlXPathObjectPtr ret;
-
+
if (val == NULL)
return(xmlXPathCacheNewFloat(ctxt, 0.0));
if (val->type == XPATH_NUMBER)
@@ -2393,7 +2393,7 @@ xmlXPathCacheConvertNumber(xmlXPathContextPtr ctxt, xmlXPathObjectPtr val) {
/************************************************************************
* *
- * Parser stacks related functions and macros *
+ * Parser stacks related functions and macros *
* *
************************************************************************/
@@ -2632,7 +2632,7 @@ xmlXPathPopExternal (xmlXPathParserContextPtr ctxt) {
#define NEXTL(l) ctxt->cur += l
-#define SKIP_BLANKS \
+#define SKIP_BLANKS \
while (IS_BLANK_CH(*(ctxt->cur))) NEXT
#define CURRENT (*ctxt->cur)
@@ -3001,17 +3001,17 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
if (node1 == node2)
return(0);
-
+
/*
* a couple of optimizations which will avoid computations in most cases
- */
+ */
switch (node1->type) {
case XML_ELEMENT_NODE:
if (node2->type == XML_ELEMENT_NODE) {
if ((0 > (long) node1->content) && /* TODO: Would a != 0 suffice here? */
(0 > (long) node2->content) &&
(node1->doc == node2->doc))
- {
+ {
l1 = -((long) node1->content);
l2 = -((long) node2->content);
if (l1 < l2)
@@ -3019,7 +3019,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
if (l1 > l2)
return(-1);
} else
- goto turtle_comparison;
+ goto turtle_comparison;
}
break;
case XML_ATTRIBUTE_NODE:
@@ -3035,7 +3035,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
miscNode1 = node1;
/*
* Find nearest element node.
- */
+ */
if (node1->prev != NULL) {
do {
node1 = node1->prev;
@@ -3075,9 +3075,9 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
return(1);
default:
break;
- }
+ }
switch (node2->type) {
- case XML_ELEMENT_NODE:
+ case XML_ELEMENT_NODE:
break;
case XML_ATTRIBUTE_NODE:
precedence2 = 1; /* element is owner */
@@ -3106,7 +3106,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
} else {
precedence2 = 2; /* element is parent */
node2 = node2->parent;
- }
+ }
if ((node2 == NULL) || (node2->type != XML_ELEMENT_NODE) ||
(0 <= (long) node1->content))
{
@@ -3144,11 +3144,11 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
* Is this 100% correct?
*/
if (precedence1 < precedence2)
- return(1);
+ return(1);
else
- return(-1);
+ return(-1);
}
- }
+ }
/*
* Special case: One of the helper-elements is contained by the other.
* <foo>
@@ -3157,7 +3157,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
* </node2>
* Text-6(precedence2 == 3)
* </foo>
- */
+ */
if ((precedence2 == 3) && (precedence1 > 1)) {
cur = node1->parent;
while (cur) {
@@ -3166,7 +3166,7 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
cur = cur->parent;
}
}
- if ((precedence1 == 3) && (precedence2 > 1)) {
+ if ((precedence1 == 3) && (precedence2 > 1)) {
cur = node2->parent;
while (cur) {
if (cur == node1)
@@ -3174,16 +3174,16 @@ xmlXPathCmpNodesExt(xmlNodePtr node1, xmlNodePtr node2) {
cur = cur->parent;
}
}
- }
+ }
/*
* Speedup using document order if availble.
*/
- if ((node1->type == XML_ELEMENT_NODE) &&
+ if ((node1->type == XML_ELEMENT_NODE) &&
(node2->type == XML_ELEMENT_NODE) &&
(0 > (long) node1->content) &&
(0 > (long) node2->content) &&
- (node1->doc == node2->doc)) {
+ (node1->doc == node2->doc)) {
l1 = -((long) node1->content);
l2 = -((long) node2->content);
@@ -3251,7 +3251,7 @@ turtle_comparison:
(node2->type == XML_ELEMENT_NODE) &&
(0 > (long) node1->content) &&
(0 > (long) node2->content) &&
- (node1->doc == node2->doc)) {
+ (node1->doc == node2->doc)) {
l1 = -((long) node1->content);
l2 = -((long) node2->content);
@@ -3339,9 +3339,9 @@ xmlXPathNodeSetDupNs(xmlNodePtr node, xmlNsPtr ns) {
memset(cur, 0, sizeof(xmlNs));
cur->type = XML_NAMESPACE_DECL;
if (ns->href != NULL)
- cur->href = xmlStrdup(ns->href);
+ cur->href = xmlStrdup(ns->href);
if (ns->prefix != NULL)
- cur->prefix = xmlStrdup(ns->prefix);
+ cur->prefix = xmlStrdup(ns->prefix);
cur->next = (xmlNsPtr) node;
return((xmlNodePtr) cur);
}
@@ -3435,7 +3435,7 @@ xmlXPathNodeSetCreateSize(int size) {
return(NULL);
}
memset(ret->nodeTab, 0 , size * (size_t) sizeof(xmlNodePtr));
- ret->nodeMax = size;
+ ret->nodeMax = size;
return(ret);
}
@@ -3488,7 +3488,7 @@ void
xmlXPathNodeSetAddNs(xmlNodeSetPtr cur, xmlNodePtr node, xmlNsPtr ns) {
int i;
-
+
if ((cur == NULL) || (ns == NULL) || (node == NULL) ||
(ns->type != XML_NAMESPACE_DECL) ||
(node->type != XML_ELEMENT_NODE))
@@ -3587,7 +3587,7 @@ xmlXPathNodeSetAdd(xmlNodeSetPtr cur, xmlNodePtr val) {
if (val->type == XML_NAMESPACE_DECL) {
xmlNsPtr ns = (xmlNsPtr) val;
- cur->nodeTab[cur->nodeNr++] =
+ cur->nodeTab[cur->nodeNr++] =
xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
} else
cur->nodeTab[cur->nodeNr++] = val;
@@ -3639,7 +3639,7 @@ xmlXPathNodeSetAddUnique(xmlNodeSetPtr cur, xmlNodePtr val) {
if (val->type == XML_NAMESPACE_DECL) {
xmlNsPtr ns = (xmlNsPtr) val;
- cur->nodeTab[cur->nodeNr++] =
+ cur->nodeTab[cur->nodeNr++] =
xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
} else
cur->nodeTab[cur->nodeNr++] = val;
@@ -3674,7 +3674,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) {
* If there was a flag on the nodesetval, indicating that
* some temporary nodes are in, that would be helpfull.
*/
- /*
+ /*
* Optimization: Create an equally sized node-set
* and memcpy the content.
*/
@@ -3698,7 +3698,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) {
initNr = val1->nodeNr;
for (i = 0;i < val2->nodeNr;i++) {
- n2 = val2->nodeTab[i];
+ n2 = val2->nodeTab[i];
/*
* check against duplicates
*/
@@ -3709,7 +3709,7 @@ xmlXPathNodeSetMerge(xmlNodeSetPtr val1, xmlNodeSetPtr val2) {
skip = 1;
break;
} else if ((n1->type == XML_NAMESPACE_DECL) &&
- (n2->type == XML_NAMESPACE_DECL)) {
+ (n2->type == XML_NAMESPACE_DECL)) {
if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
(xmlStrEqual(((xmlNsPtr) n1)->prefix,
((xmlNsPtr) n2)->prefix)))
@@ -3860,7 +3860,7 @@ xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
if (set1 == NULL)
return (NULL);
- initNbSet1 = set1->nodeNr;
+ initNbSet1 = set1->nodeNr;
for (i = 0;i < set2->nodeNr;i++) {
n2 = set2->nodeTab[i];
/*
@@ -3873,11 +3873,11 @@ xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
*/
for (j = 0; j < initNbSet1; j++) {
n1 = set1->nodeTab[j];
- if (n1 == n2) {
+ if (n1 == n2) {
goto skip_node;
} else if ((n1->type == XML_NAMESPACE_DECL) &&
(n2->type == XML_NAMESPACE_DECL))
- {
+ {
if ((((xmlNsPtr) n1)->next == ((xmlNsPtr) n2)->next) &&
(xmlStrEqual(((xmlNsPtr) n1)->prefix,
((xmlNsPtr) n2)->prefix)))
@@ -3906,7 +3906,7 @@ xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
set1->nodeMax = XML_NODESET_DEFAULT;
} else if (set1->nodeNr >= set1->nodeMax) {
xmlNodePtr *temp;
-
+
set1->nodeMax *= 2;
temp = (xmlNodePtr *) xmlRealloc(
set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr));
@@ -3918,7 +3918,7 @@ xmlXPathNodeSetMergeAndClear(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
}
if (n2->type == XML_NAMESPACE_DECL) {
xmlNsPtr ns = (xmlNsPtr) n2;
-
+
set1->nodeTab[set1->nodeNr++] =
xmlXPathNodeSetDupNs((xmlNodePtr) ns->next, ns);
} else
@@ -3946,7 +3946,7 @@ skip_node:
static xmlNodeSetPtr
xmlXPathNodeSetMergeAndClearNoDupls(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
int hasNullEntries)
-{
+{
if (set2 == NULL)
return(set1);
if ((set1 == NULL) && (hasNullEntries == 0)) {
@@ -3970,14 +3970,14 @@ xmlXPathNodeSetMergeAndClearNoDupls(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
set1 = xmlXPathNodeSetCreate(NULL);
if (set1 == NULL)
return (NULL);
-
+
for (i = 0;i < set2->nodeNr;i++) {
n2 = set2->nodeTab[i];
/*
* Skip NULLed entries.
*/
if (n2 == NULL)
- continue;
+ continue;
if (set1->nodeMax == 0) {
set1->nodeTab = (xmlNodePtr *) xmlMalloc(
XML_NODESET_DEFAULT * sizeof(xmlNodePtr));
@@ -3990,7 +3990,7 @@ xmlXPathNodeSetMergeAndClearNoDupls(xmlNodeSetPtr set1, xmlNodeSetPtr set2,
set1->nodeMax = XML_NODESET_DEFAULT;
} else if (set1->nodeNr >= set1->nodeMax) {
xmlNodePtr *temp;
-
+
set1->nodeMax *= 2;
temp = (xmlNodePtr *) xmlRealloc(
set1->nodeTab, set1->nodeMax * sizeof(xmlNodePtr));
@@ -4029,7 +4029,7 @@ xmlXPathNodeSetDel(xmlNodeSetPtr cur, xmlNodePtr val) {
if (i >= cur->nodeNr) { /* not found */
#ifdef DEBUG
- xmlGenericError(xmlGenericErrorContext,
+ xmlGenericError(xmlGenericErrorContext,
"xmlXPathNodeSetDel: Node %s wasn't found in NodeList\n",
val->name);
#endif
@@ -4089,7 +4089,7 @@ xmlXPathFreeNodeSet(xmlNodeSetPtr obj) {
/**
* xmlXPathNodeSetClear:
* @set: the node set to clear
- *
+ *
* Clears the list from all temporary XPath objects (e.g. namespace nodes
* are feed), but does *not* free the list itself. Sets the length of the
* list to 0.
@@ -4102,13 +4102,13 @@ xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes)
else if (hasNsNodes) {
int i;
xmlNodePtr node;
-
+
for (i = 0; i < set->nodeNr; i++) {
node = set->nodeTab[i];
if ((node != NULL) &&
(node->type == XML_NAMESPACE_DECL))
xmlXPathNodeSetFreeNs((xmlNsPtr) node);
- }
+ }
}
set->nodeNr = 0;
}
@@ -4117,7 +4117,7 @@ xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes)
* xmlXPathNodeSetClearFromPos:
* @set: the node set to be cleared
* @pos: the start position to clear from
- *
+ *
* Clears the list from temporary XPath objects (e.g. namespace nodes
* are feed) starting with the entry at @pos, but does *not* free the list
* itself. Sets the length of the list to @pos.
@@ -4130,13 +4130,13 @@ xmlXPathNodeSetClearFromPos(xmlNodeSetPtr set, int pos, int hasNsNodes)
else if ((hasNsNodes)) {
int i;
xmlNodePtr node;
-
+
for (i = pos; i < set->nodeNr; i++) {
node = set->nodeTab[i];
if ((node != NULL) &&
(node->type == XML_NAMESPACE_DECL))
xmlXPathNodeSetFreeNs((xmlNsPtr) node);
- }
+ }
}
set->nodeNr = pos;
}
@@ -4413,7 +4413,7 @@ xmlXPathIntersection (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) {
*
* Implements the EXSLT - Sets distinct() function:
* node-set set:distinct (node-set)
- *
+ *
* Returns a subset of the nodes contained in @nodes, or @nodes if
* it is empty
*/
@@ -4722,7 +4722,7 @@ xmlXPathTrailing (xmlNodeSetPtr nodes1, xmlNodeSetPtr nodes2) {
*
* Returns 0 in case of success, -1 in case of error
*/
-int
+int
xmlXPathRegisterFunc(xmlXPathContextPtr ctxt, const xmlChar *name,
xmlXPathFunction f) {
return(xmlXPathRegisterFuncNS(ctxt, name, NULL, f));
@@ -4816,7 +4816,7 @@ xmlXPathFunction
xmlXPathFunctionLookupNS(xmlXPathContextPtr ctxt, const xmlChar *name,
const xmlChar *ns_uri) {
xmlXPathFunction ret;
-
+
if (ctxt == NULL)
return(NULL);
if (name == NULL)
@@ -4870,7 +4870,7 @@ xmlXPathRegisteredFuncsCleanup(xmlXPathContextPtr ctxt) {
*
* Returns 0 in case of success, -1 in case of error
*/
-int
+int
xmlXPathRegisterVariable(xmlXPathContextPtr ctxt, const xmlChar *name,
xmlXPathObjectPtr value) {
return(xmlXPathRegisterVariableNS(ctxt, name, NULL, value));
@@ -4902,7 +4902,7 @@ xmlXPathRegisterVariableNS(xmlXPathContextPtr ctxt, const xmlChar *name,
if (ctxt->varHash == NULL)
return(-1);
if (value == NULL)
- return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri,
+ return(xmlHashRemoveEntry2(ctxt->varHash, name, ns_uri,
(xmlHashDeallocator)xmlXPathFreeObject));
return(xmlHashUpdateEntry2(ctxt->varHash, name, ns_uri,
(void *) value,
@@ -4958,7 +4958,7 @@ xmlXPathVariableLookup(xmlXPathContextPtr ctxt, const xmlChar *name) {
* @ns_uri: the variable namespace URI
*
* Search in the Variable array of the context for the given
- * variable value.
+ * variable value.
*
* Returns the a copy of the value or NULL if not found
*/
@@ -5341,7 +5341,7 @@ xmlXPathObjectCopy(xmlXPathObjectPtr val) {
#endif
case XPATH_USERS:
ret->user = val->user;
- break;
+ break;
case XPATH_UNDEFINED:
xmlGenericError(xmlGenericErrorContext,
"xmlXPathObjectCopy: unsupported type %d\n",
@@ -5370,7 +5370,7 @@ xmlXPathFreeObject(xmlXPathObjectPtr obj) {
#endif
obj->type = XPATH_XSLT_TREE; /* TODO: Just for debugging. */
if (obj->nodesetval != NULL)
- xmlXPathFreeValueTree(obj->nodesetval);
+ xmlXPathFreeValueTree(obj->nodesetval);
} else {
if (obj->nodesetval != NULL)
xmlXPathFreeNodeSet(obj->nodesetval);
@@ -5387,7 +5387,7 @@ xmlXPathFreeObject(xmlXPathObjectPtr obj) {
#ifdef XP_DEBUG_OBJ_USAGE
xmlXPathDebugObjUsageReleased(NULL, obj->type);
#endif
- xmlFree(obj);
+ xmlFree(obj);
}
/**
@@ -5410,7 +5410,7 @@ xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj)
return;
if ((ctxt == NULL) || (ctxt->cache == NULL)) {
xmlXPathFreeObject(obj);
- } else {
+ } else {
xmlXPathContextCachePtr cache =
(xmlXPathContextCachePtr) ctxt->cache;
@@ -5419,7 +5419,7 @@ xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj)
case XPATH_XSLT_TREE:
if (obj->nodesetval != NULL) {
if (obj->boolval) {
- /*
+ /*
* It looks like the @boolval is used for
* evaluation if this an XSLT Result Tree Fragment.
* TODO: Check if this assumption is correct.
@@ -5466,7 +5466,7 @@ xmlXPathReleaseObject(xmlXPathContextPtr ctxt, xmlXPathObjectPtr obj)
xmlXPtrFreeLocationSet(obj->user);
}
goto free_obj;
-#endif
+#endif
default:
goto free_obj;
}
@@ -5487,7 +5487,7 @@ obj_cached:
if (obj->nodesetval != NULL) {
xmlNodeSetPtr tmpset = obj->nodesetval;
-
+
/*
* TODO: Due to those nasty ns-nodes, we need to traverse
* the list and free the ns-nodes.
@@ -5510,7 +5510,7 @@ obj_cached:
if ((tmpset->nodeTab[0] != NULL) &&
(tmpset->nodeTab[0]->type == XML_NAMESPACE_DECL))
xmlXPathNodeSetFreeNs((xmlNsPtr) tmpset->nodeTab[0]);
- }
+ }
tmpset->nodeNr = 0;
memset(obj, 0, sizeof(xmlXPathObject));
obj->nodesetval = tmpset;
@@ -5522,7 +5522,7 @@ obj_cached:
free_obj:
/*
* Cache is full; free the object.
- */
+ */
if (obj->nodesetval != NULL)
xmlXPathFreeNodeSet(obj->nodesetval);
#ifdef XP_DEBUG_OBJ_USAGE
@@ -5633,7 +5633,7 @@ xmlXPathCastNodeSetToString (xmlNodeSetPtr ns) {
* Converts an existing object to its string() equivalent
*
* Returns the allocated string value of the object, NULL in case of error.
- * It's up to the caller to free the string memory with xmlFree().
+ * It's up to the caller to free the string memory with xmlFree().
*/
xmlChar *
xmlXPathCastToString(xmlXPathObjectPtr val) {
@@ -6024,7 +6024,7 @@ xmlXPathNewContext(xmlDocPtr doc) {
}
#endif
- xmlXPathRegisterAllFunctions(ret);
+ xmlXPathRegisterAllFunctions(ret);
return(ret);
}
@@ -6055,7 +6055,7 @@ xmlXPathFreeContext(xmlXPathContextPtr ctxt) {
************************************************************************/
#define CHECK_CTXT(ctxt) \
- if (ctxt == NULL) { \
+ if (ctxt == NULL) { \
__xmlRaiseError(NULL, NULL, NULL, \
NULL, NULL, XML_FROM_XPATH, \
XML_ERR_INTERNAL_ERROR, XML_ERR_FATAL, \
@@ -6066,7 +6066,7 @@ xmlXPathFreeContext(xmlXPathContextPtr ctxt) {
} \
#define CHECK_CTXT_NEG(ctxt) \
- if (ctxt == NULL) { \
+ if (ctxt == NULL) { \
__xmlRaiseError(NULL, NULL, NULL, \
NULL, NULL, XML_FROM_XPATH, \
XML_ERR_INTERNAL_ERROR, XML_ERR_FATAL, \
@@ -6079,7 +6079,7 @@ xmlXPathFreeContext(xmlXPathContextPtr ctxt) {
#define CHECK_CONTEXT(ctxt) \
if ((ctxt == NULL) || (ctxt->doc == NULL) || \
- (ctxt->doc->children == NULL)) { \
+ (ctxt->doc->children == NULL)) { \
xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_INVALID_CTXT); \
return(NULL); \
}
@@ -6142,7 +6142,7 @@ xmlXPathCompParserContext(xmlXPathCompExprPtr comp, xmlXPathContextPtr ctxt) {
memset(ret, 0 , (size_t) sizeof(xmlXPathParserContext));
/* Allocate the value stack */
- ret->valueTab = (xmlXPathObjectPtr *)
+ ret->valueTab = (xmlXPathObjectPtr *)
xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
if (ret->valueTab == NULL) {
xmlFree(ret);
@@ -6289,7 +6289,7 @@ xmlXPathNodeValHash(xmlNodePtr node) {
tmp = tmp->next;
continue;
}
-
+
do {
tmp = tmp->parent;
if (tmp == NULL)
@@ -6448,7 +6448,7 @@ xmlXPathCompareNodeSetString(xmlXPathParserContextPtr ctxt, int inf, int strict,
* If both objects to be compared are node-sets, then the comparison
* will be true if and only if there is a node in the first node-set
* and a node in the second node-set such that the result of performing
- * the comparison on the string-values of the two nodes is true.
+ * the comparison on the string-values of the two nodes is true.
* ....
* When neither object to be compared is a node-set and the operator
* is <=, <, >= or >, then the objects are compared by converting both
@@ -6462,7 +6462,7 @@ xmlXPathCompareNodeSetString(xmlXPathParserContextPtr ctxt, int inf, int strict,
* represented by the string; any other string is converted to NaN
*
* Conclusion all nodes need to be converted first to their string value
- * and then the comparison must be done when possible
+ * and then the comparison must be done when possible
*/
static int
xmlXPathCompareNodeSets(int inf, int strict,
@@ -6517,7 +6517,7 @@ xmlXPathCompareNodeSets(int inf, int strict,
}
if (xmlXPathIsNaN(values2[j]))
continue;
- if (inf && strict)
+ if (inf && strict)
ret = (val1 < values2[j]);
else if (inf && !strict)
ret = (val1 <= values2[j]);
@@ -6857,7 +6857,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt,
case XPATH_STRING:
if ((arg2->stringval == NULL) ||
(arg2->stringval[0] == 0)) ret = 0;
- else
+ else
ret = 1;
ret = (arg1->boolval == ret);
break;
@@ -6892,7 +6892,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt,
case XPATH_NUMBER:
/* Hand check NaN and Infinity equalities */
if (xmlXPathIsNaN(arg1->floatval) ||
- xmlXPathIsNaN(arg2->floatval)) {
+ xmlXPathIsNaN(arg2->floatval)) {
ret = 0;
} else if (xmlXPathIsInf(arg1->floatval) == 1) {
if (xmlXPathIsInf(arg2->floatval) == 1)
@@ -6940,7 +6940,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt,
case XPATH_BOOLEAN:
if ((arg1->stringval == NULL) ||
(arg1->stringval[0] == 0)) ret = 0;
- else
+ else
ret = 1;
ret = (arg2->boolval == ret);
break;
@@ -6953,7 +6953,7 @@ xmlXPathEqualValuesCommon(xmlXPathParserContextPtr ctxt,
arg1 = valuePop(ctxt);
/* Hand check NaN and Infinity equalities */
if (xmlXPathIsNaN(arg1->floatval) ||
- xmlXPathIsNaN(arg2->floatval)) {
+ xmlXPathIsNaN(arg2->floatval)) {
ret = 0;
} else if (xmlXPathIsInf(arg1->floatval) == 1) {
if (xmlXPathIsInf(arg2->floatval) == 1)
@@ -7019,7 +7019,7 @@ xmlXPathEqualValues(xmlXPathParserContextPtr ctxt) {
int ret = 0;
if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
- arg2 = valuePop(ctxt);
+ arg2 = valuePop(ctxt);
arg1 = valuePop(ctxt);
if ((arg1 == NULL) || (arg2 == NULL)) {
if (arg1 != NULL)
@@ -7065,7 +7065,7 @@ xmlXPathEqualValues(xmlXPathParserContextPtr ctxt) {
case XPATH_BOOLEAN:
if ((arg1->nodesetval == NULL) ||
(arg1->nodesetval->nodeNr == 0)) ret = 0;
- else
+ else
ret = 1;
ret = (ret == arg2->boolval);
break;
@@ -7104,7 +7104,7 @@ xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt) {
int ret = 0;
if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
- arg2 = valuePop(ctxt);
+ arg2 = valuePop(ctxt);
arg1 = valuePop(ctxt);
if ((arg1 == NULL) || (arg2 == NULL)) {
if (arg1 != NULL)
@@ -7150,7 +7150,7 @@ xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt) {
case XPATH_BOOLEAN:
if ((arg1->nodesetval == NULL) ||
(arg1->nodesetval->nodeNr == 0)) ret = 0;
- else
+ else
ret = 1;
ret = (ret != arg2->boolval);
break;
@@ -7181,7 +7181,7 @@ xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt) {
* @inf: less than (1) or greater than (0)
* @strict: is the comparison strict
*
- * Implement the compare operation on XPath objects:
+ * Implement the compare operation on XPath objects:
* @arg1 < @arg2 (1, 1, ...
* @arg1 <= @arg2 (1, 0, ...
* @arg1 > @arg2 (0, 1, ...
@@ -7205,7 +7205,7 @@ xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict) {
xmlXPathObjectPtr arg1, arg2;
if ((ctxt == NULL) || (ctxt->context == NULL)) return(0);
- arg2 = valuePop(ctxt);
+ arg2 = valuePop(ctxt);
arg1 = valuePop(ctxt);
if ((arg1 == NULL) || (arg2 == NULL)) {
if (arg1 != NULL)
@@ -7446,7 +7446,7 @@ xmlXPathDivValues(xmlXPathParserContextPtr ctxt) {
ctxt->value->floatval = xmlXPathPINF;
else if (ctxt->value->floatval < 0)
ctxt->value->floatval = xmlXPathNINF;
- } else
+ } else
ctxt->value->floatval /= val;
}
@@ -7681,10 +7681,10 @@ xmlXPathNextDescendantOrSelfElemParent(xmlNodePtr cur,
#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
#endif
- case XML_HTML_DOCUMENT_NODE:
+ case XML_HTML_DOCUMENT_NODE:
return(contextNode);
default:
- return(NULL);
+ return(NULL);
}
return(NULL);
} else {
@@ -7695,7 +7695,7 @@ xmlXPathNextDescendantOrSelfElemParent(xmlNodePtr cur,
case XML_ELEMENT_NODE:
/* TODO: OK to have XInclude here? */
case XML_XINCLUDE_START:
- case XML_DOCUMENT_FRAG_NODE:
+ case XML_DOCUMENT_FRAG_NODE:
if (cur != start)
return(cur);
if (cur->children != NULL) {
@@ -7714,13 +7714,13 @@ xmlXPathNextDescendantOrSelfElemParent(xmlNodePtr cur,
return(xmlDocGetRootElement((xmlDocPtr) cur));
default:
break;
- }
-
+ }
+
next_sibling:
if ((cur == NULL) || (cur == contextNode))
- return(NULL);
+ return(NULL);
if (cur->next != NULL) {
- cur = cur->next;
+ cur = cur->next;
} else {
cur = cur->parent;
goto next_sibling;
@@ -7728,7 +7728,7 @@ next_sibling:
}
}
return(NULL);
-}
+}
/**
* xmlXPathNextDescendant:
@@ -7760,7 +7760,7 @@ xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
/*
* Do not descend on entities declarations
*/
- if (cur->children->type != XML_ENTITY_DECL) {
+ if (cur->children->type != XML_ENTITY_DECL) {
cur = cur->children;
/*
* Skip DTDs
@@ -7778,7 +7778,7 @@ xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
(cur->type != XML_DTD_NODE))
return(cur);
}
-
+
do {
cur = cur->parent;
if (cur == NULL) break;
@@ -7877,7 +7877,7 @@ xmlXPathNextParent(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
return(NULL);
case XML_NAMESPACE_DECL: {
xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
-
+
if ((ns->next != NULL) &&
(ns->next->type != XML_NAMESPACE_DECL))
return((xmlNodePtr) ns->next);
@@ -7950,7 +7950,7 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
return(NULL);
case XML_NAMESPACE_DECL: {
xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
-
+
if ((ns->next != NULL) &&
(ns->next->type != XML_NAMESPACE_DECL))
return((xmlNodePtr) ns->next);
@@ -7994,7 +7994,7 @@ xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
}
case XML_NAMESPACE_DECL: {
xmlNsPtr ns = (xmlNsPtr) ctxt->context->node;
-
+
if ((ns->next != NULL) &&
(ns->next->type != XML_NAMESPACE_DECL))
return((xmlNodePtr) ns->next);
@@ -8191,7 +8191,7 @@ xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt, xmlNodePtr cur)
* node that are before the context node in document order, excluding any
* ancestors and excluding attribute nodes and namespace nodes; the nodes are
* ordered in reverse document order
- * This is a faster implementation but internal only since it requires a
+ * This is a faster implementation but internal only since it requires a
* state kept in the parser context: ctxt->ancestor.
*
* Returns the next element following that axis
@@ -8248,7 +8248,7 @@ xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt, xmlNodePtr cur) {
if (ctxt->context->tmpNsList == NULL && cur != (xmlNodePtr) xmlXPathXMLNamespace) {
if (ctxt->context->tmpNsList != NULL)
xmlFree(ctxt->context->tmpNsList);
- ctxt->context->tmpNsList =
+ ctxt->context->tmpNsList =
xmlGetNsList(ctxt->context->doc, ctxt->context->node);
ctxt->context->tmpNsNr = 0;
if (ctxt->context->tmpNsList != NULL) {
@@ -8396,7 +8396,7 @@ xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlXPathObjectPtr cur;
CHECK_ARITY(1);
- if ((ctxt->value == NULL) ||
+ if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_NODESET) &&
(ctxt->value->type != XPATH_XSLT_TREE)))
XP_ERROR(XPATH_INVALID_TYPE);
@@ -8541,7 +8541,7 @@ xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs) {
}
obj = xmlXPathCacheConvertString(ctxt->context, obj);
ret = xmlXPathGetElementsByIds(ctxt->context->doc, obj->stringval);
- valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt->context, ret));
+ valuePush(ctxt, xmlXPathCacheWrapNodeSet(ctxt->context, ret));
xmlXPathReleaseObject(ctxt->context, obj);
return;
}
@@ -8572,7 +8572,7 @@ xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs) {
}
CHECK_ARITY(1);
- if ((ctxt->value == NULL) ||
+ if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_NODESET) &&
(ctxt->value->type != XPATH_XSLT_TREE)))
XP_ERROR(XPATH_INVALID_TYPE);
@@ -8630,7 +8630,7 @@ xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs) {
nargs = 1;
}
CHECK_ARITY(1);
- if ((ctxt->value == NULL) ||
+ if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_NODESET) &&
(ctxt->value->type != XPATH_XSLT_TREE)))
XP_ERROR(XPATH_INVALID_TYPE);
@@ -8714,7 +8714,7 @@ xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs)
cur->nodesetval->nodeTab[i]->name));
} else {
xmlChar *fullname;
-
+
fullname = xmlBuildQName(cur->nodesetval->nodeTab[i]->name,
cur->nodesetval->nodeTab[i]->ns->prefix,
NULL, 0);
@@ -8749,11 +8749,11 @@ xmlXPathNameFunction(xmlXPathParserContextPtr ctxt, int nargs)
* the node in the node-set that is first in document order.
* If the node-set is empty, an empty string is returned.
* - A number is converted to a string as follows
- * + NaN is converted to the string NaN
- * + positive zero is converted to the string 0
- * + negative zero is converted to the string 0
- * + positive infinity is converted to the string Infinity
- * + negative infinity is converted to the string -Infinity
+ * + NaN is converted to the string NaN
+ * + positive zero is converted to the string 0
+ * + negative zero is converted to the string 0
+ * + positive infinity is converted to the string Infinity
+ * + negative infinity is converted to the string -Infinity
* + if the number is an integer, the number is represented in
* decimal form as a Number with no decimal point and no leading
* zeros, preceded by a minus sign (-) if the number is negative
@@ -8827,7 +8827,7 @@ xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs) {
CHECK_TYPE(XPATH_STRING);
cur = valuePop(ctxt);
valuePush(ctxt, xmlXPathCacheNewFloat(ctxt->context,
- xmlUTF8Strlen(cur->stringval)));
+ xmlUTF8Strlen(cur->stringval)));
xmlXPathReleaseObject(ctxt->context, cur);
}
@@ -8966,12 +8966,12 @@ xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs) {
* or equal to the second argument and, if the third argument is specified,
* less than the sum of the second and third arguments; the comparisons
* and addition used for the above follow the standard IEEE 754 rules. Thus:
- * - substring("12345", 1.5, 2.6) returns "234"
- * - substring("12345", 0, 3) returns "12"
- * - substring("12345", 0 div 0, 3) returns ""
- * - substring("12345", 1, 0 div 0) returns ""
- * - substring("12345", -42, 1 div 0) returns "12345"
- * - substring("12345", -1 div 0, 1 div 0) returns ""
+ * - substring("12345", 1.5, 2.6) returns "234"
+ * - substring("12345", 0, 3) returns "12"
+ * - substring("12345", 0 div 0, 3) returns ""
+ * - substring("12345", 1, 0 div 0) returns ""
+ * - substring("12345", -42, 1 div 0) returns "12345"
+ * - substring("12345", -1 div 0, 1 div 0) returns ""
*/
void
xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs) {
@@ -9012,18 +9012,18 @@ xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs) {
*/
if (nargs != 3) {
le = (double)m;
- if (in < 1.0)
+ if (in < 1.0)
in = 1.0;
}
- /* Need to check for the special cases where either
+ /* Need to check for the special cases where either
* the index is NaN, the length is NaN, or both
* arguments are infinity (relying on Inf + -Inf = NaN)
*/
if (!xmlXPathIsNaN(in + le) && !xmlXPathIsInf(in)) {
/*
* To meet the requirements of the spec, the arguments
- * must be converted to integer format before
+ * must be converted to integer format before
* initial index calculations are done
*
* First we go to integer form, rounding up
@@ -9089,13 +9089,13 @@ xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlBufferPtr target;
const xmlChar *point;
int offset;
-
+
CHECK_ARITY(2);
CAST_TO_STRING;
find = valuePop(ctxt);
CAST_TO_STRING;
str = valuePop(ctxt);
-
+
target = xmlBufferCreate();
if (target) {
point = xmlStrstr(str->stringval, find->stringval);
@@ -9132,13 +9132,13 @@ xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlBufferPtr target;
const xmlChar *point;
int offset;
-
+
CHECK_ARITY(2);
CAST_TO_STRING;
find = valuePop(ctxt);
CAST_TO_STRING;
str = valuePop(ctxt);
-
+
target = xmlBufferCreate();
if (target) {
point = xmlStrstr(str->stringval, find->stringval);
@@ -9148,7 +9148,7 @@ xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlStrlen(str->stringval) - offset);
}
valuePush(ctxt, xmlXPathCacheNewString(ctxt->context,
- xmlBufferContent(target)));
+ xmlBufferContent(target)));
xmlBufferFree(target);
}
xmlXPathReleaseObject(ctxt->context, str);
@@ -9175,7 +9175,7 @@ xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlChar *source = NULL;
xmlBufferPtr target;
xmlChar blank;
-
+
if (ctxt == NULL) return;
if (nargs == 0) {
/* Use current context node */
@@ -9193,11 +9193,11 @@ xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
target = xmlBufferCreate();
if (target && source) {
-
+
/* Skip leading whitespaces */
while (IS_BLANK_CH(*source))
source++;
-
+
/* Collapse intermediate whitespaces, and skip trailing whitespaces */
blank = 0;
while (*source) {
@@ -9472,7 +9472,7 @@ xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs) {
double res = 0.0;
CHECK_ARITY(1);
- if ((ctxt->value == NULL) ||
+ if ((ctxt->value == NULL) ||
((ctxt->value->type != XPATH_NODESET) &&
(ctxt->value->type != XPATH_XSLT_TREE)))
XP_ERROR(XPATH_INVALID_TYPE);
@@ -9591,14 +9591,14 @@ xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs) {
if (ctxt->value->floatval < 0) {
if (ctxt->value->floatval < f - 0.5)
ctxt->value->floatval = f - 1;
- else
+ else
ctxt->value->floatval = f;
if (ctxt->value->floatval == 0)
ctxt->value->floatval = xmlXPathNZERO;
} else {
if (ctxt->value->floatval < f + 0.5)
ctxt->value->floatval = f;
- else
+ else
ctxt->value->floatval = f + 1;
}
}
@@ -9649,7 +9649,7 @@ xmlXPathCurrentChar(xmlXPathParserContextPtr ctxt, int *len) {
* 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
+ * 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx
*
* Check for the 0x110000 limit too
*/
@@ -9686,7 +9686,7 @@ xmlXPathCurrentChar(xmlXPathParserContextPtr ctxt, int *len) {
}
if (!IS_CHAR(val)) {
XP_ERROR0(XPATH_INVALID_CHAR_ERROR);
- }
+ }
return(val);
} else {
/* 1-byte code */
@@ -9758,7 +9758,7 @@ xmlXPathParseNCName(xmlXPathParserContextPtr ctxt) {
/**
* xmlXPathParseQName:
* @ctxt: the XPath Parser context
- * @prefix: a xmlChar **
+ * @prefix: a xmlChar **
*
* parse an XML qualified name
*
@@ -9852,7 +9852,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) {
while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
((IS_LETTER(c)) || (IS_DIGIT(c)) ||
(c == '.') || (c == '-') ||
- (c == '_') || ((qualified) && (c == ':')) ||
+ (c == '_') || ((qualified) && (c == ':')) ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c)))) {
COPY_BUF(l,buf,len,c);
@@ -9865,7 +9865,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) {
*/
xmlChar *buffer;
int max = len * 2;
-
+
buffer = (xmlChar *) xmlMallocAtomic(max * sizeof(xmlChar));
if (buffer == NULL) {
XP_ERRORNULL(XPATH_MEMORY_ERROR);
@@ -9873,7 +9873,7 @@ xmlXPathParseNameComplex(xmlXPathParserContextPtr ctxt, int qualified) {
memcpy(buffer, buf, len);
while ((IS_LETTER(c)) || (IS_DIGIT(c)) || /* test bigname.xml */
(c == '.') || (c == '-') ||
- (c == '_') || ((qualified) && (c == ':')) ||
+ (c == '_') || ((qualified) && (c == ':')) ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c))) {
if (len + 10 > max) {
@@ -9920,7 +9920,7 @@ static double my_pow10[MAX_FRAC+1] = {
* [30a] Float ::= Number ('e' Digits?)?
*
* [30] Number ::= Digits ('.' Digits?)?
- * | '.' Digits
+ * | '.' Digits
* [31] Digits ::= [0-9]+
*
* Compile a Number in the string
@@ -10019,7 +10019,7 @@ xmlXPathStringEvalNumber(const xmlChar *str) {
* @ctxt: the XPath Parser context
*
* [30] Number ::= Digits ('.' Digits?)?
- * | '.' Digits
+ * | '.' Digits
* [31] Digits ::= [0-9]+
*
* Compile a Number, then push it on the stack
@@ -10199,9 +10199,9 @@ xmlXPathCompLiteral(xmlXPathParserContextPtr ctxt) {
*
* Early evaluation is possible since:
* The variable bindings [...] used to evaluate a subexpression are
- * always the same as those used to evaluate the containing expression.
+ * always the same as those used to evaluate the containing expression.
*
- * [36] VariableReference ::= '$' QName
+ * [36] VariableReference ::= '$' QName
*/
static void
xmlXPathCompVariableReference(xmlXPathParserContextPtr ctxt) {
@@ -10260,7 +10260,7 @@ xmlXPathIsNodeType(const xmlChar *name) {
* @ctxt: the XPath Parser context
*
* [16] FunctionCall ::= FunctionName '(' ( Argument ( ',' Argument)*)? ')'
- * [17] Argument ::= Expr
+ * [17] Argument ::= Expr
*
* Compile a function call, the evaluation of all arguments are
* pushed on the stack
@@ -10327,11 +10327,11 @@ xmlXPathCompFunctionCall(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompPrimaryExpr:
* @ctxt: the XPath Parser context
*
- * [15] PrimaryExpr ::= VariableReference
+ * [15] PrimaryExpr ::= VariableReference
* | '(' Expr ')'
- * | Literal
- * | Number
- * | FunctionCall
+ * | Literal
+ * | Number
+ * | FunctionCall
*
* Compile a primary expression.
*/
@@ -10363,8 +10363,8 @@ xmlXPathCompPrimaryExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompFilterExpr:
* @ctxt: the XPath Parser context
*
- * [20] FilterExpr ::= PrimaryExpr
- * | FilterExpr Predicate
+ * [20] FilterExpr ::= PrimaryExpr
+ * | FilterExpr Predicate
*
* Compile a filter expression.
* Square brackets are used to filter expressions in the same way that
@@ -10379,13 +10379,13 @@ xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
xmlXPathCompPrimaryExpr(ctxt);
CHECK_ERROR;
SKIP_BLANKS;
-
+
while (CUR == '[') {
xmlXPathCompPredicate(ctxt, 1);
SKIP_BLANKS;
}
-
+
}
/**
@@ -10424,7 +10424,7 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
((IS_LETTER(c)) || (IS_DIGIT(c)) ||
(c == '.') || (c == '-') ||
- (c == '_') || (c == ':') ||
+ (c == '_') || (c == ':') ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c)))) {
len += l;
@@ -10440,10 +10440,10 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompPathExpr:
* @ctxt: the XPath Parser context
*
- * [19] PathExpr ::= LocationPath
- * | FilterExpr
- * | FilterExpr '/' RelativeLocationPath
- * | FilterExpr '//' RelativeLocationPath
+ * [19] PathExpr ::= LocationPath
+ * | FilterExpr
+ * | FilterExpr '/' RelativeLocationPath
+ * | FilterExpr '//' RelativeLocationPath
*
* Compile a path expression.
* The / operator and // operators combine an arbitrary expression
@@ -10460,8 +10460,8 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
xmlChar *name = NULL; /* we may have to preparse a name to find out */
SKIP_BLANKS;
- if ((CUR == '$') || (CUR == '(') ||
- (IS_ASCII_DIGIT(CUR)) ||
+ if ((CUR == '$') || (CUR == '(') ||
+ (IS_ASCII_DIGIT(CUR)) ||
(CUR == '\'') || (CUR == '"') ||
(CUR == '.' && IS_ASCII_DIGIT(NXT(1)))) {
lc = 0;
@@ -10501,7 +10501,7 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
} else if (name != NULL) {
int len =xmlStrlen(name);
-
+
while (NXT(len) != 0) {
if (NXT(len) == '/') {
/* element name */
@@ -10568,7 +10568,7 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
/* make sure all cases are covered explicitly */
XP_ERROR(XPATH_EXPR_ERROR);
}
- }
+ }
if (lc) {
if (CUR == '/') {
@@ -10600,8 +10600,8 @@ xmlXPathCompPathExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompUnionExpr:
* @ctxt: the XPath Parser context
*
- * [18] UnionExpr ::= PathExpr
- * | UnionExpr '|' PathExpr
+ * [18] UnionExpr ::= PathExpr
+ * | UnionExpr '|' PathExpr
*
* Compile an union expression.
*/
@@ -10629,8 +10629,8 @@ xmlXPathCompUnionExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompUnaryExpr:
* @ctxt: the XPath Parser context
*
- * [27] UnaryExpr ::= UnionExpr
- * | '-' UnaryExpr
+ * [27] UnaryExpr ::= UnionExpr
+ * | '-' UnaryExpr
*
* Compile an unary expression.
*/
@@ -10662,10 +10662,10 @@ xmlXPathCompUnaryExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompMultiplicativeExpr:
* @ctxt: the XPath Parser context
*
- * [26] MultiplicativeExpr ::= UnaryExpr
- * | MultiplicativeExpr MultiplyOperator UnaryExpr
- * | MultiplicativeExpr 'div' UnaryExpr
- * | MultiplicativeExpr 'mod' UnaryExpr
+ * [26] MultiplicativeExpr ::= UnaryExpr
+ * | MultiplicativeExpr MultiplyOperator UnaryExpr
+ * | MultiplicativeExpr 'div' UnaryExpr
+ * | MultiplicativeExpr 'mod' UnaryExpr
* [34] MultiplyOperator ::= '*'
*
* Compile an Additive expression.
@@ -10676,7 +10676,7 @@ xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
xmlXPathCompUnaryExpr(ctxt);
CHECK_ERROR;
SKIP_BLANKS;
- while ((CUR == '*') ||
+ while ((CUR == '*') ||
((CUR == 'd') && (NXT(1) == 'i') && (NXT(2) == 'v')) ||
((CUR == 'm') && (NXT(1) == 'o') && (NXT(2) == 'd'))) {
int op = -1;
@@ -10704,9 +10704,9 @@ xmlXPathCompMultiplicativeExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompAdditiveExpr:
* @ctxt: the XPath Parser context
*
- * [25] AdditiveExpr ::= MultiplicativeExpr
- * | AdditiveExpr '+' MultiplicativeExpr
- * | AdditiveExpr '-' MultiplicativeExpr
+ * [25] AdditiveExpr ::= MultiplicativeExpr
+ * | AdditiveExpr '+' MultiplicativeExpr
+ * | AdditiveExpr '-' MultiplicativeExpr
*
* Compile an Additive expression.
*/
@@ -10736,11 +10736,11 @@ xmlXPathCompAdditiveExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompRelationalExpr:
* @ctxt: the XPath Parser context
*
- * [24] RelationalExpr ::= AdditiveExpr
- * | RelationalExpr '<' AdditiveExpr
- * | RelationalExpr '>' AdditiveExpr
- * | RelationalExpr '<=' AdditiveExpr
- * | RelationalExpr '>=' AdditiveExpr
+ * [24] RelationalExpr ::= AdditiveExpr
+ * | RelationalExpr '<' AdditiveExpr
+ * | RelationalExpr '>' AdditiveExpr
+ * | RelationalExpr '<=' AdditiveExpr
+ * | RelationalExpr '>=' AdditiveExpr
*
* A <= B > C is allowed ? Answer from James, yes with
* (AdditiveExpr <= AdditiveExpr) > AdditiveExpr
@@ -10780,9 +10780,9 @@ xmlXPathCompRelationalExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompEqualityExpr:
* @ctxt: the XPath Parser context
*
- * [23] EqualityExpr ::= RelationalExpr
- * | EqualityExpr '=' RelationalExpr
- * | EqualityExpr '!=' RelationalExpr
+ * [23] EqualityExpr ::= RelationalExpr
+ * | EqualityExpr '=' RelationalExpr
+ * | EqualityExpr '!=' RelationalExpr
*
* A != B != C is allowed ? Answer from James, yes with
* (RelationalExpr = RelationalExpr) = RelationalExpr
@@ -10817,8 +10817,8 @@ xmlXPathCompEqualityExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompAndExpr:
* @ctxt: the XPath Parser context
*
- * [22] AndExpr ::= EqualityExpr
- * | AndExpr 'and' EqualityExpr
+ * [22] AndExpr ::= EqualityExpr
+ * | AndExpr 'and' EqualityExpr
*
* Compile an AND expression.
*
@@ -10843,9 +10843,9 @@ xmlXPathCompAndExpr(xmlXPathParserContextPtr ctxt) {
* xmlXPathCompileExpr:
* @ctxt: the XPath Parser context
*
- * [14] Expr ::= OrExpr
- * [21] OrExpr ::= AndExpr
- * | OrExpr 'or' AndExpr
+ * [14] Expr ::= OrExpr
+ * [21] OrExpr ::= AndExpr
+ * | OrExpr 'or' AndExpr
*
* Parse and compile an expression
*/
@@ -10881,7 +10881,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
* @filter: act as a filter
*
* [8] Predicate ::= '[' PredicateExpr ']'
- * [9] PredicateExpr ::= Expr
+ * [9] PredicateExpr ::= Expr
*
* Compile a predicate expression
*/
@@ -10998,7 +10998,7 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
}
*test = NODE_TEST_TYPE;
-
+
SKIP_BLANKS;
if (*type == NODE_TYPE_PI) {
/*
@@ -11134,7 +11134,7 @@ xmlXPathIsAxisName(const xmlChar *name) {
* @ctxt: the XPath Parser context
*
* [4] Step ::= AxisSpecifier NodeTest Predicate*
- * | AbbreviatedStep
+ * | AbbreviatedStep
*
* [12] AbbreviatedStep ::= '.' | '..'
*
@@ -11306,10 +11306,10 @@ eval_predicates:
* xmlXPathCompRelativeLocationPath:
* @ctxt: the XPath Parser context
*
- * [3] RelativeLocationPath ::= Step
- * | RelativeLocationPath '/' Step
- * | AbbreviatedRelativeLocationPath
- * [11] AbbreviatedRelativeLocationPath ::= RelativeLocationPath '//' Step
+ * [3] RelativeLocationPath ::= Step
+ * | RelativeLocationPath '/' Step
+ * | AbbreviatedRelativeLocationPath
+ * [11] AbbreviatedRelativeLocationPath ::= RelativeLocationPath '//' Step
*
* Compile a relative location path.
*/
@@ -11348,12 +11348,12 @@ xmlXPathCompRelativeLocationPath
* xmlXPathCompLocationPath:
* @ctxt: the XPath Parser context
*
- * [1] LocationPath ::= RelativeLocationPath
- * | AbsoluteLocationPath
+ * [1] LocationPath ::= RelativeLocationPath
+ * | AbsoluteLocationPath
* [2] AbsoluteLocationPath ::= '/' RelativeLocationPath?
- * | AbbreviatedAbsoluteLocationPath
- * [10] AbbreviatedAbsoluteLocationPath ::=
- * '//' RelativeLocationPath
+ * | AbbreviatedAbsoluteLocationPath
+ * [10] AbbreviatedAbsoluteLocationPath ::=
+ * '//' RelativeLocationPath
*
* Compile a location path
*
@@ -11392,7 +11392,7 @@ xmlXPathCompLocationPath(xmlXPathParserContextPtr ctxt) {
/************************************************************************
* *
- * XPath precompiled expression evaluation *
+ * XPath precompiled expression evaluation *
* *
************************************************************************/
@@ -11509,7 +11509,7 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
CHECK_ERROR0;
if (contextSize <= 0)
return(0);
- }
+ }
if (op->ch2 != -1) {
xmlXPathContextPtr xpctxt = ctxt->context;
xmlNodePtr contextNode, oldContextNode;
@@ -11553,7 +11553,7 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
/*
* Get the expression of this predicate.
*/
- exprOp = &ctxt->comp->steps[op->ch2];
+ exprOp = &ctxt->comp->steps[op->ch2];
newContextSize = 0;
for (i = 0; i < set->nodeNr; i++) {
if (set->nodeTab[i] == NULL)
@@ -11563,8 +11563,8 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
xpctxt->node = contextNode;
xpctxt->contextSize = contextSize;
xpctxt->proximityPosition = ++contextPos;
-
- /*
+
+ /*
* Also set the xpath document in case things like
* key() are evaluated in the predicate.
*/
@@ -11623,7 +11623,7 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
if (ctxt->value == contextObj)
valuePop(ctxt);
xmlXPathReleaseObject(xpctxt, contextObj);
- }
+ }
evaluation_exit:
if (exprRes != NULL)
xmlXPathReleaseObject(ctxt->context, exprRes);
@@ -11707,7 +11707,7 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
xpctxt->node = contextNode;
xpctxt->contextSize = contextSize;
xpctxt->proximityPosition = ++contextPos;
-
+
/*
* Initialize the new set.
* Also set the xpath document in case things like
@@ -11729,7 +11729,7 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
valuePush(ctxt, contextObj);
res = xmlXPathCompOpEvalToBoolean(ctxt, exprOp, 1);
-
+
if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
xmlXPathObjectPtr tmp;
/* pop the result */
@@ -11761,9 +11761,9 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserContextPtr ctxt,
}
xmlXPathNodeSetClear(set, hasNsNodes);
set->nodeNr = 1;
- set->nodeTab[0] = contextNode;
+ set->nodeTab[0] = contextNode;
goto evaluation_exit;
- }
+ }
if (pos == maxPos) {
/*
* We are done.
@@ -11827,7 +11827,7 @@ evaluation_exit:
static int
xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt,
- xmlXPathStepOpPtr op,
+ xmlXPathStepOpPtr op,
int *maxPos)
{
@@ -11836,7 +11836,7 @@ xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt,
/*
* BIG NOTE: This is not intended for XPATH_OP_FILTER yet!
*/
-
+
/*
* If not -1, then ch1 will point to:
* 1) For predicates (XPATH_OP_PREDICATE):
@@ -11845,13 +11845,13 @@ xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt,
* - an inner filter operater OR
* - an expression selecting the node set.
* E.g. "key('a', 'b')" or "(//foo | //bar)".
- */
+ */
if ((op->op != XPATH_OP_PREDICATE) && (op->op != XPATH_OP_FILTER))
return(0);
if (op->ch2 != -1) {
exprOp = &ctxt->comp->steps[op->ch2];
- } else
+ } else
return(0);
if ((exprOp != NULL) &&
@@ -11870,10 +11870,10 @@ xmlXPathIsPositionalPredicate(xmlXPathParserContextPtr ctxt,
* Maybe we could rewrite the AST to ease the optimization.
*/
*maxPos = (int) ((xmlXPathObjectPtr) exprOp->value4)->floatval;
-
+
if (((xmlXPathObjectPtr) exprOp->value4)->floatval ==
(float) *maxPos)
- {
+ {
return(1);
}
}
@@ -11934,7 +11934,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
* Used to feed predicate evaluation.
*/
xmlNodeSetPtr seq;
- xmlNodePtr cur;
+ xmlNodePtr cur;
/* First predicate operator */
xmlXPathStepOpPtr predOp;
int maxPos; /* The requested position() (when a "[n]" predicate) */
@@ -11946,7 +11946,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
xmlXPathTraversalFunctionExt outerNext = NULL;
void (*addNode) (xmlNodeSetPtr, xmlNodePtr);
xmlXPathNodeSetMergeFunction mergeAndClear;
- xmlNodePtr oldContextNode;
+ xmlNodePtr oldContextNode;
xmlXPathContextPtr xpctxt = ctxt->context;
@@ -11961,7 +11961,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
xmlXPathReleaseObject(xpctxt, obj);
XP_ERROR0(XPATH_UNDEF_PREFIX_ERROR);
}
- }
+ }
/*
* Setup axis.
*
@@ -11999,8 +11999,8 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
* This iterator will give us only nodes which can
* hold element nodes.
*/
- outerNext = xmlXPathNextDescendantOrSelfElemParent;
- }
+ outerNext = xmlXPathNextDescendantOrSelfElemParent;
+ }
if (((test == NODE_TEST_NAME) || (test == NODE_TEST_ALL)) &&
(type == NODE_TYPE_NODE))
{
@@ -12060,15 +12060,15 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
#endif
if (next == NULL) {
- xmlXPathReleaseObject(xpctxt, obj);
+ xmlXPathReleaseObject(xpctxt, obj);
return(0);
- }
+ }
contextSeq = obj->nodesetval;
if ((contextSeq == NULL) || (contextSeq->nodeNr <= 0)) {
xmlXPathReleaseObject(xpctxt, obj);
valuePush(ctxt, xmlXPathCacheWrapNodeSet(xpctxt, NULL));
return(0);
- }
+ }
/*
* Predicate optimization ---------------------------------------------
* If this step has a last predicate, which contains a position(),
@@ -12076,7 +12076,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
* the short-hand form, i.e., "[n]".
*
* Example - expression "/foo[parent::bar][1]":
- *
+ *
* COLLECT 'child' 'name' 'node' foo -- op (we are here)
* ROOT -- op->ch1
* PREDICATE -- op->ch2 (predOp)
@@ -12109,7 +12109,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
*/
predOp = NULL;
hasAxisRange = 1;
- }
+ }
}
}
breakOnFirstHit = ((toBool) && (predOp == NULL)) ? 1 : 0;
@@ -12118,7 +12118,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
*/
/*
* 2.3 Node Tests
- * - For the attribute axis, the principal node type is attribute.
+ * - For the attribute axis, the principal node type is attribute.
* - For the namespace axis, the principal node type is namespace.
* - For other axes, the principal node type is element.
*
@@ -12155,8 +12155,8 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
*/
xpctxt->node = contextNode;
} else
- xpctxt->node = contextSeq->nodeTab[contextIdx++];
-
+ xpctxt->node = contextSeq->nodeTab[contextIdx++];
+
if (seq == NULL) {
seq = xmlXPathNodeSetCreate(NULL);
if (seq == NULL) {
@@ -12210,7 +12210,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
#ifdef DEBUG_STEP
xmlGenericError(xmlGenericErrorContext, " %s", cur->name);
#endif
-
+
switch (test) {
case NODE_TEST_NONE:
total = 0;
@@ -12229,7 +12229,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
#ifdef LIBXML_DOCB_ENABLED
case XML_DOCB_DOCUMENT_NODE:
#endif
- case XML_ELEMENT_NODE:
+ case XML_ELEMENT_NODE:
case XML_ATTRIBUTE_NODE:
case XML_PI_NODE:
case XML_COMMENT_NODE:
@@ -12357,7 +12357,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
goto apply_predicates;
-axis_range_end: /* ----------------------------------------------------- */
+axis_range_end: /* ----------------------------------------------------- */
/*
* We have a "/foo[n]", and position() = n was reached.
* Note that we can have as well "/foo/::parent::foo[1]", so
@@ -12396,11 +12396,11 @@ first_hit: /* ---------------------------------------------------------- */
apply_predicates: /* --------------------------------------------------- */
/*
* Apply predicates.
- */
+ */
if ((predOp != NULL) && (seq->nodeNr > 0)) {
/*
* E.g. when we have a "/foo[some expression][n]".
- */
+ */
/*
* QUESTION TODO: The old predicate evaluation took into
* account location-sets.
@@ -12409,7 +12409,7 @@ apply_predicates: /* --------------------------------------------------- */
* All what I learned now from the evaluation semantics
* does not indicate that a location-set will be processed
* here, so this looks OK.
- */
+ */
/*
* Iterate over all predicates, starting with the outermost
* predicate.
@@ -12425,7 +12425,7 @@ apply_predicates: /* --------------------------------------------------- */
*
* For the moment, I'll try to solve this with a recursive
* function: xmlXPathCompOpEvalPredicate().
- */
+ */
size = seq->nodeNr;
if (hasPredicateRange != 0)
newSize = xmlXPathCompOpEvalPositionalPredicate(ctxt,
@@ -12480,7 +12480,7 @@ apply_predicates: /* --------------------------------------------------- */
} else {
outSeq = mergeAndClear(outSeq, seq, 0);
}
- }
+ }
}
error:
@@ -12509,7 +12509,7 @@ error:
}
if ((seq != NULL) && (seq != outSeq)) {
xmlXPathFreeNodeSet(seq);
- }
+ }
/*
* Hand over the result. Better to push the set also in
* case of errors.
@@ -12793,9 +12793,9 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
xmlXPathStepOpPtr op, xmlNodePtr * first)
{
int total = 0;
- xmlXPathCompExprPtr comp;
+ xmlXPathCompExprPtr comp;
xmlXPathObjectPtr res;
- xmlXPathObjectPtr obj;
+ xmlXPathObjectPtr obj;
xmlNodeSetPtr oldset;
xmlNodePtr oldnode;
xmlDocPtr oldDoc;
@@ -12810,7 +12810,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
(comp->steps[op->ch1].op == XPATH_OP_SORT) &&
(comp->steps[op->ch2].op == XPATH_OP_SORT)) {
int f = comp->steps[op->ch2].ch1;
-
+
if ((f != -1) &&
(comp->steps[f].op == XPATH_OP_FUNCTION) &&
(comp->steps[f].value5 == NULL) &&
@@ -12819,7 +12819,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
(xmlStrEqual
(comp->steps[f].value4, BAD_CAST "last"))) {
xmlNodePtr last = NULL;
-
+
total +=
xmlXPathCompOpEvalLast(ctxt,
&comp->steps[op->ch1],
@@ -12846,7 +12846,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
return (total);
}
}
-
+
if (op->ch1 != -1)
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]);
CHECK_ERROR0;
@@ -12854,7 +12854,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
return (total);
if (ctxt->value == NULL)
return (total);
-
+
#ifdef LIBXML_XPTR_ENABLED
oldnode = ctxt->context->node;
/*
@@ -12864,7 +12864,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
xmlXPathObjectPtr tmp = NULL;
xmlLocationSetPtr newlocset = NULL;
xmlLocationSetPtr oldlocset;
-
+
/*
* Extract the old locset, and then evaluate the result of the
* expression for all the element in the locset. use it to grow
@@ -12874,7 +12874,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
obj = valuePop(ctxt);
oldlocset = obj->user;
ctxt->context->node = NULL;
-
+
if ((oldlocset == NULL) || (oldlocset->locNr == 0)) {
ctxt->context->contextSize = 0;
ctxt->context->proximityPosition = 0;
@@ -12889,7 +12889,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
return (total);
}
newlocset = xmlXPtrLocationSetCreate(NULL);
-
+
for (i = 0; i < oldlocset->locNr; i++) {
/*
* Run the evaluation with a node list made of a
@@ -12904,7 +12904,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
} else {
xmlXPathNodeSetAddUnique(tmp->nodesetval,
ctxt->context->node);
- }
+ }
valuePush(ctxt, tmp);
if (op->ch2 != -1)
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
@@ -12930,14 +12930,14 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
}
if (ctxt->value == tmp) {
valuePop(ctxt);
- xmlXPathNodeSetClear(tmp->nodesetval, 1);
+ xmlXPathNodeSetClear(tmp->nodesetval, 1);
/*
* REVISIT TODO: Don't create a temporary nodeset
* for everly iteration.
*/
/* OLD: xmlXPathFreeObject(res); */
} else
- tmp = NULL;
+ tmp = NULL;
ctxt->context->node = NULL;
/*
* Only put the first node in the result, then leave.
@@ -12962,7 +12962,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
return (total);
}
#endif /* LIBXML_XPTR_ENABLED */
-
+
/*
* Extract the old set, and then evaluate the result of the
* expression for all the element in the set. use it to grow
@@ -12971,11 +12971,11 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
CHECK_TYPE0(XPATH_NODESET);
obj = valuePop(ctxt);
oldset = obj->nodesetval;
-
+
oldnode = ctxt->context->node;
oldDoc = ctxt->context->doc;
ctxt->context->node = NULL;
-
+
if ((oldset == NULL) || (oldset->nodeNr == 0)) {
ctxt->context->contextSize = 0;
ctxt->context->proximityPosition = 0;
@@ -12999,10 +12999,10 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
* Initialize the new set.
* Also set the xpath document in case things like
* key() evaluation are attempted on the predicate
- */
+ */
newset = xmlXPathNodeSetCreate(NULL);
/* XXX what if xmlXPathNodeSetCreate returned NULL? */
-
+
for (i = 0; i < oldset->nodeNr; i++) {
/*
* Run the evaluation with a node list made of
@@ -13028,7 +13028,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
xmlXPathFreeNodeSet(newset);
xmlXPathFreeObject(obj);
return(0);
- }
+ }
/*
* The result of the evaluation needs to be tested to
* decide whether the filter succeeded or not
@@ -13036,7 +13036,7 @@ xmlXPathCompOpEvalFilterFirst(xmlXPathParserContextPtr ctxt,
res = valuePop(ctxt);
if (xmlXPathEvaluatePredicateResult(ctxt, res)) {
xmlXPathNodeSetAdd(newset, oldset->nodeTab[i]);
- }
+ }
/*
* Cleanup
*/
@@ -13172,7 +13172,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
total += xmlXPathCompOpEval(ctxt, &comp->steps[op->ch2]);
CHECK_ERROR0;
if (op->value)
- equal = xmlXPathEqualValues(ctxt);
+ equal = xmlXPathEqualValues(ctxt);
else
equal = xmlXPathNotEqualValues(ctxt);
valuePush(ctxt, xmlXPathCacheNewBoolean(ctxt->context, equal));
@@ -13581,7 +13581,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
tmp = xmlXPathCacheNewNodeSet(ctxt->context,
ctxt->context->node);
valuePush(ctxt, tmp);
-
+
if (op->ch2 != -1)
total +=
xmlXPathCompOpEval(ctxt,
@@ -13690,7 +13690,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
* nC 2
*
* removed the first node in the node-set, then
- * the context position of the
+ * the context position of the
*/
for (i = 0; i < oldset->nodeNr; i++) {
/*
@@ -13747,7 +13747,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
}
if (ctxt->value == tmp) {
valuePop(ctxt);
- xmlXPathNodeSetClear(tmp->nodesetval, 1);
+ xmlXPathNodeSetClear(tmp->nodesetval, 1);
/*
* Don't free the temporary nodeset
* in order to avoid massive recreation inside this
@@ -13850,7 +13850,7 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
res = valuePop(ctxt);
if (res->type == XPATH_LOCATIONSET) {
- xmlLocationSetPtr rloc =
+ xmlLocationSetPtr rloc =
(xmlLocationSetPtr)res->user;
for (j=0; j<rloc->locNr; j++) {
range = xmlXPtrNewRange(
@@ -14012,7 +14012,7 @@ start:
xmlXPathCompOpEval(ctxt, op);
if (ctxt->error != XPATH_EXPRESSION_OK)
return(-1);
-
+
resObj = valuePop(ctxt);
if (resObj == NULL)
return(-1);
@@ -14033,7 +14033,7 @@ start:
* to true if the number is equal to the context position
* and will be converted to false otherwise;"
*/
- res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
+ res = xmlXPathEvaluatePredicateResult(ctxt, resObj);
} else {
res = xmlXPathCastToBoolean(resObj);
}
@@ -14056,13 +14056,13 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp,
xmlXPathObjectPtr *resultSeq, int toBool)
{
int max_depth, min_depth;
- int from_root;
+ int from_root;
int ret, depth;
int eval_all_nodes;
xmlNodePtr cur = NULL, limit = NULL;
xmlStreamCtxtPtr patstream = NULL;
-
- int nb_nodes = 0;
+
+ int nb_nodes = 0;
if ((ctxt == NULL) || (comp == NULL))
return(-1);
@@ -14088,7 +14088,7 @@ xmlXPathRunStreamEval(xmlXPathContextPtr ctxt, xmlPatternPtr comp,
if (*resultSeq == NULL)
return(-1);
}
-
+
/*
* handle the special cases of "/" amd "." being matched
*/
@@ -14185,7 +14185,7 @@ next_node:
ret = xmlStreamPushNode(patstream, NULL, NULL, cur->type);
else
break;
-
+
if (ret < 0) {
/* NOP. */
} else if (ret == 1) {
@@ -14209,7 +14209,7 @@ next_node:
scan_children:
if ((cur->children != NULL) && (depth < max_depth)) {
/*
- * Do not descend on entities declarations
+ * Do not descend on entities declarations
*/
if (cur->children->type != XML_ENTITY_DECL) {
cur = cur->children;
@@ -14231,7 +14231,7 @@ scan_children:
(cur->type != XML_DTD_NODE))
goto next_node;
}
-
+
do {
cur = cur->parent;
depth--;
@@ -14290,7 +14290,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
if (ctxt->valueTab == NULL) {
/* Allocate the value stack */
- ctxt->valueTab = (xmlXPathObjectPtr *)
+ ctxt->valueTab = (xmlXPathObjectPtr *)
xmlMalloc(10 * sizeof(xmlXPathObjectPtr));
if (ctxt->valueTab == NULL) {
xmlXPathPErrMemory(ctxt, "creating evaluation context\n");
@@ -14313,7 +14313,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
if (res != -1)
return(res);
} else {
- xmlXPathObjectPtr resObj = NULL;
+ xmlXPathObjectPtr resObj = NULL;
/*
* Evaluation to a sequence.
@@ -14326,7 +14326,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
return(0);
}
if (resObj != NULL)
- xmlXPathReleaseObject(ctxt->context, resObj);
+ xmlXPathReleaseObject(ctxt->context, resObj);
}
/*
* QUESTION TODO: This falls back to normal XPath evaluation
@@ -14351,7 +14351,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
/************************************************************************
* *
- * Public interfaces *
+ * Public interfaces *
* *
************************************************************************/
@@ -14367,7 +14367,7 @@ xmlXPathRunEval(xmlXPathParserContextPtr ctxt, int toBool)
* context node in the context node list (as returned by the position
* function) and will be converted to false otherwise; if the result
* is not a number, then the result will be converted as if by a call
- * to the boolean function.
+ * to the boolean function.
*
* Returns 1 if predicate is true, 0 otherwise
*/
@@ -14405,12 +14405,12 @@ xmlXPathEvalPredicate(xmlXPathContextPtr ctxt, xmlXPathObjectPtr res) {
* context node in the context node list (as returned by the position
* function) and will be converted to false otherwise; if the result
* is not a number, then the result will be converted as if by a call
- * to the boolean function.
+ * to the boolean function.
*
* Returns 1 if predicate is true, 0 otherwise
*/
int
-xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt,
+xmlXPathEvaluatePredicateResult(xmlXPathParserContextPtr ctxt,
xmlXPathObjectPtr res) {
if ((ctxt == NULL) || (res == NULL)) return(0);
switch (res->type) {
@@ -14483,7 +14483,7 @@ xmlXPathTryStreamCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
tmp = xmlStrchr(str, ':');
if ((tmp != NULL) &&
((ctxt == NULL) || (ctxt->nsNr == 0) || (tmp[1] == ':')))
- return(NULL);
+ return(NULL);
if (ctxt != NULL) {
dict = ctxt->dict;
@@ -14507,7 +14507,7 @@ xmlXPathTryStreamCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
&namespaces[0]);
if (namespaces != NULL) {
xmlFree((xmlChar **)namespaces);
- }
+ }
if ((stream != NULL) && (xmlPatternStreamable(stream) == 1)) {
comp = xmlXPathNewCompExpr();
if (comp == NULL) {
@@ -14546,30 +14546,30 @@ xmlXPathRewriteDOSExpression(xmlXPathCompExprPtr comp, xmlXPathStepOpPtr op)
*/
if (op->ch1 != -1) {
if ((op->op == XPATH_OP_COLLECT /* 11 */) &&
- ((xmlXPathAxisVal) op->value == AXIS_CHILD /* 4 */) &&
+ ((xmlXPathAxisVal) op->value == AXIS_CHILD /* 4 */) &&
((xmlXPathTestVal) op->value2 == NODE_TEST_NAME /* 5 */) &&
((xmlXPathTypeVal) op->value3 == NODE_TYPE_NODE /* 0 */))
{
/*
* This is a "child::foo"
*/
- xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
+ xmlXPathStepOpPtr prevop = &comp->steps[op->ch1];
if ((prevop->op == XPATH_OP_COLLECT /* 11 */) &&
- (prevop->ch1 != -1) &&
+ (prevop->ch1 != -1) &&
((xmlXPathAxisVal) prevop->value ==
AXIS_DESCENDANT_OR_SELF) &&
(prevop->ch2 == -1) &&
((xmlXPathTestVal) prevop->value2 == NODE_TEST_TYPE) &&
((xmlXPathTypeVal) prevop->value3 == NODE_TYPE_NODE) &&
(comp->steps[prevop->ch1].op == XPATH_OP_ROOT))
- {
+ {
/*
* This is a "/descendant-or-self::node()" without predicates.
* Eliminate it.
*/
op->ch1 = prevop->ch1;
- op->rewriteType = XP_REWRITE_DOS_CHILD_ELEM;
+ op->rewriteType = XP_REWRITE_DOS_CHILD_ELEM;
}
}
if (op->ch1 != -1)
@@ -14614,7 +14614,7 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
}
if (*pctxt->cur != 0) {
- /*
+ /*
* aleksey: in some cases this line prints *second* error message
* (see bug #78858) and probably this should be fixed.
* However, we are not sure that all error messages are printed
@@ -14633,7 +14633,7 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
#ifdef DEBUG_EVAL_COUNTS
comp->string = xmlStrdup(str);
comp->nb = 0;
-#endif
+#endif
if ((comp->expr != NULL) &&
(comp->nbStep > 2) &&
(comp->last >= 0) &&
@@ -14678,7 +14678,7 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
xmlXPathObjectPtr *resObj,
int toBool)
{
- xmlXPathParserContextPtr pctxt;
+ xmlXPathParserContextPtr pctxt;
#ifndef LIBXML_THREAD_ENABLED
static int reentance = 0;
#endif
@@ -14707,15 +14707,15 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
res = xmlXPathRunEval(pctxt, toBool);
if (resObj) {
- if (pctxt->value == NULL) {
+ if (pctxt->value == NULL) {
xmlGenericError(xmlGenericErrorContext,
"xmlXPathCompiledEval: evaluation failed\n");
- *resObj = NULL;
+ *resObj = NULL;
} else {
*resObj = valuePop(pctxt);
}
}
-
+
/*
* Pop all remaining objects from the stack.
*/
@@ -14726,7 +14726,7 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
do {
tmp = valuePop(pctxt);
if (tmp != NULL) {
- stack++;
+ stack++;
xmlXPathReleaseObject(ctxt, tmp);
}
} while (tmp != NULL);
@@ -14738,11 +14738,11 @@ xmlXPathCompiledEvalInternal(xmlXPathCompExprPtr comp,
stack);
}
}
-
+
if ((pctxt->error != XPATH_EXPRESSION_OK) && (resObj) && (*resObj)) {
xmlXPathFreeObject(*resObj);
*resObj = NULL;
- }
+ }
pctxt->comp = NULL;
xmlXPathFreeParserContext(pctxt);
#ifndef LIBXML_THREAD_ENABLED
@@ -14803,7 +14803,7 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
#endif
if (ctxt == NULL) return;
-
+
#ifdef XPATH_STREAMING
comp = xmlXPathTryStreamCompile(ctxt->context, ctxt->base);
if (comp != NULL) {
@@ -14831,7 +14831,7 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
}
}
CHECK_ERROR;
- xmlXPathRunEval(ctxt, 0);
+ xmlXPathRunEval(ctxt, 0);
}
/**
@@ -14863,7 +14863,7 @@ xmlXPathEval(const xmlChar *str, xmlXPathContextPtr ctx) {
xmlGenericError(xmlGenericErrorContext,
"xmlXPathEval: evaluation failed\n");
res = NULL;
- } else if ((*ctxt->cur != 0) && (ctxt->comp != NULL)
+ } else if ((*ctxt->cur != 0) && (ctxt->comp != NULL)
#ifdef XPATH_STREAMING
&& (ctxt->comp->stream == NULL)
#endif
@@ -14976,21 +14976,21 @@ xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt) {
* If $escape-reserved is false, the behavior differs in that characters
* referred to in [RFC 2396] as reserved characters are not escaped. These
* characters are ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" | "$" | ",".
- *
+ *
* [RFC 2396] does not define whether escaped URIs should use lower case or
* upper case for hexadecimal digits. To ensure that escaped URIs can be
* compared using string comparison functions, this function must always use
* the upper-case letters A-F.
- *
+ *
* Generally, $escape-reserved should be set to true when escaping a string
* that is to form a single part of a URI, and to false when escaping an
* entire URI or URI reference.
- *
- * In the case of non-ascii characters, the string is encoded according to
+ *
+ * In the case of non-ascii characters, the string is encoded according to
* utf-8 and then converted according to RFC 2396.
*
* Examples
- * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), true())
+ * xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), true())
* returns "gopher%3A%2F%2Fspinaltap.micro.umn.edu%2F00%2FWeather%2FCalifornia%2FLos%20Angeles%23ocean"
* xf:escape-uri ("gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles#ocean"), false())
* returns "gopher://spinaltap.micro.umn.edu/00/Weather/California/Los%20Angeles%23ocean"
@@ -15003,28 +15003,28 @@ xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) {
xmlBufferPtr target;
xmlChar *cptr;
xmlChar escape[4];
-
+
CHECK_ARITY(2);
-
+
escape_reserved = xmlXPathPopBoolean(ctxt);
-
+
CAST_TO_STRING;
str = valuePop(ctxt);
-
+
target = xmlBufferCreate();
-
+
escape[0] = '%';
escape[3] = 0;
-
+
if (target) {
for (cptr = str->stringval; *cptr; cptr++) {
if ((*cptr >= 'A' && *cptr <= 'Z') ||
(*cptr >= 'a' && *cptr <= 'z') ||
(*cptr >= '0' && *cptr <= '9') ||
- *cptr == '-' || *cptr == '_' || *cptr == '.' ||
+ *cptr == '-' || *cptr == '_' || *cptr == '.' ||
*cptr == '!' || *cptr == '~' || *cptr == '*' ||
*cptr == '\''|| *cptr == '(' || *cptr == ')' ||
- (*cptr == '%' &&
+ (*cptr == '%' &&
((cptr[1] >= 'A' && cptr[1] <= 'F') ||
(cptr[1] >= 'a' && cptr[1] <= 'f') ||
(cptr[1] >= '0' && cptr[1] <= '9')) &&
@@ -15046,7 +15046,7 @@ xmlXPathEscapeUriFunction(xmlXPathParserContextPtr ctxt, int nargs) {
escape[2] = '0' + (*cptr & 0xF);
else
escape[2] = 'A' - 10 + (*cptr & 0xF);
-
+
xmlBufferAdd(target, &escape[0], 3);
}
}
diff --git a/xstc/Makefile.in b/xstc/Makefile.in
index 26048e6..ea25f01 100644
--- a/xstc/Makefile.in
+++ b/xstc/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.