aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadaf Ebrahimi <sadafebrahimi@google.com>2023-05-01 21:00:50 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2023-05-01 21:00:50 +0000
commitdd0c2770849096989272d123ada518adc9a2624e (patch)
treec4d9715551abb8cf07adeb0e89cc7513c54c2ce5
parentb0c4b8343c0e472cd36c860e138dd67075f33bfa (diff)
parentf04bed3f021c214448a308ac2dbaa40ff26eefa8 (diff)
downloadlibxml2-llvm-r487747.tar.gz
Merge "Upgrade libxml2 to a06eaa6119ca5b296b8105dc8c9a34ed5fc1f338"llvm-r487747
-rw-r--r--.gitignore167
-rw-r--r--CMakeLists.txt13
-rw-r--r--HTMLparser.c136
-rw-r--r--METADATA6
-rw-r--r--Makefile.am28
-rw-r--r--NEWS419
-rw-r--r--SAX2.c35
-rwxr-xr-xcheck-relaxng-test-suite.py1
-rwxr-xr-xcheck-relaxng-test-suite2.py1
-rwxr-xr-xcheck-xsddata-test-suite.py1
-rw-r--r--configure.ac15
-rw-r--r--dict.c3
-rw-r--r--doc/devhelp/libxml2-HTMLparser.html18
-rw-r--r--doc/devhelp/libxml2-SAX2.html4
-rw-r--r--doc/devhelp/libxml2-dict.html6
-rw-r--r--doc/devhelp/libxml2-encoding.html8
-rw-r--r--doc/devhelp/libxml2-globals.html4
-rw-r--r--doc/devhelp/libxml2-parser.html8
-rw-r--r--doc/devhelp/libxml2-parserInternals.html191
-rw-r--r--doc/devhelp/libxml2-threads.html42
-rw-r--r--doc/devhelp/libxml2-tree.html18
-rw-r--r--doc/devhelp/libxml2-uri.html2
-rw-r--r--doc/devhelp/libxml2-valid.html28
-rw-r--r--doc/devhelp/libxml2-xmlIO.html2
-rw-r--r--doc/devhelp/libxml2-xmlerror.html2
-rw-r--r--doc/devhelp/libxml2-xmlexports.html29
-rw-r--r--doc/devhelp/libxml2-xmlmemory.html28
-rw-r--r--doc/devhelp/libxml2-xmlschemastypes.html13
-rw-r--r--doc/devhelp/libxml2-xmlversion.html11
-rw-r--r--doc/devhelp/libxml2-xpath.html4
-rw-r--r--doc/devhelp/libxml2-xpathInternals.html8
-rw-r--r--doc/devhelp/libxml2.devhelp213
-rw-r--r--doc/examples/.gitignore15
-rw-r--r--doc/examples/Makefile.am18
-rw-r--r--doc/examples/examples.xml136
-rw-r--r--doc/examples/index.html106
-rwxr-xr-xdoc/examples/index.py2
-rw-r--r--doc/examples/io1.c8
-rw-r--r--doc/examples/parse1.c8
-rw-r--r--doc/examples/parse2.c8
-rw-r--r--doc/examples/parse3.c8
-rw-r--r--doc/examples/parse4.c8
-rw-r--r--doc/examples/reader1.c8
-rw-r--r--doc/examples/reader2.c8
-rw-r--r--doc/examples/reader3.c9
-rw-r--r--doc/examples/reader4.c8
-rw-r--r--doc/examples/testWriter.c8
-rw-r--r--doc/examples/tree1.c6
-rw-r--r--doc/examples/tree2.c10
-rw-r--r--doc/examples/xpath1.c7
-rw-r--r--doc/examples/xpath2.c7
-rw-r--r--doc/libxml2-api.xml76
-rw-r--r--doc/xmlcatalog.118
-rw-r--r--doc/xmlcatalog.html284
-rw-r--r--doc/xmllint.133
-rw-r--r--doc/xmllint.html326
-rw-r--r--encoding.c856
-rw-r--r--include/libxml/encoding.h10
-rw-r--r--include/libxml/parserInternals.h11
-rw-r--r--include/libxml/xmlmemory.h2
-rw-r--r--include/libxml/xmlschemastypes.h2
-rw-r--r--include/libxml/xpath.h2
-rw-r--r--include/libxml/xpathInternals.h2
-rw-r--r--include/private/enc.h3
-rw-r--r--include/private/parser.h6
-rw-r--r--libxml.m42
-rw-r--r--libxml2.syms2331
-rw-r--r--m4/ax_append_flag.m450
-rw-r--r--m4/ax_append_link_flags.m444
-rw-r--r--m4/ax_check_link_flag.m453
-rw-r--r--m4/ax_require_defined.m437
-rw-r--r--nanoftp.c1
-rw-r--r--nanohttp.c1
-rw-r--r--parser.c752
-rw-r--r--parserInternals.c570
-rw-r--r--python/.gitignore9
-rwxr-xr-xpython/generator.py8
-rwxr-xr-xpython/tests/attribs.py1
-rwxr-xr-xpython/tests/build.py1
-rwxr-xr-xpython/tests/compareNodes.py1
-rwxr-xr-xpython/tests/ctxterror.py1
-rwxr-xr-xpython/tests/cutnpaste.py1
-rwxr-xr-xpython/tests/dtdvalid.py1
-rwxr-xr-xpython/tests/error.py1
-rwxr-xr-xpython/tests/inbuf.py1
-rwxr-xr-xpython/tests/indexes.py1
-rwxr-xr-xpython/tests/nsdel.py1
-rwxr-xr-xpython/tests/outbuf.py1
-rwxr-xr-xpython/tests/push.py1
-rwxr-xr-xpython/tests/pushSAX.py1
-rwxr-xr-xpython/tests/pushSAXhtml.py1
-rwxr-xr-xpython/tests/reader.py1
-rwxr-xr-xpython/tests/reader2.py3
-rwxr-xr-xpython/tests/reader3.py1
-rwxr-xr-xpython/tests/reader4.py1
-rwxr-xr-xpython/tests/reader5.py1
-rwxr-xr-xpython/tests/reader6.py1
-rwxr-xr-xpython/tests/reader7.py1
-rwxr-xr-xpython/tests/reader8.py1
-rwxr-xr-xpython/tests/readererr.py1
-rwxr-xr-xpython/tests/readernext.py1
-rwxr-xr-xpython/tests/regexp.py1
-rwxr-xr-xpython/tests/relaxng.py1
-rwxr-xr-xpython/tests/resolver.py1
-rwxr-xr-xpython/tests/schema.py1
-rwxr-xr-xpython/tests/serialize.py1
-rwxr-xr-xpython/tests/sync.py1
-rwxr-xr-xpython/tests/thread2.py1
-rwxr-xr-xpython/tests/tst.py1
-rwxr-xr-xpython/tests/tstLastError.py1
-rwxr-xr-xpython/tests/tstURI.py1
-rwxr-xr-xpython/tests/tstmem.py1
-rwxr-xr-xpython/tests/tstxpath.py1
-rwxr-xr-xpython/tests/validDTD.py1
-rwxr-xr-xpython/tests/validRNG.py1
-rwxr-xr-xpython/tests/validSchemas.py1
-rwxr-xr-xpython/tests/validate.py1
-rwxr-xr-xpython/tests/walker.py1
-rwxr-xr-xpython/tests/xpath.py1
-rwxr-xr-xpython/tests/xpathext.py1
-rwxr-xr-xpython/tests/xpathleak.py2
-rwxr-xr-xpython/tests/xpathns.py1
-rwxr-xr-xpython/tests/xpathret.py1
-rw-r--r--result/HTML/names.html6
-rw-r--r--result/HTML/names.html.err3
-rw-r--r--result/HTML/names.html.sax20
-rw-r--r--result/VC/ElementValid5.rdr3
-rw-r--r--result/VC/ElementValid6.rdr2
-rw-r--r--result/VC/ElementValid7.rdr2
-rw-r--r--result/schemas/579746_0_3.err2
-rw-r--r--result/schemas/579746_0_5.err2
-rw-r--r--result/schemas/579746_1_3.err2
-rw-r--r--result/schemas/579746_1_5.err2
-rw-r--r--result/schemas/all_0_3.err2
-rw-r--r--result/schemas/all_0_4.err2
-rw-r--r--result/schemas/all_0_5.err2
-rw-r--r--result/schemas/all_0_6.err2
-rw-r--r--result/schemas/all_0_7.err2
-rw-r--r--result/schemas/all_1_3.err2
-rw-r--r--result/schemas/all_1_5.err2
-rw-r--r--result/schemas/all_1_6.err2
-rw-r--r--result/schemas/all_1_7.err2
-rw-r--r--result/schemas/all_2_0.err2
-rw-r--r--result/schemas/all_2_1.err2
-rw-r--r--result/schemas/all_2_2.err2
-rw-r--r--result/schemas/all_2_4.err2
-rw-r--r--result/schemas/all_2_5.err2
-rw-r--r--result/schemas/allsg_0_3.err2
-rw-r--r--result/schemas/allsg_0_4.err2
-rw-r--r--result/schemas/allsg_0_5.err2
-rw-r--r--result/schemas/any3_0_0.err2
-rw-r--r--result/schemas/any5_0_0.err2
-rw-r--r--result/schemas/any5_0_1.err2
-rw-r--r--result/schemas/any5_0_2.err2
-rw-r--r--result/schemas/any5_0_4.err2
-rw-r--r--result/schemas/any5_0_5.err2
-rw-r--r--result/schemas/any5_0_6.err2
-rw-r--r--result/schemas/any5_1_0.err2
-rw-r--r--result/schemas/any5_1_1.err2
-rw-r--r--result/schemas/any5_1_3.err2
-rw-r--r--result/schemas/any5_1_4.err2
-rw-r--r--result/schemas/any5_1_6.err2
-rw-r--r--result/schemas/any7_1_0.err2
-rw-r--r--result/schemas/any7_1_1.err2
-rw-r--r--result/schemas/any7_2_0.err2
-rw-r--r--result/schemas/any7_2_1.err2
-rw-r--r--result/schemas/anyAttr-processContents-err1_0_0.err4
-rw-r--r--result/schemas/attruse_0_1.err2
-rw-r--r--result/schemas/attruse_0_2.err2
-rw-r--r--result/schemas/bug323510_1_0.err2
-rw-r--r--result/schemas/changelog093_1_0.err2
-rw-r--r--result/schemas/choice_0_2.err2
-rw-r--r--result/schemas/choice_0_3.err2
-rw-r--r--result/schemas/choice_0_4.err2
-rw-r--r--result/schemas/choice_0_5.err2
-rw-r--r--result/schemas/choice_0_6.err2
-rw-r--r--result/schemas/choice_1_2.err2
-rw-r--r--result/schemas/choice_1_3.err2
-rw-r--r--result/schemas/choice_1_5.err2
-rw-r--r--result/schemas/choice_1_6.err2
-rw-r--r--result/schemas/choice_2_4.err2
-rw-r--r--result/schemas/choice_2_6.err2
-rw-r--r--result/schemas/cos-st-restricts-1-2-err_0_0.err4
-rw-r--r--result/schemas/decimal-1_1_0.err16
-rw-r--r--result/schemas/decimal-2_1_0.err4
-rw-r--r--result/schemas/decimal-3_1_0.err8
-rw-r--r--result/schemas/extension1_0_1.err2
-rw-r--r--result/schemas/extension1_0_2.err2
-rw-r--r--result/schemas/facet-unionST-err1_0_0.err2
-rw-r--r--result/schemas/hexbinary_0_1.err14
-rw-r--r--result/schemas/issue491_0_0.err1
-rw-r--r--result/schemas/list0_0_1.err2
-rw-r--r--result/schemas/list0_1_0.err2
-rw-r--r--result/schemas/list0_1_1.err2
-rw-r--r--result/schemas/ns0_0_2.err2
-rw-r--r--result/schemas/ns0_0_3.err2
-rw-r--r--result/schemas/ns0_0_4.err2
-rw-r--r--result/schemas/ns0_1_0.err2
-rw-r--r--result/schemas/ns0_1_1.err2
-rw-r--r--result/schemas/ns0_1_2.err2
-rw-r--r--result/schemas/restriction-enum-1_1_0.err2
-rw-r--r--result/schemas/union2_1_1.err2
-rw-r--r--result/schemas/vdv-first4_0_1.err2
-rw-r--r--result/schemas/vdv-first4_0_2.err2
-rw-r--r--result/valid/781333.xml.err.rdr2
-rw-r--r--runsuite.c3
-rw-r--r--runtest.c115
-rw-r--r--runxmlconf.c1
-rw-r--r--schematron.c1
-rw-r--r--test/HTML/names.html5
-rw-r--r--test/schemas/issue491_0.xml1
-rw-r--r--test/schemas/issue491_0.xsd18
-rw-r--r--testModule.c2
-rw-r--r--testOOM.c2
-rw-r--r--testThreads.c2
-rw-r--r--testapi.c20
-rw-r--r--testchar.c64
-rw-r--r--testdict.c1
-rw-r--r--testlimits.c1
-rw-r--r--testrecurse.c1
-rw-r--r--valid.c91
-rw-r--r--xmlIO.c38
-rw-r--r--xmlcatalog.c1
-rw-r--r--xmllint.c50
-rw-r--r--xmlmemory.c27
-rw-r--r--xmlreader.c2
-rw-r--r--xmlregexp.c121
-rw-r--r--xmlschemas.c122
-rw-r--r--xmlschemastypes.c204
-rw-r--r--xmlwriter.c6
-rw-r--r--xpath.c111
-rw-r--r--xpointer.c1
-rw-r--r--xstc/.gitignore3
-rwxr-xr-xxstc/fixup-tests.py1
-rw-r--r--xzlib.c7
235 files changed, 5338 insertions, 3099 deletions
diff --git a/.gitignore b/.gitignore
index 6f5dc0b4..1696d2e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,118 +1,65 @@
*.exe
*.o
+*.la
*.lo
-*.log
*.pyc
-*.patch
+
+# Executables
+/example/gjobread
+/xmlcatalog
+/xmllint
+
+# Test executables
+/runsuite
+/runtest
+/runxmlconf
+/testModule
+/testThreads
+/testapi
+/testchar
+/testdict
+/testlimits
+/testrecurse
+
+# Tests
+/dba100000.xml
+/missing.lst
+/runsuite.log
+/runxmlconf.log
+/test.out
+/xmlconf
+
+# Generated by build system
+/config.h
+/include/libxml/xmlversion.h
+/libxml-2.0-uninstalled.pc
+/libxml-2.0.pc
+/libxml2-config.cmake
+/xml2-config
+
+# Autotools
.deps
.libs
-.memdump
-COPYING
-CVE-*
-INSTALL
Makefile
Makefile.in
-aclocal.m4
-autom4te.cache
-bissect*
-compile
-config.guess
-config.h
-config.h.in
-config.h.in~
-config.log
-config.status
-config.sub
-configure
-configure~
-dba100000.xml
-depcomp
-doc/Makefile
-doc/Makefile.in
-doc/devhelp/Makefile
-doc/devhelp/Makefile.in
-doc/examples/.deps
-doc/examples/Makefile
-doc/examples/Makefile.in
-doc/examples/io1
-doc/examples/io2
-doc/examples/parse1
-doc/examples/parse2
-doc/examples/parse3
-doc/examples/parse4
-doc/examples/reader1
-doc/examples/reader2
-doc/examples/reader3
-doc/examples/reader4
-doc/examples/testWriter
-doc/examples/tree1
-doc/examples/tree2
-doc/examples/xpath1
-doc/examples/xpath2
-example/.deps
-example/Makefile
-example/Makefile.in
-example/gjobread
-include/Makefile
-include/Makefile.in
-include/libxml/Makefile
-include/libxml/Makefile.in
-include/libxml/xmlversion.h
-install-sh
-libtool
-libxml-2.0-uninstalled.pc
-libxml-2.0.pc
-libxml2-config.cmake
-libxml2.la
-list
-ltmain.sh
-log
-missing
-missing.lst
-m4/libtool.m4
-m4/lt*.m4
-py-compile
-python/.deps
-python/.libs
-python/Makefile
-python/Makefile.in
-python/gen_prog
-python/libxml2-export.c
-python/libxml2-py.c
-python/libxml2-py.h
-python/libxml2.py
-python/libxml2class.py
-python/libxml2class.txt
-python/libxml2mod.la
-python/setup.py
-python/tests/Makefile
-python/tests/Makefile.in
-python/tests/tmp.xml
-runsuite
-runtest
-runxmlconf
-runxmlconf.log
-stamp-h1
-tags
-test.out
-testModule
-testThreads
-testapi
-testapi.c.new
-testchar
-testdict
-testdso.la
-testlimits
-testrecurse
-tmp
-tst.c
-tst
-xml2-config
-xmlcatalog
-xmlconf
-xmllint
-xstc/*-test.py
-xstc/Makefile
-xstc/Makefile.in
-xstc/Tests
-xstc/xsts-*.tar.gz
+/INSTALL
+/aclocal.m4
+/autom4te.cache
+/compile
+/config.guess
+/config.h.in
+/config.h.in~
+/config.log
+/config.status
+/config.sub
+/configure
+/configure~
+/depcomp
+/install-sh
+/libtool
+/ltmain.sh
+/missing
+/m4/libtool.m4
+/m4/lt*.m4
+/py-compile
+/stamp-h1
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39d36234..834b35d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.15)
+cmake_minimum_required(VERSION 3.18)
file(STRINGS "configure.ac" CONFIGURE_AC_LINES)
foreach(line ${CONFIGURE_AC_LINES})
@@ -16,6 +16,7 @@ include(CheckCSourceCompiles)
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckLibraryExists)
+include(CheckLinkerFlag)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CMakePackageConfigHelpers)
@@ -168,8 +169,8 @@ if (NOT MSVC)
check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
check_include_files(sys/time.h HAVE_SYS_TIME_H)
check_include_files(unistd.h HAVE_UNISTD_H)
- check_function_exists(va_copy HAVE_VA_COPY)
- check_function_exists(__va_copy HAVE___VA_COPY)
+ check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY)
+ check_symbol_exists(__va_copy stdarg.h HAVE___VA_COPY)
set(LT_OBJDIR ".libs/")
check_c_source_compiles("
#include <stdarg.h>
@@ -337,7 +338,11 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
-Wredundant-decls -Wno-long-long -Wno-format-extra-args")
if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
- target_link_options(LibXml2 PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
+ check_linker_flag(C "LINKER:--undefined-version" FLAG_UNDEFINED_VERSION)
+ if (FLAG_UNDEFINED_VERSION)
+ target_link_options(LibXml2 PRIVATE "LINKER:--undefined-version")
+ endif()
+ target_link_options(LibXml2 PRIVATE "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
endif()
endif()
diff --git a/HTMLparser.c b/HTMLparser.c
index e9084950..ca2da8fa 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -410,6 +410,11 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
*len = 0;
return(ctxt->token);
}
+
+ if ((ctxt->input->end - ctxt->input->cur < INPUT_CHUNK) &&
+ (xmlParserGrow(ctxt) < 0))
+ return(0);
+
if (ctxt->charset != XML_CHAR_ENCODING_UTF8) {
xmlChar * guess;
xmlCharEncodingHandlerPtr handler;
@@ -470,29 +475,21 @@ htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
cur = ctxt->input->cur;
c = *cur;
if (c & 0x80) {
+ size_t avail;
+
if ((c & 0x40) == 0)
goto encoding_error;
- if (cur[1] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
- if ((cur[1] & 0xc0) != 0x80)
+
+ avail = ctxt->input->end - ctxt->input->cur;
+
+ if ((avail < 2) || ((cur[1] & 0xc0) != 0x80))
goto encoding_error;
if ((c & 0xe0) == 0xe0) {
-
- if (cur[2] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
- if ((cur[2] & 0xc0) != 0x80)
+ if ((avail < 3) || ((cur[2] & 0xc0) != 0x80))
goto encoding_error;
if ((c & 0xf0) == 0xf0) {
- if (cur[3] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
if (((c & 0xf8) != 0xf0) ||
- ((cur[3] & 0xc0) != 0x80))
+ (avail < 4) || ((cur[3] & 0xc0) != 0x80))
goto encoding_error;
/* 4-byte code */
*len = 4;
@@ -2670,7 +2667,6 @@ static const xmlChar *
htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
int len = 0, l;
int c;
- int count = 0;
int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
XML_MAX_TEXT_LENGTH :
XML_MAX_NAME_LENGTH;
@@ -2679,7 +2675,6 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
/*
* Handler for more complex cases
*/
- GROW;
c = CUR_CHAR(l);
if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
(!IS_LETTER(c) && (c != '_') &&
@@ -2693,10 +2688,6 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
(c == '_') || (c == ':') ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c)))) {
- if (count++ > 100) {
- count = 0;
- GROW;
- }
len += l;
if (len > maxLength) {
htmlParseErr(ctxt, XML_ERR_NAME_TOO_LONG, "name too long", NULL, NULL);
@@ -2712,6 +2703,8 @@ htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
return(htmlParseNameComplex(ctxt));
}
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
if (ctxt->input->cur - ctxt->input->base < len) {
/* Sanity check */
@@ -2847,6 +2840,10 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) {
out = &buffer[indx];
}
c = CUR_CHAR(l);
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buffer);
+ return(NULL);
+ }
if (c < 0x80)
{ *out++ = c; bits= -6; }
else if (c < 0x800)
@@ -2859,7 +2856,7 @@ htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) {
for ( ; bits >= 0; bits-= 6) {
*out++ = ((c >> bits) & 0x3F) | 0x80;
}
- NEXT;
+ NEXTL(l);
}
if (out - buffer > maxLength) {
htmlParseErr(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
@@ -3013,9 +3010,9 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished SystemLiteral\n", NULL, NULL);
} else {
- NEXT;
if (err == 0)
ret = xmlStrndup((BASE_PTR+startPosition), len);
+ NEXT;
}
return(ret);
@@ -3068,9 +3065,9 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished PubidLiteral\n", NULL, NULL);
} else {
- NEXT;
if (err == 0)
ret = xmlStrndup((BASE_PTR + startPosition), len);
+ NEXT;
}
return(ret);
@@ -3103,7 +3100,6 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
int nbchar = 0;
int cur,l;
- SHRINK;
cur = CUR_CHAR(l);
while (cur != 0) {
if ((cur == '<') && (NXT(1) == '/')) {
@@ -3142,6 +3138,7 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
"Invalid char in CDATA 0x%X\n", cur);
}
+ NEXTL(l);
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
if (ctxt->sax->cdataBlock!= NULL) {
@@ -3153,12 +3150,14 @@ htmlParseScript(htmlParserCtxtPtr ctxt) {
ctxt->sax->characters(ctxt->userData, buf, nbchar);
}
nbchar = 0;
+ SHRINK;
}
- GROW;
- NEXTL(l);
cur = CUR_CHAR(l);
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return;
+
if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
buf[nbchar] = 0;
if (ctxt->sax->cdataBlock!= NULL) {
@@ -3189,12 +3188,10 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 6];
int nbchar = 0;
int cur, l;
- int chunk = 0;
if (readahead)
buf[nbchar++] = readahead;
- SHRINK;
cur = CUR_CHAR(l);
while (((cur != '<') || (ctxt->token == '<')) &&
((cur != '&') || (ctxt->token == '&')) &&
@@ -3205,6 +3202,7 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
} else {
COPY_BUF(l,buf,nbchar,cur);
}
+ NEXTL(l);
if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
@@ -3228,21 +3226,12 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
}
}
nbchar = 0;
- }
- NEXTL(l);
- chunk++;
- if (chunk > HTML_PARSER_BUFFER_SIZE) {
- chunk = 0;
SHRINK;
- GROW;
- }
- cur = CUR_CHAR(l);
- if (cur == 0) {
- SHRINK;
- GROW;
- cur = CUR_CHAR(l);
}
+ cur = CUR_CHAR(l);
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return;
if (nbchar != 0) {
buf[nbchar] = 0;
@@ -3265,12 +3254,6 @@ htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
ctxt->sax->characters(ctxt->userData, buf, nbchar);
}
}
- } else {
- /*
- * Loop detection
- */
- if (cur == 0)
- ctxt->instate = XML_PARSER_EOF;
}
}
@@ -3366,7 +3349,6 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
XML_MAX_TEXT_LENGTH;
const xmlChar *target;
xmlParserInputState state;
- int count = 0;
if ((RAW == '<') && (NXT(1) == '?')) {
state = ctxt->instate;
@@ -3375,7 +3357,6 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
* this is a Processing Instruction.
*/
SKIP(2);
- SHRINK;
/*
* Parse the target name and check for special support like
@@ -3423,11 +3404,6 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
}
buf = tmp;
}
- count++;
- if (count > 50) {
- GROW;
- count = 0;
- }
if (IS_CHAR(cur)) {
COPY_BUF(l,buf,len,cur);
} else {
@@ -3444,13 +3420,12 @@ htmlParsePI(htmlParserCtxtPtr ctxt) {
}
NEXTL(l);
cur = CUR_CHAR(l);
- if (cur == 0) {
- SHRINK;
- GROW;
- cur = CUR_CHAR(l);
- }
}
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return;
+ }
if (cur != '>') {
htmlParseErr(ctxt, XML_ERR_PI_NOT_FINISHED,
"ParsePI: PI %s never end ...\n", target, NULL);
@@ -3504,7 +3479,6 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
state = ctxt->instate;
ctxt->instate = XML_PARSER_COMMENT;
- SHRINK;
SKIP(4);
buf = (xmlChar *) xmlMallocAtomic(size);
if (buf == NULL) {
@@ -3538,11 +3512,6 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
(r != '-') || (q != '-'))) {
NEXTL(l);
next = CUR_CHAR(nl);
- if (next == 0) {
- SHRINK;
- GROW;
- next = CUR_CHAR(nl);
- }
if ((q == '-') && (r == '-') && (cur == '!') && (next == '>')) {
htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
@@ -3587,6 +3556,10 @@ htmlParseComment(htmlParserCtxtPtr ctxt) {
}
finished:
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return;
+ }
if (cur == '>') {
NEXT;
if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
@@ -3885,9 +3858,10 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
nbchars = xmlCharEncInput(ctxt->input->buf, 1);
xmlBufResetInput(ctxt->input->buf->buffer, ctxt->input);
if (nbchars < 0) {
- htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
+ htmlParseErr(ctxt, ctxt->input->buf->error,
"htmlCheckEncoding: encoder error\n",
NULL, NULL);
+ xmlHaltParser(ctxt);
}
}
}
@@ -4500,6 +4474,8 @@ htmlParseContent(htmlParserCtxtPtr ctxt) {
else {
htmlParseCharData(ctxt);
}
+
+ SHRINK;
GROW;
}
if (currentNode != NULL) xmlFree(currentNode);
@@ -4941,6 +4917,8 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
else {
htmlParseCharData(ctxt);
}
+
+ SHRINK;
GROW;
}
if (currentNode != NULL) xmlFree(currentNode);
@@ -6000,8 +5978,14 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
if (idx < 0)
goto done;
val = in->cur[idx + 2];
- if (val == 0) /* bad cut of input */
+ if (val == 0) { /* bad cut of input */
+ /*
+ * FIXME: htmlParseScript checks for additional
+ * characters after '</'.
+ */
+ ctxt->checkIndex = idx;
goto done;
+ }
}
htmlParseScript(ctxt);
if ((cur == '<') && (next == '/')) {
@@ -6296,7 +6280,9 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
if (res < 0) {
- htmlErrMemory(ctxt, NULL);
+ htmlParseErr(ctxt, ctxt->input->buf->error,
+ "xmlParserInputBufferPush failed", NULL, NULL);
+ xmlHaltParser(ctxt);
return (ctxt->errNo);
}
#ifdef DEBUG_PUSH
@@ -6319,8 +6305,9 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
nbchars = xmlCharEncInput(in, terminate);
xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
if (nbchars < 0) {
- htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
+ htmlParseErr(ctxt, in->error,
"encoder error\n", NULL, NULL);
+ xmlHaltParser(ctxt);
return(XML_ERR_INVALID_ENCODING);
}
}
@@ -6411,10 +6398,15 @@ htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax, void *user_data,
(ctxt->input->buf != NULL)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
size_t cur = ctxt->input->cur - ctxt->input->base;
+ int res;
- xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
-
+ res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
+ if (res < 0) {
+ htmlParseErr(ctxt, ctxt->input->buf->error,
+ "xmlParserInputBufferPush failed\n", NULL, NULL);
+ xmlHaltParser(ctxt);
+ }
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
#endif
diff --git a/METADATA b/METADATA
index da6dd4a9..222b1b48 100644
--- a/METADATA
+++ b/METADATA
@@ -17,7 +17,7 @@ third_party {
type: GIT
value: "https://github.com/GNOME/libxml2/"
}
- version: "e7c3a4ca1be916d84e8182fb5de3a9c7a27bfe11"
+ version: "a06eaa6119ca5b296b8105dc8c9a34ed5fc1f338"
license_type: BY_EXCEPTION_ONLY
license_note: "contains GFDL documentation"
security {
@@ -25,7 +25,7 @@ third_party {
}
last_upgrade_date {
year: 2023
- month: 3
- day: 13
+ month: 5
+ day: 1
}
}
diff --git a/Makefile.am b/Makefile.am
index a5627280..c3ba886b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -233,7 +233,6 @@ endif
tests: $(OLD_TESTS)
Scripttests : xmllint$(EXEEXT)
- @(echo > .memdump)
@echo "## Scripts regression tests"
@echo "## Some of the base computations may be different if srcdir != ."
-@(for i in $(srcdir)/test/scripts/*.script ; do \
@@ -243,10 +242,8 @@ Scripttests : xmllint$(EXEEXT)
if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/scripts/$$name result.$$name ; \
diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
@@ -254,7 +251,6 @@ Scripttests : xmllint$(EXEEXT)
fi ; fi ; done)
Catatests : xmlcatalog$(EXEEXT)
- @(echo > .memdump)
@echo "## Catalog regression tests"
-@(for i in $(srcdir)/test/catalogs/*.script ; do \
name=`basename $$i .script`; \
@@ -263,10 +259,8 @@ Catatests : xmlcatalog$(EXEEXT)
if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
@@ -278,33 +272,22 @@ Catatests : xmlcatalog$(EXEEXT)
if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
rm result.$$name ; \
fi ; fi ; done)
@echo "## Add and del operations on XML Catalogs"
-@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
rm -f $(srcdir)/result/catalogs/mycatalog)
dba100000.xml: dbgenattr.pl
@@ -319,30 +302,21 @@ Timingtests: xmllint$(EXEEXT) dba100000.xml
@echo "## 3/ repeated DOM parsing"
@echo "## 4/ repeated DOM validation"
-@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
- MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
exit 0)
-@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
- MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
exit 0)
-@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
- MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
exit 0)
VTimingtests: xmllint$(EXEEXT)
-@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
- MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
exit 0)
Schematrontests: xmllint$(EXEEXT)
- @(echo > .memdump)
@echo "## Schematron regression tests"
-@(for i in $(srcdir)/test/schematron/*.sct ; do \
name=`basename $$i | sed 's+\.sct++'`; \
@@ -355,11 +329,9 @@ Schematrontests: xmllint$(EXEEXT)
$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
> $(srcdir)/result/schematron/"$$name"_"$$xno" \
2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
else \
log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
> res.$$name 2> err.$$name;\
- grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
res.$$name;\
diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
diff --git a/NEWS b/NEWS
index 3e6bbe6a..97f27770 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,424 @@
NEWS file for libxml2
+v2.11.0: Apr 28 2023
+
+### Major changes
+
+Protection against entity expansion attacks, also known as "billion laughs"
+has been greatly improved. Malicious files should be detected reliably now
+and false positives should be reduced. It is possible though that large
+documents which make heavy use of entities are rejected now.
+
+This release finally fixes symbol visibility on UNIX systems. Internal
+symbols will now be hidden. While these symbols were never declared in public
+headers, it was still possible to declare them manually. Now this won't work.
+
+All symbol information has been removed from the ELF version script to fix
+link errors with --no-undefined-version. The version nodes are kept so it
+should still be possible to run binaries linked against older versions.
+
+About 90 memory errors in code paths handling malloc failures have been fixed.
+While these issues shouldn't impact security, this improves robustness under
+memory pressure.
+
+The XInclude engine has been reworked to properly support nested includes.
+
+Several cases of quadratic behavior in the XML push parser have been fixed.
+
+Refactoring has begun on some buffering and encoding code with the goal of
+simplifying this part of the code base and improving error reporting.
+
+Other highlights:
+
+- Consolidated private header files.
+- Major rework of the autoconf build.
+- Deprecated several outdated and internal functions.
+
+Special thanks to Google's Open Source Security Subsidies program for
+sponsoring much of the work on this release!
+
+Ongoing work on libxml2 relies on funding. For a list of important open
+issues see <https://gitlab.gnome.org/GNOME/libxml2/-/issues/507>
+
+### Security
+
+- Fix use-after-free in xmlParseContentInternal() (David Kilzer)
+- xmllint: Fix use-after-free with --maxmem
+- parser: Fix OOB read when formatting error message
+- entities: Rework entity amplification checks
+
+### Regressions
+
+- parser: Fix regression in xmlParserNodeInfo accounting
+
+### Bug fixes
+
+- Fix memory errors in code handling malloc failures
+- encoding: Fix error code in asciiToUTF8
+- xpath: number('-') should return NaN
+- xmlParseStartTag2() contains typo when checking for default definitions for
+ an attribute in a namespace (David Kilzer)
+- uri: Fix handling of port numbers
+- error: Make sure that error messages are valid UTF-8
+- xinclude: Fix nested includes
+
+### Improvements
+
+- xmllint: Validate --maxmem integer option
+- xmlValidatePopElement() can return invalid value (-1) (David Kilzer)
+- parser: Rework EBCDIC code page detection
+- parser: Limit name length in xmlParseEncName
+- parser: Rework shrinking of input buffers
+- html: Rely on CUR_CHAR to grow the input buffer
+- parser: Rely on CUR_CHAR/NEXT to grow the input buffer
+- valid: Make xmlValidateElement non-recursive
+- html: Fix quadratic behavior in htmlParseTryOrFinish
+- xmllint: Fix memory leak with --pattern --stream
+- parser: Stop calling xmlParserInputShrink
+- html: Impose some length limits
+- valid: Allow xmlFreeValidCtxt(NULL)
+- parser: Stop calling xmlParserInputGrow
+- xinclude: Fix quadratic behavior in xmlXIncludeLoadTxt
+- xinclude: Abort immediately if max depth was exceeded
+- xpath: Only report the first error
+- error: Don't move past current position
+- error: Limit number of parser errors
+- parser: Lower entity nesting limit with XML_PARSE_HUGE
+- parser: Don't increase depth twice when parsing internal entities
+- parser: Improve detection of entity loops
+- parser: Only report a single entity error
+- libxml.h: Remove dubious definition of LIBXML_STATIC
+- html: Improve parsing of nested lists
+- memory: Don't use locks in xmlMemUsed
+- encoding: Remove unused variable xmlDefaultCharEncodingHandler
+- Rework initialization code
+- Add .editorconfig
+- parser: Merge misc, prolog and epilog cases in push parser
+- parser: Fix 'consumed' accounting when switching encodings
+- html: Fix check for end of comment in push parser
+- parser: Fix push parser with 1-3 byte initial chunk
+- parser: Rewrite push parser boundary checks
+- reader: Switch to xmlParserInputBufferCreateMem
+- html: Don't escape ASCII chars in href attributes
+- io: Don't shrink memory input buffers
+- parser: Don't call xmlSHRINK from push parser
+- parser: Ignore cdata argument in xmlParseCharData
+- parser: Rework push parser parser progress checks
+- io: Fix a few integer overflows in I/O statistics
+- io: Rework xmlParserInputBufferGrow with encodings
+- io: Remove xmlInputReadCallbackNop
+- io: Check for memory buffer early in xmlParserInputGrow
+- parser: Fix error message in xmlParseCommentComplex
+- Bypass proxy in nanoHTTP for hosts in "no_proxy" (Markus Jörg)
+- schemas: Fix infinite loop in xmlSchemaCheckElemSubstGroup
+- threads: Remove check for pthread_equal
+- xinclude: Rework XInclude cache
+- xinclude: Remove inefficient refcounting scheme
+- xmllint: Improve handling of empty XPath node sets
+- parser: Fix potential memory leak in xmlParseAttValueInternal
+- error: Don't use initGenericErrorDefaultFunc
+- xpath: Lower XPath recursion limit on Windows
+- Stop including sys/types.h
+- Don't define WIN32 macro
+- Make xmlNewSAXParserCtx take a const sax handler
+- Consolidate private header files
+- Remove internal macros from parserInternals.h
+- Move some HTML functions to correct header file
+- xmllint: Stop calling xmlSAXDefaultVersion
+- Introduce xmlNewSAXParserCtxt and htmlNewSAXParserCtxt
+- Don't mess with parser options in htmlParseDocument
+- Remove useless call to htmlDefaultSAXHandlerInit
+- Remove htmlDefaultSAXHandler from non-SAX1 build
+- Don't initialize SAX handler in htmlReadMemory
+- Fix htmlReadMemory mixing up XML and HTML functions
+- Don't use default SAX handler to report unrelated errors
+- Create stream with buffer in xmlNewStringInputStream
+- xmlcatalog: Fix memory leaks
+
+### Code quality
+
+- xzlib: Fix implicit sign change in xz_open
+- parser: Simplify calculation of available buffer space
+- parser: Use size_t when subtracting input buffer pointers
+- parser: Check for integer overflow when updating checkIndex
+- xpath: Fix harmless integer overflow in xmlXPathTranslateFunction
+- schematron: Use logical and
+- relaxng: Remove useless if statement
+- schemas: Remove useless if statement
+- pattern: Merge identical branches
+- regexp: Add sanity check in xmlRegCalloc2
+- regexp: Simplify xmlRegAtomPush
+- encoding: Cast toupper argument to unsigned char
+- uri: Add explicit cast in xmlSaveUri
+- buf: Fix return value of xmlBufGetInputBase
+- parser: Fix integer overflow of input ID
+- parser: Remove useless ent->etype test in xmlParseReference
+- parser: Remove useless ent->children tests in xmlParseReference
+- xmlmemory.c: Remove xmlMemContentShow
+- libxml.h: Add comments and indentation
+- libxml.h: Don't include stdio.h
+- xmlexports.h: Disable docs for internal macro XMLPUBLIC
+- parser: Simplify xmlParseConditionalSections
+- io: Rearrange code in xmlSwitchInputEncodingInt
+- warnings: Fix -Wstrict-prototypes warning
+- warnings: Remove set-but-unused variables
+- Fix compiler warnings in SAX2.c
+- Fix unused variable warning in python/types.c
+- Fix compiler warning in examples
+- Fix compiler warnings in fuzzing code
+- Remove unused code in nanohttp.c
+- Remove or annotate char casts
+- Don't use sizeof(xmlChar) or sizeof(char)
+- Remove explicit integer casts
+
+### Deprecations
+
+- parser: Deprecate more internal functions
+- parser: Deprecate some parser input functions
+- parser: Deprecate xmlString*DecodeEntities
+- threads: Deprecate some internal functions
+- buf: Deprecate static/immutable buffers
+- Deprecate internal parser functions
+- Deprecate old HTML SAX API
+- Generate deprecation warnings for old SAX API
+- Mark more functions setting globals as deprecated
+- Mark more parser functions as deprecated
+- Mark most SAX1 functions as deprecated
+- Deprecate some global variables
+
+### Portability
+
+- autoconf: Warn about outdated C compilers
+- win32: Remove broken libxml2.def.src
+- Remove symbols from version script
+- catalog.c: Silence a cast warning on VS 2022 (Lukáš Tyrychtr)
+- libxml.h: Remove ancient LynxOS setup
+- Use python3 not python (Ross Burton)
+- xstc/fixup-tests.py: port to Python 3 (Ross Burton)
+- xstc/fixup-tests.py: unify whitespace (Ross Burton)
+- Remove hacky heuristic from b2dc5675 (Alex Richardson)
+- Avoid creating an out-of-bounds pointer by rewriting a check
+ (Alex Richardson)
+- Hide internal functions
+- Correctly relocate internal pointers after realloc() (Alex Richardson)
+- Visual Studio builds: Allow silencing deprecation warnings (Chun-wei Fan)
+- Visual Studio: Define XML_DEPRECATED (Chun-wei Fan)
+- xmllint: Include <io.h> on Windows
+- warnings: Work around MSVC bug
+- sources: Silence C4013 warnings on Visual Studio (Chun-wei Fan)
+- python/setup.py.in: Improve Windows import patching (Chun-wei Fan)
+- python: Create .pyd on Windows
+- Fix Python build on Windows
+- Fix Windows compiler warnings in python/types.c
+- Fix libxml_PyFileGet
+- Remove BeOS support
+- Fix libxml_PyFileGet with stdout on macOS
+- Migrate from PyEval_ to PyObject_
+- Port build_glob.py to Python 3
+- Port genChRanges.py to Python 3
+- xmlexports.h: Remove LIBXML_FASTCALL optimization
+- Remove XMLCALL and XMLCDECL macros from public headers
+- Remove XMLDECL macro from .c files
+
+### Build systems
+
+- cmake: Link against `dl` and `dld` only when `LIBXML2_WITH_MODULES` is
+ enabled (Alexander Kutelev)
+- autotools: Fix make distcheck
+- Remove RPM build, Makefile.tests, README.tests
+- libxml.m4: deprecate AM_PATH_XML2, wrap PKG_CHECK_MODULES instead
+ (Ross Burton)
+- libxml.m4: fix -Wstrict-prototypes (Sam James)
+- cmake: Build static library with -DLIBXML_STATIC
+- autotools: Don't use version script on Windows
+- autotools: Fix winsock detection
+- autotools: Only add network libraries if HTTP/FTP enabled
+- autotools: Disable parallel Python build
+- python: Don't output missing generators during build
+- build: Remove check for broken ss_family
+- http: Simplify IPv6 checks
+- autotools: Fix network checks on Windows
+- Fix detection of GNU libiconv
+- cmake: Fix Python installation
+- cmake: Don't check for Python 2
+- configure.ac: Also check for MSYS host
+- Improve network library detection
+- Detect ws2_32 with AC_SEARCH_LIBS
+- Rework network configure checks
+- Remove arg cast configure checks
+- Fix dlopen check
+- Remove HAVE_WIN32_THREADS configuration flag
+- Rework dlopen and pthread detection
+- Fix test in configure.ac
+- cmake: Enable GCC compiler warnings
+- Always link with -no-undefined
+- Use AM_CFLAGS and AM_LDFLAGS consistently
+- Remove -Wredundant-decls
+- Call AC_CHECK_* with multiple arguments
+- configure.ac: Remove checks for unused programs
+- Rework library detection in configure.ac
+- Rearrange configure.ac
+- Consolidate zlib and lzma detection
+- Remove "runtime debugging"
+- Consolidate simple API modules in configure.ac
+- Fix dependency resolution in configure.ac
+- Fix --with-valid --without-regexps build
+- Fix --with-schemas --without-xpath build
+- Don't build unneeded .c source files
+- Move xmlIsXHTML to tree.c
+- Cleanup distribution settings in Makefile.am
+- Also clean *.pyc files for Python 2
+- Don't distribute libxml2.spec
+
+### Tests
+
+- testchar: Add test for memory pull parser with encoding
+- fuzz: Also test init function of URI fuzzer
+- fuzz: Separate fuzzer for DTD validation
+- gitlab-ci: Enable all "integer" sanitizers
+- fuzz: Inject random malloc failures
+- fuzz: Support variable integer sizes in fuzz data
+- fuzz: Fix duplicate detection in fuzzEntityRecorder
+- fuzz: Set filename in xmlFuzzEntityLoader
+- fuzz: Allow xmlFuzzReadString(NULL)
+- fuzz: Fix Makefile dependencies
+- fuzz: Add test/recurse to seed corpus
+- fuzz: Add separate XInclude fuzzer
+- runsuite: Some errors are expected
+- testrecurse: Test entity expansion stats
+- testapi.c: Initialize catalog early
+- gentest.py: Fix memory leak in API tests
+- tests: Enable "runsuite" test
+- python/tests/reader2: use absolute paths everywhere (Ross Burton)
+- python/tests/reader2: always exit(1) if a test fails (Ross Burton)
+- testModule: exit if the module can't be opened (Ross Burton)
+- CI: disable modules in gcc:static build (Ross Burton)
+- CI: fix CI on MinGW builds (Ross Burton)
+- python: Fix memory leak checks
+- tests: Check that xmlInitParser doesn't allocate memory
+- tests: Fix use-after-free in Python tests
+- tests: Remove unneeded #includes
+- gitlab-ci: Make Test-Msvc exit if ctest fails
+- gitlab-ci: Treat compiler warnings as errors on MSVC
+- test: Add test for push parser boundaries
+- gitlab-ci: Upgrade image to Ubuntu 22.10, reenable MSan
+- gitlab-ci: Reenable LeakSanitizer
+- gitlab-ci: Fix llvm-symbolizer
+- xinclude: Don't create result doc for test with errors
+- xinclude: Also test error messages
+- gitlab-ci: Allow cast-align warnings from clang
+- gitlab-ci: Fix tar invocation
+- gitlab-ci: Move MSVC test to separate script
+- gitlab-ci: Fix SUFFIX, remove MINGW_PATH
+- gitlab-ci: Consolidate CMake test scripts
+- gitlab-ci: Only install MinGW autotools if needed
+- gitlab-ci: Only install cmake MinGW package if needed
+- gitlab-ci: Install 7-Zip using the .msi
+- Use $MSYSTEM and 'bash -lc' in MinGW CI
+- Add CI job for MinGW/Autotools
+- Consolidate CI scripts
+- Allow empty MINGW_PACKAGE_PREFIX
+- Move Dockerfile to .gitlab-ci directory
+- testapi: Disable on Windows for now
+- Disable fuzzer tests if glob.h wasn't found
+- Move automata test to runtest.c
+- Fix testapi when building --without-sax1
+
+# Documentation
+
+- doc: Remove ancient files
+- Remove ancient TODOs
+- html: Fix htmlInitAutoClose documentation
+- doc: Mention new location of XML catalog as breaking change
+- doc: Mention potentially breaking changes in NEWS
+- doc: Remove xmlDllMain from documentation and version script
+- doc: Mention ${sysconfdir} in man pages
+- doc: Document xmlcatalog --convert
+- doc: Document xmllint --nodict and --pedantic
+- doc: Fix indentation in source XML files
+- xmllint: Document --quiet option
+- Improve cross-references in API docs
+- Improve documentation of globals
+- Fix documentation parser
+- Support comments for global variables in documentation
+- Fix update call in apibuild.py
+- Don't index anything in DOC_DISABLE sections
+- Fix warnings from apibuild.py
+- Start with documentation for maintainers
+
+
+v2.10.4: Apr 11 2023
+
+### Security
+
+- [CVE-2023-29469] Hashing of empty dict strings isn't deterministic
+- [CVE-2023-28484] Fix null deref in xmlSchemaFixupComplexType
+- schemas: Fix null-pointer-deref in xmlSchemaCheckCOSSTDerivedOK
+
+### Regressions
+
+- SAX2: Ignore namespaces in HTML documents
+- io: Fix "buffer full" error with certain buffer sizes
+
+
+v2.10.3: Oct 14 2022
+
+### Security
+
+- [CVE-2022-40304] Fix dict corruption caused by entity reference cycles
+- [CVE-2022-40303] Fix integer overflows with XML_PARSE_HUGE
+- Fix overflow check in SAX2.c
+
+### Portability
+
+- win32: Fix build with VS2013
+
+### Build system
+
+- cmake: Set SOVERSION
+
+
+v2.10.2: Aug 29 2022
+
+### Improvements
+
+- Remove set-but-unused variable in xmlXPathScanName
+- Silence -Warray-bounds warning
+
+### Build system
+
+- build: require automake-1.16.3 or later (Xi Ruoyao)
+- Remove generated files from distribution
+
+### Test suite
+
+- Don't create missing.xml when running testapi
+
+
+v2.10.1: Aug 25 2022
+
+### Regressions
+
+- Fix xmlCtxtReadDoc with encoding
+
+### Bug fixes
+
+- Fix HTML parser with threads and --without-legacy
+
+### Build system
+
+- Fix build with Python 3.10
+- cmake: Disable version script on macOS
+- Remove Makefile rule to build testapi.c
+
+### Documentation
+
+- Switch back to HTML output for API documentation
+- Port doc/examples/index.py to Python 3
+- Fix order of exports in libxml2-api.xml
+- Remove libxml2-refs.xml
+
+
v2.10.0: Aug 17 2022
### Breaking changes
diff --git a/SAX2.c b/SAX2.c
index b3dd89b1..b6be1a6c 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -1632,12 +1632,15 @@ xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
ctxt->validate = 0;
}
-
- /*
- * Split the full name into a namespace prefix and the tag name
- */
- name = xmlSplitQName(ctxt, fullname, &prefix);
-
+ if (ctxt->html) {
+ prefix = NULL;
+ name = xmlStrdup(fullname);
+ } else {
+ /*
+ * Split the full name into a namespace prefix and the tag name
+ */
+ name = xmlSplitQName(ctxt, fullname, &prefix);
+ }
/*
* Note : the namespace resolution is deferred until the end of the
@@ -1827,13 +1830,6 @@ xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
xmlGenericError(xmlGenericErrorContext, "SAX.xmlSAX2EndElement(%s)\n", name);
#endif
- /* Capture end position and add node */
- if (cur != NULL && ctxt->record_info) {
- ctxt->nodeInfo->end_pos = ctxt->input->cur - ctxt->input->base;
- ctxt->nodeInfo->end_line = ctxt->input->line;
- ctxt->nodeInfo->node = cur;
- xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
- }
ctxt->nodemem = -1;
#ifdef LIBXML_VALID_ENABLED
@@ -2476,24 +2472,15 @@ xmlSAX2EndElementNs(void *ctx,
const xmlChar * URI ATTRIBUTE_UNUSED)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
- xmlParserNodeInfo node_info;
- xmlNodePtr cur;
if (ctx == NULL) return;
- cur = ctxt->node;
- /* Capture end position and add node */
- if ((ctxt->record_info) && (cur != NULL)) {
- node_info.end_pos = ctxt->input->cur - ctxt->input->base;
- node_info.end_line = ctxt->input->line;
- node_info.node = cur;
- xmlParserAddNodeInfo(ctxt, &node_info);
- }
ctxt->nodemem = -1;
#ifdef LIBXML_VALID_ENABLED
if (ctxt->validate && ctxt->wellFormed &&
ctxt->myDoc && ctxt->myDoc->intSubset)
- ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc, cur);
+ ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
+ ctxt->node);
#endif /* LIBXML_VALID_ENABLED */
/*
diff --git a/check-relaxng-test-suite.py b/check-relaxng-test-suite.py
index 4372ddc3..3e152123 100755
--- a/check-relaxng-test-suite.py
+++ b/check-relaxng-test-suite.py
@@ -395,4 +395,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/check-relaxng-test-suite2.py b/check-relaxng-test-suite2.py
index 5f286ce2..779cefae 100755
--- a/check-relaxng-test-suite2.py
+++ b/check-relaxng-test-suite2.py
@@ -419,4 +419,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/check-xsddata-test-suite.py b/check-xsddata-test-suite.py
index 69c43ff2..a08e6af6 100755
--- a/check-xsddata-test-suite.py
+++ b/check-xsddata-test-suite.py
@@ -421,4 +421,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/configure.ac b/configure.ac
index fa24ca66..9c9ad572 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
m4_define([MAJOR_VERSION], 2)
-m4_define([MINOR_VERSION], 11)
+m4_define([MINOR_VERSION], 12)
m4_define([MICRO_VERSION], 0)
AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
@@ -455,7 +455,10 @@ if test "$lt_cv_prog_gnu_ld" = yes; then
*-*-cygwin* | *-*-mingw* | *-*-msys* )
;;
*)
- VERSION_SCRIPT_FLAGS=-Wl,--version-script=
+ dnl lld 16 defaults to --no-undefined-version but the version script
+ dnl can contain symbols disabled by configuration options.
+ AX_APPEND_LINK_FLAGS([-Wl,--undefined-version], [VERSION_SCRIPT_FLAGS])
+ AX_APPEND_FLAG([-Wl,--version-script=], [VERSION_SCRIPT_FLAGS])
;;
esac
else
@@ -1141,4 +1144,10 @@ AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
AC_OUTPUT
-echo Done configuring
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([_Thread_local int v;])], [], [
+ echo "================================================================"
+ echo "WARNING: Your C compiler doesn't support C11."
+ echo "Future versions of libxml2 will probably require a C11 compiler,"
+ echo "at least for features like multi-threading."
+ echo "================================================================"
+])
diff --git a/dict.c b/dict.c
index 86c3f6d7..d7fd1a06 100644
--- a/dict.c
+++ b/dict.c
@@ -433,7 +433,8 @@ static unsigned long
xmlDictComputeFastKey(const xmlChar *name, int namelen, int seed) {
unsigned long value = seed;
- if (name == NULL) return(0);
+ if ((name == NULL) || (namelen <= 0))
+ return(value);
value += *name;
value <<= 5;
if (namelen > 10) {
diff --git a/doc/devhelp/libxml2-HTMLparser.html b/doc/devhelp/libxml2-HTMLparser.html
index 778753c6..a25e40bb 100644
--- a/doc/devhelp/libxml2-HTMLparser.html
+++ b/doc/devhelp/libxml2-HTMLparser.html
@@ -63,7 +63,7 @@ void <a href="#htmlInitAutoClose">htmlInitAutoClose</a> (void);
int <a href="#htmlIsAutoClosed">htmlIsAutoClosed</a> (<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br> <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem);
int <a href="#htmlIsScriptAttribute">htmlIsScriptAttribute</a> (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlNewParserCtxt">htmlNewParserCtxt</a> (void);
-<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlNewSAXParserCtxt">htmlNewSAXParserCtxt</a> (<a href="libxml2-HTMLparser.html#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a> sax, <br> void * userData);
+<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> <a href="#htmlNewSAXParserCtxt">htmlNewSAXParserCtxt</a> (const <a href="libxml2-HTMLparser.html#htmlSAXHandler">htmlSAXHandler</a> * sax, <br> void * userData);
<a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a> <a href="#htmlNodeStatus">htmlNodeStatus</a> (const <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> node, <br> int legacy);
int <a href="#htmlParseCharRef">htmlParseCharRef</a> (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt);
int <a href="#htmlParseChunk">htmlParseChunk</a> (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br> const char * chunk, <br> int size, <br> int terminate);
@@ -881,7 +881,7 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<a name="htmlInitAutoClose"></a>htmlInitAutoClose ()</h3>
<pre class="programlisting">void htmlInitAutoClose (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. This is a no-op now.</p>
+<p>DEPRECATED: This is a no-op.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -948,9 +948,9 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<div class="refsect2" lang="en">
<h3>
<a name="htmlNewSAXParserCtxt"></a>htmlNewSAXParserCtxt ()</h3>
-<pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> htmlNewSAXParserCtxt (<a href="libxml2-HTMLparser.html#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a> sax, <br> void * userData)<br>
+<pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> htmlNewSAXParserCtxt (const <a href="libxml2-HTMLparser.html#htmlSAXHandler">htmlSAXHandler</a> * sax, <br> void * userData)<br>
</pre>
-<p>Allocate and initialize a new parser context.</p>
+<p>Allocate and initialize a new SAX parser context. If userData is NULL, the parser context will be passed as user data.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1000,7 +1000,7 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<a name="htmlParseCharRef"></a>htmlParseCharRef ()</h3>
<pre class="programlisting">int htmlParseCharRef (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse Reference declarations [66] CharRef ::= '&amp;#' [0-9]+ ';' | '&amp;#x' [0-9a-fA-F]+ ';'</p>
+<p>DEPRECATED: Internal function, don't use. parse Reference declarations [66] CharRef ::= '&amp;#' [0-9]+ ';' | '&amp;#x' [0-9a-fA-F]+ ';'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1101,7 +1101,7 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<a name="htmlParseElement"></a>htmlParseElement ()</h3>
<pre class="programlisting">void htmlParseElement (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an HTML element, this is highly recursive this is kept for compatibility with previous code versions [39] element ::= EmptyElemTag | STag content ETag [41] Attribute ::= Name Eq AttValue</p>
+<p>DEPRECATED: Internal function, don't use. parse an HTML element, this is highly recursive this is kept for compatibility with previous code versions [39] element ::= EmptyElemTag | STag content ETag [41] Attribute ::= Name Eq AttValue</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1116,7 +1116,7 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<a name="htmlParseEntityRef"></a>htmlParseEntityRef ()</h3>
<pre class="programlisting">const <a href="libxml2-HTMLparser.html#htmlEntityDesc">htmlEntityDesc</a> * htmlParseEntityRef (<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** str)<br>
</pre>
-<p>parse an HTML ENTITY references [68] EntityRef ::= '&amp;' Name ';'</p>
+<p>DEPRECATED: Internal function, don't use. parse an HTML ENTITY references [68] EntityRef ::= '&amp;' Name ';'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1339,7 +1339,7 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<a name="htmlSAXParseDoc"></a>htmlSAXParseDoc ()</h3>
<pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> htmlSAXParseDoc (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * cur, <br> const char * encoding, <br> <a href="libxml2-HTMLparser.html#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a> sax, <br> void * userData)<br>
</pre>
-<p>Parse an HTML in-memory document. If sax is not NULL, use the SAX callbacks to handle parse events. If sax is NULL, fallback to the default DOM behavior and return a tree.</p>
+<p>DEPRECATED: Use <a href="libxml2-HTMLparser.html#htmlNewSAXParserCtxt">htmlNewSAXParserCtxt</a> and <a href="libxml2-HTMLparser.html#htmlCtxtReadDoc">htmlCtxtReadDoc</a>. Parse an HTML in-memory document. If sax is not NULL, use the SAX callbacks to handle parse events. If sax is NULL, fallback to the default DOM behavior and return a tree.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1373,7 +1373,7 @@ const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * <a href=
<a name="htmlSAXParseFile"></a>htmlSAXParseFile ()</h3>
<pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> htmlSAXParseFile (const char * filename, <br> const char * encoding, <br> <a href="libxml2-HTMLparser.html#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a> sax, <br> void * userData)<br>
</pre>
-<p>parse an HTML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines.</p>
+<p>DEPRECATED: Use <a href="libxml2-HTMLparser.html#htmlNewSAXParserCtxt">htmlNewSAXParserCtxt</a> and <a href="libxml2-HTMLparser.html#htmlCtxtReadFile">htmlCtxtReadFile</a>. parse an HTML file and build a tree. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. It use the given SAX function block to handle the parsing callback. If sax is NULL, fallback to the default DOM tree building routines.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
diff --git a/doc/devhelp/libxml2-SAX2.html b/doc/devhelp/libxml2-SAX2.html
index 4a463b17..b0bb2c79 100644
--- a/doc/devhelp/libxml2-SAX2.html
+++ b/doc/devhelp/libxml2-SAX2.html
@@ -69,7 +69,7 @@ int <a href="#xmlSAXVersion">xmlSAXVersion</a> (<a href="libxml2-tree.html#xml
<a name="htmlDefaultSAXHandlerInit"></a>htmlDefaultSAXHandlerInit ()</h3>
<pre class="programlisting">void htmlDefaultSAXHandlerInit (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the default SAX handler</p>
+<p>DEPRECATED: This function is a no-op. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -77,7 +77,7 @@ int <a href="#xmlSAXVersion">xmlSAXVersion</a> (<a href="libxml2-tree.html#xml
<a name="xmlDefaultSAXHandlerInit"></a>xmlDefaultSAXHandlerInit ()</h3>
<pre class="programlisting">void xmlDefaultSAXHandlerInit (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the default SAX2 handler</p>
+<p>DEPRECATED: This function is a no-op. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the default SAX2 handler</p>
</div>
<hr>
<div class="refsect2" lang="en">
diff --git a/doc/devhelp/libxml2-dict.html b/doc/devhelp/libxml2-dict.html
index 5a2c8835..08e914d1 100644
--- a/doc/devhelp/libxml2-dict.html
+++ b/doc/devhelp/libxml2-dict.html
@@ -66,7 +66,7 @@ The content of this structure is not made public by the API.
<a name="xmlDictCleanup"></a>xmlDictCleanup ()</h3>
<pre class="programlisting">void xmlDictCleanup (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Free the dictionary mutex. Do not call unless sure the library is not in use anymore !</p>
+<p>DEPRECATED: This function is a no-op. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -325,12 +325,12 @@ The content of this structure is not made public by the API.
<a name="xmlInitializeDict"></a>xmlInitializeDict ()</h3>
<pre class="programlisting">int xmlInitializeDict (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Do the dictionary mutex initialization.</p>
+<p>DEPRECATED: Alias for <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 if initialization was already done, and 1 if that call led to the initialization</td>
+<td></td>
</tr></tbody>
</table></div>
</div>
diff --git a/doc/devhelp/libxml2-encoding.html b/doc/devhelp/libxml2-encoding.html
index cc9e2fb6..2eb52b3d 100644
--- a/doc/devhelp/libxml2-encoding.html
+++ b/doc/devhelp/libxml2-encoding.html
@@ -292,7 +292,7 @@ void <a href="#xmlRegisterCharEncodingHandler">xmlRegisterCharEncodingHandler</a
<a name="xmlCharEncFirstLine"></a>xmlCharEncFirstLine ()</h3>
<pre class="programlisting">int xmlCharEncFirstLine (<a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> * handler, <br> <a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> out, <br> <a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> in)<br>
</pre>
-<p>Front-end for the encoding handler input function, but handle only the very first line, i.e. limit itself to 45 chars.</p>
+<p>DEPERECATED: Don't use.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -310,7 +310,7 @@ void <a href="#xmlRegisterCharEncodingHandler">xmlRegisterCharEncodingHandler</a
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can't fit into the encoding we want), or</td>
+<td></td>
</tr>
</tbody>
</table></div>
@@ -441,7 +441,7 @@ void <a href="#xmlRegisterCharEncodingHandler">xmlRegisterCharEncodingHandler</a
<a name="xmlFindCharEncodingHandler"></a>xmlFindCharEncodingHandler ()</h3>
<pre class="programlisting"><a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> xmlFindCharEncodingHandler (const char * name)<br>
</pre>
-<p>Search in the registered set the handler able to read/write that encoding.</p>
+<p>Search in the registered set the handler able to read/write that encoding or create a new one.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -525,7 +525,7 @@ void <a href="#xmlRegisterCharEncodingHandler">xmlRegisterCharEncodingHandler</a
<a name="xmlInitCharEncodingHandlers"></a>xmlInitCharEncodingHandlers ()</h3>
<pre class="programlisting">void xmlInitCharEncodingHandlers (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the char encoding support, it registers the default encoding supported. NOTE: while public, this function usually doesn't need to be called in normal processing.</p>
+<p>DEPRECATED: Alias for <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>.</p>
</div>
<hr>
<div class="refsect2" lang="en">
diff --git a/doc/devhelp/libxml2-globals.html b/doc/devhelp/libxml2-globals.html
index ea7696de..0c1eb574 100644
--- a/doc/devhelp/libxml2-globals.html
+++ b/doc/devhelp/libxml2-globals.html
@@ -455,7 +455,7 @@ const char * <a href="#xmlThrDefTreeIndentString">xmlThrDefTreeIndentString</a>
<a name="xmlCleanupGlobals"></a>xmlCleanupGlobals ()</h3>
<pre class="programlisting">void xmlCleanupGlobals (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Additional cleanup for multi-threading</p>
+<p>DEPRECATED: This function is a no-op. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -484,7 +484,7 @@ const char * <a href="#xmlThrDefTreeIndentString">xmlThrDefTreeIndentString</a>
<a name="xmlInitGlobals"></a>xmlInitGlobals ()</h3>
<pre class="programlisting">void xmlInitGlobals (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Additional initialisation for multi-threading</p>
+<p>DEPRECATED: Alias for <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>.</p>
</div>
<hr>
<div class="refsect2" lang="en">
diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html
index bc37b594..07410f11 100644
--- a/doc/devhelp/libxml2-parser.html
+++ b/doc/devhelp/libxml2-parser.html
@@ -98,7 +98,7 @@ int <a href="#xmlLineNumbersDefault">xmlLineNumbersDefault</a> (int val);
<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="#xmlLoadExternalEntity">xmlLoadExternalEntity</a> (const char * URL, <br> const char * ID, <br> <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="#xmlNewIOInputStream">xmlNewIOInputStream</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br> <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="#xmlNewParserCtxt">xmlNewParserCtxt</a> (void);
-<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="#xmlNewSAXParserCtxt">xmlNewSAXParserCtxt</a> (<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br> void * userData);
+<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> <a href="#xmlNewSAXParserCtxt">xmlNewSAXParserCtxt</a> (const <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * sax, <br> void * userData);
int <a href="#xmlParseBalancedChunkMemory">xmlParseBalancedChunkMemory</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br> void * user_data, <br> int depth, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst);
int <a href="#xmlParseBalancedChunkMemoryRecover">xmlParseBalancedChunkMemoryRecover</a> (<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br> void * user_data, <br> int depth, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst, <br> int recover);
int <a href="#xmlParseChunk">xmlParseChunk</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const char * chunk, <br> int size, <br> int terminate);
@@ -1964,9 +1964,9 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en">
<h3>
<a name="xmlNewSAXParserCtxt"></a>xmlNewSAXParserCtxt ()</h3>
-<pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlNewSAXParserCtxt (<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br> void * userData)<br>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> xmlNewSAXParserCtxt (const <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * sax, <br> void * userData)<br>
</pre>
-<p>Allocate and initialize a new SAX parser context.</p>
+<p>Allocate and initialize a new SAX parser context. If userData is NULL, the parser context will be passed as user data.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1980,7 +1980,7 @@ The content of this structure is not made public by the API.
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> or NULL</td>
+<td>the <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> or NULL if memory allocation failed.</td>
</tr>
</tbody>
</table></div>
diff --git a/doc/devhelp/libxml2-parserInternals.html b/doc/devhelp/libxml2-parserInternals.html
index b119aa46..2a0d6d5b 100644
--- a/doc/devhelp/libxml2-parserInternals.html
+++ b/doc/devhelp/libxml2-parserInternals.html
@@ -42,10 +42,8 @@
#define <a href="#IS_LETTER_CH">IS_LETTER_CH</a>(c);
#define <a href="#IS_PUBIDCHAR">IS_PUBIDCHAR</a>(c);
#define <a href="#IS_PUBIDCHAR_CH">IS_PUBIDCHAR_CH</a>(c);
-#define <a href="#MOVETO_ENDTAG">MOVETO_ENDTAG</a>(p);
-#define <a href="#MOVETO_STARTTAG">MOVETO_STARTTAG</a>(p);
-#define <a href="#SKIP_EOL">SKIP_EOL</a>(p);
#define <a href="#XML_MAX_DICTIONARY_LIMIT">XML_MAX_DICTIONARY_LIMIT</a>;
+#define <a href="#XML_MAX_HUGE_LENGTH">XML_MAX_HUGE_LENGTH</a>;
#define <a href="#XML_MAX_LOOKUP_LIMIT">XML_MAX_LOOKUP_LIMIT</a>;
#define <a href="#XML_MAX_NAMELEN">XML_MAX_NAMELEN</a>;
#define <a href="#XML_MAX_NAME_LENGTH">XML_MAX_NAME_LENGTH</a>;
@@ -70,7 +68,6 @@ int <a href="#xmlCopyCharMultiByte">xmlCopyCharMultiByte</a> (<a href="libxml2-
int <a href="#xmlCurrentChar">xmlCurrentChar</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> int * len);
<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);
typedef void <a href="#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> (<a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> ent, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> firstNode, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> lastNode);
-void <a href="#xmlErrMemory">xmlErrMemory</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const char * extra);
void <a href="#xmlFreeInputStream">xmlFreeInputStream</a> (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
void <a href="#xmlHandleEntity">xmlHandleEntity</a> (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> entity);
int <a href="#xmlIsLetter">xmlIsLetter</a> (int c);
@@ -444,55 +441,18 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<hr>
<div class="refsect2" lang="en">
<h3>
-<a name="MOVETO_ENDTAG">Macro </a>MOVETO_ENDTAG</h3>
-<pre class="programlisting">#define <a href="#MOVETO_ENDTAG">MOVETO_ENDTAG</a>(p);
-</pre>
-<p>Skips to the next '&gt;' char.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>p</tt></i>:</span></td>
-<td>and UTF8 string pointer</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="MOVETO_STARTTAG">Macro </a>MOVETO_STARTTAG</h3>
-<pre class="programlisting">#define <a href="#MOVETO_STARTTAG">MOVETO_STARTTAG</a>(p);
-</pre>
-<p>Skips to the next '&lt;' char.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>p</tt></i>:</span></td>
-<td>and UTF8 string pointer</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="SKIP_EOL">Macro </a>SKIP_EOL</h3>
-<pre class="programlisting">#define <a href="#SKIP_EOL">SKIP_EOL</a>(p);
+<a name="XML_MAX_DICTIONARY_LIMIT">Macro </a>XML_MAX_DICTIONARY_LIMIT</h3>
+<pre class="programlisting">#define <a href="#XML_MAX_DICTIONARY_LIMIT">XML_MAX_DICTIONARY_LIMIT</a>;
</pre>
-<p>Skips the end of line chars.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>p</tt></i>:</span></td>
-<td>and UTF8 string pointer</td>
-</tr></tbody>
-</table></div>
+<p>Maximum size allowed by the parser for a dictionary by default This is not a limitation of the parser but a safety boundary feature, use <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> option to override it. Introduced in 2.9.0</p>
</div>
<hr>
<div class="refsect2" lang="en">
<h3>
-<a name="XML_MAX_DICTIONARY_LIMIT">Macro </a>XML_MAX_DICTIONARY_LIMIT</h3>
-<pre class="programlisting">#define <a href="#XML_MAX_DICTIONARY_LIMIT">XML_MAX_DICTIONARY_LIMIT</a>;
+<a name="XML_MAX_HUGE_LENGTH">Macro </a>XML_MAX_HUGE_LENGTH</h3>
+<pre class="programlisting">#define <a href="#XML_MAX_HUGE_LENGTH">XML_MAX_HUGE_LENGTH</a>;
</pre>
-<p>Maximum size allowed by the parser for a dictionary by default This is not a limitation of the parser but a safety boundary feature, use <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> option to override it. Introduced in 2.9.0</p>
+<p>Maximum size allowed when <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> is set.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -667,7 +627,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="namePop"></a>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>
+<p>DEPRECATED: Internal function, do not use. Pops the top element name from the name stack</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -688,7 +648,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="namePush"></a>namePush ()</h3>
<pre class="programlisting">int namePush (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
</pre>
-<p>Pushes a new element name on top of the name stack</p>
+<p>DEPRECATED: Internal function, do not use. Pushes a new element name on top of the name stack</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -713,7 +673,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="nodePop"></a>nodePop ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> nodePop (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>Pops the top element node from the node stack</p>
+<p>DEPRECATED: Internal function, do not use. Pops the top element node from the node stack</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -734,7 +694,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="nodePush"></a>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>
+<p>DEPRECATED: Internal function, do not use. Pushes a new element node on top of the node stack</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -759,7 +719,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlCheckLanguageID"></a>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])+ The current REC <a href="libxml2-SAX.html#reference">reference</a> the successors of RFC 1766, currently 5646 http://www.rfc-editor.org/rfc/rfc5646.txt langtag = language ["-" script] ["-" region] *("-" variant) *("-" extension) ["-" privateuse] language = 2*3ALPHA ; shortest ISO 639 code ["-" extlang] ; sometimes followed by ; extended language subtags / 4ALPHA ; or reserved for future use / 5*8ALPHA ; or registered language subtag extlang = 3ALPHA ; selected ISO 639 codes *2("-" 3ALPHA) ; permanently reserved script = 4ALPHA ; ISO 15924 code region = 2ALPHA ; ISO 3166-1 code / 3DIGIT ; UN M.49 code variant = 5*8alphanum ; registered variants / (DIGIT 3alphanum) extension = singleton 1*("-" (2*8alphanum)) ; Single alphanumerics ; "x" reserved for private use singleton = DIGIT ; 0 - 9 / %x41-57 ; A - W / %x59-5A ; Y - Z / %x61-77 ; a - w / %x79-7A ; y - z it sounds right to still allow Irregular i-xxx IANA and user codes too The parser below doesn't try to cope with extension or privateuse that could be added but that's not interoperable anyway</p>
+<p>DEPRECATED: Internal function, do not use. 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])+ The current REC <a href="libxml2-SAX.html#reference">reference</a> the successors of RFC 1766, currently 5646 http://www.rfc-editor.org/rfc/rfc5646.txt langtag = language ["-" script] ["-" region] *("-" variant) *("-" extension) ["-" privateuse] language = 2*3ALPHA ; shortest ISO 639 code ["-" extlang] ; sometimes followed by ; extended language subtags / 4ALPHA ; or reserved for future use / 5*8ALPHA ; or registered language subtag extlang = 3ALPHA ; selected ISO 639 codes *2("-" 3ALPHA) ; permanently reserved script = 4ALPHA ; ISO 15924 code region = 2ALPHA ; ISO 3166-1 code / 3DIGIT ; UN M.49 code variant = 5*8alphanum ; registered variants / (DIGIT 3alphanum) extension = singleton 1*("-" (2*8alphanum)) ; Single alphanumerics ; "x" reserved for private use singleton = DIGIT ; 0 - 9 / %x41-57 ; A - W / %x59-5A ; Y - Z / %x61-77 ; a - w / %x79-7A ; y - z it sounds right to still allow Irregular i-xxx IANA and user codes too The parser below doesn't try to cope with extension or privateuse that could be added but that's not interoperable anyway</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -937,7 +897,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlCurrentChar"></a>xmlCurrentChar ()</h3>
<pre class="programlisting">int xmlCurrentChar (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> int * len)<br>
</pre>
-<p>The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence "#xD#xA" or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)</p>
+<p>DEPRECATED: Internal function, do not use. The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence "#xD#xA" or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1001,27 +961,6 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<hr>
<div class="refsect2" lang="en">
<h3>
-<a name="xmlErrMemory"></a>xmlErrMemory ()</h3>
-<pre class="programlisting">void xmlErrMemory (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const char * extra)<br>
-</pre>
-<p>Handle a redefinition of <a href="libxml2-SAX.html#attribute">attribute</a> error</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>extra</tt></i>:</span></td>
-<td>extra information</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
<a name="xmlFreeInputStream"></a>xmlFreeInputStream ()</h3>
<pre class="programlisting">void xmlFreeInputStream (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br>
</pre>
@@ -1150,7 +1089,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlNewEntityInputStream"></a>xmlNewEntityInputStream ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> xmlNewEntityInputStream (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> entity)<br>
</pre>
-<p>Create a new input stream based on an <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a></p>
+<p>DEPRECATED: Internal function, do not use. Create a new input stream based on an <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a></p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1246,7 +1185,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlNextChar"></a>xmlNextChar ()</h3>
<pre class="programlisting">void xmlNextChar (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>Skip to the next char input char.</p>
+<p>DEPRECATED: Internal function, do not use. Skip to the next char input char.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1261,7 +1200,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseAttValue"></a>xmlParseAttValue ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseAttValue (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse a value for an <a href="libxml2-SAX.html#attribute">attribute</a> Note: the parser won't do substitution of entities here, this will be handled later in <a href="libxml2-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a> [10] AttValue ::= '"' ([^&lt;&amp;"] | Reference)* '"' | "'" ([^&lt;&amp;'] | Reference)* "'" 3.3.3 Attribute-Value Normalization: Before the value of an <a href="libxml2-SAX.html#attribute">attribute</a> is passed to the application or checked for validity, the XML processor must normalize it as follows: - a character <a href="libxml2-SAX.html#reference">reference</a> is processed by appending the referenced character to the <a href="libxml2-SAX.html#attribute">attribute</a> value - an entity <a href="libxml2-SAX.html#reference">reference</a> is processed by recursively processing the replacement text of the entity - a whitespace character (#x20, #xD, #xA, #x9) is processed by appending #x20 to the normalized value, except that only a single #x20 is appended for a "#xD#xA" sequence that is part of an external parsed entity or the literal entity value of an internal parsed entity - other <a href="libxml2-SAX.html#characters">characters</a> are processed by appending them to the normalized value If the declared value is not CDATA, then the XML processor must further process the normalized <a href="libxml2-SAX.html#attribute">attribute</a> value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) <a href="libxml2-SAX.html#characters">characters</a> by a single space (#x20) character. All attributes for which no declaration has been read should be treated by a non-validating parser as if declared CDATA.</p>
+<p>DEPRECATED: Internal function, don't use. parse a value for an <a href="libxml2-SAX.html#attribute">attribute</a> Note: the parser won't do substitution of entities here, this will be handled later in <a href="libxml2-tree.html#xmlStringGetNodeList">xmlStringGetNodeList</a> [10] AttValue ::= '"' ([^&lt;&amp;"] | Reference)* '"' | "'" ([^&lt;&amp;'] | Reference)* "'" 3.3.3 Attribute-Value Normalization: Before the value of an <a href="libxml2-SAX.html#attribute">attribute</a> is passed to the application or checked for validity, the XML processor must normalize it as follows: - a character <a href="libxml2-SAX.html#reference">reference</a> is processed by appending the referenced character to the <a href="libxml2-SAX.html#attribute">attribute</a> value - an entity <a href="libxml2-SAX.html#reference">reference</a> is processed by recursively processing the replacement text of the entity - a whitespace character (#x20, #xD, #xA, #x9) is processed by appending #x20 to the normalized value, except that only a single #x20 is appended for a "#xD#xA" sequence that is part of an external parsed entity or the literal entity value of an internal parsed entity - other <a href="libxml2-SAX.html#characters">characters</a> are processed by appending them to the normalized value If the declared value is not CDATA, then the XML processor must further process the normalized <a href="libxml2-SAX.html#attribute">attribute</a> value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) <a href="libxml2-SAX.html#characters">characters</a> by a single space (#x20) character. All attributes for which no declaration has been read should be treated by a non-validating parser as if declared CDATA.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1282,7 +1221,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseAttribute"></a>xmlParseAttribute ()</h3>
<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseAttribute (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** value)<br>
</pre>
-<p>DEPRECATED: Don't use. parse an <a href="libxml2-SAX.html#attribute">attribute</a> [41] Attribute ::= Name Eq AttValue [ WFC: No External Entity References ] Attribute values cannot contain direct or indirect entity references to external entities. [ WFC: No &lt; in Attribute Values ] The replacement text of any entity referred to directly or indirectly in an <a href="libxml2-SAX.html#attribute">attribute</a> value (other than "&amp;lt;") must not contain a &lt;. [ VC: Attribute Value Type ] The <a href="libxml2-SAX.html#attribute">attribute</a> must have been declared; the value must be of the type declared for it. [25] Eq ::= S? '=' S? With namespace: [NS 11] Attribute ::= QName Eq AttValue Also the case QName == xmlns:??? is handled independently as a namespace definition.</p>
+<p>DEPRECATED: Internal function, don't use. parse an <a href="libxml2-SAX.html#attribute">attribute</a> [41] Attribute ::= Name Eq AttValue [ WFC: No External Entity References ] Attribute values cannot contain direct or indirect entity references to external entities. [ WFC: No &lt; in Attribute Values ] The replacement text of any entity referred to directly or indirectly in an <a href="libxml2-SAX.html#attribute">attribute</a> value (other than "&amp;lt;") must not contain a &lt;. [ VC: Attribute Value Type ] The <a href="libxml2-SAX.html#attribute">attribute</a> must have been declared; the value must be of the type declared for it. [25] Eq ::= S? '=' S? With namespace: [NS 11] Attribute ::= QName Eq AttValue Also the case QName == xmlns:??? is handled independently as a namespace definition.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1308,7 +1247,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseAttributeListDecl"></a>xmlParseAttributeListDecl ()</h3>
<pre class="programlisting">void xmlParseAttributeListDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>: parse the Attribute list def for an element [52] AttlistDecl ::= '&lt;!ATTLIST' S Name AttDef* S? '&gt;' [53] AttDef ::= S Name S AttType S DefaultDecl</p>
+<p>DEPRECATED: Internal function, don't use. Parse an <a href="libxml2-SAX.html#attribute">attribute</a> list declaration for an element. Always consumes '&lt;!'. [52] AttlistDecl ::= '&lt;!ATTLIST' S Name AttDef* S? '&gt;' [53] AttDef ::= S Name S AttType S DefaultDecl</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1323,7 +1262,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseAttributeType"></a>xmlParseAttributeType ()</h3>
<pre class="programlisting">int xmlParseAttributeType (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> * tree)<br>
</pre>
-<p>parse the Attribute list def for an element [54] AttType ::= StringType | TokenizedType | EnumeratedType [55] StringType ::= 'CDATA' [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS' Validity constraints for <a href="libxml2-SAX.html#attribute">attribute</a> values syntax are checked in xmlValidateAttributeValue() [ VC: ID ] Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them. [ VC: One ID per Element Type ] No element type may have more than one ID <a href="libxml2-SAX.html#attribute">attribute</a> specified. [ VC: ID Attribute Default ] An ID <a href="libxml2-SAX.html#attribute">attribute</a> must have a declared default of #IMPLIED or #REQUIRED. [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each IDREF Name must match the value of an ID <a href="libxml2-SAX.html#attribute">attribute</a> on some element in the XML document; i.e. IDREF values must match the value of some ID <a href="libxml2-SAX.html#attribute">attribute</a>. [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names; each Entity Name must match the name of an unparsed entity declared in the DTD. [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
+<p>DEPRECATED: Internal function, don't use. parse the Attribute list def for an element [54] AttType ::= StringType | TokenizedType | EnumeratedType [55] StringType ::= 'CDATA' [56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | 'NMTOKENS' Validity constraints for <a href="libxml2-SAX.html#attribute">attribute</a> values syntax are checked in xmlValidateAttributeValue() [ VC: ID ] Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them. [ VC: One ID per Element Type ] No element type may have more than one ID <a href="libxml2-SAX.html#attribute">attribute</a> specified. [ VC: ID Attribute Default ] An ID <a href="libxml2-SAX.html#attribute">attribute</a> must have a declared default of #IMPLIED or #REQUIRED. [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each IDREF Name must match the value of an ID <a href="libxml2-SAX.html#attribute">attribute</a> on some element in the XML document; i.e. IDREF values must match the value of some ID <a href="libxml2-SAX.html#attribute">attribute</a>. [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names; each Entity Name must match the name of an unparsed entity declared in the DTD. [ 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>
@@ -1348,7 +1287,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseCDSect"></a>xmlParseCDSect ()</h3>
<pre class="programlisting">void xmlParseCDSect (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>Parse escaped pure raw content. [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '&lt;![CDATA[' [20] Data ::= (Char* - (Char* ']]&gt;' Char*)) [21] CDEnd ::= ']]&gt;'</p>
+<p>DEPRECATED: Internal function, don't use. Parse escaped pure raw content. Always consumes '&lt;!['. [18] CDSect ::= CDStart CData CDEnd [19] CDStart ::= '&lt;![CDATA[' [20] Data ::= (Char* - (Char* ']]&gt;' Char*)) [21] CDEnd ::= ']]&gt;'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1363,7 +1302,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseCharData"></a>xmlParseCharData ()</h3>
<pre class="programlisting">void xmlParseCharData (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> int cdata)<br>
</pre>
-<p>parse a CharData section. if we are within a CDATA section ']]&gt;' marks an end of section. The right angle bracket (&gt;) may be represented using the string "&amp;gt;", and must, for compatibility, be escaped using "&amp;gt;" or a character <a href="libxml2-SAX.html#reference">reference</a> when it appears in the string "]]&gt;" in content, when that string is not marking the end of a CDATA section. [14] CharData ::= [^&lt;&amp;]* - ([^&lt;&amp;]* ']]&gt;' [^&lt;&amp;]*)</p>
+<p>DEPRECATED: Internal function, don't use. Parse character data. Always makes progress if the first char isn't '&lt;' or '&amp;'. if we are within a CDATA section ']]&gt;' marks an end of section. The right angle bracket (&gt;) may be represented using the string "&amp;gt;", and must, for compatibility, be escaped using "&amp;gt;" or a character <a href="libxml2-SAX.html#reference">reference</a> when it appears in the string "]]&gt;" in content, when that string is not marking the end of a CDATA section. [14] CharData ::= [^&lt;&amp;]* - ([^&lt;&amp;]* ']]&gt;' [^&lt;&amp;]*)</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1373,7 +1312,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
</tr>
<tr>
<td><span class="term"><i><tt>cdata</tt></i>:</span></td>
-<td>int indicating whether we are within a CDATA section</td>
+<td>unused</td>
</tr>
</tbody>
</table></div>
@@ -1384,7 +1323,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseCharRef"></a>xmlParseCharRef ()</h3>
<pre class="programlisting">int xmlParseCharRef (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse Reference declarations [66] CharRef ::= '&amp;#' [0-9]+ ';' | '&amp;#x' [0-9a-fA-F]+ ';' [ WFC: Legal Character ] Characters referred to using character references must match the production for Char.</p>
+<p>DEPRECATED: Internal function, don't use. Parse a numeric character <a href="libxml2-SAX.html#reference">reference</a>. Always consumes '&amp;'. [66] CharRef ::= '&amp;#' [0-9]+ ';' | '&amp;#x' [0-9a-fA-F]+ ';' [ WFC: Legal Character ] Characters referred to using character references must match the production for Char.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1405,7 +1344,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseComment"></a>xmlParseComment ()</h3>
<pre class="programlisting">void xmlParseComment (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>Skip an XML (SGML) <a href="libxml2-SAX.html#comment">comment</a> &lt;!-- .... --&gt; The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '&lt;!--' ((Char - '-') | ('-' (Char - '-')))* '--&gt;'</p>
+<p>DEPRECATED: Internal function, don't use. Parse an XML (SGML) <a href="libxml2-SAX.html#comment">comment</a>. Always consumes '&lt;!'. The spec says that "For compatibility, the string "--" (double-hyphen) must not occur within comments. " [15] Comment ::= '&lt;!--' ((Char - '-') | ('-' (Char - '-')))* '--&gt;'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1435,7 +1374,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseDefaultDecl"></a>xmlParseDefaultDecl ()</h3>
<pre class="programlisting">int xmlParseDefaultDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** value)<br>
</pre>
-<p>Parse an <a href="libxml2-SAX.html#attribute">attribute</a> default declaration [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) [ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the <a href="libxml2-SAX.html#attribute">attribute</a> must be specified for all elements of the type in the attribute-list declaration. [ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared <a href="libxml2-SAX.html#attribute">attribute</a> type c.f. xmlValidateAttributeDecl() [ VC: Fixed Attribute Default ] if an <a href="libxml2-SAX.html#attribute">attribute</a> has a default value declared with the #FIXED keyword, instances of that <a href="libxml2-SAX.html#attribute">attribute</a> must match the default value. [ WFC: No &lt; in Attribute Values ] handled in xmlParseAttValue()</p>
+<p>DEPRECATED: Internal function, don't use. Parse an <a href="libxml2-SAX.html#attribute">attribute</a> default declaration [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) [ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the <a href="libxml2-SAX.html#attribute">attribute</a> must be specified for all elements of the type in the attribute-list declaration. [ VC: Attribute Default Legal ] The declared default value must meet the lexical constraints of the declared <a href="libxml2-SAX.html#attribute">attribute</a> type c.f. xmlValidateAttributeDecl() [ VC: Fixed Attribute Default ] if an <a href="libxml2-SAX.html#attribute">attribute</a> has a default value declared with the #FIXED keyword, instances of that <a href="libxml2-SAX.html#attribute">attribute</a> must match the default value. [ WFC: No &lt; in Attribute Values ] handled in xmlParseAttValue()</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1461,7 +1400,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseDocTypeDecl"></a>xmlParseDocTypeDecl ()</h3>
<pre class="programlisting">void xmlParseDocTypeDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse a DOCTYPE declaration [28] doctypedecl ::= '&lt;!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '&gt;' [ VC: Root Element Type ] The Name in the document type declaration must match the element type of the root element.</p>
+<p>DEPRECATED: Internal function, don't use. parse a DOCTYPE declaration [28] doctypedecl ::= '&lt;!DOCTYPE' S Name (S ExternalID)? S? ('[' (markupdecl | PEReference | S)* ']' S?)? '&gt;' [ VC: Root Element Type ] The Name in the document type declaration must match the element type of the root element.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1476,7 +1415,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseElement"></a>xmlParseElement ()</h3>
<pre class="programlisting">void xmlParseElement (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML element [39] element ::= EmptyElemTag | STag content ETag [ WFC: Element Type Match ] The Name in an element's end-tag must match the element type in the start-tag.</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML element [39] element ::= EmptyElemTag | STag content ETag [ WFC: Element Type Match ] The Name in an element's end-tag must match the element type in the start-tag.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1491,7 +1430,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseElementChildrenContentDecl"></a>xmlParseElementChildrenContentDecl ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> xmlParseElementChildrenContentDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> int inputchk)<br>
</pre>
-<p>parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in <a href="libxml2-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a> [47] children ::= (choice | seq) ('?' | '*' | '+')? [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')? [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')' [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')' [ VC: Proper Group/PE Nesting ] applies to [49] and [50] TODO Parameter-entity replacement text must be properly nested with parenthesized groups. That is to say, if either of the opening or closing parentheses in a choice, seq, or Mixed construct is contained in the replacement text for a parameter entity, both must be contained in the same replacement text. For interoperability, if a parameter-entity <a href="libxml2-SAX.html#reference">reference</a> appears in a choice, seq, or Mixed construct, its replacement text should not be empty, and neither the first nor last non-blank character of the replacement text should be a connector (| or ,).</p>
+<p>DEPRECATED: Internal function, don't use. parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in <a href="libxml2-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a> [47] children ::= (choice | seq) ('?' | '*' | '+')? [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')? [49] choice ::= '(' S? cp ( S? '|' S? cp )* S? ')' [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')' [ VC: Proper Group/PE Nesting ] applies to [49] and [50] TODO Parameter-entity replacement text must be properly nested with parenthesized groups. That is to say, if either of the opening or closing parentheses in a choice, seq, or Mixed construct is contained in the replacement text for a parameter entity, both must be contained in the same replacement text. For interoperability, if a parameter-entity <a href="libxml2-SAX.html#reference">reference</a> appears in a choice, seq, or Mixed construct, its replacement text should not be empty, and neither the first nor last non-blank character of the replacement text should be a connector (| or ,).</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1516,7 +1455,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseElementContentDecl"></a>xmlParseElementContentDecl ()</h3>
<pre class="programlisting">int xmlParseElementContentDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br> <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> * result)<br>
</pre>
-<p>parse the declaration for an Element content either Mixed or Children, the cases EMPTY and ANY are handled directly in <a href="libxml2-parserInternals.html#xmlParseElementDecl">xmlParseElementDecl</a> [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children</p>
+<p>DEPRECATED: Internal function, don't use. parse the declaration for an Element content either Mixed or Children, the cases EMPTY and ANY are handled directly in <a href="libxml2-parserInternals.html#xmlParseElementDecl">xmlParseElementDecl</a> [46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1545,7 +1484,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseElementDecl"></a>xmlParseElementDecl ()</h3>
<pre class="programlisting">int xmlParseElementDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an Element declaration. [45] elementdecl ::= '&lt;!ELEMENT' S Name S contentspec S? '&gt;' [ VC: Unique Element Type Declaration ] No element type may be declared more than once</p>
+<p>DEPRECATED: Internal function, don't use. Parse an element declaration. Always consumes '&lt;!'. [45] elementdecl ::= '&lt;!ELEMENT' S Name S contentspec S? '&gt;' [ VC: Unique Element Type Declaration ] No element type may be declared more than once</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1566,7 +1505,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseElementMixedContentDecl"></a>xmlParseElementMixedContentDecl ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> xmlParseElementMixedContentDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> int inputchk)<br>
</pre>
-<p>parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in <a href="libxml2-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a> [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')' [ VC: Proper Group/PE Nesting ] applies to [51] too (see [49]) [ VC: No Duplicate Types ] The same name must not appear more than once in a single mixed-content declaration.</p>
+<p>DEPRECATED: Internal function, don't use. parse the declaration for a Mixed Element content The leading '(' and spaces have been skipped in <a href="libxml2-parserInternals.html#xmlParseElementContentDecl">xmlParseElementContentDecl</a> [51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' | '(' S? '#PCDATA' S? ')' [ VC: Proper Group/PE Nesting ] applies to [51] too (see [49]) [ VC: No Duplicate Types ] The same name must not appear more than once in a single mixed-content declaration.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1591,7 +1530,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEncName"></a>xmlParseEncName ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseEncName (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse the XML encoding name [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*</p>
+<p>DEPRECATED: Internal function, don't use. parse the XML encoding name [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1612,7 +1551,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEncodingDecl"></a>xmlParseEncodingDecl ()</h3>
<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseEncodingDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse the XML encoding declaration [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'") this setups the conversion filters.</p>
+<p>DEPRECATED: Internal function, don't use. parse the XML encoding declaration [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'") this setups the conversion filters.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1633,7 +1572,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEndTag"></a>xmlParseEndTag ()</h3>
<pre class="programlisting">void xmlParseEndTag (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an end of tag [42] ETag ::= '&lt;/' Name S? '&gt;' With namespace [NS 9] ETag ::= '&lt;/' QName S? '&gt;'</p>
+<p>DEPRECATED: Internal function, don't use. parse an end of tag [42] ETag ::= '&lt;/' Name S? '&gt;' With namespace [NS 9] ETag ::= '&lt;/' QName S? '&gt;'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1648,7 +1587,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEntityDecl"></a>xmlParseEntityDecl ()</h3>
<pre class="programlisting">void xmlParseEntityDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse &lt;!ENTITY declarations [70] EntityDecl ::= GEDecl | PEDecl [71] GEDecl ::= '&lt;!ENTITY' S Name S EntityDef S? '&gt;' [72] PEDecl ::= '&lt;!ENTITY' S '%' S Name S PEDef S? '&gt;' [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) [74] PEDef ::= EntityValue | ExternalID [76] NDataDecl ::= S 'NDATA' S Name [ VC: Notation Declared ] The Name must match the declared name of a notation.</p>
+<p>DEPRECATED: Internal function, don't use. Parse an entity declaration. Always consumes '&lt;!'. [70] EntityDecl ::= GEDecl | PEDecl [71] GEDecl ::= '&lt;!ENTITY' S Name S EntityDef S? '&gt;' [72] PEDecl ::= '&lt;!ENTITY' S '%' S Name S PEDef S? '&gt;' [73] EntityDef ::= EntityValue | (ExternalID NDataDecl?) [74] PEDef ::= EntityValue | ExternalID [76] NDataDecl ::= S 'NDATA' S Name [ VC: Notation Declared ] The Name must match the declared name of a notation.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1663,7 +1602,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEntityRef"></a>xmlParseEntityRef ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> xmlParseEntityRef (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse ENTITY references declarations [68] EntityRef ::= '&amp;' 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 <a href="libxml2-SAX.html#reference">reference</a> 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 <a href="libxml2-SAX.html#reference">reference</a> to it. Similarly, the declaration of a general entity must precede any <a href="libxml2-SAX.html#reference">reference</a> 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'. [ WFC: Parsed Entity ] An entity <a href="libxml2-SAX.html#reference">reference</a> must not contain the name of an unparsed entity</p>
+<p>DEPRECATED: Internal function, don't use. Parse an entitiy <a href="libxml2-SAX.html#reference">reference</a>. Always consumes '&amp;'. [68] EntityRef ::= '&amp;' 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 <a href="libxml2-SAX.html#reference">reference</a> 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 <a href="libxml2-SAX.html#reference">reference</a> to it. Similarly, the declaration of a general entity must precede any <a href="libxml2-SAX.html#reference">reference</a> 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'. [ WFC: Parsed Entity ] An entity <a href="libxml2-SAX.html#reference">reference</a> must not contain the name of an unparsed entity</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1684,7 +1623,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEntityValue"></a>xmlParseEntityValue ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseEntityValue (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** orig)<br>
</pre>
-<p>parse a value for ENTITY declarations [9] EntityValue ::= '"' ([^%&amp;"] | PEReference | Reference)* '"' | "'" ([^%&amp;'] | PEReference | Reference)* "'"</p>
+<p>DEPRECATED: Internal function, don't use. parse a value for ENTITY declarations [9] EntityValue ::= '"' ([^%&amp;"] | PEReference | Reference)* '"' | "'" ([^%&amp;'] | PEReference | Reference)* "'"</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1709,7 +1648,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEnumeratedType"></a>xmlParseEnumeratedType ()</h3>
<pre class="programlisting">int xmlParseEnumeratedType (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> * tree)<br>
</pre>
-<p>parse an Enumerated <a href="libxml2-SAX.html#attribute">attribute</a> type. [57] EnumeratedType ::= NotationType | Enumeration [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'</p>
+<p>DEPRECATED: Internal function, don't use. parse an Enumerated <a href="libxml2-SAX.html#attribute">attribute</a> type. [57] EnumeratedType ::= NotationType | Enumeration [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1736,7 +1675,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseEnumerationType"></a>xmlParseEnumerationType ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> xmlParseEnumerationType (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an Enumeration <a href="libxml2-SAX.html#attribute">attribute</a> type. [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' [ VC: Enumeration ] Values of this type must match one of the Nmtoken tokens in the declaration</p>
+<p>DEPRECATED: Internal function, don't use. parse an Enumeration <a href="libxml2-SAX.html#attribute">attribute</a> type. [59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' [ VC: Enumeration ] Values of this type must match one of the Nmtoken tokens in the declaration</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1757,7 +1696,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseExternalID"></a>xmlParseExternalID ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseExternalID (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** publicID, <br> int strict)<br>
</pre>
-<p>Parse an External ID or a Public ID NOTE: Productions [75] and [83] interact badly since [75] can generate 'PUBLIC' S PubidLiteral S SystemLiteral [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral [83] PublicID ::= 'PUBLIC' S PubidLiteral</p>
+<p>DEPRECATED: Internal function, don't use. Parse an External ID or a Public ID NOTE: Productions [75] and [83] interact badly since [75] can generate 'PUBLIC' S PubidLiteral S SystemLiteral [75] ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral [83] PublicID ::= 'PUBLIC' S PubidLiteral</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1811,7 +1750,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseMarkupDecl"></a>xmlParseMarkupDecl ()</h3>
<pre class="programlisting">void xmlParseMarkupDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse Markup declarations [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text. [ WFC: PEs in Internal Subset ] In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.)</p>
+<p>DEPRECATED: Internal function, don't use. Parse markup declarations. Always consumes '&lt;!' or '&lt;?'. [29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [ VC: Proper Declaration/PE Nesting ] Parameter-entity replacement text must be properly nested with markup declarations. That is to say, if either the first character or the last character of a markup declaration (markupdecl above) is contained in the replacement text for a parameter-entity reference, both must be contained in the same replacement text. [ WFC: PEs in Internal Subset ] In the internal DTD subset, parameter-entity references can occur only where markup declarations can occur, not within markup declarations. (This does not apply to references that occur in external parameter entities or to the external subset.)</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1826,7 +1765,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseMisc"></a>xmlParseMisc ()</h3>
<pre class="programlisting">void xmlParseMisc (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML Misc* optional field. [27] Misc ::= Comment | PI | S</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML Misc* optional field. [27] Misc ::= Comment | PI | S</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1841,7 +1780,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseName"></a>xmlParseName ()</h3>
<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseName (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML name. [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20 Name)*</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML name. [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (#x20 Name)*</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1877,7 +1816,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseNmtoken"></a>xmlParseNmtoken ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseNmtoken (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML Nmtoken. [7] Nmtoken ::= (NameChar)+ [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML Nmtoken. [7] Nmtoken ::= (NameChar)+ [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1898,7 +1837,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseNotationDecl"></a>xmlParseNotationDecl ()</h3>
<pre class="programlisting">void xmlParseNotationDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse a notation declaration [82] NotationDecl ::= '&lt;!NOTATION' S Name S (ExternalID | PublicID) S? '&gt;' Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral See the NOTE on xmlParseExternalID().</p>
+<p>DEPRECATED: Internal function, don't use. Parse a notation declaration. Always consumes '&lt;!'. [82] NotationDecl ::= '&lt;!NOTATION' S Name S (ExternalID | PublicID) S? '&gt;' Hence there is actually 3 choices: 'PUBLIC' S PubidLiteral 'PUBLIC' S PubidLiteral S SystemLiteral and 'SYSTEM' S SystemLiteral See the NOTE on xmlParseExternalID().</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1913,7 +1852,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseNotationType"></a>xmlParseNotationType ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> xmlParseNotationType (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an Notation <a href="libxml2-SAX.html#attribute">attribute</a> type. Note: the leading 'NOTATION' S part has already being parsed... [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' [ VC: Notation Attributes ] Values of this type must match one of the notation names included in the declaration; all notation names in the declaration must be declared.</p>
+<p>DEPRECATED: Internal function, don't use. parse an Notation <a href="libxml2-SAX.html#attribute">attribute</a> type. Note: the leading 'NOTATION' S part has already being parsed... [58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' [ VC: Notation Attributes ] Values of this type must match one of the notation names included in the declaration; all notation names in the declaration must be declared.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1934,7 +1873,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParsePEReference"></a>xmlParsePEReference ()</h3>
<pre class="programlisting">void xmlParsePEReference (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse PEReference declarations The entity content is handled directly by pushing it's content as a new input stream. [69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive <a href="libxml2-SAX.html#reference">reference</a> to itself, either directly or indirectly. [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.</p>
+<p>DEPRECATED: Internal function, don't use. Parse a parameter entity <a href="libxml2-SAX.html#reference">reference</a>. Always consumes '%'. The entity content is handled directly by pushing it's content as a new input stream. [69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive <a href="libxml2-SAX.html#reference">reference</a> to itself, either directly or indirectly. [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1949,7 +1888,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParsePI"></a>xmlParsePI ()</h3>
<pre class="programlisting">void xmlParsePI (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML Processing Instruction. [16] PI ::= '&lt;?' PITarget (S (Char* - (Char* '?&gt;' Char*)))? '?&gt;' The processing is transferred to SAX once parsed.</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML Processing Instruction. [16] PI ::= '&lt;?' PITarget (S (Char* - (Char* '?&gt;' Char*)))? '?&gt;' The processing is transferred to SAX once parsed.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -1964,7 +1903,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParsePITarget"></a>xmlParsePITarget ()</h3>
<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParsePITarget (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse the name of a PI [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))</p>
+<p>DEPRECATED: Internal function, don't use. parse the name of a PI [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1985,7 +1924,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParsePubidLiteral"></a>xmlParsePubidLiteral ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParsePubidLiteral (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML public literal [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2027,7 +1966,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseReference"></a>xmlParseReference ()</h3>
<pre class="programlisting">void xmlParseReference (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>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. or if the parser was asked to switch to that mode. [67] Reference ::= EntityRef | CharRef</p>
+<p>DEPRECATED: Internal function, don't use. 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. or if the parser was asked to switch to that mode. Always consumes '&amp;'. [67] Reference ::= EntityRef | CharRef</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -2042,7 +1981,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseSDDecl"></a>xmlParseSDDecl ()</h3>
<pre class="programlisting">int xmlParseSDDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse the XML standalone declaration [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) [ VC: Standalone Document Declaration ] TODO The standalone document declaration must have the value "no" if any external markup declarations contain declarations of: - attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or - entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or - attributes with values subject to normalization, where the <a href="libxml2-SAX.html#attribute">attribute</a> appears in the document with a value which will change as a result of normalization, or - element types with element content, if white space occurs directly within any instance of those types.</p>
+<p>DEPRECATED: Internal function, don't use. parse the XML standalone declaration [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no')'"')) [ VC: Standalone Document Declaration ] TODO The standalone document declaration must have the value "no" if any external markup declarations contain declarations of: - attributes with default values, if elements to which these attributes apply appear in the document without specifications of values for these attributes, or - entities (other than amp, lt, gt, apos, quot), if references to those entities appear in the document, or - attributes with values subject to normalization, where the <a href="libxml2-SAX.html#attribute">attribute</a> appears in the document with a value which will change as a result of normalization, or - element types with element content, if white space occurs directly within any instance of those types.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2063,7 +2002,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseStartTag"></a>xmlParseStartTag ()</h3>
<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseStartTag (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>DEPRECATED: Don't use. parse a start of tag either for rule element or EmptyElement. In both case we don't parse the tag closing chars. [40] STag ::= '&lt;' Name (S Attribute)* S? '&gt;' [ WFC: Unique Att Spec ] No <a href="libxml2-SAX.html#attribute">attribute</a> name may appear more than once in the same start-tag or empty-element tag. [44] EmptyElemTag ::= '&lt;' Name (S Attribute)* S? '/&gt;' [ WFC: Unique Att Spec ] No <a href="libxml2-SAX.html#attribute">attribute</a> name may appear more than once in the same start-tag or empty-element tag. With namespace: [NS 8] STag ::= '&lt;' QName (S Attribute)* S? '&gt;' [NS 10] EmptyElement ::= '&lt;' QName (S Attribute)* S? '/&gt;'</p>
+<p>DEPRECATED: Internal function, don't use. Parse a start tag. Always consumes '&lt;'. [40] STag ::= '&lt;' Name (S Attribute)* S? '&gt;' [ WFC: Unique Att Spec ] No <a href="libxml2-SAX.html#attribute">attribute</a> name may appear more than once in the same start-tag or empty-element tag. [44] EmptyElemTag ::= '&lt;' Name (S Attribute)* S? '/&gt;' [ WFC: Unique Att Spec ] No <a href="libxml2-SAX.html#attribute">attribute</a> name may appear more than once in the same start-tag or empty-element tag. With namespace: [NS 8] STag ::= '&lt;' QName (S Attribute)* S? '&gt;' [NS 10] EmptyElement ::= '&lt;' QName (S Attribute)* S? '/&gt;'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2084,7 +2023,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseSystemLiteral"></a>xmlParseSystemLiteral ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseSystemLiteral (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")</p>
+<p>DEPRECATED: Internal function, don't use. parse an XML Literal [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2105,7 +2044,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseTextDecl"></a>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;'</p>
+<p>DEPRECATED: Internal function, don't use. 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>
@@ -2120,7 +2059,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseVersionInfo"></a>xmlParseVersionInfo ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlParseVersionInfo (<a href="libxml2-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>
+<p>DEPRECATED: Internal function, don't use. 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>
@@ -2141,7 +2080,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseVersionNum"></a>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 ::= '1.' [0-9]+ In practice allow [0-9].[0-9]+ at that level</p>
+<p>DEPRECATED: Internal function, don't use. 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>
@@ -2162,7 +2101,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParseXMLDecl"></a>xmlParseXMLDecl ()</h3>
<pre class="programlisting">void xmlParseXMLDecl (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>parse an XML declaration header [23] XMLDecl ::= '&lt;?xml' VersionInfo EncodingDecl? SDDecl? S? '?&gt;'</p>
+<p>DEPRECATED: Internal function, don't use. 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>
@@ -2177,7 +2116,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParserHandlePEReference"></a>xmlParserHandlePEReference ()</h3>
<pre class="programlisting">void xmlParserHandlePEReference (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>[69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive <a href="libxml2-SAX.html#reference">reference</a> to itself, either directly or indirectly. [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e. - Included in literal in entity values - Included as Parameter Entity <a href="libxml2-SAX.html#reference">reference</a> within DTDs</p>
+<p>DEPRECATED: Internal function, do not use. [69] PEReference ::= '%' Name ';' [ WFC: No Recursion ] A parsed entity must not contain a recursive <a href="libxml2-SAX.html#reference">reference</a> to itself, either directly or indirectly. [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ 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 <a href="libxml2-SAX.html#reference">reference</a> to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e. - Included in literal in entity values - Included as Parameter Entity <a href="libxml2-SAX.html#reference">reference</a> within DTDs</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -2207,7 +2146,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlParserInputShrink"></a>xmlParserInputShrink ()</h3>
<pre class="programlisting">void xmlParserInputShrink (<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in)<br>
</pre>
-<p>This function removes used input for the parser.</p>
+<p>DEPRECATED: Don't use. This function removes used input for the parser.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -2304,7 +2243,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlSkipBlankChars"></a>xmlSkipBlankChars ()</h3>
<pre class="programlisting">int xmlSkipBlankChars (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
</pre>
-<p>skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.</p>
+<p>DEPRECATED: Internal function, do not use. skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2354,7 +2293,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlStringCurrentChar"></a>xmlStringCurrentChar ()</h3>
<pre class="programlisting">int xmlStringCurrentChar (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * cur, <br> int * len)<br>
</pre>
-<p>The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.</p>
+<p>DEPRECATED: Internal function, do not use. The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2383,7 +2322,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlStringDecodeEntities"></a>xmlStringDecodeEntities ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlStringDecodeEntities (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <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)<br>
</pre>
-<p>Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'</p>
+<p>DEPRECATED: Internal function, don't use. Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2425,7 +2364,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlStringLenDecodeEntities"></a>xmlStringLenDecodeEntities ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlStringLenDecodeEntities (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <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)<br>
</pre>
-<p>Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'</p>
+<p>DEPRECATED: Internal function, don't use. Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -2496,7 +2435,7 @@ int <a href="#xmlSwitchToEncoding">xmlSwitchToEncoding</a> (<a href="libxml2-tr
<a name="xmlSwitchInputEncoding"></a>xmlSwitchInputEncoding ()</h3>
<pre class="programlisting">int xmlSwitchInputEncoding (<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br> <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> handler)<br>
</pre>
-<p>DEPRECATED: Use <a href="libxml2-parserInternals.html#xmlSwitchToEncoding">xmlSwitchToEncoding</a> change the input functions when discovering the character encoding of a given entity.</p>
+<p>change the input functions when discovering the character encoding of a given entity.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
diff --git a/doc/devhelp/libxml2-threads.html b/doc/devhelp/libxml2-threads.html
index 4ab52dc2..2dcd5b05 100644
--- a/doc/devhelp/libxml2-threads.html
+++ b/doc/devhelp/libxml2-threads.html
@@ -27,7 +27,6 @@ typedef <a href="libxml2-threads.html#xmlMutex">xmlMutex</a> * <a href="#xmlMute
typedef struct _xmlRMutex <a href="#xmlRMutex">xmlRMutex</a>;
typedef <a href="libxml2-threads.html#xmlRMutex">xmlRMutex</a> * <a href="#xmlRMutexPtr">xmlRMutexPtr</a>;
void <a href="#xmlCleanupThreads">xmlCleanupThreads</a> (void);
-int <a href="#xmlDllMain">xmlDllMain</a> (void * hinstDLL, <br> unsigned long fdwReason, <br> void * lpvReserved);
void <a href="#xmlFreeMutex">xmlFreeMutex</a> (<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
void <a href="#xmlFreeRMutex">xmlFreeRMutex</a> (<a href="libxml2-threads.html#xmlRMutexPtr">xmlRMutexPtr</a> tok);
<a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> <a href="#xmlGetGlobalState">xmlGetGlobalState</a> (void);
@@ -89,36 +88,7 @@ The content of this structure is not made public by the API.
<a name="xmlCleanupThreads"></a>xmlCleanupThreads ()</h3>
<pre class="programlisting">void xmlCleanupThreads (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all. xmlCleanupThreads() is used to to cleanup all the thread related data of the libxml2 library once processing has ended. WARNING: if your application is multithreaded or has plugin support calling this may crash the application if another thread or a plugin is still using libxml2. It's sometimes very hard to guess if libxml2 is in use in the application, some libraries or plugins may use it without notice. In case of doubt abstain from calling this function or do it just before calling exit() to avoid leak reports from valgrind !</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlDllMain"></a>xmlDllMain ()</h3>
-<pre class="programlisting">int xmlDllMain (void * hinstDLL, <br> unsigned long fdwReason, <br> void * lpvReserved)<br>
-</pre>
-<p></p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>hinstDLL</tt></i>:</span></td>
-<td></td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>fdwReason</tt></i>:</span></td>
-<td></td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>lpvReserved</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>
+<p>DEPRECATED: This function is a no-op. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -126,7 +96,7 @@ The content of this structure is not made public by the API.
<a name="xmlFreeMutex"></a>xmlFreeMutex ()</h3>
<pre class="programlisting">void xmlFreeMutex (<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok)<br>
</pre>
-<p>xmlFreeMutex() is used to reclaim resources associated with a libxml2 token struct.</p>
+<p>Free a mutex.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -156,7 +126,7 @@ The content of this structure is not made public by the API.
<a name="xmlGetGlobalState"></a>xmlGetGlobalState ()</h3>
<pre class="programlisting"><a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> xmlGetGlobalState (void)<br>
</pre>
-<p>xmlGetGlobalState() is called to retrieve the global state for a thread.</p>
+<p>DEPRECATED: Internal function, do not use. xmlGetGlobalState() is called to retrieve the global state for a thread.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -171,7 +141,7 @@ The content of this structure is not made public by the API.
<a name="xmlGetThreadId"></a>xmlGetThreadId ()</h3>
<pre class="programlisting">int xmlGetThreadId (void)<br>
</pre>
-<p>xmlGetThreadId() find the current thread ID number Note that this is likely to be broken on some platforms using pthreads as the specification doesn't mandate pthread_t to be an integer type</p>
+<p>DEPRECATED: Internal function, do not use. xmlGetThreadId() find the current thread ID number Note that this is likely to be broken on some platforms using pthreads as the specification doesn't mandate pthread_t to be an integer type</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
@@ -186,7 +156,7 @@ The content of this structure is not made public by the API.
<a name="xmlInitThreads"></a>xmlInitThreads ()</h3>
<pre class="programlisting">void xmlInitThreads (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. xmlInitThreads() is used to to initialize all the thread related data of the libxml2 library.</p>
+<p>DEPRECATED: Alias for <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -194,7 +164,7 @@ The content of this structure is not made public by the API.
<a name="xmlIsMainThread"></a>xmlIsMainThread ()</h3>
<pre class="programlisting">int xmlIsMainThread (void)<br>
</pre>
-<p>xmlIsMainThread() check whether the current thread is the main thread.</p>
+<p>DEPRECATED: Internal function, do not use. xmlIsMainThread() check whether the current thread is the main thread.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
diff --git a/doc/devhelp/libxml2-tree.html b/doc/devhelp/libxml2-tree.html
index e4987c13..4d4e1ebd 100644
--- a/doc/devhelp/libxml2-tree.html
+++ b/doc/devhelp/libxml2-tree.html
@@ -459,7 +459,7 @@ The content of this structure is not made public by the API.
<pre class="programlisting">enum <a href="#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> {
<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_IMMUTABLE">XML_BUFFER_ALLOC_IMMUTABLE</a> = 3 /* immutable buffer, deprecated */
<a name="XML_BUFFER_ALLOC_IO">XML_BUFFER_ALLOC_IO</a> = 4 /* special allocation scheme used for I/O */
<a name="XML_BUFFER_ALLOC_HYBRID">XML_BUFFER_ALLOC_HYBRID</a> = 5 /* exact up to a threshold, and doubleit thereafter */
<a name="XML_BUFFER_ALLOC_BOUNDED">XML_BUFFER_ALLOC_BOUNDED</a> = 6 /* limit the upper size of the buffer */
@@ -735,7 +735,8 @@ The content of this structure is not made public by the API.
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 this is also used to count entities *
+ int flags : various flags
+ unsigned long expandedSize : expanded size
} xmlEntity;
</pre>
<p></p>
@@ -985,7 +986,7 @@ The content of this structure is not made public by the API.
<a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> freeAttrs : * the complete error information for the last error. *
<a href="libxml2-xmlerror.html#xmlError">xmlError</a> lastError
<a href="libxml2-parser.html#xmlParserMode">xmlParserMode</a> parseMode : the parser mode
- unsigned long nbentities : number of entities references
+ unsigned long nbentities : unused
unsigned long sizeentities : size of parsed entities for use by HTML non-recursive parser
<a href="libxml2-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a> * nodeInfo : Current NodeInfo
int nodeInfoNr : Depth of the parsing stack
@@ -993,6 +994,9 @@ The content of this structure is not made public by the API.
<a href="libxml2-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a> * nodeInfoTab : array of nodeInfos
int input_id : we need to label inputs
unsigned long sizeentcopy : volume of entity copy
+ int endCheckState : quote state for push parser
+ unsigned short nbErrors : number of errors
+ unsigned short nbWarnings : number of warnings
} xmlParserCtxt;
</pre>
<p></p>
@@ -1018,13 +1022,15 @@ The content of this structure is not made public by the API.
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * end : end of the array to parse
int length : length if known
int line : Current line
- int col : * NOTE: consumed is only tested for equality in the parser code, *
+ int col : Current column
unsigned long consumed : How many xmlChars already consumed
<a href="libxml2-parser.html#xmlParserInputDeallocate">xmlParserInputDeallocate</a> free : function to deallocate the base
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * encoding : the encoding string for entity
const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * version : the version string for entity
int standalone : Was that entity marked standalone
int id : an unique identifier for the entity
+ unsigned long parentConsumed : consumed bytes from parents
+ <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> entity : entity, if any
} xmlParserInput;
</pre>
<p></p>
@@ -1664,7 +1670,7 @@ The content of this structure is not made public by the API.
<a name="xmlBufferCreateStatic"></a>xmlBufferCreateStatic ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> xmlBufferCreateStatic (void * mem, <br> size_t size)<br>
</pre>
-<p>routine to create an XML buffer from an immutable memory area. The area won't be modified nor copied, and is expected to be present until the end of the buffer lifetime.</p>
+<p>Create an XML buffer initialized with bytes.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
@@ -1678,7 +1684,7 @@ The content of this structure is not made public by the API.
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the new structure.</td>
+<td></td>
</tr>
</tbody>
</table></div>
diff --git a/doc/devhelp/libxml2-uri.html b/doc/devhelp/libxml2-uri.html
index 755e78da..de7a0aa4 100644
--- a/doc/devhelp/libxml2-uri.html
+++ b/doc/devhelp/libxml2-uri.html
@@ -358,7 +358,7 @@ char * <a href="#xmlURIUnescapeString">xmlURIUnescapeString</a> (const char * s
<a name="xmlURIEscapeStr"></a>xmlURIEscapeStr ()</h3>
<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * xmlURIEscapeStr (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * list)<br>
</pre>
-<p>This routine escapes a string to hex, ignoring reserved <a href="libxml2-SAX.html#characters">characters</a> (a-z) and the <a href="libxml2-SAX.html#characters">characters</a> in the exception list.</p>
+<p>This routine escapes a string to hex, ignoring reserved <a href="libxml2-SAX.html#characters">characters</a> (a-z, A-Z, 0-9, "@-_.!~*'()") and the <a href="libxml2-SAX.html#characters">characters</a> in the exception list.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
diff --git a/doc/devhelp/libxml2-valid.html b/doc/devhelp/libxml2-valid.html
index 3ea0bb80..821d3fa6 100644
--- a/doc/devhelp/libxml2-valid.html
+++ b/doc/devhelp/libxml2-valid.html
@@ -22,9 +22,7 @@
<p>Author(s): Daniel Veillard </p>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
-<pre class="synopsis">#define <a href="#XML_VCTXT_DTD_VALIDATED">XML_VCTXT_DTD_VALIDATED</a>;
-#define <a href="#XML_VCTXT_USE_PCTXT">XML_VCTXT_USE_PCTXT</a>;
-typedef struct _xmlHashTable <a href="#xmlAttributeTable">xmlAttributeTable</a>;
+<pre class="synopsis">typedef struct _xmlHashTable <a href="#xmlAttributeTable">xmlAttributeTable</a>;
typedef <a href="libxml2-valid.html#xmlAttributeTable">xmlAttributeTable</a> * <a href="#xmlAttributeTablePtr">xmlAttributeTablePtr</a>;
typedef struct _xmlHashTable <a href="#xmlElementTable">xmlElementTable</a>;
typedef <a href="libxml2-valid.html#xmlElementTable">xmlElementTable</a> * <a href="#xmlElementTablePtr">xmlElementTablePtr</a>;
@@ -93,7 +91,7 @@ int <a href="#xmlValidateDocument">xmlValidateDocument</a> (<a href="libxml2-va
int <a href="#xmlValidateDocumentFinal">xmlValidateDocumentFinal</a> (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
int <a href="#xmlValidateDtd">xmlValidateDtd</a> (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd);
int <a href="#xmlValidateDtdFinal">xmlValidateDtdFinal</a> (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
-int <a href="#xmlValidateElement">xmlValidateElement</a> (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem);
+int <a href="#xmlValidateElement">xmlValidateElement</a> (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> root);
int <a href="#xmlValidateElementDecl">xmlValidateElementDecl</a> (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlElementPtr">xmlElementPtr</a> elem);
int <a href="#xmlValidateNameValue">xmlValidateNameValue</a> (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
int <a href="#xmlValidateNamesValue">xmlValidateNamesValue</a> (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
@@ -118,22 +116,6 @@ typedef void <a href="#xmlValidityWarningFunc">xmlValidityWarningFunc</a> (void
<div class="refsect2" lang="en">
<div class="refsect2" lang="en">
<h3>
-<a name="XML_VCTXT_DTD_VALIDATED">Macro </a>XML_VCTXT_DTD_VALIDATED</h3>
-<pre class="programlisting">#define <a href="#XML_VCTXT_DTD_VALIDATED">XML_VCTXT_DTD_VALIDATED</a>;
-</pre>
-<p>Set after <a href="libxml2-valid.html#xmlValidateDtdFinal">xmlValidateDtdFinal</a> was called.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="XML_VCTXT_USE_PCTXT">Macro </a>XML_VCTXT_USE_PCTXT</h3>
-<pre class="programlisting">#define <a href="#XML_VCTXT_USE_PCTXT">XML_VCTXT_USE_PCTXT</a>;
-</pre>
-<p>Set if the validation context is part of a parser context.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
<a name="xmlAttributeTable">Structure </a>xmlAttributeTable</h3>
<pre class="programlisting">struct _xmlHashTable {
The content of this structure is not made public by the API.
@@ -1713,7 +1695,7 @@ The content of this structure is not made public by the API.
<div class="refsect2" lang="en">
<h3>
<a name="xmlValidateElement"></a>xmlValidateElement ()</h3>
-<pre class="programlisting">int xmlValidateElement (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem)<br>
+<pre class="programlisting">int xmlValidateElement (<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br> <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br> <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> root)<br>
</pre>
<p>Try to validate the subtree under an element</p>
<div class="variablelist"><table border="0">
@@ -1728,8 +1710,8 @@ The content of this structure is not made public by the API.
<td>a document instance</td>
</tr>
<tr>
-<td><span class="term"><i><tt>elem</tt></i>:</span></td>
-<td>an element instance</td>
+<td><span class="term"><i><tt>root</tt></i>:</span></td>
+<td></td>
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
diff --git a/doc/devhelp/libxml2-xmlIO.html b/doc/devhelp/libxml2-xmlIO.html
index e25ee025..1210a2f5 100644
--- a/doc/devhelp/libxml2-xmlIO.html
+++ b/doc/devhelp/libxml2-xmlIO.html
@@ -1211,7 +1211,7 @@ int <a href="#xmlRegisterOutputCallbacks">xmlRegisterOutputCallbacks</a> (<a hre
<a name="xmlParserInputBufferCreateStatic"></a>xmlParserInputBufferCreateStatic ()</h3>
<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> xmlParserInputBufferCreateStatic (const char * mem, <br> int size, <br> <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br>
</pre>
-<p>Create a buffered parser input for the progressive parsing for the input from an immutable memory area. This will not copy the memory area to the buffer, but the memory is expected to be available until the end of the parsing, this is useful for example when using mmap'ed file.</p>
+<p>DEPRECATED: Use <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateMem">xmlParserInputBufferCreateMem</a>.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody>
diff --git a/doc/devhelp/libxml2-xmlerror.html b/doc/devhelp/libxml2-xmlerror.html
index f97c8e14..b4d3a26b 100644
--- a/doc/devhelp/libxml2-xmlerror.html
+++ b/doc/devhelp/libxml2-xmlerror.html
@@ -929,7 +929,7 @@ typedef void <a href="#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> (void
<a name="initGenericErrorDefaultFunc"></a>initGenericErrorDefaultFunc ()</h3>
<pre class="programlisting">void initGenericErrorDefaultFunc (<a href="libxml2-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> * handler)<br>
</pre>
-<p>Set or reset (if NULL) the default handler for generic errors to the builtin error function.</p>
+<p>DEPRECATED: Use <a href="libxml2-xmlerror.html#xmlSetGenericErrorFunc">xmlSetGenericErrorFunc</a>. Set or reset (if NULL) the default handler for generic errors to the builtin error function.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
diff --git a/doc/devhelp/libxml2-xmlexports.html b/doc/devhelp/libxml2-xmlexports.html
index 422affc1..937d7cb9 100644
--- a/doc/devhelp/libxml2-xmlexports.html
+++ b/doc/devhelp/libxml2-xmlexports.html
@@ -22,10 +22,7 @@
<p>Author(s): </p>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
-<pre class="synopsis">#define <a href="#XMLCALL">XMLCALL</a>;
-#define <a href="#XMLCDECL">XMLCDECL</a>;
-#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
-#define <a href="#XMLPUBLIC">XMLPUBLIC</a>;
+<pre class="synopsis">#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
#define <a href="#XMLPUBVAR">XMLPUBVAR</a>;
</pre>
</div>
@@ -35,22 +32,6 @@
<div class="refsect2" lang="en">
<div class="refsect2" lang="en">
<h3>
-<a name="XMLCALL">Macro </a>XMLCALL</h3>
-<pre class="programlisting">#define <a href="#XMLCALL">XMLCALL</a>;
-</pre>
-<p>Macro which declares the calling convention for exported functions</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="XMLCDECL">Macro </a>XMLCDECL</h3>
-<pre class="programlisting">#define <a href="#XMLCDECL">XMLCDECL</a>;
-</pre>
-<p>Macro which declares the calling convention for exported functions that use '...'.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
<a name="XMLPUBFUN">Macro </a>XMLPUBFUN</h3>
<pre class="programlisting">#define <a href="#XMLPUBFUN">XMLPUBFUN</a>;
</pre>
@@ -59,14 +40,6 @@
<hr>
<div class="refsect2" lang="en">
<h3>
-<a name="XMLPUBLIC">Macro </a>XMLPUBLIC</h3>
-<pre class="programlisting">#define <a href="#XMLPUBLIC">XMLPUBLIC</a>;
-</pre>
-<p>Macro which declares a public symbol</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
<a name="XMLPUBVAR">Macro </a>XMLPUBVAR</h3>
<pre class="programlisting">#define <a href="#XMLPUBVAR">XMLPUBVAR</a>;
</pre>
diff --git a/doc/devhelp/libxml2-xmlmemory.html b/doc/devhelp/libxml2-xmlmemory.html
index e1aef9db..f663bb69 100644
--- a/doc/devhelp/libxml2-xmlmemory.html
+++ b/doc/devhelp/libxml2-xmlmemory.html
@@ -44,6 +44,7 @@ void * <a href="#xmlMemMalloc">xmlMemMalloc</a> (size_t size);
void * <a href="#xmlMemRealloc">xmlMemRealloc</a> (void * ptr, <br> size_t size);
int <a href="#xmlMemSetup">xmlMemSetup</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="#xmlMemShow">xmlMemShow</a> (FILE * fp, <br> int nr);
+size_t <a href="#xmlMemSize">xmlMemSize</a> (void * ptr);
char * <a href="#xmlMemStrdupLoc">xmlMemStrdupLoc</a> (const char * str, <br> const char * file, <br> int line);
int <a href="#xmlMemUsed">xmlMemUsed</a> (void);
void <a href="#xmlMemoryDump">xmlMemoryDump</a> (void);
@@ -152,7 +153,7 @@ typedef char * <a href="#xmlStrdupFunc">xmlStrdupFunc</a> (const char * str);
<a name="xmlCleanupMemory"></a>xmlCleanupMemory ()</h3>
<pre class="programlisting">void xmlCleanupMemory (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Free up all the memory allocated by the library for its own use. This should not be called by user level code.</p>
+<p>DEPRECATED: This function is a no-op. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all.</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -234,12 +235,12 @@ typedef char * <a href="#xmlStrdupFunc">xmlStrdupFunc</a> (const char * str);
<a name="xmlInitMemory"></a>xmlInitMemory ()</h3>
<pre class="programlisting">int xmlInitMemory (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the memory layer.</p>
+<p>DEPRECATED: Alias for <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>.</p>
<div class="variablelist"><table border="0">
<col align="left">
<tbody><tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 on success</td>
+<td></td>
</tr></tbody>
</table></div>
</div>
@@ -503,6 +504,27 @@ typedef char * <a href="#xmlStrdupFunc">xmlStrdupFunc</a> (const char * str);
<hr>
<div class="refsect2" lang="en">
<h3>
+<a name="xmlMemSize"></a>xmlMemSize ()</h3>
+<pre class="programlisting">size_t xmlMemSize (void * ptr)<br>
+</pre>
+<p></p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ptr</tt></i>:</span></td>
+<td>pointer to the memory allocation</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the size of a memory allocation.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
<a name="xmlMemStrdupLoc"></a>xmlMemStrdupLoc ()</h3>
<pre class="programlisting">char * xmlMemStrdupLoc (const char * str, <br> const char * file, <br> int line)<br>
</pre>
diff --git a/doc/devhelp/libxml2-xmlschemastypes.html b/doc/devhelp/libxml2-xmlschemastypes.html
index 8d4459ab..011da789 100644
--- a/doc/devhelp/libxml2-xmlschemastypes.html
+++ b/doc/devhelp/libxml2-xmlschemastypes.html
@@ -38,7 +38,7 @@ int <a href="#xmlSchemaGetCanonValueWhtsp">xmlSchemaGetCanonValueWhtsp</a> (<a h
unsigned long <a href="#xmlSchemaGetFacetValueAsULong">xmlSchemaGetFacetValueAsULong</a> (<a href="libxml2-schemasInternals.html#xmlSchemaFacetPtr">xmlSchemaFacetPtr</a> facet);
<a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a> <a href="#xmlSchemaGetPredefinedType">xmlSchemaGetPredefinedType</a> (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ns);
<a href="libxml2-schemasInternals.html#xmlSchemaValType">xmlSchemaValType</a> <a href="#xmlSchemaGetValType">xmlSchemaGetValType</a> (<a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a> val);
-void <a href="#xmlSchemaInitTypes">xmlSchemaInitTypes</a> (void);
+int <a href="#xmlSchemaInitTypes">xmlSchemaInitTypes</a> (void);
int <a href="#xmlSchemaIsBuiltInTypeFacet">xmlSchemaIsBuiltInTypeFacet</a> (<a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a> type, <br> int facetType);
<a href="libxml2-schemasInternals.html#xmlSchemaFacetPtr">xmlSchemaFacetPtr</a> <a href="#xmlSchemaNewFacet">xmlSchemaNewFacet</a> (void);
<a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a> <a href="#xmlSchemaNewNOTATIONValue">xmlSchemaNewNOTATIONValue</a> (const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br> const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ns);
@@ -114,7 +114,7 @@ const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlSchema
<a name="xmlSchemaCleanupTypes"></a>xmlSchemaCleanupTypes ()</h3>
<pre class="programlisting">void xmlSchemaCleanupTypes (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have call cleanup functions at all. Cleanup the default XML Schemas type library</p>
+<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> to free global state but see the warnings there. <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> should be only called once at program exit. In most cases, you don't have to call cleanup functions at all. Cleanup the default XML Schemas type library</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -413,9 +413,16 @@ const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * <a href="#xmlSchema
<div class="refsect2" lang="en">
<h3>
<a name="xmlSchemaInitTypes"></a>xmlSchemaInitTypes ()</h3>
-<pre class="programlisting">void xmlSchemaInitTypes (void)<br>
+<pre class="programlisting">int xmlSchemaInitTypes (void)<br>
</pre>
<p>Initialize the default XML Schemas type library</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody><tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>0 on success, -1 on error.</td>
+</tr></tbody>
+</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
diff --git a/doc/devhelp/libxml2-xmlversion.html b/doc/devhelp/libxml2-xmlversion.html
index 98b08196..7e202ac2 100644
--- a/doc/devhelp/libxml2-xmlversion.html
+++ b/doc/devhelp/libxml2-xmlversion.html
@@ -68,7 +68,6 @@
#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a>;
#define <a href="#WITHOUT_TRIO">WITHOUT_TRIO</a>;
#define <a href="#WITH_TRIO">WITH_TRIO</a>;
-#define <a href="#XML_DEPRECATED">XML_DEPRECATED</a>;
void <a href="#xmlCheckVersion">xmlCheckVersion</a> (int version);
</pre>
</div>
@@ -145,7 +144,7 @@ void <a href="#xmlCheckVersion">xmlCheckVersion</a> (int version);
<a name="LIBXML_DEBUG_RUNTIME">Macro </a>LIBXML_DEBUG_RUNTIME</h3>
<pre class="programlisting">#define <a href="#LIBXML_DEBUG_RUNTIME">LIBXML_DEBUG_RUNTIME</a>;
</pre>
-<p>Whether the runtime debugging is configured in</p>
+<p>Removed</p>
</div>
<hr>
<div class="refsect2" lang="en">
@@ -446,14 +445,6 @@ void <a href="#xmlCheckVersion">xmlCheckVersion</a> (int version);
<hr>
<div class="refsect2" lang="en">
<h3>
-<a name="XML_DEPRECATED">Macro </a>XML_DEPRECATED</h3>
-<pre class="programlisting">#define <a href="#XML_DEPRECATED">XML_DEPRECATED</a>;
-</pre>
-<p>Macro used to indicate that a function, variable, type or struct member is deprecated.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
<a name="xmlCheckVersion"></a>xmlCheckVersion ()</h3>
<pre class="programlisting">void xmlCheckVersion (int version)<br>
</pre>
diff --git a/doc/devhelp/libxml2-xpath.html b/doc/devhelp/libxml2-xpath.html
index a5970ac0..9a4c3069 100644
--- a/doc/devhelp/libxml2-xpath.html
+++ b/doc/devhelp/libxml2-xpath.html
@@ -397,7 +397,7 @@ The content of this structure is not made public by the API.
<a href="libxml2-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a> comp : the precompiled expression
int xptr : it this an XPointer expression
<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> ancestor : used for walking preceding axis
- int valueFrame : used to limit Pop on the stack
+ int valueFrame : unused
} xmlXPathParserContext;
</pre>
<p></p>
@@ -1289,7 +1289,7 @@ The content of this structure is not made public by the API.
<a name="xmlXPathInit"></a>xmlXPathInit ()</h3>
<pre class="programlisting">void xmlXPathInit (void)<br>
</pre>
-<p>DEPRECATED: This function will be made private. Call <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a> to initialize the library. Initialize the XPath environment</p>
+<p>DEPRECATED: Alias for <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>.</p>
</div>
<hr>
<div class="refsect2" lang="en">
diff --git a/doc/devhelp/libxml2-xpathInternals.html b/doc/devhelp/libxml2-xpathInternals.html
index 750dade3..3a1f3ba7 100644
--- a/doc/devhelp/libxml2-xpathInternals.html
+++ b/doc/devhelp/libxml2-xpathInternals.html
@@ -650,7 +650,7 @@ void <a href="#xmlXPatherror">xmlXPatherror</a> (<a href="libxml2-xpath.html#x
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of items on the value stack, or -1 in case of error.</td>
+<td>the number of items on the value stack, or -1 in case of error. The object is destroyed in case of error.</td>
</tr>
</tbody>
</table></div>
@@ -2095,7 +2095,7 @@ void <a href="#xmlXPatherror">xmlXPatherror</a> (<a href="libxml2-xpath.html#x
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>@val1 once extended or NULL in case of error.</td>
+<td>@val1 once extended or NULL in case of error. Frees @val1 in case of error.</td>
</tr>
</tbody>
</table></div>
@@ -3164,7 +3164,7 @@ void <a href="#xmlXPatherror">xmlXPatherror</a> (<a href="libxml2-xpath.html#x
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
+<td>the newly created object. In case of error the node set is destroyed and NULL is returned.</td>
</tr>
</tbody>
</table></div>
@@ -3185,7 +3185,7 @@ void <a href="#xmlXPatherror">xmlXPatherror</a> (<a href="libxml2-xpath.html#x
</tr>
<tr>
<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
+<td>the newly created object. Frees @val in case of error.</td>
</tr>
</tbody>
</table></div>
diff --git a/doc/devhelp/libxml2.devhelp2 b/doc/devhelp/libxml2.devhelp2
index 3f6459e9..1d9ec80b 100644
--- a/doc/devhelp/libxml2.devhelp2
+++ b/doc/devhelp/libxml2.devhelp2
@@ -133,9 +133,6 @@
<keyword type="macro" name="LIBXML_XPTR_ENABLED" link="libxml2-xmlversion.html#LIBXML_XPTR_ENABLED"/>
<keyword type="macro" name="LIBXML_XPTR_LOCS_ENABLED" link="libxml2-xmlversion.html#LIBXML_XPTR_LOCS_ENABLED"/>
<keyword type="macro" name="LIBXML_ZLIB_ENABLED" link="libxml2-xmlversion.html#LIBXML_ZLIB_ENABLED"/>
- <keyword type="macro" name="MOVETO_ENDTAG" link="libxml2-parserInternals.html#MOVETO_ENDTAG"/>
- <keyword type="macro" name="MOVETO_STARTTAG" link="libxml2-parserInternals.html#MOVETO_STARTTAG"/>
- <keyword type="macro" name="SKIP_EOL" link="libxml2-parserInternals.html#SKIP_EOL"/>
<keyword type="macro" name="SOCKET" link="libxml2-nanoftp.html#SOCKET"/>
<keyword type="macro" name="WITHOUT_TRIO" link="libxml2-xmlversion.html#WITHOUT_TRIO"/>
<keyword type="macro" name="WITH_TRIO" link="libxml2-xmlversion.html#WITH_TRIO"/>
@@ -149,22 +146,19 @@
<keyword type="macro" name="XINCLUDE_PARSE_TEXT" link="libxml2-xinclude.html#XINCLUDE_PARSE_TEXT"/>
<keyword type="macro" name="XINCLUDE_PARSE_XML" link="libxml2-xinclude.html#XINCLUDE_PARSE_XML"/>
<keyword type="macro" name="XINCLUDE_PARSE_XPOINTER" link="libxml2-xinclude.html#XINCLUDE_PARSE_XPOINTER"/>
- <keyword type="macro" name="XMLCALL" link="libxml2-xmlexports.html#XMLCALL"/>
- <keyword type="macro" name="XMLCDECL" link="libxml2-xmlexports.html#XMLCDECL"/>
<keyword type="macro" name="XMLPUBFUN" link="libxml2-xmlexports.html#XMLPUBFUN"/>
- <keyword type="macro" name="XMLPUBLIC" link="libxml2-xmlexports.html#XMLPUBLIC"/>
<keyword type="macro" name="XMLPUBVAR" link="libxml2-xmlexports.html#XMLPUBVAR"/>
<keyword type="macro" name="XML_CAST_FPTR" link="libxml2-hash.html#XML_CAST_FPTR"/>
<keyword type="macro" name="XML_CATALOGS_NAMESPACE" link="libxml2-catalog.html#XML_CATALOGS_NAMESPACE"/>
<keyword type="macro" name="XML_CATALOG_PI" link="libxml2-catalog.html#XML_CATALOG_PI"/>
<keyword type="macro" name="XML_COMPLETE_ATTRS" link="libxml2-parser.html#XML_COMPLETE_ATTRS"/>
<keyword type="macro" name="XML_DEFAULT_VERSION" link="libxml2-parser.html#XML_DEFAULT_VERSION"/>
- <keyword type="macro" name="XML_DEPRECATED" link="libxml2-xmlversion.html#XML_DEPRECATED"/>
<keyword type="macro" name="XML_DETECT_IDS" link="libxml2-parser.html#XML_DETECT_IDS"/>
<keyword type="macro" name="XML_GET_CONTENT" link="libxml2-tree.html#XML_GET_CONTENT"/>
<keyword type="macro" name="XML_GET_LINE" link="libxml2-tree.html#XML_GET_LINE"/>
<keyword type="macro" name="XML_LOCAL_NAMESPACE" link="libxml2-tree.html#XML_LOCAL_NAMESPACE"/>
<keyword type="macro" name="XML_MAX_DICTIONARY_LIMIT" link="libxml2-parserInternals.html#XML_MAX_DICTIONARY_LIMIT"/>
+ <keyword type="macro" name="XML_MAX_HUGE_LENGTH" link="libxml2-parserInternals.html#XML_MAX_HUGE_LENGTH"/>
<keyword type="macro" name="XML_MAX_LOOKUP_LIMIT" link="libxml2-parserInternals.html#XML_MAX_LOOKUP_LIMIT"/>
<keyword type="macro" name="XML_MAX_NAMELEN" link="libxml2-parserInternals.html#XML_MAX_NAMELEN"/>
<keyword type="macro" name="XML_MAX_NAME_LENGTH" link="libxml2-parserInternals.html#XML_MAX_NAME_LENGTH"/>
@@ -257,8 +251,6 @@
<keyword type="macro" name="XML_SUBSTITUTE_NONE" link="libxml2-parserInternals.html#XML_SUBSTITUTE_NONE"/>
<keyword type="macro" name="XML_SUBSTITUTE_PEREF" link="libxml2-parserInternals.html#XML_SUBSTITUTE_PEREF"/>
<keyword type="macro" name="XML_SUBSTITUTE_REF" link="libxml2-parserInternals.html#XML_SUBSTITUTE_REF"/>
- <keyword type="macro" name="XML_VCTXT_DTD_VALIDATED" link="libxml2-valid.html#XML_VCTXT_DTD_VALIDATED"/>
- <keyword type="macro" name="XML_VCTXT_USE_PCTXT" link="libxml2-valid.html#XML_VCTXT_USE_PCTXT"/>
<keyword type="macro" name="XML_XML_ID" link="libxml2-tree.html#XML_XML_ID"/>
<keyword type="macro" name="XML_XML_NAMESPACE" link="libxml2-tree.html#XML_XML_NAMESPACE"/>
<keyword type="macro" name="XML_XPATH_CHECKNS" link="libxml2-xpath.html#XML_XPATH_CHECKNS"/>
@@ -2248,7 +2240,6 @@
<keyword type="function" name="xmlDictReference ()" link="libxml2-dict.html#xmlDictReference"/>
<keyword type="function" name="xmlDictSetLimit ()" link="libxml2-dict.html#xmlDictSetLimit"/>
<keyword type="function" name="xmlDictSize ()" link="libxml2-dict.html#xmlDictSize"/>
- <keyword type="function" name="xmlDllMain ()" link="libxml2-threads.html#xmlDllMain"/>
<keyword type="function" name="xmlDocCopyNode ()" link="libxml2-tree.html#xmlDocCopyNode"/>
<keyword type="function" name="xmlDocCopyNodeList ()" link="libxml2-tree.html#xmlDocCopyNodeList"/>
<keyword type="function" name="xmlDocDump ()" link="libxml2-tree.html#xmlDocDump"/>
@@ -2271,7 +2262,6 @@
<keyword type="function" name="xmlEncodeEntities ()" link="libxml2-entities.html#xmlEncodeEntities"/>
<keyword type="function" name="xmlEncodeEntitiesReentrant ()" link="libxml2-entities.html#xmlEncodeEntitiesReentrant"/>
<keyword type="function" name="xmlEncodeSpecialChars ()" link="libxml2-entities.html#xmlEncodeSpecialChars"/>
- <keyword type="function" name="xmlErrMemory ()" link="libxml2-parserInternals.html#xmlErrMemory"/>
<keyword type="function" name="xmlExpCtxtNbCons ()" link="libxml2-xmlregexp.html#xmlExpCtxtNbCons"/>
<keyword type="function" name="xmlExpCtxtNbNodes ()" link="libxml2-xmlregexp.html#xmlExpCtxtNbNodes"/>
<keyword type="function" name="xmlExpDump ()" link="libxml2-xmlregexp.html#xmlExpDump"/>
@@ -2475,6 +2465,7 @@
<keyword type="function" name="xmlMemRealloc ()" link="libxml2-xmlmemory.html#xmlMemRealloc"/>
<keyword type="function" name="xmlMemSetup ()" link="libxml2-xmlmemory.html#xmlMemSetup"/>
<keyword type="function" name="xmlMemShow ()" link="libxml2-xmlmemory.html#xmlMemShow"/>
+ <keyword type="function" name="xmlMemSize ()" link="libxml2-xmlmemory.html#xmlMemSize"/>
<keyword type="function" name="xmlMemStrdupLoc ()" link="libxml2-xmlmemory.html#xmlMemStrdupLoc"/>
<keyword type="function" name="xmlMemUsed ()" link="libxml2-xmlmemory.html#xmlMemUsed"/>
<keyword type="function" name="xmlMemoryDump ()" link="libxml2-xmlmemory.html#xmlMemoryDump"/>
diff --git a/doc/examples/.gitignore b/doc/examples/.gitignore
new file mode 100644
index 00000000..ec244f23
--- /dev/null
+++ b/doc/examples/.gitignore
@@ -0,0 +1,15 @@
+/io1
+/io2
+/parse1
+/parse2
+/parse3
+/parse4
+/reader1
+/reader2
+/reader3
+/reader4
+/testWriter
+/tree1
+/tree2
+/xpath1
+/xpath2
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 75e138be..e30c02b4 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -22,7 +22,6 @@ uninstall-local:
clean-local:
test -f Makefile.am || rm -f test?.xml
- rm -f .memdump
EXTRA_DIST = \
examples.xml \
@@ -86,35 +85,18 @@ valgrind:
check-local:
@test -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml .
@(echo '## examples regression tests')
- @(echo > .memdump)
@$(CHECKER) ./io1 >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./io2 >/dev/null
- @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) ./parse2 test2.xml
- @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) ./parse4 test3.xml
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./reader1 test2.xml >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./reader2 test2.xml >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./reader3 >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./reader4 test1.xml test2.xml test3.xml >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./testWriter
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./tree1 test2.xml >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./tree2 >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
- @$(CHECKER) ./xpath1 test3.xml '//child2' >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@$(CHECKER) ./xpath2 test3.xml '//discarded' discarded >/dev/null
- @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0
@rm -f *.tmp
diff --git a/doc/examples/examples.xml b/doc/examples/examples.xml
index 465ea824..177e8159 100644
--- a/doc/examples/examples.xml
+++ b/doc/examples/examples.xml
@@ -15,11 +15,9 @@
</includes>
<uses>
<macro line='117' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='154' file='parser' name='xmlCleanupParser'/>
<function line='143' file='tree' name='xmlDocDump'/>
<typedef line='105' file='tree' name='xmlDocPtr'/>
<function line='149' file='tree' name='xmlFreeDoc'/>
- <function line='158' file='xmlmemory' name='xmlMemoryDump'/>
<function line='124' file='parser' name='xmlReadMemory'/>
<function line='117' file='xmlIO' name='xmlRegisterInputCallbacks'/>
<function line='134' file='xinclude' name='xmlXIncludeProcess'/>
@@ -62,10 +60,8 @@
</includes>
<uses>
<macro line='45' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='50' file='parser' name='xmlCleanupParser'/>
<typedef line='24' file='tree' name='xmlDocPtr'/>
<function line='31' file='tree' name='xmlFreeDoc'/>
- <function line='54' file='xmlmemory' name='xmlMemoryDump'/>
<function line='26' file='parser' name='xmlReadFile'/>
</uses>
</example>
@@ -84,12 +80,10 @@
<uses>
<macro line='61' file='xmlversion' name='LIBXML_TEST_VERSION'/>
<enum line='35' file='parser' name='XML_PARSE_DTDVALID'/>
- <function line='66' file='parser' name='xmlCleanupParser'/>
<function line='35' file='parser' name='xmlCtxtReadFile'/>
<typedef line='26' file='tree' name='xmlDocPtr'/>
<function line='44' file='tree' name='xmlFreeDoc'/>
<function line='47' file='parser' name='xmlFreeParserCtxt'/>
- <function line='70' file='xmlmemory' name='xmlMemoryDump'/>
<function line='29' file='parser' name='xmlNewParserCtxt'/>
<typedef line='25' file='tree' name='xmlParserCtxtPtr'/>
</uses>
@@ -108,10 +102,8 @@
</includes>
<uses>
<macro line='49' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='54' file='parser' name='xmlCleanupParser'/>
<typedef line='27' file='tree' name='xmlDocPtr'/>
<function line='38' file='tree' name='xmlFreeDoc'/>
- <function line='58' file='xmlmemory' name='xmlMemoryDump'/>
<function line='33' file='parser' name='xmlReadMemory'/>
</uses>
</example>
@@ -129,12 +121,10 @@
</includes>
<uses>
<macro line='120' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='131' file='parser' name='xmlCleanupParser'/>
<function line='67' file='parser' name='xmlCreatePushParserCtxt'/>
<typedef line='47' file='tree' name='xmlDocPtr'/>
<function line='103' file='tree' name='xmlFreeDoc'/>
<function line='94' file='parser' name='xmlFreeParserCtxt'/>
- <function line='135' file='xmlmemory' name='xmlMemoryDump'/>
<function line='80' file='parser' name='xmlParseChunk'/>
<typedef line='45' file='tree' name='xmlParserCtxtPtr'/>
</uses>
@@ -152,9 +142,7 @@
</includes>
<uses>
<macro line='89' file='xmlversion' name='LIBXML_TEST_VERSION'/>
- <function line='94' file='parser' name='xmlCleanupParser'/>
<function line='69' file='xmlreader' name='xmlFreeTextReader'/>
- <function line='98' file='xmlmemory' name='xmlMemoryDump'/>
<function line='62' file='xmlreader' name='xmlReaderForFile'/>
<function line='44' file='xmlstring' name='xmlStrlen'/>
<function line='29' file='xmlreader' name='xmlTextReaderConstName'/>
@@ -250,35 +238,35 @@
<include line='17'>&lt;libxml/xmlwriter.h&gt;</include>
</includes>
<uses>
- <macro line='885' file='parser' name='XML_DEFAULT_VERSION'/>
- <function line='347' file='tree' name='xmlBufferCreate'/>
- <function line='613' file='tree' name='xmlBufferFree'/>
- <typedef line='341' file='tree' name='xmlBufferPtr'/>
- <typedef line='1151' file='encoding' name='xmlCharEncodingHandlerPtr'/>
- <function line='901' file='tree' name='xmlDocSetRootElement'/>
- <function line='1156' file='encoding' name='xmlFindCharEncodingHandler'/>
- <variable line='113' file='globals' name='xmlFree'/>
- <function line='327' file='xmlwriter' name='xmlFreeTextWriter'/>
- <variable line='1166' file='globals' name='xmlMalloc'/>
- <function line='885' file='tree' name='xmlNewDoc'/>
- <function line='894' file='tree' name='xmlNewDocNode'/>
- <function line='632' file='xmlwriter' name='xmlNewTextWriterDoc'/>
- <function line='76' file='xmlwriter' name='xmlNewTextWriterFilename'/>
- <function line='355' file='xmlwriter' name='xmlNewTextWriterMemory'/>
- <function line='904' file='xmlwriter' name='xmlNewTextWriterTree'/>
- <typedef line='880' file='tree' name='xmlNodePtr'/>
- <variable line='1183' file='globals' name='xmlRealloc'/>
- <function line='863' file='tree' name='xmlSaveFileEnc'/>
- <function line='320' file='xmlwriter' name='xmlTextWriterEndDocument'/>
- <function line='200' file='xmlwriter' name='xmlTextWriterEndElement'/>
- <typedef line='72' file='xmlwriter' name='xmlTextWriterPtr'/>
- <function line='85' file='xmlwriter' name='xmlTextWriterStartDocument'/>
- <function line='94' file='xmlwriter' name='xmlTextWriterStartElement'/>
- <function line='124' file='xmlwriter' name='xmlTextWriterWriteAttribute'/>
- <function line='107' file='xmlwriter' name='xmlTextWriterWriteComment'/>
- <function line='181' file='xmlwriter' name='xmlTextWriterWriteElement'/>
- <function line='143' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/>
- <function line='162' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/>
+ <macro line='877' file='parser' name='XML_DEFAULT_VERSION'/>
+ <function line='339' file='tree' name='xmlBufferCreate'/>
+ <function line='605' file='tree' name='xmlBufferFree'/>
+ <typedef line='333' file='tree' name='xmlBufferPtr'/>
+ <typedef line='1143' file='encoding' name='xmlCharEncodingHandlerPtr'/>
+ <function line='893' file='tree' name='xmlDocSetRootElement'/>
+ <function line='1148' file='encoding' name='xmlFindCharEncodingHandler'/>
+ <variable line='105' file='globals' name='xmlFree'/>
+ <function line='319' file='xmlwriter' name='xmlFreeTextWriter'/>
+ <variable line='1158' file='globals' name='xmlMalloc'/>
+ <function line='877' file='tree' name='xmlNewDoc'/>
+ <function line='886' file='tree' name='xmlNewDocNode'/>
+ <function line='624' file='xmlwriter' name='xmlNewTextWriterDoc'/>
+ <function line='68' file='xmlwriter' name='xmlNewTextWriterFilename'/>
+ <function line='347' file='xmlwriter' name='xmlNewTextWriterMemory'/>
+ <function line='896' file='xmlwriter' name='xmlNewTextWriterTree'/>
+ <typedef line='872' file='tree' name='xmlNodePtr'/>
+ <variable line='1175' file='globals' name='xmlRealloc'/>
+ <function line='855' file='tree' name='xmlSaveFileEnc'/>
+ <function line='312' file='xmlwriter' name='xmlTextWriterEndDocument'/>
+ <function line='192' file='xmlwriter' name='xmlTextWriterEndElement'/>
+ <typedef line='64' file='xmlwriter' name='xmlTextWriterPtr'/>
+ <function line='77' file='xmlwriter' name='xmlTextWriterStartDocument'/>
+ <function line='86' file='xmlwriter' name='xmlTextWriterStartElement'/>
+ <function line='116' file='xmlwriter' name='xmlTextWriterWriteAttribute'/>
+ <function line='99' file='xmlwriter' name='xmlTextWriterWriteComment'/>
+ <function line='173' file='xmlwriter' name='xmlTextWriterWriteElement'/>
+ <function line='135' file='xmlwriter' name='xmlTextWriterWriteFormatComment'/>
+ <function line='154' file='xmlwriter' name='xmlTextWriterWriteFormatElement'/>
</uses>
</example>
<example filename='tree1.c'>
@@ -338,22 +326,22 @@
<include line='19'>&lt;libxml/xpathInternals.h&gt;</include>
</includes>
<uses>
- <enum line='229' file='tree' name='XML_ELEMENT_NODE'/>
- <enum line='217' file='tree' name='XML_NAMESPACE_DECL'/>
- <variable line='173' file='globals' name='xmlFree'/>
+ <enum line='222' file='tree' name='XML_ELEMENT_NODE'/>
+ <enum line='210' file='tree' name='XML_NAMESPACE_DECL'/>
+ <variable line='166' file='globals' name='xmlFree'/>
<function line='39' file='parser' name='xmlInitParser'/>
- <typedef line='206' file='tree' name='xmlNodePtr'/>
- <typedef line='218' file='tree' name='xmlNsPtr'/>
- <function line='94' file='parser' name='xmlParseFile'/>
- <function line='170' file='xmlstring' name='xmlStrchr'/>
- <function line='156' file='xmlstring' name='xmlStrdup'/>
- <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
- <function line='117' file='xpath' name='xmlXPathEvalExpression'/>
- <function line='111' file='xpath' name='xmlXPathFreeContext'/>
- <function line='129' file='xpath' name='xmlXPathFreeObject'/>
- <function line='101' file='xpath' name='xmlXPathNewContext'/>
- <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
- <function line='186' file='xpathInternals' name='xmlXPathRegisterNs'/>
+ <typedef line='199' file='tree' name='xmlNodePtr'/>
+ <typedef line='211' file='tree' name='xmlNsPtr'/>
+ <function line='87' file='parser' name='xmlParseFile'/>
+ <function line='163' file='xmlstring' name='xmlStrchr'/>
+ <function line='149' file='xmlstring' name='xmlStrdup'/>
+ <typedef line='80' file='xpath' name='xmlXPathContextPtr'/>
+ <function line='110' file='xpath' name='xmlXPathEvalExpression'/>
+ <function line='104' file='xpath' name='xmlXPathFreeContext'/>
+ <function line='122' file='xpath' name='xmlXPathFreeObject'/>
+ <function line='94' file='xpath' name='xmlXPathNewContext'/>
+ <typedef line='81' file='xpath' name='xmlXPathObjectPtr'/>
+ <function line='179' file='xpathInternals' name='xmlXPathRegisterNs'/>
</uses>
</example>
<example filename='xpath2.c'>
@@ -371,17 +359,17 @@
<include line='19'>&lt;libxml/xpathInternals.h&gt;</include>
</includes>
<uses>
- <enum line='180' file='tree' name='XML_NAMESPACE_DECL'/>
- <function line='127' file='tree' name='xmlDocDump'/>
+ <enum line='173' file='tree' name='XML_NAMESPACE_DECL'/>
+ <function line='120' file='tree' name='xmlDocDump'/>
<function line='41' file='parser' name='xmlInitParser'/>
- <function line='162' file='tree' name='xmlNodeSetContent'/>
- <function line='95' file='parser' name='xmlParseFile'/>
- <typedef line='87' file='xpath' name='xmlXPathContextPtr'/>
- <function line='110' file='xpath' name='xmlXPathEvalExpression'/>
- <function line='113' file='xpath' name='xmlXPathFreeContext'/>
- <function line='123' file='xpath' name='xmlXPathFreeObject'/>
- <function line='102' file='xpath' name='xmlXPathNewContext'/>
- <typedef line='88' file='xpath' name='xmlXPathObjectPtr'/>
+ <function line='155' file='tree' name='xmlNodeSetContent'/>
+ <function line='88' file='parser' name='xmlParseFile'/>
+ <typedef line='80' file='xpath' name='xmlXPathContextPtr'/>
+ <function line='103' file='xpath' name='xmlXPathEvalExpression'/>
+ <function line='106' file='xpath' name='xmlXPathFreeContext'/>
+ <function line='116' file='xpath' name='xmlXPathFreeObject'/>
+ <function line='95' file='xpath' name='xmlXPathNewContext'/>
+ <typedef line='81' file='xpath' name='xmlXPathObjectPtr'/>
</uses>
</example>
<symbols>
@@ -429,14 +417,6 @@
<symbol name='xmlCharEncodingHandlerPtr'>
<ref filename='testWriter.c'/>
</symbol>
- <symbol name='xmlCleanupParser'>
- <ref filename='io1.c'/>
- <ref filename='parse1.c'/>
- <ref filename='parse2.c'/>
- <ref filename='parse3.c'/>
- <ref filename='parse4.c'/>
- <ref filename='reader1.c'/>
- </symbol>
<symbol name='xmlCreateIntSubset'>
<ref filename='tree2.c'/>
</symbol>
@@ -506,14 +486,6 @@
<symbol name='xmlMalloc'>
<ref filename='testWriter.c'/>
</symbol>
- <symbol name='xmlMemoryDump'>
- <ref filename='io1.c'/>
- <ref filename='parse1.c'/>
- <ref filename='parse2.c'/>
- <ref filename='parse3.c'/>
- <ref filename='parse4.c'/>
- <ref filename='reader1.c'/>
- </symbol>
<symbol name='xmlNewChild'>
<ref filename='tree2.c'/>
</symbol>
diff --git a/doc/examples/index.html b/doc/examples/index.html
index ff7b1cd3..b4d29f31 100644
--- a/doc/examples/index.html
+++ b/doc/examples/index.html
@@ -87,8 +87,6 @@ install</i> step or when installing the libxml2 development package:</p>
<li> line 134: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xinclude.html#xmlXIncludeProcess">xmlXIncludeProcess</a> from xinclude.h</li>
<li> line 143: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li>
<li> line 149: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li>
- <li> line 154: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li>
- <li> line 158: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li>
</ul>
<p>Usage:</p>
<p>io1</p>
@@ -133,8 +131,6 @@ install</i> step or when installing the libxml2 development package:</p>
<li> line 26: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlReadFile">xmlReadFile</a> from parser.h</li>
<li> line 31: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li>
<li> line 45: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li>
- <li> line 50: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li>
- <li> line 54: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li>
</ul>
<p>Usage:</p>
<p>parse1 test1.xml</p>
@@ -159,8 +155,6 @@ install</i> step or when installing the libxml2 development package:</p>
<li> line 44: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li>
<li> line 47: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li>
<li> line 61: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li>
- <li> line 66: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li>
- <li> line 70: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li>
</ul>
<p>Usage:</p>
<p>parse2 test2.xml</p>
@@ -182,8 +176,6 @@ install</i> step or when installing the libxml2 development package:</p>
<li> line 33: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlReadMemory">xmlReadMemory</a> from parser.h</li>
<li> line 38: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li>
<li> line 49: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li>
- <li> line 54: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li>
- <li> line 58: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li>
</ul>
<p>Usage:</p>
<p>parse3</p>
@@ -208,8 +200,6 @@ install</i> step or when installing the libxml2 development package:</p>
<li> line 94: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> from parser.h</li>
<li> line 103: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlFreeDoc">xmlFreeDoc</a> from tree.h</li>
<li> line 120: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li>
- <li> line 131: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li>
- <li> line 135: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li>
</ul>
<p>Usage:</p>
<p>parse4 test3.xml</p>
@@ -281,18 +271,18 @@ install</i> step or when installing the libxml2 development package:</p>
<p>Uses:</p>
<ul>
<li> line 39: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li>
- <li> line 87: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li>
- <li> line 88: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li>
- <li> line 94: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li>
- <li> line 101: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li>
- <li> line 111: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li>
- <li> line 117: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li>
- <li> line 129: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li>
- <li> line 156: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li>
- <li> line 170: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li>
- <li> line 186: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li>
- <li> line 206: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li>
- <li> line 218: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li>
+ <li> line 80: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li>
+ <li> line 81: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li>
+ <li> line 87: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li>
+ <li> line 94: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li>
+ <li> line 104: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li>
+ <li> line 110: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li>
+ <li> line 122: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li>
+ <li> line 149: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlstring.html#xmlStrdup">xmlStrdup</a> from xmlstring.h</li>
+ <li> line 163: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlstring.html#xmlStrchr">xmlStrchr</a> from xmlstring.h</li>
+ <li> line 179: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpathInternals.html#xmlXPathRegisterNs">xmlXPathRegisterNs</a> from xpathInternals.h</li>
+ <li> line 199: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li>
+ <li> line 211: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> from tree.h</li>
</ul>
<p>Usage:</p>
<p>xpath1 &lt;xml-file&gt; &lt;xpath-expr&gt; [&lt;known-ns-list&gt;]</p>
@@ -317,15 +307,15 @@ install</i> step or when installing the libxml2 development package:</p>
<p>Uses:</p>
<ul>
<li> line 41: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlInitParser">xmlInitParser</a> from parser.h</li>
- <li> line 87: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li>
- <li> line 88: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li>
- <li> line 95: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li>
- <li> line 102: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li>
- <li> line 110: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li>
- <li> line 113: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li>
- <li> line 123: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li>
- <li> line 127: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li>
- <li> line 162: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li>
+ <li> line 80: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> from xpath.h</li>
+ <li> line 81: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from xpath.h</li>
+ <li> line 88: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlParseFile">xmlParseFile</a> from parser.h</li>
+ <li> line 95: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathNewContext">xmlXPathNewContext</a> from xpath.h</li>
+ <li> line 103: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathEvalExpression">xmlXPathEvalExpression</a> from xpath.h</li>
+ <li> line 106: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeContext">xmlXPathFreeContext</a> from xpath.h</li>
+ <li> line 116: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xpath.html#xmlXPathFreeObject">xmlXPathFreeObject</a> from xpath.h</li>
+ <li> line 120: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlDocDump">xmlDocDump</a> from tree.h</li>
+ <li> line 155: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNodeSetContent">xmlNodeSetContent</a> from tree.h</li>
</ul>
<p>Usage:</p>
<p>xpath2 &lt;xml-file&gt; &lt;xpath-expr&gt; &lt;new-value&gt;</p>
@@ -353,8 +343,6 @@ install</i> step or when installing the libxml2 development package:</p>
<li> line 64: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlreader.html#xmlTextReaderRead">xmlTextReaderRead</a> from xmlreader.h</li>
<li> line 69: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlreader.html#xmlFreeTextReader">xmlFreeTextReader</a> from xmlreader.h</li>
<li> line 89: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlversion.html#LIBXML_TEST_VERSION">LIBXML_TEST_VERSION</a> from xmlversion.h</li>
- <li> line 94: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> from parser.h</li>
- <li> line 98: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlmemory.html#xmlMemoryDump">xmlMemoryDump</a> from xmlmemory.h</li>
</ul>
<p>Usage:</p>
<p>reader1 &lt;filename&gt;</p>
@@ -440,32 +428,32 @@ install</i> step or when installing the libxml2 development package:</p>
</ul>
<p>Uses:</p>
<ul>
- <li> line 72: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li>
- <li> line 76: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li>
- <li> line 85: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li>
- <li> line 94: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li>
- <li> line 107: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li>
- <li> line 124: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li>
- <li> line 143: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li>
- <li> line 162: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li>
- <li> line 181: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li>
- <li> line 200: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li>
- <li> line 320: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li>
- <li> line 327: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li>
- <li> line 341: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li>
- <li> line 347: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li>
- <li> line 355: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li>
- <li> line 613: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li>
- <li> line 632: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li>
- <li> line 863: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li>
- <li> line 880: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li>
- <li> line 885: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li>
- <li> line 885: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li>
- <li> line 894: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li>
- <li> line 901: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li>
- <li> line 904: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li>
- <li> line 1151: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li>
- <li> line 1156: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li>
+ <li> line 64: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> from xmlwriter.h</li>
+ <li> line 68: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterFilename">xmlNewTextWriterFilename</a> from xmlwriter.h</li>
+ <li> line 77: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterStartDocument">xmlTextWriterStartDocument</a> from xmlwriter.h</li>
+ <li> line 86: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterStartElement">xmlTextWriterStartElement</a> from xmlwriter.h</li>
+ <li> line 99: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteComment">xmlTextWriterWriteComment</a> from xmlwriter.h</li>
+ <li> line 116: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteAttribute">xmlTextWriterWriteAttribute</a> from xmlwriter.h</li>
+ <li> line 135: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteFormatComment">xmlTextWriterWriteFormatComment</a> from xmlwriter.h</li>
+ <li> line 154: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteFormatElement">xmlTextWriterWriteFormatElement</a> from xmlwriter.h</li>
+ <li> line 173: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterWriteElement">xmlTextWriterWriteElement</a> from xmlwriter.h</li>
+ <li> line 192: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterEndElement">xmlTextWriterEndElement</a> from xmlwriter.h</li>
+ <li> line 312: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlTextWriterEndDocument">xmlTextWriterEndDocument</a> from xmlwriter.h</li>
+ <li> line 319: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlFreeTextWriter">xmlFreeTextWriter</a> from xmlwriter.h</li>
+ <li> line 333: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> from tree.h</li>
+ <li> line 339: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlBufferCreate">xmlBufferCreate</a> from tree.h</li>
+ <li> line 347: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterMemory">xmlNewTextWriterMemory</a> from xmlwriter.h</li>
+ <li> line 605: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlBufferFree">xmlBufferFree</a> from tree.h</li>
+ <li> line 624: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterDoc">xmlNewTextWriterDoc</a> from xmlwriter.h</li>
+ <li> line 855: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlSaveFileEnc">xmlSaveFileEnc</a> from tree.h</li>
+ <li> line 872: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> from tree.h</li>
+ <li> line 877: Macro <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-parser.html#XML_DEFAULT_VERSION">XML_DEFAULT_VERSION</a> from parser.h</li>
+ <li> line 877: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNewDoc">xmlNewDoc</a> from tree.h</li>
+ <li> line 886: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlNewDocNode">xmlNewDocNode</a> from tree.h</li>
+ <li> line 893: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-tree.html#xmlDocSetRootElement">xmlDocSetRootElement</a> from tree.h</li>
+ <li> line 896: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-xmlwriter.html#xmlNewTextWriterTree">xmlNewTextWriterTree</a> from xmlwriter.h</li>
+ <li> line 1143: Type <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> from encoding.h</li>
+ <li> line 1148: Function <a href="https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-encoding.html#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a> from encoding.h</li>
</ul>
<p>Usage:</p>
<p>testWriter</p>
diff --git a/doc/examples/index.py b/doc/examples/index.py
index c422904f..bceae8b9 100755
--- a/doc/examples/index.py
+++ b/doc/examples/index.py
@@ -262,10 +262,8 @@ clean-local:
Makefile = Makefile + "tests: $(check_PROGRAMS)\n"
Makefile = Makefile + "\t@test -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml .\n"
Makefile = Makefile + "\t@(echo '## examples regression tests')\n"
- Makefile = Makefile + "\t@(echo > .memdump)\n"
for test in tests:
Makefile = Makefile + "\t@$(CHECKER) %s\n" % (test)
- Makefile = Makefile + '\t@grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0\n'
Makefile = Makefile + "\t@rm *.tmp\n"
try:
old = open("Makefile.am", "r").read()
diff --git a/doc/examples/io1.c b/doc/examples/io1.c
index 5c2b25d7..366c63cb 100644
--- a/doc/examples/io1.c
+++ b/doc/examples/io1.c
@@ -148,14 +148,6 @@ int main(void) {
*/
xmlFreeDoc(doc);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
#else
diff --git a/doc/examples/parse1.c b/doc/examples/parse1.c
index e3c9d3a6..01087d1a 100644
--- a/doc/examples/parse1.c
+++ b/doc/examples/parse1.c
@@ -44,13 +44,5 @@ int main(int argc, char **argv) {
example1Func(argv[1]);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/parse2.c b/doc/examples/parse2.c
index 4dcbfde9..0732e1e5 100644
--- a/doc/examples/parse2.c
+++ b/doc/examples/parse2.c
@@ -60,13 +60,5 @@ int main(int argc, char **argv) {
exampleFunc(argv[1]);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/parse3.c b/doc/examples/parse3.c
index 076a786a..15349dcc 100644
--- a/doc/examples/parse3.c
+++ b/doc/examples/parse3.c
@@ -48,13 +48,5 @@ int main(void) {
example3Func(document, 6);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/parse4.c b/doc/examples/parse4.c
index ae8d332a..eaeab40c 100644
--- a/doc/examples/parse4.c
+++ b/doc/examples/parse4.c
@@ -125,14 +125,6 @@ int main(int argc, char **argv) {
fprintf(stderr, "Failed to parse %s\n", argv[1]);
}
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
#else /* ! LIBXML_PUSH_ENABLED */
diff --git a/doc/examples/reader1.c b/doc/examples/reader1.c
index 10301686..eafb6e1d 100644
--- a/doc/examples/reader1.c
+++ b/doc/examples/reader1.c
@@ -88,14 +88,6 @@ int main(int argc, char **argv) {
streamFile(argv[1]);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/reader2.c b/doc/examples/reader2.c
index 9c2d2e6b..d8d7f924 100644
--- a/doc/examples/reader2.c
+++ b/doc/examples/reader2.c
@@ -103,14 +103,6 @@ int main(int argc, char **argv) {
streamFile(argv[1]);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/reader3.c b/doc/examples/reader3.c
index f6082979..d6a43b1b 100644
--- a/doc/examples/reader3.c
+++ b/doc/examples/reader3.c
@@ -100,15 +100,6 @@ int main(int argc, char **argv) {
xmlFreeDoc(doc);
}
-
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/reader4.c b/doc/examples/reader4.c
index f4277ec4..3c0d1b97 100644
--- a/doc/examples/reader4.c
+++ b/doc/examples/reader4.c
@@ -103,14 +103,6 @@ int main(int argc, char **argv) {
*/
xmlFreeTextReader(readerPtr);
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
diff --git a/doc/examples/testWriter.c b/doc/examples/testWriter.c
index a77eec71..948cf16f 100644
--- a/doc/examples/testWriter.c
+++ b/doc/examples/testWriter.c
@@ -48,14 +48,6 @@ main(void)
/* next, the tree version */
testXmlwriterTree("writer4.tmp");
- /*
- * Cleanup function for the XML library.
- */
- xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return 0;
}
diff --git a/doc/examples/tree1.c b/doc/examples/tree1.c
index e8fc8d1b..28fc1b70 100644
--- a/doc/examples/tree1.c
+++ b/doc/examples/tree1.c
@@ -78,12 +78,6 @@ main(int argc, char **argv)
/*free the document */
xmlFreeDoc(doc);
- /*
- *Free the global variables that may
- *have been allocated by the parser.
- */
- xmlCleanupParser();
-
return 0;
}
#else
diff --git a/doc/examples/tree2.c b/doc/examples/tree2.c
index 83f29a0b..78dcac14 100644
--- a/doc/examples/tree2.c
+++ b/doc/examples/tree2.c
@@ -97,16 +97,6 @@ main(int argc, char **argv)
/*free the document */
xmlFreeDoc(doc);
- /*
- *Free the global variables that may
- *have been allocated by the parser.
- */
- xmlCleanupParser();
-
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(0);
}
#else
diff --git a/doc/examples/xpath1.c b/doc/examples/xpath1.c
index af996e69..14efcbab 100644
--- a/doc/examples/xpath1.c
+++ b/doc/examples/xpath1.c
@@ -45,13 +45,6 @@ main(int argc, char **argv) {
return(-1);
}
- /* Shutdown libxml */
- xmlCleanupParser();
-
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return 0;
}
diff --git a/doc/examples/xpath2.c b/doc/examples/xpath2.c
index a17a0256..bf4e631d 100644
--- a/doc/examples/xpath2.c
+++ b/doc/examples/xpath2.c
@@ -47,13 +47,6 @@ main(int argc, char **argv) {
return(-1);
}
- /* Shutdown libxml */
- xmlCleanupParser();
-
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return 0;
}
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index b36fea54..303da576 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -885,6 +885,7 @@
<exports symbol='IS_PUBIDCHAR' type='macro'/>
<exports symbol='IS_PUBIDCHAR_CH' type='macro'/>
<exports symbol='XML_MAX_DICTIONARY_LIMIT' type='macro'/>
+ <exports symbol='XML_MAX_HUGE_LENGTH' type='macro'/>
<exports symbol='XML_MAX_LOOKUP_LIMIT' type='macro'/>
<exports symbol='XML_MAX_NAMELEN' type='macro'/>
<exports symbol='XML_MAX_NAME_LENGTH' type='macro'/>
@@ -2786,6 +2787,7 @@
<exports symbol='xmlMemRealloc' type='function'/>
<exports symbol='xmlMemSetup' type='function'/>
<exports symbol='xmlMemShow' type='function'/>
+ <exports symbol='xmlMemSize' type='function'/>
<exports symbol='xmlMemStrdupLoc' type='function'/>
<exports symbol='xmlMemUsed' type='function'/>
<exports symbol='xmlMemoryDump' type='function'/>
@@ -4133,6 +4135,9 @@
<macro name='XML_MAX_DICTIONARY_LIMIT' file='parserInternals'>
<info>Maximum size allowed by the parser for a dictionary by default This is not a limitation of the parser but a safety boundary feature, use XML_PARSE_HUGE option to override it. Introduced in 2.9.0</info>
</macro>
+ <macro name='XML_MAX_HUGE_LENGTH' file='parserInternals'>
+ <info>Maximum size allowed when XML_PARSE_HUGE is set.</info>
+ </macro>
<macro name='XML_MAX_LOOKUP_LIMIT' file='parserInternals'>
<info>Maximum size allowed by the parser for ahead lookup This is an upper boundary enforced by the parser to avoid bad behaviour on &quot;unfriendly&apos; content Introduced in 2.9.0</info>
</macro>
@@ -6129,9 +6134,8 @@ set at the end of parsing'/>
<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 this is also used to count entities
-* references done from that entity
-* and if it contains &apos;&lt;&apos;'/>
+ <field name='flags' type='int' info=' various flags'/>
+ <field name='expandedSize' type='unsigned long' info=' expanded size'/>
</struct>
<typedef name='xmlEntityPtr' file='tree' type='xmlEntity *'/>
<typedef name='xmlEntityType' file='entities' type='enum'/>
@@ -6374,7 +6378,7 @@ 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='nbentities' type='unsigned long' info=' unused'/>
<field name='sizeentities' type='unsigned long' info=' size of parsed entities for use by HTML non-recursive parser'/>
<field name='nodeInfo' type='xmlParserNodeInfo *' info=' Current NodeInfo'/>
<field name='nodeInfoNr' type='int' info=' Depth of the parsing stack'/>
@@ -6383,6 +6387,8 @@ actually an xmlCharEncoding'/>
<field name='input_id' type='int' info=' we need to label inputs'/>
<field name='sizeentcopy' type='unsigned long' info=' volume of entity copy'/>
<field name='endCheckState' type='int' info=' quote state for push parser'/>
+ <field name='nbErrors' type='unsigned short' info=' number of errors'/>
+ <field name='nbWarnings' type='unsigned short' info=' number of warnings'/>
</struct>
<typedef name='xmlParserCtxtPtr' file='tree' type='xmlParserCtxt *'/>
<typedef name='xmlParserErrors' file='xmlerror' type='enum'/>
@@ -6395,16 +6401,15 @@ actually an xmlCharEncoding'/>
<field name='end' type='const xmlChar *' info=' end of the array to parse'/>
<field name='length' type='int' info=' length if known'/>
<field name='line' type='int' info=' Current line'/>
- <field name='col' type='int' info='* NOTE: consumed is only tested for equality in the parser code,
-* so even if there is an overflow this should not give troubles
-* for parsing very large instances.
-*'/>
+ <field name='col' type='int' info=' Current column'/>
<field name='consumed' type='unsigned long' info=' How many xmlChars already consumed'/>
<field name='free' type='xmlParserInputDeallocate' info=' function to deallocate the base'/>
<field name='encoding' type='const xmlChar *' info=' the encoding string for entity'/>
<field name='version' type='const xmlChar *' info=' the version string for entity'/>
<field name='standalone' type='int' info=' Was that entity marked standalone'/>
<field name='id' type='int' info=' an unique identifier for the entity'/>
+ <field name='parentConsumed' type='unsigned long' info=' consumed bytes from parents'/>
+ <field name='entity' type='xmlEntityPtr' info=' entity, if any'/>
</struct>
<struct name='xmlParserInputBuffer' file='tree' type='struct _xmlParserInputBuffer'>
<field name='context' type='void *' info=''/>
@@ -6898,7 +6903,7 @@ Could we use @subtypes for this?'/>
<field name='comp' type='xmlXPathCompExprPtr' info=' the precompiled expression'/>
<field name='xptr' type='int' info=' it this an XPointer expression'/>
<field name='ancestor' type='xmlNodePtr' info=' used for walking preceding axis'/>
- <field name='valueFrame' type='int' info=' used to limit Pop on the stack'/>
+ <field name='valueFrame' type='int' info=' unused'/>
</struct>
<typedef name='xmlXPathParserContextPtr' file='xpath' type='xmlXPathParserContext *'/>
<struct name='xmlXPathType' file='xpath' type='struct _xmlXPathType'>
@@ -7880,12 +7885,12 @@ Could we use @subtypes for this?'/>
<arg name='inlen' type='int *' info='the length of @in'/>
</function>
<function name='namePop' file='parserInternals' module='parser'>
- <info>Pops the top element name from the name stack</info>
+ <info>DEPRECATED: Internal function, do not use. Pops the top element name from the name stack</info>
<return type='const xmlChar *' info='the name just removed'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<function name='namePush' file='parserInternals' module='parser'>
- <info>Pushes a new element name on top of the name stack</info>
+ <info>DEPRECATED: Internal function, do not use. Pushes a new element name on top of the name stack</info>
<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='const xmlChar *' info='the element name'/>
@@ -7899,12 +7904,12 @@ Could we use @subtypes for this?'/>
<arg name='prefix' type='const xmlChar *' info='the namespace prefix'/>
</function>
<function name='nodePop' file='parserInternals' module='parser'>
- <info>Pops the top element node from the node stack</info>
+ <info>DEPRECATED: Internal function, do not use. Pops the top element node from the node stack</info>
<return type='xmlNodePtr' info='the node just removed'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
</function>
<function name='nodePush' file='parserInternals' module='parser'>
- <info>Pushes a new element node on top of the node stack</info>
+ <info>DEPRECATED: Internal function, do not use. Pushes a new element node on top of the node stack</info>
<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'/>
@@ -8056,7 +8061,7 @@ Could we use @subtypes for this?'/>
<function name='valuePush' file='xpathInternals' module='xpath'>
<cond>defined(LIBXML_XPATH_ENABLED)</cond>
<info>Pushes a new XPath object on top of the value stack. If value is NULL, a memory error is recorded in the parser context.</info>
- <return type='int' info='the number of items on the value stack, or -1 in case of error.'/>
+ <return type='int' info='the number of items on the value stack, or -1 in case of error. The object is destroyed in case of error.'/>
<arg name='ctxt' type='xmlXPathParserContextPtr' info='an XPath evaluation context'/>
<arg name='value' type='xmlXPathObjectPtr' info='the XPath object'/>
</function>
@@ -8847,8 +8852,8 @@ Could we use @subtypes for this?'/>
<arg name='handler' type='xmlCharEncodingHandler *' info='char encoding transformation data structure'/>
</function>
<function name='xmlCharEncFirstLine' file='encoding' module='encoding'>
- <info>Front-end for the encoding handler input function, but handle only the very first line, i.e. limit itself to 45 chars.</info>
- <return type='int' info='the number of byte written if success, or -1 general error -2 if the transcoding fails (for *in is not valid utf8 string or the result of transformation can&apos;t fit into the encoding we want), or'/>
+ <info>DEPERECATED: Don&apos;t use.</info>
+ <return type='int' info=''/>
<arg name='handler' type='xmlCharEncodingHandler *' info='char encoding transformation data structure'/>
<arg name='out' type='xmlBufferPtr' info='an xmlBuffer for the output.'/>
<arg name='in' type='xmlBufferPtr' info='an xmlBuffer for the input'/>
@@ -8912,7 +8917,7 @@ Could we use @subtypes for this?'/>
<arg name='ret' type='xmlParserInputPtr' info='an XML parser input'/>
</function>
<function name='xmlCheckLanguageID' file='parserInternals' module='parser'>
- <info>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 (&apos;-&apos; Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= (&apos;i&apos; | &apos;I&apos;) &apos;-&apos; ([a-z] | [A-Z])+ [37] UserCode ::= (&apos;x&apos; | &apos;X&apos;) &apos;-&apos; ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+ The current REC reference the successors of RFC 1766, currently 5646 http://www.rfc-editor.org/rfc/rfc5646.txt langtag = language [&quot;-&quot; script] [&quot;-&quot; region] *(&quot;-&quot; variant) *(&quot;-&quot; extension) [&quot;-&quot; privateuse] language = 2*3ALPHA ; shortest ISO 639 code [&quot;-&quot; extlang] ; sometimes followed by ; extended language subtags / 4ALPHA ; or reserved for future use / 5*8ALPHA ; or registered language subtag extlang = 3ALPHA ; selected ISO 639 codes *2(&quot;-&quot; 3ALPHA) ; permanently reserved script = 4ALPHA ; ISO 15924 code region = 2ALPHA ; ISO 3166-1 code / 3DIGIT ; UN M.49 code variant = 5*8alphanum ; registered variants / (DIGIT 3alphanum) extension = singleton 1*(&quot;-&quot; (2*8alphanum)) ; Single alphanumerics ; &quot;x&quot; reserved for private use singleton = DIGIT ; 0 - 9 / %x41-57 ; A - W / %x59-5A ; Y - Z / %x61-77 ; a - w / %x79-7A ; y - z it sounds right to still allow Irregular i-xxx IANA and user codes too The parser below doesn&apos;t try to cope with extension or privateuse that could be added but that&apos;s not interoperable anyway</info>
+ <info>DEPRECATED: Internal function, do not use. 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 (&apos;-&apos; Subcode)* [34] Langcode ::= ISO639Code | IanaCode | UserCode [35] ISO639Code ::= ([a-z] | [A-Z]) ([a-z] | [A-Z]) [36] IanaCode ::= (&apos;i&apos; | &apos;I&apos;) &apos;-&apos; ([a-z] | [A-Z])+ [37] UserCode ::= (&apos;x&apos; | &apos;X&apos;) &apos;-&apos; ([a-z] | [A-Z])+ [38] Subcode ::= ([a-z] | [A-Z])+ The current REC reference the successors of RFC 1766, currently 5646 http://www.rfc-editor.org/rfc/rfc5646.txt langtag = language [&quot;-&quot; script] [&quot;-&quot; region] *(&quot;-&quot; variant) *(&quot;-&quot; extension) [&quot;-&quot; privateuse] language = 2*3ALPHA ; shortest ISO 639 code [&quot;-&quot; extlang] ; sometimes followed by ; extended language subtags / 4ALPHA ; or reserved for future use / 5*8ALPHA ; or registered language subtag extlang = 3ALPHA ; selected ISO 639 codes *2(&quot;-&quot; 3ALPHA) ; permanently reserved script = 4ALPHA ; ISO 15924 code region = 2ALPHA ; ISO 3166-1 code / 3DIGIT ; UN M.49 code variant = 5*8alphanum ; registered variants / (DIGIT 3alphanum) extension = singleton 1*(&quot;-&quot; (2*8alphanum)) ; Single alphanumerics ; &quot;x&quot; reserved for private use singleton = DIGIT ; 0 - 9 / %x41-57 ; A - W / %x59-5A ; Y - Z / %x61-77 ; a - w / %x79-7A ; y - z it sounds right to still allow Irregular i-xxx IANA and user codes too The parser below doesn&apos;t try to cope with extension or privateuse that could be added but that&apos;s not interoperable anyway</info>
<return type='int' info='1 if correct 0 otherwise'/>
<arg name='lang' type='const xmlChar *' info='pointer to the string value'/>
</function>
@@ -9240,7 +9245,7 @@ Could we use @subtypes for this?'/>
<arg name='options' type='int' info='a combination of xmlParserOption'/>
</function>
<function name='xmlCurrentChar' file='parserInternals' module='parserInternals'>
- <info>The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence &quot;#xD#xA&quot; or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)</info>
+ <info>DEPRECATED: Internal function, do not use. The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer. Implement the end of line normalization: 2.11 End-of-Line Handling Wherever an external parsed entity or the literal entity value of an internal parsed entity contains either the literal two-character sequence &quot;#xD#xA&quot; or a standalone literal #xD, an XML processor must pass to the application the single character #xA. This behavior can conveniently be produced by normalizing all line breaks to #xA on input, before parsing.)</info>
<return type='int' info='the current char value and its length'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the XML parser context'/>
<arg name='len' type='int *' info='pointer to the length of the char read'/>
@@ -10966,6 +10971,11 @@ Could we use @subtypes for this?'/>
<arg name='fp' type='FILE *' info='a FILE descriptor used as the output file'/>
<arg name='nr' type='int' info='number of entries to dump'/>
</function>
+ <function name='xmlMemSize' file='xmlmemory' module='xmlmemory'>
+ <info></info>
+ <return type='size_t' info='the size of a memory allocation.'/>
+ <arg name='ptr' type='void *' info='pointer to the memory allocation'/>
+ </function>
<function name='xmlMemStrdupLoc' file='xmlmemory' module='xmlmemory'>
<info>a strdup() equivalent, with logging of the allocation info.</info>
<return type='char *' info='a pointer to the new string or NULL if allocation error occurred.'/>
@@ -11454,7 +11464,7 @@ Could we use @subtypes for this?'/>
<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>
+ <info>DEPRECATED: Internal function, do not use. Create a new input stream based on an xmlEntityPtr</info>
<return type='xmlParserInputPtr' info='the new input stream or NULL'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
<arg name='entity' type='xmlEntityPtr' info='an Entity pointer'/>
@@ -11645,7 +11655,7 @@ Could we use @subtypes for this?'/>
<return type='xmlValidCtxtPtr' info='NULL if not, otherwise the new validation context structure'/>
</function>
<function name='xmlNextChar' file='parserInternals' module='parserInternals'>
- <info>Skip to the next char input char.</info>
+ <info>DEPRECATED: Internal function, do not use. Skip to the next char input char.</info>
<return type='void'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the XML parser context'/>
</function>
@@ -12329,7 +12339,7 @@ Could we use @subtypes for this?'/>
<arg name='filename' type='const char *' info='the path to a file'/>
</function>
<function name='xmlParserHandlePEReference' file='parserInternals' module='parser'>
- <info>[69] PEReference ::= &apos;%&apos; Name &apos;;&apos; [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly. [ 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 &quot;standalone=&apos;yes&apos;&quot;, ... ... The declaration of a parameter entity must precede any reference to it... [ VC: Entity Declared ] In a document with an external subset or external parameter entities with &quot;standalone=&apos;no&apos;&quot;, ... ... The declaration of a parameter entity must precede any reference to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e. - Included in literal in entity values - Included as Parameter Entity reference within DTDs</info>
+ <info>DEPRECATED: Internal function, do not use. [69] PEReference ::= &apos;%&apos; Name &apos;;&apos; [ WFC: No Recursion ] A parsed entity must not contain a recursive reference to itself, either directly or indirectly. [ 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 &quot;standalone=&apos;yes&apos;&quot;, ... ... The declaration of a parameter entity must precede any reference to it... [ VC: Entity Declared ] In a document with an external subset or external parameter entities with &quot;standalone=&apos;no&apos;&quot;, ... ... The declaration of a parameter entity must precede any reference to it... [ WFC: In DTD ] Parameter-entity references may only appear in the DTD. NOTE: misleading but this is handled. A PEReference may have been detected in the current input stream the handling is done accordingly to http://www.w3.org/TR/REC-xml#entproc i.e. - Included in literal in entity values - Included as Parameter Entity reference within DTDs</info>
<return type='void'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the parser context'/>
</function>
@@ -12427,7 +12437,7 @@ Could we use @subtypes for this?'/>
<arg name='len' type='int' info='an indicative size for the lookahead'/>
</function>
<function name='xmlParserInputShrink' file='parserInternals' module='parserInternals'>
- <info>This function removes used input for the parser.</info>
+ <info>DEPRECATED: Don&apos;t use. This function removes used input for the parser.</info>
<return type='void'/>
<arg name='in' type='xmlParserInputPtr' info='an XML parser input'/>
</function>
@@ -13566,7 +13576,7 @@ Could we use @subtypes for this?'/>
</function>
<function name='xmlSchemaCleanupTypes' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
- <info>DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don&apos;t have call cleanup functions at all. Cleanup the default XML Schemas type library</info>
+ <info>DEPRECATED: This function will be made private. Call xmlCleanupParser to free global state but see the warnings there. xmlCleanupParser should be only called once at program exit. In most cases, you don&apos;t have to call cleanup functions at all. Cleanup the default XML Schemas type library</info>
<return type='void'/>
</function>
<function name='xmlSchemaCollapseString' file='xmlschemastypes' module='xmlschemastypes'>
@@ -13713,7 +13723,7 @@ Could we use @subtypes for this?'/>
<function name='xmlSchemaInitTypes' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
<info>Initialize the default XML Schemas type library</info>
- <return type='void'/>
+ <return type='int' info='0 on success, -1 on error.'/>
</function>
<function name='xmlSchemaIsBuiltInTypeFacet' file='xmlschemastypes' module='xmlschemastypes'>
<cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
@@ -14349,7 +14359,7 @@ Could we use @subtypes for this?'/>
<arg name='node2' type='xmlNodePtr' info='unused'/>
</function>
<function name='xmlSkipBlankChars' file='parserInternals' module='parser'>
- <info>skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.</info>
+ <info>DEPRECATED: Internal function, do not use. skip all blanks character found at that point in the input streams. It pops up finished entities in the process if allowable at that point.</info>
<return type='int' info='the number of space chars skipped'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the XML parser context'/>
</function>
@@ -14500,14 +14510,14 @@ Could we use @subtypes for this?'/>
<arg name='streamCtxt' type='xmlStreamCtxtPtr' info='the stream context'/>
</function>
<function name='xmlStringCurrentChar' file='parserInternals' module='parserInternals'>
- <info>The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.</info>
+ <info>DEPRECATED: Internal function, do not use. The current char value, if using UTF-8 this may actually span multiple bytes in the input buffer.</info>
<return type='int' info='the current char value and its length'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the XML parser context'/>
<arg name='cur' type='const xmlChar *' info='pointer to the beginning of the char'/>
<arg name='len' type='int *' info='pointer to the length of the char read'/>
</function>
<function name='xmlStringDecodeEntities' file='parserInternals' module='parser'>
- <info>Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= &apos;%&apos; Name &apos;;&apos;</info>
+ <info>DEPRECATED: Internal function, don&apos;t use. Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= &apos;%&apos; Name &apos;;&apos;</info>
<return type='xmlChar *' info='A newly allocated string with the substitution done. The caller must deallocate it !'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the parser context'/>
<arg name='str' type='const xmlChar *' info='the input string'/>
@@ -14523,7 +14533,7 @@ Could we use @subtypes for this?'/>
<arg name='value' type='const xmlChar *' info='the value of the attribute'/>
</function>
<function name='xmlStringLenDecodeEntities' file='parserInternals' module='parser'>
- <info>Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= &apos;%&apos; Name &apos;;&apos;</info>
+ <info>DEPRECATED: Internal function, don&apos;t use. Takes a entity string content and process to do the adequate substitutions. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= &apos;%&apos; Name &apos;;&apos;</info>
<return type='xmlChar *' info='A newly allocated string with the substitution done. The caller must deallocate it !'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the parser context'/>
<arg name='str' type='const xmlChar *' info='the input string'/>
@@ -14610,7 +14620,7 @@ Could we use @subtypes for this?'/>
<arg name='enc' type='xmlCharEncoding' info='the encoding value (number)'/>
</function>
<function name='xmlSwitchInputEncoding' file='parserInternals' module='parserInternals'>
- <info>DEPRECATED: Use xmlSwitchToEncoding change the input functions when discovering the character encoding of a given entity.</info>
+ <info>change the input functions when discovering the character encoding of a given entity.</info>
<return type='int' info='0 in case of success, -1 otherwise'/>
<arg name='ctxt' type='xmlParserCtxtPtr' info='the parser context'/>
<arg name='input' type='xmlParserInputPtr' info='the input stream'/>
@@ -16979,7 +16989,7 @@ Could we use @subtypes for this?'/>
<return type='int' info='1 if valid or 0 otherwise'/>
<arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
<arg name='doc' type='xmlDocPtr' info='a document instance'/>
- <arg name='elem' type='xmlNodePtr' info='an element instance'/>
+ <arg name='root' type='xmlNodePtr' info=''/>
</function>
<function name='xmlValidateElementDecl' file='valid' module='valid'>
<cond>defined(LIBXML_VALID_ENABLED)</cond>
@@ -17901,7 +17911,7 @@ Could we use @subtypes for this?'/>
<function name='xmlXPathNodeSetMerge' file='xpathInternals' module='xpath'>
<cond>defined(LIBXML_XPATH_ENABLED)</cond>
<info>Merges two nodesets, all nodes from @val2 are added to @val1 if @val1 is NULL, a new set is created and copied from @val2</info>
- <return type='xmlNodeSetPtr' info='@val1 once extended or NULL in case of error.'/>
+ <return type='xmlNodeSetPtr' info='@val1 once extended or NULL in case of error. Frees @val1 in case of error.'/>
<arg name='val1' type='xmlNodeSetPtr' info='the first NodeSet or NULL'/>
<arg name='val2' type='xmlNodeSetPtr' info='the second NodeSet'/>
</function>
@@ -18262,13 +18272,13 @@ Could we use @subtypes for this?'/>
<function name='xmlXPathWrapNodeSet' file='xpathInternals' module='xpath'>
<cond>defined(LIBXML_XPATH_ENABLED)</cond>
<info>Wrap the Nodeset @val in a new xmlXPathObjectPtr</info>
- <return type='xmlXPathObjectPtr' info='the newly created object.'/>
+ <return type='xmlXPathObjectPtr' info='the newly created object. In case of error the node set is destroyed and NULL is returned.'/>
<arg name='val' type='xmlNodeSetPtr' info='the NodePtr value'/>
</function>
<function name='xmlXPathWrapString' file='xpathInternals' module='xpath'>
<cond>defined(LIBXML_XPATH_ENABLED)</cond>
<info>Wraps the @val string into an XPath object.</info>
- <return type='xmlXPathObjectPtr' info='the newly created object.'/>
+ <return type='xmlXPathObjectPtr' info='the newly created object. Frees @val in case of error.'/>
<arg name='val' type='xmlChar *' info='the xmlChar * value'/>
</function>
<function name='xmlXPatherror' file='xpathInternals' module='xpath'>
diff --git a/doc/xmlcatalog.1 b/doc/xmlcatalog.1
index 5605bea8..15ab9f73 100644
--- a/doc/xmlcatalog.1
+++ b/doc/xmlcatalog.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: xmlcatalog
.\" Author: John Fleck <jfleck@inkstain.net>
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 08/17/2022
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 04/26/2023
.\" Manual: xmlcatalog Manual
.\" Source: libxml2
.\" Language: English
.\"
-.TH "XMLCATALOG" "1" "08/17/2022" "libxml2" "xmlcatalog Manual"
+.TH "XMLCATALOG" "1" "04/26/2023" "libxml2" "xmlcatalog Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -31,7 +31,7 @@
xmlcatalog \- Command line tool to parse and manipulate XML or SGML catalog files\&.
.SH "SYNOPSIS"
.HP \w'\fBxmlcatalog\fR\ 'u
-\fBxmlcatalog\fR [\fB\-\-sgml\fR | \fB\-\-shell\fR | \fB\-\-create\fR | \fB\-\-del\ \fR\fB\fIVALUE(S)\fR\fR | [\ \fB\-\-add\ \fR\fB\fITYPE\fR\fR\fB\ \fR\fB\fIORIG\fR\fR\fB\ \fR\fB\fIREPLACE\fR\fR\fB\ \fR\ |\ \fB\-\-add\ \fR\fB\fIFILENAME\fR\fR] | \fB\-\-noout\fR | \fB\-\-no\-super\-update\fR | [\fB\-v\fR\ |\ \fB\-\-verbose\fR]] {\fICATALOGFILE\fR} {\fIENTITIES\fR...}
+\fBxmlcatalog\fR [\fB\-\-sgml\fR | \fB\-\-shell\fR | \fB\-\-convert\fR | \fB\-\-create\fR | \fB\-\-del\ \fR\fB\fIVALUE(S)\fR\fR | [\ \fB\-\-add\ \fR\fB\fITYPE\fR\fR\fB\ \fR\fB\fIORIG\fR\fR\fB\ \fR\fB\fIREPLACE\fR\fR\fB\ \fR\ |\ \fB\-\-add\ \fR\fB\fIFILENAME\fR\fR] | \fB\-\-noout\fR | \fB\-\-no\-super\-update\fR | [\fB\-v\fR\ |\ \fB\-\-verbose\fR]] {\fICATALOGFILE\fR} {\fIENTITIES\fR...}
.SH "DESCRIPTION"
.PP
\fBxmlcatalog\fR
@@ -91,6 +91,11 @@ SGML
catalog files\&.
.RE
.PP
+\fB\-\-convert\fR
+.RS 4
+Convert SGML catalog to XML\&.
+.RE
+.PP
\fB\-\-create\fR
.RS 4
Create a new
@@ -245,9 +250,10 @@ Execute a Formal Public Identifier lookup of the catalog entry for
XML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBXML_CATALOG_FILES\fR
-environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default
+environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default catalog from
/etc/xml/catalog
-catalog\&.
+or, more specifically,
+${sysconfdir}/xml/catalog\&.
.RE
.SH "DIAGNOSTICS"
.PP
diff --git a/doc/xmlcatalog.html b/doc/xmlcatalog.html
index ae2ebabd..01ff8640 100644
--- a/doc/xmlcatalog.html
+++ b/doc/xmlcatalog.html
@@ -1,140 +1,144 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmlcatalog</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="idm1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xmlcatalog &#8212;
- Command line tool to parse and manipulate <acronym class="acronym">XML</acronym>
- or <acronym class="acronym">SGML</acronym> catalog files.
- </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xmlcatalog</code> [ <code class="option">--sgml</code> | <code class="option">--shell</code> | <code class="option">--create</code> | <code class="option">--del <em class="replaceable"><code>VALUE(S)</code></em></code> |
- [
- <code class="option">--add
- <em class="replaceable"><code>TYPE</code></em>
- <em class="replaceable"><code>ORIG</code></em>
- <em class="replaceable"><code>REPLACE</code></em>
- </code>
- | <code class="option">--add <em class="replaceable"><code>FILENAME</code></em></code> ]
- | <code class="option">--noout</code> | <code class="option">--no-super-update</code> |
- [ <code class="option">-v</code> | <code class="option">--verbose</code> ]
- ] {<em class="replaceable"><code>CATALOGFILE</code></em>} {<em class="replaceable"><code>ENTITIES</code></em>...}</p></div></div><div class="refsect1"><a name="description"></a><h2>DESCRIPTION</h2><p>
- <span class="command"><strong>xmlcatalog</strong></span> is a command line application allowing users to monitor and
- manipulate <acronym class="acronym">XML</acronym> and <acronym class="acronym">SGML</acronym> catalogs. It
- is included in <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>.
- </p><p>
- Its functions can be invoked from a single command from the command line,
- or it can perform multiple functions in interactive mode. It can operate
- on both <acronym class="acronym">XML</acronym> and <acronym class="acronym">SGML</acronym> files.
- </p></div><div class="refsect1"><a name="options"></a><h2>OPTIONS</h2><p>
- <span class="command"><strong>xmlcatalog</strong></span> accepts the following options (in alphabetical order):
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
- <code class="option">--add
- <em class="replaceable"><code>TYPE</code></em>
- <em class="replaceable"><code>ORIG</code></em>
- <em class="replaceable"><code>REPLACE</code></em>
- </code>
- </span></dt><dd><p>
- Add an entry to <code class="filename">CATALOGFILE</code>. <em class="replaceable"><code>TYPE</code></em>
- indicates the type of entry. Possible types are: <span class="simplelist"><em class="parameter"><code>public</code></em>, <em class="parameter"><code>system</code></em>, <em class="parameter"><code>uri</code></em>, <em class="parameter"><code>rewriteSystem</code></em>, <em class="parameter"><code>rewriteURI</code></em>, <em class="parameter"><code>delegatePublic</code></em>, <em class="parameter"><code>delegateSystem</code></em>, <em class="parameter"><code>delegateURI</code></em>, <em class="parameter"><code>nextCatalog</code></em></span>. <em class="replaceable"><code>ORIG</code></em> is the original
- reference to be replaced, and <em class="replaceable"><code>REPLACE</code></em>
- is the <acronym class="acronym">URI</acronym> of the replacement entity to be
- used. The <code class="option">--add</code> option will not overwrite
- <code class="filename">CATALOGFILE</code>, outputting
- to <code class="filename">stdout</code>, unless
- <code class="option">--noout</code> is used. The <code class="option">--add</code> will
- always take three parameters even if some of the <acronym class="acronym">XML</acronym>
- catalog constructs will have only a single argument.
- </p></dd><dt><span class="term"><code class="option">--add <em class="replaceable"><code>FILENAME</code></em></code></span></dt><dd><p>
- If the <code class="option">--add</code> option is used following
- the <code class="option">--sgml</code> option, only a single argument,
- a <em class="replaceable"><code>FILENAME</code></em>, is used. This is used to add
- the name of a catalog file to an <acronym class="acronym">SGML</acronym> supercatalog,
- a file that contains references to other included <acronym class="acronym">SGML</acronym>
- catalog files.
- </p></dd><dt><span class="term"><code class="option">--create</code></span></dt><dd><p>
- Create a new <acronym class="acronym">XML</acronym> catalog. Outputs
- to <code class="filename">stdout</code>,
- ignoring <em class="replaceable"><code>filename</code></em> unless <code class="option">--noout</code> is
- used, in which case it creates a new catalog
- file <em class="replaceable"><code>filename</code></em>.
- </p></dd><dt><span class="term"><code class="option">--del <em class="replaceable"><code>VALUE(S)</code></em></code></span></dt><dd><p>
- Remove entries from <em class="replaceable"><code>CATALOGFILE</code></em>
- matching <em class="replaceable"><code>VALUE(S)</code></em>. The <code class="option">--del</code>
- option will not overwrite <em class="replaceable"><code>CATALOGFILE</code></em>,
- outputting to <code class="filename">stdout</code>,
- unless <code class="option">--noout</code> is used.
- </p></dd><dt><span class="term"><code class="option">--noout</code></span></dt><dd><p>
- Save output to the named file rather than outputting
- to <code class="filename">stdout</code>.
- </p></dd><dt><span class="term"><code class="option">--no-super-update</code></span></dt><dd><p>
- Do not update the <acronym class="acronym">SGML</acronym> super catalog.
- </p></dd><dt><span class="term"><code class="option">--shell</code></span></dt><dd><p>
- Run a shell allowing interactive queries on catalog
- file <em class="replaceable"><code>CATALOGFILE</code></em>. For the set of available
- commands see <a class="xref" href="#shell" title="SHELL COMMANDS">the section called &#8220;SHELL COMMANDS&#8221;</a>.
- </p></dd><dt><span class="term"><code class="option">--sgml</code></span></dt><dd><p>
- Uses <acronym class="acronym">SGML</acronym> super catalogs for <code class="option">--add</code>
- and <code class="option">--del</code> options.
- </p></dd><dt><span class="term"><code class="option">-v</code>, </span><span class="term"><code class="option">--verbose</code></span></dt><dd><p>Output debugging information.</p></dd></dl></div><p>
- Invoking <span class="command"><strong>xmlcatalog</strong></span> non-interactively without a designated action
- (imposed with options like <code class="option">--add</code>) will result in a lookup
- of the catalog entry for <em class="replaceable"><code>ENTITIES</code></em> in the
- catalog denoted with <em class="replaceable"><code>CATALOGFILE</code></em>. The
- corresponding entries will be output to the command line. This mode of
- operation, together with <code class="option">--shell</code> mode and non-modifying
- (i.e. without <code class="option">--noout</code>) direct actions, allows for
- a special shortcut of the void <em class="replaceable"><code>CATALOGFILE</code></em>
- specification (possibly expressed as "" in the shell
- environment) appointing the default system catalog. That simplifies the
- handling when its exact location is irrelevant but the respective built-in
- still needs to be consulted.
- </p></div><div class="refsect1"><a name="shell"></a><h2>SHELL COMMANDS</h2><p>
- Invoking <span class="command"><strong>xmlcatalog</strong></span> with
- the <code class="option">--shell <em class="replaceable"><code>CATALOGFILE</code></em></code> option opens
- a command line shell allowing interactive access to the catalog file
- identified by <em class="replaceable"><code>CATALOGFILE</code></em>. Invoking the shell
- provides a command line prompt after which the following commands (described in
- alphabetical order) can be entered.
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
- <code class="option">add
- <em class="replaceable"><code>TYPE</code></em>
- <em class="replaceable"><code>ORIG</code></em>
- <em class="replaceable"><code>REPLACE</code></em>
- </code>
- </span></dt><dd><p>
- Add an entry to the catalog file. <em class="replaceable"><code>TYPE</code></em>
- indicates the type of entry. Possible types are: <span class="simplelist"><em class="parameter"><code>public</code></em>, <em class="parameter"><code>system</code></em>, <em class="parameter"><code>uri</code></em>, <em class="parameter"><code>rewriteSystem</code></em>, <em class="parameter"><code>rewriteURI</code></em>, <em class="parameter"><code>delegatePublic</code></em>, <em class="parameter"><code>delegateSystem</code></em>, <em class="parameter"><code>delegateURI</code></em>, <em class="parameter"><code>nextCatalog</code></em></span>. <em class="replaceable"><code>ORIG</code></em> is the original
- reference to be replaced, and <em class="replaceable"><code>REPLACE</code></em>
- is the <acronym class="acronym">URI</acronym> of the replacement entity to be
- used. The <code class="option">--add</code> option will not overwrite
- <code class="filename">CATALOGFILE</code>, outputting
- to <code class="filename">stdout</code>, unless
- <code class="option">--noout</code> is used. The <code class="option">--add</code> will
- always take three parameters even if some of the <acronym class="acronym">XML</acronym>
- catalog constructs will have only a single argument.
- </p></dd><dt><span class="term"><code class="option">debug</code></span></dt><dd><p>
- Print debugging statements showing the steps <span class="command"><strong>xmlcatalog</strong></span> is executing.
- </p></dd><dt><span class="term"><code class="option">del <em class="replaceable"><code>VALUE(S)</code></em></code></span></dt><dd><p>
- Remove the catalog entry corresponding to <em class="replaceable"><code>VALUE(S)</code></em>.
- </p></dd><dt><span class="term"><code class="option">dump</code></span></dt><dd><p>Print the current catalog.</p></dd><dt><span class="term"><code class="option">exit</code></span></dt><dd><p>Quit the shell.</p></dd><dt><span class="term"><code class="option">public <em class="replaceable"><code>PUBLIC-ID</code></em></code></span></dt><dd><p>
- Execute a Formal Public Identifier lookup of the catalog entry
- for <em class="replaceable"><code>PUBLIC-ID</code></em>. The corresponding entry will be
- output to the command line.
- </p></dd><dt><span class="term"><code class="option">quiet</code></span></dt><dd><p>Stop printing debugging statements.</p></dd><dt><span class="term"><code class="option">system <em class="replaceable"><code>SYSTEM-ID</code></em></code></span></dt><dd><p>
- Execute a Formal Public Identifier lookup of the catalog entry
- for <em class="replaceable"><code>SYSTEM-ID</code></em>. The corresponding entry will be
- output to the command line.
- </p></dd></dl></div></div><div class="refsect1"><a name="environment"></a><h2>ENVIRONMENT</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">XML_CATALOG_FILES</code></span></dt><dd><p><acronym class="acronym">XML</acronym> catalog behavior can be changed by redirecting
- queries to the user's own set of catalogs. This can be done by setting
- the <code class="envar">XML_CATALOG_FILES</code> environment variable to a space-separated
- list of catalogs. Use percent-encoding to escape spaces or other characters.
- An empty variable should deactivate loading the default <code class="filename">/etc/xml/catalog</code> catalog.
- </p></dd></dl></div></div><div class="refsect1"><a name="diagnostics"></a><h2>DIAGNOSTICS</h2><p>
- <span class="command"><strong>xmlcatalog</strong></span> return codes provide information that can be used when
- calling it from scripts.
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">0</span></span></dt><dd><p>No error</p></dd><dt><span class="term"><span class="errorcode">1</span></span></dt><dd><p>Failed to remove an entry from the catalog</p></dd><dt><span class="term"><span class="errorcode">2</span></span></dt><dd><p>Failed to save to the catalog, check file permissions</p></dd><dt><span class="term"><span class="errorcode">3</span></span></dt><dd><p>Failed to add an entry to the catalog</p></dd><dt><span class="term"><span class="errorcode">4</span></span></dt><dd><p>Failed to look up an entry in the catalog</p></dd></dl></div></div><div class="refsect1"><a name="seealso"></a><h2>SEE ALSO</h2><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>
- </p><p>
- More information can be found at
- </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> web page <a class="ulink" href="https://gitlab.gnome.org/GNOME/libxml2" target="_top">https://gitlab.gnome.org/GNOME/libxml2</a>
- </p></li><li class="listitem"><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> catalog support web page
- at <a class="ulink" href="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support" target="_top">https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support</a>
- </p></li><li class="listitem"><p>James Clark's <acronym class="acronym">SGML</acronym> catalog
- page <a class="ulink" href="http://www.jclark.com/sp/catalog.htm" target="_top">http://www.jclark.com/sp/catalog.htm</a>
- </p></li><li class="listitem"><p><acronym class="acronym">OASIS</acronym> <acronym class="acronym">XML</acronym> catalog specification
- <a class="ulink" href="http://www.oasis-open.org/committees/entity/spec.html" target="_top">http://www.oasis-open.org/committees/entity/spec.html</a>
- </p></li></ul></div><p>
- </p></div></div></body></html>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmlcatalog</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="idm1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xmlcatalog &#8212;
+ Command line tool to parse and manipulate <acronym class="acronym">XML</acronym>
+ or <acronym class="acronym">SGML</acronym> catalog files.
+ </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xmlcatalog</code> [ <code class="option">--sgml</code> | <code class="option">--shell</code> | <code class="option">--convert</code> | <code class="option">--create</code> | <code class="option">--del <em class="replaceable"><code>VALUE(S)</code></em></code> |
+ [
+ <code class="option">--add
+ <em class="replaceable"><code>TYPE</code></em>
+ <em class="replaceable"><code>ORIG</code></em>
+ <em class="replaceable"><code>REPLACE</code></em>
+ </code>
+ | <code class="option">--add <em class="replaceable"><code>FILENAME</code></em></code> ]
+ | <code class="option">--noout</code> | <code class="option">--no-super-update</code> |
+ [ <code class="option">-v</code> | <code class="option">--verbose</code> ]
+ ] {<em class="replaceable"><code>CATALOGFILE</code></em>} {<em class="replaceable"><code>ENTITIES</code></em>...}</p></div></div><div class="refsect1"><a name="description"></a><h2>DESCRIPTION</h2><p>
+ <span class="command"><strong>xmlcatalog</strong></span> is a command line application allowing users to monitor and
+ manipulate <acronym class="acronym">XML</acronym> and <acronym class="acronym">SGML</acronym> catalogs. It
+ is included in <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>.
+ </p><p>
+ Its functions can be invoked from a single command from the command line,
+ or it can perform multiple functions in interactive mode. It can operate
+ on both <acronym class="acronym">XML</acronym> and <acronym class="acronym">SGML</acronym> files.
+ </p></div><div class="refsect1"><a name="options"></a><h2>OPTIONS</h2><p>
+ <span class="command"><strong>xmlcatalog</strong></span> accepts the following options (in alphabetical order):
+ </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
+ <code class="option">--add
+ <em class="replaceable"><code>TYPE</code></em>
+ <em class="replaceable"><code>ORIG</code></em>
+ <em class="replaceable"><code>REPLACE</code></em>
+ </code>
+ </span></dt><dd><p>
+ Add an entry to <code class="filename">CATALOGFILE</code>. <em class="replaceable"><code>TYPE</code></em>
+ indicates the type of entry. Possible types are: <span class="simplelist"><em class="parameter"><code>public</code></em>, <em class="parameter"><code>system</code></em>, <em class="parameter"><code>uri</code></em>, <em class="parameter"><code>rewriteSystem</code></em>, <em class="parameter"><code>rewriteURI</code></em>, <em class="parameter"><code>delegatePublic</code></em>, <em class="parameter"><code>delegateSystem</code></em>, <em class="parameter"><code>delegateURI</code></em>, <em class="parameter"><code>nextCatalog</code></em></span>. <em class="replaceable"><code>ORIG</code></em> is the original
+ reference to be replaced, and <em class="replaceable"><code>REPLACE</code></em>
+ is the <acronym class="acronym">URI</acronym> of the replacement entity to be
+ used. The <code class="option">--add</code> option will not overwrite
+ <code class="filename">CATALOGFILE</code>, outputting
+ to <code class="filename">stdout</code>, unless
+ <code class="option">--noout</code> is used. The <code class="option">--add</code> will
+ always take three parameters even if some of the <acronym class="acronym">XML</acronym>
+ catalog constructs will have only a single argument.
+ </p></dd><dt><span class="term"><code class="option">--add <em class="replaceable"><code>FILENAME</code></em></code></span></dt><dd><p>
+ If the <code class="option">--add</code> option is used following
+ the <code class="option">--sgml</code> option, only a single argument,
+ a <em class="replaceable"><code>FILENAME</code></em>, is used. This is used to add
+ the name of a catalog file to an <acronym class="acronym">SGML</acronym> supercatalog,
+ a file that contains references to other included <acronym class="acronym">SGML</acronym>
+ catalog files.
+ </p></dd><dt><span class="term"><code class="option">--convert</code></span></dt><dd><p>
+ Convert SGML catalog to XML.
+ </p></dd><dt><span class="term"><code class="option">--create</code></span></dt><dd><p>
+ Create a new <acronym class="acronym">XML</acronym> catalog. Outputs
+ to <code class="filename">stdout</code>,
+ ignoring <em class="replaceable"><code>filename</code></em> unless <code class="option">--noout</code> is
+ used, in which case it creates a new catalog
+ file <em class="replaceable"><code>filename</code></em>.
+ </p></dd><dt><span class="term"><code class="option">--del <em class="replaceable"><code>VALUE(S)</code></em></code></span></dt><dd><p>
+ Remove entries from <em class="replaceable"><code>CATALOGFILE</code></em>
+ matching <em class="replaceable"><code>VALUE(S)</code></em>. The <code class="option">--del</code>
+ option will not overwrite <em class="replaceable"><code>CATALOGFILE</code></em>,
+ outputting to <code class="filename">stdout</code>,
+ unless <code class="option">--noout</code> is used.
+ </p></dd><dt><span class="term"><code class="option">--noout</code></span></dt><dd><p>
+ Save output to the named file rather than outputting
+ to <code class="filename">stdout</code>.
+ </p></dd><dt><span class="term"><code class="option">--no-super-update</code></span></dt><dd><p>
+ Do not update the <acronym class="acronym">SGML</acronym> super catalog.
+ </p></dd><dt><span class="term"><code class="option">--shell</code></span></dt><dd><p>
+ Run a shell allowing interactive queries on catalog
+ file <em class="replaceable"><code>CATALOGFILE</code></em>. For the set of available
+ commands see <a class="xref" href="#shell" title="SHELL COMMANDS">the section called &#8220;SHELL COMMANDS&#8221;</a>.
+ </p></dd><dt><span class="term"><code class="option">--sgml</code></span></dt><dd><p>
+ Uses <acronym class="acronym">SGML</acronym> super catalogs for <code class="option">--add</code>
+ and <code class="option">--del</code> options.
+ </p></dd><dt><span class="term"><code class="option">-v</code>, </span><span class="term"><code class="option">--verbose</code></span></dt><dd><p>Output debugging information.</p></dd></dl></div><p>
+ Invoking <span class="command"><strong>xmlcatalog</strong></span> non-interactively without a designated action
+ (imposed with options like <code class="option">--add</code>) will result in a lookup
+ of the catalog entry for <em class="replaceable"><code>ENTITIES</code></em> in the
+ catalog denoted with <em class="replaceable"><code>CATALOGFILE</code></em>. The
+ corresponding entries will be output to the command line. This mode of
+ operation, together with <code class="option">--shell</code> mode and non-modifying
+ (i.e. without <code class="option">--noout</code>) direct actions, allows for
+ a special shortcut of the void <em class="replaceable"><code>CATALOGFILE</code></em>
+ specification (possibly expressed as "" in the shell
+ environment) appointing the default system catalog. That simplifies the
+ handling when its exact location is irrelevant but the respective built-in
+ still needs to be consulted.
+ </p></div><div class="refsect1"><a name="shell"></a><h2>SHELL COMMANDS</h2><p>
+ Invoking <span class="command"><strong>xmlcatalog</strong></span> with
+ the <code class="option">--shell <em class="replaceable"><code>CATALOGFILE</code></em></code> option opens
+ a command line shell allowing interactive access to the catalog file
+ identified by <em class="replaceable"><code>CATALOGFILE</code></em>. Invoking the shell
+ provides a command line prompt after which the following commands (described in
+ alphabetical order) can be entered.
+ </p><div class="variablelist"><dl class="variablelist"><dt><span class="term">
+ <code class="option">add
+ <em class="replaceable"><code>TYPE</code></em>
+ <em class="replaceable"><code>ORIG</code></em>
+ <em class="replaceable"><code>REPLACE</code></em>
+ </code>
+ </span></dt><dd><p>
+ Add an entry to the catalog file. <em class="replaceable"><code>TYPE</code></em>
+ indicates the type of entry. Possible types are: <span class="simplelist"><em class="parameter"><code>public</code></em>, <em class="parameter"><code>system</code></em>, <em class="parameter"><code>uri</code></em>, <em class="parameter"><code>rewriteSystem</code></em>, <em class="parameter"><code>rewriteURI</code></em>, <em class="parameter"><code>delegatePublic</code></em>, <em class="parameter"><code>delegateSystem</code></em>, <em class="parameter"><code>delegateURI</code></em>, <em class="parameter"><code>nextCatalog</code></em></span>. <em class="replaceable"><code>ORIG</code></em> is the original
+ reference to be replaced, and <em class="replaceable"><code>REPLACE</code></em>
+ is the <acronym class="acronym">URI</acronym> of the replacement entity to be
+ used. The <code class="option">--add</code> option will not overwrite
+ <code class="filename">CATALOGFILE</code>, outputting
+ to <code class="filename">stdout</code>, unless
+ <code class="option">--noout</code> is used. The <code class="option">--add</code> will
+ always take three parameters even if some of the <acronym class="acronym">XML</acronym>
+ catalog constructs will have only a single argument.
+ </p></dd><dt><span class="term"><code class="option">debug</code></span></dt><dd><p>
+ Print debugging statements showing the steps <span class="command"><strong>xmlcatalog</strong></span> is executing.
+ </p></dd><dt><span class="term"><code class="option">del <em class="replaceable"><code>VALUE(S)</code></em></code></span></dt><dd><p>
+ Remove the catalog entry corresponding to <em class="replaceable"><code>VALUE(S)</code></em>.
+ </p></dd><dt><span class="term"><code class="option">dump</code></span></dt><dd><p>Print the current catalog.</p></dd><dt><span class="term"><code class="option">exit</code></span></dt><dd><p>Quit the shell.</p></dd><dt><span class="term"><code class="option">public <em class="replaceable"><code>PUBLIC-ID</code></em></code></span></dt><dd><p>
+ Execute a Formal Public Identifier lookup of the catalog entry
+ for <em class="replaceable"><code>PUBLIC-ID</code></em>. The corresponding entry will be
+ output to the command line.
+ </p></dd><dt><span class="term"><code class="option">quiet</code></span></dt><dd><p>Stop printing debugging statements.</p></dd><dt><span class="term"><code class="option">system <em class="replaceable"><code>SYSTEM-ID</code></em></code></span></dt><dd><p>
+ Execute a Formal Public Identifier lookup of the catalog entry
+ for <em class="replaceable"><code>SYSTEM-ID</code></em>. The corresponding entry will be
+ output to the command line.
+ </p></dd></dl></div></div><div class="refsect1"><a name="environment"></a><h2>ENVIRONMENT</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">XML_CATALOG_FILES</code></span></dt><dd><p><acronym class="acronym">XML</acronym> catalog behavior can be changed by redirecting
+ queries to the user's own set of catalogs. This can be done by setting
+ the <code class="envar">XML_CATALOG_FILES</code> environment variable to a space-separated
+ list of catalogs. Use percent-encoding to escape spaces or other characters.
+ An empty variable should deactivate loading the default catalog from
+ <code class="filename">/etc/xml/catalog</code> or, more specifically,
+ <code class="filename">${sysconfdir}/xml/catalog</code>.
+ </p></dd></dl></div></div><div class="refsect1"><a name="diagnostics"></a><h2>DIAGNOSTICS</h2><p>
+ <span class="command"><strong>xmlcatalog</strong></span> return codes provide information that can be used when
+ calling it from scripts.
+ </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">0</span></span></dt><dd><p>No error</p></dd><dt><span class="term"><span class="errorcode">1</span></span></dt><dd><p>Failed to remove an entry from the catalog</p></dd><dt><span class="term"><span class="errorcode">2</span></span></dt><dd><p>Failed to save to the catalog, check file permissions</p></dd><dt><span class="term"><span class="errorcode">3</span></span></dt><dd><p>Failed to add an entry to the catalog</p></dd><dt><span class="term"><span class="errorcode">4</span></span></dt><dd><p>Failed to look up an entry in the catalog</p></dd></dl></div></div><div class="refsect1"><a name="seealso"></a><h2>SEE ALSO</h2><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>
+ </p><p>
+ More information can be found at
+ </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> web page <a class="ulink" href="https://gitlab.gnome.org/GNOME/libxml2" target="_top">https://gitlab.gnome.org/GNOME/libxml2</a>
+ </p></li><li class="listitem"><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> catalog support web page
+ at <a class="ulink" href="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support" target="_top">https://gitlab.gnome.org/GNOME/libxml2/-/wikis/Catalog-support</a>
+ </p></li><li class="listitem"><p>James Clark's <acronym class="acronym">SGML</acronym> catalog
+ page <a class="ulink" href="http://www.jclark.com/sp/catalog.htm" target="_top">http://www.jclark.com/sp/catalog.htm</a>
+ </p></li><li class="listitem"><p><acronym class="acronym">OASIS</acronym> <acronym class="acronym">XML</acronym> catalog specification
+ <a class="ulink" href="http://www.oasis-open.org/committees/entity/spec.html" target="_top">http://www.oasis-open.org/committees/entity/spec.html</a>
+ </p></li></ul></div><p>
+ </p></div></div></body></html>
diff --git a/doc/xmllint.1 b/doc/xmllint.1
index 512dfd6b..a6b9ba6e 100644
--- a/doc/xmllint.1
+++ b/doc/xmllint.1
@@ -1,13 +1,13 @@
'\" t
.\" Title: xmllint
.\" Author: John Fleck <jfleck@inkstain.net>
-.\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\" Date: 08/17/2022
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 04/26/2023
.\" Manual: xmllint Manual
.\" Source: libxml2
.\" Language: English
.\"
-.TH "XMLLINT" "1" "08/17/2022" "libxml2" "xmllint Manual"
+.TH "XMLLINT" "1" "04/26/2023" "libxml2" "xmllint Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -31,7 +31,7 @@
xmllint \- command line XML tool
.SH "SYNOPSIS"
.HP \w'\fBxmllint\fR\ 'u
-\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR] {\fIXML\-FILE(S)\fR... | \-}
+\fBxmllint\fR [\fB\-\-version\fR | \fB\-\-debug\fR | \fB\-\-quiet\fR | \fB\-\-shell\fR | \fB\-\-xpath\ "\fR\fB\fIXPath_expression\fR\fR\fB"\fR | \fB\-\-debugent\fR | \fB\-\-copy\fR | \fB\-\-recover\fR | \fB\-\-nodict\fR | \fB\-\-noent\fR | \fB\-\-noout\fR | \fB\-\-nonet\fR | \fB\-\-path\ "\fR\fB\fIPATH(S)\fR\fR\fB"\fR | \fB\-\-load\-trace\fR | \fB\-\-htmlout\fR | \fB\-\-nowrap\fR | \fB\-\-valid\fR | \fB\-\-postvalid\fR | \fB\-\-dtdvalid\ \fR\fB\fIURL\fR\fR | \fB\-\-dtdvalidfpi\ \fR\fB\fIFPI\fR\fR | \fB\-\-timing\fR | \fB\-\-output\ \fR\fB\fIFILE\fR\fR | \fB\-\-repeat\fR | \fB\-\-insert\fR | \fB\-\-compress\fR | \fB\-\-html\fR | \fB\-\-xmlout\fR | \fB\-\-push\fR | \fB\-\-memory\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-encode\ \fR\fB\fIENCODING\fR\fR | \fB\-\-dropdtd\fR | \fB\-\-nsclean\fR | \fB\-\-testIO\fR | \fB\-\-catalogs\fR | \fB\-\-nocatalogs\fR | \fB\-\-auto\fR | \fB\-\-xinclude\fR | \fB\-\-noxincludenode\fR | \fB\-\-loaddtd\fR | \fB\-\-dtdattr\fR | \fB\-\-stream\fR | \fB\-\-walker\fR | \fB\-\-pattern\ \fR\fB\fIPATTERNVALUE\fR\fR | \fB\-\-chkregister\fR | \fB\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR | \fB\-\-pedantic\fR] {\fIXML\-FILE(S)\fR... | \-}
.HP \w'\fBxmllint\fR\ 'u
\fBxmllint\fR \fB\-\-help\fR
.SH "DESCRIPTION"
@@ -72,6 +72,8 @@ catalog(s) from
XML
catalogs starting from
/etc/xml/catalog
+or, more specifically,
+${sysconfdir}/xml/catalog
are used by default\&.
.RE
.PP
@@ -226,6 +228,11 @@ Do not use any catalogs\&.
Substitute CDATA section by equivalent text nodes\&.
.RE
.PP
+\fB\-\-nodict\fR
+.RS 4
+Don\*(Aqt use dictionaries (parser option XML_PARSE_NODICT)\&. Only for debugging\&.
+.RE
+.PP
\fB\-\-noent\fR
.RS 4
Substitute entity values for entity references\&. By default,
@@ -291,6 +298,11 @@ DTDs or entities\&. Enclose space\-separated lists by quotation marks\&.
Used to exercise the pattern recognition engine, which can be used with the reader interface to the parser\&. It allows to select some nodes in the document based on an XPath (subset) expression\&. Used for debugging\&.
.RE
.PP
+\fB\-\-pedantic\fR
+.RS 4
+Enable additional warnings\&.
+.RE
+.PP
\fB\-\-postvalid\fR
.RS 4
Validate after parsing has completed\&.
@@ -301,6 +313,11 @@ Validate after parsing has completed\&.
Use the push mode of the parser\&.
.RE
.PP
+\fB\-\-quiet\fR
+.RS 4
+Don\*(Aqt print informational messages to stderr\&.
+.RE
+.PP
\fB\-\-recover\fR
.RS 4
Output any parsable portions of an invalid document\&.
@@ -501,9 +518,7 @@ Write the current node to the given filename\&.
SGML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBSGML_CATALOG_FILES\fR
-environment variable to a list of catalogs\&. An empty one should deactivate loading the default
-/etc/sgml/catalog
-catalog\&.
+environment variable to a list of catalogs\&. An empty one should deactivate loading the default catalog\&.
.RE
.PP
\fBXML_CATALOG_FILES\fR
@@ -511,9 +526,7 @@ catalog\&.
XML
catalog behavior can be changed by redirecting queries to the user\*(Aqs own set of catalogs\&. This can be done by setting the
\fBXML_CATALOG_FILES\fR
-environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default
-/etc/xml/catalog
-catalog\&.
+environment variable to a space\-separated list of catalogs\&. Use percent\-encoding to escape spaces or other characters\&. An empty variable should deactivate loading the default catalog\&.
.RE
.PP
\fBXML_DEBUG_CATALOG\fR
diff --git a/doc/xmllint.html b/doc/xmllint.html
index 8d4400fe..9e2e7ce6 100644
--- a/doc/xmllint.html
+++ b/doc/xmllint.html
@@ -1,161 +1,165 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmllint</title><meta name="generator" content="DocBook XSL Stylesheets V1.79.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="idm1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xmllint &#8212; command line <acronym class="acronym">XML</acronym> tool</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xmllint</code> [ <code class="option">--version</code> | <code class="option">--debug</code> | <code class="option">--shell</code> | <code class="option">--xpath "<em class="replaceable"><code>XPath_expression</code></em>"</code> | <code class="option">--debugent</code> | <code class="option">--copy</code> | <code class="option">--recover</code> | <code class="option">--noent</code> | <code class="option">--noout</code> | <code class="option">--nonet</code> | <code class="option">--path "<em class="replaceable"><code>PATH(S)</code></em>"</code> | <code class="option">--load-trace</code> | <code class="option">--htmlout</code> | <code class="option">--nowrap</code> | <code class="option">--valid</code> | <code class="option">--postvalid</code> | <code class="option">--dtdvalid <em class="replaceable"><code>URL</code></em></code> | <code class="option">--dtdvalidfpi <em class="replaceable"><code>FPI</code></em></code> | <code class="option">--timing</code> | <code class="option">--output <em class="replaceable"><code>FILE</code></em></code> | <code class="option">--repeat</code> | <code class="option">--insert</code> | <code class="option">--compress</code> | <code class="option">--html</code> | <code class="option">--xmlout</code> | <code class="option">--push</code> | <code class="option">--memory</code> | <code class="option">--maxmem <em class="replaceable"><code>NBBYTES</code></em></code> | <code class="option">--nowarning</code> | <code class="option">--noblanks</code> | <code class="option">--nocdata</code> | <code class="option">--format</code> | <code class="option">--encode <em class="replaceable"><code>ENCODING</code></em></code> | <code class="option">--dropdtd</code> | <code class="option">--nsclean</code> | <code class="option">--testIO</code> | <code class="option">--catalogs</code> | <code class="option">--nocatalogs</code> | <code class="option">--auto</code> | <code class="option">--xinclude</code> | <code class="option">--noxincludenode</code> | <code class="option">--loaddtd</code> | <code class="option">--dtdattr</code> | <code class="option">--stream</code> | <code class="option">--walker</code> | <code class="option">--pattern <em class="replaceable"><code>PATTERNVALUE</code></em></code> | <code class="option">--chkregister</code> | <code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--c14n</code> ] { <em class="replaceable"><code>XML-FILE(S)</code></em>... | - }</p></div><div class="cmdsynopsis"><p><code class="command">xmllint</code> <code class="option">--help</code> </p></div></div><div class="refsect1"><a name="description"></a><h2>DESCRIPTION</h2><p>
- The <span class="command"><strong>xmllint</strong></span> program parses one or more <acronym class="acronym">XML</acronym> files,
- specified on the command line as <em class="replaceable"><code>XML-FILE</code></em>
- (or the standard input if the filename provided
- is <span class="bold"><strong>-</strong></span> ). It prints various types of
- output, depending upon the options selected. It is useful for detecting
- errors both in <acronym class="acronym">XML</acronym> code and in
- the <acronym class="acronym">XML</acronym> parser itself.
- </p><p><span class="command"><strong>xmllint</strong></span> is included in <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>.</p></div><div class="refsect1"><a name="options"></a><h2>OPTIONS</h2><p>
- <span class="command"><strong>xmllint</strong></span> accepts the following options (in alphabetical order):
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--auto</code></span></dt><dd><p>Generate a small document for testing purposes.</p></dd><dt><span class="term"><code class="option">--catalogs</code></span></dt><dd><p>
- Use the <acronym class="acronym">SGML</acronym> catalog(s) from <code class="envar">SGML_CATALOG_FILES</code>.
- Otherwise <acronym class="acronym">XML</acronym> catalogs starting
- from <code class="filename">/etc/xml/catalog</code> are used by default.
- </p></dd><dt><span class="term"><code class="option">--chkregister</code></span></dt><dd><p>
- Turn on node registration. Useful for developers testing <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> node tracking code.
- </p></dd><dt><span class="term"><code class="option">--compress</code></span></dt><dd><p>
- Turn on <span class="citerefentry"><span class="refentrytitle">gzip</span>(1)</span> compression of output.
- </p></dd><dt><span class="term"><code class="option">--copy</code></span></dt><dd><p>Test the internal copy implementation.</p></dd><dt><span class="term"><code class="option">--c14n</code></span></dt><dd><p>
- Use the W3C <acronym class="acronym">XML</acronym> Canonicalisation (<acronym class="acronym">C14N</acronym>) to
- serialize the result of parsing to <code class="filename">stdout</code>.
- It keeps comments in the result.
- </p></dd><dt><span class="term"><code class="option">--dtdvalid <em class="replaceable"><code>URL</code></em></code></span></dt><dd><p>
- Use the <acronym class="acronym">DTD</acronym> specified by
- an <em class="replaceable"><code>URL</code></em> for validation.
- </p></dd><dt><span class="term"><code class="option">--dtdvalidfpi <em class="replaceable"><code>FPI</code></em></code></span></dt><dd><p>
- Use the <acronym class="acronym">DTD</acronym> specified by a Formal Public
- Identifier <em class="replaceable"><code>FPI</code></em> for validation, note that this
- will require a catalog exporting that Formal Public Identifier to work.
- </p></dd><dt><span class="term"><code class="option">--debug</code></span></dt><dd><p>
- Parse a file and output an annotated tree of the
- in-memory version of the document.
- </p></dd><dt><span class="term"><code class="option">--debugent</code></span></dt><dd><p>Debug the entities defined in the document.</p></dd><dt><span class="term"><code class="option">--dropdtd</code></span></dt><dd><p>Remove <acronym class="acronym">DTD</acronym> from output.</p></dd><dt><span class="term"><code class="option">--dtdattr</code></span></dt><dd><p>
- Fetch external <acronym class="acronym">DTD</acronym> and populate the tree with
- inherited attributes.
- </p></dd><dt><span class="term"><code class="option">--encode <em class="replaceable"><code>ENCODING</code></em></code></span></dt><dd><p>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</p></dd><dt><span class="term"><code class="option">--format</code></span></dt><dd><p>
- Reformat and reindent the output. The <code class="envar">XMLLINT_INDENT</code>
- environment variable controls the indentation. The default value is two
- spaces " ").
- </p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print out a short usage summary for <span class="command"><strong>xmllint</strong></span>.</p></dd><dt><span class="term"><code class="option">--html</code></span></dt><dd><p>Use the <acronym class="acronym">HTML</acronym> parser.</p></dd><dt><span class="term"><code class="option">--htmlout</code></span></dt><dd><p>
- Output results as an <acronym class="acronym">HTML</acronym> file. This
- causes <span class="command"><strong>xmllint</strong></span> to output the necessary <acronym class="acronym">HTML</acronym>
- tags surrounding the result tree output so the results can be
- displayed/viewed in a browser.
- </p></dd><dt><span class="term"><code class="option">--insert</code></span></dt><dd><p>Test for valid insertions.</p></dd><dt><span class="term"><code class="option">--loaddtd</code></span></dt><dd><p>Fetch an external <acronym class="acronym">DTD</acronym>.</p></dd><dt><span class="term"><code class="option">--load-trace</code></span></dt><dd><p>
- Display all the documents loaded during the processing
- to <code class="filename">stderr</code>.
- </p></dd><dt><span class="term"><code class="option">--maxmem <em class="replaceable"><code>NNBYTES</code></em></code></span></dt><dd><p>
- Test the parser memory support. <em class="replaceable"><code>NNBYTES</code></em>
- is the maximum number of bytes the library is allowed to allocate.
- This can also be used to make sure batch processing
- of <acronym class="acronym">XML</acronym> files will not exhaust the virtual memory
- of the server running them.
- </p></dd><dt><span class="term"><code class="option">--memory</code></span></dt><dd><p>Parse from memory.</p></dd><dt><span class="term"><code class="option">--noblanks</code></span></dt><dd><p>Drop ignorable blank spaces.</p></dd><dt><span class="term"><code class="option">--nocatalogs</code></span></dt><dd><p>Do not use any catalogs.</p></dd><dt><span class="term"><code class="option">--nocdata</code></span></dt><dd><p>Substitute CDATA section by equivalent text nodes.</p></dd><dt><span class="term"><code class="option">--noent</code></span></dt><dd><p>
- Substitute entity values for entity references. By default, <span class="command"><strong>xmllint</strong></span>
- leaves entity references in place.
- </p></dd><dt><span class="term"><code class="option">--nonet</code></span></dt><dd><p>
- Do not use the Internet to fetch <acronym class="acronym">DTD</acronym>s or entities.
- </p></dd><dt><span class="term"><code class="option">--noout</code></span></dt><dd><p>
- Suppress output. By default, <span class="command"><strong>xmllint</strong></span> outputs the result tree.
- </p></dd><dt><span class="term"><code class="option">--nowarning</code></span></dt><dd><p>Do not emit warnings from the parser and/or validator.</p></dd><dt><span class="term"><code class="option">--nowrap</code></span></dt><dd><p>Do not output <acronym class="acronym">HTML</acronym> doc wrapper.</p></dd><dt><span class="term"><code class="option">--noxincludenode</code></span></dt><dd><p>
- Do XInclude processing but do not generate XInclude start and end nodes.
- </p></dd><dt><span class="term"><code class="option">--nsclean</code></span></dt><dd><p>Remove redundant namespace declarations.</p></dd><dt><span class="term"><code class="option">--output <em class="replaceable"><code>FILE</code></em></code></span></dt><dd><p>
- Define a file path where <span class="command"><strong>xmllint</strong></span> will save the result of parsing.
- Usually the programs build a tree and save it
- on <code class="filename">stdout</code>, with this option
- the result <acronym class="acronym">XML</acronym> instance will be saved onto a file.
- </p></dd><dt><span class="term"><code class="option">--path "<em class="replaceable"><code>PATH(S)</code></em>"</code></span></dt><dd><p>
- Use the (space- or colon-separated) list of filesystem paths specified
- by <em class="replaceable"><code>PATHS</code></em> to load <acronym class="acronym">DTD</acronym>s or
- entities. Enclose space-separated lists by quotation marks.
- </p></dd><dt><span class="term"><code class="option">--pattern <em class="replaceable"><code>PATTERNVALUE</code></em></code></span></dt><dd><p>
- Used to exercise the pattern recognition engine, which can be used
- with the reader interface to the parser. It allows to select some
- nodes in the document based on an XPath (subset) expression. Used
- for debugging.
- </p></dd><dt><span class="term"><code class="option">--postvalid</code></span></dt><dd><p>Validate after parsing has completed.</p></dd><dt><span class="term"><code class="option">--push</code></span></dt><dd><p>Use the push mode of the parser.</p></dd><dt><span class="term"><code class="option">--recover</code></span></dt><dd><p>Output any parsable portions of an invalid document.</p></dd><dt><span class="term"><code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
- Use RelaxNG file named <em class="replaceable"><code>SCHEMA</code></em>
- for validation.
- </p></dd><dt><span class="term"><code class="option">--repeat</code></span></dt><dd><p>Repeat 100 times, for timing or profiling.</p></dd><dt><span class="term"><code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
- Use a W3C <acronym class="acronym">XML</acronym> Schema file
- named <em class="replaceable"><code>SCHEMA</code></em> for validation.
- </p></dd><dt><span class="term"><code class="option">--shell</code></span></dt><dd><p>
- Run a navigating shell. Details on available commands in shell mode
- are below (see <a class="xref" href="#shell" title="SHELL COMMANDS">the section called &#8220;SHELL COMMANDS&#8221;</a>).
- </p></dd><dt><span class="term"><code class="option">--xpath "<em class="replaceable"><code>XPath_expression</code></em>"</code></span></dt><dd><p>
- Run an XPath expression given as argument and print the
- result. In case of a nodeset result, each node in the
- node set is serialized in full in the output. In case
- of an empty node set the "XPath set is empty" result
- will be shown and an error exit code will be returned.
- </p></dd><dt><span class="term"><code class="option">--stream</code></span></dt><dd><p>
- Use streaming <acronym class="acronym">API</acronym> - useful when used in combination
- with <code class="option">--relaxng</code> or <code class="option">--valid</code> options
- for validation of files that are too large to be held in memory.
- </p></dd><dt><span class="term"><code class="option">--testIO</code></span></dt><dd><p>Test user input/output support.</p></dd><dt><span class="term"><code class="option">--timing</code></span></dt><dd><p>
- Output information about the time it takes <span class="command"><strong>xmllint</strong></span> to perform the
- various steps.
- </p></dd><dt><span class="term"><code class="option">--valid</code></span></dt><dd><p>
- Determine if the document is a valid instance of the included
- Document Type Definition (<acronym class="acronym">DTD</acronym>).
- A <acronym class="acronym">DTD</acronym> to be validated against also can be
- specified at the command line using the <code class="option">--dtdvalid</code>
- option. By default, <span class="command"><strong>xmllint</strong></span> also checks to determine if the
- document is well-formed.
- </p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>
- Display the version of <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> used.
- </p></dd><dt><span class="term"><code class="option">--walker</code></span></dt><dd><p>
- Test the walker module, which is a reader interface but for a
- document tree, instead of using the reader <acronym class="acronym">API</acronym> on
- an unparsed document it works on an existing in-memory tree. Used for
- debugging.
- </p></dd><dt><span class="term"><code class="option">--xinclude</code></span></dt><dd><p>Do XInclude processing.</p></dd><dt><span class="term"><code class="option">--xmlout</code></span></dt><dd><p>
- Used in conjunction with <code class="option">--html</code>. Usually
- when <acronym class="acronym">HTML</acronym> is parsed the document is saved with
- the <acronym class="acronym">HTML</acronym> serializer. But with this option the
- resulting document is saved with the <acronym class="acronym">XML</acronym>
- serializer. This is primarily used to
- generate <acronym class="acronym">XHTML</acronym> from <acronym class="acronym">HTML</acronym> input.
- </p></dd></dl></div></div><div class="refsect1"><a name="shell"></a><h2>SHELL COMMANDS</h2><p>
- <span class="command"><strong>xmllint</strong></span> offers an interactive shell mode invoked with
- the <code class="option">--shell</code> command. Available commands in shell mode
- include (in alphabetical order):
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="command"><strong>base</strong></span></span></dt><dd><p>Display <acronym class="acronym">XML</acronym> base of the node.</p></dd><dt><span class="term"><span class="command"><strong>bye</strong></span></span></dt><dd><p>Leave the shell.</p></dd><dt><span class="term"><span class="command"><strong>cat <em class="replaceable"><code>NODE</code></em></strong></span></span></dt><dd><p>Display the given node or the current one.</p></dd><dt><span class="term"><span class="command"><strong>cd <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>
- Change the current node to the given path (if unique) or root if no
- argument is given.
- </p></dd><dt><span class="term"><span class="command"><strong>dir <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>
- Dumps information about the node (namespace, attributes, content).
- </p></dd><dt><span class="term"><span class="command"><strong>du <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>
- Show the structure of the subtree under the given path or the current node.
- </p></dd><dt><span class="term"><span class="command"><strong>exit</strong></span></span></dt><dd><p>Leave the shell.</p></dd><dt><span class="term"><span class="command"><strong>help</strong></span></span></dt><dd><p>Show this help.</p></dd><dt><span class="term"><span class="command"><strong>free</strong></span></span></dt><dd><p>Display memory usage.</p></dd><dt><span class="term"><span class="command"><strong>load <em class="replaceable"><code>FILENAME</code></em></strong></span></span></dt><dd><p>Load a new document with the given filename.</p></dd><dt><span class="term"><span class="command"><strong>ls <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>List contents of the given path or the current directory.</p></dd><dt><span class="term"><span class="command"><strong>pwd</strong></span></span></dt><dd><p>Display the path to the current node.</p></dd><dt><span class="term"><span class="command"><strong>quit</strong></span></span></dt><dd><p>Leave the shell.</p></dd><dt><span class="term"><span class="command"><strong>save <em class="replaceable"><code>FILENAME</code></em></strong></span></span></dt><dd><p>
- Save the current document to the given filename or to the original name.
- </p></dd><dt><span class="term"><code class="option">validate</code></span></dt><dd><p>Check the document for errors.</p></dd><dt><span class="term"><span class="command"><strong>write <em class="replaceable"><code>FILENAME</code></em></strong></span></span></dt><dd><p>Write the current node to the given filename.</p></dd></dl></div></div><div class="refsect1"><a name="environment"></a><h2>ENVIRONMENT</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">SGML_CATALOG_FILES</code></span></dt><dd><p><acronym class="acronym">SGML</acronym> catalog behavior can be changed by redirecting
- queries to the user's own set of catalogs. This can be done by setting
- the <code class="envar">SGML_CATALOG_FILES</code> environment variable to a list
- of catalogs. An empty one should deactivate loading the
- default <code class="filename">/etc/sgml/catalog</code> catalog.
- </p></dd><dt><span class="term"><code class="envar">XML_CATALOG_FILES</code></span></dt><dd><p><acronym class="acronym">XML</acronym> catalog behavior can be changed by redirecting
- queries to the user's own set of catalogs. This can be done by setting
- the <code class="envar">XML_CATALOG_FILES</code> environment variable to a space-separated
- list of catalogs. Use percent-encoding to escape spaces or other characters.
- An empty variable should deactivate loading the default <code class="filename">/etc/xml/catalog</code> catalog.
- </p></dd><dt><span class="term"><code class="envar">XML_DEBUG_CATALOG</code></span></dt><dd><p>Setting the environment variable <code class="envar">XML_DEBUG_CATALOG</code>
- to <em class="parameter"><code>non-zero</code></em> using the <span class="command"><strong>export</strong></span>
- command outputs debugging information related to catalog operations.
- </p></dd><dt><span class="term"><code class="envar">XMLLINT_INDENT</code></span></dt><dd><p>Setting the environment variable <code class="envar">XMLLINT_INDENT</code>
- controls the indentation. The default value is two spaces " ".
- </p></dd></dl></div></div><div class="refsect1"><a name="diagnostics"></a><h2>DIAGNOSTICS</h2><p>
- <span class="command"><strong>xmllint</strong></span> return codes provide information that can be used when
- calling it from scripts.
- </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">0</span></span></dt><dd><p>No error</p></dd><dt><span class="term"><span class="errorcode">1</span></span></dt><dd><p>Unclassified</p></dd><dt><span class="term"><span class="errorcode">2</span></span></dt><dd><p>Error in <acronym class="acronym">DTD</acronym></p></dd><dt><span class="term"><span class="errorcode">3</span></span></dt><dd><p>Validation error</p></dd><dt><span class="term"><span class="errorcode">4</span></span></dt><dd><p>Validation error</p></dd><dt><span class="term"><span class="errorcode">5</span></span></dt><dd><p>Error in schema compilation</p></dd><dt><span class="term"><span class="errorcode">6</span></span></dt><dd><p>Error writing output</p></dd><dt><span class="term"><span class="errorcode">7</span></span></dt><dd><p>
- Error in pattern (generated when <code class="option">--pattern</code> option is used)
- </p></dd><dt><span class="term"><span class="errorcode">8</span></span></dt><dd><p>
- Error in Reader registration (generated
- when <code class="option">--chkregister</code> option is used)
- </p></dd><dt><span class="term"><span class="errorcode">9</span></span></dt><dd><p>Out of memory error</p></dd><dt><span class="term"><span class="errorcode">10</span></span></dt><dd><p>XPath evaluation error</p></dd></dl></div></div><div class="refsect1"><a name="seealso"></a><h2>SEE ALSO</h2><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>
- </p><p>
- More information can be found at
- </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> web page <a class="ulink" href="https://gitlab.gnome.org/GNOME/libxml2" target="_top">https://gitlab.gnome.org/GNOME/libxml2</a>
- </p></li></ul></div><p>
- </p></div></div></body></html>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>xmllint</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="idm1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>xmllint &#8212; command line <acronym class="acronym">XML</acronym> tool</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">xmllint</code> [ <code class="option">--version</code> | <code class="option">--debug</code> | <code class="option">--quiet</code> | <code class="option">--shell</code> | <code class="option">--xpath "<em class="replaceable"><code>XPath_expression</code></em>"</code> | <code class="option">--debugent</code> | <code class="option">--copy</code> | <code class="option">--recover</code> | <code class="option">--nodict</code> | <code class="option">--noent</code> | <code class="option">--noout</code> | <code class="option">--nonet</code> | <code class="option">--path "<em class="replaceable"><code>PATH(S)</code></em>"</code> | <code class="option">--load-trace</code> | <code class="option">--htmlout</code> | <code class="option">--nowrap</code> | <code class="option">--valid</code> | <code class="option">--postvalid</code> | <code class="option">--dtdvalid <em class="replaceable"><code>URL</code></em></code> | <code class="option">--dtdvalidfpi <em class="replaceable"><code>FPI</code></em></code> | <code class="option">--timing</code> | <code class="option">--output <em class="replaceable"><code>FILE</code></em></code> | <code class="option">--repeat</code> | <code class="option">--insert</code> | <code class="option">--compress</code> | <code class="option">--html</code> | <code class="option">--xmlout</code> | <code class="option">--push</code> | <code class="option">--memory</code> | <code class="option">--maxmem <em class="replaceable"><code>NBBYTES</code></em></code> | <code class="option">--nowarning</code> | <code class="option">--noblanks</code> | <code class="option">--nocdata</code> | <code class="option">--format</code> | <code class="option">--encode <em class="replaceable"><code>ENCODING</code></em></code> | <code class="option">--dropdtd</code> | <code class="option">--nsclean</code> | <code class="option">--testIO</code> | <code class="option">--catalogs</code> | <code class="option">--nocatalogs</code> | <code class="option">--auto</code> | <code class="option">--xinclude</code> | <code class="option">--noxincludenode</code> | <code class="option">--loaddtd</code> | <code class="option">--dtdattr</code> | <code class="option">--stream</code> | <code class="option">--walker</code> | <code class="option">--pattern <em class="replaceable"><code>PATTERNVALUE</code></em></code> | <code class="option">--chkregister</code> | <code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code> | <code class="option">--c14n</code> | <code class="option">--pedantic</code> ] { <em class="replaceable"><code>XML-FILE(S)</code></em>... | - }</p></div><div class="cmdsynopsis"><p><code class="command">xmllint</code> <code class="option">--help</code> </p></div></div><div class="refsect1"><a name="description"></a><h2>DESCRIPTION</h2><p>
+ The <span class="command"><strong>xmllint</strong></span> program parses one or more <acronym class="acronym">XML</acronym> files,
+ specified on the command line as <em class="replaceable"><code>XML-FILE</code></em>
+ (or the standard input if the filename provided
+ is <span class="bold"><strong>-</strong></span> ). It prints various types of
+ output, depending upon the options selected. It is useful for detecting
+ errors both in <acronym class="acronym">XML</acronym> code and in
+ the <acronym class="acronym">XML</acronym> parser itself.
+ </p><p><span class="command"><strong>xmllint</strong></span> is included in <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>.</p></div><div class="refsect1"><a name="options"></a><h2>OPTIONS</h2><p>
+ <span class="command"><strong>xmllint</strong></span> accepts the following options (in alphabetical order):
+ </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="option">--auto</code></span></dt><dd><p>Generate a small document for testing purposes.</p></dd><dt><span class="term"><code class="option">--catalogs</code></span></dt><dd><p>
+ Use the <acronym class="acronym">SGML</acronym> catalog(s) from <code class="envar">SGML_CATALOG_FILES</code>.
+ Otherwise <acronym class="acronym">XML</acronym> catalogs starting
+ from <code class="filename">/etc/xml/catalog</code> or, more specifically,
+ <code class="filename">${sysconfdir}/xml/catalog</code> are used by default.
+ </p></dd><dt><span class="term"><code class="option">--chkregister</code></span></dt><dd><p>
+ Turn on node registration. Useful for developers testing <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> node tracking code.
+ </p></dd><dt><span class="term"><code class="option">--compress</code></span></dt><dd><p>
+ Turn on <span class="citerefentry"><span class="refentrytitle">gzip</span>(1)</span> compression of output.
+ </p></dd><dt><span class="term"><code class="option">--copy</code></span></dt><dd><p>Test the internal copy implementation.</p></dd><dt><span class="term"><code class="option">--c14n</code></span></dt><dd><p>
+ Use the W3C <acronym class="acronym">XML</acronym> Canonicalisation (<acronym class="acronym">C14N</acronym>) to
+ serialize the result of parsing to <code class="filename">stdout</code>.
+ It keeps comments in the result.
+ </p></dd><dt><span class="term"><code class="option">--dtdvalid <em class="replaceable"><code>URL</code></em></code></span></dt><dd><p>
+ Use the <acronym class="acronym">DTD</acronym> specified by
+ an <em class="replaceable"><code>URL</code></em> for validation.
+ </p></dd><dt><span class="term"><code class="option">--dtdvalidfpi <em class="replaceable"><code>FPI</code></em></code></span></dt><dd><p>
+ Use the <acronym class="acronym">DTD</acronym> specified by a Formal Public
+ Identifier <em class="replaceable"><code>FPI</code></em> for validation, note that this
+ will require a catalog exporting that Formal Public Identifier to work.
+ </p></dd><dt><span class="term"><code class="option">--debug</code></span></dt><dd><p>
+ Parse a file and output an annotated tree of the
+ in-memory version of the document.
+ </p></dd><dt><span class="term"><code class="option">--debugent</code></span></dt><dd><p>Debug the entities defined in the document.</p></dd><dt><span class="term"><code class="option">--dropdtd</code></span></dt><dd><p>Remove <acronym class="acronym">DTD</acronym> from output.</p></dd><dt><span class="term"><code class="option">--dtdattr</code></span></dt><dd><p>
+ Fetch external <acronym class="acronym">DTD</acronym> and populate the tree with
+ inherited attributes.
+ </p></dd><dt><span class="term"><code class="option">--encode <em class="replaceable"><code>ENCODING</code></em></code></span></dt><dd><p>Output in the given encoding. Note that this works for full document not fragments or result from XPath queries.</p></dd><dt><span class="term"><code class="option">--format</code></span></dt><dd><p>
+ Reformat and reindent the output. The <code class="envar">XMLLINT_INDENT</code>
+ environment variable controls the indentation. The default value is two
+ spaces " ").
+ </p></dd><dt><span class="term"><code class="option">--help</code></span></dt><dd><p>Print out a short usage summary for <span class="command"><strong>xmllint</strong></span>.</p></dd><dt><span class="term"><code class="option">--html</code></span></dt><dd><p>Use the <acronym class="acronym">HTML</acronym> parser.</p></dd><dt><span class="term"><code class="option">--htmlout</code></span></dt><dd><p>
+ Output results as an <acronym class="acronym">HTML</acronym> file. This
+ causes <span class="command"><strong>xmllint</strong></span> to output the necessary <acronym class="acronym">HTML</acronym>
+ tags surrounding the result tree output so the results can be
+ displayed/viewed in a browser.
+ </p></dd><dt><span class="term"><code class="option">--insert</code></span></dt><dd><p>Test for valid insertions.</p></dd><dt><span class="term"><code class="option">--loaddtd</code></span></dt><dd><p>Fetch an external <acronym class="acronym">DTD</acronym>.</p></dd><dt><span class="term"><code class="option">--load-trace</code></span></dt><dd><p>
+ Display all the documents loaded during the processing
+ to <code class="filename">stderr</code>.
+ </p></dd><dt><span class="term"><code class="option">--maxmem <em class="replaceable"><code>NNBYTES</code></em></code></span></dt><dd><p>
+ Test the parser memory support. <em class="replaceable"><code>NNBYTES</code></em>
+ is the maximum number of bytes the library is allowed to allocate.
+ This can also be used to make sure batch processing
+ of <acronym class="acronym">XML</acronym> files will not exhaust the virtual memory
+ of the server running them.
+ </p></dd><dt><span class="term"><code class="option">--memory</code></span></dt><dd><p>Parse from memory.</p></dd><dt><span class="term"><code class="option">--noblanks</code></span></dt><dd><p>Drop ignorable blank spaces.</p></dd><dt><span class="term"><code class="option">--nocatalogs</code></span></dt><dd><p>Do not use any catalogs.</p></dd><dt><span class="term"><code class="option">--nocdata</code></span></dt><dd><p>Substitute CDATA section by equivalent text nodes.</p></dd><dt><span class="term"><code class="option">--nodict</code></span></dt><dd><p>
+ Don't use dictionaries (parser option XML_PARSE_NODICT).
+ Only for debugging.
+ </p></dd><dt><span class="term"><code class="option">--noent</code></span></dt><dd><p>
+ Substitute entity values for entity references. By default, <span class="command"><strong>xmllint</strong></span>
+ leaves entity references in place.
+ </p></dd><dt><span class="term"><code class="option">--nonet</code></span></dt><dd><p>
+ Do not use the Internet to fetch <acronym class="acronym">DTD</acronym>s or entities.
+ </p></dd><dt><span class="term"><code class="option">--noout</code></span></dt><dd><p>
+ Suppress output. By default, <span class="command"><strong>xmllint</strong></span> outputs the result tree.
+ </p></dd><dt><span class="term"><code class="option">--nowarning</code></span></dt><dd><p>Do not emit warnings from the parser and/or validator.</p></dd><dt><span class="term"><code class="option">--nowrap</code></span></dt><dd><p>Do not output <acronym class="acronym">HTML</acronym> doc wrapper.</p></dd><dt><span class="term"><code class="option">--noxincludenode</code></span></dt><dd><p>
+ Do XInclude processing but do not generate XInclude start and end nodes.
+ </p></dd><dt><span class="term"><code class="option">--nsclean</code></span></dt><dd><p>Remove redundant namespace declarations.</p></dd><dt><span class="term"><code class="option">--output <em class="replaceable"><code>FILE</code></em></code></span></dt><dd><p>
+ Define a file path where <span class="command"><strong>xmllint</strong></span> will save the result of parsing.
+ Usually the programs build a tree and save it
+ on <code class="filename">stdout</code>, with this option
+ the result <acronym class="acronym">XML</acronym> instance will be saved onto a file.
+ </p></dd><dt><span class="term"><code class="option">--path "<em class="replaceable"><code>PATH(S)</code></em>"</code></span></dt><dd><p>
+ Use the (space- or colon-separated) list of filesystem paths specified
+ by <em class="replaceable"><code>PATHS</code></em> to load <acronym class="acronym">DTD</acronym>s or
+ entities. Enclose space-separated lists by quotation marks.
+ </p></dd><dt><span class="term"><code class="option">--pattern <em class="replaceable"><code>PATTERNVALUE</code></em></code></span></dt><dd><p>
+ Used to exercise the pattern recognition engine, which can be used
+ with the reader interface to the parser. It allows to select some
+ nodes in the document based on an XPath (subset) expression. Used
+ for debugging.
+ </p></dd><dt><span class="term"><code class="option">--pedantic</code></span></dt><dd><p>Enable additional warnings.</p></dd><dt><span class="term"><code class="option">--postvalid</code></span></dt><dd><p>Validate after parsing has completed.</p></dd><dt><span class="term"><code class="option">--push</code></span></dt><dd><p>Use the push mode of the parser.</p></dd><dt><span class="term"><code class="option">--quiet</code></span></dt><dd><p>Don't print informational messages to stderr.</p></dd><dt><span class="term"><code class="option">--recover</code></span></dt><dd><p>Output any parsable portions of an invalid document.</p></dd><dt><span class="term"><code class="option">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
+ Use RelaxNG file named <em class="replaceable"><code>SCHEMA</code></em>
+ for validation.
+ </p></dd><dt><span class="term"><code class="option">--repeat</code></span></dt><dd><p>Repeat 100 times, for timing or profiling.</p></dd><dt><span class="term"><code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
+ Use a W3C <acronym class="acronym">XML</acronym> Schema file
+ named <em class="replaceable"><code>SCHEMA</code></em> for validation.
+ </p></dd><dt><span class="term"><code class="option">--shell</code></span></dt><dd><p>
+ Run a navigating shell. Details on available commands in shell mode
+ are below (see <a class="xref" href="#shell" title="SHELL COMMANDS">the section called &#8220;SHELL COMMANDS&#8221;</a>).
+ </p></dd><dt><span class="term"><code class="option">--xpath "<em class="replaceable"><code>XPath_expression</code></em>"</code></span></dt><dd><p>
+ Run an XPath expression given as argument and print the
+ result. In case of a nodeset result, each node in the
+ node set is serialized in full in the output. In case
+ of an empty node set the "XPath set is empty" result
+ will be shown and an error exit code will be returned.
+ </p></dd><dt><span class="term"><code class="option">--stream</code></span></dt><dd><p>
+ Use streaming <acronym class="acronym">API</acronym> - useful when used in combination
+ with <code class="option">--relaxng</code> or <code class="option">--valid</code> options
+ for validation of files that are too large to be held in memory.
+ </p></dd><dt><span class="term"><code class="option">--testIO</code></span></dt><dd><p>Test user input/output support.</p></dd><dt><span class="term"><code class="option">--timing</code></span></dt><dd><p>
+ Output information about the time it takes <span class="command"><strong>xmllint</strong></span> to perform the
+ various steps.
+ </p></dd><dt><span class="term"><code class="option">--valid</code></span></dt><dd><p>
+ Determine if the document is a valid instance of the included
+ Document Type Definition (<acronym class="acronym">DTD</acronym>).
+ A <acronym class="acronym">DTD</acronym> to be validated against also can be
+ specified at the command line using the <code class="option">--dtdvalid</code>
+ option. By default, <span class="command"><strong>xmllint</strong></span> also checks to determine if the
+ document is well-formed.
+ </p></dd><dt><span class="term"><code class="option">--version</code></span></dt><dd><p>
+ Display the version of <span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> used.
+ </p></dd><dt><span class="term"><code class="option">--walker</code></span></dt><dd><p>
+ Test the walker module, which is a reader interface but for a
+ document tree, instead of using the reader <acronym class="acronym">API</acronym> on
+ an unparsed document it works on an existing in-memory tree. Used for
+ debugging.
+ </p></dd><dt><span class="term"><code class="option">--xinclude</code></span></dt><dd><p>Do XInclude processing.</p></dd><dt><span class="term"><code class="option">--xmlout</code></span></dt><dd><p>
+ Used in conjunction with <code class="option">--html</code>. Usually
+ when <acronym class="acronym">HTML</acronym> is parsed the document is saved with
+ the <acronym class="acronym">HTML</acronym> serializer. But with this option the
+ resulting document is saved with the <acronym class="acronym">XML</acronym>
+ serializer. This is primarily used to
+ generate <acronym class="acronym">XHTML</acronym> from <acronym class="acronym">HTML</acronym> input.
+ </p></dd></dl></div></div><div class="refsect1"><a name="shell"></a><h2>SHELL COMMANDS</h2><p>
+ <span class="command"><strong>xmllint</strong></span> offers an interactive shell mode invoked with
+ the <code class="option">--shell</code> command. Available commands in shell mode
+ include (in alphabetical order):
+ </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="command"><strong>base</strong></span></span></dt><dd><p>Display <acronym class="acronym">XML</acronym> base of the node.</p></dd><dt><span class="term"><span class="command"><strong>bye</strong></span></span></dt><dd><p>Leave the shell.</p></dd><dt><span class="term"><span class="command"><strong>cat <em class="replaceable"><code>NODE</code></em></strong></span></span></dt><dd><p>Display the given node or the current one.</p></dd><dt><span class="term"><span class="command"><strong>cd <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>
+ Change the current node to the given path (if unique) or root if no
+ argument is given.
+ </p></dd><dt><span class="term"><span class="command"><strong>dir <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>
+ Dumps information about the node (namespace, attributes, content).
+ </p></dd><dt><span class="term"><span class="command"><strong>du <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>
+ Show the structure of the subtree under the given path or the current node.
+ </p></dd><dt><span class="term"><span class="command"><strong>exit</strong></span></span></dt><dd><p>Leave the shell.</p></dd><dt><span class="term"><span class="command"><strong>help</strong></span></span></dt><dd><p>Show this help.</p></dd><dt><span class="term"><span class="command"><strong>free</strong></span></span></dt><dd><p>Display memory usage.</p></dd><dt><span class="term"><span class="command"><strong>load <em class="replaceable"><code>FILENAME</code></em></strong></span></span></dt><dd><p>Load a new document with the given filename.</p></dd><dt><span class="term"><span class="command"><strong>ls <em class="replaceable"><code>PATH</code></em></strong></span></span></dt><dd><p>List contents of the given path or the current directory.</p></dd><dt><span class="term"><span class="command"><strong>pwd</strong></span></span></dt><dd><p>Display the path to the current node.</p></dd><dt><span class="term"><span class="command"><strong>quit</strong></span></span></dt><dd><p>Leave the shell.</p></dd><dt><span class="term"><span class="command"><strong>save <em class="replaceable"><code>FILENAME</code></em></strong></span></span></dt><dd><p>
+ Save the current document to the given filename or to the original name.
+ </p></dd><dt><span class="term"><code class="option">validate</code></span></dt><dd><p>Check the document for errors.</p></dd><dt><span class="term"><span class="command"><strong>write <em class="replaceable"><code>FILENAME</code></em></strong></span></span></dt><dd><p>Write the current node to the given filename.</p></dd></dl></div></div><div class="refsect1"><a name="environment"></a><h2>ENVIRONMENT</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><code class="envar">SGML_CATALOG_FILES</code></span></dt><dd><p><acronym class="acronym">SGML</acronym> catalog behavior can be changed by redirecting
+ queries to the user's own set of catalogs. This can be done by setting
+ the <code class="envar">SGML_CATALOG_FILES</code> environment variable to a list
+ of catalogs. An empty one should deactivate loading the
+ default catalog.
+ </p></dd><dt><span class="term"><code class="envar">XML_CATALOG_FILES</code></span></dt><dd><p><acronym class="acronym">XML</acronym> catalog behavior can be changed by redirecting
+ queries to the user's own set of catalogs. This can be done by setting
+ the <code class="envar">XML_CATALOG_FILES</code> environment variable to a space-separated
+ list of catalogs. Use percent-encoding to escape spaces or other characters.
+ An empty variable should deactivate loading the default catalog.
+ </p></dd><dt><span class="term"><code class="envar">XML_DEBUG_CATALOG</code></span></dt><dd><p>Setting the environment variable <code class="envar">XML_DEBUG_CATALOG</code>
+ to <em class="parameter"><code>non-zero</code></em> using the <span class="command"><strong>export</strong></span>
+ command outputs debugging information related to catalog operations.
+ </p></dd><dt><span class="term"><code class="envar">XMLLINT_INDENT</code></span></dt><dd><p>Setting the environment variable <code class="envar">XMLLINT_INDENT</code>
+ controls the indentation. The default value is two spaces " ".
+ </p></dd></dl></div></div><div class="refsect1"><a name="diagnostics"></a><h2>DIAGNOSTICS</h2><p>
+ <span class="command"><strong>xmllint</strong></span> return codes provide information that can be used when
+ calling it from scripts.
+ </p><div class="variablelist"><dl class="variablelist"><dt><span class="term"><span class="errorcode">0</span></span></dt><dd><p>No error</p></dd><dt><span class="term"><span class="errorcode">1</span></span></dt><dd><p>Unclassified</p></dd><dt><span class="term"><span class="errorcode">2</span></span></dt><dd><p>Error in <acronym class="acronym">DTD</acronym></p></dd><dt><span class="term"><span class="errorcode">3</span></span></dt><dd><p>Validation error</p></dd><dt><span class="term"><span class="errorcode">4</span></span></dt><dd><p>Validation error</p></dd><dt><span class="term"><span class="errorcode">5</span></span></dt><dd><p>Error in schema compilation</p></dd><dt><span class="term"><span class="errorcode">6</span></span></dt><dd><p>Error writing output</p></dd><dt><span class="term"><span class="errorcode">7</span></span></dt><dd><p>
+ Error in pattern (generated when <code class="option">--pattern</code> option is used)
+ </p></dd><dt><span class="term"><span class="errorcode">8</span></span></dt><dd><p>
+ Error in Reader registration (generated
+ when <code class="option">--chkregister</code> option is used)
+ </p></dd><dt><span class="term"><span class="errorcode">9</span></span></dt><dd><p>Out of memory error</p></dd><dt><span class="term"><span class="errorcode">10</span></span></dt><dd><p>XPath evaluation error</p></dd></dl></div></div><div class="refsect1"><a name="seealso"></a><h2>SEE ALSO</h2><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span>
+ </p><p>
+ More information can be found at
+ </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p><span class="citerefentry"><span class="refentrytitle">libxml</span>(3)</span> web page <a class="ulink" href="https://gitlab.gnome.org/GNOME/libxml2" target="_top">https://gitlab.gnome.org/GNOME/libxml2</a>
+ </p></li></ul></div><p>
+ </p></div></div></body></html>
diff --git a/encoding.c b/encoding.c
index 101eba9b..86ab7f47 100644
--- a/encoding.c
+++ b/encoding.c
@@ -78,33 +78,6 @@ static int xmlCharEncodingAliasesMax = 0;
static int xmlLittleEndian = 1;
-/**
- * xmlEncodingErrMemory:
- * @extra: extra information
- *
- * Handle an out of memory condition
- */
-static void
-xmlEncodingErrMemory(const char *extra)
-{
- __xmlSimpleError(XML_FROM_I18N, XML_ERR_NO_MEMORY, NULL, NULL, extra);
-}
-
-/**
- * xmlErrEncoding:
- * @error: the error number
- * @msg: the error message
- *
- * n encoding error
- */
-static void LIBXML_ATTR_FORMAT(2,0)
-xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val)
-{
- __xmlRaiseError(NULL, NULL, NULL, NULL, NULL,
- XML_FROM_I18N, error, XML_ERR_FATAL,
- NULL, 0, val, NULL, NULL, 0, 0, msg, val);
-}
-
#ifdef LIBXML_ICU_ENABLED
static uconv_t*
openIcuConverter(const char* name, int toUnicode)
@@ -171,7 +144,9 @@ closeIcuConverter(uconv_t *conv)
*
* Take a block of ASCII chars in and try to convert it to an UTF-8
* block of chars out.
- * Returns 0 if success, or -1 otherwise
+ *
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
@@ -197,7 +172,7 @@ asciiToUTF8(unsigned char* out, int *outlen,
} else {
*outlen = out - outstart;
*inlen = processed - base;
- return(-1);
+ return(XML_ENC_ERR_INPUT);
}
processed = (const unsigned char*) in;
@@ -218,7 +193,8 @@ asciiToUTF8(unsigned char* out, int *outlen,
* Take a block of UTF-8 chars in and try to convert it to an ASCII
* block of chars out.
*
- * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
@@ -234,7 +210,8 @@ UTF8Toascii(unsigned char* out, int *outlen,
unsigned int c, d;
int trailing;
- if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
+ return(XML_ENC_ERR_INTERNAL);
if (in == NULL) {
/*
* initialization nothing to do
@@ -252,7 +229,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
/* trailing byte in leading position */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
} else if (d < 0xE0) { c= d & 0x1F; trailing= 1; }
else if (d < 0xF0) { c= d & 0x0F; trailing= 2; }
else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
@@ -260,7 +237,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
/* no chance for this in Ascii */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
if (inend - in < trailing) {
@@ -283,7 +260,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
/* no chance for this in Ascii */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
processed = in;
}
@@ -302,7 +279,9 @@ UTF8Toascii(unsigned char* out, int *outlen,
*
* Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8
* block of chars out.
- * Returns the number of bytes written if success, or -1 otherwise
+ *
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
@@ -317,7 +296,7 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
const unsigned char* instop;
if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
outend = out + *outlen;
inend = in + (*inlen);
@@ -351,7 +330,8 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
*
* No op copy operation for UTF8 handling.
*
- * Returns the number of bytes written, or -1 if lack of space.
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of *inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
*/
@@ -362,7 +342,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
int len;
if ((out == NULL) || (outlen == NULL) || (inlenb == NULL))
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
if (inb == NULL) {
/* inb == NULL means output is initialized. */
*outlen = 0;
@@ -375,7 +355,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
len = *outlen;
}
if (len < 0)
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
/*
* FIXME: Conversion functions must assure valid UTF-8, so we have
@@ -401,8 +381,8 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
* Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1
* block of chars out.
*
- * Returns the number of bytes written if success, -2 if the transcoding fails,
- or -1 otherwise
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of @inlen after return is the number of octets consumed
* if the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets produced.
@@ -418,7 +398,8 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
unsigned int c, d;
int trailing;
- if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
+ return(XML_ENC_ERR_INTERNAL);
if (in == NULL) {
/*
* initialization nothing to do
@@ -436,7 +417,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
/* trailing byte in leading position */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
} else if (d < 0xE0) { c= d & 0x1F; trailing= 1; }
else if (d < 0xF0) { c= d & 0x0F; trailing= 2; }
else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
@@ -444,7 +425,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
/* no chance for this in IsoLat1 */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
if (inend - in < trailing) {
@@ -457,7 +438,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
if (((d= *in++) & 0xC0) != 0x80) {
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
c <<= 6;
c |= d & 0x3F;
@@ -472,7 +453,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
/* no chance for this in IsoLat1 */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
processed = in;
}
@@ -494,10 +475,10 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
* is the same between the native type of this machine and the
* inputed one.
*
- * Returns the number of bytes written, or -1 if lack of space, or -2
- * if the transcoding fails (if *in is not a valid utf16 string)
- * The value of *inlen after return is the number of octets consumed
- * if the return value is positive, else unpredictable.
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
+ * The value of *inlen after return is the number of octets consumed
+ * if the return value is positive, else unpredictable.
*/
static int
UTF16LEToUTF8(unsigned char* out, int *outlen,
@@ -551,7 +532,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
else {
*outlen = out - outstart;
*inlenb = processed - inb;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
}
@@ -586,8 +567,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
* Take a block of UTF-8 chars in and try to convert it to an UTF-16LE
* block of chars out.
*
- * Returns the number of bytes written, or -1 if lack of space, or -2
- * if the transcoding failed.
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
static int
UTF8ToUTF16LE(unsigned char* outb, int *outlen,
@@ -605,7 +585,8 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
unsigned short tmp1, tmp2;
/* UTF16LE encoding has no BOM */
- if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
+ if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
+ return(XML_ENC_ERR_INTERNAL);
if (in == NULL) {
*outlen = 0;
*inlen = 0;
@@ -620,7 +601,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
/* trailing byte in leading position */
*outlen = (out - outstart) * 2;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
} else if (d < 0xE0) { c= d & 0x1F; trailing= 1; }
else if (d < 0xF0) { c= d & 0x0F; trailing= 2; }
else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
@@ -628,7 +609,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
/* no chance for this in UTF-16 */
*outlen = (out - outstart) * 2;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
if (inend - in < trailing) {
@@ -695,8 +676,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
* Take a block of UTF-8 chars in and try to convert it to an UTF-16
* block of chars out.
*
- * Returns the number of bytes written, or -1 if lack of space, or -2
- * if the transcoding failed.
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
static int
UTF8ToUTF16(unsigned char* outb, int *outlen,
@@ -737,10 +717,10 @@ UTF8ToUTF16(unsigned char* outb, int *outlen,
* is the same between the native type of this machine and the
* inputed one.
*
- * Returns the number of bytes written, or -1 if lack of space, or -2
- * if the transcoding fails (if *in is not a valid utf16 string)
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of *inlen after return is the number of octets consumed
- * if the return value is positive, else unpredictable.
+ * if the return value is positive, else unpredictable.
*/
static int
UTF16BEToUTF8(unsigned char* out, int *outlen,
@@ -794,7 +774,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen,
else {
*outlen = out - outstart;
*inlenb = processed - inb;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
}
@@ -829,8 +809,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen,
* Take a block of UTF-8 chars in and try to convert it to an UTF-16BE
* block of chars out.
*
- * Returns the number of byte written, or -1 by lack of space, or -2
- * if the transcoding failed.
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
static int
UTF8ToUTF16BE(unsigned char* outb, int *outlen,
@@ -848,7 +827,8 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
unsigned short tmp1, tmp2;
/* UTF-16BE has no BOM */
- if ((outb == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
+ if ((outb == NULL) || (outlen == NULL) || (inlen == NULL))
+ return(XML_ENC_ERR_INTERNAL);
if (in == NULL) {
*outlen = 0;
*inlen = 0;
@@ -863,7 +843,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
/* trailing byte in leading position */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
} else if (d < 0xE0) { c= d & 0x1F; trailing= 1; }
else if (d < 0xF0) { c= d & 0x0F; trailing= 2; }
else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
@@ -871,7 +851,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
/* no chance for this in UTF-16 */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
if (inend - in < trailing) {
@@ -1340,7 +1320,7 @@ DECLARE_ISO_FUNCS(16)
#define EMPTY_ICONV
#endif
-#ifdef LIBXML_UCONV_ENABLED
+#ifdef LIBXML_ICU_ENABLED
#define EMPTY_UCONV , NULL, NULL
#else
#define EMPTY_UCONV
@@ -1430,21 +1410,16 @@ xmlNewCharEncodingHandler(const char *name,
/*
* Keep only the uppercase version of the encoding.
*/
- if (name == NULL) {
- xmlEncodingErr(XML_I18N_NO_NAME,
- "xmlNewCharEncodingHandler : no name !\n", NULL);
+ if (name == NULL)
return(NULL);
- }
for (i = 0;i < 499;i++) {
upper[i] = (char) toupper((unsigned char) name[i]);
if (upper[i] == 0) break;
}
upper[i] = 0;
up = xmlMemStrdup(upper);
- if (up == NULL) {
- xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n");
+ if (up == NULL)
return(NULL);
- }
/*
* allocate and fill-up an handler block.
@@ -1453,7 +1428,6 @@ xmlNewCharEncodingHandler(const char *name,
xmlMalloc(sizeof(xmlCharEncodingHandler));
if (handler == NULL) {
xmlFree(up);
- xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n");
return(NULL);
}
memset(handler, 0, sizeof(xmlCharEncodingHandler));
@@ -1502,11 +1476,7 @@ xmlInitEncodingInternal(void) {
unsigned char *ptr = (unsigned char *) &tst;
if (*ptr == 0x12) xmlLittleEndian = 0;
- else if (*ptr == 0x34) xmlLittleEndian = 1;
- else {
- xmlEncodingErr(XML_ERR_INTERNAL_ERROR,
- "Odd problem at endianness detection\n", NULL);
- }
+ else xmlLittleEndian = 1;
}
/**
@@ -1547,25 +1517,16 @@ xmlCleanupCharEncodingHandlers(void) {
*/
void
xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) {
- if (handler == NULL) {
- xmlEncodingErr(XML_I18N_NO_HANDLER,
- "xmlRegisterCharEncodingHandler: NULL handler\n", NULL);
+ if (handler == NULL)
return;
- }
if (handlers == NULL) {
handlers = xmlMalloc(MAX_ENCODING_HANDLERS * sizeof(handlers[0]));
- if (handlers == NULL) {
- xmlEncodingErrMemory("allocating handler table");
+ if (handlers == NULL)
goto free_handler;
- }
}
- if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS) {
- xmlEncodingErr(XML_I18N_EXCESS_HANDLER,
- "xmlRegisterCharEncodingHandler: Too many handler registered, see %s\n",
- "MAX_ENCODING_HANDLERS");
+ if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS)
goto free_handler;
- }
handlers[nbCharEncodingHandler++] = handler;
return;
@@ -1809,8 +1770,6 @@ xmlFindCharEncodingHandler(const char *name) {
#endif
return enc;
} else if ((icv_in != (iconv_t) -1) || icv_out != (iconv_t) -1) {
- xmlEncodingErr(XML_ERR_INTERNAL_ERROR,
- "iconv : problems with filters for '%s'\n", name);
if (icv_in != (iconv_t) -1)
iconv_close(icv_in);
else
@@ -1849,8 +1808,6 @@ xmlFindCharEncodingHandler(const char *name) {
} else if (ucv_in != NULL || ucv_out != NULL) {
closeIcuConverter(ucv_in);
closeIcuConverter(ucv_out);
- xmlEncodingErr(XML_ERR_INTERNAL_ERROR,
- "ICU converter : problems with filters for '%s'\n", name);
}
#endif /* LIBXML_ICU_ENABLED */
@@ -1890,11 +1847,7 @@ xmlFindCharEncodingHandler(const char *name) {
* @in: a pointer to an array of input bytes
* @inlen: the length of @in
*
- * Returns 0 if success, or
- * -1 by lack of space, or
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
- * -3 if there the last byte can't form a single output char.
+ * Returns an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* as the return value is positive, else unpredictable.
@@ -1910,7 +1863,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
if (outlen != NULL) *outlen = 0;
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
}
icv_inlen = *inlen;
icv_outlen = *outlen;
@@ -1920,27 +1873,16 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
ret = iconv(cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
*inlen -= icv_inlen;
*outlen -= icv_outlen;
- if ((icv_inlen != 0) || (ret == (size_t) -1)) {
-#ifdef EILSEQ
- if (errno == EILSEQ) {
- return -2;
- } else
-#endif
-#ifdef E2BIG
- if (errno == E2BIG) {
- return -1;
- } else
-#endif
-#ifdef EINVAL
- if (errno == EINVAL) {
- return -3;
- } else
-#endif
- {
- return -3;
- }
+ if (ret == (size_t) -1) {
+ if (errno == EILSEQ)
+ return(XML_ENC_ERR_INPUT);
+ if (errno == E2BIG)
+ return(XML_ENC_ERR_SPACE);
+ if (errno == EINVAL)
+ return(XML_ENC_ERR_PARTIAL);
+ return(XML_ENC_ERR_INTERNAL);
}
- return 0;
+ return(XML_ENC_ERR_SUCCESS);
}
#endif /* LIBXML_ICONV_ENABLED */
@@ -1961,11 +1903,7 @@ xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
* @inlen: the length of @in
* @flush: if true, indicates end of input
*
- * Returns 0 if success, or
- * -1 by lack of space, or
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
- * -3 if there the last byte can't form a single output char.
+ * Returns an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* as the return value is positive, else unpredictable.
@@ -1980,7 +1918,7 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
if (outlen != NULL) *outlen = 0;
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
}
if (toUnicode) {
@@ -2002,13 +1940,13 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
/* reset pivot buf if this is the last call for input (flush==TRUE) */
if (flush)
cd->pivot_source = cd->pivot_target = cd->pivot_buf;
- return 0;
+ return(XML_ENC_ERR_SUCCESS);
}
if (err == U_BUFFER_OVERFLOW_ERROR)
- return -1;
+ return(XML_ENC_ERR_SPACE);
if (err == U_INVALID_CHAR_FOUND || err == U_ILLEGAL_CHAR_FOUND)
- return -2;
- return -3;
+ return(XML_ENC_ERR_INPUT);
+ return(XML_ENC_ERR_PARTIAL);
}
#endif /* LIBXML_ICU_ENABLED */
@@ -2019,6 +1957,34 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
************************************************************************/
/**
+ * xmlEncConvertError:
+ * @code: XML_ENC_ERR code
+ *
+ * Convert XML_ENC_ERR to libxml2 error codes.
+ */
+static int
+xmlEncConvertError(int code) {
+ int ret;
+
+ switch (code) {
+ case XML_ENC_ERR_SUCCESS:
+ ret = XML_ERR_OK;
+ break;
+ case XML_ENC_ERR_INPUT:
+ ret = XML_ERR_INVALID_ENCODING;
+ break;
+ case XML_ENC_ERR_MEMORY:
+ ret = XML_ERR_NO_MEMORY;
+ break;
+ default:
+ ret = XML_ERR_INTERNAL_ERROR;
+ break;
+ }
+
+ return(ret);
+}
+
+/**
* xmlEncInputChunk:
* @handler: encoding handler
* @out: a pointer to an array of bytes to store the result
@@ -2027,17 +1993,13 @@ xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
* @inlen: the length of @in
* @flush: flush (ICU-related)
*
- * Returns 0 if success, or
- * -1 by lack of space, or
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
- * -3 if there the last byte can't form a single output char.
+ * Returns an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* as the return value is 0, else unpredictable.
* The value of @outlen after return is the number of octets produced.
*/
-static int
+int
xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
int *outlen, const unsigned char *in, int *inlen, int flush) {
int ret;
@@ -2046,7 +2008,7 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
if (handler->input != NULL) {
ret = handler->input(out, outlen, in, inlen);
if (ret > 0)
- ret = 0;
+ ret = XML_ENC_ERR_SUCCESS;
}
#ifdef LIBXML_ICONV_ENABLED
else if (handler->iconv_in != NULL) {
@@ -2062,9 +2024,13 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
else {
*outlen = 0;
*inlen = 0;
- ret = -2;
+ ret = XML_ENC_ERR_INTERNAL;
}
+ /* Ignore space and partial errors when reading. */
+ if ((ret == XML_ENC_ERR_SPACE) || (ret == XML_ENC_ERR_PARTIAL))
+ ret = XML_ENC_ERR_SUCCESS;
+
return(ret);
}
@@ -2076,12 +2042,7 @@ xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
* @in: a pointer to an array of input bytes
* @inlen: the length of @in
*
- * Returns 0 if success, or
- * -1 by lack of space, or
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
- * -3 if there the last byte can't form a single output char.
- * -4 if no output function was found.
+ * Returns an XML_ENC_ERR code.
*
* The value of @inlen after return is the number of octets consumed
* as the return value is 0, else unpredictable.
@@ -2095,7 +2056,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
if (handler->output != NULL) {
ret = handler->output(out, outlen, in, inlen);
if (ret > 0)
- ret = 0;
+ ret = XML_ENC_ERR_SUCCESS;
}
#ifdef LIBXML_ICONV_ENABLED
else if (handler->iconv_out != NULL) {
@@ -2111,201 +2072,28 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
else {
*outlen = 0;
*inlen = 0;
- ret = -4;
+ ret = XML_ENC_ERR_INTERNAL;
}
+ /* We shouldn't generate partial sequences when writing. */
+ if (ret == XML_ENC_ERR_PARTIAL)
+ ret = XML_ENC_ERR_INTERNAL;
+
return(ret);
}
/**
* xmlCharEncFirstLine:
- * @handler: char encoding transformation data structure
+ * @handler: char encoding transformation data structure
* @out: an xmlBuffer for the output.
* @in: an xmlBuffer for the input
*
- * Front-end for the encoding handler input function, but handle only
- * the very first line, i.e. limit itself to 45 chars.
- *
- * Returns the number of byte written if success, or
- * -1 general error
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
+ * DEPERECATED: Don't use.
*/
int
xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
xmlBufferPtr in) {
- int ret;
- int written;
- int toconv;
-
- if (handler == NULL) return(-1);
- if (out == NULL) return(-1);
- if (in == NULL) return(-1);
-
- /* calculate space available */
- written = out->size - out->use - 1; /* count '\0' */
- toconv = in->use;
- /*
- * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
- * 45 chars should be sufficient to reach the end of the encoding
- * declaration without going too far inside the document content.
- * on UTF-16 this means 90bytes, on UCS4 this means 180
- * The actual value depending on guessed encoding is passed as @len
- * if provided
- */
- if (toconv > 180)
- toconv = 180;
- if (toconv * 2 >= written) {
- xmlBufferGrow(out, toconv * 2);
- written = out->size - out->use - 1;
- }
-
- ret = xmlEncInputChunk(handler, &out->content[out->use], &written,
- in->content, &toconv, 0);
- xmlBufferShrink(in, toconv);
- out->use += written;
- out->content[out->use] = 0;
- if (ret == -1) ret = -3;
-
-#ifdef DEBUG_ENCODING
- switch (ret) {
- case 0:
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input\n",
- toconv, written);
- break;
- case -1:
- xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d bytes of input, %d left\n",
- toconv, written, in->use);
- break;
- case -2:
- xmlGenericError(xmlGenericErrorContext,
- "input conversion failed due to input error\n");
- break;
- case -3:
- xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d bytes of input, %d left\n",
- toconv, written, in->use);
- break;
- default:
- xmlGenericError(xmlGenericErrorContext,"Unknown input conversion failed %d\n", ret);
- }
-#endif /* DEBUG_ENCODING */
- /*
- * Ignore when input buffer is not on a boundary
- */
- if (ret == -3) ret = 0;
- if (ret == -1) ret = 0;
- return(written ? written : ret);
-}
-
-/**
- * xmlCharEncFirstLineInput:
- * @input: a parser input buffer
- * @len: number of bytes to convert for the first line, or -1
- *
- * Front-end for the encoding handler input function, but handle only
- * the very first line. Point is that this is based on autodetection
- * of the encoding and once that first line is converted we may find
- * out that a different decoder is needed to process the input.
- *
- * Returns the number of byte written if success, or
- * -1 general error
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
- */
-int
-xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
-{
- int ret;
- size_t written;
- size_t toconv;
- int c_in;
- int c_out;
- xmlBufPtr in;
- xmlBufPtr out;
-
- if ((input == NULL) || (input->encoder == NULL) ||
- (input->buffer == NULL) || (input->raw == NULL))
- return (-1);
- out = input->buffer;
- in = input->raw;
-
- toconv = xmlBufUse(in);
- if (toconv == 0)
- return (0);
- written = xmlBufAvail(out);
- /*
- * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
- * 45 chars should be sufficient to reach the end of the encoding
- * declaration without going too far inside the document content.
- * on UTF-16 this means 90bytes, on UCS4 this means 180
- * The actual value depending on guessed encoding is passed as @len
- * if provided
- */
- if (len >= 0) {
- if (toconv > (unsigned int) len)
- toconv = len;
- } else {
- if (toconv > 180)
- toconv = 180;
- }
- if (toconv * 2 >= written) {
- xmlBufGrow(out, toconv * 2);
- written = xmlBufAvail(out);
- }
- if (written > 360)
- written = 360;
-
- c_in = toconv;
- c_out = written;
- ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
- xmlBufContent(in), &c_in, 0);
- xmlBufShrink(in, c_in);
- xmlBufAddLen(out, c_out);
- if (ret == -1)
- ret = -3;
-
- switch (ret) {
- case 0:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input\n",
- c_in, c_out);
-#endif
- break;
- case -1:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input, %d left\n",
- c_in, c_out, (int)xmlBufUse(in));
-#endif
- break;
- case -3:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input, %d left\n",
- c_in, c_out, (int)xmlBufUse(in));
-#endif
- break;
- case -2: {
- char buf[50];
- const xmlChar *content = xmlBufContent(in);
-
- snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
- content[0], content[1],
- content[2], content[3]);
- buf[49] = 0;
- xmlEncodingErr(XML_I18N_CONV_FAILED,
- "input conversion failed due to input error, bytes %s\n",
- buf);
- }
- }
- /*
- * Ignore when input buffer is not on a boundary
- */
- if (ret == -3) ret = 0;
- if (ret == -1) ret = 0;
- return(c_out ? c_out : ret);
+ return(xmlCharEncInFunc(handler, out, in));
}
/**
@@ -2315,10 +2103,7 @@ xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
*
* Generic front-end for the encoding handler on parser input
*
- * Returns the number of byte written if success, or
- * -1 general error
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
@@ -2333,7 +2118,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
if ((input == NULL) || (input->encoder == NULL) ||
(input->buffer == NULL) || (input->raw == NULL))
- return (-1);
+ return(XML_ENC_ERR_INTERNAL);
out = input->buffer;
in = input->raw;
@@ -2345,7 +2130,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
written = xmlBufAvail(out);
if (toconv * 2 >= written) {
if (xmlBufGrow(out, toconv * 2) < 0)
- return (-1);
+ return(XML_ENC_ERR_MEMORY);
written = xmlBufAvail(out);
}
if ((written > 128 * 1024) && (flush == 0))
@@ -2357,50 +2142,14 @@ xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
xmlBufContent(in), &c_in, flush);
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
- if (ret == -1)
- ret = -3;
- switch (ret) {
- case 0:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input\n",
- c_in, c_out);
-#endif
- break;
- case -1:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input, %d left\n",
- c_in, c_out, (int)xmlBufUse(in));
-#endif
- break;
- case -3:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input, %d left\n",
- c_in, c_out, (int)xmlBufUse(in));
-#endif
- break;
- case -2: {
- char buf[50];
- const xmlChar *content = xmlBufContent(in);
-
- snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
- content[0], content[1],
- content[2], content[3]);
- buf[49] = 0;
- xmlEncodingErr(XML_I18N_CONV_FAILED,
- "input conversion failed due to input error, bytes %s\n",
- buf);
- }
+ if ((c_out == 0) && (ret != 0)) {
+ if (input->error == 0)
+ input->error = xmlEncConvertError(ret);
+ return(ret);
}
- /*
- * Ignore when input buffer is not on a boundary
- */
- if (ret == -3)
- ret = 0;
- return (c_out? c_out : ret);
+
+ return (c_out);
}
/**
@@ -2411,10 +2160,7 @@ xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
*
* Generic front-end for the encoding handler input function
*
- * Returns the number of byte written if success, or
- * -1 general error
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
@@ -2425,11 +2171,11 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
int toconv;
if (handler == NULL)
- return (-1);
+ return(XML_ENC_ERR_INTERNAL);
if (out == NULL)
- return (-1);
+ return(XML_ENC_ERR_INTERNAL);
if (in == NULL)
- return (-1);
+ return(XML_ENC_ERR_INTERNAL);
toconv = in->use;
if (toconv == 0)
@@ -2444,48 +2190,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
xmlBufferShrink(in, toconv);
out->use += written;
out->content[out->use] = 0;
- if (ret == -1)
- ret = -3;
- switch (ret) {
- case 0:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input\n",
- toconv, written);
-#endif
- break;
- case -1:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input, %d left\n",
- toconv, written, in->use);
-#endif
- break;
- case -3:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of input, %d left\n",
- toconv, written, in->use);
-#endif
- break;
- case -2: {
- char buf[50];
-
- snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
- in->content[0], in->content[1],
- in->content[2], in->content[3]);
- buf[49] = 0;
- xmlEncodingErr(XML_I18N_CONV_FAILED,
- "input conversion failed due to input error, bytes %s\n",
- buf);
- }
- }
- /*
- * Ignore when input buffer is not on a boundary
- */
- if (ret == -3)
- ret = 0;
return (written? written : ret);
}
@@ -2502,10 +2207,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler * handler, xmlBufferPtr out,
* In case of UTF8 sequence conversion errors for the given encoder,
* the content will be automatically remapped to a CharRef sequence.
*
- * Returns the number of byte written if success, or
- * -1 general error
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncOutput(xmlOutputBufferPtr output, int init)
@@ -2521,7 +2223,7 @@ xmlCharEncOutput(xmlOutputBufferPtr output, int init)
if ((output == NULL) || (output->encoder == NULL) ||
(output->buffer == NULL) || (output->conv == NULL))
- return (-1);
+ return(XML_ENC_ERR_INTERNAL);
out = output->conv;
in = output->buffer;
@@ -2568,94 +2270,62 @@ retry:
xmlBufShrink(in, c_in);
xmlBufAddLen(out, c_out);
writtentot += c_out;
- if (ret == -1) {
- if (c_out > 0) {
- /* Can be a limitation of iconv or uconv */
- goto retry;
- }
- ret = -3;
- }
+
+ if (ret == XML_ENC_ERR_SPACE)
+ goto retry;
/*
* Attempt to handle error cases
*/
- switch (ret) {
- case 0:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of output\n",
- c_in, c_out);
-#endif
- break;
- case -1:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "output conversion failed by lack of space\n");
-#endif
- break;
- case -3:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d bytes of output %d left\n",
- c_in, c_out, (int) xmlBufUse(in));
-#endif
- break;
- case -4:
- xmlEncodingErr(XML_I18N_NO_OUTPUT,
- "xmlCharEncOutFunc: no output function !\n", NULL);
- ret = -1;
- break;
- case -2: {
- xmlChar charref[20];
- int len = xmlBufUse(in);
- xmlChar *content = xmlBufContent(in);
- int cur, charrefLen;
-
- cur = xmlGetUTF8Char(content, &len);
- if (cur <= 0)
- break;
+ if (ret == XML_ENC_ERR_INPUT) {
+ xmlChar charref[20];
+ int len = xmlBufUse(in);
+ xmlChar *content = xmlBufContent(in);
+ int cur, charrefLen;
+
+ cur = xmlGetUTF8Char(content, &len);
+ if (cur <= 0)
+ goto error;
#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "handling output conversion error\n");
- xmlGenericError(xmlGenericErrorContext,
- "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
- content[0], content[1],
- content[2], content[3]);
+ xmlGenericError(xmlGenericErrorContext,
+ "handling output conversion error\n");
+ xmlGenericError(xmlGenericErrorContext,
+ "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ content[0], content[1],
+ content[2], content[3]);
#endif
- /*
- * Removes the UTF8 sequence, and replace it by a charref
- * and continue the transcoding phase, hoping the error
- * did not mangle the encoder state.
- */
- charrefLen = snprintf((char *) &charref[0], sizeof(charref),
- "&#%d;", cur);
- xmlBufShrink(in, len);
- xmlBufGrow(out, charrefLen * 4);
- c_out = xmlBufAvail(out);
- c_in = charrefLen;
- ret = xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out,
- charref, &c_in);
-
- if ((ret < 0) || (c_in != charrefLen)) {
- char buf[50];
-
- snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
- content[0], content[1],
- content[2], content[3]);
- buf[49] = 0;
- xmlEncodingErr(XML_I18N_CONV_FAILED,
- "output conversion failed due to conv error, bytes %s\n",
- buf);
- content[0] = ' ';
- break;
- }
+ /*
+ * Removes the UTF8 sequence, and replace it by a charref
+ * and continue the transcoding phase, hoping the error
+ * did not mangle the encoder state.
+ */
+ charrefLen = snprintf((char *) &charref[0], sizeof(charref),
+ "&#%d;", cur);
+ xmlBufShrink(in, len);
+ xmlBufGrow(out, charrefLen * 4);
+ c_out = xmlBufAvail(out);
+ c_in = charrefLen;
+ ret = xmlEncOutputChunk(output->encoder, xmlBufEnd(out), &c_out,
+ charref, &c_in);
+ if ((ret < 0) || (c_in != charrefLen)) {
+ ret = XML_ENC_ERR_INTERNAL;
+ goto error;
+ }
- xmlBufAddLen(out, c_out);
- writtentot += c_out;
- goto retry;
- }
+ xmlBufAddLen(out, c_out);
+ writtentot += c_out;
+ goto retry;
}
- return(writtentot ? writtentot : ret);
+
+error:
+ if ((writtentot <= 0) && (ret != 0)) {
+ if (output->error == 0)
+ output->error = xmlEncConvertError(ret);
+ return(ret);
+ }
+
+ return(writtentot);
}
#endif
@@ -2672,10 +2342,7 @@ retry:
* In case of UTF8 sequence conversion errors for the given encoder,
* the content will be automatically remapped to a CharRef sequence.
*
- * Returns the number of byte written if success, or
- * -1 general error
- * -2 if the transcoding fails (for *in is not valid utf8 string or
- * the result of transformation can't fit into the encoding we want), or
+ * Returns the number of bytes written or an XML_ENC_ERR code.
*/
int
xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
@@ -2685,8 +2352,8 @@ xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
int writtentot = 0;
int toconv;
- if (handler == NULL) return(-1);
- if (out == NULL) return(-1);
+ if (handler == NULL) return(XML_ENC_ERR_INTERNAL);
+ if (out == NULL) return(XML_ENC_ERR_INTERNAL);
retry:
@@ -2728,93 +2395,51 @@ retry:
out->use += written;
writtentot += written;
out->content[out->use] = 0;
- if (ret == -1) {
- if (written > 0) {
- /* Can be a limitation of iconv or uconv */
- goto retry;
- }
- ret = -3;
- }
+
+ if (ret == XML_ENC_ERR_SPACE)
+ goto retry;
/*
* Attempt to handle error cases
*/
- switch (ret) {
- case 0:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "converted %d bytes to %d bytes of output\n",
- toconv, written);
-#endif
- break;
- case -1:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "output conversion failed by lack of space\n");
-#endif
- break;
- case -3:
-#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d bytes of output %d left\n",
- toconv, written, in->use);
-#endif
- break;
- case -4:
- xmlEncodingErr(XML_I18N_NO_OUTPUT,
- "xmlCharEncOutFunc: no output function !\n", NULL);
- ret = -1;
- break;
- case -2: {
- xmlChar charref[20];
- int len = in->use;
- const xmlChar *utf = (const xmlChar *) in->content;
- int cur, charrefLen;
-
- cur = xmlGetUTF8Char(utf, &len);
- if (cur <= 0)
- break;
+ if (ret == XML_ENC_ERR_INPUT) {
+ xmlChar charref[20];
+ int len = in->use;
+ const xmlChar *utf = (const xmlChar *) in->content;
+ int cur, charrefLen;
+
+ cur = xmlGetUTF8Char(utf, &len);
+ if (cur <= 0)
+ return(ret);
#ifdef DEBUG_ENCODING
- xmlGenericError(xmlGenericErrorContext,
- "handling output conversion error\n");
- xmlGenericError(xmlGenericErrorContext,
- "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
- in->content[0], in->content[1],
- in->content[2], in->content[3]);
+ xmlGenericError(xmlGenericErrorContext,
+ "handling output conversion error\n");
+ xmlGenericError(xmlGenericErrorContext,
+ "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
+ in->content[0], in->content[1],
+ in->content[2], in->content[3]);
#endif
- /*
- * Removes the UTF8 sequence, and replace it by a charref
- * and continue the transcoding phase, hoping the error
- * did not mangle the encoder state.
- */
- charrefLen = snprintf((char *) &charref[0], sizeof(charref),
- "&#%d;", cur);
- xmlBufferShrink(in, len);
- xmlBufferGrow(out, charrefLen * 4);
- written = out->size - out->use - 1;
- toconv = charrefLen;
- ret = xmlEncOutputChunk(handler, &out->content[out->use], &written,
- charref, &toconv);
-
- if ((ret < 0) || (toconv != charrefLen)) {
- char buf[50];
-
- snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
- in->content[0], in->content[1],
- in->content[2], in->content[3]);
- buf[49] = 0;
- xmlEncodingErr(XML_I18N_CONV_FAILED,
- "output conversion failed due to conv error, bytes %s\n",
- buf);
- in->content[0] = ' ';
- break;
- }
+ /*
+ * Removes the UTF8 sequence, and replace it by a charref
+ * and continue the transcoding phase, hoping the error
+ * did not mangle the encoder state.
+ */
+ charrefLen = snprintf((char *) &charref[0], sizeof(charref),
+ "&#%d;", cur);
+ xmlBufferShrink(in, len);
+ xmlBufferGrow(out, charrefLen * 4);
+ written = out->size - out->use - 1;
+ toconv = charrefLen;
+ ret = xmlEncOutputChunk(handler, &out->content[out->use], &written,
+ charref, &toconv);
+ if ((ret < 0) || (toconv != charrefLen))
+ return(XML_ENC_ERR_INTERNAL);
- out->use += written;
- writtentot += written;
- out->content[out->use] = 0;
- goto retry;
- }
+ out->use += written;
+ writtentot += written;
+ out->content[out->use] = 0;
+ goto retry;
}
return(writtentot ? writtentot : ret);
}
@@ -2938,15 +2563,11 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) {
written = 32000;
ret = xmlEncOutputChunk(handler, &convbuf[0], &written,
cur, &toconv);
- if (ret < 0) {
- if (written > 0)
- ret = -2;
- else
- return(-1);
- }
+ if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE))
+ return(-1);
unused += written;
cur += toconv;
- } while (ret == -2);
+ } while (ret == XML_ENC_ERR_SPACE);
}
if (in->buf->rawconsumed < unused)
return(-1);
@@ -2969,9 +2590,10 @@ xmlByteConsumed(xmlParserCtxtPtr ctxt) {
* Take a block of UTF-8 chars in and try to convert it to an ISO 8859-*
* block of chars out.
*
- * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of @inlen after return is the number of octets consumed
- * as the return value is positive, else unpredictable.
+ * as the return value is positive, else unpredictable.
* The value of @outlen after return is the number of octets consumed.
*/
static int
@@ -2985,7 +2607,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
(xlattable == NULL))
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
if (in == NULL) {
/*
* initialization nothing to do
@@ -3003,21 +2625,21 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
/* trailing byte in leading position */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
} else if (d < 0xE0) {
unsigned char c;
if (!(in < inend)) {
/* trailing byte not in input buffer */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-3);
+ return(XML_ENC_ERR_PARTIAL);
}
c = *in++;
if ((c & 0xC0) != 0x80) {
/* not a trailing byte */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
c = c & 0x3F;
d = d & 0x1F;
@@ -3026,7 +2648,7 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
/* not in character set */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
*out++ = d;
} else if (d < 0xF0) {
@@ -3036,21 +2658,21 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
/* trailing bytes not in input buffer */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-3);
+ return(XML_ENC_ERR_PARTIAL);
}
c1 = *in++;
if ((c1 & 0xC0) != 0x80) {
/* not a trailing byte (c1) */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
c2 = *in++;
if ((c2 & 0xC0) != 0x80) {
/* not a trailing byte (c2) */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
c1 = c1 & 0x3F;
c2 = c2 & 0x3F;
@@ -3061,14 +2683,14 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
/* not in character set */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
*out++ = d;
} else {
/* cannot transcode >= U+010000 */
*outlen = out - outstart;
*inlen = processed - instart;
- return(-2);
+ return(XML_ENC_ERR_INPUT);
}
processed = in;
}
@@ -3086,7 +2708,9 @@ UTF8ToISO8859x(unsigned char* out, int *outlen,
*
* Take a block of ISO 8859-* chars in and try to convert it to an UTF-8
* block of chars out.
- * Returns 0 if success, or -1 otherwise
+ *
+ * Returns the number of bytes written or an XML_ENC_ERR code.
+ *
* The value of @inlen after return is the number of octets consumed
* The value of @outlen after return is the number of octets produced.
*/
@@ -3103,7 +2727,7 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
(in == NULL) || (unicodetable == NULL))
- return(-1);
+ return(XML_ENC_ERR_INTERNAL);
outend = out + *outlen;
inend = in + *inlen;
instop = inend;
@@ -3115,7 +2739,7 @@ ISO8859xToUTF8(unsigned char* out, int *outlen,
/* undefined code point */
*outlen = out - outstart;
*inlen = in - instart;
- return (-1);
+ return(XML_ENC_ERR_INPUT);
}
if (c < 0x800) {
*out++ = ((c >> 6) & 0x1F) | 0xC0;
diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h
index 231b0be1..91fe87d7 100644
--- a/include/libxml/encoding.h
+++ b/include/libxml/encoding.h
@@ -32,6 +32,15 @@
extern "C" {
#endif
+typedef enum {
+ XML_ENC_ERR_SUCCESS = 0,
+ XML_ENC_ERR_SPACE = -1,
+ XML_ENC_ERR_INPUT = -2,
+ XML_ENC_ERR_PARTIAL = -3,
+ XML_ENC_ERR_INTERNAL = -4,
+ XML_ENC_ERR_MEMORY = -5
+} xmlCharEncError;
+
/*
* xmlCharEncoding:
*
@@ -203,6 +212,7 @@ XMLPUBFUN int
xmlCharEncInFunc (xmlCharEncodingHandler *handler,
xmlBufferPtr out,
xmlBufferPtr in);
+XML_DEPRECATED
XMLPUBFUN int
xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
xmlBufferPtr out,
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index ab512499..513981ea 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -330,6 +330,7 @@ XMLPUBFUN int
XMLPUBFUN xmlParserInputPtr
xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
const xmlChar *buffer);
+XML_DEPRECATED
XMLPUBFUN xmlParserInputPtr
xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
xmlEntityPtr entity);
@@ -551,29 +552,38 @@ XMLPUBFUN xmlChar *
/*
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
*/
+XML_DEPRECATED
XMLPUBFUN int nodePush (xmlParserCtxtPtr ctxt,
xmlNodePtr value);
+XML_DEPRECATED
XMLPUBFUN xmlNodePtr nodePop (xmlParserCtxtPtr ctxt);
XMLPUBFUN int inputPush (xmlParserCtxtPtr ctxt,
xmlParserInputPtr value);
XMLPUBFUN xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
XMLPUBFUN const xmlChar * namePop (xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
XMLPUBFUN int namePush (xmlParserCtxtPtr ctxt,
const xmlChar *value);
/*
* other commodities shared between parser.c and parserInternals.
*/
+XML_DEPRECATED
XMLPUBFUN int xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
XMLPUBFUN int xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
const xmlChar *cur,
int *len);
+XML_DEPRECATED
XMLPUBFUN void xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
XMLPUBFUN int xmlCheckLanguageID (const xmlChar *lang);
/*
* Really core function shared with HTML parser.
*/
+XML_DEPRECATED
XMLPUBFUN int xmlCurrentChar (xmlParserCtxtPtr ctxt,
int *len);
XMLPUBFUN int xmlCopyCharMultiByte (xmlChar *out,
@@ -581,6 +591,7 @@ XMLPUBFUN int xmlCopyCharMultiByte (xmlChar *out,
XMLPUBFUN int xmlCopyChar (int len,
xmlChar *out,
int val);
+XML_DEPRECATED
XMLPUBFUN void xmlNextChar (xmlParserCtxtPtr ctxt);
XML_DEPRECATED
XMLPUBFUN void xmlParserInputShrink (xmlParserInputPtr in);
diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h
index 969d6877..830933a7 100644
--- a/include/libxml/xmlmemory.h
+++ b/include/libxml/xmlmemory.h
@@ -139,6 +139,8 @@ XMLPUBFUN void
/*
* These are specific to the XML debug memory wrapper.
*/
+XMLPUBFUN size_t
+ xmlMemSize (void *ptr);
XMLPUBFUN int
xmlMemUsed (void);
XMLPUBFUN int
diff --git a/include/libxml/xmlschemastypes.h b/include/libxml/xmlschemastypes.h
index eb1388db..e2cde357 100644
--- a/include/libxml/xmlschemastypes.h
+++ b/include/libxml/xmlschemastypes.h
@@ -30,7 +30,7 @@ typedef enum {
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
} xmlSchemaWhitespaceValueType;
-XMLPUBFUN void
+XMLPUBFUN int
xmlSchemaInitTypes (void);
XML_DEPRECATED
XMLPUBFUN void
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h
index b57985a2..6dae0780 100644
--- a/include/libxml/xpath.h
+++ b/include/libxml/xpath.h
@@ -400,7 +400,7 @@ struct _xmlXPathParserContext {
int xptr; /* it this an XPointer expression */
xmlNodePtr ancestor; /* used for walking preceding axis */
- int valueFrame; /* unused */
+ int valueFrame; /* always zero for compatibility */
};
/************************************************************************
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h
index cb0991d7..870055f9 100644
--- a/include/libxml/xpathInternals.h
+++ b/include/libxml/xpathInternals.h
@@ -297,7 +297,7 @@ XMLPUBFUN void *
if (ctxt == NULL) return; \
if (nargs != (x)) \
XP_ERROR(XPATH_INVALID_ARITY); \
- if (ctxt->valueNr < ctxt->valueFrame + (x)) \
+ if (ctxt->valueNr < (x)) \
XP_ERROR(XPATH_STACK_ERROR);
/**
diff --git a/include/private/enc.h b/include/private/enc.h
index ddfc8aea..cbdc2b33 100644
--- a/include/private/enc.h
+++ b/include/private/enc.h
@@ -8,7 +8,8 @@ XML_HIDDEN void
xmlInitEncodingInternal(void);
XML_HIDDEN int
-xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len);
+xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
+ int *outlen, const unsigned char *in, int *inlen, int flush);
XML_HIDDEN int
xmlCharEncInput(xmlParserInputBufferPtr input, int flush);
XML_HIDDEN int
diff --git a/include/private/parser.h b/include/private/parser.h
index 628f5a90..bf933f7d 100644
--- a/include/private/parser.h
+++ b/include/private/parser.h
@@ -20,12 +20,16 @@
XML_HIDDEN void
xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
XML_HIDDEN void
+xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info);
+XML_HIDDEN void
__xmlErrEncoding(xmlParserCtxtPtr ctxt, xmlParserErrors xmlerr,
const char *msg, const xmlChar *str1,
const xmlChar *str2) LIBXML_ATTR_FORMAT(3,0);
+XML_HIDDEN void
+xmlHaltParser(xmlParserCtxtPtr ctxt);
XML_HIDDEN int
xmlParserGrow(xmlParserCtxtPtr ctxt);
-XML_HIDDEN int
+XML_HIDDEN void
xmlParserShrink(xmlParserCtxtPtr ctxt);
#endif /* XML_PARSER_H_PRIVATE__ */
diff --git a/libxml.m4 b/libxml.m4
index 622a7499..27ad84d4 100644
--- a/libxml.m4
+++ b/libxml.m4
@@ -2,7 +2,7 @@ dnl AM_PATH_XML2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for XML, and define XML_CPPFLAGS and XML_LIBS
dnl
AC_DEFUN([AM_PATH_XML2],[
- AC_MSG_WARN([AM_PATH_XML2 is deprecated, use PKG_CHECK_MODULES instead])
+ m4_warn([obsolete], [AM_PATH_XML2 is deprecated, use PKG_CHECK_MODULES instead])
AC_REQUIRE([PKG_PROG_PKG_CONFIG])
verdep=ifelse([$1], [], [], [">= $1"])
diff --git a/libxml2.syms b/libxml2.syms
index 7794596e..24b8f9fd 100644
--- a/libxml2.syms
+++ b/libxml2.syms
@@ -1,52 +1,2285 @@
#
-# Retained for backward compatibility.
-#
-# The original version script didn't account for configuration options.
-# Since libxml2 never made use of symbol versioning, all symbols were
-# removed in version 2.11.0. Only the version nodes are kept to avoid
-# errors when running binaries linked against older versions.
+# Retained for backward compatibility. Don't add new symbols.
#
-LIBXML2_2.4.30 {};
-LIBXML2_2.5.0 {} LIBXML2_2.4.30;
-LIBXML2_2.5.2 {} LIBXML2_2.5.0;
-LIBXML2_2.5.4 {} LIBXML2_2.5.2;
-LIBXML2_2.5.5 {} LIBXML2_2.5.4;
-LIBXML2_2.5.6 {} LIBXML2_2.5.5;
-LIBXML2_2.5.7 {} LIBXML2_2.5.6;
-LIBXML2_2.5.8 {} LIBXML2_2.5.7;
-LIBXML2_2.5.9 {} LIBXML2_2.5.8;
-LIBXML2_2.6.0 {} LIBXML2_2.5.9;
-LIBXML2_2.6.1 {} LIBXML2_2.6.0;
-LIBXML2_2.6.2 {} LIBXML2_2.6.1;
-LIBXML2_2.6.3 {} LIBXML2_2.6.2;
-LIBXML2_2.6.5 {} LIBXML2_2.6.3;
-LIBXML2_2.6.6 {} LIBXML2_2.6.5;
-LIBXML2_2.6.7 {} LIBXML2_2.6.6;
-LIBXML2_2.6.8 {} LIBXML2_2.6.7;
-LIBXML2_2.6.10 {} LIBXML2_2.6.8;
-LIBXML2_2.6.11 {} LIBXML2_2.6.10;
-LIBXML2_2.6.12 {} LIBXML2_2.6.11;
-LIBXML2_2.6.14 {} LIBXML2_2.6.12;
-LIBXML2_2.6.15 {} LIBXML2_2.6.14;
-LIBXML2_2.6.16 {} LIBXML2_2.6.15;
-LIBXML2_2.6.17 {} LIBXML2_2.6.16;
-LIBXML2_2.6.18 {} LIBXML2_2.6.17;
-LIBXML2_2.6.19 {} LIBXML2_2.6.18;
-LIBXML2_2.6.20 {} LIBXML2_2.6.19;
-LIBXML2_2.6.21 {} LIBXML2_2.6.20;
-LIBXML2_2.6.23 {} LIBXML2_2.6.21;
-LIBXML2_2.6.24 {} LIBXML2_2.6.23;
-LIBXML2_2.6.25 {} LIBXML2_2.6.24;
-LIBXML2_2.6.27 {} LIBXML2_2.6.25;
-LIBXML2_2.6.28 {} LIBXML2_2.6.27;
-LIBXML2_2.6.32 {} LIBXML2_2.6.28;
-LIBXML2_2.7.0 {} LIBXML2_2.6.32;
-LIBXML2_2.7.3 {} LIBXML2_2.7.0;
-LIBXML2_2.7.4 {} LIBXML2_2.7.3;
-LIBXML2_2.8.0 {} LIBXML2_2.7.4;
-LIBXML2_2.9.0 {} LIBXML2_2.8.0;
-LIBXML2_2.9.1 {} LIBXML2_2.9.0;
-LIBXML2_2.9.8 {} LIBXML2_2.9.1;
-LIBXML2_2.9.11 {} LIBXML2_2.9.8;
-LIBXML2_2.11.0 {} LIBXML2_2.9.11;
+LIBXML2_2.4.30 {
+ global:
+
+# debugXML
+ xmlBoolToText;
+ xmlDebugDumpAttr;
+ xmlDebugDumpAttrList;
+ xmlDebugDumpDTD;
+ xmlDebugDumpDocument;
+ xmlDebugDumpDocumentHead;
+ xmlDebugDumpEntities;
+ xmlDebugDumpNode;
+ xmlDebugDumpNodeList;
+ xmlDebugDumpOneNode;
+ xmlDebugDumpString;
+ xmlLsCountNode;
+ xmlLsOneNode;
+ xmlShell;
+ xmlShellBase;
+ xmlShellCat;
+ xmlShellDir;
+ xmlShellDu;
+ xmlShellList;
+ xmlShellLoad;
+ xmlShellPrintNode;
+ xmlShellPrintXPathError;
+ xmlShellPrintXPathResult;
+ xmlShellPwd;
+ xmlShellSave;
+ xmlShellValidate;
+ xmlShellWrite;
+
+# xpointer
+ xmlXPtrBuildNodeList;
+ xmlXPtrEval;
+ xmlXPtrEvalRangePredicate;
+ xmlXPtrFreeLocationSet;
+ xmlXPtrLocationSetAdd;
+ xmlXPtrLocationSetCreate;
+ xmlXPtrLocationSetDel;
+ xmlXPtrLocationSetMerge;
+ xmlXPtrLocationSetRemove;
+ xmlXPtrNewCollapsedRange;
+ xmlXPtrNewContext;
+ xmlXPtrNewLocationSetNodeSet;
+ xmlXPtrNewLocationSetNodes;
+ xmlXPtrNewRange;
+ xmlXPtrNewRangeNodeObject;
+ xmlXPtrNewRangeNodePoint;
+ xmlXPtrNewRangeNodes;
+ xmlXPtrNewRangePointNode;
+ xmlXPtrNewRangePoints;
+ xmlXPtrRangeToFunction;
+ xmlXPtrWrapLocationSet;
+
+# SAX
+ attribute;
+ attributeDecl;
+ cdataBlock;
+ characters;
+ checkNamespace;
+ comment;
+
+# SAX2
+# docbDefaultSAXHandlerInit; removed in 2.10.0
+
+# SAX
+ elementDecl;
+ endDocument;
+ endElement;
+ entityDecl;
+ externalSubset;
+ getColumnNumber;
+ getEntity;
+ getLineNumber;
+ getNamespace;
+ getParameterEntity;
+ getPublicId;
+ getSystemId;
+ globalNamespace;
+ hasExternalSubset;
+ hasInternalSubset;
+
+# SAX2
+ htmlDefaultSAXHandlerInit;
+
+# SAX
+ ignorableWhitespace;
+# initdocbDefaultSAXHandler; removed in 2.10.0
+ inithtmlDefaultSAXHandler;
+ initxmlDefaultSAXHandler;
+ internalSubset;
+ isStandalone;
+ namespaceDecl;
+ notationDecl;
+ processingInstruction;
+ reference;
+ resolveEntity;
+ setDocumentLocator;
+ setNamespace;
+ startDocument;
+ startElement;
+ unparsedEntityDecl;
+
+# SAX2
+ xmlDefaultSAXHandlerInit;
+
+# parserInternals
+ htmlCreateFileParserCtxt;
+ htmlInitAutoClose;
+ inputPop;
+ inputPush;
+ namePop;
+ namePush;
+ nodePop;
+ nodePush;
+ xmlCheckLanguageID;
+ xmlCopyChar;
+ xmlCopyCharMultiByte;
+ xmlCreateEntityParserCtxt;
+ xmlCreateFileParserCtxt;
+ xmlCreateMemoryParserCtxt;
+ xmlCurrentChar;
+ xmlDecodeEntities;
+ xmlFreeInputStream;
+ xmlHandleEntity;
+
+# chvalid
+ xmlIsBaseChar;
+ xmlIsBlank;
+ xmlIsChar;
+ xmlIsCombining;
+ xmlIsDigit;
+ xmlIsExtender;
+ xmlIsIdeographic;
+
+# parserInternals
+ xmlIsLetter;
+
+# chvalid
+ xmlIsPubidChar;
+
+# parserInternals
+ xmlNamespaceParseNCName;
+ xmlNamespaceParseNSDef;
+ xmlNamespaceParseQName;
+ xmlNewEntityInputStream;
+ xmlNewInputFromFile;
+ xmlNewInputStream;
+
+# parser
+ xmlNewParserCtxt;
+
+# parserInternals
+ xmlNewStringInputStream;
+ xmlNextChar;
+ xmlParseAttValue;
+ xmlParseAttribute;
+ xmlParseAttributeListDecl;
+ xmlParseAttributeType;
+ xmlParseCDSect;
+ xmlParseCharData;
+ xmlParseCharRef;
+ xmlParseComment;
+ xmlParseContent;
+ xmlParseDefaultDecl;
+ xmlParseDocTypeDecl;
+ xmlParseElement;
+ xmlParseElementChildrenContentDecl;
+ xmlParseElementContentDecl;
+ xmlParseElementDecl;
+ xmlParseElementMixedContentDecl;
+ xmlParseEncName;
+ xmlParseEncodingDecl;
+ xmlParseEndTag;
+ xmlParseEntityDecl;
+ xmlParseEntityRef;
+ xmlParseEntityValue;
+ xmlParseEnumeratedType;
+ xmlParseEnumerationType;
+ xmlParseExternalID;
+ xmlParseExternalSubset;
+ xmlParseMarkupDecl;
+ xmlParseMisc;
+ xmlParseName;
+ xmlParseNamespace;
+ xmlParseNmtoken;
+ xmlParseNotationDecl;
+ xmlParseNotationType;
+ xmlParsePEReference;
+ xmlParsePI;
+ xmlParsePITarget;
+ xmlParsePubidLiteral;
+ xmlParseQuotedString;
+ xmlParseReference;
+ xmlParseSDDecl;
+ xmlParseStartTag;
+ xmlParseSystemLiteral;
+ xmlParseTextDecl;
+ xmlParseVersionInfo;
+ xmlParseVersionNum;
+ xmlParseXMLDecl;
+ xmlParserHandlePEReference;
+ xmlParserHandleReference;
+ xmlParserInputShrink;
+ xmlPopInput;
+ xmlPushInput;
+ xmlScanName;
+ xmlSetEntityReferenceFunc;
+ xmlSkipBlankChars;
+ xmlSplitQName;
+ xmlStringComment; # variable
+ xmlStringCurrentChar;
+ xmlStringDecodeEntities;
+ xmlStringText; # variable
+ xmlStringTextNoenc; # variable
+ xmlSwitchEncoding;
+ xmlSwitchToEncoding;
+
+# c14n
+ xmlC14NDocDumpMemory;
+ xmlC14NDocSave;
+ xmlC14NDocSaveTo;
+ xmlC14NExecute;
+
+# catalog
+ xmlACatalogAdd;
+ xmlACatalogDump;
+ xmlACatalogRemove;
+ xmlACatalogResolve;
+ xmlACatalogResolvePublic;
+ xmlACatalogResolveSystem;
+ xmlACatalogResolveURI;
+ xmlCatalogAdd;
+ xmlCatalogAddLocal;
+ xmlCatalogCleanup;
+ xmlCatalogConvert;
+ xmlCatalogDump;
+ xmlCatalogFreeLocal;
+ xmlCatalogGetDefaults;
+ xmlCatalogGetPublic;
+ xmlCatalogGetSystem;
+ xmlCatalogIsEmpty;
+ xmlCatalogLocalResolve;
+ xmlCatalogLocalResolveURI;
+ xmlCatalogRemove;
+ xmlCatalogResolve;
+ xmlCatalogResolvePublic;
+ xmlCatalogResolveSystem;
+ xmlCatalogResolveURI;
+ xmlCatalogSetDebug;
+ xmlCatalogSetDefaultPrefer;
+ xmlCatalogSetDefaults;
+ xmlConvertSGMLCatalog;
+ xmlFreeCatalog;
+ xmlInitializeCatalog;
+ xmlLoadACatalog;
+ xmlLoadCatalog;
+ xmlLoadCatalogs;
+ xmlLoadSGMLSuperCatalog;
+ xmlNewCatalog;
+ xmlParseCatalogFile;
+
+# xpathInternals
+ valuePop;
+ valuePush;
+ xmlXPathAddValues;
+ xmlXPathBooleanFunction;
+ xmlXPathCeilingFunction;
+ xmlXPathCompareValues;
+ xmlXPathConcatFunction;
+ xmlXPathContainsFunction;
+ xmlXPathCountFunction;
+ xmlXPathDebugDumpCompExpr;
+ xmlXPathDebugDumpObject;
+ xmlXPathDifference;
+ xmlXPathDistinct;
+ xmlXPathDistinctSorted;
+ xmlXPathDivValues;
+ xmlXPathEqualValues;
+ xmlXPathEvalExpr;
+ xmlXPathEvaluatePredicateResult;
+ xmlXPathFalseFunction;
+ xmlXPathFloorFunction;
+ xmlXPathFreeParserContext;
+ xmlXPathFunctionLookup;
+ xmlXPathFunctionLookupNS;
+ xmlXPathHasSameNodes;
+ xmlXPathIdFunction;
+ xmlXPathIntersection;
+ xmlXPathIsNodeType;
+ xmlXPathLangFunction;
+ xmlXPathLastFunction;
+ xmlXPathLeading;
+ xmlXPathLeadingSorted;
+ xmlXPathLocalNameFunction;
+ xmlXPathModValues;
+ xmlXPathMultValues;
+ xmlXPathNamespaceURIFunction;
+ xmlXPathNewBoolean;
+ xmlXPathNewCString;
+ xmlXPathNewFloat;
+ xmlXPathNewNodeSet;
+ xmlXPathNewNodeSetList;
+ xmlXPathNewParserContext;
+ xmlXPathNewString;
+ xmlXPathNewValueTree;
+ xmlXPathNextAncestor;
+ xmlXPathNextAncestorOrSelf;
+ xmlXPathNextAttribute;
+ xmlXPathNextChild;
+ xmlXPathNextDescendant;
+ xmlXPathNextDescendantOrSelf;
+ xmlXPathNextFollowing;
+ xmlXPathNextFollowingSibling;
+ xmlXPathNextNamespace;
+ xmlXPathNextParent;
+ xmlXPathNextPreceding;
+ xmlXPathNextPrecedingSibling;
+ xmlXPathNextSelf;
+ xmlXPathNodeLeading;
+ xmlXPathNodeLeadingSorted;
+ xmlXPathNodeSetAdd;
+ xmlXPathNodeSetAddNs;
+ xmlXPathNodeSetAddUnique;
+ xmlXPathNodeSetContains;
+ xmlXPathNodeSetDel;
+ xmlXPathNodeSetFreeNs;
+ xmlXPathNodeSetMerge;
+ xmlXPathNodeSetRemove;
+ xmlXPathNodeSetSort;
+ xmlXPathNodeTrailing;
+ xmlXPathNodeTrailingSorted;
+ xmlXPathNormalizeFunction;
+ xmlXPathNotEqualValues;
+ xmlXPathNotFunction;
+ xmlXPathNsLookup;
+ xmlXPathNumberFunction;
+ xmlXPathParseNCName;
+ xmlXPathParseName;
+ xmlXPathPopBoolean;
+ xmlXPathPopExternal;
+ xmlXPathPopNodeSet;
+ xmlXPathPopNumber;
+ xmlXPathPopString;
+ xmlXPathPositionFunction;
+ xmlXPathRegisterAllFunctions;
+ xmlXPathRegisterFunc;
+ xmlXPathRegisterFuncLookup;
+ xmlXPathRegisterFuncNS;
+ xmlXPathRegisterNs;
+ xmlXPathRegisterVariable;
+ xmlXPathRegisterVariableLookup;
+ xmlXPathRegisterVariableNS;
+ xmlXPathRegisteredFuncsCleanup;
+ xmlXPathRegisteredNsCleanup;
+ xmlXPathRegisteredVariablesCleanup;
+ xmlXPathRoot;
+ xmlXPathRoundFunction;
+ xmlXPathStartsWithFunction;
+ xmlXPathStringEvalNumber;
+ xmlXPathStringFunction;
+ xmlXPathStringLengthFunction;
+ xmlXPathSubValues;
+ xmlXPathSubstringAfterFunction;
+ xmlXPathSubstringBeforeFunction;
+ xmlXPathSubstringFunction;
+ xmlXPathSumFunction;
+ xmlXPathTrailing;
+ xmlXPathTrailingSorted;
+ xmlXPathTranslateFunction;
+ xmlXPathTrueFunction;
+ xmlXPathValueFlipSign;
+ xmlXPathVariableLookup;
+ xmlXPathVariableLookupNS;
+ xmlXPathWrapCString;
+ xmlXPathWrapExternal;
+ xmlXPathWrapNodeSet;
+ xmlXPathWrapString;
+ xmlXPatherror;
+
+# xmlautomata
+ xmlAutomataCompile;
+ xmlAutomataGetInitState;
+ xmlAutomataIsDeterminist;
+ xmlAutomataNewAllTrans;
+ xmlAutomataNewCountTrans;
+ xmlAutomataNewCountedTrans;
+ xmlAutomataNewCounter;
+ xmlAutomataNewCounterTrans;
+ xmlAutomataNewEpsilon;
+ xmlAutomataNewOnceTrans;
+ xmlAutomataNewState;
+ xmlAutomataNewTransition;
+ xmlAutomataSetFinalState;
+ xmlFreeAutomata;
+ xmlNewAutomata;
+
+# HTMLtree
+ htmlDocContentDumpFormatOutput;
+ htmlDocContentDumpOutput;
+ htmlDocDump;
+ htmlDocDumpMemory;
+ htmlGetMetaEncoding;
+ htmlIsBooleanAttr;
+ htmlNewDoc;
+ htmlNewDocNoDtD;
+ htmlNodeDump;
+ htmlNodeDumpFile;
+ htmlNodeDumpFileFormat;
+ htmlNodeDumpFormatOutput;
+ htmlNodeDumpOutput;
+ htmlSaveFile;
+ htmlSaveFileEnc;
+ htmlSaveFileFormat;
+ htmlSetMetaEncoding;
+
+# nanoftp
+ xmlNanoFTPCheckResponse;
+ xmlNanoFTPCleanup;
+ xmlNanoFTPClose;
+ xmlNanoFTPCloseConnection;
+ xmlNanoFTPConnect;
+ xmlNanoFTPConnectTo;
+ xmlNanoFTPCwd;
+ xmlNanoFTPFreeCtxt;
+ xmlNanoFTPGet;
+ xmlNanoFTPGetConnection;
+ xmlNanoFTPGetResponse;
+ xmlNanoFTPGetSocket;
+ xmlNanoFTPInit;
+ xmlNanoFTPList;
+ xmlNanoFTPNewCtxt;
+ xmlNanoFTPOpen;
+ xmlNanoFTPProxy;
+ xmlNanoFTPQuit;
+ xmlNanoFTPRead;
+ xmlNanoFTPScanProxy;
+ xmlNanoFTPUpdateURL;
+
+# DOCBparser
+# docbCreateFileParserCtxt; removed in 2.10.0
+# docbCreatePushParserCtxt; removed in 2.10.0
+# docbEncodeEntities; removed in 2.10.0
+# docbFreeParserCtxt; removed in 2.10.0
+# docbParseChunk; removed in 2.10.0
+# docbParseDoc; removed in 2.10.0
+# docbParseDocument; removed in 2.10.0
+# docbParseFile; removed in 2.10.0
+# docbSAXParseDoc; removed in 2.10.0
+# docbSAXParseFile; removed in 2.10.0
+
+# xpath
+ xmlXPathCastBooleanToNumber;
+ xmlXPathCastBooleanToString;
+ xmlXPathCastNodeSetToBoolean;
+ xmlXPathCastNodeSetToNumber;
+ xmlXPathCastNodeSetToString;
+ xmlXPathCastNodeToNumber;
+ xmlXPathCastNodeToString;
+ xmlXPathCastNumberToBoolean;
+ xmlXPathCastNumberToString;
+ xmlXPathCastStringToBoolean;
+ xmlXPathCastStringToNumber;
+ xmlXPathCastToBoolean;
+ xmlXPathCastToNumber;
+ xmlXPathCastToString;
+ xmlXPathCmpNodes;
+ xmlXPathCompile;
+ xmlXPathCompiledEval;
+ xmlXPathConvertBoolean;
+ xmlXPathConvertNumber;
+ xmlXPathConvertString;
+ xmlXPathEval;
+ xmlXPathEvalExpression;
+ xmlXPathEvalPredicate;
+ xmlXPathFreeCompExpr;
+ xmlXPathFreeContext;
+ xmlXPathFreeNodeSet;
+ xmlXPathFreeNodeSetList;
+ xmlXPathFreeObject;
+ xmlXPathInit;
+ xmlXPathIsInf;
+ xmlXPathIsNaN;
+ xmlXPathNAN; # variable
+ xmlXPathNINF; # variable
+ xmlXPathNewContext;
+ xmlXPathNodeSetCreate;
+ xmlXPathObjectCopy;
+ xmlXPathPINF; # variable
+
+# xlink
+ xlinkGetDefaultDetect;
+ xlinkGetDefaultHandler;
+ xlinkIsLink;
+ xlinkSetDefaultDetect;
+ xlinkSetDefaultHandler;
+
+# entities
+ xmlAddDocEntity;
+ xmlAddDtdEntity;
+ xmlCleanupPredefinedEntities;
+ xmlCopyEntitiesTable;
+ xmlCreateEntitiesTable;
+ xmlDumpEntitiesTable;
+ xmlDumpEntityDecl;
+ xmlEncodeEntities;
+ xmlEncodeEntitiesReentrant;
+ xmlEncodeSpecialChars;
+ xmlFreeEntitiesTable;
+ xmlGetDocEntity;
+ xmlGetDtdEntity;
+ xmlGetParameterEntity;
+ xmlGetPredefinedEntity;
+ xmlInitializePredefinedEntities;
+
+# xinclude
+ xmlXIncludeProcess;
+
+# list
+ xmlLinkGetData;
+ xmlListAppend;
+ xmlListClear;
+ xmlListCopy;
+ xmlListCreate;
+ xmlListDelete;
+ xmlListDup;
+ xmlListEmpty;
+ xmlListEnd;
+ xmlListFront;
+ xmlListInsert;
+ xmlListMerge;
+ xmlListPopBack;
+ xmlListPopFront;
+ xmlListPushBack;
+ xmlListPushFront;
+ xmlListRemoveAll;
+ xmlListRemoveFirst;
+ xmlListRemoveLast;
+ xmlListReverse;
+ xmlListReverseSearch;
+ xmlListReverseWalk;
+ xmlListSearch;
+ xmlListSize;
+ xmlListSort;
+ xmlListWalk;
+
+# xmlmemory
+ xmlInitMemory;
+ xmlMallocLoc;
+ xmlMemDisplay;
+ xmlMemFree;
+ xmlMemGet;
+ xmlMemMalloc;
+ xmlMemRealloc;
+ xmlMemSetup;
+ xmlMemShow;
+ xmlMemStrdupLoc;
+ xmlMemUsed;
+ xmlMemoryDump;
+ xmlMemoryStrdup;
+ xmlReallocLoc;
+
+# xmlIO
+ xmlAllocOutputBuffer;
+ xmlAllocParserInputBuffer;
+ xmlCheckFilename;
+ xmlCleanupInputCallbacks;
+ xmlCleanupOutputCallbacks;
+ xmlFileClose;
+ xmlFileMatch;
+ xmlFileOpen;
+ xmlFileRead;
+ xmlFreeParserInputBuffer;
+ xmlIOFTPClose;
+ xmlIOFTPMatch;
+ xmlIOFTPOpen;
+ xmlIOFTPRead;
+ xmlIOHTTPClose;
+ xmlIOHTTPMatch;
+ xmlIOHTTPOpen;
+ xmlIOHTTPOpenW;
+ xmlIOHTTPRead;
+ xmlNoNetExternalEntityLoader;
+ xmlNormalizeWindowsPath;
+ xmlOutputBufferClose;
+ xmlOutputBufferCreateFd;
+ xmlOutputBufferCreateFile;
+ xmlOutputBufferCreateFilename;
+ xmlOutputBufferCreateIO;
+ xmlOutputBufferFlush;
+ xmlOutputBufferWrite;
+ xmlOutputBufferWriteString;
+ xmlParserGetDirectory;
+ xmlParserInputBufferCreateFd;
+ xmlParserInputBufferCreateFile;
+ xmlParserInputBufferCreateFilename;
+ xmlParserInputBufferCreateIO;
+ xmlParserInputBufferCreateMem;
+ xmlParserInputBufferGrow;
+ xmlParserInputBufferPush;
+ xmlParserInputBufferRead;
+ xmlRegisterDefaultInputCallbacks;
+ xmlRegisterDefaultOutputCallbacks;
+ xmlRegisterHTTPPostCallbacks;
+ xmlRegisterInputCallbacks;
+ xmlRegisterOutputCallbacks;
+
+# xmlversion
+ xmlCheckVersion;
+
+# valid
+ xmlAddAttributeDecl;
+ xmlAddElementDecl;
+ xmlAddID;
+ xmlAddNotationDecl;
+ xmlAddRef;
+ xmlCopyAttributeTable;
+ xmlCopyElementContent;
+ xmlCopyElementTable;
+ xmlCopyEnumeration;
+ xmlCopyNotationTable;
+ xmlCreateEnumeration;
+ xmlDumpAttributeDecl;
+ xmlDumpAttributeTable;
+ xmlDumpElementDecl;
+ xmlDumpElementTable;
+ xmlDumpNotationDecl;
+ xmlDumpNotationTable;
+ xmlFreeAttributeTable;
+ xmlFreeElementContent;
+ xmlFreeElementTable;
+ xmlFreeEnumeration;
+ xmlFreeIDTable;
+ xmlFreeNotationTable;
+ xmlFreeRefTable;
+ xmlGetDtdAttrDesc;
+ xmlGetDtdElementDesc;
+ xmlGetDtdNotationDesc;
+ xmlGetDtdQAttrDesc;
+ xmlGetDtdQElementDesc;
+ xmlGetID;
+ xmlGetRefs;
+ xmlIsID;
+ xmlIsMixedElement;
+ xmlIsRef;
+ xmlNewElementContent;
+ xmlRemoveID;
+ xmlRemoveRef;
+ xmlSnprintfElementContent;
+
+# tree
+ xmlSplitQName2;
+
+# valid
+ xmlSprintfElementContent;
+ xmlValidBuildContentModel;
+ xmlValidCtxtNormalizeAttributeValue;
+ xmlValidGetPotentialChildren;
+ xmlValidGetValidElements;
+ xmlValidNormalizeAttributeValue;
+ xmlValidateAttributeDecl;
+ xmlValidateAttributeValue;
+ xmlValidateDocument;
+ xmlValidateDocumentFinal;
+ xmlValidateDtd;
+ xmlValidateDtdFinal;
+ xmlValidateElement;
+ xmlValidateElementDecl;
+ xmlValidateNameValue;
+ xmlValidateNamesValue;
+ xmlValidateNmtokenValue;
+ xmlValidateNmtokensValue;
+ xmlValidateNotationDecl;
+ xmlValidateNotationUse;
+ xmlValidateOneAttribute;
+ xmlValidateOneElement;
+ xmlValidateOneNamespace;
+ xmlValidateRoot;
+
+# HTMLparser
+ UTF8ToHtml;
+ htmlAutoCloseTag;
+ htmlCreatePushParserCtxt;
+ htmlEncodeEntities;
+ htmlEntityLookup;
+ htmlEntityValueLookup;
+ htmlFreeParserCtxt;
+ htmlHandleOmittedElem;
+ htmlIsAutoClosed;
+ htmlIsScriptAttribute;
+ htmlParseCharRef;
+ htmlParseChunk;
+ htmlParseDoc;
+ htmlParseDocument;
+ htmlParseElement;
+ htmlParseEntityRef;
+ htmlParseFile;
+ htmlSAXParseDoc;
+ htmlSAXParseFile;
+ htmlTagLookup;
+
+# xmlstring
+ xmlCharStrdup;
+ xmlCharStrndup;
+
+# parser
+ xmlCleanupParser;
+ xmlClearNodeInfoSeq;
+ xmlClearParserCtxt;
+ xmlCreateDocParserCtxt;
+ xmlCreateIOParserCtxt;
+ xmlCreatePushParserCtxt;
+ xmlFreeParserCtxt;
+ xmlGetExternalEntityLoader;
+ xmlGetFeature;
+ xmlGetFeaturesList;
+
+# globals
+ xmlGetWarningsDefaultValue; # variable
+
+# parser
+ xmlIOParseDTD;
+ xmlInitNodeInfoSeq;
+ xmlInitParser;
+ xmlInitParserCtxt;
+ xmlKeepBlanksDefault;
+ xmlLineNumbersDefault;
+ xmlLoadExternalEntity;
+ xmlNewIOInputStream;
+ xmlParseBalancedChunkMemory;
+ xmlParseBalancedChunkMemoryRecover;
+ xmlParseChunk;
+ xmlParseCtxtExternalEntity;
+ xmlParseDTD;
+ xmlParseDoc;
+ xmlParseDocument;
+ xmlParseEntity;
+ xmlParseExtParsedEnt;
+ xmlParseExternalEntity;
+ xmlParseFile;
+ xmlParseMemory;
+ xmlParserAddNodeInfo;
+ xmlParserFindNodeInfo;
+ xmlParserFindNodeInfoIndex;
+ xmlParserInputGrow;
+ xmlParserInputRead;
+ xmlPedanticParserDefault;
+ xmlRecoverDoc;
+ xmlRecoverFile;
+ xmlRecoverMemory;
+ xmlSAXParseDTD;
+ xmlSAXParseDoc;
+ xmlSAXParseEntity;
+ xmlSAXParseFile;
+ xmlSAXParseFileWithData;
+ xmlSAXParseMemory;
+ xmlSAXParseMemoryWithData;
+ xmlSAXUserParseFile;
+ xmlSAXUserParseMemory;
+ xmlSetExternalEntityLoader;
+ xmlSetFeature;
+ xmlSetupParserForBuffer;
+ xmlStopParser;
+
+# xmlstring
+ xmlStrEqual;
+ xmlStrcasecmp;
+ xmlStrcasestr;
+ xmlStrcat;
+ xmlStrchr;
+ xmlStrcmp;
+ xmlStrdup;
+ xmlStrlen;
+ xmlStrncasecmp;
+ xmlStrncat;
+ xmlStrncmp;
+ xmlStrndup;
+ xmlStrstr;
+ xmlStrsub;
+
+# parser
+ xmlSubstituteEntitiesDefault;
+
+# xmlreader
+ xmlFreeTextReader;
+ xmlNewTextReader;
+ xmlNewTextReaderFilename;
+ xmlTextReaderAttributeCount;
+ xmlTextReaderBaseUri;
+ xmlTextReaderDepth;
+ xmlTextReaderHasAttributes;
+ xmlTextReaderHasValue;
+ xmlTextReaderIsDefault;
+ xmlTextReaderIsEmptyElement;
+ xmlTextReaderLocalName;
+ xmlTextReaderName;
+ xmlTextReaderNamespaceUri;
+ xmlTextReaderNodeType;
+ xmlTextReaderPrefix;
+ xmlTextReaderQuoteChar;
+ xmlTextReaderRead;
+ xmlTextReaderValue;
+ xmlTextReaderXmlLang;
+
+# globals
+# docbDefaultSAXHandler; removed in 2.10.0
+ htmlDefaultSAXHandler; # variable
+ xmlDefaultSAXHandler; # variable
+ xmlDefaultSAXLocator; # variable
+ xmlDoValidityCheckingDefaultValue; # variable
+ xmlFree; # variable
+ xmlGenericError; # variable
+ xmlGenericErrorContext; # variable
+ xmlInitializeGlobalState;
+ xmlKeepBlanksDefaultValue; # variable
+ xmlLineNumbersDefaultValue; # variable
+ xmlLoadExtDtdDefaultValue; # variable
+ xmlMalloc; # variable
+ xmlMemStrdup; # variable
+ xmlParserDebugEntities; # variable
+ xmlParserVersion; # variable
+ xmlPedanticParserDefaultValue; # variable
+ xmlRealloc; # variable
+ xmlSaveNoEmptyTags; # variable
+ xmlSubstituteEntitiesDefaultValue; # variable
+ xmlTreeIndentString; # variable
+
+# threads
+ xmlCleanupThreads;
+ xmlFreeMutex;
+ xmlFreeRMutex;
+ xmlGetGlobalState;
+ xmlGetThreadId;
+ xmlInitThreads;
+ xmlIsMainThread;
+ xmlLockLibrary;
+ xmlMutexLock;
+ xmlMutexUnlock;
+ xmlNewMutex;
+ xmlNewRMutex;
+ xmlRMutexLock;
+ xmlRMutexUnlock;
+ xmlUnlockLibrary;
+
+# hash
+ xmlHashAddEntry;
+ xmlHashAddEntry2;
+ xmlHashAddEntry3;
+ xmlHashCopy;
+ xmlHashCreate;
+ xmlHashFree;
+ xmlHashLookup;
+ xmlHashLookup2;
+ xmlHashLookup3;
+ xmlHashRemoveEntry;
+ xmlHashRemoveEntry2;
+ xmlHashRemoveEntry3;
+ xmlHashScan;
+ xmlHashScan3;
+ xmlHashScanFull;
+ xmlHashScanFull3;
+ xmlHashSize;
+ xmlHashUpdateEntry;
+ xmlHashUpdateEntry2;
+ xmlHashUpdateEntry3;
+
+# xmlerror
+ initGenericErrorDefaultFunc;
+ xmlParserError;
+ xmlParserPrintFileContext;
+ xmlParserPrintFileInfo;
+ xmlParserValidityError;
+ xmlParserValidityWarning;
+ xmlParserWarning;
+ xmlSetGenericErrorFunc;
+
+# globals
+ oldXMLWDcompatibility; # variable
+
+# tree
+ xmlAddChild;
+ xmlAddChildList;
+ xmlAddNextSibling;
+ xmlAddPrevSibling;
+ xmlAddSibling;
+ xmlBufferAdd;
+ xmlBufferAddHead;
+
+# globals
+ xmlBufferAllocScheme; # variable
+
+# tree
+ xmlBufferCCat;
+ xmlBufferCat;
+ xmlBufferContent;
+ xmlBufferCreate;
+ xmlBufferCreateSize;
+ xmlBufferDump;
+ xmlBufferEmpty;
+ xmlBufferFree;
+ xmlBufferGrow;
+ xmlBufferLength;
+ xmlBufferResize;
+ xmlBufferSetAllocationScheme;
+ xmlBufferShrink;
+ xmlBufferWriteCHAR;
+ xmlBufferWriteChar;
+ xmlBufferWriteQuotedString;
+ xmlCopyDoc;
+ xmlCopyDtd;
+ xmlCopyNamespace;
+ xmlCopyNamespaceList;
+ xmlCopyNode;
+ xmlCopyNodeList;
+ xmlCopyProp;
+ xmlCopyPropList;
+ xmlCreateIntSubset;
+
+# globals
+ xmlDefaultBufferSize; # variable
+
+# tree
+ xmlDocCopyNode;
+ xmlDocDump;
+ xmlDocDumpFormatMemory;
+ xmlDocDumpFormatMemoryEnc;
+ xmlDocDumpMemory;
+ xmlDocDumpMemoryEnc;
+ xmlDocFormatDump;
+ xmlDocGetRootElement;
+ xmlDocSetRootElement;
+ xmlElemDump;
+ xmlFreeDoc;
+ xmlFreeDtd;
+ xmlFreeNode;
+ xmlFreeNodeList;
+ xmlFreeNs;
+ xmlFreeNsList;
+ xmlFreeProp;
+ xmlFreePropList;
+ xmlGetBufferAllocationScheme;
+ xmlGetCompressMode;
+ xmlGetDocCompressMode;
+ xmlGetIntSubset;
+ xmlGetLastChild;
+ xmlGetLineNo;
+ xmlGetNodePath;
+ xmlGetNsList;
+ xmlGetNsProp;
+ xmlGetProp;
+ xmlHasNsProp;
+ xmlHasProp;
+
+# globals
+ xmlIndentTreeOutput; # variable
+
+# tree
+ xmlIsBlankNode;
+ xmlIsXHTML;
+ xmlNewCDataBlock;
+ xmlNewCharRef;
+ xmlNewChild;
+ xmlNewComment;
+ xmlNewDoc;
+ xmlNewDocComment;
+ xmlNewDocFragment;
+ xmlNewDocNode;
+ xmlNewDocNodeEatName;
+ xmlNewDocProp;
+ xmlNewDocRawNode;
+ xmlNewDocText;
+ xmlNewDocTextLen;
+ xmlNewDtd;
+ xmlNewGlobalNs;
+ xmlNewNode;
+ xmlNewNodeEatName;
+ xmlNewNs;
+ xmlNewNsProp;
+ xmlNewNsPropEatName;
+ xmlNewPI;
+ xmlNewProp;
+ xmlNewReference;
+ xmlNewText;
+ xmlNewTextChild;
+ xmlNewTextLen;
+ xmlNodeAddContent;
+ xmlNodeAddContentLen;
+ xmlNodeDump;
+ xmlNodeDumpOutput;
+ xmlNodeGetBase;
+ xmlNodeGetContent;
+ xmlNodeGetLang;
+ xmlNodeGetSpacePreserve;
+ xmlNodeIsText;
+ xmlNodeListGetRawString;
+ xmlNodeListGetString;
+ xmlNodeSetBase;
+ xmlNodeSetContent;
+ xmlNodeSetContentLen;
+ xmlNodeSetLang;
+ xmlNodeSetName;
+ xmlNodeSetSpacePreserve;
+ xmlReconciliateNs;
+ xmlRemoveProp;
+ xmlReplaceNode;
+ xmlSaveFile;
+ xmlSaveFileEnc;
+ xmlSaveFileTo;
+ xmlSaveFormatFile;
+ xmlSaveFormatFileEnc;
+ xmlSaveFormatFileTo;
+ xmlSearchNs;
+ xmlSearchNsByHref;
+ xmlSetBufferAllocationScheme;
+ xmlSetCompressMode;
+ xmlSetDocCompressMode;
+ xmlSetListDoc;
+ xmlSetNs;
+ xmlSetNsProp;
+ xmlSetProp;
+ xmlSetTreeDoc;
+ xmlStringGetNodeList;
+ xmlStringLenGetNodeList;
+ xmlTextConcat;
+ xmlTextMerge;
+ xmlUnlinkNode;
+ xmlUnsetNsProp;
+ xmlUnsetProp;
+
+# xmlregexp
+ xmlRegExecPushString;
+ xmlRegFreeExecCtxt;
+ xmlRegFreeRegexp;
+ xmlRegNewExecCtxt;
+ xmlRegexpCompile;
+ xmlRegexpExec;
+ xmlRegexpIsDeterminist;
+ xmlRegexpPrint;
+
+# nanohttp
+ xmlNanoHTTPAuthHeader;
+ xmlNanoHTTPCleanup;
+ xmlNanoHTTPClose;
+ xmlNanoHTTPFetch;
+ xmlNanoHTTPInit;
+ xmlNanoHTTPMethod;
+ xmlNanoHTTPMethodRedir;
+ xmlNanoHTTPOpen;
+ xmlNanoHTTPOpenRedir;
+ xmlNanoHTTPRead;
+ xmlNanoHTTPReturnCode;
+ xmlNanoHTTPSave;
+ xmlNanoHTTPScanProxy;
+
+# xmlunicode
+ xmlUCSIsAlphabeticPresentationForms;
+ xmlUCSIsArabic;
+ xmlUCSIsArabicPresentationFormsA;
+ xmlUCSIsArabicPresentationFormsB;
+ xmlUCSIsArmenian;
+ xmlUCSIsArrows;
+ xmlUCSIsBasicLatin;
+ xmlUCSIsBengali;
+ xmlUCSIsBlock;
+ xmlUCSIsBlockElements;
+ xmlUCSIsBopomofo;
+ xmlUCSIsBopomofoExtended;
+ xmlUCSIsBoxDrawing;
+ xmlUCSIsBraillePatterns;
+ xmlUCSIsByzantineMusicalSymbols;
+ xmlUCSIsCJKCompatibility;
+ xmlUCSIsCJKCompatibilityForms;
+ xmlUCSIsCJKCompatibilityIdeographs;
+ xmlUCSIsCJKCompatibilityIdeographsSupplement;
+ xmlUCSIsCJKRadicalsSupplement;
+ xmlUCSIsCJKSymbolsandPunctuation;
+ xmlUCSIsCJKUnifiedIdeographs;
+ xmlUCSIsCJKUnifiedIdeographsExtensionA;
+ xmlUCSIsCJKUnifiedIdeographsExtensionB;
+ xmlUCSIsCat;
+ xmlUCSIsCatC;
+ xmlUCSIsCatCc;
+ xmlUCSIsCatCf;
+ xmlUCSIsCatCo;
+ xmlUCSIsCatCs;
+ xmlUCSIsCatL;
+ xmlUCSIsCatLl;
+ xmlUCSIsCatLm;
+ xmlUCSIsCatLo;
+ xmlUCSIsCatLt;
+ xmlUCSIsCatLu;
+ xmlUCSIsCatM;
+ xmlUCSIsCatMc;
+ xmlUCSIsCatMe;
+ xmlUCSIsCatMn;
+ xmlUCSIsCatN;
+ xmlUCSIsCatNd;
+ xmlUCSIsCatNl;
+ xmlUCSIsCatNo;
+ xmlUCSIsCatP;
+ xmlUCSIsCatPc;
+ xmlUCSIsCatPd;
+ xmlUCSIsCatPe;
+ xmlUCSIsCatPf;
+ xmlUCSIsCatPi;
+ xmlUCSIsCatPo;
+ xmlUCSIsCatPs;
+ xmlUCSIsCatS;
+ xmlUCSIsCatSc;
+ xmlUCSIsCatSk;
+ xmlUCSIsCatSm;
+ xmlUCSIsCatSo;
+ xmlUCSIsCatZ;
+ xmlUCSIsCatZl;
+ xmlUCSIsCatZp;
+ xmlUCSIsCatZs;
+ xmlUCSIsCherokee;
+ xmlUCSIsCombiningDiacriticalMarks;
+ xmlUCSIsCombiningHalfMarks;
+ xmlUCSIsCombiningMarksforSymbols;
+ xmlUCSIsControlPictures;
+ xmlUCSIsCurrencySymbols;
+ xmlUCSIsCyrillic;
+ xmlUCSIsDeseret;
+ xmlUCSIsDevanagari;
+ xmlUCSIsDingbats;
+ xmlUCSIsEnclosedAlphanumerics;
+ xmlUCSIsEnclosedCJKLettersandMonths;
+ xmlUCSIsEthiopic;
+ xmlUCSIsGeneralPunctuation;
+ xmlUCSIsGeometricShapes;
+ xmlUCSIsGeorgian;
+ xmlUCSIsGothic;
+ xmlUCSIsGreek;
+ xmlUCSIsGreekExtended;
+ xmlUCSIsGujarati;
+ xmlUCSIsGurmukhi;
+ xmlUCSIsHalfwidthandFullwidthForms;
+ xmlUCSIsHangulCompatibilityJamo;
+ xmlUCSIsHangulJamo;
+ xmlUCSIsHangulSyllables;
+ xmlUCSIsHebrew;
+ xmlUCSIsHighPrivateUseSurrogates;
+ xmlUCSIsHighSurrogates;
+ xmlUCSIsHiragana;
+ xmlUCSIsIPAExtensions;
+ xmlUCSIsIdeographicDescriptionCharacters;
+ xmlUCSIsKanbun;
+ xmlUCSIsKangxiRadicals;
+ xmlUCSIsKannada;
+ xmlUCSIsKatakana;
+ xmlUCSIsKhmer;
+ xmlUCSIsLao;
+ xmlUCSIsLatin1Supplement;
+ xmlUCSIsLatinExtendedA;
+ xmlUCSIsLatinExtendedAdditional;
+ xmlUCSIsLatinExtendedB;
+ xmlUCSIsLetterlikeSymbols;
+ xmlUCSIsLowSurrogates;
+ xmlUCSIsMalayalam;
+ xmlUCSIsMathematicalAlphanumericSymbols;
+ xmlUCSIsMathematicalOperators;
+ xmlUCSIsMiscellaneousSymbols;
+ xmlUCSIsMiscellaneousTechnical;
+ xmlUCSIsMongolian;
+ xmlUCSIsMusicalSymbols;
+ xmlUCSIsMyanmar;
+ xmlUCSIsNumberForms;
+ xmlUCSIsOgham;
+ xmlUCSIsOldItalic;
+ xmlUCSIsOpticalCharacterRecognition;
+ xmlUCSIsOriya;
+ xmlUCSIsPrivateUse;
+ xmlUCSIsRunic;
+ xmlUCSIsSinhala;
+ xmlUCSIsSmallFormVariants;
+ xmlUCSIsSpacingModifierLetters;
+ xmlUCSIsSpecials;
+ xmlUCSIsSuperscriptsandSubscripts;
+ xmlUCSIsSyriac;
+ xmlUCSIsTags;
+ xmlUCSIsTamil;
+ xmlUCSIsTelugu;
+ xmlUCSIsThaana;
+ xmlUCSIsThai;
+ xmlUCSIsTibetan;
+ xmlUCSIsUnifiedCanadianAboriginalSyllabics;
+ xmlUCSIsYiRadicals;
+ xmlUCSIsYiSyllables;
+
+# uri
+ xmlBuildURI;
+ xmlCreateURI;
+ xmlFreeURI;
+ xmlNormalizeURIPath;
+ xmlParseURI;
+ xmlParseURIReference;
+ xmlPrintURI;
+ xmlSaveUri;
+ xmlURIEscape;
+ xmlURIEscapeStr;
+ xmlURIUnescapeString;
+
+# encoding
+ UTF8Toisolat1;
+ isolat1ToUTF8;
+ xmlAddEncodingAlias;
+ xmlCharEncCloseFunc;
+ xmlCharEncFirstLine;
+ xmlCharEncInFunc;
+ xmlCharEncOutFunc;
+
+# xmlstring
+ xmlCheckUTF8;
+
+# encoding
+ xmlCleanupCharEncodingHandlers;
+ xmlCleanupEncodingAliases;
+ xmlDelEncodingAlias;
+ xmlDetectCharEncoding;
+ xmlFindCharEncodingHandler;
+ xmlGetCharEncodingHandler;
+ xmlGetCharEncodingName;
+ xmlGetEncodingAlias;
+
+# xmlstring
+ xmlGetUTF8Char;
+
+# encoding
+ xmlInitCharEncodingHandlers;
+ xmlNewCharEncodingHandler;
+ xmlParseCharEncoding;
+ xmlRegisterCharEncodingHandler;
+
+# xmlstring
+ xmlUTF8Strlen;
+ xmlUTF8Strloc;
+ xmlUTF8Strndup;
+ xmlUTF8Strpos;
+ xmlUTF8Strsize;
+ xmlUTF8Strsub;
+} ;
+
+LIBXML2_2.5.0 {
+ global:
+
+# globals
+ xmlDeregisterNodeDefault;
+ xmlDeregisterNodeDefaultValue; # variable
+ xmlRegisterNodeDefault;
+ xmlRegisterNodeDefaultValue; # variable
+
+# xmlreader
+ xmlTextReaderClose;
+ xmlTextReaderCurrentDoc;
+ xmlTextReaderCurrentNode;
+ xmlTextReaderGetAttributeNo;
+ xmlTextReaderGetAttributeNs;
+ xmlTextReaderGetAttribute;
+ xmlTextReaderGetParserProp;
+ xmlTextReaderGetRemainder;
+ xmlTextReaderLookupNamespace;
+ xmlTextReaderMoveToAttributeNo;
+ xmlTextReaderMoveToAttributeNs;
+ xmlTextReaderMoveToAttribute;
+ xmlTextReaderMoveToElement;
+ xmlTextReaderMoveToFirstAttribute;
+ xmlTextReaderMoveToNextAttribute;
+ xmlTextReaderNormalization;
+ xmlTextReaderReadAttributeValue;
+ xmlTextReaderReadInnerXml;
+ xmlTextReaderReadOuterXml;
+ xmlTextReaderReadState;
+ xmlTextReaderReadString;
+ xmlTextReaderSetParserProp;
+
+# valid
+ xmlValidatePopElement;
+ xmlValidatePushCData;
+ xmlValidatePushElement;
+} LIBXML2_2.4.30;
+
+LIBXML2_2.5.2 {
+ global:
+
+# tree
+ xmlGetNoNsProp;
+
+# HTMLparser
+ htmlAttrAllowed;
+ htmlElementAllowedHere;
+ htmlElementStatusHere;
+ htmlNodeStatus;
+
+# relaxng
+ xmlRelaxNGCleanupTypes;
+ xmlRelaxNGDump;
+ xmlRelaxNGFreeParserCtxt;
+ xmlRelaxNGFree;
+ xmlRelaxNGFreeValidCtxt;
+ xmlRelaxNGNewMemParserCtxt;
+ xmlRelaxNGNewParserCtxt;
+ xmlRelaxNGNewValidCtxt;
+ xmlRelaxNGParse;
+ xmlRelaxNGSetParserErrors;
+ xmlRelaxNGSetValidErrors;
+ xmlRelaxNGValidateDoc;
+
+# xmlreader
+ xmlTextReaderGetErrorHandler;
+ xmlTextReaderLocatorBaseURI;
+ xmlTextReaderLocatorLineNumber;
+ xmlTextReaderSetErrorHandler;
+
+# relaxng
+# xmlRelaxNGValidateStream; removed in 2.5.5
+} LIBXML2_2.5.0;
+
+LIBXML2_2.5.4 {
+ global:
+
+# uri
+ xmlCanonicPath;
+
+# relaxng
+ xmlRelaxNGDumpTree;
+
+# tree
+ xmlValidateName;
+ xmlValidateNCName;
+ xmlValidateNMToken;
+ xmlValidateQName;
+} LIBXML2_2.5.2;
+
+LIBXML2_2.5.5 {
+ global:
+
+# nanoftp
+ xmlNanoFTPDele;
+} LIBXML2_2.5.4;
+
+LIBXML2_2.5.6 {
+ global:
+
+# xpath
+ xmlXPathOrderDocElems;
+} LIBXML2_2.5.5;
+
+LIBXML2_2.5.7 {
+ global:
+
+# HTMLparser
+ htmlCreateMemoryParserCtxt;
+
+# xmlautomata
+ xmlAutomataNewTransition2;
+
+# tree
+ xmlBuildQName;
+
+# xmlmemory
+ xmlGcMemGet;
+ xmlGcMemSetup;
+
+# globals
+ xmlMallocAtomic; # variable
+
+# xmlregexp
+ xmlRegExecPushString2;
+
+# relaxng
+ xmlRelaxNGNewDocParserCtxt;
+ xmlRelaxNGValidateFullElement;
+ xmlRelaxNGValidatePopElement;
+ xmlRelaxNGValidatePushCData;
+ xmlRelaxNGValidatePushElement;
+
+# xmlreader
+ xmlTextReaderExpand;
+ xmlTextReaderIsValid;
+ xmlTextReaderNext;
+ xmlTextReaderRelaxNGSetSchema;
+ xmlTextReaderRelaxNGValidate;
+} LIBXML2_2.5.6;
+
+LIBXML2_2.5.8 {
+ global:
+
+# globals
+ xmlCleanupGlobals;
+ xmlInitGlobals;
+
+# valid
+ xmlFreeValidCtxt;
+ xmlNewValidCtxt;
+
+# schemasInternals
+ xmlSchemaFreeType;
+
+# xmlschemas
+ xmlSchemaDump;
+ xmlSchemaFreeParserCtxt;
+ xmlSchemaFreeValidCtxt;
+ xmlSchemaFree;
+ xmlSchemaNewMemParserCtxt;
+ xmlSchemaNewParserCtxt;
+ xmlSchemaNewValidCtxt;
+ xmlSchemaParse;
+ xmlSchemaSetParserErrors;
+ xmlSchemaSetValidErrors;
+ xmlSchemaValidateDoc;
+ xmlSchemaValidateStream;
+
+# xmlschemastypes
+ xmlSchemaCheckFacet;
+ xmlSchemaCleanupTypes;
+ xmlSchemaCompareValues;
+ xmlSchemaFreeFacet;
+ xmlSchemaFreeValue;
+ xmlSchemaGetPredefinedType;
+ xmlSchemaInitTypes;
+ xmlSchemaNewFacet;
+ xmlSchemaValidateFacet;
+ xmlSchemaValidatePredefinedType;
+ xmlSchemaValPredefTypeNode;
+
+# globals
+ xmlThrDefBufferAllocScheme;
+ xmlThrDefDefaultBufferSize;
+ xmlThrDefDeregisterNodeDefault;
+ xmlThrDefDoValidityCheckingDefaultValue;
+ xmlThrDefGetWarningsDefaultValue;
+ xmlThrDefIndentTreeOutput;
+ xmlThrDefKeepBlanksDefaultValue;
+ xmlThrDefLineNumbersDefaultValue;
+ xmlThrDefLoadExtDtdDefaultValue;
+ xmlThrDefParserDebugEntities;
+ xmlThrDefPedanticParserDefaultValue;
+ xmlThrDefRegisterNodeDefault;
+ xmlThrDefSaveNoEmptyTags;
+ xmlThrDefSetGenericErrorFunc;
+ xmlThrDefSubstituteEntitiesDefaultValue;
+ xmlThrDefTreeIndentString;
+} LIBXML2_2.5.7;
+
+LIBXML2_2.5.9 {
+ global:
+
+# xmlmemory
+ xmlMallocAtomicLoc;
+
+# relaxng
+ xmlRelaxNGGetParserErrors;
+ xmlRelaxNGGetValidErrors;
+
+# tree
+ xmlSplitQName3;
+
+# xmlstring
+ xmlUTF8Charcmp;
+ xmlUTF8Size;
+
+# xinclude
+ xmlXIncludeProcessTree;
+} LIBXML2_2.5.8;
+
+LIBXML2_2.6.0 {
+ global:
+
+# SAX2
+ xmlSAX2AttributeDecl;
+ xmlSAX2CDataBlock;
+ xmlSAX2Characters;
+ xmlSAX2Comment;
+ xmlSAX2ElementDecl;
+ xmlSAX2EndDocument;
+ xmlSAX2EndElementNs;
+ xmlSAX2EndElement;
+ xmlSAX2EntityDecl;
+ xmlSAX2ExternalSubset;
+ xmlSAX2GetColumnNumber;
+ xmlSAX2GetEntity;
+ xmlSAX2GetLineNumber;
+ xmlSAX2GetParameterEntity;
+ xmlSAX2GetPublicId;
+ xmlSAX2GetSystemId;
+ xmlSAX2HasExternalSubset;
+ xmlSAX2HasInternalSubset;
+ xmlSAX2IgnorableWhitespace;
+ xmlSAX2InitDefaultSAXHandler;
+# xmlSAX2InitDocbDefaultSAXHandler; removed in 2.10.0
+ xmlSAX2InitHtmlDefaultSAXHandler;
+ xmlSAX2InternalSubset;
+ xmlSAX2IsStandalone;
+ xmlSAX2NotationDecl;
+ xmlSAX2ProcessingInstruction;
+ xmlSAX2Reference;
+ xmlSAX2ResolveEntity;
+ xmlSAX2SetDocumentLocator;
+ xmlSAX2StartDocument;
+ xmlSAX2StartElementNs;
+ xmlSAX2StartElement;
+ xmlSAX2UnparsedEntityDecl;
+ xmlSAXDefaultVersion;
+ xmlSAXVersion;
+
+# HTMLparser
+ htmlCtxtReadDoc;
+ htmlCtxtReadFd;
+ htmlCtxtReadFile;
+ htmlCtxtReadIO;
+ htmlCtxtReadMemory;
+ htmlCtxtReset;
+ htmlCtxtUseOptions;
+ htmlReadDoc;
+ htmlReadFd;
+ htmlReadFile;
+ htmlReadIO;
+ htmlReadMemory;
+
+# tree
+ xmlBufferCreateStatic;
+
+# chvalid
+ xmlCharInRange;
+
+# xmlIO
+ xmlCheckHTTPInput;
+
+# xmlerror
+ xmlCopyError;
+ xmlCtxtGetLastError;
+ xmlGetLastError;
+ xmlResetError;
+ xmlResetLastError;
+ xmlSetStructuredErrorFunc;
+
+# parser
+ xmlCtxtReadDoc;
+ xmlCtxtReadFd;
+ xmlCtxtReadFile;
+ xmlCtxtReadIO;
+ xmlCtxtReadMemory;
+
+# xmlerror
+ xmlCtxtResetLastError;
+
+# parser
+ xmlCtxtReset;
+ xmlCtxtUseOptions;
+ xmlReadDoc;
+ xmlReadFd;
+ xmlReadFile;
+ xmlReadIO;
+ xmlReadMemory;
+
+# xmlstring
+ xmlStrPrintf;
+ xmlStrQEqual;
+
+# dict
+ xmlDictCreate;
+ xmlDictFree;
+ xmlDictLookup;
+ xmlDictOwns;
+ xmlDictQLookup;
+ xmlDictReference;
+ xmlDictSize;
+
+# parserInternals
+ xmlErrMemory;
+ xmlParserMaxDepth; # variable
+ xmlStringLenDecodeEntities;
+ xmlSwitchInputEncoding;
+
+# xmlwriter
+ xmlFreeTextWriter;
+ xmlNewTextWriterFilename;
+ xmlNewTextWriterMemory;
+ xmlNewTextWriter;
+ xmlTextWriterEndAttribute;
+ xmlTextWriterEndCDATA;
+ xmlTextWriterEndDocument;
+ xmlTextWriterEndDTD;
+ xmlTextWriterEndElement;
+ xmlTextWriterEndPI;
+ xmlTextWriterFlush;
+ xmlTextWriterFullEndElement;
+ xmlTextWriterStartAttributeNS;
+ xmlTextWriterStartAttribute;
+ xmlTextWriterStartCDATA;
+ xmlTextWriterStartDocument;
+ xmlTextWriterStartDTDAttlist;
+ xmlTextWriterStartDTDElement;
+ xmlTextWriterStartDTDEntity;
+ xmlTextWriterStartDTD;
+ xmlTextWriterStartElementNS;
+ xmlTextWriterStartElement;
+ xmlTextWriterStartPI;
+ xmlTextWriterWriteAttributeNS;
+ xmlTextWriterWriteAttribute;
+ xmlTextWriterWriteBase64;
+ xmlTextWriterWriteBinHex;
+ xmlTextWriterWriteCDATA;
+ xmlTextWriterWriteComment;
+ xmlTextWriterWriteDTDAttlist;
+ xmlTextWriterWriteDTDElement;
+ xmlTextWriterWriteDTDEntity;
+ xmlTextWriterWriteDTDExternalEntity;
+ xmlTextWriterWriteDTDInternalEntity;
+ xmlTextWriterWriteDTDNotation;
+ xmlTextWriterWriteDTD;
+ xmlTextWriterWriteElementNS;
+ xmlTextWriterWriteElement;
+ xmlTextWriterWriteFormatAttributeNS;
+ xmlTextWriterWriteFormatAttribute;
+ xmlTextWriterWriteFormatCDATA;
+ xmlTextWriterWriteFormatComment;
+ xmlTextWriterWriteFormatDTDAttlist;
+ xmlTextWriterWriteFormatDTDElement;
+ xmlTextWriterWriteFormatDTDInternalEntity;
+ xmlTextWriterWriteFormatDTD;
+ xmlTextWriterWriteFormatElementNS;
+ xmlTextWriterWriteFormatElement;
+ xmlTextWriterWriteFormatPI;
+ xmlTextWriterWriteFormatRaw;
+ xmlTextWriterWriteFormatString;
+ xmlTextWriterWritePI;
+ xmlTextWriterWriteRawLen;
+ xmlTextWriterWriteRaw;
+ xmlTextWriterWriteString;
+ xmlTextWriterWriteVFormatAttributeNS;
+ xmlTextWriterWriteVFormatAttribute;
+ xmlTextWriterWriteVFormatCDATA;
+ xmlTextWriterWriteVFormatComment;
+ xmlTextWriterWriteVFormatDTDAttlist;
+ xmlTextWriterWriteVFormatDTDElement;
+ xmlTextWriterWriteVFormatDTDInternalEntity;
+ xmlTextWriterWriteVFormatDTD;
+ xmlTextWriterWriteVFormatElementNS;
+ xmlTextWriterWriteVFormatElement;
+ xmlTextWriterWriteVFormatPI;
+ xmlTextWriterWriteVFormatRaw;
+ xmlTextWriterWriteVFormatString;
+
+# hash
+ xmlHashQLookup2;
+ xmlHashQLookup3;
+ xmlHashQLookup;
+
+# chvalid
+ xmlIsBaseCharGroup; # variable
+ xmlIsCharGroup; # variable
+ xmlIsCombiningGroup; # variable
+ xmlIsDigitGroup; # variable
+ xmlIsExtenderGroup; # variable
+ xmlIsIdeographicGroup; # variable
+ xmlIsPubidChar_tab; # variable
+
+# globals
+ xmlLastError; # variable
+
+# nanohttp
+ xmlNanoHTTPEncoding;
+ xmlNanoHTTPMimeType;
+ xmlNanoHTTPRedir;
+
+# tree
+ xmlNodeBufGetContent;
+
+# xmlIO
+ xmlParserInputBufferCreateStatic;
+
+# xmlreader
+ xmlReaderForDoc;
+ xmlReaderForFd;
+ xmlReaderForFile;
+ xmlReaderForIO;
+ xmlReaderForMemory;
+ xmlReaderNewDoc;
+ xmlReaderNewFd;
+ xmlReaderNewFile;
+ xmlReaderNewIO;
+ xmlReaderNewMemory;
+ xmlReaderNewWalker;
+ xmlReaderWalker;
+ xmlTextReaderConstBaseUri;
+ xmlTextReaderConstLocalName;
+ xmlTextReaderConstNamespaceUri;
+ xmlTextReaderConstName;
+ xmlTextReaderConstPrefix;
+ xmlTextReaderConstString;
+ xmlTextReaderConstValue;
+ xmlTextReaderConstXmlLang;
+ xmlTextReaderNextSibling;
+ xmlTextReaderPreserve;
+
+# globals
+ xmlStructuredError; # variable
+ xmlThrDefSetStructuredErrorFunc;
+
+# xpathInternals
+ xmlXPathErr;
+
+# SAX2
+# xmlSAX2CheckNamespace; removed in 2.6.10
+# xmlSAX2GetNamespace; removed in 2.6.10
+# xmlSAX2GlobalNamespace; removed in 2.6.10
+# xmlSAX2NamespaceDecl; removed in 2.6.10
+# xmlSAX2SetNamespace; removed in 2.6.10
+} LIBXML2_2.5.9;
+
+LIBXML2_2.6.1 {
+ global:
+
+# parser
+ xmlCtxtResetPush;
+} LIBXML2_2.6.0;
+
+LIBXML2_2.6.2 {
+ global:
+
+# parserInternals
+ xmlCreateURLParserCtxt;
+
+# xmlschemas
+ xmlSchemaNewDocParserCtxt;
+
+# xmlstring
+ xmlStrVPrintf;
+
+# xinclude
+ xmlXIncludeFreeContext;
+ xmlXIncludeNewContext;
+ xmlXIncludeProcessNode;
+} LIBXML2_2.6.1;
+
+LIBXML2_2.6.3 {
+ global:
+
+# pattern
+ xmlFreePatternList;
+ xmlFreePattern;
+ xmlPatterncompile;
+ xmlPatternMatch;
+
+# xmlwriter
+ xmlNewTextWriterDoc;
+ xmlNewTextWriterPushParser;
+ xmlNewTextWriterTree;
+
+# xmlreader
+ xmlTextReaderPreservePattern;
+
+# xmlunicode
+ xmlUCSIsAegeanNumbers;
+ xmlUCSIsBuhid;
+ xmlUCSIsCombiningDiacriticalMarksforSymbols;
+ xmlUCSIsCypriotSyllabary;
+ xmlUCSIsCyrillicSupplement;
+ xmlUCSIsGreekandCoptic;
+ xmlUCSIsHanunoo;
+ xmlUCSIsKatakanaPhoneticExtensions;
+ xmlUCSIsKhmerSymbols;
+ xmlUCSIsLimbu;
+ xmlUCSIsLinearBIdeograms;
+ xmlUCSIsLinearBSyllabary;
+ xmlUCSIsMiscellaneousMathematicalSymbolsA;
+ xmlUCSIsMiscellaneousMathematicalSymbolsB;
+ xmlUCSIsMiscellaneousSymbolsandArrows;
+ xmlUCSIsOsmanya;
+ xmlUCSIsPhoneticExtensions;
+ xmlUCSIsPrivateUseArea;
+ xmlUCSIsShavian;
+ xmlUCSIsSupplementalArrowsA;
+ xmlUCSIsSupplementalArrowsB;
+ xmlUCSIsSupplementalMathematicalOperators;
+ xmlUCSIsSupplementaryPrivateUseAreaA;
+ xmlUCSIsSupplementaryPrivateUseAreaB;
+ xmlUCSIsTagalog;
+ xmlUCSIsTagbanwa;
+ xmlUCSIsTaiLe;
+ xmlUCSIsTaiXuanJingSymbols;
+ xmlUCSIsUgaritic;
+ xmlUCSIsVariationSelectorsSupplement;
+ xmlUCSIsVariationSelectors;
+ xmlUCSIsYijingHexagramSymbols;
+
+# xinclude
+ xmlXIncludeProcessFlags;
+ xmlXIncludeProcessTreeFlags;
+ xmlXIncludeSetFlags;
+} LIBXML2_2.6.2;
+
+LIBXML2_2.6.5 {
+ global:
+
+# xmlmemory
+ xmlCleanupMemory;
+
+# dict
+ xmlDictCreateSub;
+
+# relaxng
+ xmlRelaxParserSetFlag;
+
+# xmlstring
+ xmlStrncatNew;
+
+# xmlwriter
+ xmlTextWriterSetIndentString;
+ xmlTextWriterSetIndent;
+
+# xpath
+ xmlXPathCtxtCompile;
+} LIBXML2_2.6.3;
+
+LIBXML2_2.6.6 {
+ global:
+
+# tree
+ xmlAttrSerializeTxtContent;
+
+# parser
+ xmlByteConsumed;
+
+# xmlreader
+ xmlTextReaderSetStructuredErrorHandler;
+} LIBXML2_2.6.5;
+
+LIBXML2_2.6.7 {
+ global:
+
+# xmlwriter
+ xmlTextWriterEndComment;
+ xmlTextWriterStartComment;
+} LIBXML2_2.6.6;
+
+LIBXML2_2.6.8 {
+ global:
+
+# xmlsave
+ xmlSaveClose;
+ xmlSaveDoc;
+ xmlSaveFlush;
+ xmlSaveToFd;
+ xmlSaveToFilename;
+ xmlSaveToIO;
+ xmlSaveTree;
+
+# xmlwriter
+ xmlTextWriterEndDTDAttlist;
+ xmlTextWriterEndDTDElement;
+ xmlTextWriterEndDTDEntity;
+ xmlTextWriterWriteDTDExternalEntityContents;
+} LIBXML2_2.6.7;
+
+LIBXML2_2.6.10 {
+ global:
+
+# xmlIO
+ xmlOutputBufferWriteEscape;
+ xmlPopInputCallbacks;
+
+# xmlsave
+ xmlSaveSetAttrEscape;
+ xmlSaveSetEscape;
+} LIBXML2_2.6.8;
+
+LIBXML2_2.6.11 {
+ global:
+
+# uri
+ xmlBuildRelativeURI;
+
+# globals
+ xmlOutputBufferCreateFilenameDefault;
+ xmlOutputBufferCreateFilenameValue; # variable
+ xmlParserInputBufferCreateFilenameDefault;
+ xmlParserInputBufferCreateFilenameValue; # variable
+ xmlThrDefOutputBufferCreateFilenameDefault;
+ xmlThrDefParserInputBufferCreateFilenameDefault;
+
+# schemasInternals
+ xmlSchemaFreeWildcard;
+
+# xmlschemastypes
+ xmlSchemaCollapseString;
+ xmlSchemaGetBuiltInListSimpleTypeItemType;
+ xmlSchemaGetBuiltInType;
+ xmlSchemaIsBuiltInTypeFacet;
+ xmlSchemaValidateListSimpleTypeFacet;
+} LIBXML2_2.6.10;
+
+LIBXML2_2.6.12 {
+ global:
+
+# parser
+ xmlParseInNodeContext;
+
+# xmlschemastypes
+ xmlSchemaGetFacetValueAsULong;
+ xmlSchemaValidateLengthFacet;
+ xmlSchemaValPredefTypeNodeNoNorm;
+
+# xmlschemas
+ xmlSchemaGetParserErrors;
+ xmlSchemaGetValidErrors;
+} LIBXML2_2.6.11;
+
+LIBXML2_2.6.14 {
+ global:
+
+# xmlautomata
+ xmlAutomataNewCountTrans2;
+ xmlAutomataNewOnceTrans2;
+
+# nanohttp
+ xmlNanoHTTPContentLength;
+
+# xmlschemas
+ xmlSchemaSetValidOptions;
+ xmlSchemaValidateOneElement;
+ xmlSchemaValidCtxtGetOptions;
+} LIBXML2_2.6.12;
+
+LIBXML2_2.6.15 {
+ global:
+
+# debugXML
+ xmlDebugCheckDocument;
+
+# tree
+ xmlDocCopyNodeList;
+ xmlNewDocPI;
+
+# xmlreader
+ xmlTextReaderConstEncoding;
+ xmlTextReaderConstXmlVersion;
+ xmlTextReaderIsNamespaceDecl;
+ xmlTextReaderStandalone;
+} LIBXML2_2.6.14;
+
+LIBXML2_2.6.16 {
+ global:
+
+# xmlmemory
+ xmlMemBlocks;
+
+# relaxng
+ xmlRelaxNGInitTypes;
+} LIBXML2_2.6.15;
+
+LIBXML2_2.6.17 {
+ global:
+
+# dict
+ xmlDictExists;
+
+# xmlmodule
+ xmlModuleClose;
+ xmlModuleFree;
+ xmlModuleOpen;
+ xmlModuleSymbol;
+
+# xmlregexp
+ xmlRegExecErrInfo;
+ xmlRegExecNextValues;
+
+# xmlschemastypes
+ xmlSchemaWhiteSpaceReplace;
+
+# xmlreader
+ xmlTextReaderGetParserColumnNumber;
+ xmlTextReaderGetParserLineNumber;
+} LIBXML2_2.6.16;
+
+LIBXML2_2.6.18 {
+ global:
+
+# valid
+ xmlCopyDocElementContent;
+ xmlFreeDocElementContent;
+ xmlNewDocElementContent;
+
+# dict
+ xmlDictCleanup;
+
+# hash
+ xmlHashCreateDict;
+
+# pattern
+ xmlFreeStreamCtxt;
+ xmlPatternFromRoot;
+ xmlPatternGetStreamCtxt;
+ xmlPatternMaxDepth;
+ xmlPatternStreamable;
+ xmlStreamPop;
+ xmlStreamPushAttr;
+ xmlStreamPush;
+
+# xmlschemastypes
+ xmlSchemaCompareValuesWhtsp;
+ xmlSchemaCopyValue;
+ xmlSchemaGetCanonValue;
+ xmlSchemaNewNOTATIONValue;
+ xmlSchemaNewStringValue;
+
+# xmlreader
+ xmlTextReaderByteConsumed;
+} LIBXML2_2.6.17;
+
+LIBXML2_2.6.19 {
+ global:
+
+# xmlschemastypes
+ xmlSchemaGetValType;
+ xmlSchemaValidateFacetWhtsp;
+ xmlSchemaValidateLengthFacetWhtsp;
+} LIBXML2_2.6.18;
+
+LIBXML2_2.6.20 {
+ global:
+
+# tree
+ xmlDOMWrapAdoptNode;
+ xmlDOMWrapFreeCtxt;
+ xmlDOMWrapNewCtxt;
+ xmlDOMWrapReconcileNamespaces;
+ xmlDOMWrapRemoveNode;
+
+# xmlschemastypes
+ xmlSchemaGetCanonValueWhtsp;
+ xmlSchemaNewQNameValue;
+ xmlSchemaValueAppend;
+ xmlSchemaValueGetAsBoolean;
+ xmlSchemaValueGetAsString;
+ xmlSchemaValueGetNext;
+
+# xmlschemas
+ xmlSchemaIsValid;
+ xmlSchemaSAXPlug;
+ xmlSchemaSAXUnplug;
+ xmlSchemaValidateFile;
+
+# xmlreader
+ xmlTextReaderSchemaValidate;
+ xmlTextReaderSetSchema;
+} LIBXML2_2.6.19;
+
+LIBXML2_2.6.21 {
+ global:
+
+# xmlautomata
+ xmlAutomataNewNegTrans;
+
+# xmlregexp
+# emptyExp; removed in 2.9.10
+# forbiddenExp; removed in 2.9.10
+# xmlExpCtxtNbCons; removed in 2.9.10
+# xmlExpCtxtNbNodes; removed in 2.9.10
+# xmlExpDump; removed in 2.9.10
+# xmlExpExpDerive; removed in 2.9.10
+# xmlExpFreeCtxt; removed in 2.9.10
+# xmlExpFree; removed in 2.9.10
+# xmlExpGetLanguage; removed in 2.9.10
+# xmlExpGetStart; removed in 2.9.10
+# xmlExpIsNillable; removed in 2.9.10
+# xmlExpMaxToken; removed in 2.9.10
+# xmlExpNewAtom; removed in 2.9.10
+# xmlExpNewCtxt; removed in 2.9.10
+# xmlExpNewOr; removed in 2.9.10
+# xmlExpNewRange; removed in 2.9.10
+# xmlExpNewSeq; removed in 2.9.10
+# xmlExpParse; removed in 2.9.10
+# xmlExpRef; removed in 2.9.10
+# xmlExpStringDerive; removed in 2.9.10
+# xmlExpSubsume; removed in 2.9.10
+
+# parser
+ xmlHasFeature;
+
+# uri
+ xmlParseURIRaw;
+
+# pattern
+ xmlPatternMinDepth;
+
+# relaxng
+ xmlRelaxNGSetValidStructuredErrors;
+
+# xmlschemas
+ xmlSchemaSetValidStructuredErrors;
+
+# schematron
+ xmlSchematronFreeParserCtxt;
+ xmlSchematronFree;
+ xmlSchematronFreeValidCtxt;
+ xmlSchematronNewDocParserCtxt;
+ xmlSchematronNewMemParserCtxt;
+ xmlSchematronNewParserCtxt;
+ xmlSchematronNewValidCtxt;
+ xmlSchematronParse;
+ xmlSchematronValidateDoc;
+} LIBXML2_2.6.20;
+
+LIBXML2_2.6.23 {
+ global:
+
+# HTMLtree
+ htmlDocDumpMemoryFormat;
+
+# xmlIO
+ xmlOutputBufferCreateBuffer;
+
+# xmlsave
+ xmlSaveToBuffer;# suppressed in 2.6.11, readded in 2.6.23
+
+
+# xmlschemas
+ xmlSchemaSetParserStructuredErrors;
+
+# pattern
+ xmlStreamPushNode;
+ xmlStreamWantsAnyNode;
+
+# xmlreader
+ xmlTextReaderSchemaValidateCtxt;
+} LIBXML2_2.6.21;
+
+LIBXML2_2.6.24 {
+ global:
+
+# tree
+ xmlDOMWrapCloneNode;
+
+# relaxng
+ xmlRelaxNGSetParserStructuredErrors;
+} LIBXML2_2.6.23;
+
+LIBXML2_2.6.25 {
+ global:
+
+# xpath
+ xmlXPathContextSetCache;
+} LIBXML2_2.6.24;
+
+LIBXML2_2.6.27 {
+ global:
+
+# HTMLparser
+ htmlNewParserCtxt;
+
+# uri
+ xmlPathToURI;
+
+# xinclude
+ xmlXIncludeProcessFlagsData;
+
+# xpath
+ xmlXPathCompiledEvalToBoolean;
+} LIBXML2_2.6.25;
+
+LIBXML2_2.6.28 {
+ global:
+
+# xmlreader
+ xmlTextReaderSetup;
+} LIBXML2_2.6.27;
+
+LIBXML2_2.6.29 {
+ global:
+
+# threads
+ xmlDllMain;
+} LIBXML2_2.6.28;
+
+LIBXML2_2.6.32 {
+ global:
+
+# schematron
+ xmlSchematronSetValidStructuredErrors;
+} LIBXML2_2.6.29;
+
+LIBXML2_2.7.0 {
+ global:
+
+# xmlmemory
+ xmlMemDisplayLast;
+
+# entities
+ xmlNewEntity;
+
+# xmlschemas
+ xmlSchemaValidCtxtGetParserCtxt;
+} LIBXML2_2.6.32;
+
+LIBXML2_2.7.3 {
+ global:
+
+# tree
+ xmlChildElementCount;
+ xmlFirstElementChild;
+ xmlLastElementChild;
+ xmlNextElementSibling;
+ xmlPreviousElementSibling;
+} LIBXML2_2.7.0;
+
+LIBXML2_2.7.4 {
+ global:
+
+# globals
+ xmlStructuredErrorContext; # variable
+
+# xinclude
+ xmlXIncludeProcessTreeFlagsData;
+} LIBXML2_2.7.3;
+
+LIBXML2_2.8.0 {
+ global:
+
+# xmlreader
+ xmlTextReaderRelaxNGValidateCtxt;
+
+# tree
+ xmlBufferDetach;
+
+# dict
+ xmlInitializeDict;
+} LIBXML2_2.7.4;
+
+LIBXML2_2.9.0 {
+ global:
+
+# tree
+ xmlBufContent;
+ xmlBufEnd;
+ xmlBufGetNodeContent;
+ xmlBufNodeDump;
+ xmlBufShrink;
+ xmlBufUse;
+
+# dict
+ xmlDictGetUsage;
+ xmlDictSetLimit;
+
+# xmlschemas
+ xmlSchemaValidateSetFilename;
+ xmlSchemaValidateSetLocator;
+
+# xmlIO
+ xmlOutputBufferGetContent;
+ xmlOutputBufferGetSize;
+
+# xmlwriter
+ xmlTextWriterSetQuoteChar;
+} LIBXML2_2.8.0;
+
+LIBXML2_2.9.1 {
+ global:
+
+# xpath
+ xmlXPathNodeEval;
+ xmlXPathSetContextNode;
+} LIBXML2_2.9.0;
+
+LIBXML2_2.9.8 {
+ global:
+
+# hash
+ xmlHashDefaultDeallocator;
+} LIBXML2_2.9.1;
+
+LIBXML2_2.9.11 {
+ global:
+
+# xmlIO
+ xmlPopOutputCallbacks;
+} LIBXML2_2.9.8;
+
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
new file mode 100644
index 00000000..dd6d8b61
--- /dev/null
+++ b/m4/ax_append_flag.m4
@@ -0,0 +1,50 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_append_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_FLAG(FLAG, [FLAGS-VARIABLE])
+#
+# DESCRIPTION
+#
+# FLAG is appended to the FLAGS-VARIABLE shell variable, with a space
+# added in between.
+#
+# If FLAGS-VARIABLE is not specified, the current language's flags (e.g.
+# CFLAGS) is used. FLAGS-VARIABLE is not changed if it already contains
+# FLAG. If FLAGS-VARIABLE is unset in the shell, it is set to exactly
+# FLAG.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 8
+
+AC_DEFUN([AX_APPEND_FLAG],
+[dnl
+AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_SET_IF
+AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])
+AS_VAR_SET_IF(FLAGS,[
+ AS_CASE([" AS_VAR_GET(FLAGS) "],
+ [*" $1 "*], [AC_RUN_LOG([: FLAGS already contains $1])],
+ [
+ AS_VAR_APPEND(FLAGS,[" $1"])
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
+ ])
+ ],
+ [
+ AS_VAR_SET(FLAGS,[$1])
+ AC_RUN_LOG([: FLAGS="$FLAGS"])
+ ])
+AS_VAR_POPDEF([FLAGS])dnl
+])dnl AX_APPEND_FLAG
diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4
new file mode 100644
index 00000000..99b9fa5b
--- /dev/null
+++ b/m4/ax_append_link_flags.m4
@@ -0,0 +1,44 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_append_link_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_APPEND_LINK_FLAGS([FLAG1 FLAG2 ...], [FLAGS-VARIABLE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# For every FLAG1, FLAG2 it is checked whether the linker works with the
+# flag. If it does, the flag is added FLAGS-VARIABLE
+#
+# If FLAGS-VARIABLE is not specified, the linker's flags (LDFLAGS) is
+# used. During the check the flag is always added to the linker's flags.
+#
+# If EXTRA-FLAGS is defined, it is added to the linker's default flags
+# when the check is done. The check is thus made with the flags: "LDFLAGS
+# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
+# issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
+#
+# NOTE: This macro depends on the AX_APPEND_FLAG and AX_CHECK_LINK_FLAG.
+# Please keep this macro in sync with AX_APPEND_COMPILE_FLAGS.
+#
+# LICENSE
+#
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 7
+
+AC_DEFUN([AX_APPEND_LINK_FLAGS],
+[AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+AX_REQUIRE_DEFINED([AX_APPEND_FLAG])
+for flag in $1; do
+ AX_CHECK_LINK_FLAG([$flag], [AX_APPEND_FLAG([$flag], [m4_default([$2], [LDFLAGS])])], [], [$3], [$4])
+done
+])dnl AX_APPEND_LINK_FLAGS
diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4
new file mode 100644
index 00000000..03a30ce4
--- /dev/null
+++ b/m4/ax_check_link_flag.m4
@@ -0,0 +1,53 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
+#
+# DESCRIPTION
+#
+# Check whether the given FLAG works with the linker or gives an error.
+# (Warnings, however, are ignored)
+#
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
+# success/failure.
+#
+# If EXTRA-FLAGS is defined, it is added to the linker's default flags
+# when the check is done. The check is thus made with the flags: "LDFLAGS
+# EXTRA-FLAGS FLAG". This can for example be used to force the linker to
+# issue an error when a bad flag is given.
+#
+# INPUT gives an alternative input source to AC_LINK_IFELSE.
+#
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
+# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 6
+
+AC_DEFUN([AX_CHECK_LINK_FLAG],
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl
+AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [
+ ax_check_save_flags=$LDFLAGS
+ LDFLAGS="$LDFLAGS $4 $1"
+ AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
+ [AS_VAR_SET(CACHEVAR,[yes])],
+ [AS_VAR_SET(CACHEVAR,[no])])
+ LDFLAGS=$ax_check_save_flags])
+AS_VAR_IF(CACHEVAR,yes,
+ [m4_default([$2], :)],
+ [m4_default([$3], :)])
+AS_VAR_POPDEF([CACHEVAR])dnl
+])dnl AX_CHECK_LINK_FLAGS
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
new file mode 100644
index 00000000..17c3eab7
--- /dev/null
+++ b/m4/ax_require_defined.m4
@@ -0,0 +1,37 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_require_defined.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_REQUIRE_DEFINED(MACRO)
+#
+# DESCRIPTION
+#
+# AX_REQUIRE_DEFINED is a simple helper for making sure other macros have
+# been defined and thus are available for use. This avoids random issues
+# where a macro isn't expanded. Instead the configure script emits a
+# non-fatal:
+#
+# ./configure: line 1673: AX_CFLAGS_WARN_ALL: command not found
+#
+# It's like AC_REQUIRE except it doesn't expand the required macro.
+#
+# Here's an example:
+#
+# AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG])
+#
+# LICENSE
+#
+# Copyright (c) 2014 Mike Frysinger <vapier@gentoo.org>
+#
+# Copying and distribution of this file, with or without modification, are
+# permitted in any medium without royalty provided the copyright notice
+# and this notice are preserved. This file is offered as-is, without any
+# warranty.
+
+#serial 2
+
+AC_DEFUN([AX_REQUIRE_DEFINED], [dnl
+ m4_ifndef([$1], [m4_fatal([macro ]$1[ is not defined; is a m4 file missing?])])
+])dnl AX_REQUIRE_DEFINED
diff --git a/nanoftp.c b/nanoftp.c
index 2bfba853..f4e8c250 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -2083,7 +2083,6 @@ int main(int argc, char **argv) {
}
xmlNanoFTPClose(ctxt);
- xmlMemoryDump();
exit(0);
}
#endif /* STANDALONE */
diff --git a/nanohttp.c b/nanohttp.c
index e014fe48..7c63e94c 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -1912,7 +1912,6 @@ int main(int argc, char **argv) {
"\tusage %s [ URL [ filename ] ]\n", argv[0]);
}
xmlNanoHTTPCleanup();
- xmlMemoryDump();
return(0);
}
#endif /* STANDALONE */
diff --git a/parser.c b/parser.c
index 53289c7a..bb05791d 100644
--- a/parser.c
+++ b/parser.c
@@ -100,8 +100,6 @@ xmlCreateEntityParserCtxtInternal(xmlSAXHandlerPtr sax, void *userData,
const xmlChar *URL, const xmlChar *ID, const xmlChar *base,
xmlParserCtxtPtr pctx);
-static void xmlHaltParser(xmlParserCtxtPtr ctxt);
-
static int
xmlParseElementStart(xmlParserCtxtPtr ctxt);
@@ -248,222 +246,6 @@ xmlErrAttributeDup(xmlParserCtxtPtr ctxt, const xmlChar * prefix,
}
/**
- * xmlFatalErr:
- * @ctxt: an XML parser context
- * @error: the error number
- * @extra: extra information string
- *
- * Handle a fatal parser error, i.e. violating Well-Formedness constraints
- */
-static void
-xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info)
-{
- const char *errmsg;
-
- if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
- (ctxt->instate == XML_PARSER_EOF))
- return;
- switch (error) {
- case XML_ERR_INVALID_HEX_CHARREF:
- errmsg = "CharRef: invalid hexadecimal value";
- break;
- case XML_ERR_INVALID_DEC_CHARREF:
- errmsg = "CharRef: invalid decimal value";
- break;
- case XML_ERR_INVALID_CHARREF:
- errmsg = "CharRef: invalid value";
- break;
- case XML_ERR_INTERNAL_ERROR:
- errmsg = "internal error";
- break;
- case XML_ERR_PEREF_AT_EOF:
- errmsg = "PEReference at end of document";
- break;
- case XML_ERR_PEREF_IN_PROLOG:
- errmsg = "PEReference in prolog";
- break;
- case XML_ERR_PEREF_IN_EPILOG:
- errmsg = "PEReference in epilog";
- break;
- case XML_ERR_PEREF_NO_NAME:
- errmsg = "PEReference: no name";
- break;
- case XML_ERR_PEREF_SEMICOL_MISSING:
- errmsg = "PEReference: expecting ';'";
- break;
- case XML_ERR_ENTITY_LOOP:
- errmsg = "Detected an entity reference loop";
- break;
- case XML_ERR_ENTITY_NOT_STARTED:
- errmsg = "EntityValue: \" or ' expected";
- break;
- case XML_ERR_ENTITY_PE_INTERNAL:
- errmsg = "PEReferences forbidden in internal subset";
- break;
- case XML_ERR_ENTITY_NOT_FINISHED:
- errmsg = "EntityValue: \" or ' expected";
- break;
- case XML_ERR_ATTRIBUTE_NOT_STARTED:
- errmsg = "AttValue: \" or ' expected";
- break;
- case XML_ERR_LT_IN_ATTRIBUTE:
- errmsg = "Unescaped '<' not allowed in attributes values";
- break;
- case XML_ERR_LITERAL_NOT_STARTED:
- errmsg = "SystemLiteral \" or ' expected";
- break;
- case XML_ERR_LITERAL_NOT_FINISHED:
- errmsg = "Unfinished System or Public ID \" or ' expected";
- break;
- case XML_ERR_MISPLACED_CDATA_END:
- errmsg = "Sequence ']]>' not allowed in content";
- break;
- case XML_ERR_URI_REQUIRED:
- errmsg = "SYSTEM or PUBLIC, the URI is missing";
- break;
- case XML_ERR_PUBID_REQUIRED:
- errmsg = "PUBLIC, the Public Identifier is missing";
- break;
- case XML_ERR_HYPHEN_IN_COMMENT:
- errmsg = "Comment must not contain '--' (double-hyphen)";
- break;
- case XML_ERR_PI_NOT_STARTED:
- errmsg = "xmlParsePI : no target name";
- break;
- case XML_ERR_RESERVED_XML_NAME:
- errmsg = "Invalid PI name";
- break;
- case XML_ERR_NOTATION_NOT_STARTED:
- errmsg = "NOTATION: Name expected here";
- break;
- case XML_ERR_NOTATION_NOT_FINISHED:
- errmsg = "'>' required to close NOTATION declaration";
- break;
- case XML_ERR_VALUE_REQUIRED:
- errmsg = "Entity value required";
- break;
- case XML_ERR_URI_FRAGMENT:
- errmsg = "Fragment not allowed";
- break;
- case XML_ERR_ATTLIST_NOT_STARTED:
- errmsg = "'(' required to start ATTLIST enumeration";
- break;
- case XML_ERR_NMTOKEN_REQUIRED:
- errmsg = "NmToken expected in ATTLIST enumeration";
- break;
- case XML_ERR_ATTLIST_NOT_FINISHED:
- errmsg = "')' required to finish ATTLIST enumeration";
- break;
- case XML_ERR_MIXED_NOT_STARTED:
- errmsg = "MixedContentDecl : '|' or ')*' expected";
- break;
- case XML_ERR_PCDATA_REQUIRED:
- errmsg = "MixedContentDecl : '#PCDATA' expected";
- break;
- case XML_ERR_ELEMCONTENT_NOT_STARTED:
- errmsg = "ContentDecl : Name or '(' expected";
- break;
- case XML_ERR_ELEMCONTENT_NOT_FINISHED:
- errmsg = "ContentDecl : ',' '|' or ')' expected";
- break;
- case XML_ERR_PEREF_IN_INT_SUBSET:
- errmsg =
- "PEReference: forbidden within markup decl in internal subset";
- break;
- case XML_ERR_GT_REQUIRED:
- errmsg = "expected '>'";
- break;
- case XML_ERR_CONDSEC_INVALID:
- errmsg = "XML conditional section '[' expected";
- break;
- case XML_ERR_EXT_SUBSET_NOT_FINISHED:
- errmsg = "Content error in the external subset";
- break;
- case XML_ERR_CONDSEC_INVALID_KEYWORD:
- errmsg =
- "conditional section INCLUDE or IGNORE keyword expected";
- break;
- case XML_ERR_CONDSEC_NOT_FINISHED:
- errmsg = "XML conditional section not closed";
- break;
- case XML_ERR_XMLDECL_NOT_STARTED:
- errmsg = "Text declaration '<?xml' required";
- break;
- case XML_ERR_XMLDECL_NOT_FINISHED:
- errmsg = "parsing XML declaration: '?>' expected";
- break;
- case XML_ERR_EXT_ENTITY_STANDALONE:
- errmsg = "external parsed entities cannot be standalone";
- break;
- case XML_ERR_ENTITYREF_SEMICOL_MISSING:
- errmsg = "EntityRef: expecting ';'";
- break;
- case XML_ERR_DOCTYPE_NOT_FINISHED:
- errmsg = "DOCTYPE improperly terminated";
- break;
- case XML_ERR_LTSLASH_REQUIRED:
- errmsg = "EndTag: '</' not found";
- break;
- case XML_ERR_EQUAL_REQUIRED:
- errmsg = "expected '='";
- break;
- case XML_ERR_STRING_NOT_CLOSED:
- errmsg = "String not closed expecting \" or '";
- break;
- case XML_ERR_STRING_NOT_STARTED:
- errmsg = "String not started expecting ' or \"";
- break;
- case XML_ERR_ENCODING_NAME:
- errmsg = "Invalid XML encoding name";
- break;
- case XML_ERR_STANDALONE_VALUE:
- errmsg = "standalone accepts only 'yes' or 'no'";
- break;
- case XML_ERR_DOCUMENT_EMPTY:
- errmsg = "Document is empty";
- break;
- case XML_ERR_DOCUMENT_END:
- errmsg = "Extra content at the end of the document";
- break;
- case XML_ERR_NOT_WELL_BALANCED:
- errmsg = "chunk is not well balanced";
- break;
- case XML_ERR_EXTRA_CONTENT:
- errmsg = "extra content at the end of well balanced chunk";
- break;
- case XML_ERR_VERSION_MISSING:
- errmsg = "Malformed declaration expecting version";
- break;
- case XML_ERR_NAME_TOO_LONG:
- errmsg = "Name too long";
- break;
-#if 0
- case:
- errmsg = "";
- break;
-#endif
- default:
- errmsg = "Unregistered error message";
- }
- if (ctxt != NULL)
- ctxt->errNo = error;
- if (info == NULL) {
- __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
- XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s\n",
- errmsg);
- } else {
- __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
- XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s: %s\n",
- errmsg, info);
- }
- if (ctxt != NULL) {
- ctxt->wellFormed = 0;
- if (ctxt->recovery == 0)
- ctxt->disableSAX = 1;
- }
-}
-
-/**
* xmlFatalErrMsg:
* @ctxt: an XML parser context
* @error: the error number
@@ -1378,6 +1160,8 @@ xmlCleanSpecialAttr(xmlParserCtxtPtr ctxt)
* xmlCheckLanguageID:
* @lang: pointer to the string value
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Checks that the value conforms to the LanguageID production:
*
* NOTE: this is somewhat deprecated, those productions were removed from
@@ -1752,6 +1536,8 @@ inputPop(xmlParserCtxtPtr ctxt)
* @ctxt: an XML parser context
* @value: the element node
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Pushes a new element node on top of the node stack
*
* Returns -1 in case of error, the index in the stack otherwise
@@ -1790,6 +1576,8 @@ nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value)
* nodePop:
* @ctxt: an XML parser context
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Pops the top element node from the node stack
*
* Returns the node just removed
@@ -1901,6 +1689,8 @@ nameNsPop(xmlParserCtxtPtr ctxt)
* @ctxt: an XML parser context
* @value: the element name
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Pushes a new element name on top of the name stack
*
* Returns -1 in case of error, the index in the stack otherwise
@@ -1928,10 +1718,13 @@ mem_error:
xmlErrMemory(ctxt, NULL);
return (-1);
}
+
/**
* namePop:
* @ctxt: an XML parser context
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Pops the top element name from the name stack
*
* Returns the name just removed
@@ -2100,6 +1893,8 @@ static int spacePop(xmlParserCtxtPtr ctxt) {
* xmlSkipBlankChars:
* @ctxt: the XML parser context
*
+ * DEPRECATED: Internal function, do not use.
+ *
* skip all blanks character found at that point in the input streams.
* It pops up finished entities in the process if allowable at that point.
*
@@ -2475,6 +2270,8 @@ xmlParseStringCharRef(xmlParserCtxtPtr ctxt, const xmlChar **str) {
* xmlParserHandlePEReference:
* @ctxt: the parser context
*
+ * DEPRECATED: Internal function, do not use.
+ *
* [69] PEReference ::= '%' Name ';'
*
* [ WFC: No Recursion ]
@@ -3203,7 +3000,6 @@ static const xmlChar *
xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
int len = 0, l;
int c;
- int count = 0;
int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
XML_MAX_TEXT_LENGTH :
XML_MAX_NAME_LENGTH;
@@ -3215,9 +3011,6 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
/*
* Handler for more complex cases
*/
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
c = CUR_CHAR(l);
if ((ctxt->options & XML_PARSE_OLD10) == 0) {
/*
@@ -3266,12 +3059,6 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
((c >= 0xFDF0) && (c <= 0xFFFD)) ||
((c >= 0x10000) && (c <= 0xEFFFF))
)) {
- if (count++ > XML_PARSER_CHUNK_SIZE) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
- }
if (len <= INT_MAX - l)
len += l;
NEXTL(l);
@@ -3293,18 +3080,14 @@ xmlParseNameComplex(xmlParserCtxtPtr ctxt) {
(c == '_') || (c == ':') ||
(IS_COMBINING(c)) ||
(IS_EXTENDER(c)))) {
- if (count++ > XML_PARSER_CHUNK_SIZE) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
- }
if (len <= INT_MAX - l)
len += l;
NEXTL(l);
c = CUR_CHAR(l);
}
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
if (len > maxLength) {
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Name");
return(NULL);
@@ -3352,6 +3135,8 @@ xmlParseName(xmlParserCtxtPtr ctxt) {
XML_MAX_NAME_LENGTH;
GROW;
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
#ifdef DEBUG
nbParseName++;
@@ -3393,7 +3178,6 @@ static const xmlChar *
xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
int len = 0, l;
int c;
- int count = 0;
int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
XML_MAX_TEXT_LENGTH :
XML_MAX_NAME_LENGTH;
@@ -3406,7 +3190,6 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
/*
* Handler for more complex cases
*/
- GROW;
startPosition = CUR_PTR - BASE_PTR;
c = CUR_CHAR(l);
if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
@@ -3416,31 +3199,13 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
(xmlIsNameChar(ctxt, c) && (c != ':'))) {
- if (count++ > XML_PARSER_CHUNK_SIZE) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
- }
if (len <= INT_MAX - l)
len += l;
NEXTL(l);
c = CUR_CHAR(l);
- if (c == 0) {
- count = 0;
- /*
- * when shrinking to extend the buffer we really need to preserve
- * the part of the name we already parsed. Hence rolling back
- * by current length.
- */
- ctxt->input->cur -= l;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
- ctxt->input->cur += l;
- c = CUR_CHAR(l);
- }
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
if (len > maxLength) {
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NCName");
return(NULL);
@@ -3666,7 +3431,6 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) {
xmlChar buf[XML_MAX_NAMELEN + 5];
int len = 0, l;
int c;
- int count = 0;
int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
XML_MAX_TEXT_LENGTH :
XML_MAX_NAME_LENGTH;
@@ -3675,26 +3439,12 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) {
nbParseNmToken++;
#endif
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
c = CUR_CHAR(l);
while (xmlIsNameChar(ctxt, c)) {
- if (count++ > XML_PARSER_CHUNK_SIZE) {
- count = 0;
- GROW;
- }
COPY_BUF(l,buf,len,c);
NEXTL(l);
c = CUR_CHAR(l);
- if (c == 0) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF)
- return(NULL);
- c = CUR_CHAR(l);
- }
if (len >= XML_MAX_NAMELEN) {
/*
* Okay someone managed to make a huge token, so he's ready to pay
@@ -3710,14 +3460,6 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) {
}
memcpy(buffer, buf, len);
while (xmlIsNameChar(ctxt, c)) {
- if (count++ > XML_PARSER_CHUNK_SIZE) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlFree(buffer);
- return(NULL);
- }
- }
if (len + 10 > max) {
xmlChar *tmp;
@@ -3731,18 +3473,24 @@ xmlParseNmtoken(xmlParserCtxtPtr ctxt) {
buffer = tmp;
}
COPY_BUF(l,buffer,len,c);
- NEXTL(l);
- c = CUR_CHAR(l);
if (len > maxLength) {
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "NmToken");
xmlFree(buffer);
return(NULL);
}
+ NEXTL(l);
+ c = CUR_CHAR(l);
}
buffer[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buffer);
+ return(NULL);
+ }
return(buffer);
}
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
if (len == 0)
return(NULL);
if (len > maxLength) {
@@ -4233,9 +3981,7 @@ xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) {
XML_MAX_NAME_LENGTH;
xmlChar stop;
int state = ctxt->instate;
- int count = 0;
- SHRINK;
if (RAW == '"') {
NEXT;
stop = '"';
@@ -4268,32 +4014,21 @@ xmlParseSystemLiteral(xmlParserCtxtPtr ctxt) {
}
buf = tmp;
}
- count++;
- if (count > 50) {
- SHRINK;
- GROW;
- count = 0;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlFree(buf);
- return(NULL);
- }
- }
COPY_BUF(l,buf,len,cur);
- NEXTL(l);
- cur = CUR_CHAR(l);
- if (cur == 0) {
- GROW;
- SHRINK;
- cur = CUR_CHAR(l);
- }
if (len > maxLength) {
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "SystemLiteral");
xmlFree(buf);
ctxt->instate = (xmlParserInputState) state;
return(NULL);
}
+ NEXTL(l);
+ cur = CUR_CHAR(l);
}
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return(NULL);
+ }
ctxt->instate = (xmlParserInputState) state;
if (!IS_CHAR(cur)) {
xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
@@ -4326,10 +4061,8 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
XML_MAX_NAME_LENGTH;
xmlChar cur;
xmlChar stop;
- int count = 0;
xmlParserInputState oldstate = ctxt->instate;
- SHRINK;
if (RAW == '"') {
NEXT;
stop = '"';
@@ -4361,34 +4094,23 @@ xmlParsePubidLiteral(xmlParserCtxtPtr ctxt) {
buf = tmp;
}
buf[len++] = cur;
- count++;
- if (count > 50) {
- SHRINK;
- GROW;
- count = 0;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlFree(buf);
- return(NULL);
- }
- }
- NEXT;
- cur = CUR;
- if (cur == 0) {
- GROW;
- SHRINK;
- cur = CUR;
- }
if (len > maxLength) {
xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "Public ID");
xmlFree(buf);
return(NULL);
}
+ NEXT;
+ cur = CUR;
}
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return(NULL);
+ }
if (cur != stop) {
xmlFatalErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED, NULL);
} else {
- NEXT;
+ NEXTL(1);
}
ctxt->instate = oldstate;
return(buf);
@@ -4462,7 +4184,6 @@ xmlParseCharData(xmlParserCtxtPtr ctxt, ATTRIBUTE_UNUSED int cdata) {
int col = ctxt->input->col;
int ccol;
- SHRINK;
GROW;
/*
* Accelerated common case where input don't need to be
@@ -4525,7 +4246,8 @@ get_more:
if (*in == ']') {
if ((in[1] == ']') && (in[2] == '>')) {
xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
- ctxt->input->cur = in + 1;
+ if (ctxt->instate != XML_PARSER_EOF)
+ ctxt->input->cur = in + 1;
return;
}
in++;
@@ -4607,10 +4329,7 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt) {
xmlChar buf[XML_PARSER_BIG_BUFFER_SIZE + 5];
int nbchar = 0;
int cur, l;
- int count = 0;
- SHRINK;
- GROW;
cur = CUR_CHAR(l);
while ((cur != '<') && /* checked */
(cur != '&') &&
@@ -4621,7 +4340,6 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt) {
COPY_BUF(l,buf,nbchar,cur);
/* move current position before possible calling of ctxt->sax->characters */
NEXTL(l);
- cur = CUR_CHAR(l);
if (nbchar >= XML_PARSER_BIG_BUFFER_SIZE) {
buf[nbchar] = 0;
@@ -4646,16 +4364,12 @@ xmlParseCharDataComplex(xmlParserCtxtPtr ctxt) {
/* something really bad happened in the SAX callback */
if (ctxt->instate != XML_PARSER_CONTENT)
return;
+ SHRINK;
}
- count++;
- if (count > 50) {
- SHRINK;
- GROW;
- count = 0;
- if (ctxt->instate == XML_PARSER_EOF)
- return;
- }
+ cur = CUR_CHAR(l);
}
+ if (ctxt->instate == XML_PARSER_EOF)
+ return;
if (nbchar != 0) {
buf[nbchar] = 0;
/*
@@ -4711,8 +4425,6 @@ xmlChar *
xmlParseExternalID(xmlParserCtxtPtr ctxt, xmlChar **publicID, int strict) {
xmlChar *URI = NULL;
- SHRINK;
-
*publicID = NULL;
if (CMP6(CUR_PTR, 'S', 'Y', 'S', 'T', 'E', 'M')) {
SKIP(6);
@@ -4780,7 +4492,6 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf,
int q, ql;
int r, rl;
int cur, l;
- size_t count = 0;
size_t maxLength = (ctxt->options & XML_PARSE_HUGE) ?
XML_MAX_HUGE_LENGTH :
XML_MAX_TEXT_LENGTH;
@@ -4797,7 +4508,6 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf,
return;
}
}
- GROW; /* Assure there's enough input data */
q = CUR_CHAR(ql);
if (q == 0)
goto not_terminated;
@@ -4844,37 +4554,27 @@ xmlParseCommentComplex(xmlParserCtxtPtr ctxt, xmlChar *buf,
size = new_size;
}
COPY_BUF(ql,buf,len,q);
+ if (len > maxLength) {
+ xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
+ "Comment too big found", NULL);
+ xmlFree (buf);
+ return;
+ }
+
q = r;
ql = rl;
r = cur;
rl = l;
- count++;
- if (count > 50) {
- SHRINK;
- GROW;
- count = 0;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlFree(buf);
- return;
- }
- }
NEXTL(l);
cur = CUR_CHAR(l);
- if (cur == 0) {
- SHRINK;
- GROW;
- cur = CUR_CHAR(l);
- }
- if (len > maxLength) {
- xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
- "Comment too big found", NULL);
- xmlFree (buf);
- return;
- }
}
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return;
+ }
if (cur == 0) {
xmlFatalErrMsgStr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
"Comment not terminated \n<!--%.50s\n", buf);
@@ -4941,7 +4641,6 @@ xmlParseComment(xmlParserCtxtPtr ctxt) {
ctxt->instate = XML_PARSER_COMMENT;
inputid = ctxt->input->id;
SKIP(2);
- SHRINK;
GROW;
/*
@@ -5218,7 +4917,6 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
int cur, l;
const xmlChar *target;
xmlParserInputState state;
- int count = 0;
if ((RAW == '<') && (NXT(1) == '?')) {
int inputid = ctxt->input->id;
@@ -5228,7 +4926,6 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
* this is a Processing Instruction.
*/
SKIP(2);
- SHRINK;
/*
* Parse the target name and check for special support like
@@ -5281,24 +4978,7 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
buf = tmp;
size = new_size;
}
- count++;
- if (count > 50) {
- SHRINK;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlFree(buf);
- return;
- }
- count = 0;
- }
COPY_BUF(l,buf,len,cur);
- NEXTL(l);
- cur = CUR_CHAR(l);
- if (cur == 0) {
- SHRINK;
- GROW;
- cur = CUR_CHAR(l);
- }
if (len > maxLength) {
xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
"PI %s too big found", target);
@@ -5306,8 +4986,14 @@ xmlParsePI(xmlParserCtxtPtr ctxt) {
ctxt->instate = state;
return;
}
+ NEXTL(l);
+ cur = CUR_CHAR(l);
}
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return;
+ }
if (cur != '?') {
xmlFatalErrMsgStr(ctxt, XML_ERR_PI_NOT_FINISHED,
"ParsePI: PI %s never end ...\n", target);
@@ -5378,7 +5064,6 @@ xmlParseNotationDecl(xmlParserCtxtPtr ctxt) {
if (CMP8(CUR_PTR, 'N', 'O', 'T', 'A', 'T', 'I', 'O', 'N')) {
int inputid = ctxt->input->id;
- SHRINK;
SKIP(8);
if (SKIP_BLANKS == 0) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
@@ -5466,7 +5151,6 @@ xmlParseEntityDecl(xmlParserCtxtPtr ctxt) {
/* GROW; done in the caller */
if (CMP6(CUR_PTR, 'E', 'N', 'T', 'I', 'T', 'Y')) {
int inputid = ctxt->input->id;
- SHRINK;
SKIP(6);
if (SKIP_BLANKS == 0) {
xmlFatalErrMsg(ctxt, XML_ERR_SPACE_REQUIRED,
@@ -5790,7 +5474,6 @@ xmlParseNotationType(xmlParserCtxtPtr ctxt) {
xmlFatalErr(ctxt, XML_ERR_NOTATION_NOT_STARTED, NULL);
return(NULL);
}
- SHRINK;
do {
NEXT;
SKIP_BLANKS;
@@ -5862,7 +5545,6 @@ xmlParseEnumerationType(xmlParserCtxtPtr ctxt) {
xmlFatalErr(ctxt, XML_ERR_ATTLIST_NOT_STARTED, NULL);
return(NULL);
}
- SHRINK;
do {
NEXT;
SKIP_BLANKS;
@@ -5991,7 +5673,6 @@ xmlParseEnumeratedType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) {
*/
int
xmlParseAttributeType(xmlParserCtxtPtr ctxt, xmlEnumerationPtr *tree) {
- SHRINK;
if (CMP5(CUR_PTR, 'C', 'D', 'A', 'T', 'A')) {
SKIP(5);
return(XML_ATTRIBUTE_CDATA);
@@ -6176,7 +5857,6 @@ xmlParseElementMixedContentDecl(xmlParserCtxtPtr ctxt, int inputchk) {
if (CMP7(CUR_PTR, '#', 'P', 'C', 'D', 'A', 'T', 'A')) {
SKIP(7);
SKIP_BLANKS;
- SHRINK;
if (RAW == ')') {
if (ctxt->input->id != inputchk) {
xmlFatalErrMsg(ctxt, XML_ERR_ENTITY_BOUNDARY,
@@ -6348,7 +6028,6 @@ xmlParseElementChildrenContentDeclPriv(xmlParserCtxtPtr ctxt, int inputchk,
GROW;
}
SKIP_BLANKS;
- SHRINK;
while ((RAW != ')') && (ctxt->instate != XML_PARSER_EOF)) {
/*
* Each loop we parse one separator and one element.
@@ -6893,6 +6572,7 @@ xmlParseConditionalSections(xmlParserCtxtPtr ctxt) {
break;
SKIP_BLANKS;
+ SHRINK;
GROW;
}
@@ -7124,6 +6804,7 @@ xmlParseExternalSubset(xmlParserCtxtPtr ctxt, const xmlChar *ExternalID,
return;
}
SKIP_BLANKS;
+ SHRINK;
}
if (RAW != 0) {
@@ -8139,7 +7820,6 @@ xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
xmlParserInputPtr input;
xmlBufferPtr buf;
int l, c;
- int count = 0;
if ((ctxt == NULL) || (entity == NULL) ||
((entity->etype != XML_EXTERNAL_PARAMETER_ENTITY) &&
@@ -8185,25 +7865,12 @@ xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity) {
while ((ctxt->input == input) && (ctxt->input->cur < ctxt->input->end) &&
(IS_CHAR(c))) {
xmlBufferAdd(buf, ctxt->input->cur, l);
- if (count++ > XML_PARSER_CHUNK_SIZE) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlBufferFree(buf);
- return(-1);
- }
- }
NEXTL(l);
c = CUR_CHAR(l);
- if (c == 0) {
- count = 0;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF) {
- xmlBufferFree(buf);
- return(-1);
- }
- c = CUR_CHAR(l);
- }
+ }
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlBufferFree(buf);
+ return(-1);
}
if ((ctxt->input == input) && (ctxt->input->cur >= ctxt->input->end)) {
@@ -8463,6 +8130,8 @@ xmlParseInternalSubset(xmlParserCtxtPtr ctxt) {
return;
}
SKIP_BLANKS;
+ SHRINK;
+ GROW;
}
if (RAW == ']') {
NEXT;
@@ -8863,6 +8532,8 @@ xmlParseQName(xmlParserCtxtPtr ctxt, const xmlChar **prefix) {
const xmlChar *l, *p;
GROW;
+ if (ctxt->instate == XML_PARSER_EOF)
+ return(NULL);
l = xmlParseNCName(ctxt);
if (l == NULL) {
@@ -9347,14 +9018,6 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
if (RAW != '<') return(NULL);
NEXT1;
- /*
- * NOTE: it is crucial with the SAX2 API to never call SHRINK beyond that
- * point since the attribute values may be stored as pointers to
- * the buffer and calling SHRINK would destroy them !
- * The Shrinking is only possible once the full set of attribute
- * callbacks have been done.
- */
- SHRINK;
cur = ctxt->input->cur - ctxt->input->base;
inputid = ctxt->input->id;
nbatts = 0;
@@ -9844,7 +9507,6 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
int r, rl;
int s, sl;
int cur, l;
- int count = 0;
int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
XML_MAX_HUGE_LENGTH :
XML_MAX_TEXT_LENGTH;
@@ -9890,28 +9552,23 @@ xmlParseCDSect(xmlParserCtxtPtr ctxt) {
size *= 2;
}
COPY_BUF(rl,buf,len,r);
+ if (len > maxLength) {
+ xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED,
+ "CData section too big found\n");
+ goto out;
+ }
r = s;
rl = sl;
s = cur;
sl = l;
- count++;
- if (count > 50) {
- SHRINK;
- GROW;
- if (ctxt->instate == XML_PARSER_EOF) {
- goto out;
- }
- count = 0;
- }
NEXTL(l);
cur = CUR_CHAR(l);
- if (len > maxLength) {
- xmlFatalErrMsg(ctxt, XML_ERR_CDATA_NOT_FINISHED,
- "CData section too big found\n");
- goto out;
- }
}
buf[len] = 0;
+ if (ctxt->instate == XML_PARSER_EOF) {
+ xmlFree(buf);
+ return;
+ }
if (cur != '>') {
xmlFatalErrMsgStr(ctxt, XML_ERR_CDATA_NOT_FINISHED,
"CData section not finished\n%.50s\n", buf);
@@ -10005,8 +9662,8 @@ xmlParseContentInternal(xmlParserCtxtPtr ctxt) {
xmlParseCharData(ctxt, 0);
}
- GROW;
SHRINK;
+ GROW;
}
}
@@ -10087,7 +9744,7 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) {
const xmlChar *URI = NULL;
xmlParserNodeInfo node_info;
int line, tlen = 0;
- xmlNodePtr ret;
+ xmlNodePtr cur;
int nsNr = ctxt->nsNr;
if (((unsigned int) ctxt->nameNr > xmlParserMaxDepth) &&
@@ -10129,7 +9786,7 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) {
return(-1);
}
nameNsPush(ctxt, name, prefix, URI, line, ctxt->nsNr - nsNr);
- ret = ctxt->node;
+ cur = ctxt->node;
#ifdef LIBXML_VALID_ENABLED
/*
@@ -10162,17 +9819,23 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) {
spacePop(ctxt);
if (nsNr != ctxt->nsNr)
nsPop(ctxt, ctxt->nsNr - nsNr);
- if ( ret != NULL && ctxt->record_info ) {
- node_info.end_pos = ctxt->input->consumed +
- (CUR_PTR - ctxt->input->base);
- node_info.end_line = ctxt->input->line;
- node_info.node = ret;
- xmlParserAddNodeInfo(ctxt, &node_info);
+ if (cur != NULL && ctxt->record_info) {
+ node_info.node = cur;
+ node_info.end_pos = ctxt->input->consumed +
+ (CUR_PTR - ctxt->input->base);
+ node_info.end_line = ctxt->input->line;
+ xmlParserAddNodeInfo(ctxt, &node_info);
}
return(1);
}
if (RAW == '>') {
NEXT1;
+ if (cur != NULL && ctxt->record_info) {
+ node_info.node = cur;
+ node_info.end_pos = 0;
+ node_info.end_line = 0;
+ xmlParserAddNodeInfo(ctxt, &node_info);
+ }
} else {
xmlFatalErrMsgStrIntStr(ctxt, XML_ERR_GT_REQUIRED,
"Couldn't find end of Start Tag %s line %d\n",
@@ -10186,17 +9849,6 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) {
spacePop(ctxt);
if (nsNr != ctxt->nsNr)
nsPop(ctxt, ctxt->nsNr - nsNr);
-
- /*
- * Capture end position and add node
- */
- if ( ret != NULL && ctxt->record_info ) {
- node_info.end_pos = ctxt->input->consumed +
- (CUR_PTR - ctxt->input->base);
- node_info.end_line = ctxt->input->line;
- node_info.node = ret;
- xmlParserAddNodeInfo(ctxt, &node_info);
- }
return(-1);
}
@@ -10211,8 +9863,7 @@ xmlParseElementStart(xmlParserCtxtPtr ctxt) {
*/
static void
xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
- xmlParserNodeInfo node_info;
- xmlNodePtr ret = ctxt->node;
+ xmlNodePtr cur = ctxt->node;
if (ctxt->nameNr <= 0) {
if ((RAW == '<') && (NXT(1) == '/'))
@@ -10233,14 +9884,17 @@ xmlParseElementEnd(xmlParserCtxtPtr ctxt) {
#endif /* LIBXML_SAX1_ENABLED */
/*
- * Capture end position and add node
+ * Capture end position
*/
- if ( ret != NULL && ctxt->record_info ) {
- node_info.end_pos = ctxt->input->consumed +
- (CUR_PTR - ctxt->input->base);
- node_info.end_line = ctxt->input->line;
- node_info.node = ret;
- xmlParserAddNodeInfo(ctxt, &node_info);
+ if (cur != NULL && ctxt->record_info) {
+ xmlParserNodeInfoPtr node_info;
+
+ node_info = (xmlParserNodeInfoPtr) xmlParserFindNodeInfo(ctxt, cur);
+ if (node_info != NULL) {
+ node_info->end_pos = ctxt->input->consumed +
+ (CUR_PTR - ctxt->input->base);
+ node_info->end_line = ctxt->input->line;
+ }
}
}
@@ -10372,6 +10026,9 @@ xmlParseEncName(xmlParserCtxtPtr ctxt) {
xmlChar *buf = NULL;
int len = 0;
int size = 10;
+ int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
+ XML_MAX_TEXT_LENGTH :
+ XML_MAX_NAME_LENGTH;
xmlChar cur;
cur = CUR;
@@ -10404,13 +10061,13 @@ xmlParseEncName(xmlParserCtxtPtr ctxt) {
buf = tmp;
}
buf[len++] = cur;
+ if (len > maxLength) {
+ xmlFatalErr(ctxt, XML_ERR_NAME_TOO_LONG, "EncName");
+ xmlFree(buf);
+ return(NULL);
+ }
NEXT;
cur = CUR;
- if (cur == 0) {
- SHRINK;
- GROW;
- cur = CUR;
- }
}
buf[len] = 0;
} else {
@@ -10507,6 +10164,7 @@ xmlParseEncodingDecl(xmlParserCtxtPtr ctxt) {
else if ((encoding != NULL) &&
((!xmlStrcasecmp(encoding, BAD_CAST "UTF-8")) ||
(!xmlStrcasecmp(encoding, BAD_CAST "UTF8")))) {
+ /* TODO: Check for encoding mismatch. */
if (ctxt->encoding != NULL)
xmlFree((xmlChar *) ctxt->encoding);
ctxt->encoding = encoding;
@@ -10832,15 +10490,7 @@ xmlParseDocument(xmlParserCtxtPtr ctxt) {
return(-1);
}
- /*
- * Check for the XMLDecl in the Prolog.
- * do not GROW here to avoid the detected encoder to decode more
- * than just the first line, unless the amount of data is really
- * too small to hold "<?xml version="1.0" encoding="foo"
- */
- if ((ctxt->input->end - ctxt->input->cur) < 35) {
- GROW;
- }
+ GROW;
if ((CMP5(CUR_PTR, '<', '?', 'x', 'm', 'l')) && (IS_BLANK_CH(NXT(5)))) {
/*
@@ -11487,20 +11137,23 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
/*
* If we are operating on converted input, try to flush
* remaining chars to avoid them stalling in the non-converted
- * buffer. But do not do this in document start where
- * encoding="..." may not have been read and we work on a
- * guessed encoding.
+ * buffer.
*/
- if ((ctxt->instate != XML_PARSER_START) &&
- (ctxt->input->buf->raw != NULL) &&
+ if ((ctxt->input->buf->raw != NULL) &&
(xmlBufIsEmpty(ctxt->input->buf->raw) == 0)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer,
ctxt->input);
size_t current = ctxt->input->cur - ctxt->input->base;
+ int res;
- xmlParserInputBufferPush(ctxt->input->buf, 0, "");
+ res = xmlParserInputBufferPush(ctxt->input->buf, 0, "");
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input,
base, current);
+ if (res < 0) {
+ xmlFatalErr(ctxt, ctxt->input->buf->error, NULL);
+ xmlHaltParser(ctxt);
+ return(0);
+ }
}
}
avail = ctxt->input->end - ctxt->input->cur;
@@ -11535,6 +11188,13 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
start[2] = NXT(2);
start[3] = NXT(3);
enc = xmlDetectCharEncoding(start, 4);
+ /*
+ * We need more bytes to detect EBCDIC code pages.
+ * See xmlDetectEBCDIC.
+ */
+ if ((enc == XML_CHAR_ENCODING_EBCDIC) &&
+ (!terminate) && (avail < 200))
+ goto done;
xmlSwitchEncoding(ctxt, enc);
break;
}
@@ -12140,7 +11800,6 @@ int
xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
int terminate) {
int end_in_lf = 0;
- int remain = 0;
if (ctxt == NULL)
return(XML_ERR_INTERNAL_ERROR);
@@ -12160,55 +11819,18 @@ xmlParseChunk(xmlParserCtxtPtr ctxt, const char *chunk, int size,
size--;
}
-xmldecl_done:
-
if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL) && (ctxt->instate != XML_PARSER_EOF)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
size_t cur = ctxt->input->cur - ctxt->input->base;
int res;
- /*
- * Specific handling if we autodetected an encoding, we should not
- * push more than the first line ... which depend on the encoding
- * And only push the rest once the final encoding was detected
- */
- if ((ctxt->instate == XML_PARSER_START) && (ctxt->input != NULL) &&
- (ctxt->input->buf != NULL) && (ctxt->input->buf->encoder != NULL)) {
- unsigned int len = 45;
-
- if ((xmlStrcasestr(BAD_CAST ctxt->input->buf->encoder->name,
- BAD_CAST "UTF-16")) ||
- (xmlStrcasestr(BAD_CAST ctxt->input->buf->encoder->name,
- BAD_CAST "UTF16")))
- len = 90;
- else if ((xmlStrcasestr(BAD_CAST ctxt->input->buf->encoder->name,
- BAD_CAST "UCS-4")) ||
- (xmlStrcasestr(BAD_CAST ctxt->input->buf->encoder->name,
- BAD_CAST "UCS4")))
- len = 180;
-
- if (ctxt->input->buf->rawconsumed < len)
- len -= ctxt->input->buf->rawconsumed;
-
- /*
- * Change size for reading the initial declaration only
- * if size is greater than len. Otherwise, memmove in xmlBufferAdd
- * will blindly copy extra bytes from memory.
- */
- if ((unsigned int) size > len) {
- remain = size - len;
- size = len;
- } else {
- remain = 0;
- }
- }
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
if (res < 0) {
- ctxt->errNo = XML_PARSER_EOF;
+ xmlFatalErr(ctxt, ctxt->input->buf->error, NULL);
xmlHaltParser(ctxt);
- return (XML_PARSER_EOF);
+ return(ctxt->errNo);
}
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "PP: pushed %d\n", size);
@@ -12226,21 +11848,15 @@ xmldecl_done:
nbchars = xmlCharEncInput(in, terminate);
xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
if (nbchars < 0) {
- /* TODO 2.6.0 */
- xmlGenericError(xmlGenericErrorContext,
- "xmlParseChunk: encoder error\n");
+ xmlFatalErr(ctxt, in->error, NULL);
xmlHaltParser(ctxt);
- return(XML_ERR_INVALID_ENCODING);
+ return(ctxt->errNo);
}
}
}
}
- if (remain != 0) {
- xmlParseTryOrFinish(ctxt, 0);
- } else {
- xmlParseTryOrFinish(ctxt, terminate);
- }
+ xmlParseTryOrFinish(ctxt, terminate);
if (ctxt->instate == XML_PARSER_EOF)
return(ctxt->errNo);
@@ -12254,22 +11870,21 @@ xmldecl_done:
if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
return(ctxt->errNo);
- if (remain != 0) {
- chunk += size;
- size = remain;
- remain = 0;
- goto xmldecl_done;
- }
if ((end_in_lf == 1) && (ctxt->input != NULL) &&
(ctxt->input->buf != NULL)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer,
ctxt->input);
size_t current = ctxt->input->cur - ctxt->input->base;
+ int res;
- xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
-
+ res = xmlParserInputBufferPush(ctxt->input->buf, 1, "\r");
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input,
base, current);
+ if (res < 0) {
+ xmlFatalErr(ctxt, ctxt->input->buf->error, NULL);
+ xmlHaltParser(ctxt);
+ return(ctxt->errNo);
+ }
}
if (terminate) {
/*
@@ -12326,15 +11941,8 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
xmlParserCtxtPtr ctxt;
xmlParserInputPtr inputStream;
xmlParserInputBufferPtr buf;
- xmlCharEncoding enc = XML_CHAR_ENCODING_NONE;
-
- /*
- * plug some encoding conversion routines
- */
- if ((chunk != NULL) && (size >= 4))
- enc = xmlDetectCharEncoding((const xmlChar *) chunk, size);
- buf = xmlAllocParserInputBuffer(enc);
+ buf = xmlAllocParserInputBuffer(XML_CHAR_ENCODING_NONE);
if (buf == NULL) return(NULL);
ctxt = xmlNewSAXParserCtxt(sax, user_data);
@@ -12384,59 +11992,24 @@ xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax, void *user_data,
(ctxt->input != NULL) && (ctxt->input->buf != NULL)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
size_t cur = ctxt->input->cur - ctxt->input->base;
+ int res;
- xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
-
+ res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
+ if (res < 0) {
+ xmlFatalErr(ctxt, ctxt->input->buf->error, NULL);
+ xmlHaltParser(ctxt);
+ }
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "PP: pushed %d\n", size);
#endif
}
- if (enc != XML_CHAR_ENCODING_NONE) {
- xmlSwitchEncoding(ctxt, enc);
- }
-
return(ctxt);
}
#endif /* LIBXML_PUSH_ENABLED */
/**
- * xmlHaltParser:
- * @ctxt: an XML parser context
- *
- * Blocks further parser processing don't override error
- * for internal use
- */
-static void
-xmlHaltParser(xmlParserCtxtPtr ctxt) {
- if (ctxt == NULL)
- return;
- ctxt->instate = XML_PARSER_EOF;
- ctxt->disableSAX = 1;
- while (ctxt->inputNr > 1)
- xmlFreeInputStream(inputPop(ctxt));
- if (ctxt->input != NULL) {
- /*
- * in case there was a specific allocation deallocate before
- * overriding base
- */
- if (ctxt->input->free != NULL) {
- ctxt->input->free((xmlChar *) ctxt->input->base);
- ctxt->input->free = NULL;
- }
- if (ctxt->input->buf != NULL) {
- xmlFreeParserInputBuffer(ctxt->input->buf);
- ctxt->input->buf = NULL;
- }
- ctxt->input->cur = BAD_CAST"";
- ctxt->input->length = 0;
- ctxt->input->base = ctxt->input->cur;
- ctxt->input->end = ctxt->input->cur;
- }
-}
-
-/**
* xmlStopParser:
* @ctxt: an XML parser context
*
@@ -14791,10 +14364,15 @@ xmlCtxtResetPush(xmlParserCtxtPtr ctxt, const char *chunk,
(ctxt->input->buf != NULL)) {
size_t base = xmlBufGetInputBase(ctxt->input->buf->buffer, ctxt->input);
size_t cur = ctxt->input->cur - ctxt->input->base;
+ int res;
- xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
-
+ res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
+ if (res < 0) {
+ xmlFatalErr(ctxt, ctxt->input->buf->error, NULL);
+ xmlHaltParser(ctxt);
+ return(1);
+ }
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "PP: pushed %d\n", size);
#endif
@@ -15002,6 +14580,12 @@ xmlDoRead(xmlParserCtxtPtr ctxt, const char *URL, const char *encoding,
if (encoding != NULL) {
xmlCharEncodingHandlerPtr hdlr;
+ /*
+ * TODO: We should consider to set XML_PARSE_IGNORE_ENC if the
+ * caller provided an encoding. Otherwise, we might switch to
+ * the encoding from the XML declaration which is likely to
+ * break things. Also see xmlSwitchInputEncoding.
+ */
hdlr = xmlFindCharEncodingHandler(encoding);
if (hdlr != NULL)
xmlSwitchToEncoding(ctxt, hdlr);
diff --git a/parserInternals.c b/parserInternals.c
index 90c428d1..6612ea74 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -176,6 +176,228 @@ xmlErrInternal(xmlParserCtxtPtr ctxt, const char *msg, const xmlChar * str)
}
/**
+ * xmlFatalErr:
+ * @ctxt: an XML parser context
+ * @error: the error number
+ * @extra: extra information string
+ *
+ * Handle a fatal parser error, i.e. violating Well-Formedness constraints
+ */
+void
+xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info)
+{
+ const char *errmsg;
+
+ if ((ctxt != NULL) && (ctxt->disableSAX != 0) &&
+ (ctxt->instate == XML_PARSER_EOF))
+ return;
+ switch (error) {
+ case XML_ERR_INVALID_HEX_CHARREF:
+ errmsg = "CharRef: invalid hexadecimal value";
+ break;
+ case XML_ERR_INVALID_DEC_CHARREF:
+ errmsg = "CharRef: invalid decimal value";
+ break;
+ case XML_ERR_INVALID_CHARREF:
+ errmsg = "CharRef: invalid value";
+ break;
+ case XML_ERR_INTERNAL_ERROR:
+ errmsg = "internal error";
+ break;
+ case XML_ERR_PEREF_AT_EOF:
+ errmsg = "PEReference at end of document";
+ break;
+ case XML_ERR_PEREF_IN_PROLOG:
+ errmsg = "PEReference in prolog";
+ break;
+ case XML_ERR_PEREF_IN_EPILOG:
+ errmsg = "PEReference in epilog";
+ break;
+ case XML_ERR_PEREF_NO_NAME:
+ errmsg = "PEReference: no name";
+ break;
+ case XML_ERR_PEREF_SEMICOL_MISSING:
+ errmsg = "PEReference: expecting ';'";
+ break;
+ case XML_ERR_ENTITY_LOOP:
+ errmsg = "Detected an entity reference loop";
+ break;
+ case XML_ERR_ENTITY_NOT_STARTED:
+ errmsg = "EntityValue: \" or ' expected";
+ break;
+ case XML_ERR_ENTITY_PE_INTERNAL:
+ errmsg = "PEReferences forbidden in internal subset";
+ break;
+ case XML_ERR_ENTITY_NOT_FINISHED:
+ errmsg = "EntityValue: \" or ' expected";
+ break;
+ case XML_ERR_ATTRIBUTE_NOT_STARTED:
+ errmsg = "AttValue: \" or ' expected";
+ break;
+ case XML_ERR_LT_IN_ATTRIBUTE:
+ errmsg = "Unescaped '<' not allowed in attributes values";
+ break;
+ case XML_ERR_LITERAL_NOT_STARTED:
+ errmsg = "SystemLiteral \" or ' expected";
+ break;
+ case XML_ERR_LITERAL_NOT_FINISHED:
+ errmsg = "Unfinished System or Public ID \" or ' expected";
+ break;
+ case XML_ERR_MISPLACED_CDATA_END:
+ errmsg = "Sequence ']]>' not allowed in content";
+ break;
+ case XML_ERR_URI_REQUIRED:
+ errmsg = "SYSTEM or PUBLIC, the URI is missing";
+ break;
+ case XML_ERR_PUBID_REQUIRED:
+ errmsg = "PUBLIC, the Public Identifier is missing";
+ break;
+ case XML_ERR_HYPHEN_IN_COMMENT:
+ errmsg = "Comment must not contain '--' (double-hyphen)";
+ break;
+ case XML_ERR_PI_NOT_STARTED:
+ errmsg = "xmlParsePI : no target name";
+ break;
+ case XML_ERR_RESERVED_XML_NAME:
+ errmsg = "Invalid PI name";
+ break;
+ case XML_ERR_NOTATION_NOT_STARTED:
+ errmsg = "NOTATION: Name expected here";
+ break;
+ case XML_ERR_NOTATION_NOT_FINISHED:
+ errmsg = "'>' required to close NOTATION declaration";
+ break;
+ case XML_ERR_VALUE_REQUIRED:
+ errmsg = "Entity value required";
+ break;
+ case XML_ERR_URI_FRAGMENT:
+ errmsg = "Fragment not allowed";
+ break;
+ case XML_ERR_ATTLIST_NOT_STARTED:
+ errmsg = "'(' required to start ATTLIST enumeration";
+ break;
+ case XML_ERR_NMTOKEN_REQUIRED:
+ errmsg = "NmToken expected in ATTLIST enumeration";
+ break;
+ case XML_ERR_ATTLIST_NOT_FINISHED:
+ errmsg = "')' required to finish ATTLIST enumeration";
+ break;
+ case XML_ERR_MIXED_NOT_STARTED:
+ errmsg = "MixedContentDecl : '|' or ')*' expected";
+ break;
+ case XML_ERR_PCDATA_REQUIRED:
+ errmsg = "MixedContentDecl : '#PCDATA' expected";
+ break;
+ case XML_ERR_ELEMCONTENT_NOT_STARTED:
+ errmsg = "ContentDecl : Name or '(' expected";
+ break;
+ case XML_ERR_ELEMCONTENT_NOT_FINISHED:
+ errmsg = "ContentDecl : ',' '|' or ')' expected";
+ break;
+ case XML_ERR_PEREF_IN_INT_SUBSET:
+ errmsg =
+ "PEReference: forbidden within markup decl in internal subset";
+ break;
+ case XML_ERR_GT_REQUIRED:
+ errmsg = "expected '>'";
+ break;
+ case XML_ERR_CONDSEC_INVALID:
+ errmsg = "XML conditional section '[' expected";
+ break;
+ case XML_ERR_EXT_SUBSET_NOT_FINISHED:
+ errmsg = "Content error in the external subset";
+ break;
+ case XML_ERR_CONDSEC_INVALID_KEYWORD:
+ errmsg =
+ "conditional section INCLUDE or IGNORE keyword expected";
+ break;
+ case XML_ERR_CONDSEC_NOT_FINISHED:
+ errmsg = "XML conditional section not closed";
+ break;
+ case XML_ERR_XMLDECL_NOT_STARTED:
+ errmsg = "Text declaration '<?xml' required";
+ break;
+ case XML_ERR_XMLDECL_NOT_FINISHED:
+ errmsg = "parsing XML declaration: '?>' expected";
+ break;
+ case XML_ERR_EXT_ENTITY_STANDALONE:
+ errmsg = "external parsed entities cannot be standalone";
+ break;
+ case XML_ERR_ENTITYREF_SEMICOL_MISSING:
+ errmsg = "EntityRef: expecting ';'";
+ break;
+ case XML_ERR_DOCTYPE_NOT_FINISHED:
+ errmsg = "DOCTYPE improperly terminated";
+ break;
+ case XML_ERR_LTSLASH_REQUIRED:
+ errmsg = "EndTag: '</' not found";
+ break;
+ case XML_ERR_EQUAL_REQUIRED:
+ errmsg = "expected '='";
+ break;
+ case XML_ERR_STRING_NOT_CLOSED:
+ errmsg = "String not closed expecting \" or '";
+ break;
+ case XML_ERR_STRING_NOT_STARTED:
+ errmsg = "String not started expecting ' or \"";
+ break;
+ case XML_ERR_ENCODING_NAME:
+ errmsg = "Invalid XML encoding name";
+ break;
+ case XML_ERR_STANDALONE_VALUE:
+ errmsg = "standalone accepts only 'yes' or 'no'";
+ break;
+ case XML_ERR_DOCUMENT_EMPTY:
+ errmsg = "Document is empty";
+ break;
+ case XML_ERR_DOCUMENT_END:
+ errmsg = "Extra content at the end of the document";
+ break;
+ case XML_ERR_NOT_WELL_BALANCED:
+ errmsg = "chunk is not well balanced";
+ break;
+ case XML_ERR_EXTRA_CONTENT:
+ errmsg = "extra content at the end of well balanced chunk";
+ break;
+ case XML_ERR_VERSION_MISSING:
+ errmsg = "Malformed declaration expecting version";
+ break;
+ case XML_ERR_NAME_TOO_LONG:
+ errmsg = "Name too long";
+ break;
+ case XML_ERR_INVALID_ENCODING:
+ errmsg = "Invalid bytes in character encoding";
+ break;
+ case XML_IO_UNKNOWN:
+ errmsg = "I/O error";
+ break;
+#if 0
+ case:
+ errmsg = "";
+ break;
+#endif
+ default:
+ errmsg = "Unregistered error message";
+ }
+ if (ctxt != NULL)
+ ctxt->errNo = error;
+ if (info == NULL) {
+ __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
+ XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s\n",
+ errmsg);
+ } else {
+ __xmlRaiseError(NULL, NULL, NULL, ctxt, NULL, XML_FROM_PARSER, error,
+ XML_ERR_FATAL, NULL, 0, info, NULL, NULL, 0, 0, "%s: %s\n",
+ errmsg, info);
+ }
+ if (ctxt != NULL) {
+ ctxt->wellFormed = 0;
+ if (ctxt->recovery == 0)
+ ctxt->disableSAX = 1;
+ }
+}
+
+/**
* xmlErrEncodingInt:
* @ctxt: an XML parser context
* @error: the error number
@@ -259,6 +481,41 @@ void check_buffer(xmlParserInputPtr in) {
/**
+ * xmlHaltParser:
+ * @ctxt: an XML parser context
+ *
+ * Blocks further parser processing don't override error
+ * for internal use
+ */
+void
+xmlHaltParser(xmlParserCtxtPtr ctxt) {
+ if (ctxt == NULL)
+ return;
+ ctxt->instate = XML_PARSER_EOF;
+ ctxt->disableSAX = 1;
+ while (ctxt->inputNr > 1)
+ xmlFreeInputStream(inputPop(ctxt));
+ if (ctxt->input != NULL) {
+ /*
+ * in case there was a specific allocation deallocate before
+ * overriding base
+ */
+ if (ctxt->input->free != NULL) {
+ ctxt->input->free((xmlChar *) ctxt->input->base);
+ ctxt->input->free = NULL;
+ }
+ if (ctxt->input->buf != NULL) {
+ xmlFreeParserInputBuffer(ctxt->input->buf);
+ ctxt->input->buf = NULL;
+ }
+ ctxt->input->cur = BAD_CAST"";
+ ctxt->input->length = 0;
+ ctxt->input->base = ctxt->input->cur;
+ ctxt->input->end = ctxt->input->cur;
+ }
+}
+
+/**
* xmlParserInputRead:
* @in: an XML parser input
* @len: an indicative size for the lookahead
@@ -286,6 +543,9 @@ xmlParserGrow(xmlParserCtxtPtr ctxt) {
if (buf == NULL)
return(0);
+ /* Don't grow push parser buffer. */
+ if (ctxt->progressive)
+ return(0);
/* Don't grow memory buffers. */
if ((buf->encoder == NULL) && (buf->readcallback == NULL))
return(0);
@@ -293,8 +553,8 @@ xmlParserGrow(xmlParserCtxtPtr ctxt) {
if (((curEnd > XML_MAX_LOOKUP_LIMIT) ||
(curBase > XML_MAX_LOOKUP_LIMIT)) &&
((ctxt->options & XML_PARSE_HUGE) == 0)) {
- xmlErrInternal(ctxt, "Huge input lookup", NULL);
- ctxt->instate = XML_PARSER_EOF;
+ xmlErrMemory(ctxt, "Huge input lookup");
+ xmlHaltParser(ctxt);
return(-1);
}
@@ -302,22 +562,11 @@ xmlParserGrow(xmlParserCtxtPtr ctxt) {
return(0);
ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
+ xmlBufSetInputBaseCur(buf->buffer, in, 0, curBase);
- in->base = xmlBufContent(buf->buffer);
- if (in->base == NULL) {
- in->base = BAD_CAST "";
- in->cur = in->base;
- in->end = in->base;
- xmlErrMemory(ctxt, NULL);
- return(-1);
- }
- in->cur = in->base + curBase;
- in->end = xmlBufEnd(buf->buffer);
-
- /* TODO: Get error code from xmlParserInputBufferGrow */
if (ret < 0) {
- xmlErrInternal(ctxt, "Growing input buffer", NULL);
- ctxt->instate = XML_PARSER_EOF;
+ xmlFatalErr(ctxt, buf->error, NULL);
+ xmlHaltParser(ctxt);
}
return(ret);
@@ -384,17 +633,16 @@ xmlParserInputGrow(xmlParserInputPtr in, int len) {
* xmlParserShrink:
* @ctxt: an XML parser context
*/
-int
+void
xmlParserShrink(xmlParserCtxtPtr ctxt) {
xmlParserInputPtr in = ctxt->input;
xmlParserInputBufferPtr buf = in->buf;
size_t used;
- int ret = 0;
/* Don't shrink memory buffers. */
if ((buf == NULL) ||
((buf->encoder == NULL) && (buf->readcallback == NULL)))
- return(0);
+ return;
used = in->cur - in->base;
/*
@@ -414,27 +662,7 @@ xmlParserShrink(xmlParserCtxtPtr ctxt) {
}
}
- if (xmlBufUse(buf->buffer) < INPUT_CHUNK)
- ret = xmlParserInputBufferGrow(buf, INPUT_CHUNK);
-
- in->base = xmlBufContent(buf->buffer);
- if (in->base == NULL) {
- in->base = BAD_CAST "";
- in->cur = in->base;
- in->end = in->base;
- xmlErrMemory(ctxt, NULL);
- return(-1);
- }
- in->cur = in->base + used;
- in->end = xmlBufEnd(buf->buffer);
-
- /* TODO: Get error code from xmlParserInputBufferGrow */
- if (ret < 0) {
- xmlErrInternal(ctxt, "Growing input buffer", NULL);
- ctxt->instate = XML_PARSER_EOF;
- }
-
- return(ret);
+ xmlBufSetInputBaseCur(buf->buffer, in, 0, used);
}
/**
@@ -506,6 +734,8 @@ xmlParserInputShrink(xmlParserInputPtr in) {
* xmlNextChar:
* @ctxt: the XML parser context
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Skip to the next char input char.
*/
@@ -523,8 +753,11 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
return;
}
- if ((ctxt->input->cur >= ctxt->input->end) && (xmlParserGrow(ctxt) <= 0)) {
- return;
+ if (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK) {
+ if (xmlParserGrow(ctxt) < 0)
+ return;
+ if (ctxt->input->cur >= ctxt->input->end)
+ return;
}
if (ctxt->charset == XML_CHAR_ENCODING_UTF8) {
@@ -557,30 +790,23 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
c = *cur;
if (c & 0x80) {
+ size_t avail;
+
if (c == 0xC0)
goto encoding_error;
- if (cur[1] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
- if ((cur[1] & 0xc0) != 0x80)
+
+ avail = ctxt->input->end - ctxt->input->cur;
+
+ if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
goto encoding_error;
if ((c & 0xe0) == 0xe0) {
unsigned int val;
- if (cur[2] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
- if ((cur[2] & 0xc0) != 0x80)
+ if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
goto encoding_error;
if ((c & 0xf0) == 0xf0) {
- if (cur[3] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
if (((c & 0xf8) != 0xf0) ||
- ((cur[3] & 0xc0) != 0x80))
+ (avail < 4) || ((cur[3] & 0xc0) != 0x80))
goto encoding_error;
/* 4-byte code */
ctxt->input->cur += 4;
@@ -621,8 +847,6 @@ xmlNextChar(xmlParserCtxtPtr ctxt)
ctxt->input->col++;
ctxt->input->cur++;
}
- if (*ctxt->input->cur == 0)
- xmlParserGrow(ctxt);
return;
encoding_error:
/*
@@ -657,6 +881,8 @@ encoding_error:
* @ctxt: the XML parser context
* @len: pointer to the length of the char read
*
+ * DEPRECATED: Internal function, do not use.
+ *
* The current char value, if using UTF-8 this may actually span multiple
* bytes in the input buffer. Implement the end of line normalization:
* 2.11 End-of-Line Handling
@@ -676,6 +902,10 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
if (ctxt->instate == XML_PARSER_EOF)
return(0);
+ if ((ctxt->input->end - ctxt->input->cur < INPUT_CHUNK) &&
+ (xmlParserGrow(ctxt) < 0))
+ return(0);
+
if ((*ctxt->input->cur >= 0x20) && (*ctxt->input->cur <= 0x7F)) {
*len = 1;
return(*ctxt->input->cur);
@@ -698,28 +928,21 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
c = *cur;
if (c & 0x80) {
+ size_t avail;
+
if (((c & 0x40) == 0) || (c == 0xC0))
goto encoding_error;
- if (cur[1] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
- if ((cur[1] & 0xc0) != 0x80)
+
+ avail = ctxt->input->end - ctxt->input->cur;
+
+ if ((avail < 2) || (cur[1] & 0xc0) != 0x80)
goto encoding_error;
if ((c & 0xe0) == 0xe0) {
- if (cur[2] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
- if ((cur[2] & 0xc0) != 0x80)
+ if ((avail < 3) || (cur[2] & 0xc0) != 0x80)
goto encoding_error;
if ((c & 0xf0) == 0xf0) {
- if (cur[3] == 0) {
- xmlParserGrow(ctxt);
- cur = ctxt->input->cur;
- }
if (((c & 0xf8) != 0xf0) ||
- ((cur[3] & 0xc0) != 0x80))
+ (avail < 4) || ((cur[3] & 0xc0) != 0x80))
goto encoding_error;
/* 4-byte code */
*len = 4;
@@ -754,8 +977,6 @@ xmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
} else {
/* 1-byte code */
*len = 1;
- if (*ctxt->input->cur == 0)
- xmlParserGrow(ctxt);
if ((*ctxt->input->cur == 0) &&
(ctxt->input->end > ctxt->input->cur)) {
xmlErrEncodingInt(ctxt, XML_ERR_INVALID_CHAR,
@@ -822,6 +1043,8 @@ encoding_error:
* @cur: pointer to the beginning of the char
* @len: pointer to the length of the char read
*
+ * DEPRECATED: Internal function, do not use.
+ *
* The current char value, if using UTF-8 this may actually span multiple
* bytes in the input buffer.
*
@@ -997,9 +1220,63 @@ xmlCopyChar(int len ATTRIBUTE_UNUSED, xmlChar *out, int val) {
* *
************************************************************************/
-static int
-xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
- xmlCharEncodingHandlerPtr handler, int len);
+static xmlCharEncodingHandlerPtr
+xmlDetectEBCDIC(xmlParserInputPtr input) {
+ xmlChar out[200];
+ xmlCharEncodingHandlerPtr handler;
+ int inlen, outlen, res, i;
+
+ /*
+ * To detect the EBCDIC code page, we convert the first 200 bytes
+ * to EBCDIC-US and try to find the encoding declaration.
+ */
+ handler = xmlGetCharEncodingHandler(XML_CHAR_ENCODING_EBCDIC);
+ if (handler == NULL)
+ return(NULL);
+ outlen = sizeof(out) - 1;
+ inlen = input->end - input->cur;
+ res = xmlEncInputChunk(handler, out, &outlen, input->cur, &inlen, 0);
+ if (res < 0)
+ return(handler);
+ out[outlen] = 0;
+
+ for (i = 0; i < outlen; i++) {
+ if (out[i] == '>')
+ break;
+ if ((out[i] == 'e') &&
+ (xmlStrncmp(out + i, BAD_CAST "encoding", 8) == 0)) {
+ int start, cur, quote;
+
+ i += 8;
+ while (IS_BLANK_CH(out[i]))
+ i += 1;
+ if (out[i++] != '=')
+ break;
+ while (IS_BLANK_CH(out[i]))
+ i += 1;
+ quote = out[i++];
+ if ((quote != '\'') && (quote != '"'))
+ break;
+ start = i;
+ cur = out[i];
+ while (((cur >= 'a') && (cur <= 'z')) ||
+ ((cur >= 'A') && (cur <= 'Z')) ||
+ ((cur >= '0') && (cur <= '9')) ||
+ (cur == '.') || (cur == '_') ||
+ (cur == '-'))
+ cur = out[++i];
+ if (cur != quote)
+ break;
+ out[i] = 0;
+ xmlCharEncCloseFunc(handler);
+ handler = xmlFindCharEncodingHandler((char *) out + start);
+ break;
+ }
+ }
+
+ return(handler);
+}
+
/**
* xmlSwitchEncoding:
* @ctxt: the parser context
@@ -1014,7 +1291,6 @@ int
xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
{
xmlCharEncodingHandlerPtr handler;
- int len = -1;
int ret;
if (ctxt == NULL) return(-1);
@@ -1043,51 +1319,13 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
ctxt->input->cur += 3;
}
return(0);
- case XML_CHAR_ENCODING_UTF16LE:
- case XML_CHAR_ENCODING_UTF16BE:
- /*The raw input characters are encoded
- *in UTF-16. As we expect this function
- *to be called after xmlCharEncInFunc, we expect
- *ctxt->input->cur to contain UTF-8 encoded characters.
- *So the raw UTF16 Byte Order Mark
- *has also been converted into
- *an UTF-8 BOM. Let's skip that BOM.
- */
- if ((ctxt->input != NULL) && (ctxt->input->cur != NULL) &&
- (ctxt->input->cur[0] == 0xEF) &&
- (ctxt->input->cur[1] == 0xBB) &&
- (ctxt->input->cur[2] == 0xBF)) {
- ctxt->input->cur += 3;
- }
- len = 90;
- break;
- case XML_CHAR_ENCODING_UCS2:
- len = 90;
- break;
- case XML_CHAR_ENCODING_UCS4BE:
- case XML_CHAR_ENCODING_UCS4LE:
- case XML_CHAR_ENCODING_UCS4_2143:
- case XML_CHAR_ENCODING_UCS4_3412:
- len = 180;
- break;
- case XML_CHAR_ENCODING_EBCDIC:
- case XML_CHAR_ENCODING_8859_1:
- case XML_CHAR_ENCODING_8859_2:
- case XML_CHAR_ENCODING_8859_3:
- case XML_CHAR_ENCODING_8859_4:
- case XML_CHAR_ENCODING_8859_5:
- case XML_CHAR_ENCODING_8859_6:
- case XML_CHAR_ENCODING_8859_7:
- case XML_CHAR_ENCODING_8859_8:
- case XML_CHAR_ENCODING_8859_9:
- case XML_CHAR_ENCODING_ASCII:
- case XML_CHAR_ENCODING_2022_JP:
- case XML_CHAR_ENCODING_SHIFT_JIS:
- case XML_CHAR_ENCODING_EUC_JP:
- len = 45;
- break;
- }
- handler = xmlGetCharEncodingHandler(enc);
+ case XML_CHAR_ENCODING_EBCDIC:
+ handler = xmlDetectEBCDIC(ctxt->input);
+ break;
+ default:
+ handler = xmlGetCharEncodingHandler(enc);
+ break;
+ }
if (handler == NULL) {
/*
* Default handlers.
@@ -1119,7 +1357,7 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
return(-1);
}
}
- ret = xmlSwitchInputEncodingInt(ctxt, ctxt->input, handler, len);
+ ret = xmlSwitchInputEncoding(ctxt, ctxt->input, handler);
if ((ret < 0) || (ctxt->errNo == XML_I18N_CONV_FAILED)) {
/*
* on encoding conversion errors, stop the parser
@@ -1131,20 +1369,19 @@ xmlSwitchEncoding(xmlParserCtxtPtr ctxt, xmlCharEncoding enc)
}
/**
- * xmlSwitchInputEncodingInt:
+ * xmlSwitchInputEncoding:
* @ctxt: the parser context
* @input: the input stream
* @handler: the encoding handler
- * @len: the number of bytes to convert for the first line or -1
*
* change the input functions when discovering the character encoding
* of a given entity.
*
* Returns 0 in case of success, -1 otherwise
*/
-static int
-xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
- xmlCharEncodingHandlerPtr handler, int len)
+int
+xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
+ xmlCharEncodingHandlerPtr handler)
{
int nbchars;
xmlParserInputBufferPtr in;
@@ -1166,30 +1403,25 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
return (-1);
}
- ctxt->charset = XML_CHAR_ENCODING_UTF8;
-
if (in->encoder != NULL) {
- /*
- * Check in case the auto encoding detection triggered
- * in already.
- */
if (in->encoder == handler)
return (0);
/*
- * Note: this is a bit dangerous, but that's what it
- * takes to use nearly compatible signature for different
- * encodings.
+ * Switching encodings during parsing is a really bad idea,
+ * but WebKit/Chromium switches from ISO-8859-1 to UTF-16 as soon as
+ * it finds Unicode characters with code points larger than 255.
*
- * FIXME: Encoders might buffer partial byte sequences, so
- * this probably can't work. We should return an error and
- * make sure that callers never try to switch the encoding
- * twice.
+ * TODO: We should check whether the "raw" input buffer is empty and
+ * convert the old content using the old encoder.
*/
+
xmlCharEncCloseFunc(in->encoder);
in->encoder = handler;
return (0);
}
+
+ ctxt->charset = XML_CHAR_ENCODING_UTF8;
in->encoder = handler;
/*
@@ -1237,25 +1469,24 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
in->rawconsumed = processed;
use = xmlBufUse(in->raw);
- if (ctxt->html) {
- /*
- * convert as much as possible of the buffer
- */
- nbchars = xmlCharEncInput(in, 1);
- } else {
- /*
- * convert just enough to get
- * '<?xml version="1.0" encoding="xxx"?>'
- * parsed with the autodetected encoding
- * into the parser reading buffer.
- */
- nbchars = xmlCharEncFirstLineInput(in, len);
- }
+ /*
+ * TODO: We must flush and decode the whole buffer to make functions
+ * like xmlReadMemory work with a user-provided encoding. If the
+ * encoding is specified directly, we should probably set
+ * XML_PARSE_IGNORE_ENC in xmlDoRead to avoid switching encodings
+ * twice. Then we could set "flush" to false which should save
+ * a considerable amount of memory when parsing from memory.
+ * It's probably even possible to remove this whole if-block
+ * completely.
+ */
+ nbchars = xmlCharEncInput(in, 1);
xmlBufResetInput(in->buffer, input);
if (nbchars < 0) {
+ /* TODO: This could be an out of memory or an encoding error. */
xmlErrInternal(ctxt,
"switching encoding: encoder error\n",
NULL);
+ xmlHaltParser(ctxt);
return (-1);
}
consumed = use - xmlBufUse(in->raw);
@@ -1269,25 +1500,6 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
}
/**
- * xmlSwitchInputEncoding:
- * @ctxt: the parser context
- * @input: the input stream
- * @handler: the encoding handler
- *
- * DEPRECATED: Use xmlSwitchToEncoding
- *
- * change the input functions when discovering the character encoding
- * of a given entity.
- *
- * Returns 0 in case of success, -1 otherwise
- */
-int
-xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
- xmlCharEncodingHandlerPtr handler) {
- return(xmlSwitchInputEncodingInt(ctxt, input, handler, -1));
-}
-
-/**
* xmlSwitchToEncoding:
* @ctxt: the parser context
* @handler: the encoding handler
@@ -1302,7 +1514,7 @@ xmlSwitchToEncoding(xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler)
{
if (ctxt == NULL)
return(-1);
- return(xmlSwitchInputEncodingInt(ctxt, ctxt->input, handler, -1));
+ return(xmlSwitchInputEncoding(ctxt, ctxt->input, handler));
}
/************************************************************************
@@ -1409,6 +1621,8 @@ xmlNewIOInputStream(xmlParserCtxtPtr ctxt, xmlParserInputBufferPtr input,
* @ctxt: an XML parser context
* @entity: an Entity pointer
*
+ * DEPRECATED: Internal function, do not use.
+ *
* Create a new input stream based on an xmlEntityPtr
*
* Returns the new input stream or NULL
diff --git a/python/.gitignore b/python/.gitignore
new file mode 100644
index 00000000..b68d6ea9
--- /dev/null
+++ b/python/.gitignore
@@ -0,0 +1,9 @@
+/gen_prog
+/libxml2-export.c
+/libxml2-py.c
+/libxml2-py.h
+/libxml2.py
+/libxml2class.py
+/libxml2class.txt
+/setup.py
+/tests/tmp.xml
diff --git a/python/generator.py b/python/generator.py
index 989c38e1..3a5db228 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -293,6 +293,11 @@ deprecated_funcs = {
'htmlInitAutoClose': True,
'htmlParseCharRef': True,
'htmlParseElement': True,
+ 'namePop': True,
+ 'namePush': True,
+ 'nodePop': True,
+ 'nodePush': True,
+ 'xmlCheckLanguageID': True,
'xmlCleanupCharEncodingHandlers': True,
'xmlCleanupGlobals': True,
'xmlDefaultSAXHandlerInit': True,
@@ -312,6 +317,7 @@ deprecated_funcs = {
'xmlNanoFTPProxy': True,
'xmlNanoFTPScanProxy': True,
'xmlNewGlobalNs': True,
+ 'xmlNextChar': True,
'xmlParseAttValue': True,
'xmlParseAttributeListDecl': True,
'xmlParseCDSect': True,
@@ -346,6 +352,7 @@ deprecated_funcs = {
'xmlParseVersionInfo': True,
'xmlParseVersionNum': True,
'xmlParseXMLDecl': True,
+ 'xmlParserHandlePEReference': True,
'xmlParserHandleReference': True,
'xmlRecoverDoc': True,
'xmlRecoverFile': True,
@@ -358,6 +365,7 @@ deprecated_funcs = {
'xmlSchemaCleanupTypes': True,
'xmlSchemaInitTypes': True,
'xmlSetupParserForBuffer': True,
+ 'xmlSkipBlankChars': True,
'xmlStringDecodeEntities': True,
'xmlStringLenDecodeEntities': True,
'xmlThrDefDefaultBufferSize': True,
diff --git a/python/tests/attribs.py b/python/tests/attribs.py
index 9170cb7a..16d22f1f 100755
--- a/python/tests/attribs.py
+++ b/python/tests/attribs.py
@@ -31,4 +31,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/build.py b/python/tests/build.py
index 1ff4a5b9..fa894570 100755
--- a/python/tests/build.py
+++ b/python/tests/build.py
@@ -56,4 +56,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/compareNodes.py b/python/tests/compareNodes.py
index 322754d8..9bf6482b 100755
--- a/python/tests/compareNodes.py
+++ b/python/tests/compareNodes.py
@@ -47,4 +47,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/ctxterror.py b/python/tests/ctxterror.py
index 4823194b..4646c2df 100755
--- a/python/tests/ctxterror.py
+++ b/python/tests/ctxterror.py
@@ -53,4 +53,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/cutnpaste.py b/python/tests/cutnpaste.py
index 6134d88b..53eafc45 100755
--- a/python/tests/cutnpaste.py
+++ b/python/tests/cutnpaste.py
@@ -45,4 +45,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/dtdvalid.py b/python/tests/dtdvalid.py
index dc3af120..8f461af4 100755
--- a/python/tests/dtdvalid.py
+++ b/python/tests/dtdvalid.py
@@ -28,5 +28,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/error.py b/python/tests/error.py
index 09102adb..932751ff 100755
--- a/python/tests/error.py
+++ b/python/tests/error.py
@@ -48,4 +48,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/inbuf.py b/python/tests/inbuf.py
index 10a9cf0f..d1225cf3 100755
--- a/python/tests/inbuf.py
+++ b/python/tests/inbuf.py
@@ -26,5 +26,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/indexes.py b/python/tests/indexes.py
index d64dfb81..14b5f11d 100755
--- a/python/tests/indexes.py
+++ b/python/tests/indexes.py
@@ -110,4 +110,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/nsdel.py b/python/tests/nsdel.py
index 7d4aa96f..435da61b 100755
--- a/python/tests/nsdel.py
+++ b/python/tests/nsdel.py
@@ -59,4 +59,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/outbuf.py b/python/tests/outbuf.py
index 2bafcc83..cdd93518 100755
--- a/python/tests/outbuf.py
+++ b/python/tests/outbuf.py
@@ -107,4 +107,3 @@ if __name__ == '__main__':
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/push.py b/python/tests/push.py
index 0b6ae1d3..2c69d729 100755
--- a/python/tests/push.py
+++ b/python/tests/push.py
@@ -32,4 +32,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/pushSAX.py b/python/tests/pushSAX.py
index a2df0a87..ebe62c98 100755
--- a/python/tests/pushSAX.py
+++ b/python/tests/pushSAX.py
@@ -61,4 +61,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/pushSAXhtml.py b/python/tests/pushSAXhtml.py
index eabbfcae..c4126544 100755
--- a/python/tests/pushSAXhtml.py
+++ b/python/tests/pushSAXhtml.py
@@ -62,4 +62,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader.py b/python/tests/reader.py
index d8e6fff1..870abf20 100755
--- a/python/tests/reader.py
+++ b/python/tests/reader.py
@@ -443,4 +443,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader2.py b/python/tests/reader2.py
index 802d848d..66b5c2d0 100755
--- a/python/tests/reader2.py
+++ b/python/tests/reader2.py
@@ -41,7 +41,7 @@ value
"""{0}/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got
<a/>
^
-{0}/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child
+{0}/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more children
^
""".format(dir_prefix),
@@ -334,4 +334,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader3.py b/python/tests/reader3.py
index 6507a7bd..d3241029 100755
--- a/python/tests/reader3.py
+++ b/python/tests/reader3.py
@@ -157,4 +157,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader4.py b/python/tests/reader4.py
index 5aeed28e..aea4bf4d 100755
--- a/python/tests/reader4.py
+++ b/python/tests/reader4.py
@@ -47,4 +47,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader5.py b/python/tests/reader5.py
index 19d1c3be..6f382519 100755
--- a/python/tests/reader5.py
+++ b/python/tests/reader5.py
@@ -46,4 +46,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader6.py b/python/tests/reader6.py
index 7d293c65..75a6f799 100755
--- a/python/tests/reader6.py
+++ b/python/tests/reader6.py
@@ -125,4 +125,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader7.py b/python/tests/reader7.py
index 8cb7a731..f1735caa 100755
--- a/python/tests/reader7.py
+++ b/python/tests/reader7.py
@@ -98,4 +98,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/reader8.py b/python/tests/reader8.py
index 1e4b7c00..6e0a70ad 100755
--- a/python/tests/reader8.py
+++ b/python/tests/reader8.py
@@ -33,4 +33,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/readererr.py b/python/tests/readererr.py
index 6c9f85ec..9c518215 100755
--- a/python/tests/readererr.py
+++ b/python/tests/readererr.py
@@ -53,4 +53,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/readernext.py b/python/tests/readernext.py
index 112283ee..cf5f0156 100755
--- a/python/tests/readernext.py
+++ b/python/tests/readernext.py
@@ -83,4 +83,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/regexp.py b/python/tests/regexp.py
index ccef3f66..74b4c919 100755
--- a/python/tests/regexp.py
+++ b/python/tests/regexp.py
@@ -29,4 +29,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/relaxng.py b/python/tests/relaxng.py
index 277ac5f5..63b77e09 100755
--- a/python/tests/relaxng.py
+++ b/python/tests/relaxng.py
@@ -44,5 +44,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/resolver.py b/python/tests/resolver.py
index c39edc9f..cb66c6f0 100755
--- a/python/tests/resolver.py
+++ b/python/tests/resolver.py
@@ -40,5 +40,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/schema.py b/python/tests/schema.py
index 28501f8b..de5cd456 100755
--- a/python/tests/schema.py
+++ b/python/tests/schema.py
@@ -48,5 +48,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/serialize.py b/python/tests/serialize.py
index 6c8a94ec..7fea7aaa 100755
--- a/python/tests/serialize.py
+++ b/python/tests/serialize.py
@@ -147,4 +147,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/sync.py b/python/tests/sync.py
index a9a89c7d..29b4a653 100755
--- a/python/tests/sync.py
+++ b/python/tests/sync.py
@@ -135,4 +135,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/thread2.py b/python/tests/thread2.py
index 9a171e9a..4722592c 100755
--- a/python/tests/thread2.py
+++ b/python/tests/thread2.py
@@ -96,4 +96,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/tst.py b/python/tests/tst.py
index d528bf0c..6887cac3 100755
--- a/python/tests/tst.py
+++ b/python/tests/tst.py
@@ -25,4 +25,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py
index ea57e397..45c99f00 100755
--- a/python/tests/tstLastError.py
+++ b/python/tests/tstLastError.py
@@ -15,7 +15,6 @@ class TestCase(unittest.TestCase):
def tearDown(self):
libxml2.cleanupParser()
if libxml2.debugMemory(1) != 0:
- libxml2.dumpMemory()
self.fail("Memory leak %d bytes" % (libxml2.debugMemory(1),))
else:
print("OK")
diff --git a/python/tests/tstURI.py b/python/tests/tstURI.py
index b3ac87b9..04543d7d 100755
--- a/python/tests/tstURI.py
+++ b/python/tests/tstURI.py
@@ -38,4 +38,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/tstmem.py b/python/tests/tstmem.py
index a9dbdea2..70477275 100755
--- a/python/tests/tstmem.py
+++ b/python/tests/tstmem.py
@@ -38,4 +38,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/tstxpath.py b/python/tests/tstxpath.py
index ea490127..45b2833e 100755
--- a/python/tests/tstxpath.py
+++ b/python/tests/tstxpath.py
@@ -60,4 +60,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/validDTD.py b/python/tests/validDTD.py
index 1afb93f5..5d1c9c81 100755
--- a/python/tests/validDTD.py
+++ b/python/tests/validDTD.py
@@ -55,5 +55,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/validRNG.py b/python/tests/validRNG.py
index 0b3d60eb..72978688 100755
--- a/python/tests/validRNG.py
+++ b/python/tests/validRNG.py
@@ -72,5 +72,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/validSchemas.py b/python/tests/validSchemas.py
index b68747dc..f5929100 100755
--- a/python/tests/validSchemas.py
+++ b/python/tests/validSchemas.py
@@ -79,5 +79,4 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/validate.py b/python/tests/validate.py
index afdf0e9f..830b5da3 100755
--- a/python/tests/validate.py
+++ b/python/tests/validate.py
@@ -79,4 +79,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/walker.py b/python/tests/walker.py
index 62b48dc1..99d89135 100755
--- a/python/tests/walker.py
+++ b/python/tests/walker.py
@@ -141,4 +141,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/xpath.py b/python/tests/xpath.py
index 816de8a3..9736bde7 100755
--- a/python/tests/xpath.py
+++ b/python/tests/xpath.py
@@ -48,4 +48,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/xpathext.py b/python/tests/xpathext.py
index 69e1fc95..2506287e 100755
--- a/python/tests/xpathext.py
+++ b/python/tests/xpathext.py
@@ -46,4 +46,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/xpathleak.py b/python/tests/xpathleak.py
index 438c13f5..6814baeb 100755
--- a/python/tests/xpathleak.py
+++ b/python/tests/xpathleak.py
@@ -51,5 +51,3 @@ if leakedbytes == 0:
print("OK")
else:
print("Memory leak", leakedbytes, "bytes")
- # drop file to .memdump file in cwd, but won't work if not compiled in
- libxml2.dumpMemory()
diff --git a/python/tests/xpathns.py b/python/tests/xpathns.py
index a4509052..7fe4235d 100755
--- a/python/tests/xpathns.py
+++ b/python/tests/xpathns.py
@@ -26,4 +26,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/python/tests/xpathret.py b/python/tests/xpathret.py
index 8517c42d..219c2ed3 100755
--- a/python/tests/xpathret.py
+++ b/python/tests/xpathret.py
@@ -54,4 +54,3 @@ if libxml2.debugMemory(1) == 0:
print("OK")
else:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/result/HTML/names.html b/result/HTML/names.html
new file mode 100644
index 00000000..dd7dcc2e
--- /dev/null
+++ b/result/HTML/names.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
+<html>
+<body>
+ <o:p></o:p>
+</body>
+</html>
diff --git a/result/HTML/names.html.err b/result/HTML/names.html.err
new file mode 100644
index 00000000..4d91a5d2
--- /dev/null
+++ b/result/HTML/names.html.err
@@ -0,0 +1,3 @@
+./test/HTML/names.html:3: HTML parser error : Tag o:p invalid
+ <o:p></o:p>
+ ^
diff --git a/result/HTML/names.html.sax b/result/HTML/names.html.sax
new file mode 100644
index 00000000..12a107f8
--- /dev/null
+++ b/result/HTML/names.html.sax
@@ -0,0 +1,20 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(html)
+SAX.characters(
+, 1)
+SAX.startElement(body)
+SAX.characters(
+ , 3)
+SAX.startElement(o:p)
+SAX.error: Tag o:p invalid
+SAX.endElement(o:p)
+SAX.characters(
+, 1)
+SAX.endElement(body)
+SAX.characters(
+, 1)
+SAX.endElement(html)
+SAX.characters(
+, 1)
+SAX.endDocument()
diff --git a/result/VC/ElementValid5.rdr b/result/VC/ElementValid5.rdr
index 899d7591..91eef9c6 100644
--- a/result/VC/ElementValid5.rdr
+++ b/result/VC/ElementValid5.rdr
@@ -4,3 +4,6 @@
./test/VC/ElementValid5:8: element doc: validity error : Element doc content does not follow the DTD, Misplaced b
^
+./test/VC/ElementValid5:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more children
+
+^
diff --git a/result/VC/ElementValid6.rdr b/result/VC/ElementValid6.rdr
index aeafd6be..3b51d1a1 100644
--- a/result/VC/ElementValid6.rdr
+++ b/result/VC/ElementValid6.rdr
@@ -1,6 +1,6 @@
./test/VC/ElementValid6:7: element doc: validity error : Element doc content does not follow the DTD, expecting (a , b? , c+)?, got (a b)
<doc><a/><b>lacks c</b></doc>
^
-./test/VC/ElementValid6:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more child
+./test/VC/ElementValid6:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more children
^
diff --git a/result/VC/ElementValid7.rdr b/result/VC/ElementValid7.rdr
index f001fd21..ecafd1db 100644
--- a/result/VC/ElementValid7.rdr
+++ b/result/VC/ElementValid7.rdr
@@ -1,6 +1,6 @@
./test/VC/ElementValid7:7: element doc: validity error : Element doc content does not follow the DTD, expecting ((a | b)* , c+ , a , b? , c , a?), got (a b a c c a)
<doc><a/><b/><a/><c/><c/><a/></doc>
^
-./test/VC/ElementValid7:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more child
+./test/VC/ElementValid7:8: element doc: validity error : Element doc content does not follow the DTD, Expecting more children
^
diff --git a/result/schemas/579746_0_3.err b/result/schemas/579746_0_3.err
index 5e4c25ea..5b544ba6 100644
--- a/result/schemas/579746_0_3.err
+++ b/result/schemas/579746_0_3.err
@@ -1 +1 @@
-./test/schemas/579746_3.xml:5: element customer: Schemas validity error : Element 'customer': This element is not expected.
+./test/schemas/579746_3.xml:5: Schemas validity error : Element 'customer': This element is not expected.
diff --git a/result/schemas/579746_0_5.err b/result/schemas/579746_0_5.err
index 1e5680d1..e71f94bb 100644
--- a/result/schemas/579746_0_5.err
+++ b/result/schemas/579746_0_5.err
@@ -1 +1 @@
-./test/schemas/579746_5.xml:5: element comment: Schemas validity error : Element 'comment': This element is not expected.
+./test/schemas/579746_5.xml:5: Schemas validity error : Element 'comment': This element is not expected.
diff --git a/result/schemas/579746_1_3.err b/result/schemas/579746_1_3.err
index 5e4c25ea..5b544ba6 100644
--- a/result/schemas/579746_1_3.err
+++ b/result/schemas/579746_1_3.err
@@ -1 +1 @@
-./test/schemas/579746_3.xml:5: element customer: Schemas validity error : Element 'customer': This element is not expected.
+./test/schemas/579746_3.xml:5: Schemas validity error : Element 'customer': This element is not expected.
diff --git a/result/schemas/579746_1_5.err b/result/schemas/579746_1_5.err
index 1e5680d1..e71f94bb 100644
--- a/result/schemas/579746_1_5.err
+++ b/result/schemas/579746_1_5.err
@@ -1 +1 @@
-./test/schemas/579746_5.xml:5: element comment: Schemas validity error : Element 'comment': This element is not expected.
+./test/schemas/579746_5.xml:5: Schemas validity error : Element 'comment': This element is not expected.
diff --git a/result/schemas/all_0_3.err b/result/schemas/all_0_3.err
index 6933fb7b..1d422a5f 100644
--- a/result/schemas/all_0_3.err
+++ b/result/schemas/all_0_3.err
@@ -1 +1 @@
-./test/schemas/all_3.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
+./test/schemas/all_3.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
diff --git a/result/schemas/all_0_4.err b/result/schemas/all_0_4.err
index f846d15c..94065392 100644
--- a/result/schemas/all_0_4.err
+++ b/result/schemas/all_0_4.err
@@ -1 +1 @@
-./test/schemas/all_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b, c ).
+./test/schemas/all_4.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b, c ).
diff --git a/result/schemas/all_0_5.err b/result/schemas/all_0_5.err
index d8ca9a7e..183c3094 100644
--- a/result/schemas/all_0_5.err
+++ b/result/schemas/all_0_5.err
@@ -1 +1 @@
-./test/schemas/all_5.xml:1: element a: Schemas validity error : Element 'a': This element is not expected. Expected is ( c ).
+./test/schemas/all_5.xml:1: Schemas validity error : Element 'a': This element is not expected. Expected is ( c ).
diff --git a/result/schemas/all_0_6.err b/result/schemas/all_0_6.err
index c31d91b8..7a74825e 100644
--- a/result/schemas/all_0_6.err
+++ b/result/schemas/all_0_6.err
@@ -1 +1 @@
-./test/schemas/all_6.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( b, c ).
+./test/schemas/all_6.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( b, c ).
diff --git a/result/schemas/all_0_7.err b/result/schemas/all_0_7.err
index d5c54287..2f4c53f1 100644
--- a/result/schemas/all_0_7.err
+++ b/result/schemas/all_0_7.err
@@ -1 +1 @@
-./test/schemas/all_7.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
+./test/schemas/all_7.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
diff --git a/result/schemas/all_1_3.err b/result/schemas/all_1_3.err
index 6933fb7b..1d422a5f 100644
--- a/result/schemas/all_1_3.err
+++ b/result/schemas/all_1_3.err
@@ -1 +1 @@
-./test/schemas/all_3.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
+./test/schemas/all_3.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
diff --git a/result/schemas/all_1_5.err b/result/schemas/all_1_5.err
index d8ca9a7e..183c3094 100644
--- a/result/schemas/all_1_5.err
+++ b/result/schemas/all_1_5.err
@@ -1 +1 @@
-./test/schemas/all_5.xml:1: element a: Schemas validity error : Element 'a': This element is not expected. Expected is ( c ).
+./test/schemas/all_5.xml:1: Schemas validity error : Element 'a': This element is not expected. Expected is ( c ).
diff --git a/result/schemas/all_1_6.err b/result/schemas/all_1_6.err
index c31d91b8..7a74825e 100644
--- a/result/schemas/all_1_6.err
+++ b/result/schemas/all_1_6.err
@@ -1 +1 @@
-./test/schemas/all_6.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( b, c ).
+./test/schemas/all_6.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( b, c ).
diff --git a/result/schemas/all_1_7.err b/result/schemas/all_1_7.err
index d5c54287..2f4c53f1 100644
--- a/result/schemas/all_1_7.err
+++ b/result/schemas/all_1_7.err
@@ -1 +1 @@
-./test/schemas/all_7.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
+./test/schemas/all_7.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
diff --git a/result/schemas/all_2_0.err b/result/schemas/all_2_0.err
index 6ef8590b..bf439446 100644
--- a/result/schemas/all_2_0.err
+++ b/result/schemas/all_2_0.err
@@ -1 +1 @@
-./test/schemas/all_0.xml:1: element c: Schemas validity error : Element 'c': This element is not expected.
+./test/schemas/all_0.xml:1: Schemas validity error : Element 'c': This element is not expected.
diff --git a/result/schemas/all_2_1.err b/result/schemas/all_2_1.err
index fd8cb482..fc12152e 100644
--- a/result/schemas/all_2_1.err
+++ b/result/schemas/all_2_1.err
@@ -1 +1 @@
-./test/schemas/all_1.xml:1: element c: Schemas validity error : Element 'c': This element is not expected. Expected is ( a ).
+./test/schemas/all_1.xml:1: Schemas validity error : Element 'c': This element is not expected. Expected is ( a ).
diff --git a/result/schemas/all_2_2.err b/result/schemas/all_2_2.err
index 1f044620..8e56a78b 100644
--- a/result/schemas/all_2_2.err
+++ b/result/schemas/all_2_2.err
@@ -1 +1 @@
-./test/schemas/all_2.xml:1: element c: Schemas validity error : Element 'c': This element is not expected.
+./test/schemas/all_2.xml:1: Schemas validity error : Element 'c': This element is not expected.
diff --git a/result/schemas/all_2_4.err b/result/schemas/all_2_4.err
index 31dcf125..717e0428 100644
--- a/result/schemas/all_2_4.err
+++ b/result/schemas/all_2_4.err
@@ -1 +1 @@
-./test/schemas/all_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b ).
+./test/schemas/all_4.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b ).
diff --git a/result/schemas/all_2_5.err b/result/schemas/all_2_5.err
index e859ebd2..42ea79a2 100644
--- a/result/schemas/all_2_5.err
+++ b/result/schemas/all_2_5.err
@@ -1 +1 @@
-./test/schemas/all_5.xml:1: element a: Schemas validity error : Element 'a': This element is not expected.
+./test/schemas/all_5.xml:1: Schemas validity error : Element 'a': This element is not expected.
diff --git a/result/schemas/allsg_0_3.err b/result/schemas/allsg_0_3.err
index 628a3606..57dd594b 100644
--- a/result/schemas/allsg_0_3.err
+++ b/result/schemas/allsg_0_3.err
@@ -1 +1 @@
-./test/schemas/allsg_3.xml:6: element gm-B-1: Schemas validity error : Element '{urn:test:foo}gm-B-1': This element is not expected. Expected is one of ( {urn:test:foo}gh-A, {urn:test:foo}gm-A-1, {urn:test:foo}gm-A-2 ).
+./test/schemas/allsg_3.xml:6: Schemas validity error : Element '{urn:test:foo}gm-B-1': This element is not expected. Expected is one of ( {urn:test:foo}gh-A, {urn:test:foo}gm-A-1, {urn:test:foo}gm-A-2 ).
diff --git a/result/schemas/allsg_0_4.err b/result/schemas/allsg_0_4.err
index e72288d1..558f9846 100644
--- a/result/schemas/allsg_0_4.err
+++ b/result/schemas/allsg_0_4.err
@@ -1 +1 @@
-./test/schemas/allsg_4.xml:6: element gm-A-1: Schemas validity error : Element '{urn:test:foo}gm-A-1': This element is not expected. Expected is one of ( {urn:test:foo}gh-B, {urn:test:foo}gm-B-1, {urn:test:foo}gm-B-2 ).
+./test/schemas/allsg_4.xml:6: Schemas validity error : Element '{urn:test:foo}gm-A-1': This element is not expected. Expected is one of ( {urn:test:foo}gh-B, {urn:test:foo}gm-B-1, {urn:test:foo}gm-B-2 ).
diff --git a/result/schemas/allsg_0_5.err b/result/schemas/allsg_0_5.err
index 26a14461..f428fd64 100644
--- a/result/schemas/allsg_0_5.err
+++ b/result/schemas/allsg_0_5.err
@@ -1 +1 @@
-./test/schemas/allsg_5.xml:7: element gm-B-2: Schemas validity error : Element '{urn:test:foo}gm-B-2': This element is not expected.
+./test/schemas/allsg_5.xml:7: Schemas validity error : Element '{urn:test:foo}gm-B-2': This element is not expected.
diff --git a/result/schemas/any3_0_0.err b/result/schemas/any3_0_0.err
index 49ce5813..ee4ca24b 100644
--- a/result/schemas/any3_0_0.err
+++ b/result/schemas/any3_0_0.err
@@ -1 +1 @@
-./test/schemas/any3_0.xml:12: element bar.A: Schemas validity error : Element 'bar.A': This element is not expected. Expected is ( ##other{http://FOO}* ).
+./test/schemas/any3_0.xml:12: Schemas validity error : Element 'bar.A': This element is not expected. Expected is ( ##other{http://FOO}* ).
diff --git a/result/schemas/any5_0_0.err b/result/schemas/any5_0_0.err
index b69fd575..72b39a9e 100644
--- a/result/schemas/any5_0_0.err
+++ b/result/schemas/any5_0_0.err
@@ -1 +1 @@
-./test/schemas/any5_0.xml:6: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
+./test/schemas/any5_0.xml:6: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
diff --git a/result/schemas/any5_0_1.err b/result/schemas/any5_0_1.err
index 79d7e35b..52c53a84 100644
--- a/result/schemas/any5_0_1.err
+++ b/result/schemas/any5_0_1.err
@@ -1 +1 @@
-./test/schemas/any5_1.xml:11: element boo: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected.
+./test/schemas/any5_1.xml:11: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected.
diff --git a/result/schemas/any5_0_2.err b/result/schemas/any5_0_2.err
index a5bf4c08..cd23a02e 100644
--- a/result/schemas/any5_0_2.err
+++ b/result/schemas/any5_0_2.err
@@ -1 +1 @@
-./test/schemas/any5_2.xml:7: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected.
+./test/schemas/any5_2.xml:7: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected.
diff --git a/result/schemas/any5_0_4.err b/result/schemas/any5_0_4.err
index 74a6bda1..6ec962c0 100644
--- a/result/schemas/any5_0_4.err
+++ b/result/schemas/any5_0_4.err
@@ -1 +1 @@
-./test/schemas/any5_4.xml:11: element boo: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected.
+./test/schemas/any5_4.xml:11: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected.
diff --git a/result/schemas/any5_0_5.err b/result/schemas/any5_0_5.err
index e50113f4..e777721a 100644
--- a/result/schemas/any5_0_5.err
+++ b/result/schemas/any5_0_5.err
@@ -1 +1 @@
-./test/schemas/any5_5.xml:11: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected.
+./test/schemas/any5_5.xml:11: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected.
diff --git a/result/schemas/any5_0_6.err b/result/schemas/any5_0_6.err
index b64cd4fb..4998a4ef 100644
--- a/result/schemas/any5_0_6.err
+++ b/result/schemas/any5_0_6.err
@@ -1 +1 @@
-./test/schemas/any5_6.xml:11: element boo: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected.
+./test/schemas/any5_6.xml:11: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected.
diff --git a/result/schemas/any5_1_0.err b/result/schemas/any5_1_0.err
index b69fd575..72b39a9e 100644
--- a/result/schemas/any5_1_0.err
+++ b/result/schemas/any5_1_0.err
@@ -1 +1 @@
-./test/schemas/any5_0.xml:6: element boo: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
+./test/schemas/any5_0.xml:6: Schemas validity error : Element '{urn:test:foo}boo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
diff --git a/result/schemas/any5_1_1.err b/result/schemas/any5_1_1.err
index bbfccb44..9a17c9ea 100644
--- a/result/schemas/any5_1_1.err
+++ b/result/schemas/any5_1_1.err
@@ -1 +1 @@
-./test/schemas/any5_1.xml:11: element boo: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected. Expected is ( {urn:test:foo}boo ).
+./test/schemas/any5_1.xml:11: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected. Expected is ( {urn:test:foo}boo ).
diff --git a/result/schemas/any5_1_3.err b/result/schemas/any5_1_3.err
index e6c07b28..f823ee37 100644
--- a/result/schemas/any5_1_3.err
+++ b/result/schemas/any5_1_3.err
@@ -1 +1 @@
-./test/schemas/any5_3.xml:4: element foo: Schemas validity error : Element '{urn:test:foo}foo': Missing child element(s).
+./test/schemas/any5_3.xml:4: Schemas validity error : Element '{urn:test:foo}foo': Missing child element(s).
diff --git a/result/schemas/any5_1_4.err b/result/schemas/any5_1_4.err
index 6d89773d..9f02329a 100644
--- a/result/schemas/any5_1_4.err
+++ b/result/schemas/any5_1_4.err
@@ -1 +1 @@
-./test/schemas/any5_4.xml:11: element boo: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected. Expected is ( {urn:test:foo}boo ).
+./test/schemas/any5_4.xml:11: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected. Expected is ( {urn:test:foo}boo ).
diff --git a/result/schemas/any5_1_6.err b/result/schemas/any5_1_6.err
index 8c3f020a..e090bc35 100644
--- a/result/schemas/any5_1_6.err
+++ b/result/schemas/any5_1_6.err
@@ -1 +1 @@
-./test/schemas/any5_6.xml:11: element boo: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected. Expected is ( {urn:test:foo}boo ).
+./test/schemas/any5_6.xml:11: Schemas validity error : Element '{urn:test:bar}boo': This element is not expected. Expected is ( {urn:test:foo}boo ).
diff --git a/result/schemas/any7_1_0.err b/result/schemas/any7_1_0.err
index a4274f89..208c8a6f 100644
--- a/result/schemas/any7_1_0.err
+++ b/result/schemas/any7_1_0.err
@@ -1 +1 @@
-./test/schemas/any7_0.xml:18: element moo: Schemas validity error : Element 'moo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
+./test/schemas/any7_0.xml:18: Schemas validity error : Element 'moo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
diff --git a/result/schemas/any7_1_1.err b/result/schemas/any7_1_1.err
index 8745468a..440d6a58 100644
--- a/result/schemas/any7_1_1.err
+++ b/result/schemas/any7_1_1.err
@@ -1 +1 @@
-./test/schemas/any7_1.xml:17: element bar: Schemas validity error : Element '{urn:test:foo}bar': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
+./test/schemas/any7_1.xml:17: Schemas validity error : Element '{urn:test:foo}bar': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
diff --git a/result/schemas/any7_2_0.err b/result/schemas/any7_2_0.err
index a4274f89..208c8a6f 100644
--- a/result/schemas/any7_2_0.err
+++ b/result/schemas/any7_2_0.err
@@ -1 +1 @@
-./test/schemas/any7_0.xml:18: element moo: Schemas validity error : Element 'moo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
+./test/schemas/any7_0.xml:18: Schemas validity error : Element 'moo': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
diff --git a/result/schemas/any7_2_1.err b/result/schemas/any7_2_1.err
index 8745468a..440d6a58 100644
--- a/result/schemas/any7_2_1.err
+++ b/result/schemas/any7_2_1.err
@@ -1 +1 @@
-./test/schemas/any7_1.xml:17: element bar: Schemas validity error : Element '{urn:test:foo}bar': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
+./test/schemas/any7_1.xml:17: Schemas validity error : Element '{urn:test:foo}bar': This element is not expected. Expected is ( ##other{urn:test:foo}* ).
diff --git a/result/schemas/anyAttr-processContents-err1_0_0.err b/result/schemas/anyAttr-processContents-err1_0_0.err
index dc4766b7..f1a6023b 100644
--- a/result/schemas/anyAttr-processContents-err1_0_0.err
+++ b/result/schemas/anyAttr-processContents-err1_0_0.err
@@ -1,2 +1,2 @@
-./test/schemas/anyAttr-processContents-err1_0.xml:8: element elem.lax: Schemas validity error : Element '{http://FOO}elem.lax', attribute '{http://FOO}bar': 'o o' is not a valid value of the atomic type 'xs:language'.
-./test/schemas/anyAttr-processContents-err1_0.xml:9: element elem.strict: Schemas validity error : Element '{http://FOO}elem.strict', attribute '{http://FOO}barB': No matching global attribute declaration available, but demanded by the strict wildcard.
+./test/schemas/anyAttr-processContents-err1_0.xml:8: Schemas validity error : Element '{http://FOO}elem.lax', attribute '{http://FOO}bar': 'o o' is not a valid value of the atomic type 'xs:language'.
+./test/schemas/anyAttr-processContents-err1_0.xml:9: Schemas validity error : Element '{http://FOO}elem.strict', attribute '{http://FOO}barB': No matching global attribute declaration available, but demanded by the strict wildcard.
diff --git a/result/schemas/attruse_0_1.err b/result/schemas/attruse_0_1.err
index 5dd4fb16..6795f8f2 100644
--- a/result/schemas/attruse_0_1.err
+++ b/result/schemas/attruse_0_1.err
@@ -1 +1 @@
-./test/schemas/attruse_0_1.xml:3: element barA: Schemas validity error : Element 'barA': The attribute 'attr' is required but missing.
+./test/schemas/attruse_0_1.xml:3: Schemas validity error : Element 'barA': The attribute 'attr' is required but missing.
diff --git a/result/schemas/attruse_0_2.err b/result/schemas/attruse_0_2.err
index 01cf822a..d09a2ae9 100644
--- a/result/schemas/attruse_0_2.err
+++ b/result/schemas/attruse_0_2.err
@@ -1 +1 @@
-./test/schemas/attruse_0_2.xml:6: element barC: Schemas validity error : Element 'barC', attribute 'attr': The attribute 'attr' is not allowed.
+./test/schemas/attruse_0_2.xml:6: Schemas validity error : Element 'barC', attribute 'attr': The attribute 'attr' is not allowed.
diff --git a/result/schemas/bug323510_1_0.err b/result/schemas/bug323510_1_0.err
index 1655070c..0488ef81 100644
--- a/result/schemas/bug323510_1_0.err
+++ b/result/schemas/bug323510_1_0.err
@@ -1 +1 @@
-./test/schemas/bug323510_0.xml:2: element foo: Schemas validity error : Element 'foo': Missing child element(s). Expected is ( bar ).
+./test/schemas/bug323510_0.xml:2: Schemas validity error : Element 'foo': Missing child element(s). Expected is ( bar ).
diff --git a/result/schemas/changelog093_1_0.err b/result/schemas/changelog093_1_0.err
index ef0b1ec5..344a156f 100644
--- a/result/schemas/changelog093_1_0.err
+++ b/result/schemas/changelog093_1_0.err
@@ -1 +1 @@
-./test/schemas/changelog093_0.xml:7: element description: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description': Duplicate key-sequence ['PL'] in unique identity-constraint '{http://www.blackperl.com/XML/ChangeLog}changelogDescriptionLangConstraint'.
+./test/schemas/changelog093_0.xml:7: Schemas validity error : Element '{http://www.blackperl.com/XML/ChangeLog}description': Duplicate key-sequence ['PL'] in unique identity-constraint '{http://www.blackperl.com/XML/ChangeLog}changelogDescriptionLangConstraint'.
diff --git a/result/schemas/choice_0_2.err b/result/schemas/choice_0_2.err
index 51414458..37344b1b 100644
--- a/result/schemas/choice_0_2.err
+++ b/result/schemas/choice_0_2.err
@@ -1 +1 @@
-./test/schemas/choice_2.xml:3: element b: Schemas validity error : Element 'b': This element is not expected.
+./test/schemas/choice_2.xml:3: Schemas validity error : Element 'b': This element is not expected.
diff --git a/result/schemas/choice_0_3.err b/result/schemas/choice_0_3.err
index ece5d69f..57d3728a 100644
--- a/result/schemas/choice_0_3.err
+++ b/result/schemas/choice_0_3.err
@@ -1 +1 @@
-./test/schemas/choice_3.xml:3: element a: Schemas validity error : Element 'a': This element is not expected.
+./test/schemas/choice_3.xml:3: Schemas validity error : Element 'a': This element is not expected.
diff --git a/result/schemas/choice_0_4.err b/result/schemas/choice_0_4.err
index 3d3af59f..273f170e 100644
--- a/result/schemas/choice_0_4.err
+++ b/result/schemas/choice_0_4.err
@@ -1 +1 @@
-./test/schemas/choice_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b ).
+./test/schemas/choice_4.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b ).
diff --git a/result/schemas/choice_0_5.err b/result/schemas/choice_0_5.err
index 39d413cd..3a0f40ac 100644
--- a/result/schemas/choice_0_5.err
+++ b/result/schemas/choice_0_5.err
@@ -1 +1 @@
-./test/schemas/choice_5.xml:3: element b: Schemas validity error : Element 'b': This element is not expected.
+./test/schemas/choice_5.xml:3: Schemas validity error : Element 'b': This element is not expected.
diff --git a/result/schemas/choice_0_6.err b/result/schemas/choice_0_6.err
index 414d1e29..270c1fff 100644
--- a/result/schemas/choice_0_6.err
+++ b/result/schemas/choice_0_6.err
@@ -1 +1 @@
-./test/schemas/choice_6.xml:3: element b: Schemas validity error : Element 'b': This element is not expected.
+./test/schemas/choice_6.xml:3: Schemas validity error : Element 'b': This element is not expected.
diff --git a/result/schemas/choice_1_2.err b/result/schemas/choice_1_2.err
index 51414458..37344b1b 100644
--- a/result/schemas/choice_1_2.err
+++ b/result/schemas/choice_1_2.err
@@ -1 +1 @@
-./test/schemas/choice_2.xml:3: element b: Schemas validity error : Element 'b': This element is not expected.
+./test/schemas/choice_2.xml:3: Schemas validity error : Element 'b': This element is not expected.
diff --git a/result/schemas/choice_1_3.err b/result/schemas/choice_1_3.err
index ece5d69f..57d3728a 100644
--- a/result/schemas/choice_1_3.err
+++ b/result/schemas/choice_1_3.err
@@ -1 +1 @@
-./test/schemas/choice_3.xml:3: element a: Schemas validity error : Element 'a': This element is not expected.
+./test/schemas/choice_3.xml:3: Schemas validity error : Element 'a': This element is not expected.
diff --git a/result/schemas/choice_1_5.err b/result/schemas/choice_1_5.err
index 39d413cd..3a0f40ac 100644
--- a/result/schemas/choice_1_5.err
+++ b/result/schemas/choice_1_5.err
@@ -1 +1 @@
-./test/schemas/choice_5.xml:3: element b: Schemas validity error : Element 'b': This element is not expected.
+./test/schemas/choice_5.xml:3: Schemas validity error : Element 'b': This element is not expected.
diff --git a/result/schemas/choice_1_6.err b/result/schemas/choice_1_6.err
index 414d1e29..270c1fff 100644
--- a/result/schemas/choice_1_6.err
+++ b/result/schemas/choice_1_6.err
@@ -1 +1 @@
-./test/schemas/choice_6.xml:3: element b: Schemas validity error : Element 'b': This element is not expected.
+./test/schemas/choice_6.xml:3: Schemas validity error : Element 'b': This element is not expected.
diff --git a/result/schemas/choice_2_4.err b/result/schemas/choice_2_4.err
index 3d3af59f..273f170e 100644
--- a/result/schemas/choice_2_4.err
+++ b/result/schemas/choice_2_4.err
@@ -1 +1 @@
-./test/schemas/choice_4.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b ).
+./test/schemas/choice_4.xml:1: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( a, b ).
diff --git a/result/schemas/choice_2_6.err b/result/schemas/choice_2_6.err
index bef56da0..b6ae4a73 100644
--- a/result/schemas/choice_2_6.err
+++ b/result/schemas/choice_2_6.err
@@ -1 +1 @@
-./test/schemas/choice_6.xml:5: element a: Schemas validity error : Element 'a': This element is not expected.
+./test/schemas/choice_6.xml:5: Schemas validity error : Element 'a': This element is not expected.
diff --git a/result/schemas/cos-st-restricts-1-2-err_0_0.err b/result/schemas/cos-st-restricts-1-2-err_0_0.err
index ccc12b66..32e389b2 100644
--- a/result/schemas/cos-st-restricts-1-2-err_0_0.err
+++ b/result/schemas/cos-st-restricts-1-2-err_0_0.err
@@ -1,2 +1,2 @@
-./test/schemas/cos-st-restricts-1-2-err_0.xml:3: element foo: Schemas validity error : Element '{http://FOO}foo': [facet 'length'] The value has a length of '2'; this differs from the allowed length of '3'.
-./test/schemas/cos-st-restricts-1-2-err_0.xml:3: element foo: Schemas validity error : Element '{http://FOO}foo': '1 2' is not a valid value of the list type '{http://FOO}type.A'.
+./test/schemas/cos-st-restricts-1-2-err_0.xml:3: Schemas validity error : Element '{http://FOO}foo': [facet 'length'] The value has a length of '2'; this differs from the allowed length of '3'.
+./test/schemas/cos-st-restricts-1-2-err_0.xml:3: Schemas validity error : Element '{http://FOO}foo': '1 2' is not a valid value of the list type '{http://FOO}type.A'.
diff --git a/result/schemas/decimal-1_1_0.err b/result/schemas/decimal-1_1_0.err
index 7f4fa9cc..62ca9de1 100644
--- a/result/schemas/decimal-1_1_0.err
+++ b/result/schemas/decimal-1_1_0.err
@@ -1,8 +1,8 @@
-./test/schemas/decimal-1_0.xml:16: element val: Schemas validity error : Element 'val': '.' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:17: element val: Schemas validity error : Element 'val': '-' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:18: element val: Schemas validity error : Element 'val': '+' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:19: element val: Schemas validity error : Element 'val': '*' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:20: element val: Schemas validity error : Element 'val': '- 1' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:21: element val: Schemas validity error : Element 'val': '+ 1' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:22: element val: Schemas validity error : Element 'val': '+ 0' is not a valid value of the atomic type 'myDecimal'.
-./test/schemas/decimal-1_0.xml:23: element val: Schemas validity error : Element 'val': '- 0' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:16: Schemas validity error : Element 'val': '.' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:17: Schemas validity error : Element 'val': '-' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:18: Schemas validity error : Element 'val': '+' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:19: Schemas validity error : Element 'val': '*' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:20: Schemas validity error : Element 'val': '- 1' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:21: Schemas validity error : Element 'val': '+ 1' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:22: Schemas validity error : Element 'val': '+ 0' is not a valid value of the atomic type 'myDecimal'.
+./test/schemas/decimal-1_0.xml:23: Schemas validity error : Element 'val': '- 0' is not a valid value of the atomic type 'myDecimal'.
diff --git a/result/schemas/decimal-2_1_0.err b/result/schemas/decimal-2_1_0.err
index bda17a54..89dcb2d7 100644
--- a/result/schemas/decimal-2_1_0.err
+++ b/result/schemas/decimal-2_1_0.err
@@ -1,2 +1,2 @@
-./test/schemas/decimal-2_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-0.1' is less than the minimum value allowed ('0').
-./test/schemas/decimal-2_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-1' is less than the minimum value allowed ('0').
+./test/schemas/decimal-2_0.xml:12: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-0.1' is less than the minimum value allowed ('0').
+./test/schemas/decimal-2_0.xml:13: Schemas validity error : Element 'val': [facet 'minInclusive'] The value '-1' is less than the minimum value allowed ('0').
diff --git a/result/schemas/decimal-3_1_0.err b/result/schemas/decimal-3_1_0.err
index f37a2009..64be5538 100644
--- a/result/schemas/decimal-3_1_0.err
+++ b/result/schemas/decimal-3_1_0.err
@@ -1,4 +1,4 @@
-./test/schemas/decimal-3_0.xml:12: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.123' has more digits than are allowed ('2').
-./test/schemas/decimal-3_0.xml:13: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.023' has more digits than are allowed ('2').
-./test/schemas/decimal-3_0.xml:14: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '123' has more digits than are allowed ('2').
-./test/schemas/decimal-3_0.xml:15: element val: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '12.3' has more digits than are allowed ('2').
+./test/schemas/decimal-3_0.xml:12: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.123' has more digits than are allowed ('2').
+./test/schemas/decimal-3_0.xml:13: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '0.023' has more digits than are allowed ('2').
+./test/schemas/decimal-3_0.xml:14: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '123' has more digits than are allowed ('2').
+./test/schemas/decimal-3_0.xml:15: Schemas validity error : Element 'val': [facet 'totalDigits'] The value '12.3' has more digits than are allowed ('2').
diff --git a/result/schemas/extension1_0_1.err b/result/schemas/extension1_0_1.err
index bb5b0473..25e93f7d 100644
--- a/result/schemas/extension1_0_1.err
+++ b/result/schemas/extension1_0_1.err
@@ -1 +1 @@
-./test/schemas/extension1_1.xml:1: element title: Schemas validity error : Element 'title', attribute 'langue': The attribute 'langue' is not allowed.
+./test/schemas/extension1_1.xml:1: Schemas validity error : Element 'title', attribute 'langue': The attribute 'langue' is not allowed.
diff --git a/result/schemas/extension1_0_2.err b/result/schemas/extension1_0_2.err
index 161fe9ef..2268f38e 100644
--- a/result/schemas/extension1_0_2.err
+++ b/result/schemas/extension1_0_2.err
@@ -1 +1 @@
-./test/schemas/extension1_2.xml:1: element title: Schemas validity error : Element 'title': Element content is not allowed, because the content type is a simple type definition.
+./test/schemas/extension1_2.xml:1: Schemas validity error : Element 'title': Element content is not allowed, because the content type is a simple type definition.
diff --git a/result/schemas/facet-unionST-err1_0_0.err b/result/schemas/facet-unionST-err1_0_0.err
index 392dbe5b..dbaa113f 100644
--- a/result/schemas/facet-unionST-err1_0_0.err
+++ b/result/schemas/facet-unionST-err1_0_0.err
@@ -1 +1 @@
-./test/schemas/facet-unionST-err1_0.xml:3: element foo: Schemas validity error : Element '{http://FOO}foo': 'tiny' is not a valid value of the union type '{http://FOO}fooType.B'.
+./test/schemas/facet-unionST-err1_0.xml:3: Schemas validity error : Element '{http://FOO}foo': 'tiny' is not a valid value of the union type '{http://FOO}fooType.B'.
diff --git a/result/schemas/hexbinary_0_1.err b/result/schemas/hexbinary_0_1.err
index f43ef338..15ce34d7 100644
--- a/result/schemas/hexbinary_0_1.err
+++ b/result/schemas/hexbinary_0_1.err
@@ -1,7 +1,7 @@
-./test/schemas/hexbinary_1.xml:6: element hex: Schemas validity error : Element 'hex': '0' is not a valid value of the atomic type 'xs:hexBinary'.
-./test/schemas/hexbinary_1.xml:7: element hex: Schemas validity error : Element 'hex': '0123456789ABCDEFGH' is not a valid value of the atomic type 'xs:hexBinary'.
-./test/schemas/hexbinary_1.xml:8: element hex: Schemas validity error : Element 'hex': '+abcdef0123456789' is not a valid value of the atomic type 'xs:hexBinary'.
-./test/schemas/hexbinary_1.xml:9: element hex: Schemas validity error : Element 'hex': '-0123456789abcdef' is not a valid value of the atomic type 'xs:hexBinary'.
-./test/schemas/hexbinary_1.xml:11: element hex2: Schemas validity error : Element 'hex2': [facet 'maxLength'] The value has a length of '9'; this exceeds the allowed maximum length of '8'.
-./test/schemas/hexbinary_1.xml:13: element hex3: Schemas validity error : Element 'hex3': [facet 'length'] The value has a length of '1'; this differs from the allowed length of '2'.
-./test/schemas/hexbinary_1.xml:14: element hex3: Schemas validity error : Element 'hex3': [facet 'length'] The value has a length of '3'; this differs from the allowed length of '2'.
+./test/schemas/hexbinary_1.xml:6: Schemas validity error : Element 'hex': '0' is not a valid value of the atomic type 'xs:hexBinary'.
+./test/schemas/hexbinary_1.xml:7: Schemas validity error : Element 'hex': '0123456789ABCDEFGH' is not a valid value of the atomic type 'xs:hexBinary'.
+./test/schemas/hexbinary_1.xml:8: Schemas validity error : Element 'hex': '+abcdef0123456789' is not a valid value of the atomic type 'xs:hexBinary'.
+./test/schemas/hexbinary_1.xml:9: Schemas validity error : Element 'hex': '-0123456789abcdef' is not a valid value of the atomic type 'xs:hexBinary'.
+./test/schemas/hexbinary_1.xml:11: Schemas validity error : Element 'hex2': [facet 'maxLength'] The value has a length of '9'; this exceeds the allowed maximum length of '8'.
+./test/schemas/hexbinary_1.xml:13: Schemas validity error : Element 'hex3': [facet 'length'] The value has a length of '1'; this differs from the allowed length of '2'.
+./test/schemas/hexbinary_1.xml:14: Schemas validity error : Element 'hex3': [facet 'length'] The value has a length of '3'; this differs from the allowed length of '2'.
diff --git a/result/schemas/issue491_0_0.err b/result/schemas/issue491_0_0.err
new file mode 100644
index 00000000..9b2bb969
--- /dev/null
+++ b/result/schemas/issue491_0_0.err
@@ -0,0 +1 @@
+./test/schemas/issue491_0.xsd:8: element complexType: Schemas parser error : complex type 'ChildType': The content type of both, the type and its base type, must either 'mixed' or 'element-only'.
diff --git a/result/schemas/list0_0_1.err b/result/schemas/list0_0_1.err
index 7a3b63bf..8d25f8ad 100644
--- a/result/schemas/list0_0_1.err
+++ b/result/schemas/list0_0_1.err
@@ -1 +1 @@
-./test/schemas/list0_1.xml:1: element test: Schemas validity error : Element 'test': Missing child element(s). Expected is ( string ).
+./test/schemas/list0_1.xml:1: Schemas validity error : Element 'test': Missing child element(s). Expected is ( string ).
diff --git a/result/schemas/list0_1_0.err b/result/schemas/list0_1_0.err
index 0bc3c8a5..ae915c42 100644
--- a/result/schemas/list0_1_0.err
+++ b/result/schemas/list0_1_0.err
@@ -1 +1 @@
-./test/schemas/list0_0.xml:5: element string: Schemas validity error : Element 'string': This element is not expected.
+./test/schemas/list0_0.xml:5: Schemas validity error : Element 'string': This element is not expected.
diff --git a/result/schemas/list0_1_1.err b/result/schemas/list0_1_1.err
index 7a3b63bf..8d25f8ad 100644
--- a/result/schemas/list0_1_1.err
+++ b/result/schemas/list0_1_1.err
@@ -1 +1 @@
-./test/schemas/list0_1.xml:1: element test: Schemas validity error : Element 'test': Missing child element(s). Expected is ( string ).
+./test/schemas/list0_1.xml:1: Schemas validity error : Element 'test': Missing child element(s). Expected is ( string ).
diff --git a/result/schemas/ns0_0_2.err b/result/schemas/ns0_0_2.err
index 346af267..315553c1 100644
--- a/result/schemas/ns0_0_2.err
+++ b/result/schemas/ns0_0_2.err
@@ -1 +1 @@
-./test/schemas/ns0_2.xml:1: element foo: Schemas validity error : Element 'foo': No matching global declaration available for the validation root.
+./test/schemas/ns0_2.xml:1: Schemas validity error : Element 'foo': No matching global declaration available for the validation root.
diff --git a/result/schemas/ns0_0_3.err b/result/schemas/ns0_0_3.err
index fd1cbd51..7953234c 100644
--- a/result/schemas/ns0_0_3.err
+++ b/result/schemas/ns0_0_3.err
@@ -1 +1 @@
-./test/schemas/ns0_3.xml:1: element foo: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute '{http://example.com/xsd/ns}id': The attribute '{http://example.com/xsd/ns}id' is not allowed.
+./test/schemas/ns0_3.xml:1: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute '{http://example.com/xsd/ns}id': The attribute '{http://example.com/xsd/ns}id' is not allowed.
diff --git a/result/schemas/ns0_0_4.err b/result/schemas/ns0_0_4.err
index 2512e8db..f491e145 100644
--- a/result/schemas/ns0_0_4.err
+++ b/result/schemas/ns0_0_4.err
@@ -1 +1 @@
-./test/schemas/ns0_4.xml:2: element foo: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute '{http://example.com/xsd/ns}id': The attribute '{http://example.com/xsd/ns}id' is not allowed.
+./test/schemas/ns0_4.xml:2: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute '{http://example.com/xsd/ns}id': The attribute '{http://example.com/xsd/ns}id' is not allowed.
diff --git a/result/schemas/ns0_1_0.err b/result/schemas/ns0_1_0.err
index 12828881..3a24c8ca 100644
--- a/result/schemas/ns0_1_0.err
+++ b/result/schemas/ns0_1_0.err
@@ -1 +1 @@
-./test/schemas/ns0_0.xml:1: element foo: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute 'id': The attribute 'id' is not allowed.
+./test/schemas/ns0_0.xml:1: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute 'id': The attribute 'id' is not allowed.
diff --git a/result/schemas/ns0_1_1.err b/result/schemas/ns0_1_1.err
index 99b28800..6c259ad5 100644
--- a/result/schemas/ns0_1_1.err
+++ b/result/schemas/ns0_1_1.err
@@ -1 +1 @@
-./test/schemas/ns0_1.xml:1: element foo: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute 'id': The attribute 'id' is not allowed.
+./test/schemas/ns0_1.xml:1: Schemas validity error : Element '{http://example.com/xsd/ns}foo', attribute 'id': The attribute 'id' is not allowed.
diff --git a/result/schemas/ns0_1_2.err b/result/schemas/ns0_1_2.err
index 346af267..315553c1 100644
--- a/result/schemas/ns0_1_2.err
+++ b/result/schemas/ns0_1_2.err
@@ -1 +1 @@
-./test/schemas/ns0_2.xml:1: element foo: Schemas validity error : Element 'foo': No matching global declaration available for the validation root.
+./test/schemas/ns0_2.xml:1: Schemas validity error : Element 'foo': No matching global declaration available for the validation root.
diff --git a/result/schemas/restriction-enum-1_1_0.err b/result/schemas/restriction-enum-1_1_0.err
index 42dee61a..c6ab50d5 100644
--- a/result/schemas/restriction-enum-1_1_0.err
+++ b/result/schemas/restriction-enum-1_1_0.err
@@ -1 +1 @@
-./test/schemas/restriction-enum-1_0.xml:7: element foo: Schemas validity error : Element 'foo': [facet 'enumeration'] The value 'c' is not an element of the set {'a', 'b', 'd'}.
+./test/schemas/restriction-enum-1_0.xml:7: Schemas validity error : Element 'foo': [facet 'enumeration'] The value 'c' is not an element of the set {'a', 'b', 'd'}.
diff --git a/result/schemas/union2_1_1.err b/result/schemas/union2_1_1.err
index a66ad593..9fffc2cf 100644
--- a/result/schemas/union2_1_1.err
+++ b/result/schemas/union2_1_1.err
@@ -1,3 +1,3 @@
-./test/schemas/union2_1.xml:4: element ELEMENTS: Schemas validity error : Element '{urn:test:foo}ELEMENTS': '
+./test/schemas/union2_1.xml:4: Schemas validity error : Element '{urn:test:foo}ELEMENTS': '
5
' is not a valid value of the local union type.
diff --git a/result/schemas/vdv-first4_0_1.err b/result/schemas/vdv-first4_0_1.err
index 1b964b2c..4a176469 100644
--- a/result/schemas/vdv-first4_0_1.err
+++ b/result/schemas/vdv-first4_0_1.err
@@ -1 +1 @@
-./test/schemas/vdv-first4_1.xml:14: element born: Schemas validity error : Element 'born': '196T6-08-22' is not a valid value of the atomic type 'date'.
+./test/schemas/vdv-first4_1.xml:14: Schemas validity error : Element 'born': '196T6-08-22' is not a valid value of the atomic type 'date'.
diff --git a/result/schemas/vdv-first4_0_2.err b/result/schemas/vdv-first4_0_2.err
index 0a49faac..fe405f76 100644
--- a/result/schemas/vdv-first4_0_2.err
+++ b/result/schemas/vdv-first4_0_2.err
@@ -1 +1 @@
-./test/schemas/vdv-first4_2.xml:24: element born: Schemas validity error : Element 'born': [facet 'pattern'] The value '2000-01-20Z' is not accepted by the pattern '[^:Z]*'.
+./test/schemas/vdv-first4_2.xml:24: Schemas validity error : Element 'born': [facet 'pattern'] The value '2000-01-20Z' is not accepted by the pattern '[^:Z]*'.
diff --git a/result/valid/781333.xml.err.rdr b/result/valid/781333.xml.err.rdr
index 5ff56992..dd9df08f 100644
--- a/result/valid/781333.xml.err.rdr
+++ b/result/valid/781333.xml.err.rdr
@@ -1,6 +1,6 @@
./test/valid/781333.xml:4: element a: validity error : Element a content does not follow the DTD, expecting ( ..., got
<a/>
^
-./test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more child
+./test/valid/781333.xml:5: element a: validity error : Element a content does not follow the DTD, Expecting more children
^
diff --git a/runsuite.c b/runsuite.c
index 0880e0a7..750df2a2 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -522,7 +522,6 @@ xsdTestCase(xmlNodePtr tst) {
if ((mem != xmlMemUsed()) && (extraMemoryFromResolver == 0)) {
test_log("Validation of instance line %ld leaked %d\n",
xmlGetLineNo(tmp), xmlMemUsed() - mem);
- xmlMemoryDump();
nb_leaks++;
}
}
@@ -577,7 +576,6 @@ xsdTestCase(xmlNodePtr tst) {
if ((mem != xmlMemUsed()) && (extraMemoryFromResolver == 0)) {
test_log("Validation of instance line %ld leaked %d\n",
xmlGetLineNo(tmp), xmlMemUsed() - mem);
- xmlMemoryDump();
nb_leaks++;
}
}
@@ -1157,7 +1155,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
}
xmlXPathFreeContext(ctxtXPath);
xmlCleanupParser();
- xmlMemoryDump();
if (logfile != NULL)
fclose(logfile);
diff --git a/runtest.c b/runtest.c
index 80a6c750..d1eced93 100644
--- a/runtest.c
+++ b/runtest.c
@@ -419,7 +419,11 @@ testStructuredErrorHandler(void *ctx ATTRIBUTE_UNUSED, xmlErrorPtr err) {
else if ((line != 0) && (domain == XML_FROM_PARSER))
channel(data, "Entity: line %d: ", line);
}
- if (name != NULL) {
+ /*
+ * Skip element name when testing schemas to make memory and streaming
+ * output match.
+ */
+ if ((domain != XML_FROM_SCHEMASV) && (name != NULL)) {
channel(data, "element %s: ", name);
}
if (code == XML_ERR_OK)
@@ -3396,59 +3400,81 @@ static int
schemasOneTest(const char *sch,
const char *filename,
const char *result,
+ const char *err,
int options,
xmlSchemaPtr schemas) {
- xmlDocPtr doc;
- xmlSchemaValidCtxtPtr ctxt;
int ret = 0;
- int validResult = 0;
+ int i;
char *temp;
- FILE *schemasOutput;
-
- doc = xmlReadFile(filename, NULL, options);
- if (doc == NULL) {
- fprintf(stderr, "failed to parse instance %s for %s\n", filename, sch);
- return(-1);
- }
+ int parseErrorsSize = testErrorsSize;
temp = resultFilename(result, temp_directory, ".res");
if (temp == NULL) {
fprintf(stderr, "Out of memory\n");
fatalError();
- }
- schemasOutput = fopen(temp, "wb");
- if (schemasOutput == NULL) {
- fprintf(stderr, "failed to open output file %s\n", temp);
- xmlFreeDoc(doc);
- free(temp);
- return(-1);
+ return(-1);
}
- ctxt = xmlSchemaNewValidCtxt(schemas);
- xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
- validResult = xmlSchemaValidateDoc(ctxt, doc);
- if (validResult == 0) {
- fprintf(schemasOutput, "%s validates\n", filename);
- } else if (validResult > 0) {
- fprintf(schemasOutput, "%s fails to validate\n", filename);
- } else {
- fprintf(schemasOutput, "%s validation generated an internal error\n",
- filename);
- }
- fclose(schemasOutput);
- if (result) {
- if (compareFiles(temp, result)) {
- fprintf(stderr, "Result for %s on %s failed\n", filename, sch);
- ret = 1;
- }
- }
- if (temp != NULL) {
+ /*
+ * Test both memory and streaming validation.
+ */
+ for (i = 0; i < 2; i++) {
+ xmlSchemaValidCtxtPtr ctxt;
+ int validResult = 0;
+ FILE *schemasOutput;
+
+ testErrorsSize = parseErrorsSize;
+ testErrors[parseErrorsSize] = 0;
+
+ ctxt = xmlSchemaNewValidCtxt(schemas);
+ xmlSchemaSetValidErrors(ctxt, testErrorHandler, testErrorHandler, ctxt);
+
+ schemasOutput = fopen(temp, "wb");
+ if (schemasOutput == NULL) {
+ fprintf(stderr, "failed to open output file %s\n", temp);
+ free(temp);
+ return(-1);
+ }
+
+ if (i == 0) {
+ xmlDocPtr doc;
+
+ doc = xmlReadFile(filename, NULL, options);
+ if (doc == NULL) {
+ fprintf(stderr, "failed to parse instance %s for %s\n", filename, sch);
+ return(-1);
+ }
+ validResult = xmlSchemaValidateDoc(ctxt, doc);
+ xmlFreeDoc(doc);
+ } else {
+ validResult = xmlSchemaValidateFile(ctxt, filename, options);
+ }
+
+ if (validResult == 0) {
+ fprintf(schemasOutput, "%s validates\n", filename);
+ } else if (validResult > 0) {
+ fprintf(schemasOutput, "%s fails to validate\n", filename);
+ } else {
+ fprintf(schemasOutput, "%s validation generated an internal error\n",
+ filename);
+ }
+ fclose(schemasOutput);
+ if (result) {
+ if (compareFiles(temp, result)) {
+ fprintf(stderr, "Result for %s on %s failed\n", filename, sch);
+ ret = 1;
+ }
+ }
+ if (compareFileMem(err, testErrors, testErrorsSize)) {
+ fprintf(stderr, "Error for %s on %s failed\n", filename, sch);
+ ret = 1;
+ }
+
unlink(temp);
- free(temp);
+ xmlSchemaFreeValidCtxt(ctxt);
}
- xmlSchemaFreeValidCtxt(ctxt);
- xmlFreeDoc(doc);
+ free(temp);
return(ret);
}
/**
@@ -3540,15 +3566,11 @@ schemasTest(const char *filename,
}
if (schemas != NULL) {
nb_tests++;
- ret = schemasOneTest(filename, instance, result, options, schemas);
+ ret = schemasOneTest(filename, instance, result, err,
+ options, schemas);
if (ret != 0)
res = ret;
}
- if (compareFileMem(err, testErrors, testErrorsSize)) {
- fprintf(stderr, "Error for %s on %s failed\n", instance,
- filename);
- res = 1;
- }
}
globfree(&globbuf);
xmlSchemaFree(schemas);
@@ -5308,7 +5330,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
nb_tests, nb_errors, nb_leaks);
}
xmlCleanupParser();
- xmlMemoryDump();
return(ret);
}
diff --git a/runxmlconf.c b/runxmlconf.c
index 8df9df13..f440bdc1 100644
--- a/runxmlconf.c
+++ b/runxmlconf.c
@@ -586,7 +586,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
}
xmlXPathFreeContext(ctxtXPath);
xmlCleanupParser();
- xmlMemoryDump();
if (logfile != NULL)
fclose(logfile);
diff --git a/schematron.c b/schematron.c
index c105a758..35a1447e 100644
--- a/schematron.c
+++ b/schematron.c
@@ -2053,7 +2053,6 @@ main(void)
xmlFreeDoc(instance);
xmlCleanupParser();
- xmlMemoryDump();
return (0);
}
diff --git a/test/HTML/names.html b/test/HTML/names.html
new file mode 100644
index 00000000..0dac7a47
--- /dev/null
+++ b/test/HTML/names.html
@@ -0,0 +1,5 @@
+<html>
+<body>
+ <o:p></o:p>
+</body>
+</html>
diff --git a/test/schemas/issue491_0.xml b/test/schemas/issue491_0.xml
new file mode 100644
index 00000000..e2b2fc2e
--- /dev/null
+++ b/test/schemas/issue491_0.xml
@@ -0,0 +1 @@
+<Child xmlns="http://www.test.com">5</Child>
diff --git a/test/schemas/issue491_0.xsd b/test/schemas/issue491_0.xsd
new file mode 100644
index 00000000..81702649
--- /dev/null
+++ b/test/schemas/issue491_0.xsd
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.test.com" targetNamespace="http://www.test.com" elementFormDefault="qualified" attributeFormDefault="unqualified">
+ <xs:complexType name="BaseType">
+ <xs:simpleContent>
+ <xs:extension base="xs:int" />
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="ChildType">
+ <xs:complexContent>
+ <xs:extension base="BaseType">
+ <xs:sequence>
+ <xs:element name="bad" type="xs:int" minOccurs="0" maxOccurs="1"/>
+ </xs:sequence>
+ </xs:extension>
+ </xs:complexContent>
+ </xs:complexType>
+ <xs:element name="Child" type="ChildType" />
+</xs:schema>
diff --git a/testModule.c b/testModule.c
index 6d00596f..45edd9f0 100644
--- a/testModule.c
+++ b/testModule.c
@@ -70,8 +70,6 @@ int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
xmlModuleClose(module);
- xmlMemoryDump();
-
return(0);
}
diff --git a/testOOM.c b/testOOM.c
index 217e04af..3cb6b2da 100644
--- a/testOOM.c
+++ b/testOOM.c
@@ -352,14 +352,12 @@ int main(int argc, char **argv) {
if (test_get_malloc_blocks_outstanding () > 0) {
fprintf (stdout, "%d blocks leaked\n",
test_get_malloc_blocks_outstanding ());
- xmlMemoryDump();
return 1;
}
files ++;
}
}
- xmlMemoryDump();
return 0;
}
diff --git a/testThreads.c b/testThreads.c
index 709ae769..d1535944 100644
--- a/testThreads.c
+++ b/testThreads.c
@@ -135,7 +135,6 @@ main(void)
threadParams[i].filename);
}
xmlCleanupParser();
- xmlMemoryDump();
return (0);
}
#elif defined(_WIN32)
@@ -198,7 +197,6 @@ main(void)
}
xmlCleanupParser();
- xmlMemoryDump();
return (0);
}
diff --git a/testapi.c b/testapi.c
index 12c887f1..1021a208 100644
--- a/testapi.c
+++ b/testapi.c
@@ -174,8 +174,8 @@ int main(int argc, char **argv) {
mem = xmlMemUsed();
if ((blocks != 0) || (mem != 0)) {
printf("testapi leaked %d bytes in %d blocks\n", mem, blocks);
+ ret = 1;
}
- xmlMemoryDump();
return (ret != 0);
}
@@ -25770,23 +25770,23 @@ test_xmlValidateElement(void) {
int n_ctxt;
xmlDocPtr doc; /* a document instance */
int n_doc;
- xmlNodePtr elem; /* an element instance */
- int n_elem;
+ xmlNodePtr root; /* */
+ int n_root;
for (n_ctxt = 0;n_ctxt < gen_nb_xmlValidCtxtPtr;n_ctxt++) {
for (n_doc = 0;n_doc < gen_nb_xmlDocPtr;n_doc++) {
- for (n_elem = 0;n_elem < gen_nb_xmlNodePtr;n_elem++) {
+ for (n_root = 0;n_root < gen_nb_xmlNodePtr;n_root++) {
mem_base = xmlMemBlocks();
ctxt = gen_xmlValidCtxtPtr(n_ctxt, 0);
doc = gen_xmlDocPtr(n_doc, 1);
- elem = gen_xmlNodePtr(n_elem, 2);
+ root = gen_xmlNodePtr(n_root, 2);
- ret_val = xmlValidateElement(ctxt, doc, elem);
+ ret_val = xmlValidateElement(ctxt, doc, root);
desret_int(ret_val);
call_tests++;
des_xmlValidCtxtPtr(n_ctxt, ctxt, 0);
des_xmlDocPtr(n_doc, doc, 1);
- des_xmlNodePtr(n_elem, elem, 2);
+ des_xmlNodePtr(n_root, root, 2);
xmlResetLastError();
if (mem_base != xmlMemBlocks()) {
printf("Leak of %d blocks found in xmlValidateElement",
@@ -25794,7 +25794,7 @@ test_xmlValidateElement(void) {
test_ret++;
printf(" %d", n_ctxt);
printf(" %d", n_doc);
- printf(" %d", n_elem);
+ printf(" %d", n_root);
printf("\n");
}
}
@@ -34695,9 +34695,11 @@ test_xmlSchemaInitTypes(void) {
int test_ret = 0;
#if defined(LIBXML_SCHEMAS_ENABLED)
+ int ret_val;
- xmlSchemaInitTypes();
+ ret_val = xmlSchemaInitTypes();
+ desret_int(ret_val);
call_tests++;
xmlResetLastError();
function_tests++;
diff --git a/testchar.c b/testchar.c
index b612cbdb..e7c4f78f 100644
--- a/testchar.c
+++ b/testchar.c
@@ -5,6 +5,8 @@
* copy: see Copyright for the status of this software.
*/
+#define XML_DEPRECATED
+
#include <stdio.h>
#include <string.h>
#include <libxml/tree.h>
@@ -654,6 +656,63 @@ error:
return(test_ret);
}
+static int
+testUserEncoding(void) {
+ /*
+ * Create a document encoded as UTF-16LE with an ISO-8859-1 encoding
+ * declaration, then parse it with xmlReadMemory and the encoding
+ * argument set to UTF-16LE.
+ */
+ xmlDocPtr doc = NULL;
+ const char *start = "<?xml version='1.0' encoding='ISO-8859-1'?><d>";
+ const char *end = "</d>";
+ char *buf = NULL;
+ xmlChar *text;
+ int startSize = strlen(start);
+ int textSize = 100000; /* Make sure to exceed internal buffer sizes. */
+ int endSize = strlen(end);
+ int totalSize = startSize + textSize + endSize;
+ int k = 0;
+ int i;
+ int ret = 1;
+
+ buf = xmlMalloc(2 * totalSize);
+ for (i = 0; start[i] != 0; i++) {
+ buf[k++] = start[i];
+ buf[k++] = 0;
+ }
+ for (i = 0; i < textSize; i++) {
+ buf[k++] = 'x';
+ buf[k++] = 0;
+ }
+ for (i = 0; end[i] != 0; i++) {
+ buf[k++] = end[i];
+ buf[k++] = 0;
+ }
+
+ doc = xmlReadMemory(buf, 2 * totalSize, NULL, "UTF-16LE", 0);
+ if (doc == NULL) {
+ fprintf(stderr, "failed to parse document\n");
+ goto error;
+ }
+
+ text = doc->children->children->content;
+ for (i = 0; i < textSize; i++) {
+ if (text[i] != 'x') {
+ fprintf(stderr, "text node has wrong content at offset %d\n", k);
+ goto error;
+ }
+ }
+
+ ret = 0;
+
+error:
+ xmlFreeDoc(doc);
+ xmlFree(buf);
+
+ return ret;
+}
+
int main(void) {
int ret = 0;
@@ -676,14 +735,11 @@ int main(void) {
*/
ret += testCharRanges();
ret += testDocumentRanges();
+ ret += testUserEncoding();
/*
* Cleanup function for the XML library.
*/
xmlCleanupParser();
- /*
- * this is to debug memory for regression tests
- */
- xmlMemoryDump();
return(ret ? 1 : 0);
}
diff --git a/testdict.c b/testdict.c
index 4d745525..cad516fc 100644
--- a/testdict.c
+++ b/testdict.c
@@ -441,6 +441,5 @@ int main(void)
}
clean_strings();
xmlCleanupParser();
- xmlMemoryDump();
return(ret);
}
diff --git a/testlimits.c b/testlimits.c
index 0680f95b..5400bd80 100644
--- a/testlimits.c
+++ b/testlimits.c
@@ -1622,7 +1622,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
nb_tests, nb_errors, nb_leaks);
}
xmlCleanupParser();
- xmlMemoryDump();
return(ret);
}
diff --git a/testrecurse.c b/testrecurse.c
index a70ca34a..d0a4ed24 100644
--- a/testrecurse.c
+++ b/testrecurse.c
@@ -1208,7 +1208,6 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
nb_tests, nb_errors, nb_leaks);
}
xmlCleanupParser();
- xmlMemoryDump();
return(ret);
}
diff --git a/valid.c b/valid.c
index 4352a08b..479fa628 100644
--- a/valid.c
+++ b/valid.c
@@ -5999,11 +5999,12 @@ xmlValidatePopElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc ATTRIBUTE_UNUSED,
if (elemDecl->etype == XML_ELEMENT_TYPE_ELEMENT) {
if (state->exec != NULL) {
ret = xmlRegExecPushString(state->exec, NULL, NULL);
- if (ret == 0) {
+ if (ret <= 0) {
xmlErrValidNode(ctxt, state->node,
XML_DTD_CONTENT_MODEL,
- "Element %s content does not follow the DTD, Expecting more child\n",
+ "Element %s content does not follow the DTD, Expecting more children\n",
state->node->name, NULL,NULL);
+ ret = 0;
} else {
/*
* previous validation errors should not generate
@@ -6467,60 +6468,60 @@ name_ok:
*/
int
-xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr elem) {
- xmlNodePtr child;
+xmlValidateElement(xmlValidCtxtPtr ctxt, xmlDocPtr doc, xmlNodePtr root) {
+ xmlNodePtr elem;
xmlAttrPtr attr;
xmlNsPtr ns;
const xmlChar *value;
int ret = 1;
- if (elem == NULL) return(0);
-
- /*
- * XInclude elements were added after parsing in the infoset,
- * they don't really mean anything validation wise.
- */
- if ((elem->type == XML_XINCLUDE_START) ||
- (elem->type == XML_XINCLUDE_END) ||
- (elem->type == XML_NAMESPACE_DECL))
- return(1);
+ if (root == NULL) return(0);
CHECK_DTD;
- /*
- * Entities references have to be handled separately
- */
- if (elem->type == XML_ENTITY_REF_NODE) {
- return(1);
- }
+ elem = root;
+ while (1) {
+ ret &= xmlValidateOneElement(ctxt, doc, elem);
+
+ if (elem->type == XML_ELEMENT_NODE) {
+ attr = elem->properties;
+ while (attr != NULL) {
+ value = xmlNodeListGetString(doc, attr->children, 0);
+ ret &= xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
+ if (value != NULL)
+ xmlFree((char *)value);
+ attr= attr->next;
+ }
- ret &= xmlValidateOneElement(ctxt, doc, elem);
- if (elem->type == XML_ELEMENT_NODE) {
- attr = elem->properties;
- while (attr != NULL) {
- value = xmlNodeListGetString(doc, attr->children, 0);
- ret &= xmlValidateOneAttribute(ctxt, doc, elem, attr, value);
- if (value != NULL)
- xmlFree((char *)value);
- attr= attr->next;
- }
- ns = elem->nsDef;
- while (ns != NULL) {
- if (elem->ns == NULL)
- ret &= xmlValidateOneNamespace(ctxt, doc, elem, NULL,
- ns, ns->href);
- else
- ret &= xmlValidateOneNamespace(ctxt, doc, elem,
- elem->ns->prefix, ns, ns->href);
- ns = ns->next;
- }
- }
- child = elem->children;
- while (child != NULL) {
- ret &= xmlValidateElement(ctxt, doc, child);
- child = child->next;
+ ns = elem->nsDef;
+ while (ns != NULL) {
+ if (elem->ns == NULL)
+ ret &= xmlValidateOneNamespace(ctxt, doc, elem, NULL,
+ ns, ns->href);
+ else
+ ret &= xmlValidateOneNamespace(ctxt, doc, elem,
+ elem->ns->prefix, ns,
+ ns->href);
+ ns = ns->next;
+ }
+
+ if (elem->children != NULL) {
+ elem = elem->children;
+ continue;
+ }
+ }
+
+ while (1) {
+ if (elem == root)
+ goto done;
+ if (elem->next != NULL)
+ break;
+ elem = elem->parent;
+ }
+ elem = elem->next;
}
+done:
return(ret);
}
diff --git a/xmlIO.c b/xmlIO.c
index 5cab16f4..9fd9c780 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -211,6 +211,7 @@ __xmlIOWin32UTF8ToWChar(const char *u8String)
}
#endif
+#if defined(LIBXML_HTTP_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
/**
* xmlIOErrMemory:
* @extra: extra information
@@ -222,6 +223,7 @@ xmlIOErrMemory(const char *extra)
{
__xmlSimpleError(XML_FROM_IO, XML_ERR_NO_MEMORY, NULL, NULL, extra);
}
+#endif
/**
* __xmlIOErr:
@@ -2325,7 +2327,6 @@ xmlAllocParserInputBuffer(xmlCharEncoding enc) {
ret = (xmlParserInputBufferPtr) xmlMalloc(sizeof(xmlParserInputBuffer));
if (ret == NULL) {
- xmlIOErrMemory("creating input buffer");
return(NULL);
}
memset(ret, 0, sizeof(xmlParserInputBuffer));
@@ -2364,7 +2365,6 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) {
ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
if (ret == NULL) {
- xmlIOErrMemory("creating output buffer");
return(NULL);
}
memset(ret, 0, sizeof(xmlOutputBuffer));
@@ -2412,7 +2412,6 @@ xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder) {
ret = (xmlOutputBufferPtr) xmlMalloc(sizeof(xmlOutputBuffer));
if (ret == NULL) {
- xmlIOErrMemory("creating output buffer");
return(NULL);
}
memset(ret, 0, sizeof(xmlOutputBuffer));
@@ -3119,21 +3118,24 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
*/
if (in->raw == NULL) {
in->raw = xmlBufCreate();
+ if (in->raw == NULL) {
+ in->error = XML_ERR_NO_MEMORY;
+ return(-1);
+ }
}
ret = xmlBufAdd(in->raw, (const xmlChar *) buf, len);
- if (ret != 0)
+ if (ret != 0) {
+ in->error = XML_ERR_NO_MEMORY;
return(-1);
+ }
/*
* convert as much as possible to the parser reading buffer.
*/
use = xmlBufUse(in->raw);
nbchars = xmlCharEncInput(in, 1);
- if (nbchars < 0) {
- xmlIOErr(XML_IO_ENCODER, NULL);
- in->error = XML_IO_ENCODER;
+ if (nbchars < 0)
return(-1);
- }
consumed = use - xmlBufUse(in->raw);
if ((consumed > ULONG_MAX) ||
(in->rawconsumed > ULONG_MAX - (unsigned long)consumed))
@@ -3143,8 +3145,10 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
} else {
nbchars = len;
ret = xmlBufAdd(in->buffer, (xmlChar *) buf, nbchars);
- if (ret != 0)
+ if (ret != 0) {
+ in->error = XML_ERR_NO_MEMORY;
return(-1);
+ }
}
#ifdef DEBUG_INPUT
xmlGenericError(xmlGenericErrorContext,
@@ -3207,7 +3211,6 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
*/
if (in->readcallback != NULL) {
if (xmlBufGrow(buf, len + 1) < 0) {
- xmlIOErrMemory("growing input buffer");
in->error = XML_ERR_NO_MEMORY;
return(-1);
}
@@ -3215,11 +3218,15 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
res = in->readcallback(in->context, (char *)xmlBufEnd(buf), len);
if (res <= 0)
in->readcallback = endOfInput;
- if (res < 0)
+ if (res < 0) {
+ in->error = XML_IO_UNKNOWN;
return(-1);
+ }
- if (xmlBufAddLen(buf, res) < 0)
+ if (xmlBufAddLen(buf, res) < 0) {
+ in->error = XML_ERR_NO_MEMORY;
return(-1);
+ }
}
/*
@@ -3240,11 +3247,8 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
*/
use = xmlBufUse(buf);
res = xmlCharEncInput(in, 1);
- if (res < 0) {
- xmlIOErr(XML_IO_ENCODER, NULL);
- in->error = XML_IO_ENCODER;
+ if (res < 0)
return(-1);
- }
consumed = use - xmlBufUse(buf);
if ((consumed > ULONG_MAX) ||
(in->rawconsumed > ULONG_MAX - (unsigned long)consumed))
@@ -4006,7 +4010,7 @@ xmlLoadExternalEntity(const char *URL, const char *ID,
canonicFilename = (char *) xmlCanonicPath((const xmlChar *) URL);
if (canonicFilename == NULL) {
- xmlIOErrMemory("building canonical path\n");
+ xmlErrMemory(ctxt, "building canonical path\n");
return(NULL);
}
diff --git a/xmlcatalog.c b/xmlcatalog.c
index 60ff0019..ee5fc3c7 100644
--- a/xmlcatalog.c
+++ b/xmlcatalog.c
@@ -598,7 +598,6 @@ int main(int argc, char **argv) {
* Cleanup and check for memory leaks
*/
xmlCleanupParser();
- xmlMemoryDump();
return(exit_value);
}
#else
diff --git a/xmllint.c b/xmllint.c
index 2f0ada1f..2368a85f 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -14,6 +14,8 @@
#include <stdlib.h>
#include <assert.h>
#include <time.h>
+#include <errno.h>
+#include <limits.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
@@ -352,17 +354,14 @@ myMallocFunc(size_t size)
static void *
myReallocFunc(void *mem, size_t size)
{
- void *ret;
+ size_t oldsize = xmlMemSize(mem);
- ret = xmlMemRealloc(mem, size);
- if (ret != NULL) {
- if (xmlMemUsed() > maxmem) {
- OOM();
- xmlMemFree(ret);
- return (NULL);
- }
+ if (xmlMemUsed() + size - oldsize > (size_t) maxmem) {
+ OOM();
+ return (NULL);
}
- return (ret);
+
+ return (xmlMemRealloc(mem, size));
}
static char *
myStrdupFunc(const char *str)
@@ -1785,15 +1784,6 @@ static void streamFile(char *filename) {
#endif
reader = xmlReaderForFile(filename, NULL, options);
#ifdef LIBXML_PATTERN_ENABLED
- if (pattern != NULL) {
- patternc = xmlPatterncompile((const xmlChar *) pattern, NULL, 0, NULL);
- if (patternc == NULL) {
- xmlGenericError(xmlGenericErrorContext,
- "Pattern %s failed to compile\n", pattern);
- progresult = XMLLINT_ERR_SCHEMAPAT;
- pattern = NULL;
- }
- }
if (patternc != NULL) {
patstream = xmlPatternGetStreamCtxt(patternc);
if (patstream != NULL) {
@@ -3097,10 +3087,25 @@ main(int argc, char **argv) {
if ((!strcmp(argv[i], "-maxmem")) ||
(!strcmp(argv[i], "--maxmem"))) {
- i++;
- if ((i >= argc) || (sscanf(argv[i], "%d", &maxmem) != 1)) {
- maxmem = 0;
- }
+ char *val_end;
+ long val;
+
+ i++;
+ if (i >= argc) {
+ fprintf(stderr, "maxmem: missing integer value\n");
+ return(XMLLINT_ERR_UNCLASS);
+ }
+ errno = 0;
+ val = strtol(argv[i], &val_end, 10);
+ if (errno == EINVAL || *val_end != 0) {
+ fprintf(stderr, "maxmem: invalid integer: %s\n", argv[i]);
+ return(XMLLINT_ERR_UNCLASS);
+ }
+ if (errno != 0 || val < 0 || val > INT_MAX) {
+ fprintf(stderr, "maxmem: integer out of range: %s\n", argv[i]);
+ return(XMLLINT_ERR_UNCLASS);
+ }
+ maxmem = val;
}
}
if (maxmem != 0)
@@ -3748,7 +3753,6 @@ main(int argc, char **argv) {
error:
xmlCleanupParser();
- xmlMemoryDump();
return(progresult);
}
diff --git a/xmlmemory.c b/xmlmemory.c
index eed16669..c399cbb0 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -160,7 +160,6 @@ xmlMallocLoc(size_t size, const char * file, int line)
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
xmlGenericError(xmlGenericErrorContext,
"xmlMallocLoc : Unsigned overflow\n");
- xmlMemoryDump();
return(NULL);
}
@@ -169,7 +168,6 @@ xmlMallocLoc(size_t size, const char * file, int line)
if (!p) {
xmlGenericError(xmlGenericErrorContext,
"xmlMallocLoc : Out of free space\n");
- xmlMemoryDump();
return(NULL);
}
p->mh_tag = MEMTAG;
@@ -236,7 +234,6 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
xmlGenericError(xmlGenericErrorContext,
"xmlMallocAtomicLoc : Unsigned overflow\n");
- xmlMemoryDump();
return(NULL);
}
@@ -245,7 +242,6 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
if (!p) {
xmlGenericError(xmlGenericErrorContext,
"xmlMallocAtomicLoc : Out of free space\n");
- xmlMemoryDump();
return(NULL);
}
p->mh_tag = MEMTAG;
@@ -347,7 +343,6 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
xmlGenericError(xmlGenericErrorContext,
"xmlReallocLoc : Unsigned overflow\n");
- xmlMemoryDump();
return(NULL);
}
@@ -501,7 +496,6 @@ xmlMemStrdupLoc(const char *str, const char *file, int line)
if (size > (MAX_SIZE_T - RESERVE_SIZE)) {
xmlGenericError(xmlGenericErrorContext,
"xmlMemStrdupLoc : Unsigned overflow\n");
- xmlMemoryDump();
return(NULL);
}
@@ -559,6 +553,27 @@ xmlMemoryStrdup(const char *str) {
}
/**
+ * xmlMemSize:
+ * @ptr: pointer to the memory allocation
+ *
+ * Returns the size of a memory allocation.
+ */
+
+size_t
+xmlMemSize(void *ptr) {
+ MEMHDR *p;
+
+ if (ptr == NULL)
+ return(0);
+
+ p = CLIENT_2_HDR(ptr);
+ if (p->mh_tag != MEMTAG)
+ return(0);
+
+ return(p->mh_size);
+}
+
+/**
* xmlMemUsed:
*
* Provides the amount of memory currently allocated
diff --git a/xmlreader.c b/xmlreader.c
index 979385a1..71f2f933 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -788,6 +788,8 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
reader->state = oldstate;
}
} else if (val < 0) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlParserInputBufferRead failed\n");
reader->mode = XML_TEXTREADER_MODE_EOF;
reader->state = oldstate;
if ((oldstate != XML_TEXTREADER_START) ||
diff --git a/xmlregexp.c b/xmlregexp.c
index 5638ddc6..5e35faa7 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -600,7 +600,7 @@ xmlRegEpxFromParse(xmlRegParserCtxtPtr ctxt) {
for (j = 0;j < state->nbTrans;j++) {
trans = &(state->trans[j]);
- if ((trans->to == -1) || (trans->atom == NULL))
+ if ((trans->to < 0) || (trans->atom == NULL))
continue;
atomno = stringRemap[trans->atom->no];
if ((trans->atom->data != NULL) && (transdata == NULL)) {
@@ -1821,50 +1821,66 @@ xmlFAReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int fromnr,
from->type = XML_REGEXP_FINAL_STATE;
}
for (transnr = 0;transnr < to->nbTrans;transnr++) {
- if (to->trans[transnr].to < 0)
+ xmlRegTransPtr t1 = &to->trans[transnr];
+ int tcounter;
+
+ if (t1->to < 0)
continue;
- if (to->trans[transnr].atom == NULL) {
+ if (t1->counter >= 0) {
+ /* assert(counter < 0); */
+ tcounter = t1->counter;
+ } else {
+ tcounter = counter;
+ }
+ if (t1->atom == NULL) {
/*
* Don't remove counted transitions
* Don't loop either
*/
- if (to->trans[transnr].to != fromnr) {
- if (to->trans[transnr].count >= 0) {
- int newto = to->trans[transnr].to;
-
- xmlRegStateAddTrans(ctxt, from, NULL,
- ctxt->states[newto],
- -1, to->trans[transnr].count);
+ if (t1->to != fromnr) {
+ if (t1->count >= 0) {
+ xmlRegStateAddTrans(ctxt, from, NULL, ctxt->states[t1->to],
+ -1, t1->count);
} else {
#ifdef DEBUG_REGEXP_GRAPH
printf("Found epsilon trans %d from %d to %d\n",
- transnr, tonr, to->trans[transnr].to);
+ transnr, tonr, t1->to);
#endif
- if (to->trans[transnr].counter >= 0) {
- xmlFAReduceEpsilonTransitions(ctxt, fromnr,
- to->trans[transnr].to,
- to->trans[transnr].counter);
- } else {
- xmlFAReduceEpsilonTransitions(ctxt, fromnr,
- to->trans[transnr].to,
- counter);
- }
+ xmlFAReduceEpsilonTransitions(ctxt, fromnr, t1->to,
+ tcounter);
}
}
} else {
- int newto = to->trans[transnr].to;
-
- if (to->trans[transnr].counter >= 0) {
- xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom,
- ctxt->states[newto],
- to->trans[transnr].counter, -1);
- } else {
- xmlRegStateAddTrans(ctxt, from, to->trans[transnr].atom,
- ctxt->states[newto], counter, -1);
- }
+ xmlRegStateAddTrans(ctxt, from, t1->atom,
+ ctxt->states[t1->to], tcounter, -1);
}
}
+}
+
+/**
+ * xmlFAFinishReduceEpsilonTransitions:
+ * @ctxt: a regexp parser context
+ * @fromnr: the from state
+ * @tonr: the to state
+ * @counter: should that transition be associated to a counted
+ *
+ */
+static void
+xmlFAFinishReduceEpsilonTransitions(xmlRegParserCtxtPtr ctxt, int tonr) {
+ int transnr;
+ xmlRegStatePtr to;
+
+ to = ctxt->states[tonr];
+ if ((to->mark == XML_REGEXP_MARK_START) ||
+ (to->mark == XML_REGEXP_MARK_NORMAL))
+ return;
+
to->mark = XML_REGEXP_MARK_NORMAL;
+ for (transnr = 0;transnr < to->nbTrans;transnr++) {
+ xmlRegTransPtr t1 = &to->trans[transnr];
+ if ((t1->to >= 0) && (t1->atom == NULL))
+ xmlFAFinishReduceEpsilonTransitions(ctxt, t1->to);
+ }
}
/**
@@ -2016,6 +2032,7 @@ xmlFAEliminateEpsilonTransitions(xmlRegParserCtxtPtr ctxt) {
state->mark = XML_REGEXP_MARK_START;
xmlFAReduceEpsilonTransitions(ctxt, statenr,
newto, state->trans[transnr].counter);
+ xmlFAFinishReduceEpsilonTransitions(ctxt, newto);
state->mark = XML_REGEXP_MARK_NORMAL;
#ifdef DEBUG_REGEXP_GRAPH
} else {
@@ -2623,7 +2640,7 @@ not_determinist:
*/
static int
xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
- int to, xmlRegAtomPtr atom) {
+ int fromnr, int tonr, xmlRegAtomPtr atom) {
int ret = 1;
int res;
int transnr, nbTrans;
@@ -2648,21 +2665,23 @@ xmlFARecurseDeterminism(xmlRegParserCtxtPtr ctxt, xmlRegStatePtr state,
/*
* check transitions conflicting with the one looked at
*/
+ if ((t1->to < 0) || (t1->to == fromnr))
+ continue;
if (t1->atom == NULL) {
- if (t1->to < 0)
- continue;
state->markd = XML_REGEXP_MARK_VISITED;
res = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
- to, atom);
+ fromnr, tonr, atom);
if (res == 0) {
ret = 0;
/* t1->nd = 1; */
}
continue;
}
- if (t1->to != to)
- continue;
if (xmlFACompareAtoms(t1->atom, atom, deep)) {
+ /* Treat equal transitions as deterministic. */
+ if ((t1->to != tonr) ||
+ (!xmlFAEqualAtoms(t1->atom, atom, deep)))
+ ret = 0;
ret = 0;
/* mark the transition as non-deterministic */
t1->nd = 1;
@@ -2741,11 +2760,11 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
/* t1->nd = 1; */
continue;
}
- if (t1->to == -1) /* eliminated */
+ if (t1->to < 0) /* eliminated */
continue;
for (i = 0;i < transnr;i++) {
t2 = &(state->trans[i]);
- if (t2->to == -1) /* eliminated */
+ if (t2->to < 0) /* eliminated */
continue;
if (t2->atom != NULL) {
if (t1->to == t2->to) {
@@ -2783,11 +2802,11 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
if (t1->atom == NULL) {
continue;
}
- if (t1->to == -1) /* eliminated */
+ if (t1->to < 0) /* eliminated */
continue;
for (i = 0;i < transnr;i++) {
t2 = &(state->trans[i]);
- if (t2->to == -1) /* eliminated */
+ if (t2->to < 0) /* eliminated */
continue;
if (t2->atom != NULL) {
/*
@@ -2795,29 +2814,39 @@ xmlFAComputesDeterminism(xmlRegParserCtxtPtr ctxt) {
* find transitions which indicate a conflict
*/
if (xmlFACompareAtoms(t1->atom, t2->atom, 1)) {
- ret = 0;
+ /*
+ * Treat equal counter transitions that couldn't be
+ * eliminated as deterministic.
+ */
+ if ((t1->to != t2->to) ||
+ (t1->counter == t2->counter) ||
+ (!xmlFAEqualAtoms(t1->atom, t2->atom, deep)))
+ ret = 0;
/* mark the transitions as non-deterministic ones */
t1->nd = 1;
t2->nd = 1;
last = t1;
}
- } else if (t1->to != -1) {
+ } else {
+ int res;
+
/*
* do the closure in case of remaining specific
* epsilon transitions like choices or all
*/
- ret = xmlFARecurseDeterminism(ctxt, ctxt->states[t1->to],
- t2->to, t2->atom);
- xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t1->to]);
+ res = xmlFARecurseDeterminism(ctxt, ctxt->states[t2->to],
+ statenr, t1->to, t1->atom);
+ xmlFAFinishRecurseDeterminism(ctxt, ctxt->states[t2->to]);
/* don't shortcut the computation so all non deterministic
transition get marked down
if (ret == 0)
return(0);
*/
- if (ret == 0) {
+ if (res == 0) {
t1->nd = 1;
/* t2->nd = 1; */
last = t1;
+ ret = 0;
}
}
}
diff --git a/xmlschemas.c b/xmlschemas.c
index 65c9123c..ddf4c6b9 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -2143,8 +2143,14 @@ xmlSchemaErr4Line(xmlSchemaAbstractCtxtPtr ctxt,
(vctxt->parserCtxt != NULL) &&
(vctxt->parserCtxt->input != NULL)) {
file = vctxt->parserCtxt->input->filename;
- line = vctxt->parserCtxt->input->line;
- col = vctxt->parserCtxt->input->col;
+ if (vctxt->inode != NULL) {
+ line = vctxt->inode->nodeLine;
+ col = 0;
+ } else {
+ /* This is inaccurate. */
+ line = vctxt->parserCtxt->input->line;
+ col = vctxt->parserCtxt->input->col;
+ }
}
} else {
/*
@@ -18632,7 +18638,7 @@ xmlSchemaFixupComplexType(xmlSchemaParserCtxtPtr pctxt,
"allowed to appear inside other model groups",
NULL, NULL);
- } else if (! dummySequence) {
+ } else if ((!dummySequence) && (baseType->subtypes != NULL)) {
xmlSchemaTreeItemPtr effectiveContent =
(xmlSchemaTreeItemPtr) type->subtypes;
/*
@@ -21457,7 +21463,8 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
* the API; i.e. not automatically by the validated instance document.
*/
- xmlSchemaInitTypes();
+ if (xmlSchemaInitTypes() < 0)
+ return (NULL);
if (ctxt == NULL)
return (NULL);
@@ -29067,6 +29074,55 @@ xmlSchemaValidateStreamLocator(void *ctx, const char **file,
}
/**
+ * xmlSchemaValidateStreamInternal:
+ * @ctxt: a schema validation context
+ * @pctxt: a parser context
+ *
+ * Returns 0 if the document is schemas valid, a positive error code
+ * number otherwise and -1 in case of internal or API error.
+ */
+static int
+xmlSchemaValidateStreamInternal(xmlSchemaValidCtxtPtr ctxt,
+ xmlParserCtxtPtr pctxt) {
+ xmlSchemaSAXPlugPtr plug = NULL;
+ int ret;
+
+ pctxt->linenumbers = 1;
+ xmlSchemaValidateSetLocator(ctxt, xmlSchemaValidateStreamLocator, pctxt);
+
+ ctxt->parserCtxt = pctxt;
+ ctxt->input = pctxt->input->buf;
+
+ /*
+ * Plug the validation and launch the parsing
+ */
+ plug = xmlSchemaSAXPlug(ctxt, &(pctxt->sax), &(pctxt->userData));
+ if (plug == NULL) {
+ ret = -1;
+ goto done;
+ }
+ ctxt->input = pctxt->input->buf;
+ ctxt->sax = pctxt->sax;
+ ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
+ ret = xmlSchemaVStart(ctxt);
+
+ if ((ret == 0) && (! ctxt->parserCtxt->wellFormed)) {
+ ret = ctxt->parserCtxt->errNo;
+ if (ret == 0)
+ ret = 1;
+ }
+
+done:
+ ctxt->parserCtxt = NULL;
+ ctxt->sax = NULL;
+ ctxt->input = NULL;
+ if (plug != NULL) {
+ xmlSchemaSAXUnplug(plug);
+ }
+ return (ret);
+}
+
+/**
* xmlSchemaValidateStream:
* @ctxt: a schema validation context
* @input: the input to use for reading the data
@@ -29086,7 +29142,6 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
xmlParserInputBufferPtr input, xmlCharEncoding enc,
xmlSAXHandlerPtr sax, void *user_data)
{
- xmlSchemaSAXPlugPtr plug = NULL;
xmlParserCtxtPtr pctxt = NULL;
xmlParserInputPtr inputStream = NULL;
int ret;
@@ -29097,15 +29152,22 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
/*
* prepare the parser
*/
- pctxt = xmlNewSAXParserCtxt(sax, user_data);
- if (pctxt == NULL)
- return (-1);
+ if (sax != NULL) {
+ pctxt = xmlNewSAXParserCtxt(sax, user_data);
+ if (pctxt == NULL)
+ return (-1);
+ } else {
+ pctxt = xmlNewParserCtxt();
+ if (pctxt == NULL)
+ return (-1);
+ /* We really want pctxt->sax to be NULL here. */
+ xmlFree(pctxt->sax);
+ pctxt->sax = NULL;
+ }
#if 0
if (options)
xmlCtxtUseOptions(pctxt, options);
#endif
- pctxt->linenumbers = 1;
- xmlSchemaValidateSetLocator(ctxt, xmlSchemaValidateStreamLocator, pctxt);
inputStream = xmlNewIOInputStream(pctxt, input, enc);;
if (inputStream == NULL) {
@@ -29113,36 +29175,12 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
goto done;
}
inputPush(pctxt, inputStream);
- ctxt->parserCtxt = pctxt;
- ctxt->input = input;
- /*
- * Plug the validation and launch the parsing
- */
- plug = xmlSchemaSAXPlug(ctxt, &(pctxt->sax), &(pctxt->userData));
- if (plug == NULL) {
- ret = -1;
- goto done;
- }
- ctxt->input = input;
ctxt->enc = enc;
- ctxt->sax = pctxt->sax;
- ctxt->flags |= XML_SCHEMA_VALID_CTXT_FLAG_STREAM;
- ret = xmlSchemaVStart(ctxt);
- if ((ret == 0) && (! ctxt->parserCtxt->wellFormed)) {
- ret = ctxt->parserCtxt->errNo;
- if (ret == 0)
- ret = 1;
- }
+ ret = xmlSchemaValidateStreamInternal(ctxt, pctxt);
done:
- ctxt->parserCtxt = NULL;
- ctxt->sax = NULL;
- ctxt->input = NULL;
- if (plug != NULL) {
- xmlSchemaSAXUnplug(plug);
- }
/* cleanup */
if (pctxt != NULL) {
xmlFreeParserCtxt(pctxt);
@@ -29168,17 +29206,19 @@ xmlSchemaValidateFile(xmlSchemaValidCtxtPtr ctxt,
int options ATTRIBUTE_UNUSED)
{
int ret;
- xmlParserInputBufferPtr input;
+ xmlParserCtxtPtr pctxt = NULL;
if ((ctxt == NULL) || (filename == NULL))
return (-1);
- input = xmlParserInputBufferCreateFilename(filename,
- XML_CHAR_ENCODING_NONE);
- if (input == NULL)
+ pctxt = xmlCreateURLParserCtxt(filename, 0);
+ if (pctxt == NULL)
return (-1);
- ret = xmlSchemaValidateStream(ctxt, input, XML_CHAR_ENCODING_NONE,
- NULL, NULL);
+ /* We really want pctxt->sax to be NULL here. */
+ xmlFree(pctxt->sax);
+ pctxt->sax = NULL;
+ ret = xmlSchemaValidateStreamInternal(ctxt, pctxt);
+ xmlFreeParserCtxt(pctxt);
return (ret);
}
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 5d7eb419..60268e2d 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -385,18 +385,61 @@ xmlSchemaAddParticle(void)
return (ret);
}
+static void
+xmlSchemaFreeTypeEntry(void *type, const xmlChar *name ATTRIBUTE_UNUSED) {
+ xmlSchemaFreeType((xmlSchemaTypePtr) type);
+}
+
+/**
+ * xmlSchemaCleanupTypesInternal:
+ *
+ * Cleanup the default XML Schemas type library
+ */
+static void
+xmlSchemaCleanupTypesInternal(void) {
+ xmlSchemaParticlePtr particle;
+
+ /*
+ * Free xs:anyType.
+ */
+ if (xmlSchemaTypeAnyTypeDef != NULL) {
+ /* Attribute wildcard. */
+ xmlSchemaFreeWildcard(xmlSchemaTypeAnyTypeDef->attributeWildcard);
+ /* Content type. */
+ particle = (xmlSchemaParticlePtr) xmlSchemaTypeAnyTypeDef->subtypes;
+ /* Wildcard. */
+ xmlSchemaFreeWildcard((xmlSchemaWildcardPtr)
+ particle->children->children->children);
+ xmlFree((xmlSchemaParticlePtr) particle->children->children);
+ /* Sequence model group. */
+ xmlFree((xmlSchemaModelGroupPtr) particle->children);
+ xmlFree((xmlSchemaParticlePtr) particle);
+ xmlSchemaTypeAnyTypeDef->subtypes = NULL;
+ xmlSchemaTypeAnyTypeDef = NULL;
+ }
+
+ xmlHashFree(xmlSchemaTypesBank, xmlSchemaFreeTypeEntry);
+ xmlSchemaTypesBank = NULL;
+ /* Note that the xmlSchemaType*Def pointers aren't set to NULL. */
+}
+
/*
* xmlSchemaInitTypes:
*
* Initialize the default XML Schemas type library
+ *
+ * Returns 0 on success, -1 on error.
*/
-void
+int
xmlSchemaInitTypes(void)
{
if (xmlSchemaTypesInitialized != 0)
- return;
+ return (0);
xmlSchemaTypesBank = xmlHashCreate(40);
-
+ if (xmlSchemaTypesBank == NULL) {
+ xmlSchemaTypeErrMemory(NULL, NULL);
+ goto error;
+ }
/*
* 3.4.7 Built-in Complex Type Definition
@@ -404,10 +447,8 @@ xmlSchemaInitTypes(void)
xmlSchemaTypeAnyTypeDef = xmlSchemaInitBasicType("anyType",
XML_SCHEMAS_ANYTYPE,
NULL);
- if (xmlSchemaTypeAnyTypeDef == NULL) {
- xmlSchemaTypeErrMemory(NULL, NULL);
- return;
- }
+ if (xmlSchemaTypeAnyTypeDef == NULL)
+ goto error;
xmlSchemaTypeAnyTypeDef->baseType = xmlSchemaTypeAnyTypeDef;
xmlSchemaTypeAnyTypeDef->contentType = XML_SCHEMA_CONTENT_MIXED;
/*
@@ -421,14 +462,14 @@ xmlSchemaInitTypes(void)
/* First particle. */
particle = xmlSchemaAddParticle();
if (particle == NULL)
- return;
+ goto error;
xmlSchemaTypeAnyTypeDef->subtypes = (xmlSchemaTypePtr) particle;
/* Sequence model group. */
sequence = (xmlSchemaModelGroupPtr)
xmlMalloc(sizeof(xmlSchemaModelGroup));
if (sequence == NULL) {
xmlSchemaTypeErrMemory(NULL, "allocating model group component");
- return;
+ goto error;
}
memset(sequence, 0, sizeof(xmlSchemaModelGroup));
sequence->type = XML_SCHEMA_TYPE_SEQUENCE;
@@ -436,7 +477,7 @@ xmlSchemaInitTypes(void)
/* Second particle. */
particle = xmlSchemaAddParticle();
if (particle == NULL)
- return;
+ goto error;
particle->minOccurs = 0;
particle->maxOccurs = UNBOUNDED;
sequence->children = (xmlSchemaTreeItemPtr) particle;
@@ -444,7 +485,7 @@ xmlSchemaInitTypes(void)
wild = (xmlSchemaWildcardPtr) xmlMalloc(sizeof(xmlSchemaWildcard));
if (wild == NULL) {
xmlSchemaTypeErrMemory(NULL, "allocating wildcard component");
- return;
+ goto error;
}
memset(wild, 0, sizeof(xmlSchemaWildcard));
wild->type = XML_SCHEMA_TYPE_ANY;
@@ -458,7 +499,7 @@ xmlSchemaInitTypes(void)
if (wild == NULL) {
xmlSchemaTypeErrMemory(NULL, "could not create an attribute "
"wildcard on anyType");
- return;
+ goto error;
}
memset(wild, 0, sizeof(xmlSchemaWildcard));
wild->any = 1;
@@ -468,66 +509,106 @@ xmlSchemaInitTypes(void)
xmlSchemaTypeAnySimpleTypeDef = xmlSchemaInitBasicType("anySimpleType",
XML_SCHEMAS_ANYSIMPLETYPE,
xmlSchemaTypeAnyTypeDef);
+ if (xmlSchemaTypeAnySimpleTypeDef == NULL)
+ goto error;
/*
* primitive datatypes
*/
xmlSchemaTypeStringDef = xmlSchemaInitBasicType("string",
XML_SCHEMAS_STRING,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeStringDef == NULL)
+ goto error;
xmlSchemaTypeDecimalDef = xmlSchemaInitBasicType("decimal",
XML_SCHEMAS_DECIMAL,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeDecimalDef == NULL)
+ goto error;
xmlSchemaTypeDateDef = xmlSchemaInitBasicType("date",
XML_SCHEMAS_DATE,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeDateDef == NULL)
+ goto error;
xmlSchemaTypeDatetimeDef = xmlSchemaInitBasicType("dateTime",
XML_SCHEMAS_DATETIME,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeDatetimeDef == NULL)
+ goto error;
xmlSchemaTypeTimeDef = xmlSchemaInitBasicType("time",
XML_SCHEMAS_TIME,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeTimeDef == NULL)
+ goto error;
xmlSchemaTypeGYearDef = xmlSchemaInitBasicType("gYear",
XML_SCHEMAS_GYEAR,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeGYearDef == NULL)
+ goto error;
xmlSchemaTypeGYearMonthDef = xmlSchemaInitBasicType("gYearMonth",
XML_SCHEMAS_GYEARMONTH,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeGYearMonthDef == NULL)
+ goto error;
xmlSchemaTypeGMonthDef = xmlSchemaInitBasicType("gMonth",
XML_SCHEMAS_GMONTH,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeGMonthDef == NULL)
+ goto error;
xmlSchemaTypeGMonthDayDef = xmlSchemaInitBasicType("gMonthDay",
XML_SCHEMAS_GMONTHDAY,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeGMonthDayDef == NULL)
+ goto error;
xmlSchemaTypeGDayDef = xmlSchemaInitBasicType("gDay",
XML_SCHEMAS_GDAY,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeGDayDef == NULL)
+ goto error;
xmlSchemaTypeDurationDef = xmlSchemaInitBasicType("duration",
XML_SCHEMAS_DURATION,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeDurationDef == NULL)
+ goto error;
xmlSchemaTypeFloatDef = xmlSchemaInitBasicType("float",
XML_SCHEMAS_FLOAT,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeFloatDef == NULL)
+ goto error;
xmlSchemaTypeDoubleDef = xmlSchemaInitBasicType("double",
XML_SCHEMAS_DOUBLE,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeDoubleDef == NULL)
+ goto error;
xmlSchemaTypeBooleanDef = xmlSchemaInitBasicType("boolean",
XML_SCHEMAS_BOOLEAN,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeBooleanDef == NULL)
+ goto error;
xmlSchemaTypeAnyURIDef = xmlSchemaInitBasicType("anyURI",
XML_SCHEMAS_ANYURI,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeAnyURIDef == NULL)
+ goto error;
xmlSchemaTypeHexBinaryDef = xmlSchemaInitBasicType("hexBinary",
XML_SCHEMAS_HEXBINARY,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeHexBinaryDef == NULL)
+ goto error;
xmlSchemaTypeBase64BinaryDef
= xmlSchemaInitBasicType("base64Binary", XML_SCHEMAS_BASE64BINARY,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeBase64BinaryDef == NULL)
+ goto error;
xmlSchemaTypeNotationDef = xmlSchemaInitBasicType("NOTATION",
XML_SCHEMAS_NOTATION,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeNotationDef == NULL)
+ goto error;
xmlSchemaTypeQNameDef = xmlSchemaInitBasicType("QName",
XML_SCHEMAS_QNAME,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeQNameDef == NULL)
+ goto error;
/*
* derived datatypes
@@ -535,69 +616,113 @@ xmlSchemaInitTypes(void)
xmlSchemaTypeIntegerDef = xmlSchemaInitBasicType("integer",
XML_SCHEMAS_INTEGER,
xmlSchemaTypeDecimalDef);
+ if (xmlSchemaTypeIntegerDef == NULL)
+ goto error;
xmlSchemaTypeNonPositiveIntegerDef =
xmlSchemaInitBasicType("nonPositiveInteger",
XML_SCHEMAS_NPINTEGER,
xmlSchemaTypeIntegerDef);
+ if (xmlSchemaTypeNonPositiveIntegerDef == NULL)
+ goto error;
xmlSchemaTypeNegativeIntegerDef =
xmlSchemaInitBasicType("negativeInteger", XML_SCHEMAS_NINTEGER,
xmlSchemaTypeNonPositiveIntegerDef);
+ if (xmlSchemaTypeNegativeIntegerDef == NULL)
+ goto error;
xmlSchemaTypeLongDef =
xmlSchemaInitBasicType("long", XML_SCHEMAS_LONG,
xmlSchemaTypeIntegerDef);
+ if (xmlSchemaTypeLongDef == NULL)
+ goto error;
xmlSchemaTypeIntDef = xmlSchemaInitBasicType("int", XML_SCHEMAS_INT,
xmlSchemaTypeLongDef);
+ if (xmlSchemaTypeIntDef == NULL)
+ goto error;
xmlSchemaTypeShortDef = xmlSchemaInitBasicType("short",
XML_SCHEMAS_SHORT,
xmlSchemaTypeIntDef);
+ if (xmlSchemaTypeShortDef == NULL)
+ goto error;
xmlSchemaTypeByteDef = xmlSchemaInitBasicType("byte",
XML_SCHEMAS_BYTE,
xmlSchemaTypeShortDef);
+ if (xmlSchemaTypeByteDef == NULL)
+ goto error;
xmlSchemaTypeNonNegativeIntegerDef =
xmlSchemaInitBasicType("nonNegativeInteger",
XML_SCHEMAS_NNINTEGER,
xmlSchemaTypeIntegerDef);
+ if (xmlSchemaTypeNonNegativeIntegerDef == NULL)
+ goto error;
xmlSchemaTypeUnsignedLongDef =
xmlSchemaInitBasicType("unsignedLong", XML_SCHEMAS_ULONG,
xmlSchemaTypeNonNegativeIntegerDef);
+ if (xmlSchemaTypeUnsignedLongDef == NULL)
+ goto error;
xmlSchemaTypeUnsignedIntDef =
xmlSchemaInitBasicType("unsignedInt", XML_SCHEMAS_UINT,
xmlSchemaTypeUnsignedLongDef);
+ if (xmlSchemaTypeUnsignedIntDef == NULL)
+ goto error;
xmlSchemaTypeUnsignedShortDef =
xmlSchemaInitBasicType("unsignedShort", XML_SCHEMAS_USHORT,
xmlSchemaTypeUnsignedIntDef);
+ if (xmlSchemaTypeUnsignedShortDef == NULL)
+ goto error;
xmlSchemaTypeUnsignedByteDef =
xmlSchemaInitBasicType("unsignedByte", XML_SCHEMAS_UBYTE,
xmlSchemaTypeUnsignedShortDef);
+ if (xmlSchemaTypeUnsignedByteDef == NULL)
+ goto error;
xmlSchemaTypePositiveIntegerDef =
xmlSchemaInitBasicType("positiveInteger", XML_SCHEMAS_PINTEGER,
xmlSchemaTypeNonNegativeIntegerDef);
+ if (xmlSchemaTypePositiveIntegerDef == NULL)
+ goto error;
xmlSchemaTypeNormStringDef = xmlSchemaInitBasicType("normalizedString",
XML_SCHEMAS_NORMSTRING,
xmlSchemaTypeStringDef);
+ if (xmlSchemaTypeNormStringDef == NULL)
+ goto error;
xmlSchemaTypeTokenDef = xmlSchemaInitBasicType("token",
XML_SCHEMAS_TOKEN,
xmlSchemaTypeNormStringDef);
+ if (xmlSchemaTypeTokenDef == NULL)
+ goto error;
xmlSchemaTypeLanguageDef = xmlSchemaInitBasicType("language",
XML_SCHEMAS_LANGUAGE,
xmlSchemaTypeTokenDef);
+ if (xmlSchemaTypeLanguageDef == NULL)
+ goto error;
xmlSchemaTypeNameDef = xmlSchemaInitBasicType("Name",
XML_SCHEMAS_NAME,
xmlSchemaTypeTokenDef);
+ if (xmlSchemaTypeNameDef == NULL)
+ goto error;
xmlSchemaTypeNmtokenDef = xmlSchemaInitBasicType("NMTOKEN",
XML_SCHEMAS_NMTOKEN,
xmlSchemaTypeTokenDef);
+ if (xmlSchemaTypeNmtokenDef == NULL)
+ goto error;
xmlSchemaTypeNCNameDef = xmlSchemaInitBasicType("NCName",
XML_SCHEMAS_NCNAME,
xmlSchemaTypeNameDef);
+ if (xmlSchemaTypeNCNameDef == NULL)
+ goto error;
xmlSchemaTypeIdDef = xmlSchemaInitBasicType("ID", XML_SCHEMAS_ID,
xmlSchemaTypeNCNameDef);
+ if (xmlSchemaTypeIdDef == NULL)
+ goto error;
xmlSchemaTypeIdrefDef = xmlSchemaInitBasicType("IDREF",
XML_SCHEMAS_IDREF,
xmlSchemaTypeNCNameDef);
+ if (xmlSchemaTypeIdrefDef == NULL)
+ goto error;
xmlSchemaTypeEntityDef = xmlSchemaInitBasicType("ENTITY",
XML_SCHEMAS_ENTITY,
xmlSchemaTypeNCNameDef);
+ if (xmlSchemaTypeEntityDef == NULL)
+ goto error;
/*
* Derived list types.
*/
@@ -605,25 +730,31 @@ xmlSchemaInitTypes(void)
xmlSchemaTypeEntitiesDef = xmlSchemaInitBasicType("ENTITIES",
XML_SCHEMAS_ENTITIES,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeEntitiesDef == NULL)
+ goto error;
xmlSchemaTypeEntitiesDef->subtypes = xmlSchemaTypeEntityDef;
/* IDREFS */
xmlSchemaTypeIdrefsDef = xmlSchemaInitBasicType("IDREFS",
XML_SCHEMAS_IDREFS,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeIdrefsDef == NULL)
+ goto error;
xmlSchemaTypeIdrefsDef->subtypes = xmlSchemaTypeIdrefDef;
/* NMTOKENS */
xmlSchemaTypeNmtokensDef = xmlSchemaInitBasicType("NMTOKENS",
XML_SCHEMAS_NMTOKENS,
xmlSchemaTypeAnySimpleTypeDef);
+ if (xmlSchemaTypeNmtokensDef == NULL)
+ goto error;
xmlSchemaTypeNmtokensDef->subtypes = xmlSchemaTypeNmtokenDef;
xmlSchemaTypesInitialized = 1;
-}
+ return (0);
-static void
-xmlSchemaFreeTypeEntry(void *type, const xmlChar *name ATTRIBUTE_UNUSED) {
- xmlSchemaFreeType((xmlSchemaTypePtr) type);
+error:
+ xmlSchemaCleanupTypesInternal();
+ return (-1);
}
/**
@@ -632,34 +763,16 @@ xmlSchemaFreeTypeEntry(void *type, const xmlChar *name ATTRIBUTE_UNUSED) {
* DEPRECATED: This function will be made private. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
- * have call cleanup functions at all.
+ * have to call cleanup functions at all.
*
* Cleanup the default XML Schemas type library
*/
void
xmlSchemaCleanupTypes(void) {
- if (xmlSchemaTypesInitialized == 0)
- return;
- /*
- * Free xs:anyType.
- */
- {
- xmlSchemaParticlePtr particle;
- /* Attribute wildcard. */
- xmlSchemaFreeWildcard(xmlSchemaTypeAnyTypeDef->attributeWildcard);
- /* Content type. */
- particle = (xmlSchemaParticlePtr) xmlSchemaTypeAnyTypeDef->subtypes;
- /* Wildcard. */
- xmlSchemaFreeWildcard((xmlSchemaWildcardPtr)
- particle->children->children->children);
- xmlFree((xmlSchemaParticlePtr) particle->children->children);
- /* Sequence model group. */
- xmlFree((xmlSchemaModelGroupPtr) particle->children);
- xmlFree((xmlSchemaParticlePtr) particle);
- xmlSchemaTypeAnyTypeDef->subtypes = NULL;
+ if (xmlSchemaTypesInitialized != 0) {
+ xmlSchemaCleanupTypesInternal();
+ xmlSchemaTypesInitialized = 0;
}
- xmlHashFree(xmlSchemaTypesBank, xmlSchemaFreeTypeEntry);
- xmlSchemaTypesInitialized = 0;
}
/**
@@ -754,8 +867,9 @@ xmlSchemaIsBuiltInTypeFacet(xmlSchemaTypePtr type, int facetType)
xmlSchemaTypePtr
xmlSchemaGetBuiltInType(xmlSchemaValType type)
{
- if (xmlSchemaTypesInitialized == 0)
- xmlSchemaInitTypes();
+ if ((xmlSchemaTypesInitialized == 0) &&
+ (xmlSchemaInitTypes() < 0))
+ return (NULL);
switch (type) {
case XML_SCHEMAS_ANYSIMPLETYPE:
@@ -1087,8 +1201,9 @@ xmlSchemaFreeValue(xmlSchemaValPtr value) {
*/
xmlSchemaTypePtr
xmlSchemaGetPredefinedType(const xmlChar *name, const xmlChar *ns) {
- if (xmlSchemaTypesInitialized == 0)
- xmlSchemaInitTypes();
+ if ((xmlSchemaTypesInitialized == 0) &&
+ (xmlSchemaInitTypes() < 0))
+ return (NULL);
if (name == NULL)
return(NULL);
return((xmlSchemaTypePtr) xmlHashLookup2(xmlSchemaTypesBank, name, ns));
@@ -2257,8 +2372,9 @@ xmlSchemaValAtomicType(xmlSchemaTypePtr type, const xmlChar * value,
xmlChar *norm = NULL;
int ret = 0;
- if (xmlSchemaTypesInitialized == 0)
- xmlSchemaInitTypes();
+ if ((xmlSchemaTypesInitialized == 0) &&
+ (xmlSchemaInitTypes() < 0))
+ return (-1);
if (type == NULL)
return (-1);
diff --git a/xmlwriter.c b/xmlwriter.c
index 0de56e7c..569830cf 100644
--- a/xmlwriter.c
+++ b/xmlwriter.c
@@ -709,7 +709,11 @@ xmlTextWriterEndDocument(xmlTextWriterPtr writer)
sum += count;
}
- sum += xmlTextWriterFlush(writer);
+ count = xmlTextWriterFlush(writer);
+ if (count < 0)
+ return -1;
+ sum += count;
+
return sum;
}
diff --git a/xpath.c b/xpath.c
index 27628586..0f969950 100644
--- a/xpath.c
+++ b/xpath.c
@@ -2495,17 +2495,17 @@ xmlXPathCacheNewNodeSet(xmlXPathContextPtr ctxt, xmlNodePtr val)
}
/**
- * xmlXPathCacheNewCString:
+ * xmlXPathCacheNewString:
* @ctxt: the XPath context
- * @val: the char * value
+ * @val: the xmlChar * value
*
- * This is the cached version of xmlXPathNewCString().
+ * This is the cached version of xmlXPathNewString().
* Acquire an xmlXPathObjectPtr of type string and of value @val
*
* Returns the created or reused object.
*/
static xmlXPathObjectPtr
-xmlXPathCacheNewCString(xmlXPathContextPtr ctxt, const char *val)
+xmlXPathCacheNewString(xmlXPathContextPtr ctxt, const xmlChar *val)
{
if ((ctxt != NULL) && (ctxt->cache)) {
xmlXPathContextCachePtr cache = (xmlXPathContextCachePtr) ctxt->cache;
@@ -2514,12 +2514,20 @@ xmlXPathCacheNewCString(xmlXPathContextPtr ctxt, const char *val)
(cache->stringObjs->number != 0))
{
xmlXPathObjectPtr ret;
+ xmlChar *copy;
+
+ if (val == NULL)
+ val = BAD_CAST "";
+ copy = xmlStrdup(val);
+ if (copy == NULL) {
+ xmlXPathErrMemory(ctxt, NULL);
+ return(NULL);
+ }
ret = (xmlXPathObjectPtr)
cache->stringObjs->items[--cache->stringObjs->number];
-
ret->type = XPATH_STRING;
- ret->stringval = xmlStrdup(BAD_CAST val);
+ ret->stringval = copy;
#ifdef XP_DEBUG_OBJ_USAGE
xmlXPathDebugObjUsageRequested(ctxt, XPATH_STRING);
#endif
@@ -2528,73 +2536,44 @@ xmlXPathCacheNewCString(xmlXPathContextPtr ctxt, const char *val)
(cache->miscObjs->number != 0))
{
xmlXPathObjectPtr ret;
+ xmlChar *copy;
+
+ if (val == NULL)
+ val = BAD_CAST "";
+ copy = xmlStrdup(val);
+ if (copy == NULL) {
+ xmlXPathErrMemory(ctxt, NULL);
+ return(NULL);
+ }
ret = (xmlXPathObjectPtr)
cache->miscObjs->items[--cache->miscObjs->number];
ret->type = XPATH_STRING;
- ret->stringval = xmlStrdup(BAD_CAST val);
+ ret->stringval = copy;
#ifdef XP_DEBUG_OBJ_USAGE
xmlXPathDebugObjUsageRequested(ctxt, XPATH_STRING);
#endif
return(ret);
}
}
- return(xmlXPathNewCString(val));
+ return(xmlXPathNewString(val));
}
/**
- * xmlXPathCacheNewString:
+ * xmlXPathCacheNewCString:
* @ctxt: the XPath context
- * @val: the xmlChar * value
+ * @val: the char * value
*
- * This is the cached version of xmlXPathNewString().
+ * This is the cached version of xmlXPathNewCString().
* Acquire an xmlXPathObjectPtr of type string and of value @val
*
* Returns the created or reused object.
*/
static xmlXPathObjectPtr
-xmlXPathCacheNewString(xmlXPathContextPtr ctxt, const xmlChar *val)
+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];
- ret->type = XPATH_STRING;
- if (val != NULL)
- ret->stringval = xmlStrdup(val);
- else
- ret->stringval = xmlStrdup((const xmlChar *)"");
-#ifdef XP_DEBUG_OBJ_USAGE
- xmlXPathDebugObjUsageRequested(ctxt, XPATH_STRING);
-#endif
- return(ret);
- } else if ((cache->miscObjs != NULL) &&
- (cache->miscObjs->number != 0))
- {
- xmlXPathObjectPtr ret;
-
- ret = (xmlXPathObjectPtr)
- cache->miscObjs->items[--cache->miscObjs->number];
-
- ret->type = XPATH_STRING;
- if (val != NULL)
- ret->stringval = xmlStrdup(val);
- else
- ret->stringval = xmlStrdup((const xmlChar *)"");
-#ifdef XP_DEBUG_OBJ_USAGE
- xmlXPathDebugObjUsageRequested(ctxt, XPATH_STRING);
-#endif
- return(ret);
- }
- }
- return(xmlXPathNewString(val));
+ return xmlXPathCacheNewString(ctxt, BAD_CAST val);
}
/**
@@ -5271,10 +5250,13 @@ xmlXPathNewString(const xmlChar *val) {
}
memset(ret, 0 , sizeof(xmlXPathObject));
ret->type = XPATH_STRING;
- if (val != NULL)
- ret->stringval = xmlStrdup(val);
- else
- ret->stringval = xmlStrdup((const xmlChar *)"");
+ if (val == NULL)
+ val = BAD_CAST "";
+ ret->stringval = xmlStrdup(val);
+ if (ret->stringval == NULL) {
+ xmlFree(ret);
+ return(NULL);
+ }
#ifdef XP_DEBUG_OBJ_USAGE
xmlXPathDebugObjUsageRequested(NULL, XPATH_STRING);
#endif
@@ -5320,20 +5302,7 @@ xmlXPathWrapString (xmlChar *val) {
*/
xmlXPathObjectPtr
xmlXPathNewCString(const char *val) {
- xmlXPathObjectPtr ret;
-
- ret = (xmlXPathObjectPtr) xmlMalloc(sizeof(xmlXPathObject));
- if (ret == NULL) {
- xmlXPathErrMemory(NULL, "creating string object\n");
- return(NULL);
- }
- memset(ret, 0 , sizeof(xmlXPathObject));
- ret->type = XPATH_STRING;
- ret->stringval = xmlStrdup(BAD_CAST val);
-#ifdef XP_DEBUG_OBJ_USAGE
- xmlXPathDebugObjUsageRequested(NULL, XPATH_STRING);
-#endif
- return(ret);
+ return(xmlXPathNewString(BAD_CAST val));
}
/**
@@ -5409,6 +5378,10 @@ xmlXPathObjectCopy(xmlXPathObjectPtr val) {
break;
case XPATH_STRING:
ret->stringval = xmlStrdup(val->stringval);
+ if (ret->stringval == NULL) {
+ xmlFree(ret);
+ return(NULL);
+ }
break;
case XPATH_XSLT_TREE:
#if 0
diff --git a/xpointer.c b/xpointer.c
index d8c18d7a..73514215 100644
--- a/xpointer.c
+++ b/xpointer.c
@@ -1248,7 +1248,6 @@ xmlXPtrEvalXPointer(xmlXPathParserContextPtr ctxt) {
ctxt->valueNr = 0;
ctxt->valueMax = 10;
ctxt->value = NULL;
- ctxt->valueFrame = 0;
}
SKIP_BLANKS;
if (CUR == '/') {
diff --git a/xstc/.gitignore b/xstc/.gitignore
new file mode 100644
index 00000000..e8c51fd6
--- /dev/null
+++ b/xstc/.gitignore
@@ -0,0 +1,3 @@
+/*-test.py
+/Tests
+/xsts-*.tar.gz
diff --git a/xstc/fixup-tests.py b/xstc/fixup-tests.py
index 138d6e0a..09490d10 100755
--- a/xstc/fixup-tests.py
+++ b/xstc/fixup-tests.py
@@ -95,5 +95,4 @@ finally:
libxml2.cleanupParser()
if libxml2.debugMemory(1) != 0:
print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
- libxml2.dumpMemory()
diff --git a/xzlib.c b/xzlib.c
index 33c27a26..5470c4e8 100644
--- a/xzlib.c
+++ b/xzlib.c
@@ -133,6 +133,7 @@ static xzFile
xz_open(const char *path, int fd, const char *mode ATTRIBUTE_UNUSED)
{
xz_statep state;
+ off_t offset;
/* allocate xzFile structure to return */
state = xmlMalloc(sizeof(xz_state));
@@ -167,9 +168,11 @@ xz_open(const char *path, int fd, const char *mode ATTRIBUTE_UNUSED)
}
/* save the current position for rewinding (only if reading) */
- state->start = lseek(state->fd, 0, SEEK_CUR);
- if (state->start == (uint64_t) - 1)
+ offset = lseek(state->fd, 0, SEEK_CUR);
+ if (offset == -1)
state->start = 0;
+ else
+ state->start = offset;
/* initialize stream */
xz_reset(state);