Merge tag 'v2.14.2' into HEAD

* Release v2.14.2
* Update README.fuchsia to new libxml2 version.
* Merge via 'git merge -X theirs v2.14.2'.
* Regenerate config with './autogen.sh --without-lzma'

Bug: 414072443
Change-Id: If2c14c0dd12a506204d6faf837eccf1343ae1e9d
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/libxml2/+/1272071
Reviewed-by: Dzmitry Yatsushkevich <dmitryya@google.com>
diff --git a/.gitignore b/.gitignore
index 4b2f754..c4881df 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,7 +13,6 @@
 /runtest
 /runxmlconf
 /testModule
-/testThreads
 /testapi
 /testchar
 /testdict
@@ -22,7 +21,6 @@
 /testrecurse
 
 # Tests
-/dba100000.xml
 /missing.lst
 /runsuite.log
 /runxmlconf.log
@@ -32,7 +30,6 @@
 # Generated by build system
 /config.h
 /include/libxml/xmlversion.h
-/libxml-2.0-uninstalled.pc
 /libxml-2.0.pc
 /libxml2-config.cmake
 /xml2-config
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f362b20..a9e565a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -2,16 +2,16 @@
   - component: "gitlab.gnome.org/GNOME/citemplates/release-service@master"
     inputs:
       dist-job-name: "dist"
-      tarball-artifact-path: "libxml2-dist/libxml2-2.13.6.tar.xz"
+      tarball-artifact-path: "${TARBALL_ARTIFACT_PATH}"
 
 .test:
   image: registry.gitlab.gnome.org/gnome/libxml2
   variables:
-    BASE_CONFIG: "--with-ftp --with-legacy --with-xptr-locs"
+    BASE_CONFIG: "--with-http --with-lzma --with-zlib"
   before_script:
     - rm -rf libxml2-build
     - mkdir libxml2-build
-    - ln -s /tests/xmlconf libxml2-build
+    - ln -s /tests/xmlconf .
   script:
     - sh .gitlab-ci/test.sh
 
@@ -24,7 +24,7 @@
   extends: .test
   variables:
     CONFIG: "--without-python"
-    CFLAGS: "-O2 -std=c89 -D_XOPEN_SOURCE=600"
+    CFLAGS: "-O2 -std=c89 -D_XOPEN_SOURCE=600 -Wno-error=unused-function"
 
 gcc:minimum:
   extends: .test
@@ -36,7 +36,7 @@
   extends: .test
   variables:
     BASE_CONFIG: "--with-minimum"
-    CONFIG: "--with-threads --with-tree --with-xpath --with-output --with-html"
+    CONFIG: "--with-threads --with-tree --with-xpath --with-output --with-html --with-iso8859x --with-valid"
     CFLAGS: "-O2"
 
 gcc:legacy:
@@ -78,7 +78,7 @@
   tags:
     - win32-ps
   variables:
-    BASE_CONFIG: "--with-ftp --with-legacy --with-xptr-locs"
+    BASE_CONFIG: "--with-http --with-lzma --with-zlib"
     # Disabled for now, see #658
     CONFIG: "--without-python"
     CHERE_INVOKING: "yes"
@@ -90,7 +90,7 @@
   cache:
     key: "$MSYSTEM"
     paths:
-      - libxml2-build/xmlconf/
+      - xmlconf/
 
 mingw:w64-x86_64:shared:
   extends: .mingw
@@ -118,7 +118,7 @@
   before_script:
     - rm -rf libxml2-build
     - mkdir libxml2-build
-    - ln -s /tests/xmlconf libxml2-build
+    - ln -s /tests/xmlconf .
   script:
     - sh .gitlab-ci/test_cmake.sh
   artifacts:
@@ -173,7 +173,7 @@
   cache:
     key: "$MSYSTEM"
     paths:
-      - libxml2-build/xmlconf/
+      - xmlconf/
   artifacts:
     paths:
       - libxml2-$Env:CI_COMMIT_SHORT_SHA-$Env:SUFFIX.tar.gz
@@ -190,8 +190,8 @@
 
 cmake:mingw:w64-i686:static:
   extends: .cmake:mingw
-  only:
-    - schedules
+#  only:
+#    - schedules
   variables:
     BUILD_SHARED_LIBS: "OFF"
     MSYSTEM: MINGW32
@@ -199,6 +199,8 @@
 
 cmake:mingw:w64-x86_64:shared:
   extends: .cmake:mingw
+#  only:
+#    - schedules
   variables:
     BUILD_SHARED_LIBS: "ON"
     MSYSTEM: MINGW64
@@ -227,7 +229,7 @@
     key: "msvc"
     paths:
       - cmake-$Env:CMAKE_VERSION-win64-x64/
-      - libxml2-build/xmlconf/
+      - xmlconf/
       - 7za.exe
   artifacts:
     paths:
@@ -282,6 +284,8 @@
 
 meson:
   image: registry.gitlab.gnome.org/gnome/libxml2
+  before_script:
+    - ln -s /tests/xmlconf .
   script:
     - sh .gitlab-ci/test_meson.sh
 
@@ -296,9 +300,12 @@
   image: registry.gitlab.gnome.org/gnome/libxml2
   script:
     - sh .gitlab-ci/dist.sh
+    - echo "TARBALL_ARTIFACT_PATH=$(ls libxml2-dist/*.tar.xz)" >> build.env
   artifacts:
     paths:
       - libxml2-dist/*.tar.xz
+    reports:
+      dotenv: build.env
 
 pages:
   script:
@@ -312,3 +319,24 @@
       - public/devhelp/*.xsl
   only:
     - master@GNOME/libxml2
+
+downstream-lxml:
+  image: registry.gitlab.gnome.org/gnome/libxml2
+  script:
+    - sh .gitlab-ci/downstream-lxml.sh
+
+downstream-nokogiri:
+  # owner: @flavorjones
+  image: ghcr.io/sparklemotion/nokogiri-test:upstream-libxml
+  script:
+    - .gitlab-ci/downstream-nokogiri.sh
+
+downstream-perl:
+  image: registry.gitlab.gnome.org/gnome/libxml2
+  script:
+    - sh .gitlab-ci/downstream-perl.sh
+
+downstream-php:
+  image: registry.gitlab.gnome.org/gnome/libxml2
+  script:
+    - sh .gitlab-ci/downstream-php.sh
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile
index 0b1fa78..c2b4999 100644
--- a/.gitlab-ci/Dockerfile
+++ b/.gitlab-ci/Dockerfile
@@ -1,7 +1,14 @@
-# The image is also used for libxslt, that's why we need git and
-# libgcrypt-dev.
+# The image is also used for libxslt.
+#
+# package           required for
+# ------------------------------------------------------------
+# libclang-rt-dev   sanitizer runtimes
+# llvm              llvm-symbolizer (for sanitizer backtraces)
+# git               libxslt
+# libgcrypt-dev     libxslt
+# xz-utils          make dist
 
-FROM ubuntu:23.10
+FROM ubuntu:24.04
 ENV DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && \
     apt-get upgrade -y && \
@@ -11,6 +18,31 @@
         make gcc clang llvm libclang-rt-dev \
         zlib1g-dev liblzma-dev libgcrypt-dev \
         python3-dev \
-        cmake meson
+        cmake meson \
+        xz-utils
 WORKDIR /tests
 RUN curl https://www.w3.org/XML/Test/xmlts20080827.tar.gz |tar xz
+
+# XML::LibXML uses Alien::Libxml2 which has a huge dependency chain.
+# We try to install most dependencies with apt. We also require
+# libxml2-dev to stop Alien::Libxml2 from downloading and building
+# libxml2 on its own.
+RUN apt-get install -y --no-install-recommends \
+        libperl-dev libxml2-dev cpanminus \
+        libalien-build-perl \
+        libio-socket-ssl-perl \
+        libsort-versions-perl \
+        liburi-perl \
+        libxml-namespacesupport-perl  \
+        libxml-sax-perl \
+        libyaml-perl
+RUN cpanm -n Alien::Libxml2
+RUN apt-get remove -y libxml2-dev
+
+# PHP
+RUN apt-get install -y --no-install-recommends \
+        bison re2c libsqlite3-dev
+
+# lxml
+RUN apt-get install -y --no-install-recommends \
+        cython3
diff --git a/.gitlab-ci/Test-Msvc.ps1 b/.gitlab-ci/Test-Msvc.ps1
index 796d75c..0db7596 100644
--- a/.gitlab-ci/Test-Msvc.ps1
+++ b/.gitlab-ci/Test-Msvc.ps1
@@ -1,13 +1,5 @@
 [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
 
-if (-not (Test-Path cmake-$Env:CMAKE_VERSION-win64-x64)) {
-    Invoke-WebRequest `
-        -Uri http://github.com/Kitware/CMake/releases/download/v$Env:CMAKE_VERSION/cmake-$Env:CMAKE_VERSION-win64-x64.zip `
-        -OutFile cmake-$Env:CMAKE_VERSION-win64-x64.zip
-    Expand-Archive cmake-$Env:CMAKE_VERSION-win64-x64.zip -DestinationPath .
-}
-$Env:Path="$Env:CI_PROJECT_DIR\cmake-$Env:CMAKE_VERSION-win64-x64\bin;$Env:Path"
-
 if (-not (Test-Path 7za.exe)) {
     Invoke-WebRequest `
         -Uri https://www.7-zip.org/a/7z1900-extra.7z `
@@ -15,11 +7,12 @@
     cmake -E tar xf 7z1900-extra.7z 7za.exe
 }
 
-if (-not (Test-Path libxml2-build/xmlconf)) {
+if (-not (Test-Path xmlconf)) {
     Invoke-WebRequest `
         -Uri https://www.w3.org/XML/Test/xmlts20080827.tar.gz `
         -OutFile xmlts20080827.tar.gz ;
-    .\7za.exe x xmlts20080827.tar.gz -olibxml2-build
+    .\7za.exe x xmlts20080827.tar.gz
+    .\7za.exe x xmlts20080827.tar
 }
 
 cmake `
diff --git a/.gitlab-ci/downstream-lxml.sh b/.gitlab-ci/downstream-lxml.sh
new file mode 100644
index 0000000..52df56d
--- /dev/null
+++ b/.gitlab-ci/downstream-lxml.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+set -e
+
+srcdir=$(pwd)
+
+mkdir -p install
+installdir="$srcdir/install"
+export PKG_CONFIG_PATH="$installdir/lib/pkgconfig"
+
+sh autogen.sh "--prefix=$installdir" --with-http --with-zlib --without-python
+make -j$(nproc)
+make install
+
+git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git
+cd libxslt
+sh autogen.sh \
+    "--prefix=$installdir" \
+    "--with-libxml-prefix=$installdir" \
+    --without-python
+make -j$(nproc)
+make install
+cd ..
+
+git clone --depth 1 https://github.com/lxml/lxml.git
+cd lxml
+make
+LD_LIBRARY_PATH="$installdir/lib" make TESTFLAGS='' test
diff --git a/.gitlab-ci/downstream-nokogiri.sh b/.gitlab-ci/downstream-nokogiri.sh
new file mode 100755
index 0000000..8ac282d
--- /dev/null
+++ b/.gitlab-ci/downstream-nokogiri.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env bash
+
+set -e
+
+export LIBXML_DIR=$(pwd)
+export MAKEFLAGS=-j$(nproc)
+export NOCONFIGURE=1
+./autogen.sh
+
+git clone https://github.com/sparklemotion/nokogiri
+cd nokogiri
+bundle install
+bundle exec rake compile -- --with-xml2-source-dir=${LIBXML_DIR}
+bundle exec rake test
diff --git a/.gitlab-ci/downstream-perl.sh b/.gitlab-ci/downstream-perl.sh
new file mode 100644
index 0000000..84e6859
--- /dev/null
+++ b/.gitlab-ci/downstream-perl.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+set -e
+
+sh autogen.sh --without-python
+make -j$(nproc)
+
+srcdir=$(pwd)
+incdir=$srcdir/include
+libdir=$srcdir/.libs
+
+git clone --depth 1 -b test-suite-libxml2 \
+    https://github.com/nwellnhof/perl-XML-LibXML.git
+cd perl-XML-LibXML
+
+perl Makefile.PL INC="-I$incdir" LIBS="-L$libdir -lxml2"
+make
+make test
diff --git a/.gitlab-ci/downstream-php.sh b/.gitlab-ci/downstream-php.sh
new file mode 100644
index 0000000..45ec7d8
--- /dev/null
+++ b/.gitlab-ci/downstream-php.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+srcdir=$(pwd)
+
+mkdir -p install
+installdir="$srcdir/install"
+export PKG_CONFIG_PATH="$installdir/lib/pkgconfig"
+
+sh autogen.sh "--prefix=$installdir" --without-python
+make -j$(nproc)
+make install
+
+git clone --depth 1 https://gitlab.gnome.org/GNOME/libxslt.git
+cd libxslt
+sh autogen.sh \
+    "--prefix=$installdir" \
+    "--with-libxml-prefix=$installdir" \
+    --without-python
+make -j$(nproc)
+make install
+cd ..
+
+git clone --depth 1 https://github.com/php/php-src.git
+cd php-src
+./buildconf
+./configure --with-xsl --enable-soap --enable-debug
+make -j$(nproc)
+make TESTS=" \
+    -g FAIL \
+    --no-progress \
+    ext/dom \
+    ext/libxml \
+    ext/simplexml \
+    ext/soap \
+    ext/xml \
+    ext/xmlreader \
+    ext/xmlwriter \
+    ext/xsl \
+" test
diff --git a/.gitlab-ci/setup_mingw.sh b/.gitlab-ci/setup_mingw.sh
index 7e61c34..e9df9a6 100644
--- a/.gitlab-ci/setup_mingw.sh
+++ b/.gitlab-ci/setup_mingw.sh
@@ -10,8 +10,9 @@
     pacman --noconfirm -S --needed ${prefix}$module
 done
 
-if [ ! -e libxml2-build/xmlconf ]; then
-    mkdir -p libxml2-build
+mkdir -p libxml2-build
+
+if [ ! -e xmlconf ]; then
     wget https://www.w3.org/XML/Test/xmlts20080827.tar -O - |
-       tar -x -C libxml2-build
+       tar -x
 fi
diff --git a/.gitlab-ci/test_meson.sh b/.gitlab-ci/test_meson.sh
index 3e815fd..9aebed6 100644
--- a/.gitlab-ci/test_meson.sh
+++ b/.gitlab-ci/test_meson.sh
@@ -11,7 +11,9 @@
        --werror \
        --buildtype=debugoptimized \
        --default-library shared \
+       -Dlegacy=enabled \
        builddir
 
-ninja -C builddir test
+ninja -C builddir
 
+meson test --verbose -C builddir
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2af1e6f..e136f21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,35 +1,31 @@
 cmake_minimum_required(VERSION 3.18)
 
-file(STRINGS "configure.ac" CONFIGURE_AC_LINES)
-foreach(line ${CONFIGURE_AC_LINES})
-    if(line MATCHES [[^m4_define\(\[(MAJOR_VERSION|MINOR_VERSION|MICRO_VERSION)\],[ \t]*([0-9]+)\)$]])
-        set(LIBXML_${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
-    elseif(line MATCHES "^(LIBXML_MAJOR_VERSION|LIBXML_MINOR_VERSION|LIBXML_MICRO_VERSION)=([0-9]+)$")
-        set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
-    endif()
-endforeach()
-set(VERSION "${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}")
+file(READ "VERSION" VERSION)
+string(STRIP ${VERSION} VERSION)
+if(${VERSION} MATCHES [[([0-9]+)\.([0-9]+)\.([0-9]+)]])
+    set(LIBXML_MAJOR_VERSION ${CMAKE_MATCH_1})
+    set(LIBXML_MINOR_VERSION ${CMAKE_MATCH_2})
+    set(LIBXML_MICRO_VERSION ${CMAKE_MATCH_3})
+endif()
 
 project(libxml2 VERSION ${VERSION} LANGUAGES C)
 
+set(CMAKE_C_STANDARD 11)
+
 include(CheckCSourceCompiles)
 include(CheckFunctionExists)
 include(CheckIncludeFiles)
 include(CheckLibraryExists)
-include(CheckLinkerFlag)
 include(CheckStructHasMember)
 include(CheckSymbolExists)
+include(CMakeDependentOption)
 include(CMakePackageConfigHelpers)
 include(FindPkgConfig)
 include(GNUInstallDirs)
 
 option(BUILD_SHARED_LIBS "Build shared libraries" ON)
-set(LIBXML2_WITH_AUTOMATA ON)
-option(LIBXML2_WITH_C14N "Add the Canonicalization support" ON)
 option(LIBXML2_WITH_CATALOG "Add the Catalog support" ON)
 option(LIBXML2_WITH_DEBUG "Add the debugging module" ON)
-set(LIBXML2_WITH_EXPR ON)
-option(LIBXML2_WITH_FTP "Add the FTP support" OFF)
 option(LIBXML2_WITH_HTML "Add the HTML support" ON)
 option(LIBXML2_WITH_HTTP "Add the HTTP support" OFF)
 option(LIBXML2_WITH_ICONV "Add ICONV support" ON)
@@ -43,36 +39,57 @@
 option(LIBXML2_WITH_PROGRAMS "Build programs" ON)
 option(LIBXML2_WITH_PUSH "Add the PUSH parser interfaces" ON)
 option(LIBXML2_WITH_PYTHON "Build Python bindings" ON)
-option(LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON)
+option(LIBXML2_WITH_READLINE "readline support for xmllint shell" OFF)
 option(LIBXML2_WITH_REGEXPS "Add Regular Expressions support" ON)
 option(LIBXML2_WITH_SAX1 "Add the older SAX1 interface" ON)
-option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON)
-option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON)
 option(LIBXML2_WITH_TESTS "Build tests" ON)
 option(LIBXML2_WITH_THREADS "Add multithread support" ON)
-option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF)
 option(LIBXML2_WITH_TLS "Enable thread-local storage" OFF)
-option(LIBXML2_WITH_TREE "Add the DOM like tree manipulation APIs" ON)
-set(LIBXML2_WITH_UNICODE ON)
 option(LIBXML2_WITH_VALID "Add the DTD validation support" ON)
-option(LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON)
 option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON)
 option(LIBXML2_WITH_XPATH "Add the XPATH support" ON)
-option(LIBXML2_WITH_XPTR "Add the XPointer support" ON)
-option(LIBXML2_WITH_XPTR_LOCS "Add support for XPointer locations" OFF)
-option(LIBXML2_WITH_ZLIB "Use libz" OFF)
-set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite")
+
+cmake_dependent_option(
+    LIBXML2_WITH_ZLIB "Use libz" OFF
+    "NOT LIBXML2_WITH_LEGACY" ON)
+
+cmake_dependent_option(
+    LIBXML2_WITH_C14N "Add the Canonicalization support" ON
+    "LIBXML2_WITH_OUTPUT;LIBXML2_WITH_XPATH" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_HISTORY "history support for xmllint shell" OFF
+    "LIBXML2_WITH_READLINE" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_READER "Add the xmlReader parsing interface" ON
+    "LIBXML2_WITH_PUSH" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_SCHEMAS "Add XML Schemas 1.0 support" ON
+    "LIBXML2_WITH_PATTERN;LIBXML2_WITH_REGEXPS" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON
+    "LIBXML2_WITH_PATTERN;LIBXML2_WITH_XPATH" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_THREAD_ALLOC "Add per-thread malloc hooks" OFF
+    "LIBXML2_WITH_THREADS" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_WRITER "Add the xmlWriter saving interface" ON
+    "LIBXML2_WITH_OUTPUT;LIBXML2_WITH_PUSH" OFF)
+cmake_dependent_option(
+    LIBXML2_WITH_XPTR "Add the XPointer support" ON
+    "LIBXML2_WITH_XPATH" OFF)
+
+cmake_dependent_option(
+    LIBXML2_WITH_RELAXNG "Add Relax-NG support" ON
+    "LIBXML2_WITH_REGEXPS;LIBXML2_WITH_SCHEMAS" OFF)
 
 if(LIBXML2_WITH_PYTHON)
-    check_include_files(unistd.h HAVE_UNISTD_H)
-    check_symbol_exists(F_GETFL fcntl.h HAVE_F_GETFL)
     find_package(Python COMPONENTS Interpreter Development REQUIRED)
     #set(LIBXML2_PYTHON_INSTALL_DIR ${Python_SITEARCH} CACHE PATH "Python bindings install directory")
     set(LIBXML2_PYTHON_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/python"
         CACHE PATH "Python bindings install directory")
 endif()
 
-foreach(VARIABLE IN ITEMS WITH_AUTOMATA WITH_C14N WITH_CATALOG WITH_DEBUG WITH_EXPR WITH_FTP WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LEGACY WITH_LZMA WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_TREE WITH_UNICODE WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_XPTR_LOCS WITH_ZLIB)
+foreach(VARIABLE IN ITEMS WITH_C14N WITH_CATALOG WITH_DEBUG WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LZMA WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_RELAXNG WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_ZLIB)
     if(LIBXML2_${VARIABLE})
         set(${VARIABLE} 1)
     else()
@@ -90,19 +107,12 @@
 
 set(MODULE_EXTENSION "${CMAKE_SHARED_LIBRARY_SUFFIX}")
 
-set(PACKAGE "libxml2")
-set(PACKAGE_NAME "libxml2")
-set(PACKAGE_STRING "libxml2 ${VERSION}")
-set(PACKAGE_TARNAME "libxml2")
-set(PACKAGE_URL "https://gitlab.gnome.org/GNOME/libxml2")
-set(PACKAGE_VERSION ${VERSION})
-
 if(LIBXML2_WITH_ICONV)
     find_package(Iconv REQUIRED)
 endif()
 
 if(LIBXML2_WITH_ICU)
-    find_package(ICU REQUIRED COMPONENTS data i18n uc)
+    find_package(ICU REQUIRED COMPONENTS uc)
 endif()
 
 if(LIBXML2_WITH_LZMA)
@@ -119,72 +129,25 @@
     find_package(ZLIB REQUIRED)
 endif()
 
-if (NOT MSVC)
-    check_c_source_compiles("
-        void __attribute__((destructor))
-        f(void) {}
-        int main(void) { return 0; }
-    " HAVE_ATTRIBUTE_DESTRUCTOR)
-    if(HAVE_ATTRIBUTE_DESTRUCTOR)
-        set(ATTRIBUTE_DESTRUCTOR "__attribute__((destructor))")
-    endif()
-    check_include_files(arpa/inet.h HAVE_ARPA_INET_H)
-    check_function_exists(class HAVE_CLASS)
-    check_include_files(dlfcn.h HAVE_DLFCN_H)
-    check_library_exists(dl dlopen "" HAVE_DLOPEN)
-    check_include_files(dl.h HAVE_DL_H)
-    check_include_files(fcntl.h HAVE_FCNTL_H)
-    check_function_exists(fpclass HAVE_FPCLASS)
-    check_function_exists(ftime HAVE_FTIME)
-    check_function_exists(getentropy HAVE_GETENTROPY)
-    check_function_exists(gettimeofday HAVE_GETTIMEOFDAY)
-    check_library_exists(history append_history "" HAVE_LIBHISTORY)
+check_c_source_compiles("
+    void __attribute__((destructor))
+    f(void) {}
+    int main(void) { return 0; }
+" HAVE_FUNC_ATTRIBUTE_DESTRUCTOR)
+check_symbol_exists(getentropy "sys/random.h" HAVE_DECL_GETENTROPY)
+check_symbol_exists(glob "glob.h" HAVE_DECL_GLOB)
+check_symbol_exists(mmap "sys/mman.h" HAVE_DECL_MMAP)
+check_include_files(stdint.h HAVE_STDINT_H)
+
+if(LIBXML2_WITH_READLINE)
     check_library_exists(readline readline "" HAVE_LIBREADLINE)
-    check_function_exists(mmap HAVE_MMAP)
-    check_function_exists(munmap HAVE_MUNMAP)
-    check_include_files(netdb.h HAVE_NETDB_H)
-    check_include_files(netinet/in.h HAVE_NETINET_IN_H)
+    if (LIBXML2_WITH_HISTORY)
+        check_library_exists(history append_history "" HAVE_LIBHISTORY)
+    endif()
+endif()
+
+if(LIBXML2_WITH_HTTP)
     check_include_files(poll.h HAVE_POLL_H)
-    check_library_exists(dld shl_load "" HAVE_SHLLOAD)
-    check_function_exists(stat HAVE_STAT)
-    check_include_files(stdint.h HAVE_STDINT_H)
-    check_include_files(sys/mman.h HAVE_SYS_MMAN_H)
-    if (APPLE)
-        # In old macOS SDKs (ex: 10.15), sys/random.h fails to include header files it needs, so add them here.
-        check_include_files("Availability.h;stddef.h;sys/random.h" HAVE_SYS_RANDOM_H)
-    else()
-        check_include_files(sys/random.h HAVE_SYS_RANDOM_H)
-    endif()
-    check_include_files(sys/select.h HAVE_SYS_SELECT_H)
-    check_include_files(sys/socket.h HAVE_SYS_SOCKET_H)
-    check_include_files(sys/stat.h HAVE_SYS_STAT_H)
-    check_include_files(sys/timeb.h HAVE_SYS_TIMEB_H)
-    check_include_files(sys/time.h HAVE_SYS_TIME_H)
-    check_include_files(unistd.h HAVE_UNISTD_H)
-    check_c_source_compiles("
-        #include <stddef.h>
-        #include <sys/socket.h>
-        int main() { (void) getsockopt(1, 1, 1, NULL, (socklen_t*) NULL); return 0; }
-    " XML_SOCKLEN_T_SOCKLEN_T)
-    if(XML_SOCKLEN_T_SOCKLEN_T)
-        set(XML_SOCKLEN_T socklen_t)
-    else()
-        check_c_source_compiles("
-            #include <stddef.h>
-            #include <sys/socket.h>
-            int main() { (void) getsockopt(1, 1, 1, NULL, (size_t*) NULL); return 0; }
-        " XML_SOCKLEN_T_SIZE_T)
-        if(XML_SOCKLEN_T_SIZE_T)
-            set(XML_SOCKLEN_T size_t)
-        else()
-            check_c_source_compiles("
-                #include <stddef.h>
-                #include <sys/socket.h>
-                int main() { (void) getsockopt (1, 1, 1, NULL, (int*) NULL); return 0; }
-            " XML_SOCKLEN_T_INT)
-            set(XML_SOCKLEN_T int)
-        endif()
-    endif()
 endif()
 
 if(LIBXML2_WITH_TLS)
@@ -265,50 +228,79 @@
 set(
     LIBXML2_SRCS
     buf.c
-    c14n.c
-    catalog.c
     chvalid.c
-    debugXML.c
     dict.c
     encoding.c
     entities.c
     error.c
     globals.c
     hash.c
-    HTMLparser.c
-    HTMLtree.c
-    legacy.c
     list.c
-    nanoftp.c
-    nanohttp.c
     parser.c
     parserInternals.c
-    pattern.c
-    relaxng.c
-    SAX.c
     SAX2.c
-    schematron.c
     threads.c
     tree.c
     uri.c
     valid.c
-    xinclude.c
-    xlink.c
     xmlIO.c
     xmlmemory.c
-    xmlmodule.c
-    xmlreader.c
-    xmlregexp.c
-    xmlsave.c
-    xmlschemas.c
-    xmlschemastypes.c
     xmlstring.c
-    xmlunicode.c
-    xmlwriter.c
-    xpath.c
-    xpointer.c
-    xzlib.c
 )
+if(LIBXML2_WITH_C14N)
+    list(APPEND LIBXML2_SRCS c14n.c)
+endif()
+if(LIBXML2_WITH_CATALOG)
+    list(APPEND LIBXML2_SRCS catalog.c)
+endif()
+if(LIBXML2_WITH_DEBUG)
+    list(APPEND LIBXML2_SRCS debugXML.c)
+endif()
+if(LIBXML2_WITH_HTML)
+    list(APPEND LIBXML2_SRCS HTMLparser.c HTMLtree.c)
+endif()
+if(LIBXML2_WITH_HTTP)
+    list(APPEND LIBXML2_SRCS nanohttp.c)
+endif()
+if(LIBXML2_WITH_LZMA)
+    list(APPEND LIBXML2_SRCS xzlib.c)
+endif()
+if(LIBXML2_WITH_MODULES)
+    list(APPEND LIBXML2_SRCS xmlmodule.c)
+endif()
+if(LIBXML2_WITH_OUTPUT)
+    list(APPEND LIBXML2_SRCS xmlsave.c)
+endif()
+if(LIBXML2_WITH_PATTERN)
+    list(APPEND LIBXML2_SRCS pattern.c)
+endif()
+if(LIBXML2_WITH_READER)
+    list(APPEND LIBXML2_SRCS xmlreader.c)
+endif()
+if(LIBXML2_WITH_REGEXPS)
+    list(APPEND LIBXML2_SRCS xmlregexp.c xmlunicode.c)
+endif()
+if(LIBXML2_WITH_RELAXNG)
+    list(APPEND LIBXML2_SRCS relaxng.c)
+endif()
+if(LIBXML2_WITH_SCHEMAS)
+    list(APPEND LIBXML2_SRCS xmlschemas.c xmlschemastypes.c)
+endif()
+if(LIBXML2_WITH_SCHEMATRON)
+    list(APPEND LIBXML2_SRCS schematron.c)
+endif()
+if(LIBXML2_WITH_WRITER)
+    list(APPEND LIBXML2_SRCS xmlwriter.c)
+endif()
+if(LIBXML2_WITH_XINCLUDE)
+    list(APPEND LIBXML2_SRCS xinclude.c)
+endif()
+if(LIBXML2_WITH_XPATH)
+    list(APPEND LIBXML2_SRCS xpath.c)
+endif()
+if(LIBXML2_WITH_XPTR)
+    list(APPEND LIBXML2_SRCS xlink.c xpointer.c)
+endif()
 
 if(WIN32)
     list(APPEND LIBXML2_SRCS win32/libxml2.rc)
@@ -325,14 +317,6 @@
 add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS})
 add_library(LibXml2::LibXml2 ALIAS LibXml2)
 
-target_compile_definitions(LibXml2 PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
-
-if(LIBXML2_WITH_THREADS)
-    if(NOT WIN32)
-        check_include_files(pthread.h HAVE_PTHREAD_H)
-    endif()
-endif()
-
 target_include_directories(
     LibXml2
     PUBLIC
@@ -342,14 +326,16 @@
 )
 
 if(LIBXML2_WITH_MODULES)
+    check_library_exists(dl dlopen "" HAVE_DLOPEN)
     if(HAVE_DLOPEN)
         target_link_libraries(LibXml2 PRIVATE dl)
-        set(MODULE_PLATFORM_LIBS "-ldl")
-    endif()
-
-    if(HAVE_SHLLOAD)
-        target_link_libraries(LibXml2 PRIVATE dld)
-        set(MODULE_PLATFORM_LIBS "-ldld")
+        set(MODULE_LIBS "-ldl")
+    else()
+        check_library_exists(dld shl_load "" HAVE_SHLLOAD)
+        if(HAVE_SHLLOAD)
+            target_link_libraries(LibXml2 PRIVATE dld)
+            set(MODULE_LIBS "-ldld")
+        endif()
     endif()
 endif()
 
@@ -359,10 +345,12 @@
 endif()
 
 if(WIN32)
-    target_link_libraries(LibXml2 PRIVATE ws2_32)
-    set(WINSOCK_LIBS "-lws2_32")
     target_link_libraries(LibXml2 PRIVATE bcrypt)
     set(CRYPTO_LIBS "-lbcrypt")
+    if(LIBXML2_WITH_HTTP)
+        target_link_libraries(LibXml2 PRIVATE ws2_32)
+        set(WINSOCK_LIBS "-lws2_32")
+    endif()
 endif()
 
 if(LIBXML2_WITH_ICONV)
@@ -373,16 +361,12 @@
 endif()
 
 if(LIBXML2_WITH_ICU)
-    target_link_libraries(LibXml2 PRIVATE ICU::data ICU::i18n ICU::uc)
-    if(WIN32)
-        set(ICU_LDFLAGS "-licudt -licuin -licuuc")
-    else()
-        set(ICU_LDFLAGS "-licudata -licui18n -licuuc")
-    endif()
+    target_link_libraries(LibXml2 PRIVATE ICU::uc)
+    set(ICU_LDFLAGS "-licuuc")
     list(APPEND XML_PRIVATE_LIBS "${ICU_LDFLAGS}")
-    pkg_check_modules(ICU_PC IMPORTED_TARGET icu-i18n)
+    pkg_check_modules(ICU_PC IMPORTED_TARGET icu-uc)
     if(ICU_PC_FOUND)
-        list(APPEND XML_PC_REQUIRES icu-i18n)
+        list(APPEND XML_PC_REQUIRES icu-uc)
     else()
         list(APPEND XML_PC_LIBS "${ICU_LDFLAGS}")
     endif()
@@ -421,17 +405,13 @@
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wshadow \
 -Wpointer-arith -Wcast-align -Wwrite-strings \
 -Wstrict-prototypes -Wmissing-prototypes \
--Wno-long-long -Wno-format-extra-args")
-
-    if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
-        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()
+-Wno-long-long -Wno-format-extra-args -Wno-array-bounds")
 endif()
 
+set(LIBXML_MINOR_COMPAT 14)
+math(EXPR LIBXML_SOVERSION "${LIBXML_MAJOR_VERSION} + ${LIBXML_MINOR_COMPAT}")
+math(EXPR LIBXML_AGE "${LIBXML_MINOR_VERSION} - ${LIBXML_MINOR_COMPAT}")
+math(EXPR LIBXML_MACHO_COMPAT "${LIBXML_MAJOR_VERSION} + ${LIBXML_MINOR_VERSION} + 1")
 set_target_properties(
     LibXml2
     PROPERTIES
@@ -439,8 +419,10 @@
     OUTPUT_NAME xml2
     POSITION_INDEPENDENT_CODE ON
     PREFIX lib
-    VERSION ${PROJECT_VERSION}
-    SOVERSION ${LIBXML_MAJOR_VERSION}
+    VERSION "${LIBXML_SOVERSION}.${LIBXML_AGE}.${LIBXML_MICRO_VERSION}"
+    SOVERSION ${LIBXML_SOVERSION}
+    MACHO_COMPATIBILITY_VERSION ${LIBXML_MACHO_COMPAT}
+    MACHO_CURRENT_VERSION "${LIBXML_MACHO_COMPAT}.${LIBXML_MICRO_VERSION}"
 )
 
 if(MSVC)
@@ -462,6 +444,8 @@
     endif()
 endif()
 
+set(XML_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}")
+
 install(FILES ${LIBXML2_HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
 
 install(
@@ -477,15 +461,14 @@
 endif()
 
 if(LIBXML2_WITH_PROGRAMS)
-    set(
-        PROGRAMS
-        xmlcatalog
-        xmllint
-    )
+    add_executable(xmllint xmllint.c shell.c lintmain.c)
+    set(PROGRAMS xmllint)
+    if(LIBXML2_WITH_CATALOG AND LIBXML2_WITH_OUTPUT)
+        add_executable(xmlcatalog xmlcatalog.c)
+        list(APPEND PROGRAMS xmlcatalog)
+    endif()
     foreach(PROGRAM ${PROGRAMS})
-        add_executable(${PROGRAM} ${PROGRAM}.c)
         add_executable(LibXml2::${PROGRAM} ALIAS ${PROGRAM})
-        target_compile_definitions(${PROGRAM} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
         target_link_libraries(${PROGRAM} LibXml2)
         if(HAVE_LIBHISTORY)
             target_link_libraries(${PROGRAM} history)
@@ -511,22 +494,20 @@
         testlimits
         testparser
         testrecurse
-        testThreads
     )
     foreach(TEST ${TESTS})
         add_executable(${TEST} ${TEST}.c)
-        target_compile_definitions(${TEST} PRIVATE SYSCONFDIR="${CMAKE_INSTALL_FULL_SYSCONFDIR}")
         target_link_libraries(${TEST} LibXml2)
     endforeach()
     if(Threads_FOUND)
-        foreach(TEST runtest testThreads)
+        foreach(TEST runtest)
             target_link_libraries(${TEST} Threads::Threads)
         endforeach()
     endif()
     add_test(NAME runtest COMMAND runtest --out ${CMAKE_CURRENT_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     add_test(NAME runsuite COMMAND runsuite WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-    if(EXISTS ${LIBXML2_XMLCONF_WORKING_DIR}/xmlconf/xmlconf.xml)
-        add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${LIBXML2_XMLCONF_WORKING_DIR})
+    if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/xmlconf/xmlconf.xml)
+        add_test(NAME runxmlconf COMMAND runxmlconf WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     endif()
     if(NOT WIN32)
         add_test(NAME testapi COMMAND testapi)
@@ -535,7 +516,6 @@
     add_test(NAME testdict COMMAND testdict)
     add_test(NAME testparser COMMAND testparser WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     add_test(NAME testrecurse COMMAND testrecurse WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
-    add_test(NAME testThreads COMMAND testThreads WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
 endif()
 
 if(LIBXML2_WITH_PYTHON)
@@ -543,9 +523,6 @@
         COMMAND
         ${Python_EXECUTABLE}
         ${CMAKE_CURRENT_SOURCE_DIR}/python/generator.py
-        ${CMAKE_CURRENT_SOURCE_DIR}/doc/libxml2-api.xml
-        ${CMAKE_CURRENT_SOURCE_DIR}/python/libxml2-python-api.xml
-        WORKING_DIRECTORY
         ${CMAKE_CURRENT_BINARY_DIR}
     )
     file(READ python/libxml.py LIBXML_PY)
@@ -592,10 +569,13 @@
 endif()
 
 install(FILES doc/xml2-config.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
-install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
-install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+if(LIBXML2_WITH_PROGRAMS)
+    install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+    install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation)
+endif()
 install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation
     PATTERN "Makefile.*" EXCLUDE
+    PATTERN "meson.build" EXCLUDE
     PATTERN "*.1" EXCLUDE
     PATTERN "*.py" EXCLUDE
     PATTERN "*.res" EXCLUDE
@@ -633,11 +613,7 @@
     COMPONENT development
 )
 
-if(MSVC)
-    configure_file(include/win32config.h config.h COPYONLY)
-else()
-    configure_file(config.h.cmake.in config.h)
-endif()
+configure_file(config.h.cmake.in config.h)
 configure_file(include/libxml/xmlversion.h.in libxml/xmlversion.h)
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlversion.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development)
 
@@ -646,7 +622,7 @@
     configure_file(python/setup.py.in setup.py @ONLY)
 endif()
 
-set(NON_PC_LIBS "${THREAD_LIBS} ${ICONV_LIBS} ${LIBM} ${WINSOCK_LIBS} ${CRYPTO_LIBS}")
+set(NON_PC_LIBS "${THREAD_LIBS} ${ICONV_LIBS} ${LIBM} ${WINSOCK_LIBS} ${CRYPTO_LIBS} ${MODULE_LIBS}")
 list(APPEND XML_PC_LIBS "${NON_PC_LIBS}")
 list(APPEND XML_PRIVATE_LIBS "${NON_PC_LIBS}")
 list(REMOVE_DUPLICATES XML_PC_LIBS)
@@ -665,11 +641,20 @@
     set(XML_PC_LIBS_PRIVATE "
 Libs.private:")
 else()
-    target_compile_definitions(LibXml2 PUBLIC LIBXML_STATIC)
-    set(XML_CFLAGS "-DLIBXML_STATIC")
     set(XML_PRIVATE_LIBS_NO_SHARED "${XML_PRIVATE_LIBS}")
 endif()
 
+if(WIN32)
+    set(XML_STATIC_CFLAGS "-DLIBXML_STATIC")
+    if (BUILD_SHARED_LIBS)
+        set(XML_PC_CFLAGS_PRIVATE "
+Cflags.private:")
+    else()
+        target_compile_definitions(LibXml2 PUBLIC LIBXML_STATIC)
+        set(XML_CFLAGS "${XML_STATIC_CFLAGS}")
+    endif()
+endif()
+
 file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}")
 string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}")
 
@@ -690,10 +675,6 @@
 configure_file(xml2-config.in xml2-config @ONLY)
 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development)
 
-if(UNIX)
-    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/libxml.m4 DESTINATION ${CMAKE_INSTALL_DATADIR}/aclocal)
-endif()
-
 set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2")
 set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}")
 
diff --git a/Copyright b/Copyright
index f76a86d..8c0b7c1 100644
--- a/Copyright
+++ b/Copyright
@@ -3,6 +3,7 @@
 notices) all the files are:
 
  Copyright (C) 1998-2012 Daniel Veillard.  All Rights Reserved.
+ Copyright (C) The Libxml2 Contributors.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/HTMLparser.c b/HTMLparser.c
index 2213592..2260ef1 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -1,5 +1,14 @@
 /*
- * HTMLparser.c : an HTML 4.0 non-verifying parser
+ * HTMLparser.c : an HTML parser
+ *
+ * References:
+ *   HTML Living Standard
+ *     https://html.spec.whatwg.org/multipage/parsing.html
+ *
+ * Tokenization now conforms to HTML5. Tree construction still follows
+ * a custom, non-standard implementation. See:
+ *
+ *     https://gitlab.gnome.org/GNOME/libxml2/-/issues/211
  *
  * See Copyright for the status of this software.
  *
@@ -27,22 +36,75 @@
 #include <libxml/uri.h>
 
 #include "private/buf.h"
+#include "private/dict.h"
 #include "private/enc.h"
 #include "private/error.h"
 #include "private/html.h"
 #include "private/io.h"
+#include "private/memory.h"
 #include "private/parser.h"
 #include "private/tree.h"
 
 #define HTML_MAX_NAMELEN 1000
+#define HTML_MAX_ATTRS 100000000 /* 100 million */
 #define HTML_PARSER_BIG_BUFFER_SIZE 1000
 #define HTML_PARSER_BUFFER_SIZE 100
 
+#define IS_WS_HTML(c) \
+    (((c) == 0x20) || \
+     (((c) >= 0x09) && ((c) <= 0x0D) && ((c) != 0x0B)))
+
+#define IS_HEX_DIGIT(c) \
+    ((IS_ASCII_DIGIT(c)) || \
+     ((((c) | 0x20) >= 'a') && (((c) | 0x20) <= 'f')))
+
+#define IS_UPPER(c) \
+    (((c) >= 'A') && ((c) <= 'Z'))
+
+#define IS_ALNUM(c) \
+    (IS_ASCII_LETTER(c) || IS_ASCII_DIGIT(c))
+
+typedef enum {
+    INSERT_INITIAL = 1,
+    INSERT_IN_HEAD = 3,
+    INSERT_IN_BODY = 10
+} htmlInsertMode;
+
+typedef const unsigned htmlAsciiMask[2];
+
+static htmlAsciiMask MASK_DQ = {
+    0,
+    1u << ('"' - 32),
+};
+static htmlAsciiMask MASK_SQ = {
+    0,
+    1u << ('\'' - 32),
+};
+static htmlAsciiMask MASK_GT = {
+    0,
+    1u << ('>' - 32),
+};
+static htmlAsciiMask MASK_DASH = {
+    0,
+    1u << ('-' - 32),
+};
+static htmlAsciiMask MASK_WS_GT = {
+    1u << 0x09 | 1u << 0x0A | 1u << 0x0C | 1u << 0x0D,
+    1u << (' ' - 32) | 1u << ('>' - 32),
+};
+static htmlAsciiMask MASK_DQ_GT = {
+    0,
+    1u << ('"' - 32) | 1u << ('>' - 32),
+};
+static htmlAsciiMask MASK_SQ_GT = {
+    0,
+    1u << ('\'' - 32) | 1u << ('>' - 32),
+};
+
 static int htmlOmittedDefaultValue = 1;
 
-xmlChar * htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len,
-			     xmlChar end, xmlChar  end2, xmlChar end3);
-static void htmlParseComment(htmlParserCtxtPtr ctxt);
+static int
+htmlParseElementInternal(htmlParserCtxtPtr ctxt);
 
 /************************************************************************
  *									*
@@ -81,23 +143,6 @@
                str1, str2, NULL, 0, msg, str1, str2);
 }
 
-/**
- * htmlParseErrInt:
- * @ctxt:  an HTML parser context
- * @error:  the error number
- * @msg:  the error message
- * @val:  integer info
- *
- * Handle a fatal parser error, i.e. violating Well-Formedness constraints
- */
-static void LIBXML_ATTR_FORMAT(3,0)
-htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error,
-             const char *msg, int val)
-{
-    xmlCtxtErr(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR,
-               NULL, NULL, NULL, val, msg, val);
-}
-
 /************************************************************************
  *									*
  *	Parser stacks related functions and macros		*
@@ -116,20 +161,25 @@
 static int
 htmlnamePush(htmlParserCtxtPtr ctxt, const xmlChar * value)
 {
-    if ((ctxt->html < 3) && (xmlStrEqual(value, BAD_CAST "head")))
-        ctxt->html = 3;
-    if ((ctxt->html < 10) && (xmlStrEqual(value, BAD_CAST "body")))
-        ctxt->html = 10;
+    if ((ctxt->html < INSERT_IN_HEAD) && (xmlStrEqual(value, BAD_CAST "head")))
+        ctxt->html = INSERT_IN_HEAD;
+    if ((ctxt->html < INSERT_IN_BODY) && (xmlStrEqual(value, BAD_CAST "body")))
+        ctxt->html = INSERT_IN_BODY;
     if (ctxt->nameNr >= ctxt->nameMax) {
-        size_t newSize = ctxt->nameMax * 2;
         const xmlChar **tmp;
+        int newSize;
 
-        tmp = xmlRealloc((xmlChar **) ctxt->nameTab,
-                         newSize * sizeof(ctxt->nameTab[0]));
-        if (tmp == NULL) {
+        newSize = xmlGrowCapacity(ctxt->nameMax, sizeof(tmp[0]),
+                                  10, XML_MAX_ITEMS);
+        if (newSize < 0) {
             htmlErrMemory(ctxt);
             return (-1);
         }
+        tmp = xmlRealloc(ctxt->nameTab, newSize * sizeof(tmp[0]));
+        if (tmp == NULL) {
+            htmlErrMemory(ctxt);
+            return(-1);
+        }
         ctxt->nameTab = tmp;
         ctxt->nameMax = newSize;
     }
@@ -177,17 +227,22 @@
 htmlNodeInfoPush(htmlParserCtxtPtr ctxt, htmlParserNodeInfo *value)
 {
     if (ctxt->nodeInfoNr >= ctxt->nodeInfoMax) {
-        if (ctxt->nodeInfoMax == 0)
-                ctxt->nodeInfoMax = 5;
-        ctxt->nodeInfoMax *= 2;
-        ctxt->nodeInfoTab = (htmlParserNodeInfo *)
-                         xmlRealloc((htmlParserNodeInfo *)ctxt->nodeInfoTab,
-                                    ctxt->nodeInfoMax *
-                                    sizeof(ctxt->nodeInfoTab[0]));
-        if (ctxt->nodeInfoTab == NULL) {
+        xmlParserNodeInfo *tmp;
+        int newSize;
+
+        newSize = xmlGrowCapacity(ctxt->nodeInfoMax, sizeof(tmp[0]),
+                                  5, XML_MAX_ITEMS);
+        if (newSize < 0) {
             htmlErrMemory(ctxt);
             return (0);
         }
+        tmp = xmlRealloc(ctxt->nodeInfoTab, newSize * sizeof(tmp[0]));
+        if (tmp == NULL) {
+            htmlErrMemory(ctxt);
+            return (0);
+        }
+        ctxt->nodeInfoTab = tmp;
+        ctxt->nodeInfoMax = newSize;
     }
     ctxt->nodeInfoTab[ctxt->nodeInfoNr] = *value;
     ctxt->nodeInfo = &ctxt->nodeInfoTab[ctxt->nodeInfoNr];
@@ -238,9 +293,6 @@
  *
  * Clean macros, not dependent of an ASCII context, expect UTF-8 encoding
  *
- *   NEXT    Skip to the next character, this does the proper decoding
- *           in UTF-8 mode. It also pop-up unfinished entities on the fly.
- *   NEXTL(l) Skip the current unicode character of l xmlChars long.
  *   COPY(to) copy one char to *to, increment CUR_PTR and to accordingly
  */
 
@@ -271,29 +323,6 @@
 /* Imported from XML */
 
 #define CUR (*ctxt->input->cur)
-#define NEXT xmlNextChar(ctxt)
-
-#define RAW (*ctxt->input->cur)
-
-
-#define NEXTL(l) do {							\
-    if (*(ctxt->input->cur) == '\n') {					\
-	ctxt->input->line++; ctxt->input->col = 1;			\
-    } else ctxt->input->col++;						\
-    ctxt->input->cur += l;						\
-  } while (0)
-
-/************
-    \
-    if (*ctxt->input->cur == '%') xmlParserHandlePEReference(ctxt);	\
-    if (*ctxt->input->cur == '&') xmlParserHandleReference(ctxt);
- ************/
-
-#define CUR_CHAR(l) htmlCurrentChar(ctxt, &l)
-
-#define COPY_BUF(l,b,i,v)						\
-    if (l == 1) b[i++] = v;						\
-    else i += xmlCopyChar(l,&b[i],v)
 
 /**
  * htmlFindEncoding:
@@ -337,9 +366,7 @@
         return(NULL);
     cur += 8;
     start = cur;
-    while (((*cur >= 'A') && (*cur <= 'Z')) ||
-           ((*cur >= 'a') && (*cur <= 'z')) ||
-           ((*cur >= '0') && (*cur <= '9')) ||
+    while ((IS_ALNUM(*cur)) ||
            (*cur == '-') || (*cur == '_') || (*cur == ':') || (*cur == '/'))
            cur++;
     if (cur == start)
@@ -350,150 +377,72 @@
     return(ret);
 }
 
-/**
- * htmlCurrentChar:
- * @ctxt:  the HTML parser context
- * @len:  pointer to the length of the char read
- *
- * 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
- * If the encoding is unspecified, in the case we find an ISO-Latin-1
- * char, then the encoding converter is plugged in automatically.
- *
- * Returns the current char value and its length
- */
+static int
+htmlMaskMatch(htmlAsciiMask mask, unsigned c) {
+    if (c >= 64)
+        return(0);
+    return((mask[c/32] >> (c & 31)) & 1);
+}
 
 static int
-htmlCurrentChar(xmlParserCtxtPtr ctxt, int *len) {
-    const unsigned char *cur;
-    unsigned char c;
-    unsigned int val;
+htmlValidateUtf8(xmlParserCtxtPtr ctxt, const xmlChar *str, size_t len,
+                 int partial) {
+    unsigned c = str[0];
+    int size;
 
-    if (ctxt->input->end - ctxt->input->cur < INPUT_CHUNK)
-        xmlParserGrow(ctxt);
+    if (c < 0xC2) {
+        goto invalid;
+    } else if (c < 0xE0) {
+        if (len < 2)
+            goto incomplete;
+        if ((str[1] & 0xC0) != 0x80)
+            goto invalid;
+        size = 2;
+    } else if (c < 0xF0) {
+        unsigned v;
 
-    if ((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) {
-        xmlChar * guess;
+        if (len < 3)
+            goto incomplete;
 
-        /*
-         * Assume it's a fixed length encoding (1) with
-         * a compatible encoding for the ASCII set, since
-         * HTML constructs only use < 128 chars
-         */
-        if (*ctxt->input->cur < 0x80) {
-            if (*ctxt->input->cur == 0) {
-                if (ctxt->input->cur < ctxt->input->end) {
-                    htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                                    "Char 0x%X out of allowed range\n", 0);
-                    *len = 1;
-                    return(' ');
-                } else {
-                    *len = 0;
-                    return(0);
-                }
-            }
-            *len = 1;
-            return(*ctxt->input->cur);
-        }
+        v = str[1] << 8 | str[2]; /* hint to generate 16-bit load */
+        v |= c << 16;
 
-        /*
-         * Humm this is bad, do an automatic flow conversion
-         */
-        guess = htmlFindEncoding(ctxt);
-        if (guess == NULL) {
-            xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
-        } else {
-            xmlSwitchEncodingName(ctxt, (const char *) guess);
-            xmlFree(guess);
-        }
-        ctxt->input->flags |= XML_INPUT_HAS_ENCODING;
-    }
+        if (((v & 0x00C0C0) != 0x008080) ||
+            ((v & 0x0F2000) == 0x000000) ||
+            ((v & 0x0F2000) == 0x0D2000))
+            goto invalid;
 
-    /*
-     * We are supposed to handle UTF8, check it's valid
-     * From rfc2044: encoding of the Unicode values on UTF-8:
-     *
-     * UCS-4 range (hex.)           UTF-8 octet sequence (binary)
-     * 0000 0000-0000 007F   0xxxxxxx
-     * 0000 0080-0000 07FF   110xxxxx 10xxxxxx
-     * 0000 0800-0000 FFFF   1110xxxx 10xxxxxx 10xxxxxx
-     *
-     * Check for the 0x110000 limit too
-     */
-    cur = ctxt->input->cur;
-    c = *cur;
-    if (c & 0x80) {
-        size_t avail;
-
-        if ((c & 0x40) == 0)
-            goto encoding_error;
-
-        avail = ctxt->input->end - ctxt->input->cur;
-
-        if ((avail < 2) || ((cur[1] & 0xc0) != 0x80))
-            goto encoding_error;
-        if ((c & 0xe0) == 0xe0) {
-            if ((avail < 3) || ((cur[2] & 0xc0) != 0x80))
-                goto encoding_error;
-            if ((c & 0xf0) == 0xf0) {
-                if (((c & 0xf8) != 0xf0) ||
-                    (avail < 4) || ((cur[3] & 0xc0) != 0x80))
-                    goto encoding_error;
-                /* 4-byte code */
-                *len = 4;
-                val = (cur[0] & 0x7) << 18;
-                val |= (cur[1] & 0x3f) << 12;
-                val |= (cur[2] & 0x3f) << 6;
-                val |= cur[3] & 0x3f;
-                if (val < 0x10000)
-                    goto encoding_error;
-            } else {
-              /* 3-byte code */
-                *len = 3;
-                val = (cur[0] & 0xf) << 12;
-                val |= (cur[1] & 0x3f) << 6;
-                val |= cur[2] & 0x3f;
-                if (val < 0x800)
-                    goto encoding_error;
-            }
-        } else {
-          /* 2-byte code */
-            *len = 2;
-            val = (cur[0] & 0x1f) << 6;
-            val |= cur[1] & 0x3f;
-            if (val < 0x80)
-                goto encoding_error;
-        }
-        if (!IS_CHAR(val)) {
-            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                            "Char 0x%X out of allowed range\n", val);
-        }
-        return(val);
+        size = 3;
     } else {
-        if (*ctxt->input->cur == 0) {
-            if (ctxt->input->cur < ctxt->input->end) {
-                htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                                "Char 0x%X out of allowed range\n", 0);
-                *len = 1;
-                return(' ');
-            } else {
-                *len = 0;
-                return(0);
-            }
-        }
-        /* 1-byte code */
-        *len = 1;
-        return(*ctxt->input->cur);
+        unsigned v;
+
+        if (len < 4)
+            goto incomplete;
+
+        v = c << 24 | str[1] << 16 | str[2] << 8 | str[3];
+
+        if (((v & 0x00C0C0C0) != 0x00808080) ||
+            (v < 0xF0900000) || (v >= 0xF4900000))
+            goto invalid;
+
+        size = 4;
     }
 
-encoding_error:
-    xmlCtxtErrIO(ctxt, XML_ERR_INVALID_ENCODING, NULL);
+    return(size);
 
-    if ((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0)
-        xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
-    *len = 1;
-    return(*ctxt->input->cur);
+incomplete:
+    if (partial)
+        return(0);
+
+invalid:
+    /* Only report the first error */
+    if ((ctxt->input->flags & XML_INPUT_ENCODING_ERROR) == 0) {
+        htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
+                     "Invalid bytes in character encoding", NULL, NULL);
+        ctxt->input->flags |= XML_INPUT_ENCODING_ERROR;
+    }
+
+    return(-1);
 }
 
 /**
@@ -507,18 +456,46 @@
 
 static int
 htmlSkipBlankChars(xmlParserCtxtPtr ctxt) {
+    const xmlChar *cur = ctxt->input->cur;
+    size_t avail = ctxt->input->end - cur;
     int res = 0;
+    int line = ctxt->input->line;
+    int col = ctxt->input->col;
 
-    while (IS_BLANK_CH(*(ctxt->input->cur))) {
-        if (*(ctxt->input->cur) == '\n') {
-            ctxt->input->line++; ctxt->input->col = 1;
-        } else ctxt->input->col++;
-        ctxt->input->cur++;
-        if (*ctxt->input->cur == 0)
-            xmlParserGrow(ctxt);
+    while (!PARSER_STOPPED(ctxt)) {
+        if (avail == 0) {
+            ctxt->input->cur = cur;
+            GROW;
+            cur = ctxt->input->cur;
+            avail = ctxt->input->end - cur;
+
+            if (avail == 0)
+                break;
+        }
+
+        if (*cur == '\n') {
+            line++;
+            col = 1;
+        } else if (IS_WS_HTML(*cur)) {
+            col++;
+        } else {
+            break;
+        }
+
+        cur += 1;
+        avail -= 1;
+
 	if (res < INT_MAX)
 	    res++;
     }
+
+    ctxt->input->cur = cur;
+    ctxt->input->line = line;
+    ctxt->input->col = col;
+
+    if (res > 8)
+        GROW;
+
     return(res);
 }
 
@@ -540,438 +517,396 @@
  *             2 means that this element is valid only in the Frameset DTD
  *
  * Name,Start Tag,End Tag,Save End,Empty,Deprecated,DTD,inline,Description
-	, subElements , impliedsubelt , Attributes, userdata
  */
 
-/* Definitions and a couple of vars for HTML Elements */
-
-#define FONTSTYLE "tt", "i", "b", "u", "s", "strike", "big", "small"
-#define NB_FONTSTYLE 8
-#define PHRASE "em", "strong", "dfn", "code", "samp", "kbd", "var", "cite", "abbr", "acronym"
-#define NB_PHRASE 10
-#define SPECIAL "a", "img", "applet", "embed", "object", "font", "basefont", "br", "script", "map", "q", "sub", "sup", "span", "bdo", "iframe"
-#define NB_SPECIAL 16
-#define INLINE FONTSTYLE, PHRASE, SPECIAL, FORMCTRL
-#define NB_INLINE NB_PCDATA + NB_FONTSTYLE + NB_PHRASE + NB_SPECIAL + NB_FORMCTRL
-#define BLOCK HEADING, LIST, "pre", "p", "dl", "div", "center", "noscript", "noframes", "blockquote", "form", "isindex", "hr", "table", "fieldset", "address"
-#define NB_BLOCK NB_HEADING + NB_LIST + 14
-#define FORMCTRL "input", "select", "textarea", "label", "button"
-#define NB_FORMCTRL 5
-#define PCDATA
-#define NB_PCDATA 0
-#define HEADING "h1", "h2", "h3", "h4", "h5", "h6"
-#define NB_HEADING 6
-#define LIST "ul", "ol", "dir", "menu"
-#define NB_LIST 4
-#define MODIFIER
-#define NB_MODIFIER 0
-#define FLOW BLOCK,INLINE
-#define NB_FLOW NB_BLOCK + NB_INLINE
-#define EMPTY NULL
-
-
-static const char* const html_flow[] = { FLOW, NULL } ;
-static const char* const html_inline[] = { INLINE, NULL } ;
-
-/* placeholders: elts with content but no subelements */
-static const char* const html_pcdata[] = { NULL } ;
-#define html_cdata html_pcdata
-
-
-/* ... and for HTML Attributes */
-
-#define COREATTRS "id", "class", "style", "title"
-#define NB_COREATTRS 4
-#define I18N "lang", "dir"
-#define NB_I18N 2
-#define EVENTS "onclick", "ondblclick", "onmousedown", "onmouseup", "onmouseover", "onmouseout", "onkeypress", "onkeydown", "onkeyup"
-#define NB_EVENTS 9
-#define ATTRS COREATTRS,I18N,EVENTS
-#define NB_ATTRS NB_NB_COREATTRS + NB_I18N + NB_EVENTS
-#define CELLHALIGN "align", "char", "charoff"
-#define NB_CELLHALIGN 3
-#define CELLVALIGN "valign"
-#define NB_CELLVALIGN 1
-
-static const char* const html_attrs[] = { ATTRS, NULL } ;
-static const char* const core_i18n_attrs[] = { COREATTRS, I18N, NULL } ;
-static const char* const core_attrs[] = { COREATTRS, NULL } ;
-static const char* const i18n_attrs[] = { I18N, NULL } ;
-
-
-/* Other declarations that should go inline ... */
-static const char* const a_attrs[] = { ATTRS, "charset", "type", "name",
-	"href", "hreflang", "rel", "rev", "accesskey", "shape", "coords",
-	"tabindex", "onfocus", "onblur", NULL } ;
-static const char* const target_attr[] = { "target", NULL } ;
-static const char* const rows_cols_attr[] = { "rows", "cols", NULL } ;
-static const char* const alt_attr[] = { "alt", NULL } ;
-static const char* const src_alt_attrs[] = { "src", "alt", NULL } ;
-static const char* const href_attrs[] = { "href", NULL } ;
-static const char* const clear_attrs[] = { "clear", NULL } ;
-static const char* const inline_p[] = { INLINE, "p", NULL } ;
-
-static const char* const flow_param[] = { FLOW, "param", NULL } ;
-static const char* const applet_attrs[] = { COREATTRS , "codebase",
-		"archive", "alt", "name", "height", "width", "align",
-		"hspace", "vspace", NULL } ;
-static const char* const area_attrs[] = { "shape", "coords", "href", "nohref",
-	"tabindex", "accesskey", "onfocus", "onblur", NULL } ;
-static const char* const basefont_attrs[] =
-	{ "id", "size", "color", "face", NULL } ;
-static const char* const quote_attrs[] = { ATTRS, "cite", NULL } ;
-static const char* const body_contents[] = { FLOW, "ins", "del", NULL } ;
-static const char* const body_attrs[] = { ATTRS, "onload", "onunload", NULL } ;
-static const char* const body_depr[] = { "background", "bgcolor", "text",
-	"link", "vlink", "alink", NULL } ;
-static const char* const button_attrs[] = { ATTRS, "name", "value", "type",
-	"disabled", "tabindex", "accesskey", "onfocus", "onblur", NULL } ;
-
-
-static const char* const col_attrs[] = { ATTRS, "span", "width", CELLHALIGN, CELLVALIGN, NULL } ;
-static const char* const col_elt[] = { "col", NULL } ;
-static const char* const edit_attrs[] = { ATTRS, "datetime", "cite", NULL } ;
-static const char* const compact_attrs[] = { ATTRS, "compact", NULL } ;
-static const char* const dl_contents[] = { "dt", "dd", NULL } ;
-static const char* const compact_attr[] = { "compact", NULL } ;
-static const char* const label_attr[] = { "label", NULL } ;
-static const char* const fieldset_contents[] = { FLOW, "legend" } ;
-static const char* const font_attrs[] = { COREATTRS, I18N, "size", "color", "face" , NULL } ;
-static const char* const form_contents[] = { HEADING, LIST, INLINE, "pre", "p", "div", "center", "noscript", "noframes", "blockquote", "isindex", "hr", "table", "fieldset", "address", NULL } ;
-static const char* const form_attrs[] = { ATTRS, "method", "enctype", "accept", "name", "onsubmit", "onreset", "accept-charset", NULL } ;
-static const char* const frame_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "noresize", "scrolling" , NULL } ;
-static const char* const frameset_attrs[] = { COREATTRS, "rows", "cols", "onload", "onunload", NULL } ;
-static const char* const frameset_contents[] = { "frameset", "frame", "noframes", NULL } ;
-static const char* const head_attrs[] = { I18N, "profile", NULL } ;
-static const char* const head_contents[] = { "title", "isindex", "base", "script", "style", "meta", "link", "object", NULL } ;
-static const char* const hr_depr[] = { "align", "noshade", "size", "width", NULL } ;
-static const char* const version_attr[] = { "version", NULL } ;
-static const char* const html_content[] = { "head", "body", "frameset", NULL } ;
-static const char* const iframe_attrs[] = { COREATTRS, "longdesc", "name", "src", "frameborder", "marginwidth", "marginheight", "scrolling", "align", "height", "width", NULL } ;
-static const char* const img_attrs[] = { ATTRS, "longdesc", "name", "height", "width", "usemap", "ismap", NULL } ;
-static const char* const embed_attrs[] = { COREATTRS, "align", "alt", "border", "code", "codebase", "frameborder", "height", "hidden", "hspace", "name", "palette", "pluginspace", "pluginurl", "src", "type", "units", "vspace", "width", NULL } ;
-static const char* const input_attrs[] = { ATTRS, "type", "name", "value", "checked", "disabled", "readonly", "size", "maxlength", "src", "alt", "usemap", "ismap", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", "accept", NULL } ;
-static const char* const prompt_attrs[] = { COREATTRS, I18N, "prompt", NULL } ;
-static const char* const label_attrs[] = { ATTRS, "for", "accesskey", "onfocus", "onblur", NULL } ;
-static const char* const legend_attrs[] = { ATTRS, "accesskey", NULL } ;
-static const char* const align_attr[] = { "align", NULL } ;
-static const char* const link_attrs[] = { ATTRS, "charset", "href", "hreflang", "type", "rel", "rev", "media", NULL } ;
-static const char* const map_contents[] = { BLOCK, "area", NULL } ;
-static const char* const name_attr[] = { "name", NULL } ;
-static const char* const action_attr[] = { "action", NULL } ;
-static const char* const blockli_elt[] = { BLOCK, "li", NULL } ;
-static const char* const meta_attrs[] = { I18N, "http-equiv", "name", "scheme", "charset", NULL } ;
-static const char* const content_attr[] = { "content", NULL } ;
-static const char* const type_attr[] = { "type", NULL } ;
-static const char* const noframes_content[] = { "body", FLOW MODIFIER, NULL } ;
-static const char* const object_contents[] = { FLOW, "param", NULL } ;
-static const char* const object_attrs[] = { ATTRS, "declare", "classid", "codebase", "data", "type", "codetype", "archive", "standby", "height", "width", "usemap", "name", "tabindex", NULL } ;
-static const char* const object_depr[] = { "align", "border", "hspace", "vspace", NULL } ;
-static const char* const ol_attrs[] = { "type", "compact", "start", NULL} ;
-static const char* const option_elt[] = { "option", NULL } ;
-static const char* const optgroup_attrs[] = { ATTRS, "disabled", NULL } ;
-static const char* const option_attrs[] = { ATTRS, "disabled", "label", "selected", "value", NULL } ;
-static const char* const param_attrs[] = { "id", "value", "valuetype", "type", NULL } ;
-static const char* const width_attr[] = { "width", NULL } ;
-static const char* const pre_content[] = { PHRASE, "tt", "i", "b", "u", "s", "strike", "a", "br", "script", "map", "q", "span", "bdo", "iframe", NULL } ;
-static const char* const script_attrs[] = { "charset", "src", "defer", "event", "for", NULL } ;
-static const char* const language_attr[] = { "language", NULL } ;
-static const char* const select_content[] = { "optgroup", "option", NULL } ;
-static const char* const select_attrs[] = { ATTRS, "name", "size", "multiple", "disabled", "tabindex", "onfocus", "onblur", "onchange", NULL } ;
-static const char* const style_attrs[] = { I18N, "media", "title", NULL } ;
-static const char* const table_attrs[] = { ATTRS, "summary", "width", "border", "frame", "rules", "cellspacing", "cellpadding", "datapagesize", NULL } ;
-static const char* const table_depr[] = { "align", "bgcolor", NULL } ;
-static const char* const table_contents[] = { "caption", "col", "colgroup", "thead", "tfoot", "tbody", "tr", NULL} ;
-static const char* const tr_elt[] = { "tr", NULL } ;
-static const char* const talign_attrs[] = { ATTRS, CELLHALIGN, CELLVALIGN, NULL} ;
-static const char* const th_td_depr[] = { "nowrap", "bgcolor", "width", "height", NULL } ;
-static const char* const th_td_attr[] = { ATTRS, "abbr", "axis", "headers", "scope", "rowspan", "colspan", CELLHALIGN, CELLVALIGN, NULL } ;
-static const char* const textarea_attrs[] = { ATTRS, "name", "disabled", "readonly", "tabindex", "accesskey", "onfocus", "onblur", "onselect", "onchange", NULL } ;
-static const char* const tr_contents[] = { "th", "td", NULL } ;
-static const char* const bgcolor_attr[] = { "bgcolor", NULL } ;
-static const char* const li_elt[] = { "li", NULL } ;
-static const char* const ul_depr[] = { "type", "compact", NULL} ;
-static const char* const dir_attr[] = { "dir", NULL} ;
-
-#define DECL (const char**)
+#define DATA_RCDATA         1
+#define DATA_RAWTEXT        2
+#define DATA_PLAINTEXT      3
+#define DATA_SCRIPT         4
+#define DATA_SCRIPT_ESC1    5
+#define DATA_SCRIPT_ESC2    6
 
 static const htmlElemDesc
 html40ElementTable[] = {
 { "a",		0, 0, 0, 0, 0, 0, 1, "anchor ",
-	DECL html_inline , NULL , DECL a_attrs , DECL target_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "abbr",	0, 0, 0, 0, 0, 0, 1, "abbreviated form",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "acronym",	0, 0, 0, 0, 0, 0, 1, "",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "address",	0, 0, 0, 0, 0, 0, 0, "information on author ",
-	DECL inline_p  , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "applet",	0, 0, 0, 0, 1, 1, 2, "java applet ",
-	DECL flow_param , NULL , NULL , DECL applet_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "area",	0, 2, 2, 1, 0, 0, 0, "client-side image map area ",
-	EMPTY ,  NULL , DECL area_attrs , DECL target_attr, DECL alt_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "b",		0, 3, 0, 0, 0, 0, 1, "bold text style",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "base",	0, 2, 2, 1, 0, 0, 0, "document base uri ",
-	EMPTY , NULL , NULL , DECL target_attr, DECL href_attrs
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "basefont",	0, 2, 2, 1, 1, 1, 1, "base font size " ,
-	EMPTY , NULL , NULL, DECL basefont_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "bdo",	0, 0, 0, 0, 0, 0, 1, "i18n bidi over-ride ",
-	DECL html_inline , NULL , DECL core_i18n_attrs, NULL, DECL dir_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "big",	0, 3, 0, 0, 0, 0, 1, "large text style",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "blockquote",	0, 0, 0, 0, 0, 0, 0, "long quotation ",
-	DECL html_flow , NULL , DECL quote_attrs , NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "body",	1, 1, 0, 0, 0, 0, 0, "document body ",
-	DECL body_contents , "div" , DECL body_attrs, DECL body_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "br",		0, 2, 2, 1, 0, 0, 1, "forced line break ",
-	EMPTY , NULL , DECL core_attrs, DECL clear_attrs , NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "button",	0, 0, 0, 0, 0, 0, 2, "push button ",
-	DECL html_flow MODIFIER , NULL , DECL button_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "caption",	0, 0, 0, 0, 0, 0, 0, "table caption ",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "center",	0, 3, 0, 0, 1, 1, 0, "shorthand for div align=center ",
-	DECL html_flow , NULL , NULL, DECL html_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "cite",	0, 0, 0, 0, 0, 0, 1, "citation",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "code",	0, 0, 0, 0, 0, 0, 1, "computer code fragment",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "col",	0, 2, 2, 1, 0, 0, 0, "table column ",
-	EMPTY , NULL , DECL col_attrs , NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "colgroup",	0, 1, 0, 0, 0, 0, 0, "table column group ",
-	DECL col_elt , "col" , DECL col_attrs , NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "dd",		0, 1, 0, 0, 0, 0, 0, "definition description ",
-	DECL html_flow , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "del",	0, 0, 0, 0, 0, 0, 2, "deleted text ",
-	DECL html_flow , NULL , DECL edit_attrs , NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "dfn",	0, 0, 0, 0, 0, 0, 1, "instance definition",
-	DECL html_inline , NULL , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "dir",	0, 0, 0, 0, 1, 1, 0, "directory list",
-	DECL blockli_elt, "li" , NULL, DECL compact_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "div",	0, 0, 0, 0, 0, 0, 0, "generic language/style container",
-	DECL html_flow, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "dl",		0, 0, 0, 0, 0, 0, 0, "definition list ",
-	DECL dl_contents , "dd" , DECL html_attrs, DECL compact_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "dt",		0, 1, 0, 0, 0, 0, 0, "definition term ",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "em",		0, 3, 0, 0, 0, 0, 1, "emphasis",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "embed",	0, 1, 0, 0, 1, 1, 1, "generic embedded object ",
-	EMPTY, NULL, DECL embed_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "fieldset",	0, 0, 0, 0, 0, 0, 0, "form control group ",
-	DECL fieldset_contents , NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "font",	0, 3, 0, 0, 1, 1, 1, "local change to font ",
-	DECL html_inline, NULL, NULL, DECL font_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "form",	0, 0, 0, 0, 0, 0, 0, "interactive form ",
-	DECL form_contents, "fieldset", DECL form_attrs , DECL target_attr, DECL action_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "frame",	0, 2, 2, 1, 0, 2, 0, "subwindow " ,
-	EMPTY, NULL, NULL, DECL frame_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "frameset",	0, 0, 0, 0, 0, 2, 0, "window subdivision" ,
-	DECL frameset_contents, "noframes" , NULL , DECL frameset_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "h1",		0, 0, 0, 0, 0, 0, 0, "heading ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "h2",		0, 0, 0, 0, 0, 0, 0, "heading ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "h3",		0, 0, 0, 0, 0, 0, 0, "heading ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "h4",		0, 0, 0, 0, 0, 0, 0, "heading ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "h5",		0, 0, 0, 0, 0, 0, 0, "heading ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "h6",		0, 0, 0, 0, 0, 0, 0, "heading ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "head",	1, 1, 0, 0, 0, 0, 0, "document head ",
-	DECL head_contents, NULL, DECL head_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "hr",		0, 2, 2, 1, 0, 0, 0, "horizontal rule " ,
-	EMPTY, NULL, DECL html_attrs, DECL hr_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "html",	1, 1, 0, 0, 0, 0, 0, "document root element ",
-	DECL html_content , NULL , DECL i18n_attrs, DECL version_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "i",		0, 3, 0, 0, 0, 0, 1, "italic text style",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "iframe",	0, 0, 0, 0, 0, 1, 2, "inline subwindow ",
-	DECL html_flow, NULL, NULL, DECL iframe_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RAWTEXT
 },
 { "img",	0, 2, 2, 1, 0, 0, 1, "embedded image ",
-	EMPTY, NULL, DECL img_attrs, DECL align_attr, DECL src_alt_attrs
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "input",	0, 2, 2, 1, 0, 0, 1, "form control ",
-	EMPTY, NULL, DECL input_attrs , DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "ins",	0, 0, 0, 0, 0, 0, 2, "inserted text",
-	DECL html_flow, NULL, DECL edit_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "isindex",	0, 2, 2, 1, 1, 1, 0, "single line prompt ",
-	EMPTY, NULL, NULL, DECL prompt_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "kbd",	0, 0, 0, 0, 0, 0, 1, "text to be entered by the user",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "label",	0, 0, 0, 0, 0, 0, 1, "form field label text ",
-	DECL html_inline MODIFIER, NULL, DECL label_attrs , NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "legend",	0, 0, 0, 0, 0, 0, 0, "fieldset legend ",
-	DECL html_inline, NULL, DECL legend_attrs , DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "li",		0, 1, 1, 0, 0, 0, 0, "list item ",
-	DECL html_flow, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "link",	0, 2, 2, 1, 0, 0, 0, "a media-independent link ",
-	EMPTY, NULL, DECL link_attrs, DECL target_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "map",	0, 0, 0, 0, 0, 0, 2, "client-side image map ",
-	DECL map_contents , NULL, DECL html_attrs , NULL, DECL name_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "menu",	0, 0, 0, 0, 1, 1, 0, "menu list ",
-	DECL blockli_elt , NULL, NULL, DECL compact_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "meta",	0, 2, 2, 1, 0, 0, 0, "generic metainformation ",
-	EMPTY, NULL, DECL meta_attrs , NULL , DECL content_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
+},
+{ "noembed",	0, 0, 0, 0, 0, 0, 0, "",
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RAWTEXT
 },
 { "noframes",	0, 0, 0, 0, 0, 2, 0, "alternate content container for non frame-based rendering ",
-	DECL noframes_content, "body" , DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RAWTEXT
 },
 { "noscript",	0, 0, 0, 0, 0, 0, 0, "alternate content container for non script-based rendering ",
-	DECL html_flow, "div", DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "object",	0, 0, 0, 0, 0, 0, 2, "generic embedded object ",
-	DECL object_contents , "div" , DECL object_attrs, DECL object_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "ol",		0, 0, 0, 0, 0, 0, 0, "ordered list ",
-	DECL li_elt , "li" , DECL html_attrs, DECL ol_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "optgroup",	0, 0, 0, 0, 0, 0, 0, "option group ",
-	DECL option_elt , "option", DECL optgroup_attrs, NULL, DECL label_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "option",	0, 1, 0, 0, 0, 0, 0, "selectable choice " ,
-	DECL html_pcdata, NULL, DECL option_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "p",		0, 1, 0, 0, 0, 0, 0, "paragraph ",
-	DECL html_inline, NULL, DECL html_attrs, DECL align_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "param",	0, 2, 2, 1, 0, 0, 0, "named property value ",
-	EMPTY, NULL, DECL param_attrs, NULL, DECL name_attr
+	NULL, NULL, NULL, NULL, NULL,
+	0
+},
+{ "plaintext",	0, 0, 0, 0, 0, 0, 0, "",
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_PLAINTEXT
 },
 { "pre",	0, 0, 0, 0, 0, 0, 0, "preformatted text ",
-	DECL pre_content, NULL, DECL html_attrs, DECL width_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "q",		0, 0, 0, 0, 0, 0, 1, "short inline quotation ",
-	DECL html_inline, NULL, DECL quote_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "s",		0, 3, 0, 0, 1, 1, 1, "strike-through text style",
-	DECL html_inline, NULL, NULL, DECL html_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "samp",	0, 0, 0, 0, 0, 0, 1, "sample program output, scripts, etc.",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "script",	0, 0, 0, 0, 0, 0, 2, "script statements ",
-	DECL html_cdata, NULL, DECL script_attrs, DECL language_attr, DECL type_attr
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_SCRIPT
 },
 { "select",	0, 0, 0, 0, 0, 0, 1, "option selector ",
-	DECL select_content, NULL, DECL select_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "small",	0, 3, 0, 0, 0, 0, 1, "small text style",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "span",	0, 0, 0, 0, 0, 0, 1, "generic language/style container ",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "strike",	0, 3, 0, 0, 1, 1, 1, "strike-through text",
-	DECL html_inline, NULL, NULL, DECL html_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "strong",	0, 3, 0, 0, 0, 0, 1, "strong emphasis",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "style",	0, 0, 0, 0, 0, 0, 0, "style info ",
-	DECL html_cdata, NULL, DECL style_attrs, NULL, DECL type_attr
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RAWTEXT
 },
 { "sub",	0, 3, 0, 0, 0, 0, 1, "subscript",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "sup",	0, 3, 0, 0, 0, 0, 1, "superscript ",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "table",	0, 0, 0, 0, 0, 0, 0, "",
-	DECL table_contents , "tr" , DECL table_attrs , DECL table_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "tbody",	1, 0, 0, 0, 0, 0, 0, "table body ",
-	DECL tr_elt , "tr" , DECL talign_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "td",		0, 0, 0, 0, 0, 0, 0, "table data cell",
-	DECL html_flow, NULL, DECL th_td_attr, DECL th_td_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "textarea",	0, 0, 0, 0, 0, 0, 1, "multi-line text field ",
-	DECL html_pcdata, NULL, DECL textarea_attrs, NULL, DECL rows_cols_attr
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RCDATA
 },
 { "tfoot",	0, 1, 0, 0, 0, 0, 0, "table footer ",
-	DECL tr_elt , "tr" , DECL talign_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "th",		0, 1, 0, 0, 0, 0, 0, "table header cell",
-	DECL html_flow, NULL, DECL th_td_attr, DECL th_td_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "thead",	0, 1, 0, 0, 0, 0, 0, "table header ",
-	DECL tr_elt , "tr" , DECL talign_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "title",	0, 0, 0, 0, 0, 0, 0, "document title ",
-	DECL html_pcdata, NULL, DECL i18n_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RCDATA
 },
 { "tr",		0, 0, 0, 0, 0, 0, 0, "table row ",
-	DECL tr_contents , "td" , DECL talign_attrs, DECL bgcolor_attr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "tt",		0, 3, 0, 0, 0, 0, 1, "teletype or monospaced text style",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "u",		0, 3, 0, 0, 1, 1, 1, "underlined text style",
-	DECL html_inline, NULL, NULL, DECL html_attrs, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "ul",		0, 0, 0, 0, 0, 0, 0, "unordered list ",
-	DECL li_elt , "li" , DECL html_attrs, DECL ul_depr, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
 },
 { "var",	0, 0, 0, 0, 0, 0, 1, "instance of a variable or program argument",
-	DECL html_inline, NULL, DECL html_attrs, NULL, NULL
+	NULL, NULL, NULL, NULL, NULL,
+	0
+},
+{ "xmp",	0, 0, 0, 0, 0, 0, 1, "",
+	NULL, NULL, NULL, NULL, NULL,
+	DATA_RAWTEXT
 }
 };
 
@@ -1236,19 +1171,6 @@
 };
 
 /*
- * The list of HTML elements which are supposed not to have
- * CDATA content and where a p element will be implied
- *
- * TODO: extend that list by reading the HTML SGML DTD on
- *       implied paragraph
- */
-static const char *const htmlNoContentElements[] = {
-    "html",
-    "head",
-    NULL
-};
-
-/*
  * The list of HTML attributes which are of content %Script;
  * NOTE: when adding ones, check htmlIsScriptAttribute() since
  *       it assumes the name starts with 'on'
@@ -1308,6 +1230,21 @@
  *									*
  ************************************************************************/
 
+static void
+htmlParserFinishElementParsing(htmlParserCtxtPtr ctxt) {
+    /*
+     * Capture end position and add node
+     */
+    if ( ctxt->node != NULL && ctxt->record_info ) {
+       ctxt->nodeInfo->end_pos = ctxt->input->consumed +
+                                (CUR_PTR - ctxt->input->base);
+       ctxt->nodeInfo->end_line = ctxt->input->line;
+       ctxt->nodeInfo->node = ctxt->node;
+       xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
+       htmlNodeInfoPop(ctxt);
+    }
+}
+
 /**
  * htmlInitAutoClose:
  *
@@ -1412,6 +1349,9 @@
     const htmlElemDesc *info;
     int i, priority;
 
+    if (ctxt->options & HTML_PARSE_HTML5)
+        return;
+
     priority = htmlGetEndPriority(newtag);
 
     for (i = (ctxt->nameNr - 1); i >= 0; i--) {
@@ -1437,6 +1377,7 @@
 	                 "Opening and ending tag mismatch: %s and %s\n",
 			 newtag, ctxt->name);
         }
+	htmlParserFinishElementParsing(ctxt);
         if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
             ctxt->sax->endElement(ctxt->userData, ctxt->name);
 	htmlnamePop(ctxt);
@@ -1454,9 +1395,13 @@
 {
     int i;
 
+    if (ctxt->options & HTML_PARSE_HTML5)
+        return;
+
     if (ctxt->nameNr == 0)
         return;
     for (i = (ctxt->nameNr - 1); i >= 0; i--) {
+	htmlParserFinishElementParsing(ctxt);
         if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
             ctxt->sax->endElement(ctxt->userData, ctxt->name);
 	htmlnamePop(ctxt);
@@ -1478,11 +1423,15 @@
 static void
 htmlAutoClose(htmlParserCtxtPtr ctxt, const xmlChar * newtag)
 {
+    if (ctxt->options & HTML_PARSE_HTML5)
+        return;
+
     if (newtag == NULL)
         return;
 
     while ((ctxt->name != NULL) &&
            (htmlCheckAutoClose(newtag, ctxt->name))) {
+	htmlParserFinishElementParsing(ctxt);
         if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
             ctxt->sax->endElement(ctxt->userData, ctxt->name);
 	htmlnamePop(ctxt);
@@ -1495,6 +1444,8 @@
  * @name:  The tag name
  * @elem:  the HTML element
  *
+ * DEPRECATED: Internal function, don't use.
+ *
  * The HTML DTD allows a tag to implicitly close other tags.
  * The list is kept in htmlStartClose array. This function checks
  * if the element or one of it's children would autoclose the
@@ -1522,6 +1473,8 @@
  * @doc:  the HTML document
  * @elem:  the HTML element
  *
+ * DEPRECATED: Internal function, don't use.
+ *
  * The HTML DTD allows a tag to implicitly close other tags.
  * The list is kept in htmlStartClose array. This function checks
  * if a tag is autoclosed by one of it's child
@@ -1554,7 +1507,7 @@
 htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *newtag) {
     int i;
 
-    if (ctxt->options & HTML_PARSE_NOIMPLIED)
+    if (ctxt->options & (HTML_PARSE_NOIMPLIED | HTML_PARSE_HTML5))
         return;
     if (!htmlOmittedDefaultValue)
 	return;
@@ -1574,7 +1527,7 @@
 	 (xmlStrEqual(newtag, BAD_CAST"link")) ||
 	 (xmlStrEqual(newtag, BAD_CAST"title")) ||
 	 (xmlStrEqual(newtag, BAD_CAST"base")))) {
-        if (ctxt->html >= 3) {
+        if (ctxt->html >= INSERT_IN_HEAD) {
             /* we already saw or generated an <head> before */
             return;
         }
@@ -1588,7 +1541,7 @@
     } else if ((!xmlStrEqual(newtag, BAD_CAST"noframes")) &&
 	       (!xmlStrEqual(newtag, BAD_CAST"frame")) &&
 	       (!xmlStrEqual(newtag, BAD_CAST"frameset"))) {
-        if (ctxt->html >= 10) {
+        if (ctxt->html >= INSERT_IN_BODY) {
             /* we already saw or generated a <body> before */
             return;
         }
@@ -1608,45 +1561,22 @@
 }
 
 /**
- * htmlCheckParagraph
+ * htmlStartCharData
  * @ctxt:  an HTML parser context
  *
- * Check whether a p element need to be implied before inserting
- * characters in the current element.
- *
- * Returns 1 if a paragraph has been inserted, 0 if not and -1
- *         in case of error.
+ * Prepare for non-whitespace character data.
  */
 
-static int
-htmlCheckParagraph(htmlParserCtxtPtr ctxt) {
-    const xmlChar *tag;
-    int i;
-
-    if (ctxt == NULL)
-	return(-1);
-    tag = ctxt->name;
-    if (tag == NULL) {
-	htmlAutoClose(ctxt, BAD_CAST"p");
-	htmlCheckImplied(ctxt, BAD_CAST"p");
-	htmlnamePush(ctxt, BAD_CAST"p");
-	if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
-	    ctxt->sax->startElement(ctxt->userData, BAD_CAST"p", NULL);
-	return(1);
-    }
+static void
+htmlStartCharData(htmlParserCtxtPtr ctxt) {
+    if (ctxt->options & (HTML_PARSE_NOIMPLIED | HTML_PARSE_HTML5))
+        return;
     if (!htmlOmittedDefaultValue)
-	return(0);
-    for (i = 0; htmlNoContentElements[i] != NULL; i++) {
-	if (xmlStrEqual(tag, BAD_CAST htmlNoContentElements[i])) {
-	    htmlAutoClose(ctxt, BAD_CAST"p");
-	    htmlCheckImplied(ctxt, BAD_CAST"p");
-	    htmlnamePush(ctxt, BAD_CAST"p");
-	    if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
-		ctxt->sax->startElement(ctxt->userData, BAD_CAST"p", NULL);
-	    return(1);
-	}
-    }
-    return(0);
+	return;
+
+    if (xmlStrEqual(ctxt->name, BAD_CAST "head"))
+        htmlAutoClose(ctxt, BAD_CAST "p");
+    htmlCheckImplied(ctxt, BAD_CAST "p");
 }
 
 /**
@@ -1973,21 +1903,6 @@
  *									*
  ************************************************************************/
 
-/*
- * Macro used to grow the current buffer.
- */
-#define growBuffer(buffer) {						\
-    xmlChar *tmp;							\
-    buffer##_size *= 2;							\
-    tmp = (xmlChar *) xmlRealloc(buffer, buffer##_size); 		\
-    if (tmp == NULL) {							\
-	htmlErrMemory(ctxt);			\
-	xmlFree(buffer);						\
-	return(NULL);							\
-    }									\
-    buffer = tmp;							\
-}
-
 /**
  * htmlEntityLookup:
  * @name: the entity name
@@ -2042,7 +1957,7 @@
 }
 
 /**
- * UTF8ToHtml:
+ * htmlUTF8ToHtml:
  * @out:  a pointer to an array of bytes to store the result
  * @outlen:  the length of @out
  * @in:  a pointer to an array of UTF-8 chars
@@ -2057,91 +1972,88 @@
  * The value of @outlen after return is the number of octets consumed.
  */
 int
-UTF8ToHtml(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen) {
-    const unsigned char* processed = in;
-    const unsigned char* outend;
-    const unsigned char* outstart = out;
+htmlUTF8ToHtml(unsigned char* out, int *outlen,
+               const unsigned char* in, int *inlen) {
     const unsigned char* instart = in;
     const unsigned char* inend;
-    unsigned int c, d;
-    int trailing;
+    unsigned char* outstart = out;
+    unsigned char* outend;
+    int ret = XML_ENC_ERR_SPACE;
 
-    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
 	 */
 	*outlen = 0;
 	*inlen = 0;
-	return(0);
+	return(XML_ENC_ERR_SUCCESS);
     }
-    inend = in + (*inlen);
-    outend = out + (*outlen);
+
+    inend = in + *inlen;
+    outend = out + *outlen;
     while (in < inend) {
-	d = *in++;
-	if      (d < 0x80)  { c= d; trailing= 0; }
-	else if (d < 0xC0) {
-	    /* trailing byte in leading position */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    return(-2);
-        } 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; }
-	else {
-	    /* no chance for this in Ascii */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    return(-2);
-	}
+        const htmlEntityDesc *ent;
+        const char *cp;
+        char nbuf[16];
+        unsigned c, d;
+        int seqlen, len, i;
 
-	if (inend - in < trailing) {
+	d = *in;
+
+	if (d < 0x80) {
+            if (out >= outend)
+                goto done;
+            *out++ = d;
+            in += 1;
+            continue;
+        }
+
+        if (d < 0xE0)      { c = d & 0x1F; seqlen = 2; }
+        else if (d < 0xF0) { c = d & 0x0F; seqlen = 3; }
+        else               { c = d & 0x07; seqlen = 4; }
+
+	if (inend - in < seqlen)
 	    break;
-	}
 
-	for ( ; trailing; trailing--) {
-	    if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
-		break;
+	for (i = 1; i < seqlen; i++) {
+	    d = in[i];
 	    c <<= 6;
 	    c |= d & 0x3F;
 	}
 
-	/* assertion: c is a single UTF-4 value */
-	if (c < 0x80) {
-	    if (out + 1 >= outend)
-		break;
-	    *out++ = c;
-	} else {
-	    int len;
-	    const htmlEntityDesc * ent;
-	    const char *cp;
-	    char nbuf[16];
+        /*
+         * Try to lookup a predefined HTML entity for it
+         */
+        ent = htmlEntityValueLookup(c);
 
-	    /*
-	     * Try to lookup a predefined HTML entity for it
-	     */
+        if (ent == NULL) {
+          snprintf(nbuf, sizeof(nbuf), "#%u", c);
+          cp = nbuf;
+        } else {
+          cp = ent->name;
+        }
 
-	    ent = htmlEntityValueLookup(c);
-	    if (ent == NULL) {
-	      snprintf(nbuf, sizeof(nbuf), "#%u", c);
-	      cp = nbuf;
-	    }
-	    else
-	      cp = ent->name;
-	    len = strlen(cp);
-	    if (out + 2 + len >= outend)
-		break;
-	    *out++ = '&';
-	    memcpy(out, cp, len);
-	    out += len;
-	    *out++ = ';';
-	}
-	processed = in;
+        len = strlen(cp);
+        if (outend - out < len + 2)
+            goto done;
+
+        *out++ = '&';
+        memcpy(out, cp, len);
+        out += len;
+        *out++ = ';';
+
+        in += seqlen;
     }
+
+    ret = out - outstart;
+
+done:
     *outlen = out - outstart;
-    *inlen = processed - instart;
-    return(0);
+    *inlen = in - instart;
+    return(ret);
 }
 
 /**
@@ -2271,7 +2183,7 @@
  *
  * Is this a sequence of blank chars that one can ignore ?
  *
- * Returns 1 if ignorable 0 otherwise.
+ * Returns 1 if ignorable 0 if whitespace, -1 otherwise.
  */
 
 static int areBlanks(htmlParserCtxtPtr ctxt, const xmlChar *str, int len) {
@@ -2281,7 +2193,7 @@
     xmlDtdPtr dtd;
 
     for (j = 0;j < len;j++)
-        if (!(IS_BLANK_CH(str[j]))) return(0);
+        if (!(IS_WS_HTML(str[j]))) return(-1);
 
     if (CUR == 0) return(1);
     if (CUR != '<') return(0);
@@ -2378,7 +2290,7 @@
             return(NULL);
         }
     }
-    if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
+    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
 	xmlRegisterNodeDefaultValue((xmlNodePtr)cur);
     return(cur);
 }
@@ -2416,25 +2328,6 @@
  *									*
  ************************************************************************/
 
-static const xmlChar * htmlParseNameComplex(xmlParserCtxtPtr ctxt);
-
-static void
-htmlSkipBogusComment(htmlParserCtxtPtr ctxt) {
-    int c;
-
-    htmlParseErr(ctxt, XML_HTML_INCORRECTLY_OPENED_COMMENT,
-                 "Incorrectly opened comment\n", NULL, NULL);
-
-    while (PARSER_STOPPED(ctxt) == 0) {
-        c = CUR;
-        if (c == 0)
-            break;
-        NEXT;
-        if (c == '>')
-            break;
-    }
-}
-
 /**
  * htmlParseHTMLName:
  * @ctxt:  an HTML parser context
@@ -2445,322 +2338,544 @@
  * Returns the Tag Name parsed or NULL
  */
 
-static const xmlChar *
-htmlParseHTMLName(htmlParserCtxtPtr ctxt) {
-    const xmlChar *ret;
-    int i = 0;
-    xmlChar loc[HTML_PARSER_BUFFER_SIZE];
-
-    if (!IS_ASCII_LETTER(CUR) && (CUR != '_') &&
-        (CUR != ':') && (CUR != '.')) return(NULL);
-
-    while ((i < HTML_PARSER_BUFFER_SIZE) &&
-           ((IS_ASCII_LETTER(CUR)) || (IS_ASCII_DIGIT(CUR)) ||
-	   (CUR == ':') || (CUR == '-') || (CUR == '_') ||
-           (CUR == '.'))) {
-	if ((CUR >= 'A') && (CUR <= 'Z')) loc[i] = CUR + 0x20;
-        else loc[i] = CUR;
-	i++;
-
-	NEXT;
-    }
-
-    ret = xmlDictLookup(ctxt->dict, loc, i);
-    if (ret == NULL)
-        htmlErrMemory(ctxt);
-
-    return(ret);
-}
-
-
-/**
- * htmlParseHTMLName_nonInvasive:
- * @ctxt:  an HTML parser context
- *
- * parse an HTML tag or attribute name, note that we convert it to lowercase
- * since HTML names are not case-sensitive, this doesn't consume the data
- * from the stream, it's a look-ahead
- *
- * Returns the Tag Name parsed or NULL
- */
-
-static const xmlChar *
-htmlParseHTMLName_nonInvasive(htmlParserCtxtPtr ctxt) {
-    int i = 0;
-    xmlChar loc[HTML_PARSER_BUFFER_SIZE];
-    const xmlChar *ret;
-
-    if (!IS_ASCII_LETTER(NXT(1)) && (NXT(1) != '_') &&
-        (NXT(1) != ':')) return(NULL);
-
-    while ((i < HTML_PARSER_BUFFER_SIZE) &&
-           ((IS_ASCII_LETTER(NXT(1+i))) || (IS_ASCII_DIGIT(NXT(1+i))) ||
-	   (NXT(1+i) == ':') || (NXT(1+i) == '-') || (NXT(1+i) == '_'))) {
-	if ((NXT(1+i) >= 'A') && (NXT(1+i) <= 'Z')) loc[i] = NXT(1+i) + 0x20;
-        else loc[i] = NXT(1+i);
-	i++;
-    }
-
-    ret = xmlDictLookup(ctxt->dict, loc, i);
-    if (ret == NULL)
-        htmlErrMemory(ctxt);
-
-    return(ret);
-}
-
-
-/**
- * htmlParseName:
- * @ctxt:  an HTML parser context
- *
- * parse an HTML name, this routine is case sensitive.
- *
- * Returns the Name parsed or NULL
- */
-
-static const xmlChar *
-htmlParseName(htmlParserCtxtPtr ctxt) {
+static xmlHashedString
+htmlParseHTMLName(htmlParserCtxtPtr ctxt, int attr) {
+    xmlHashedString ret;
+    xmlChar buf[HTML_PARSER_BUFFER_SIZE];
     const xmlChar *in;
-    const xmlChar *ret;
-    int count = 0;
+    size_t avail;
+    int eof = PARSER_PROGRESSIVE(ctxt);
+    int nbchar = 0;
+    int stop = attr ? '=' : ' ';
 
-    GROW;
-
-    /*
-     * Accelerator for simple ASCII names
-     */
     in = ctxt->input->cur;
-    if (((*in >= 0x61) && (*in <= 0x7A)) ||
-	((*in >= 0x41) && (*in <= 0x5A)) ||
-	(*in == '_') || (*in == ':')) {
-	in++;
-	while (((*in >= 0x61) && (*in <= 0x7A)) ||
-	       ((*in >= 0x41) && (*in <= 0x5A)) ||
-	       ((*in >= 0x30) && (*in <= 0x39)) ||
-	       (*in == '_') || (*in == '-') ||
-	       (*in == ':') || (*in == '.'))
-	    in++;
+    avail = ctxt->input->end - in;
 
-	if (in == ctxt->input->end)
-	    return(NULL);
+    while (1) {
+        int c, size;
 
-	if ((*in > 0) && (*in < 0x80)) {
-	    count = in - ctxt->input->cur;
-	    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur, count);
-            if (ret == NULL)
-                htmlErrMemory(ctxt);
-	    ctxt->input->cur = in;
-	    ctxt->input->col += count;
-	    return(ret);
-	}
-    }
-    return(htmlParseNameComplex(ctxt));
-}
+        if ((!eof) && (avail < 32)) {
+            size_t oldAvail = avail;
 
-static const xmlChar *
-htmlParseNameComplex(xmlParserCtxtPtr ctxt) {
-    int len = 0, l;
-    int c;
-    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
-                    XML_MAX_TEXT_LENGTH :
-                    XML_MAX_NAME_LENGTH;
-    const xmlChar *base = ctxt->input->base;
-    const xmlChar *ret;
+            ctxt->input->cur = in;
 
-    /*
-     * Handler for more complex cases
-     */
-    c = CUR_CHAR(l);
-    if ((c == ' ') || (c == '>') || (c == '/') || /* accelerators */
-	(!IS_LETTER(c) && (c != '_') &&
-         (c != ':'))) {
-	return(NULL);
-    }
+            SHRINK;
+            xmlParserGrow(ctxt);
 
-    while ((c != ' ') && (c != '>') && (c != '/') && /* test bigname.xml */
-	   ((IS_LETTER(c)) || (IS_DIGIT(c)) ||
-            (c == '.') || (c == '-') ||
-	    (c == '_') || (c == ':') ||
-	    (IS_COMBINING(c)) ||
-	    (IS_EXTENDER(c)))) {
-	len += l;
-        if (len > maxLength) {
-            htmlParseErr(ctxt, XML_ERR_NAME_TOO_LONG, "name too long", NULL, NULL);
-            return(NULL);
+            in = ctxt->input->cur;
+            avail = ctxt->input->end - in;
+
+            if (oldAvail == avail)
+                eof = 1;
         }
-	NEXTL(l);
-	c = CUR_CHAR(l);
-	if (ctxt->input->base != base) {
-	    /*
-	     * We changed encoding from an unknown encoding
-	     * Input buffer changed location, so we better start again
-	     */
-	    return(htmlParseNameComplex(ctxt));
-	}
+
+        if (avail == 0)
+            break;
+
+        c = *in;
+        size = 1;
+
+        if ((nbchar != 0) &&
+            ((c == '/') || (c == '>') || (c == stop) ||
+             (IS_WS_HTML(c))))
+            break;
+
+        if (c == 0) {
+            if (nbchar + 3 <= HTML_PARSER_BUFFER_SIZE) {
+                buf[nbchar++] = 0xEF;
+                buf[nbchar++] = 0xBF;
+                buf[nbchar++] = 0xBD;
+            }
+        } else if (c < 0x80) {
+            if (nbchar < HTML_PARSER_BUFFER_SIZE) {
+                if (IS_UPPER(c))
+                    c += 0x20;
+                buf[nbchar++] = c;
+            }
+        } else {
+            size = htmlValidateUtf8(ctxt, in, avail, /* partial */ 0);
+
+            if (size > 0) {
+                if (nbchar + size <= HTML_PARSER_BUFFER_SIZE) {
+                    memcpy(buf + nbchar, in, size);
+                    nbchar += size;
+                }
+            } else {
+                size = 1;
+
+                if (nbchar + 3 <= HTML_PARSER_BUFFER_SIZE) {
+                    buf[nbchar++] = 0xEF;
+                    buf[nbchar++] = 0xBF;
+                    buf[nbchar++] = 0xBD;
+                }
+            }
+        }
+
+        in += size;
+        avail -= size;
     }
 
-    if (ctxt->input->cur - ctxt->input->base < len) {
-        /* Sanity check */
-	htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
-                     "unexpected change of input buffer", NULL, NULL);
-        return (NULL);
-    }
+    ctxt->input->cur = in;
 
-    ret = xmlDictLookup(ctxt->dict, ctxt->input->cur - len, len);
-    if (ret == NULL)
+    SHRINK;
+
+    ret = xmlDictLookupHashed(ctxt->dict, buf, nbchar);
+    if (ret.name == NULL)
         htmlErrMemory(ctxt);
 
     return(ret);
 }
 
+static const short htmlC1Remap[32] = {
+    0x20AC, 0x0081, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
+    0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x008D, 0x017D, 0x008F,
+    0x0090, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
+    0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x009D, 0x017E, 0x0178
+};
+
+static const xmlChar *
+htmlCodePointToUtf8(int c, xmlChar *out, int *osize) {
+    int i = 0;
+    int bits, hi;
+
+    if ((c >= 0x80) && (c < 0xA0)) {
+        c = htmlC1Remap[c - 0x80];
+    } else if ((c <= 0) ||
+               ((c >= 0xD800) && (c < 0xE000)) ||
+               (c > 0x10FFFF)) {
+        c = 0xFFFD;
+    }
+
+    if      (c <    0x80) { bits =  0; hi = 0x00; }
+    else if (c <   0x800) { bits =  6; hi = 0xC0; }
+    else if (c < 0x10000) { bits = 12; hi = 0xE0; }
+    else                  { bits = 18; hi = 0xF0; }
+
+    out[i++] = (c >> bits) | hi;
+
+    while (bits > 0) {
+        bits -= 6;
+        out[i++] = ((c >> bits) & 0x3F) | 0x80;
+    }
+
+    *osize = i;
+    return(out);
+}
+
+#include "html5ent.inc"
+
+#define ENT_F_SEMICOLON 0x80u
+#define ENT_F_SUBTABLE  0x40u
+#define ENT_F_ALL       0xC0u
+
+static const xmlChar *
+htmlFindEntityPrefix(const xmlChar *string, size_t slen, int isAttr,
+                     int *nlen, int *rlen) {
+    const xmlChar *match = NULL;
+    unsigned left, right;
+    int first = string[0];
+    size_t matchLen = 0;
+    size_t soff = 1;
+
+    if (slen < 2)
+        return(NULL);
+    if (!IS_ASCII_LETTER(first))
+        return(NULL);
+
+    /*
+     * Look up range by first character
+     */
+    first &= 63;
+    left = htmlEntAlpha[first*3] | htmlEntAlpha[first*3+1] << 8;
+    right = left + htmlEntAlpha[first*3+2];
+
+    /*
+     * Binary search
+     */
+    while (left < right) {
+        const xmlChar *bytes;
+        unsigned mid;
+        size_t len;
+        int cmp;
+
+        mid = left + (right - left) / 2;
+        bytes = htmlEntStrings + htmlEntValues[mid];
+        len = bytes[0] & ~ENT_F_ALL;
+
+        cmp = string[soff] - bytes[1];
+
+        if (cmp == 0) {
+            if (slen < len) {
+                cmp = strncmp((const char *) string + soff + 1,
+                              (const char *) bytes + 2,
+                              slen - 1);
+                /* Prefix can never match */
+                if (cmp == 0)
+                    break;
+            } else {
+                cmp = strncmp((const char *) string + soff + 1,
+                              (const char *) bytes + 2,
+                              len - 1);
+            }
+        }
+
+        if (cmp < 0) {
+            right = mid;
+        } else if (cmp > 0) {
+            left = mid + 1;
+        } else {
+            int term = soff + len < slen ? string[soff + len] : 0;
+            int isAlnum, isTerm;
+
+            isAlnum = IS_ALNUM(term);
+            isTerm = ((term == ';') ||
+                      ((bytes[0] & ENT_F_SEMICOLON) &&
+                       ((!isAttr) ||
+                        ((!isAlnum) && (term != '=')))));
+
+            if (isTerm) {
+                match = bytes + len + 1;
+                matchLen = soff + len;
+                if (term == ';')
+                    matchLen += 1;
+            }
+
+            if (bytes[0] & ENT_F_SUBTABLE) {
+                if (isTerm)
+                    match += 2;
+
+                if ((isAlnum) && (soff + len < slen)) {
+                    left = mid + bytes[len + 1];
+                    right = left + bytes[len + 2];
+                    soff += len;
+                    continue;
+                }
+            }
+
+            break;
+        }
+    }
+
+    if (match == NULL)
+        return(NULL);
+
+    *nlen = matchLen;
+    *rlen = match[0];
+    return(match + 1);
+}
 
 /**
- * htmlParseHTMLAttribute:
+ * htmlParseData:
  * @ctxt:  an HTML parser context
- * @stop:  a char stop value
+ * @mask:  mask of terminating characters
+ * @comment:  true if parsing a comment
+ * @refs:  true if references are allowed
+ * @maxLength:  maximum output length
  *
- * parse an HTML attribute value till the stop (quote), if
- * stop is 0 then it stops at the first space
+ * Parse data until terminator is reached.
  *
- * Returns the attribute parsed or NULL
+ * Returns the parsed string or NULL in case of errors.
  */
 
 static xmlChar *
-htmlParseHTMLAttribute(htmlParserCtxtPtr ctxt, const xmlChar stop) {
-    xmlChar *buffer = NULL;
-    int buffer_size = 0;
-    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
-                    XML_MAX_HUGE_LENGTH :
-                    XML_MAX_TEXT_LENGTH;
-    xmlChar *out = NULL;
-    const xmlChar *name = NULL;
-    const xmlChar *cur = NULL;
-    const htmlEntityDesc * ent;
+htmlParseData(htmlParserCtxtPtr ctxt, htmlAsciiMask mask,
+              int comment, int refs, int maxLength) {
+    xmlParserInputPtr input = ctxt->input;
+    xmlChar *ret = NULL;
+    xmlChar *buffer;
+    xmlChar utf8Char[4];
+    size_t buffer_size;
+    size_t used;
+    int eof = PARSER_PROGRESSIVE(ctxt);
+    int line, col;
+    int termSkip = -1;
 
-    /*
-     * allocate a translation buffer.
-     */
-    buffer_size = HTML_PARSER_BUFFER_SIZE;
-    buffer = (xmlChar *) xmlMallocAtomic(buffer_size);
+    used = 0;
+    buffer_size = ctxt->spaceMax;
+    buffer = (xmlChar *) ctxt->spaceTab;
     if (buffer == NULL) {
-	htmlErrMemory(ctxt);
-	return(NULL);
-    }
-    out = buffer;
-
-    /*
-     * Ok loop until we reach one of the ending chars
-     */
-    while ((PARSER_STOPPED(ctxt) == 0) &&
-           (CUR != 0) && (CUR != stop)) {
-	if ((stop == 0) && (CUR == '>')) break;
-	if ((stop == 0) && (IS_BLANK_CH(CUR))) break;
-        if (CUR == '&') {
-	    if (NXT(1) == '#') {
-		unsigned int c;
-		int bits;
-
-		c = htmlParseCharRef(ctxt);
-		if      (c <    0x80)
-		        { *out++  = c;                bits= -6; }
-		else if (c <   0x800)
-		        { *out++  =((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-		else if (c < 0x10000)
-		        { *out++  =((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-		else
-		        { *out++  =((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-		for ( ; bits >= 0; bits-= 6) {
-		    *out++  = ((c >> bits) & 0x3F) | 0x80;
-		}
-
-		if (out - buffer > buffer_size - 100) {
-			int indx = out - buffer;
-
-			growBuffer(buffer);
-			out = &buffer[indx];
-		}
-	    } else {
-		ent = htmlParseEntityRef(ctxt, &name);
-		if (name == NULL) {
-		    *out++ = '&';
-		    if (out - buffer > buffer_size - 100) {
-			int indx = out - buffer;
-
-			growBuffer(buffer);
-			out = &buffer[indx];
-		    }
-		} else if (ent == NULL) {
-		    *out++ = '&';
-		    cur = name;
-		    while (*cur != 0) {
-			if (out - buffer > buffer_size - 100) {
-			    int indx = out - buffer;
-
-			    growBuffer(buffer);
-			    out = &buffer[indx];
-			}
-			*out++ = *cur++;
-		    }
-		} else {
-		    unsigned int c;
-		    int bits;
-
-		    if (out - buffer > buffer_size - 100) {
-			int indx = out - buffer;
-
-			growBuffer(buffer);
-			out = &buffer[indx];
-		    }
-		    c = ent->value;
-		    if      (c <    0x80)
-			{ *out++  = c;                bits= -6; }
-		    else if (c <   0x800)
-			{ *out++  =((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-		    else if (c < 0x10000)
-			{ *out++  =((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-		    else
-			{ *out++  =((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-		    for ( ; bits >= 0; bits-= 6) {
-			*out++  = ((c >> bits) & 0x3F) | 0x80;
-		    }
-		}
-	    }
-	} else {
-	    unsigned int c;
-	    int bits, l;
-
-	    if (out - buffer > buffer_size - 100) {
-		int indx = out - buffer;
-
-		growBuffer(buffer);
-		out = &buffer[indx];
-	    }
-	    c = CUR_CHAR(l);
-	    if      (c <    0x80)
-		    { *out++  = c;                bits= -6; }
-	    else if (c <   0x800)
-		    { *out++  =((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-	    else if (c < 0x10000)
-		    { *out++  =((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-	    else
-		    { *out++  =((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-	    for ( ; bits >= 0; bits-= 6) {
-		*out++  = ((c >> bits) & 0x3F) | 0x80;
-	    }
-	    NEXTL(l);
-	}
-        if (out - buffer > maxLength) {
-            htmlParseErr(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
-                         "attribute value too long\n", NULL, NULL);
-            xmlFree(buffer);
+        buffer_size = 500;
+        buffer = xmlMalloc(buffer_size + 1);
+        if (buffer == NULL) {
+            htmlErrMemory(ctxt);
             return(NULL);
         }
     }
-    *out = 0;
-    return(buffer);
+
+    line = input->line;
+    col = input->col;
+
+    while (!PARSER_STOPPED(ctxt)) {
+        const xmlChar *chunk, *in, *repl;
+        size_t avail, chunkSize, extraSize;
+        int replSize;
+        int skip = 0;
+        int ncr = 0;
+        int ncrSize = 0;
+        int cp = 0;
+
+        chunk = input->cur;
+        avail = input->end - chunk;
+        in = chunk;
+
+        repl = BAD_CAST "";
+        replSize = 0;
+
+        while (!PARSER_STOPPED(ctxt)) {
+            size_t j;
+            int cur, size;
+
+            if ((!eof) && (avail <= 64)) {
+                size_t oldAvail = avail;
+                size_t off = in - chunk;
+
+                input->cur = in;
+
+                xmlParserGrow(ctxt);
+
+                in = input->cur;
+                chunk = in - off;
+                input->cur = chunk;
+                avail = input->end - in;
+
+                if (oldAvail == avail)
+                    eof = 1;
+            }
+
+            if (avail == 0) {
+                termSkip = 0;
+                break;
+            }
+
+            cur = *in;
+            size = 1;
+            col += 1;
+
+            if (htmlMaskMatch(mask, cur)) {
+                if (comment) {
+                    if (avail < 2) {
+                        termSkip = 1;
+                    } else if (in[1] == '-') {
+                        if  (avail < 3) {
+                            termSkip = 2;
+                        } else if (in[2] == '>') {
+                            termSkip = 3;
+                        } else if (in[2] == '!') {
+                            if (avail < 4)
+                                termSkip = 3;
+                            else if (in[3] == '>')
+                                termSkip = 4;
+                        }
+                    }
+
+                    if (termSkip >= 0)
+                        break;
+                } else {
+                    termSkip = 0;
+                    break;
+                }
+            }
+
+            if (ncr) {
+                int lc = cur | 0x20;
+                int digit;
+
+                if ((cur >= '0') && (cur <= '9')) {
+                    digit = cur - '0';
+                } else if ((ncr == 16) && (lc >= 'a') && (lc <= 'f')) {
+                    digit = (lc - 'a') + 10;
+                } else {
+                    if (cur == ';') {
+                        in += 1;
+                        size += 1;
+                        ncrSize += 1;
+                    }
+                    goto next_chunk;
+                }
+
+                cp = cp * ncr + digit;
+                if (cp >= 0x110000)
+                    cp = 0x110000;
+
+                ncrSize += 1;
+
+                goto next_char;
+            }
+
+            switch (cur) {
+            case '&':
+                if (!refs)
+                    break;
+
+                j = 1;
+
+                if ((j < avail) && (in[j] == '#')) {
+                    j += 1;
+                    if (j < avail) {
+                        if ((in[j] | 0x20) == 'x') {
+                            j += 1;
+                            if ((j < avail) && (IS_HEX_DIGIT(in[j]))) {
+                                ncr = 16;
+                                size = 3;
+                                ncrSize = 3;
+                                cp = 0;
+                            }
+                        } else if (IS_ASCII_DIGIT(in[j])) {
+                            ncr = 10;
+                            size = 2;
+                            ncrSize = 2;
+                            cp = 0;
+                        }
+                    }
+                } else {
+                    repl = htmlFindEntityPrefix(in + j,
+                                                avail - j,
+                                                /* isAttr */ 1,
+                                                &skip, &replSize);
+                    if (repl != NULL) {
+                        skip += 1;
+                        goto next_chunk;
+                    }
+
+                    skip = 0;
+                }
+
+                break;
+
+            case '\0':
+                skip = 1;
+                repl = BAD_CAST "\xEF\xBF\xBD";
+                replSize = 3;
+                goto next_chunk;
+
+            case '\n':
+                line += 1;
+                col = 1;
+                break;
+
+            case '\r':
+                skip = 1;
+                if (in[1] != 0x0A) {
+                    repl = BAD_CAST "\x0A";
+                    replSize = 1;
+                }
+                goto next_chunk;
+
+            default:
+                if (cur < 0x80)
+                    break;
+
+                if ((input->flags & XML_INPUT_HAS_ENCODING) == 0) {
+                    xmlChar * guess;
+
+                    if (in > chunk)
+                        goto next_chunk;
+
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+                    guess = NULL;
+#else
+                    guess = htmlFindEncoding(ctxt);
+#endif
+                    if (guess == NULL) {
+                        xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
+                    } else {
+                        xmlSwitchEncodingName(ctxt, (const char *) guess);
+                        xmlFree(guess);
+                    }
+                    input->flags |= XML_INPUT_HAS_ENCODING;
+
+                    eof = PARSER_PROGRESSIVE(ctxt);
+                    goto restart;
+                }
+
+                size = htmlValidateUtf8(ctxt, in, avail, /* partial */ 0);
+
+                if (size <= 0) {
+                    skip = 1;
+                    repl = BAD_CAST "\xEF\xBF\xBD";
+                    replSize = 3;
+                    goto next_chunk;
+                }
+
+                break;
+            }
+
+next_char:
+            in += size;
+            avail -= size;
+        }
+
+next_chunk:
+        if (ncrSize > 0) {
+            skip = ncrSize;
+            in -= ncrSize;
+
+            repl = htmlCodePointToUtf8(cp, utf8Char, &replSize);
+        }
+
+        chunkSize = in - chunk;
+        extraSize = chunkSize + replSize;
+
+        if (extraSize > maxLength - used) {
+            htmlParseErr(ctxt, XML_ERR_RESOURCE_LIMIT,
+                         "value too long\n", NULL, NULL);
+            goto error;
+        }
+
+        if (extraSize > buffer_size - used) {
+            size_t newSize = (used + extraSize) * 2;
+            xmlChar *tmp = xmlRealloc(buffer, newSize + 1);
+
+            if (tmp == NULL) {
+                htmlErrMemory(ctxt);
+                goto error;
+            }
+            buffer = tmp;
+            buffer_size = newSize;
+        }
+
+        if (chunkSize > 0) {
+            input->cur += chunkSize;
+            memcpy(buffer + used, chunk, chunkSize);
+            used += chunkSize;
+        }
+
+        input->cur += skip;
+        if (replSize > 0) {
+            memcpy(buffer + used, repl, replSize);
+            used += replSize;
+        }
+
+        SHRINK;
+
+        if (termSkip >= 0)
+            break;
+
+restart:
+        ;
+    }
+
+    if (termSkip > 0) {
+        input->cur += termSkip;
+        col += termSkip;
+    }
+
+    input->line = line;
+    input->col = col;
+
+    ret = xmlMalloc(used + 1);
+    if (ret == NULL) {
+        htmlErrMemory(ctxt);
+    } else {
+        memcpy(ret, buffer, used);
+        ret[used] = 0;
+    }
+
+error:
+    ctxt->spaceTab = (void *) buffer;
+    ctxt->spaceMax = buffer_size;
+
+    return(ret);
 }
 
 /**
@@ -2770,49 +2885,12 @@
  *
  * DEPRECATED: Internal function, don't use.
  *
- * parse an HTML ENTITY references
- *
- * [68] EntityRef ::= '&' Name ';'
- *
- * Returns the associated htmlEntityDescPtr if found, or NULL otherwise,
- *         if non-NULL *str will have to be freed by the caller.
+ * Returns NULL.
  */
 const htmlEntityDesc *
-htmlParseEntityRef(htmlParserCtxtPtr ctxt, const xmlChar **str) {
-    const xmlChar *name;
-    const htmlEntityDesc * ent = NULL;
-
-    if (str != NULL) *str = NULL;
-    if ((ctxt == NULL) || (ctxt->input == NULL)) return(NULL);
-
-    if (CUR == '&') {
-        NEXT;
-        name = htmlParseName(ctxt);
-	if (name == NULL) {
-	    htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
-	                 "htmlParseEntityRef: no name\n", NULL, NULL);
-	} else {
-	    GROW;
-	    if (CUR == ';') {
-	        if (str != NULL)
-		    *str = name;
-
-		/*
-		 * Lookup the entity in the table.
-		 */
-		ent = htmlEntityLookup(name);
-		if (ent != NULL) /* OK that's ugly !!! */
-		    NEXT;
-	    } else {
-		htmlParseErr(ctxt, XML_ERR_ENTITYREF_SEMICOL_MISSING,
-		             "htmlParseEntityRef: expecting ';'\n",
-			     NULL, NULL);
-	        if (str != NULL)
-		    *str = name;
-	    }
-	}
-    }
-    return(ent);
+htmlParseEntityRef(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
+                   const xmlChar **str ATTRIBUTE_UNUSED) {
+    return(NULL);
 }
 
 /**
@@ -2830,636 +2908,515 @@
 static xmlChar *
 htmlParseAttValue(htmlParserCtxtPtr ctxt) {
     xmlChar *ret = NULL;
+    int maxLength = (ctxt->options & HTML_PARSE_HUGE) ?
+                    XML_MAX_HUGE_LENGTH :
+                    XML_MAX_TEXT_LENGTH;
 
     if (CUR == '"') {
-        NEXT;
-	ret = htmlParseHTMLAttribute(ctxt, '"');
-        if (CUR != '"') {
-	    htmlParseErr(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
-	                 "AttValue: \" expected\n", NULL, NULL);
-	} else
-	    NEXT;
+        SKIP(1);
+	ret = htmlParseData(ctxt, MASK_DQ, 0, 1, maxLength);
+        if (CUR == '"')
+            SKIP(1);
     } else if (CUR == '\'') {
-        NEXT;
-	ret = htmlParseHTMLAttribute(ctxt, '\'');
-        if (CUR != '\'') {
-	    htmlParseErr(ctxt, XML_ERR_ATTRIBUTE_NOT_FINISHED,
-	                 "AttValue: ' expected\n", NULL, NULL);
-	} else
-	    NEXT;
+        SKIP(1);
+	ret = htmlParseData(ctxt, MASK_SQ, 0, 1, maxLength);
+        if (CUR == '\'')
+            SKIP(1);
+    } else {
+	ret = htmlParseData(ctxt, MASK_WS_GT, 0, 1, maxLength);
+    }
+    return(ret);
+}
+
+static void
+htmlCharDataSAXCallback(htmlParserCtxtPtr ctxt, const xmlChar *buf,
+                        int size, int mode) {
+    if ((ctxt->sax == NULL) || (ctxt->disableSAX))
+        return;
+
+    if ((mode == 0) || (mode == DATA_RCDATA) ||
+        (ctxt->sax->cdataBlock == NULL)) {
+        if ((ctxt->name == NULL) ||
+            (xmlStrEqual(ctxt->name, BAD_CAST "html")) ||
+            (xmlStrEqual(ctxt->name, BAD_CAST "head"))) {
+            int i;
+
+            /*
+             * Add leading whitespace to html or head elements before
+             * calling htmlStartCharData.
+             */
+            for (i = 0; i < size; i++)
+                if (!IS_WS_HTML(buf[i]))
+                    break;
+
+            if (i > 0) {
+                if (!ctxt->keepBlanks) {
+                    if (ctxt->sax->ignorableWhitespace != NULL)
+                        ctxt->sax->ignorableWhitespace(ctxt->userData, buf, i);
+                } else {
+                    if (ctxt->sax->characters != NULL)
+                        ctxt->sax->characters(ctxt->userData, buf, i);
+                }
+
+                buf += i;
+                size -= i;
+            }
+
+            if (size <= 0)
+                return;
+
+            htmlStartCharData(ctxt);
+
+            if (PARSER_STOPPED(ctxt))
+                return;
+        }
+
+        if ((mode == 0) &&
+            (!ctxt->keepBlanks) &&
+            (areBlanks(ctxt, buf, size) > 0)) {
+            if (ctxt->sax->ignorableWhitespace != NULL)
+                ctxt->sax->ignorableWhitespace(ctxt->userData, buf, size);
+        } else {
+            if (ctxt->sax->characters != NULL)
+                ctxt->sax->characters(ctxt->userData, buf, size);
+        }
     } else {
         /*
-	 * That's an HTMLism, the attribute value may not be quoted
-	 */
-	ret = htmlParseHTMLAttribute(ctxt, 0);
-	if (ret == NULL) {
-	    htmlParseErr(ctxt, XML_ERR_ATTRIBUTE_WITHOUT_VALUE,
-	                 "AttValue: no value found\n", NULL, NULL);
-	}
-    }
-    return(ret);
-}
-
-/**
- * htmlParseSystemLiteral:
- * @ctxt:  an HTML parser context
- *
- * parse an HTML Literal
- *
- * [11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
- *
- * Returns the SystemLiteral parsed or NULL
- */
-
-static xmlChar *
-htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
-    size_t len = 0, startPosition = 0;
-    int err = 0;
-    int quote;
-    xmlChar *ret = NULL;
-
-    if ((CUR != '"') && (CUR != '\'')) {
-	htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
-	             "SystemLiteral \" or ' expected\n", NULL, NULL);
-        return(NULL);
-    }
-    quote = CUR;
-    NEXT;
-
-    if (CUR_PTR < BASE_PTR)
-        return(ret);
-    startPosition = CUR_PTR - BASE_PTR;
-
-    while ((PARSER_STOPPED(ctxt) == 0) &&
-           (CUR != 0) && (CUR != quote)) {
-        /* TODO: Handle UTF-8 */
-        if (!IS_CHAR_CH(CUR)) {
-            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                            "Invalid char in SystemLiteral 0x%X\n", CUR);
-            err = 1;
-        }
-        NEXT;
-        len++;
-    }
-    if (CUR != quote) {
-        htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
-                     "Unfinished SystemLiteral\n", NULL, NULL);
-    } else {
-        if (err == 0) {
-            ret = xmlStrndup((BASE_PTR+startPosition), len);
-            if (ret == NULL) {
-                htmlErrMemory(ctxt);
-                return(NULL);
-            }
-        }
-        NEXT;
-    }
-
-    return(ret);
-}
-
-/**
- * htmlParsePubidLiteral:
- * @ctxt:  an HTML parser context
- *
- * parse an HTML public literal
- *
- * [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
- *
- * Returns the PubidLiteral parsed or NULL.
- */
-
-static xmlChar *
-htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
-    size_t len = 0, startPosition = 0;
-    int err = 0;
-    int quote;
-    xmlChar *ret = NULL;
-
-    if ((CUR != '"') && (CUR != '\'')) {
-	htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_STARTED,
-	             "PubidLiteral \" or ' expected\n", NULL, NULL);
-        return(NULL);
-    }
-    quote = CUR;
-    NEXT;
-
-    /*
-     * Name ::= (Letter | '_') (NameChar)*
-     */
-    if (CUR_PTR < BASE_PTR)
-        return(ret);
-    startPosition = CUR_PTR - BASE_PTR;
-
-    while ((PARSER_STOPPED(ctxt) == 0) &&
-           (CUR != 0) && (CUR != quote)) {
-        if (!IS_PUBIDCHAR_CH(CUR)) {
-            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                            "Invalid char in PubidLiteral 0x%X\n", CUR);
-            err = 1;
-        }
-        len++;
-        NEXT;
-    }
-
-    if (CUR != quote) {
-        htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
-                     "Unfinished PubidLiteral\n", NULL, NULL);
-    } else {
-        if (err == 0) {
-            ret = xmlStrndup((BASE_PTR + startPosition), len);
-            if (ret == NULL) {
-                htmlErrMemory(ctxt);
-                return(NULL);
-            }
-        }
-        NEXT;
-    }
-
-    return(ret);
-}
-
-/**
- * htmlParseScript:
- * @ctxt:  an HTML parser context
- *
- * parse the content of an HTML SCRIPT or STYLE element
- * http://www.w3.org/TR/html4/sgml/dtd.html#Script
- * http://www.w3.org/TR/html4/sgml/dtd.html#StyleSheet
- * http://www.w3.org/TR/html4/types.html#type-script
- * http://www.w3.org/TR/html4/types.html#h-6.15
- * http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.2.1
- *
- * Script data ( %Script; in the DTD) can be the content of the SCRIPT
- * element and the value of intrinsic event attributes. User agents must
- * not evaluate script data as HTML markup but instead must pass it on as
- * data to a script engine.
- * NOTES:
- * - The content is passed like CDATA
- * - the attributes for style and scripting "onXXX" are also described
- *   as CDATA but SGML allows entities references in attributes so their
- *   processing is identical as other attributes
- */
-static void
-htmlParseScript(htmlParserCtxtPtr ctxt) {
-    xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 5];
-    int nbchar = 0;
-    int cur,l;
-
-    cur = CUR_CHAR(l);
-    while (cur != 0) {
-	if ((cur == '<') && (NXT(1) == '/')) {
-            /*
-             * One should break here, the specification is clear:
-             * Authors should therefore escape "</" within the content.
-             * Escape mechanisms are specific to each scripting or
-             * style sheet language.
-             *
-             * In recovery mode, only break if end tag match the
-             * current tag, effectively ignoring all tags inside the
-             * script/style block and treating the entire block as
-             * CDATA.
-             */
-            if (ctxt->recovery) {
-                if (xmlStrncasecmp(ctxt->name, ctxt->input->cur+2,
-				   xmlStrlen(ctxt->name)) == 0)
-                {
-                    break; /* while */
-                } else {
-		    htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
-				 "Element %s embeds close tag\n",
-		                 ctxt->name, NULL);
-		}
-            } else {
-                if (((NXT(2) >= 'A') && (NXT(2) <= 'Z')) ||
-                    ((NXT(2) >= 'a') && (NXT(2) <= 'z')))
-                {
-                    break; /* while */
-                }
-            }
-	}
-        if (IS_CHAR(cur)) {
-	    COPY_BUF(l,buf,nbchar,cur);
-        } else {
-            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                            "Invalid char in CDATA 0x%X\n", cur);
-        }
-	NEXTL(l);
-	if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
-            buf[nbchar] = 0;
-	    if (ctxt->sax->cdataBlock!= NULL) {
-		/*
-		 * Insert as CDATA, which is the same as HTML_PRESERVE_NODE
-		 */
-		ctxt->sax->cdataBlock(ctxt->userData, buf, nbchar);
-	    } else if (ctxt->sax->characters != NULL) {
-		ctxt->sax->characters(ctxt->userData, buf, nbchar);
-	    }
-	    nbchar = 0;
-            SHRINK;
-	}
-	cur = CUR_CHAR(l);
-    }
-
-    if ((nbchar != 0) && (ctxt->sax != NULL) && (!ctxt->disableSAX)) {
-        buf[nbchar] = 0;
-	if (ctxt->sax->cdataBlock!= NULL) {
-	    /*
-	     * Insert as CDATA, which is the same as HTML_PRESERVE_NODE
-	     */
-	    ctxt->sax->cdataBlock(ctxt->userData, buf, nbchar);
-	} else if (ctxt->sax->characters != NULL) {
-	    ctxt->sax->characters(ctxt->userData, buf, nbchar);
-	}
-    }
-}
-
-
-/**
- * htmlParseCharDataInternal:
- * @ctxt:  an HTML parser context
- * @readahead: optional read ahead character in ascii range
- *
- * parse a CharData section.
- * if we are within a CDATA section ']]>' marks an end of section.
- *
- * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
- */
-
-static void
-htmlParseCharDataInternal(htmlParserCtxtPtr ctxt, int readahead) {
-    xmlChar buf[HTML_PARSER_BIG_BUFFER_SIZE + 6];
-    int nbchar = 0;
-    int cur, l;
-
-    if (readahead)
-        buf[nbchar++] = readahead;
-
-    cur = CUR_CHAR(l);
-    while ((cur != '<') &&
-           (cur != '&') &&
-	   (cur != 0) &&
-           (!PARSER_STOPPED(ctxt))) {
-	if (!(IS_CHAR(cur))) {
-	    htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-	                "Invalid char in CDATA 0x%X\n", cur);
-	} else {
-	    COPY_BUF(l,buf,nbchar,cur);
-	}
-	NEXTL(l);
-	if (nbchar >= HTML_PARSER_BIG_BUFFER_SIZE) {
-            buf[nbchar] = 0;
-
-	    /*
-	     * Ok the segment is to be consumed as chars.
-	     */
-	    if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
-		if (areBlanks(ctxt, buf, nbchar)) {
-		    if (ctxt->keepBlanks) {
-			if (ctxt->sax->characters != NULL)
-			    ctxt->sax->characters(ctxt->userData, buf, nbchar);
-		    } else {
-			if (ctxt->sax->ignorableWhitespace != NULL)
-			    ctxt->sax->ignorableWhitespace(ctxt->userData,
-			                                   buf, nbchar);
-		    }
-		} else {
-		    htmlCheckParagraph(ctxt);
-		    if (ctxt->sax->characters != NULL)
-			ctxt->sax->characters(ctxt->userData, buf, nbchar);
-		}
-	    }
-	    nbchar = 0;
-            SHRINK;
-	}
-	cur = CUR_CHAR(l);
-    }
-    if (nbchar != 0) {
-        buf[nbchar] = 0;
-
-	/*
-	 * Ok the segment is to be consumed as chars.
-	 */
-	if ((ctxt->sax != NULL) && (!ctxt->disableSAX)) {
-	    if (areBlanks(ctxt, buf, nbchar)) {
-		if (ctxt->keepBlanks) {
-		    if (ctxt->sax->characters != NULL)
-			ctxt->sax->characters(ctxt->userData, buf, nbchar);
-		} else {
-		    if (ctxt->sax->ignorableWhitespace != NULL)
-			ctxt->sax->ignorableWhitespace(ctxt->userData,
-			                               buf, nbchar);
-		}
-	    } else {
-		htmlCheckParagraph(ctxt);
-		if (ctxt->sax->characters != NULL)
-		    ctxt->sax->characters(ctxt->userData, buf, nbchar);
-	    }
-	}
+         * Insert as CDATA, which is the same as HTML_PRESERVE_NODE
+         */
+        ctxt->sax->cdataBlock(ctxt->userData, buf, size);
     }
 }
 
 /**
  * htmlParseCharData:
  * @ctxt:  an HTML parser context
+ * @partial: true if the input buffer is incomplete
  *
- * parse a CharData section.
- * if we are within a CDATA section ']]>' marks an end of section.
+ * Parse character data and references.
  *
- * [14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
+ * Returns 1 if all data was parsed, 0 otherwise.
  */
 
-static void
-htmlParseCharData(htmlParserCtxtPtr ctxt) {
-    htmlParseCharDataInternal(ctxt, 0);
-}
+static int
+htmlParseCharData(htmlParserCtxtPtr ctxt, int partial) {
+    xmlParserInputPtr input = ctxt->input;
+    xmlChar utf8Char[4];
+    int complete = 0;
+    int done = 0;
+    int mode;
+    int eof = PARSER_PROGRESSIVE(ctxt);
+    int line, col;
 
-/**
- * htmlParseExternalID:
- * @ctxt:  an HTML parser context
- * @publicID:  a xmlChar** receiving PubidLiteral
- *
- * Parse an External ID or a Public ID
- *
- * [75] ExternalID ::= 'SYSTEM' S SystemLiteral
- *                   | 'PUBLIC' S PubidLiteral S SystemLiteral
- *
- * [83] PublicID ::= 'PUBLIC' S PubidLiteral
- *
- * Returns the function returns SystemLiteral and in the second
- *                case publicID receives PubidLiteral, is strict is off
- *                it is possible to return NULL and have publicID set.
- */
+    mode = ctxt->endCheckState;
 
-static xmlChar *
-htmlParseExternalID(htmlParserCtxtPtr ctxt, xmlChar **publicID) {
-    xmlChar *URI = NULL;
+    line = input->line;
+    col = input->col;
 
-    if ((UPPER == 'S') && (UPP(1) == 'Y') &&
-         (UPP(2) == 'S') && (UPP(3) == 'T') &&
-	 (UPP(4) == 'E') && (UPP(5) == 'M')) {
-        SKIP(6);
-	if (!IS_BLANK_CH(CUR)) {
-	    htmlParseErr(ctxt, XML_ERR_SPACE_REQUIRED,
-	                 "Space required after 'SYSTEM'\n", NULL, NULL);
-	}
-        SKIP_BLANKS;
-	URI = htmlParseSystemLiteral(ctxt);
-	if (URI == NULL) {
-	    htmlParseErr(ctxt, XML_ERR_URI_REQUIRED,
-	                 "htmlParseExternalID: SYSTEM, no URI\n", NULL, NULL);
-        }
-    } else if ((UPPER == 'P') && (UPP(1) == 'U') &&
-	       (UPP(2) == 'B') && (UPP(3) == 'L') &&
-	       (UPP(4) == 'I') && (UPP(5) == 'C')) {
-        SKIP(6);
-	if (!IS_BLANK_CH(CUR)) {
-	    htmlParseErr(ctxt, XML_ERR_SPACE_REQUIRED,
-	                 "Space required after 'PUBLIC'\n", NULL, NULL);
-	}
-        SKIP_BLANKS;
-	*publicID = htmlParsePubidLiteral(ctxt);
-	if (*publicID == NULL) {
-	    htmlParseErr(ctxt, XML_ERR_PUBID_REQUIRED,
-	                 "htmlParseExternalID: PUBLIC, no Public Identifier\n",
-			 NULL, NULL);
-	}
-        SKIP_BLANKS;
-        if ((CUR == '"') || (CUR == '\'')) {
-	    URI = htmlParseSystemLiteral(ctxt);
-	}
-    }
-    return(URI);
-}
+    while (!PARSER_STOPPED(ctxt)) {
+        const xmlChar *chunk, *in, *repl;
+        size_t avail;
+        int replSize;
+        int skip = 0;
+        int ncr = 0;
+        int ncrSize = 0;
+        int cp = 0;
 
-/**
- * htmlParsePI:
- * @ctxt:  an HTML parser context
- *
- * Parse an XML Processing Instruction. HTML5 doesn't allow processing
- * instructions, so this will be removed at some point.
- */
-static void
-htmlParsePI(htmlParserCtxtPtr ctxt) {
-    xmlChar *buf = NULL;
-    int len = 0;
-    int size = HTML_PARSER_BUFFER_SIZE;
-    int cur, l;
-    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
-                    XML_MAX_HUGE_LENGTH :
-                    XML_MAX_TEXT_LENGTH;
-    const xmlChar *target;
-    xmlParserInputState state;
+        chunk = input->cur;
+        avail = input->end - chunk;
+        in = chunk;
 
-    if ((RAW == '<') && (NXT(1) == '?')) {
-	state = ctxt->instate;
-        ctxt->instate = XML_PARSER_PI;
-	/*
-	 * this is a Processing Instruction.
-	 */
-	SKIP(2);
+        repl = BAD_CAST "";
+        replSize = 0;
 
-	/*
-	 * Parse the target name and check for special support like
-	 * namespace.
-	 */
-        target = htmlParseName(ctxt);
-	if (target != NULL) {
-	    if (RAW == '>') {
-		SKIP(1);
+        while (!PARSER_STOPPED(ctxt)) {
+            size_t j;
+            int cur, size;
 
-		/*
-		 * SAX: PI detected.
-		 */
-		if ((ctxt->sax) && (!ctxt->disableSAX) &&
-		    (ctxt->sax->processingInstruction != NULL))
-		    ctxt->sax->processingInstruction(ctxt->userData,
-		                                     target, NULL);
-                goto done;
-	    }
-	    buf = (xmlChar *) xmlMallocAtomic(size);
-	    if (buf == NULL) {
-		htmlErrMemory(ctxt);
-		return;
-	    }
-	    cur = CUR;
-	    if (!IS_BLANK(cur)) {
-		htmlParseErr(ctxt, XML_ERR_SPACE_REQUIRED,
-			  "ParsePI: PI %s space expected\n", target, NULL);
-	    }
-            SKIP_BLANKS;
-	    cur = CUR_CHAR(l);
-	    while ((cur != 0) && (cur != '>')) {
-		if (len + 5 >= size) {
-		    xmlChar *tmp;
+            if (avail <= 64) {
+                if (!eof) {
+                    size_t oldAvail = avail;
+                    size_t off = in - chunk;
 
-		    size *= 2;
-		    tmp = (xmlChar *) xmlRealloc(buf, size);
-		    if (tmp == NULL) {
-			htmlErrMemory(ctxt);
-			xmlFree(buf);
-			return;
-		    }
-		    buf = tmp;
-		}
-                if (IS_CHAR(cur)) {
-		    COPY_BUF(l,buf,len,cur);
+                    input->cur = in;
+
+                    xmlParserGrow(ctxt);
+
+                    in = input->cur;
+                    chunk = in - off;
+                    input->cur = chunk;
+                    avail = input->end - in;
+
+                    if (oldAvail == avail)
+                        eof = 1;
+                }
+
+                if (avail == 0) {
+                    if ((partial) && (ncr)) {
+                        in -= ncrSize;
+                        ncrSize = 0;
+                    }
+
+                    done = 1;
+                    break;
+                }
+            }
+
+            /* Accelerator */
+            if (!ncr) {
+                while (avail > 0) {
+                    static const unsigned mask[8] = {
+                        0x00002401, 0x10002040,
+                        0x00000000, 0x00000000,
+                        0xFFFFFFFF, 0xFFFFFFFF,
+                        0xFFFFFFFF, 0xFFFFFFFF
+                    };
+                    cur = *in;
+                    if ((1u << (cur & 0x1F)) & mask[cur >> 5])
+                        break;
+                    col += 1;
+                    in += 1;
+                    avail -= 1;
+                }
+
+                if ((!eof) && (avail <= 64))
+                    continue;
+                if (avail == 0)
+                    continue;
+            }
+
+            cur = *in;
+            size = 1;
+            col += 1;
+
+            if (ncr) {
+                int lc = cur | 0x20;
+                int digit;
+
+                if ((cur >= '0') && (cur <= '9')) {
+                    digit = cur - '0';
+                } else if ((ncr == 16) && (lc >= 'a') && (lc <= 'f')) {
+                    digit = (lc - 'a') + 10;
                 } else {
-                    htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                                    "Invalid char in processing instruction "
-                                    "0x%X\n", cur);
+                    if (cur == ';') {
+                        in += 1;
+                        size += 1;
+                        ncrSize += 1;
+                    }
+                    goto next_chunk;
                 }
-                if (len > maxLength) {
-                    htmlParseErr(ctxt, XML_ERR_PI_NOT_FINISHED,
-                                 "PI %s too long", target, NULL);
-                    xmlFree(buf);
-                    goto done;
+
+                cp = cp * ncr + digit;
+                if (cp >= 0x110000)
+                    cp = 0x110000;
+
+                ncrSize += 1;
+
+                goto next_char;
+            }
+
+            switch (cur) {
+            case '<':
+                if (mode == 0) {
+                    done = 1;
+                    complete = 1;
+                    goto next_chunk;
                 }
-		NEXTL(l);
-		cur = CUR_CHAR(l);
-	    }
-	    buf[len] = 0;
-	    if (cur != '>') {
-		htmlParseErr(ctxt, XML_ERR_PI_NOT_FINISHED,
-		      "ParsePI: PI %s never end ...\n", target, NULL);
-	    } else {
-		SKIP(1);
+                if (mode == DATA_PLAINTEXT)
+                    break;
 
-		/*
-		 * SAX: PI detected.
-		 */
-		if ((ctxt->sax) && (!ctxt->disableSAX) &&
-		    (ctxt->sax->processingInstruction != NULL))
-		    ctxt->sax->processingInstruction(ctxt->userData,
-		                                     target, buf);
-	    }
-	    xmlFree(buf);
-	} else {
-	    htmlParseErr(ctxt, XML_ERR_PI_NOT_STARTED,
-                         "PI is not started correctly", NULL, NULL);
-	}
+                j = 1;
+                if (j < avail) {
+                    if ((mode == DATA_SCRIPT) && (in[j] == '!')) {
+                        /* Check for comment start */
 
-done:
-	ctxt->instate = state;
+                        j += 1;
+                        if ((j < avail) && (in[j] == '-')) {
+                            j += 1;
+                            if ((j < avail) && (in[j] == '-'))
+                                mode = DATA_SCRIPT_ESC1;
+                        }
+                    } else {
+                        int i = 0;
+                        int solidus = 0;
+
+                        /* Check for tag */
+
+                        if (in[j] == '/') {
+                            j += 1;
+                            solidus = 1;
+                        }
+
+                        if ((solidus) || (mode == DATA_SCRIPT_ESC1)) {
+                            while ((j < avail) &&
+                                   (ctxt->name[i] != 0) &&
+                                   (ctxt->name[i] == (in[j] | 0x20))) {
+                                i += 1;
+                                j += 1;
+                            }
+
+                            if ((ctxt->name[i] == 0) && (j < avail)) {
+                                int c = in[j];
+
+                                if ((c == '>') || (c == '/') ||
+                                    (IS_WS_HTML(c))) {
+                                    if ((mode == DATA_SCRIPT_ESC1) &&
+                                        (!solidus)) {
+                                        mode = DATA_SCRIPT_ESC2;
+                                    } else if (mode == DATA_SCRIPT_ESC2) {
+                                        mode = DATA_SCRIPT_ESC1;
+                                    } else {
+                                        complete = 1;
+                                        done = 1;
+                                        goto next_chunk;
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+
+                if ((partial) && (j >= avail)) {
+                    done = 1;
+                    goto next_chunk;
+                }
+
+                break;
+
+            case '-':
+                if ((mode != DATA_SCRIPT_ESC1) && (mode != DATA_SCRIPT_ESC2))
+                    break;
+
+                /* Check for comment end */
+
+                j = 1;
+                if ((j < avail) && (in[j] == '-')) {
+                    j += 1;
+                    if ((j < avail) && (in[j] == '>'))
+                        mode = DATA_SCRIPT;
+                }
+
+                if ((partial) && (j >= avail)) {
+                    done = 1;
+                    goto next_chunk;
+                }
+
+                break;
+
+            case '&':
+                if ((mode != 0) && (mode != DATA_RCDATA))
+                    break;
+
+                j = 1;
+
+                if ((j < avail) && (in[j] == '#')) {
+                    j += 1;
+                    if (j < avail) {
+                        if ((in[j] | 0x20) == 'x') {
+                            j += 1;
+                            if ((j < avail) && (IS_HEX_DIGIT(in[j]))) {
+                                ncr = 16;
+                                size = 3;
+                                ncrSize = 3;
+                                cp = 0;
+                            }
+                        } else if (IS_ASCII_DIGIT(in[j])) {
+                            ncr = 10;
+                            size = 2;
+                            ncrSize = 2;
+                            cp = 0;
+                        }
+                    }
+                } else {
+                    if (partial) {
+                        int terminated = 0;
+                        size_t i;
+
+                        /*
+                         * &CounterClockwiseContourIntegral; has 33 bytes.
+                         */
+                        for (i = 1; i < avail; i++) {
+                            if ((i >= 32) ||
+                                (!IS_ASCII_LETTER(in[i]) &&
+                                 ((i < 2) || !IS_ASCII_DIGIT(in[i])))) {
+                                terminated = 1;
+                                break;
+                            }
+                        }
+
+                        if (!terminated) {
+                            done = 1;
+                            goto next_chunk;
+                        }
+                    }
+
+                    repl = htmlFindEntityPrefix(in + j,
+                                                avail - j,
+                                                /* isAttr */ 0,
+                                                &skip, &replSize);
+                    if (repl != NULL) {
+                        skip += 1;
+                        goto next_chunk;
+                    }
+
+                    skip = 0;
+                }
+
+                if ((partial) && (j >= avail)) {
+                    done = 1;
+                    goto next_chunk;
+                }
+
+                break;
+
+            case '\0':
+                skip = 1;
+                repl = BAD_CAST "\xEF\xBF\xBD";
+                replSize = 3;
+                goto next_chunk;
+
+            case '\n':
+                line += 1;
+                col = 1;
+                break;
+
+            case '\r':
+                if (partial && avail < 2) {
+                    done = 1;
+                    goto next_chunk;
+                }
+
+                skip = 1;
+                if (in[1] != 0x0A) {
+                    repl = BAD_CAST "\x0A";
+                    replSize = 1;
+                }
+                goto next_chunk;
+
+            default:
+                if (cur < 0x80)
+                    break;
+
+                if ((input->flags & XML_INPUT_HAS_ENCODING) == 0) {
+                    xmlChar * guess;
+
+                    if (in > chunk)
+                        goto next_chunk;
+
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+                    guess = NULL;
+#else
+                    guess = htmlFindEncoding(ctxt);
+#endif
+                    if (guess == NULL) {
+                        xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_8859_1);
+                    } else {
+                        xmlSwitchEncodingName(ctxt, (const char *) guess);
+                        xmlFree(guess);
+                    }
+                    input->flags |= XML_INPUT_HAS_ENCODING;
+
+                    eof = PARSER_PROGRESSIVE(ctxt);
+                    goto restart;
+                }
+
+                size = htmlValidateUtf8(ctxt, in, avail, partial);
+
+                if ((partial) && (size == 0)) {
+                    done = 1;
+                    goto next_chunk;
+                }
+
+                if (size <= 0) {
+                    skip = 1;
+                    repl = BAD_CAST "\xEF\xBF\xBD";
+                    replSize = 3;
+                    goto next_chunk;
+                }
+
+                break;
+            }
+
+next_char:
+            in += size;
+            avail -= size;
+        }
+
+next_chunk:
+        if (ncrSize > 0) {
+            skip = ncrSize;
+            in -= ncrSize;
+
+            repl = htmlCodePointToUtf8(cp, utf8Char, &replSize);
+        }
+
+        if (in > chunk) {
+            input->cur += in - chunk;
+            htmlCharDataSAXCallback(ctxt, chunk, in - chunk, mode);
+        }
+
+        input->cur += skip;
+        if (replSize > 0)
+            htmlCharDataSAXCallback(ctxt, repl, replSize, mode);
+
+        SHRINK;
+
+        if (done)
+            break;
+
+restart:
+        ;
     }
+
+    input->line = line;
+    input->col = col;
+
+    if (complete)
+        ctxt->endCheckState = 0;
+    else
+        ctxt->endCheckState = mode;
+
+    return(complete);
 }
 
 /**
  * htmlParseComment:
  * @ctxt:  an HTML parser context
+ * @bogus:  true if this is a bogus comment
  *
  * Parse an HTML comment
  */
 static void
-htmlParseComment(htmlParserCtxtPtr ctxt) {
+htmlParseComment(htmlParserCtxtPtr ctxt, int bogus) {
+    const xmlChar *comment = BAD_CAST "";
     xmlChar *buf = NULL;
-    int len;
-    int size = HTML_PARSER_BUFFER_SIZE;
-    int q, ql;
-    int r, rl;
-    int cur, l;
-    int next, nl;
-    int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
+    int maxLength = (ctxt->options & HTML_PARSE_HUGE) ?
                     XML_MAX_HUGE_LENGTH :
                     XML_MAX_TEXT_LENGTH;
-    xmlParserInputState state;
 
-    /*
-     * Check that there is a comment right here.
-     */
-    if ((RAW != '<') || (NXT(1) != '!') ||
-        (NXT(2) != '-') || (NXT(3) != '-')) return;
-
-    state = ctxt->instate;
-    ctxt->instate = XML_PARSER_COMMENT;
-    SKIP(4);
-    buf = (xmlChar *) xmlMallocAtomic(size);
-    if (buf == NULL) {
-        htmlErrMemory(ctxt);
-	return;
-    }
-    len = 0;
-    buf[len] = 0;
-    q = CUR_CHAR(ql);
-    if (q == 0)
-        goto unfinished;
-    if (q == '>') {
-        htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL);
-        cur = '>';
-        goto finished;
-    }
-    NEXTL(ql);
-    r = CUR_CHAR(rl);
-    if (r == 0)
-        goto unfinished;
-    if (q == '-' && r == '>') {
-        htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL);
-        cur = '>';
-        goto finished;
-    }
-    NEXTL(rl);
-    cur = CUR_CHAR(l);
-    while ((cur != 0) &&
-           ((cur != '>') ||
-	    (r != '-') || (q != '-'))) {
-	NEXTL(l);
-	next = CUR_CHAR(nl);
-
-	if ((q == '-') && (r == '-') && (cur == '!') && (next == '>')) {
-	  htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
-		       "Comment incorrectly closed by '--!>'", NULL, NULL);
-	  cur = '>';
-	  break;
-	}
-
-	if (len + 5 >= size) {
-	    xmlChar *tmp;
-
-	    size *= 2;
-	    tmp = (xmlChar *) xmlRealloc(buf, size);
-	    if (tmp == NULL) {
-	        xmlFree(buf);
-	        htmlErrMemory(ctxt);
-		return;
-	    }
-	    buf = tmp;
-	}
-        if (IS_CHAR(q)) {
-	    COPY_BUF(ql,buf,len,q);
+    if (bogus) {
+        buf = htmlParseData(ctxt, MASK_GT, 0, 0, maxLength);
+        if (CUR == '>')
+            SKIP(1);
+        comment = buf;
+    } else {
+        if (CUR == '>') {
+            SKIP(1);
+        } else if ((CUR == '-') && (NXT(1) == '>')) {
+            SKIP(2);
         } else {
-            htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-                            "Invalid char in comment 0x%X\n", q);
+            buf = htmlParseData(ctxt, MASK_DASH, 1, 0, maxLength);
+            comment = buf;
         }
-        if (len > maxLength) {
-            htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
-                         "comment too long", NULL, NULL);
-            xmlFree(buf);
-            ctxt->instate = state;
-            return;
-        }
-
-	q = r;
-	ql = rl;
-	r = cur;
-	rl = l;
-	cur = next;
-	l = nl;
-    }
-finished:
-    buf[len] = 0;
-    if (cur == '>') {
-        NEXT;
-	if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
-	    (!ctxt->disableSAX))
-	    ctxt->sax->comment(ctxt->userData, buf);
-	xmlFree(buf);
-	ctxt->instate = state;
-	return;
     }
 
-unfinished:
-    htmlParseErr(ctxt, XML_ERR_COMMENT_NOT_FINISHED,
-		 "Comment not terminated \n<!--%.50s\n", buf, NULL);
+    if (comment == NULL)
+        return;
+
+    if ((ctxt->sax != NULL) && (ctxt->sax->comment != NULL) &&
+        (!ctxt->disableSAX))
+        ctxt->sax->comment(ctxt->userData, comment);
+
     xmlFree(buf);
 }
 
@@ -3469,94 +3426,117 @@
  *
  * DEPRECATED: Internal function, don't use.
  *
- * parse Reference declarations
- *
- * [66] CharRef ::= '&#' [0-9]+ ';' |
- *                  '&#x' [0-9a-fA-F]+ ';'
- *
- * Returns the value parsed (as an int)
+ * Returns 0
  */
 int
-htmlParseCharRef(htmlParserCtxtPtr ctxt) {
-    int val = 0;
-
-    if ((ctxt == NULL) || (ctxt->input == NULL))
-        return(0);
-    if ((CUR == '&') && (NXT(1) == '#') &&
-        ((NXT(2) == 'x') || NXT(2) == 'X')) {
-	SKIP(3);
-	while (CUR != ';') {
-	    if ((CUR >= '0') && (CUR <= '9')) {
-                if (val < 0x110000)
-	            val = val * 16 + (CUR - '0');
-            } else if ((CUR >= 'a') && (CUR <= 'f')) {
-                if (val < 0x110000)
-	            val = val * 16 + (CUR - 'a') + 10;
-            } else if ((CUR >= 'A') && (CUR <= 'F')) {
-                if (val < 0x110000)
-	            val = val * 16 + (CUR - 'A') + 10;
-            } else {
-	        htmlParseErr(ctxt, XML_ERR_INVALID_HEX_CHARREF,
-		             "htmlParseCharRef: missing semicolon\n",
-			     NULL, NULL);
-		break;
-	    }
-	    NEXT;
-	}
-	if (CUR == ';')
-	    NEXT;
-    } else if  ((CUR == '&') && (NXT(1) == '#')) {
-	SKIP(2);
-	while (CUR != ';') {
-	    if ((CUR >= '0') && (CUR <= '9')) {
-                if (val < 0x110000)
-	            val = val * 10 + (CUR - '0');
-            } else {
-	        htmlParseErr(ctxt, XML_ERR_INVALID_DEC_CHARREF,
-		             "htmlParseCharRef: missing semicolon\n",
-			     NULL, NULL);
-		break;
-	    }
-	    NEXT;
-	}
-	if (CUR == ';')
-	    NEXT;
-    } else {
-	htmlParseErr(ctxt, XML_ERR_INVALID_CHARREF,
-	             "htmlParseCharRef: invalid value\n", NULL, NULL);
-    }
-    /*
-     * Check the value IS_CHAR ...
-     */
-    if (IS_CHAR(val)) {
-        return(val);
-    } else if (val >= 0x110000) {
-	htmlParseErr(ctxt, XML_ERR_INVALID_CHAR,
-		     "htmlParseCharRef: value too large\n", NULL, NULL);
-    } else {
-	htmlParseErrInt(ctxt, XML_ERR_INVALID_CHAR,
-			"htmlParseCharRef: invalid xmlChar value %d\n",
-			val);
-    }
+htmlParseCharRef(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED) {
     return(0);
 }
 
 
 /**
+ * htmlParseDoctypeLiteral:
+ * @ctxt:  an HTML parser context
+ *
+ * Parse a DOCTYPE SYTSTEM or PUBLIC literal.
+ *
+ * Returns the literal or NULL in case of error.
+ */
+
+static xmlChar *
+htmlParseDoctypeLiteral(htmlParserCtxtPtr ctxt) {
+    xmlChar *ret;
+    int maxLength = (ctxt->options & HTML_PARSE_HUGE) ?
+                    XML_MAX_TEXT_LENGTH :
+                    XML_MAX_NAME_LENGTH;
+
+    if (CUR == '"') {
+        SKIP(1);
+        ret = htmlParseData(ctxt, MASK_DQ_GT, 0, 0, maxLength);
+        if (CUR == '"')
+            SKIP(1);
+    } else if (CUR == '\'') {
+        SKIP(1);
+        ret = htmlParseData(ctxt, MASK_SQ_GT, 0, 0, maxLength);
+        if (CUR == '\'')
+            SKIP(1);
+    } else {
+        return(NULL);
+    }
+
+    return(ret);
+}
+
+static void
+htmlSkipBogusDoctype(htmlParserCtxtPtr ctxt) {
+    const xmlChar *in;
+    size_t avail;
+    int eof = PARSER_PROGRESSIVE(ctxt);
+    int line, col;
+
+    line = ctxt->input->line;
+    col = ctxt->input->col;
+
+    in = ctxt->input->cur;
+    avail = ctxt->input->end - in;
+
+    while (!PARSER_STOPPED(ctxt)) {
+        int cur;
+
+        if ((!eof) && (avail <= 64)) {
+            size_t oldAvail = avail;
+
+            ctxt->input->cur = in;
+
+            xmlParserGrow(ctxt);
+
+            in = ctxt->input->cur;
+            avail = ctxt->input->end - in;
+
+            if (oldAvail == avail)
+                eof = 1;
+        }
+
+        if (avail == 0)
+            break;
+
+        col += 1;
+
+        cur = *in;
+        if (cur == '>') {
+            in += 1;
+            break;
+        } else if (cur == 0x0A) {
+            line += 1;
+            col = 1;
+        }
+
+        in += 1;
+        avail -= 1;
+
+        SHRINK;
+    }
+
+    ctxt->input->cur = in;
+    ctxt->input->line = line;
+    ctxt->input->col = col;
+}
+
+/**
  * htmlParseDocTypeDecl:
  * @ctxt:  an HTML parser context
  *
- * parse a DOCTYPE declaration
- *
- * [28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S?
- *                      ('[' (markupdecl | PEReference | S)* ']' S?)? '>'
+ * Parse a DOCTYPE declaration.
  */
 
 static void
 htmlParseDocTypeDecl(htmlParserCtxtPtr ctxt) {
-    const xmlChar *name;
-    xmlChar *ExternalID = NULL;
+    xmlChar *name = NULL;
+    xmlChar *publicId = NULL;
     xmlChar *URI = NULL;
+    int maxLength = (ctxt->options & HTML_PARSE_HUGE) ?
+                    XML_MAX_TEXT_LENGTH :
+                    XML_MAX_NAME_LENGTH;
 
     /*
      * We know that '<!DOCTYPE' has been detected.
@@ -3565,53 +3545,55 @@
 
     SKIP_BLANKS;
 
-    /*
-     * Parse the DOCTYPE name.
-     */
-    name = htmlParseName(ctxt);
-    if (name == NULL) {
-	htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
-	             "htmlParseDocTypeDecl : no DOCTYPE name !\n",
-		     NULL, NULL);
+    if ((ctxt->input->cur < ctxt->input->end) && (CUR != '>')) {
+        name = htmlParseData(ctxt, MASK_WS_GT, 0, 0, maxLength);
+
+        if ((ctxt->options & HTML_PARSE_HTML5) && (name != NULL)) {
+            xmlChar *cur;
+
+            for (cur = name; *cur; cur++) {
+                if (IS_UPPER(*cur))
+                    *cur += 0x20;
+            }
+        }
+
+        SKIP_BLANKS;
     }
-    /*
-     * Check that upper(name) == "HTML" !!!!!!!!!!!!!
-     */
-
-    SKIP_BLANKS;
 
     /*
-     * Check for SystemID and ExternalID
+     * Check for SystemID and publicId
      */
-    URI = htmlParseExternalID(ctxt, &ExternalID);
-    SKIP_BLANKS;
-
-    /*
-     * We should be at the end of the DOCTYPE declaration.
-     */
-    if (CUR != '>') {
-	htmlParseErr(ctxt, XML_ERR_DOCTYPE_NOT_FINISHED,
-	             "DOCTYPE improperly terminated\n", NULL, NULL);
-        /* Ignore bogus content */
-        while ((CUR != 0) && (CUR != '>') &&
-               (PARSER_STOPPED(ctxt) == 0))
-            NEXT;
+    if ((UPPER == 'P') && (UPP(1) == 'U') &&
+	(UPP(2) == 'B') && (UPP(3) == 'L') &&
+	(UPP(4) == 'I') && (UPP(5) == 'C')) {
+        SKIP(6);
+        SKIP_BLANKS;
+	publicId = htmlParseDoctypeLiteral(ctxt);
+	if (publicId == NULL)
+            goto bogus;
+        SKIP_BLANKS;
+	URI = htmlParseDoctypeLiteral(ctxt);
+    } else if ((UPPER == 'S') && (UPP(1) == 'Y') &&
+               (UPP(2) == 'S') && (UPP(3) == 'T') &&
+	       (UPP(4) == 'E') && (UPP(5) == 'M')) {
+        SKIP(6);
+        SKIP_BLANKS;
+	URI = htmlParseDoctypeLiteral(ctxt);
     }
-    if (CUR == '>')
-        NEXT;
+
+bogus:
+    htmlSkipBogusDoctype(ctxt);
 
     /*
      * Create or update the document accordingly to the DOCTYPE
      */
     if ((ctxt->sax != NULL) && (ctxt->sax->internalSubset != NULL) &&
 	(!ctxt->disableSAX))
-	ctxt->sax->internalSubset(ctxt->userData, name, ExternalID, URI);
+	ctxt->sax->internalSubset(ctxt->userData, name, publicId, URI);
 
-    /*
-     * Cleanup, since we don't use all those identifiers
-     */
-    if (URI != NULL) xmlFree(URI);
-    if (ExternalID != NULL) xmlFree(ExternalID);
+    xmlFree(name);
+    xmlFree(URI);
+    xmlFree(publicId);
 }
 
 /**
@@ -3635,31 +3617,28 @@
  * Returns the attribute name, and the value in *value.
  */
 
-static const xmlChar *
+static xmlHashedString
 htmlParseAttribute(htmlParserCtxtPtr ctxt, xmlChar **value) {
-    const xmlChar *name;
+    xmlHashedString hname;
     xmlChar *val = NULL;
 
     *value = NULL;
-    name = htmlParseHTMLName(ctxt);
-    if (name == NULL) {
-	htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
-	             "error parsing attribute name\n", NULL, NULL);
-        return(NULL);
-    }
+    hname = htmlParseHTMLName(ctxt, 1);
+    if (hname.name == NULL)
+        return(hname);
 
     /*
      * read the value
      */
     SKIP_BLANKS;
     if (CUR == '=') {
-        NEXT;
+        SKIP(1);
 	SKIP_BLANKS;
 	val = htmlParseAttValue(ctxt);
     }
 
     *value = val;
-    return(name);
+    return(hname);
 }
 
 /**
@@ -3687,7 +3666,7 @@
     /*
      * skip blank
      */
-    if (encoding && IS_BLANK_CH(*encoding))
+    if (encoding && IS_WS_HTML(*encoding))
 	encoding = xmlStrcasestr(attvalue, BAD_CAST"=");
     if (encoding && *encoding == '=') {
 	encoding ++;
@@ -3742,6 +3721,48 @@
 }
 
 /**
+ * htmlAttrHashInsert:
+ * @ctxt: parser context
+ * @size: size of the hash table
+ * @name: attribute name
+ * @hashValue: hash value of name
+ * @aindex: attribute index (this is a multiple of 5)
+ *
+ * Inserts a new attribute into the hash table.
+ *
+ * Returns INT_MAX if no existing attribute was found, the attribute
+ * index if an attribute was found, -1 if a memory allocation failed.
+ */
+static int
+htmlAttrHashInsert(xmlParserCtxtPtr ctxt, unsigned size, const xmlChar *name,
+                   unsigned hashValue, int aindex) {
+    xmlAttrHashBucket *table = ctxt->attrHash;
+    xmlAttrHashBucket *bucket;
+    unsigned hindex;
+
+    hindex = hashValue & (size - 1);
+    bucket = &table[hindex];
+
+    while (bucket->index >= 0) {
+        const xmlChar **atts = &ctxt->atts[bucket->index];
+
+        if (name == atts[0])
+            return(bucket->index);
+
+        hindex++;
+        bucket++;
+        if (hindex >= size) {
+            hindex = 0;
+            bucket = table;
+        }
+    }
+
+    bucket->index = aindex;
+
+    return(INT_MAX);
+}
+
+/**
  * htmlParseStartTag:
  * @ctxt:  an HTML parser context
  *
@@ -3761,7 +3782,7 @@
  * Returns 0 in case of success, -1 in case of error and 1 if discarded
  */
 
-static int
+static void
 htmlParseStartTag(htmlParserCtxtPtr ctxt) {
     const xmlChar *name;
     const xmlChar *attname;
@@ -3773,69 +3794,62 @@
     int i;
     int discardtag = 0;
 
-    if ((ctxt == NULL) || (ctxt->input == NULL))
-	return -1;
-    if (CUR != '<') return -1;
-    NEXT;
+    ctxt->endCheckState = 0;
+
+    SKIP(1);
 
     atts = ctxt->atts;
     maxatts = ctxt->maxatts;
 
     GROW;
-    name = htmlParseHTMLName(ctxt);
-    if (name == NULL) {
-	htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
-	             "htmlParseStartTag: invalid element name\n",
-		     NULL, NULL);
-	/* Dump the bogus tag like browsers do */
-	while ((CUR != 0) && (CUR != '>') &&
-               (PARSER_STOPPED(ctxt) == 0))
-	    NEXT;
-        return -1;
-    }
+    name = htmlParseHTMLName(ctxt, 0).name;
+    if (name == NULL)
+        return;
     if (xmlStrEqual(name, BAD_CAST"meta"))
 	meta = 1;
 
-    /*
-     * Check for auto-closure of HTML elements.
-     */
-    htmlAutoClose(ctxt, name);
+    if ((ctxt->options & HTML_PARSE_HTML5) == 0) {
+        /*
+         * Check for auto-closure of HTML elements.
+         */
+        htmlAutoClose(ctxt, name);
 
-    /*
-     * Check for implied HTML elements.
-     */
-    htmlCheckImplied(ctxt, name);
+        /*
+         * Check for implied HTML elements.
+         */
+        htmlCheckImplied(ctxt, name);
 
-    /*
-     * Avoid html at any level > 0, head at any level != 1
-     * or any attempt to recurse body
-     */
-    if ((ctxt->nameNr > 0) && (xmlStrEqual(name, BAD_CAST"html"))) {
-	htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
-	             "htmlParseStartTag: misplaced <html> tag\n",
-		     name, NULL);
-	discardtag = 1;
-	ctxt->depth++;
-    }
-    if ((ctxt->nameNr != 1) &&
-	(xmlStrEqual(name, BAD_CAST"head"))) {
-	htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
-	             "htmlParseStartTag: misplaced <head> tag\n",
-		     name, NULL);
-	discardtag = 1;
-	ctxt->depth++;
-    }
-    if (xmlStrEqual(name, BAD_CAST"body")) {
-	int indx;
-	for (indx = 0;indx < ctxt->nameNr;indx++) {
-	    if (xmlStrEqual(ctxt->nameTab[indx], BAD_CAST"body")) {
-		htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
-		             "htmlParseStartTag: misplaced <body> tag\n",
-			     name, NULL);
-		discardtag = 1;
-		ctxt->depth++;
-	    }
-	}
+        /*
+         * Avoid html at any level > 0, head at any level != 1
+         * or any attempt to recurse body
+         */
+        if ((ctxt->nameNr > 0) && (xmlStrEqual(name, BAD_CAST"html"))) {
+            htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
+                         "htmlParseStartTag: misplaced <html> tag\n",
+                         name, NULL);
+            discardtag = 1;
+            ctxt->depth++;
+        }
+        if ((ctxt->nameNr != 1) &&
+            (xmlStrEqual(name, BAD_CAST"head"))) {
+            htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
+                         "htmlParseStartTag: misplaced <head> tag\n",
+                         name, NULL);
+            discardtag = 1;
+            ctxt->depth++;
+        }
+        if (xmlStrEqual(name, BAD_CAST"body")) {
+            int indx;
+            for (indx = 0;indx < ctxt->nameNr;indx++) {
+                if (xmlStrEqual(ctxt->nameTab[indx], BAD_CAST"body")) {
+                    htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
+                                 "htmlParseStartTag: misplaced <body> tag\n",
+                                 name, NULL);
+                    discardtag = 1;
+                    ctxt->depth++;
+                }
+            }
+        }
     }
 
     /*
@@ -3844,89 +3858,164 @@
      * (S Attribute)* S?
      */
     SKIP_BLANKS;
-    while ((CUR != 0) &&
+    while ((ctxt->input->cur < ctxt->input->end) &&
            (CUR != '>') &&
 	   ((CUR != '/') || (NXT(1) != '>')) &&
            (PARSER_STOPPED(ctxt) == 0)) {
+        xmlHashedString hattname;
+
+        /*  unexpected-solidus-in-tag */
+        if (CUR == '/') {
+            SKIP(1);
+            SKIP_BLANKS;
+            continue;
+        }
 	GROW;
-	attname = htmlParseAttribute(ctxt, &attvalue);
+	hattname = htmlParseAttribute(ctxt, &attvalue);
+        attname = hattname.name;
+
         if (attname != NULL) {
-
-	    /*
-	     * Well formedness requires at most one declaration of an attribute
-	     */
-	    for (i = 0; i < nbatts;i += 2) {
-	        if (xmlStrEqual(atts[i], attname)) {
-		    htmlParseErr(ctxt, XML_ERR_ATTRIBUTE_REDEFINED,
-		                 "Attribute %s redefined\n", attname, NULL);
-		    if (attvalue != NULL)
-			xmlFree(attvalue);
-		    goto failed;
-		}
-	    }
-
 	    /*
 	     * Add the pair to atts
 	     */
-	    if (atts == NULL) {
-	        maxatts = 22; /* allow for 10 attrs by default */
-	        atts = (const xmlChar **)
-		       xmlMalloc(maxatts * sizeof(xmlChar *));
-		if (atts == NULL) {
-		    htmlErrMemory(ctxt);
-		    if (attvalue != NULL)
-			xmlFree(attvalue);
-		    goto failed;
-		}
-		ctxt->atts = atts;
-		ctxt->maxatts = maxatts;
-	    } else if (nbatts + 4 > maxatts) {
-	        const xmlChar **n;
+	    if (nbatts + 4 > maxatts) {
+	        const xmlChar **tmp;
+                unsigned *utmp;
+                int newSize;
 
-	        maxatts *= 2;
-	        n = (const xmlChar **) xmlRealloc((void *) atts,
-					     maxatts * sizeof(const xmlChar *));
-		if (n == NULL) {
+                newSize = xmlGrowCapacity(maxatts,
+                                          sizeof(tmp[0]) * 2 + sizeof(utmp[0]),
+                                          11, HTML_MAX_ATTRS);
+		if (newSize < 0) {
 		    htmlErrMemory(ctxt);
-		    if (attvalue != NULL)
-			xmlFree(attvalue);
 		    goto failed;
 		}
-		atts = n;
-		ctxt->atts = atts;
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+                if (newSize < 2)
+                    newSize = 2;
+#endif
+	        tmp = xmlRealloc(atts, newSize * sizeof(tmp[0]) * 2);
+		if (tmp == NULL) {
+		    htmlErrMemory(ctxt);
+		    goto failed;
+		}
+                atts = tmp;
+		ctxt->atts = tmp;
+
+	        utmp = xmlRealloc(ctxt->attallocs, newSize * sizeof(utmp[0]));
+		if (utmp == NULL) {
+		    htmlErrMemory(ctxt);
+		    goto failed;
+		}
+                ctxt->attallocs = utmp;
+
+                maxatts = newSize * 2;
 		ctxt->maxatts = maxatts;
 	    }
+
+            ctxt->attallocs[nbatts/2] = hattname.hashValue;
 	    atts[nbatts++] = attname;
 	    atts[nbatts++] = attvalue;
-	    atts[nbatts] = NULL;
-	    atts[nbatts + 1] = NULL;
-	}
-	else {
-	    if (attvalue != NULL)
-	        xmlFree(attvalue);
-	    /* Dump the bogus attribute string up to the next blank or
-	     * the end of the tag. */
-	    while ((CUR != 0) &&
-	           !(IS_BLANK_CH(CUR)) && (CUR != '>') &&
-		   ((CUR != '/') || (NXT(1) != '>')) &&
-                   (PARSER_STOPPED(ctxt) == 0))
-		NEXT;
+
+            attvalue = NULL;
 	}
 
 failed:
+        if (attvalue != NULL)
+            xmlFree(attvalue);
+
 	SKIP_BLANKS;
     }
 
+    if (ctxt->input->cur >= ctxt->input->end) {
+        discardtag = 1;
+        goto done;
+    }
+
     /*
-     * Handle specific association to the META tag
+     * Verify that attribute names are unique.
      */
-    if (meta && (nbatts != 0))
-	htmlCheckMeta(ctxt, atts);
+    if (nbatts > 2) {
+        unsigned attrHashSize;
+        int j, k;
+
+        attrHashSize = 4;
+        while (attrHashSize / 2 < (unsigned) nbatts / 2)
+            attrHashSize *= 2;
+
+        if (attrHashSize > ctxt->attrHashMax) {
+            xmlAttrHashBucket *tmp;
+
+            tmp = xmlRealloc(ctxt->attrHash, attrHashSize * sizeof(tmp[0]));
+            if (tmp == NULL) {
+                htmlErrMemory(ctxt);
+                goto done;
+            }
+
+            ctxt->attrHash = tmp;
+            ctxt->attrHashMax = attrHashSize;
+        }
+
+        memset(ctxt->attrHash, -1, attrHashSize * sizeof(ctxt->attrHash[0]));
+
+        for (i = 0, j = 0, k = 0; i < nbatts; i += 2, k++) {
+            unsigned hashValue;
+            int res;
+
+            attname = atts[i];
+            hashValue = ctxt->attallocs[k] | 0x80000000;
+
+            res = htmlAttrHashInsert(ctxt, attrHashSize, attname,
+                                    hashValue, j);
+            if (res < 0)
+                continue;
+
+            if (res == INT_MAX) {
+                atts[j] = atts[i];
+                atts[j+1] = atts[i+1];
+                j += 2;
+            } else {
+                xmlFree((xmlChar *) atts[i+1]);
+            }
+        }
+
+        nbatts = j;
+    }
+
+    if (nbatts > 0) {
+        atts[nbatts] = NULL;
+        atts[nbatts + 1] = NULL;
+
+    /*
+     * Apple's new libiconv is so broken that you routinely run into
+     * issues when fuzz testing (by accident with an uninstrumented
+     * libiconv). Here's a harmless (?) example:
+     *
+     * printf '>'             | iconv -f shift_jis -t utf-8 | hexdump -C
+     * printf '\xfc\x00\x00'  | iconv -f shift_jis -t utf-8 | hexdump -C
+     * printf '>\xfc\x00\x00' | iconv -f shift_jis -t utf-8 | hexdump -C
+     *
+     * The last command fails to detect the illegal sequence.
+     */
+#if !defined(__APPLE__) || \
+    !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
+        /*
+         * Handle specific association to the META tag
+         */
+        if (meta)
+            htmlCheckMeta(ctxt, atts);
+#endif
+    }
 
     /*
      * SAX: Start of Element !
      */
     if (!discardtag) {
+        if (ctxt->options & HTML_PARSE_HTML5) {
+            if (ctxt->nameNr > 0)
+                htmlnamePop(ctxt);
+        }
+
 	htmlnamePush(ctxt, name);
 	if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL)) {
 	    if (nbatts != 0)
@@ -3936,14 +4025,13 @@
 	}
     }
 
+done:
     if (atts != NULL) {
         for (i = 1;i < nbatts;i += 2) {
 	    if (atts[i] != NULL)
 		xmlFree((xmlChar *) atts[i]);
 	}
     }
-
-    return(discardtag);
 }
 
 /**
@@ -3961,37 +4049,77 @@
  * Returns 1 if the current level should be closed.
  */
 
-static int
+static void
 htmlParseEndTag(htmlParserCtxtPtr ctxt)
 {
     const xmlChar *name;
     const xmlChar *oldname;
-    int i, ret;
+    int i;
 
-    if ((CUR != '<') || (NXT(1) != '/')) {
-        htmlParseErr(ctxt, XML_ERR_LTSLASH_REQUIRED,
-	             "htmlParseEndTag: '</' not found\n", NULL, NULL);
-        return (0);
-    }
+    ctxt->endCheckState = 0;
+
     SKIP(2);
 
-    name = htmlParseHTMLName(ctxt);
+    if (ctxt->input->cur >= ctxt->input->end) {
+        htmlStartCharData(ctxt);
+        if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
+            (ctxt->sax->characters != NULL))
+            ctxt->sax->characters(ctxt->userData,
+                                  BAD_CAST "</", 2);
+        return;
+    }
+
+    if (CUR == '>') {
+        SKIP(1);
+        return;
+    }
+
+    if (!IS_ASCII_LETTER(CUR)) {
+        htmlParseComment(ctxt, /* bogus */ 1);
+        return;
+    }
+
+    name = htmlParseHTMLName(ctxt, 0).name;
     if (name == NULL)
-        return (0);
+        return;
+
     /*
-     * We should definitely be at the ending "S? '>'" part
+     * Parse and ignore attributes.
      */
     SKIP_BLANKS;
-    if (CUR != '>') {
-        htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
-	             "End tag : expected '>'\n", NULL, NULL);
-        /* Skip to next '>' */
-        while ((PARSER_STOPPED(ctxt) == 0) &&
-               (CUR != 0) && (CUR != '>'))
-            NEXT;
+    while ((ctxt->input->cur < ctxt->input->end) &&
+           (CUR != '>') &&
+	   ((CUR != '/') || (NXT(1) != '>')) &&
+           (ctxt->instate != XML_PARSER_EOF)) {
+        xmlChar *attvalue = NULL;
+
+        /*  unexpected-solidus-in-tag */
+        if (CUR == '/') {
+            SKIP(1);
+            SKIP_BLANKS;
+            continue;
+        }
+	GROW;
+	htmlParseAttribute(ctxt, &attvalue);
+        if (attvalue != NULL)
+            xmlFree(attvalue);
+
+	SKIP_BLANKS;
     }
-    if (CUR == '>')
-        NEXT;
+
+    if (CUR == '>') {
+        SKIP(1);
+    } else if ((CUR == '/') && (NXT(1) == '>')) {
+        SKIP(2);
+    } else {
+        return;
+    }
+
+    if (ctxt->options & HTML_PARSE_HTML5) {
+        if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
+            ctxt->sax->endElement(ctxt->userData, name);
+        return;
+    }
 
     /*
      * if we ignored misplaced tags in htmlParseStartTag don't pop them
@@ -4002,7 +4130,7 @@
          xmlStrEqual(name, BAD_CAST "body") ||
 	 xmlStrEqual(name, BAD_CAST "head"))) {
 	ctxt->depth--;
-	return (0);
+	return;
     }
 
     /*
@@ -4016,7 +4144,7 @@
     if (i < 0) {
         htmlParseErr(ctxt, XML_ERR_TAG_NAME_MISMATCH,
 	             "Unexpected end tag : %s\n", name, NULL);
-        return (0);
+        return;
     }
 
 
@@ -4042,93 +4170,10 @@
      */
     oldname = ctxt->name;
     if ((oldname != NULL) && (xmlStrEqual(oldname, name))) {
+	htmlParserFinishElementParsing(ctxt);
         if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
             ctxt->sax->endElement(ctxt->userData, name);
-	htmlNodeInfoPop(ctxt);
         htmlnamePop(ctxt);
-        ret = 1;
-    } else {
-        ret = 0;
-    }
-
-    return (ret);
-}
-
-
-/**
- * htmlParseReference:
- * @ctxt:  an HTML parser context
- *
- * parse and handle entity references in content,
- * this will end-up in a call to character() since this is either a
- * CharRef, or a predefined entity.
- */
-static void
-htmlParseReference(htmlParserCtxtPtr ctxt) {
-    const htmlEntityDesc * ent;
-    xmlChar out[6];
-    const xmlChar *name;
-    if (CUR != '&') return;
-
-    if (NXT(1) == '#') {
-	unsigned int c;
-	int bits, i = 0;
-
-	c = htmlParseCharRef(ctxt);
-	if (c == 0)
-	    return;
-
-        if      (c <    0x80) { out[i++]= c;                bits= -6; }
-        else if (c <   0x800) { out[i++]=((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-        else if (c < 0x10000) { out[i++]=((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-        else                  { out[i++]=((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-        for ( ; bits >= 0; bits-= 6) {
-            out[i++]= ((c >> bits) & 0x3F) | 0x80;
-        }
-	out[i] = 0;
-
-	htmlCheckParagraph(ctxt);
-	if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
-	    ctxt->sax->characters(ctxt->userData, out, i);
-    } else {
-	ent = htmlParseEntityRef(ctxt, &name);
-	if (name == NULL) {
-	    htmlCheckParagraph(ctxt);
-	    if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
-	        ctxt->sax->characters(ctxt->userData, BAD_CAST "&", 1);
-	    return;
-	}
-	if ((ent == NULL) || !(ent->value > 0)) {
-	    htmlCheckParagraph(ctxt);
-	    if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL)) {
-		ctxt->sax->characters(ctxt->userData, BAD_CAST "&", 1);
-		ctxt->sax->characters(ctxt->userData, name, xmlStrlen(name));
-		/* ctxt->sax->characters(ctxt->userData, BAD_CAST ";", 1); */
-	    }
-	} else {
-	    unsigned int c;
-	    int bits, i = 0;
-
-	    c = ent->value;
-	    if      (c <    0x80)
-	            { out[i++]= c;                bits= -6; }
-	    else if (c <   0x800)
-	            { out[i++]=((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-	    else if (c < 0x10000)
-	            { out[i++]=((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-	    else
-	            { out[i++]=((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-	    for ( ; bits >= 0; bits-= 6) {
-		out[i++]= ((c >> bits) & 0x3F) | 0x80;
-	    }
-	    out[i] = 0;
-
-	    htmlCheckParagraph(ctxt);
-	    if ((ctxt->sax != NULL) && (ctxt->sax->characters != NULL))
-		ctxt->sax->characters(ctxt->userData, out, i);
-	}
     }
 }
 
@@ -4137,148 +4182,137 @@
  * @ctxt:  an HTML parser context
  *
  * Parse a content: comment, sub-element, reference or text.
- * Kept for compatibility with old code
+ * New version for non recursive htmlParseElementInternal
  */
 
 static void
 htmlParseContent(htmlParserCtxtPtr ctxt) {
-    xmlChar *currentNode;
-    int depth;
-    const xmlChar *name;
+    GROW;
 
-    currentNode = xmlStrdup(ctxt->name);
-    depth = ctxt->nameNr;
-    while (!PARSER_STOPPED(ctxt)) {
-        GROW;
+    while ((PARSER_STOPPED(ctxt) == 0) &&
+           (ctxt->input->cur < ctxt->input->end)) {
+        int mode;
 
-	/*
-	 * Our tag or one of it's parent or children is ending.
-	 */
-        if ((CUR == '<') && (NXT(1) == '/')) {
-	    if (htmlParseEndTag(ctxt) &&
-		((currentNode != NULL) || (ctxt->nameNr == 0))) {
-		if (currentNode != NULL)
-		    xmlFree(currentNode);
-		return;
-	    }
-	    continue; /* while */
-        }
+        mode = ctxt->endCheckState;
 
-	else if ((CUR == '<') &&
-	         ((IS_ASCII_LETTER(NXT(1))) ||
-		  (NXT(1) == '_') || (NXT(1) == ':'))) {
-	    name = htmlParseHTMLName_nonInvasive(ctxt);
-	    if (name == NULL) {
-	        htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
-			 "htmlParseStartTag: invalid element name\n",
-			 NULL, NULL);
-	        /* Dump the bogus tag like browsers do */
-                while ((CUR != 0) && (CUR != '>'))
-	            NEXT;
-
-	        if (currentNode != NULL)
-	            xmlFree(currentNode);
-	        return;
-	    }
-
-	    if (ctxt->name != NULL) {
-	        if (htmlCheckAutoClose(name, ctxt->name) == 1) {
-	            htmlAutoClose(ctxt, name);
-	            continue;
-	        }
-	    }
-	}
-
-	/*
-	 * Has this node been popped out during parsing of
-	 * the next element
-	 */
-        if ((ctxt->nameNr > 0) && (depth >= ctxt->nameNr) &&
-	    (!xmlStrEqual(currentNode, ctxt->name)))
-	     {
-	    if (currentNode != NULL) xmlFree(currentNode);
-	    return;
-	}
-
-	if ((CUR != 0) && ((xmlStrEqual(currentNode, BAD_CAST"script")) ||
-	    (xmlStrEqual(currentNode, BAD_CAST"style")))) {
-	    /*
-	     * Handle SCRIPT/STYLE separately
-	     */
-	    htmlParseScript(ctxt);
-	}
-
-        else if ((CUR == '<') && (NXT(1) == '!')) {
-            /*
-             * Sometimes DOCTYPE arrives in the middle of the document
-             */
-            if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
-                (UPP(4) == 'C') && (UPP(5) == 'T') &&
-                (UPP(6) == 'Y') && (UPP(7) == 'P') &&
-                (UPP(8) == 'E')) {
-                htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
-                             "Misplaced DOCTYPE declaration\n",
-                             BAD_CAST "DOCTYPE" , NULL);
-                htmlParseDocTypeDecl(ctxt);
+        if ((mode == 0) && (CUR == '<')) {
+            if (NXT(1) == '/') {
+	        htmlParseEndTag(ctxt);
+            } else if (NXT(1) == '!') {
+                /*
+                 * Sometimes DOCTYPE arrives in the middle of the document
+                 */
+                if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
+                    (UPP(4) == 'C') && (UPP(5) == 'T') &&
+                    (UPP(6) == 'Y') && (UPP(7) == 'P') &&
+                    (UPP(8) == 'E')) {
+                    htmlParseDocTypeDecl(ctxt);
+                } else if ((NXT(2) == '-') && (NXT(3) == '-')) {
+                    SKIP(4);
+                    htmlParseComment(ctxt, /* bogus */ 0);
+                } else {
+                    SKIP(2);
+                    htmlParseComment(ctxt, /* bogus */ 1);
+                }
+            } else if (NXT(1) == '?') {
+                SKIP(1);
+                htmlParseComment(ctxt, /* bogus */ 1);
+            } else if (IS_ASCII_LETTER(NXT(1))) {
+                htmlParseElementInternal(ctxt);
+            } else {
+                htmlStartCharData(ctxt);
+                if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
+                    (ctxt->sax->characters != NULL))
+                    ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1);
+                SKIP(1);
             }
-            /*
-             * First case :  a comment
-             */
-            else if ((NXT(2) == '-') && (NXT(3) == '-')) {
-                htmlParseComment(ctxt);
-            }
-            else {
-                htmlSkipBogusComment(ctxt);
-            }
-        }
-
-        /*
-         * Second case : a Processing Instruction.
-         */
-        else if ((CUR == '<') && (NXT(1) == '?')) {
-            htmlParsePI(ctxt);
-        }
-
-        /*
-         * Third case :  a sub-element.
-         */
-        else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) {
-            htmlParseElement(ctxt);
-        }
-        else if (CUR == '<') {
-            if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
-                (ctxt->sax->characters != NULL))
-                ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1);
-            NEXT;
-        }
-
-        /*
-         * Fourth case : a reference. If if has not been resolved,
-         *    parsing returns it's Name, create the node
-         */
-        else if (CUR == '&') {
-            htmlParseReference(ctxt);
-        }
-
-        /*
-         * Fifth case : end of the resource
-         */
-        else if (CUR == 0) {
-            htmlAutoCloseOnEnd(ctxt);
-            break;
-        }
-
-        /*
-         * Last case, text. Note that References are handled directly.
-         */
-        else {
-            htmlParseCharData(ctxt);
+        } else {
+            htmlParseCharData(ctxt, /* partial */ 0);
         }
 
         SHRINK;
         GROW;
     }
-    if (currentNode != NULL) xmlFree(currentNode);
+
+    if (ctxt->input->cur >= ctxt->input->end)
+        htmlAutoCloseOnEnd(ctxt);
+}
+
+/**
+ * htmlParseElementInternal:
+ * @ctxt:  an HTML parser context
+ *
+ * parse an HTML element, new version, non recursive
+ *
+ * [39] element ::= EmptyElemTag | STag content ETag
+ *
+ * [41] Attribute ::= Name Eq AttValue
+ */
+
+static int
+htmlParseElementInternal(htmlParserCtxtPtr ctxt) {
+    const xmlChar *name;
+    const htmlElemDesc * info;
+    htmlParserNodeInfo node_info = { NULL, 0, 0, 0, 0 };
+
+    if ((ctxt == NULL) || (ctxt->input == NULL))
+	return(0);
+
+    /* Capture start position */
+    if (ctxt->record_info) {
+        node_info.begin_pos = ctxt->input->consumed +
+                          (CUR_PTR - ctxt->input->base);
+	node_info.begin_line = ctxt->input->line;
+    }
+
+    htmlParseStartTag(ctxt);
+    name = ctxt->name;
+    if (name == NULL)
+        return(0);
+
+    if (ctxt->record_info)
+        htmlNodeInfoPush(ctxt, &node_info);
+
+    /*
+     * Check for an Empty Element labeled the XML/SGML way
+     */
+    if ((CUR == '/') && (NXT(1) == '>')) {
+        SKIP(2);
+        htmlParserFinishElementParsing(ctxt);
+        if ((ctxt->options & HTML_PARSE_HTML5) == 0) {
+            if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
+                ctxt->sax->endElement(ctxt->userData, name);
+        }
+	htmlnamePop(ctxt);
+	return(0);
+    }
+
+    if (CUR != '>')
+        return(0);
+    SKIP(1);
+
+    /*
+     * Lookup the info for that element.
+     */
+    info = htmlTagLookup(name);
+
+    /*
+     * Check for an Empty Element from DTD definition
+     */
+    if ((info != NULL) && (info->empty)) {
+        htmlParserFinishElementParsing(ctxt);
+        if ((ctxt->options & HTML_PARSE_HTML5) == 0) {
+            if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
+                ctxt->sax->endElement(ctxt->userData, name);
+        }
+	htmlnamePop(ctxt);
+	return(0);
+    }
+
+    if (info != NULL)
+        ctxt->endCheckState = info->dataMode;
+
+    return(1);
 }
 
 /**
@@ -4297,93 +4331,18 @@
 
 void
 htmlParseElement(htmlParserCtxtPtr ctxt) {
-    const xmlChar *name;
-    xmlChar *currentNode = NULL;
-    const htmlElemDesc * info;
-    htmlParserNodeInfo node_info;
-    int failed;
-    int depth;
     const xmlChar *oldptr;
+    int depth;
 
     if ((ctxt == NULL) || (ctxt->input == NULL))
 	return;
 
-    /* Capture start position */
-    if (ctxt->record_info) {
-        node_info.begin_pos = ctxt->input->consumed +
-                          (CUR_PTR - ctxt->input->base);
-	node_info.begin_line = ctxt->input->line;
-    }
-
-    failed = htmlParseStartTag(ctxt);
-    name = ctxt->name;
-    if ((failed == -1) || (name == NULL)) {
-	if (CUR == '>')
-	    NEXT;
+    if (htmlParseElementInternal(ctxt) == 0)
         return;
-    }
-
-    /*
-     * Lookup the info for that element.
-     */
-    info = htmlTagLookup(name);
-    if (info == NULL) {
-	htmlParseErr(ctxt, XML_HTML_UNKNOWN_TAG,
-	             "Tag %s invalid\n", name, NULL);
-    }
-
-    /*
-     * Check for an Empty Element labeled the XML/SGML way
-     */
-    if ((CUR == '/') && (NXT(1) == '>')) {
-        SKIP(2);
-	if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
-	    ctxt->sax->endElement(ctxt->userData, name);
-	htmlnamePop(ctxt);
-	return;
-    }
-
-    if (CUR == '>') {
-        NEXT;
-    } else {
-	htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
-	             "Couldn't find end of Start Tag %s\n", name, NULL);
-
-	/*
-	 * end of parsing of this node.
-	 */
-	if (xmlStrEqual(name, ctxt->name)) {
-	    nodePop(ctxt);
-	    htmlnamePop(ctxt);
-	}
-
-	/*
-	 * Capture end position and add node
-	 */
-	if (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 = ctxt->node;
-	   xmlParserAddNodeInfo(ctxt, &node_info);
-	}
-	return;
-    }
-
-    /*
-     * Check for an Empty Element from DTD definition
-     */
-    if ((info != NULL) && (info->empty)) {
-	if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
-	    ctxt->sax->endElement(ctxt->userData, name);
-	htmlnamePop(ctxt);
-	return;
-    }
 
     /*
      * Parse the content of the element:
      */
-    currentNode = xmlStrdup(ctxt->name);
     depth = ctxt->nameNr;
     while (CUR != 0) {
 	oldptr = ctxt->input->cur;
@@ -4392,347 +4351,66 @@
 	if (ctxt->nameNr < depth) break;
     }
 
-    /*
-     * Capture end position and add node
-     */
-    if ( currentNode != 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 = ctxt->node;
-       xmlParserAddNodeInfo(ctxt, &node_info);
-    }
     if (CUR == 0) {
 	htmlAutoCloseOnEnd(ctxt);
     }
-
-    if (currentNode != NULL)
-	xmlFree(currentNode);
-}
-
-static void
-htmlParserFinishElementParsing(htmlParserCtxtPtr ctxt) {
-    /*
-     * Capture end position and add node
-     */
-    if ( ctxt->node != NULL && ctxt->record_info ) {
-       ctxt->nodeInfo->end_pos = ctxt->input->consumed +
-                                (CUR_PTR - ctxt->input->base);
-       ctxt->nodeInfo->end_line = ctxt->input->line;
-       ctxt->nodeInfo->node = ctxt->node;
-       xmlParserAddNodeInfo(ctxt, ctxt->nodeInfo);
-       htmlNodeInfoPop(ctxt);
-    }
-    if (CUR == 0) {
-       htmlAutoCloseOnEnd(ctxt);
-    }
 }
 
 /**
- * htmlParseElementInternal:
- * @ctxt:  an HTML parser context
+ * htmlCtxtParseContentInternal:
+ * @ctxt:  parser context
+ * @input:  parser input
  *
- * parse an HTML element, new version, non recursive
- *
- * [39] element ::= EmptyElemTag | STag content ETag
- *
- * [41] Attribute ::= Name Eq AttValue
+ * Returns a node list.
  */
+xmlNodePtr
+htmlCtxtParseContentInternal(htmlParserCtxtPtr ctxt, xmlParserInputPtr input) {
+    xmlNodePtr root;
+    xmlNodePtr list = NULL;
+    xmlChar *rootName = BAD_CAST "#root";
 
-static void
-htmlParseElementInternal(htmlParserCtxtPtr ctxt) {
-    const xmlChar *name;
-    const htmlElemDesc * info;
-    htmlParserNodeInfo node_info = { NULL, 0, 0, 0, 0 };
-    int failed;
-
-    if ((ctxt == NULL) || (ctxt->input == NULL))
-	return;
-
-    /* Capture start position */
-    if (ctxt->record_info) {
-        node_info.begin_pos = ctxt->input->consumed +
-                          (CUR_PTR - ctxt->input->base);
-	node_info.begin_line = ctxt->input->line;
+    root = xmlNewDocNode(ctxt->myDoc, NULL, rootName, NULL);
+    if (root == NULL) {
+        htmlErrMemory(ctxt);
+        return(NULL);
     }
 
-    failed = htmlParseStartTag(ctxt);
-    name = ctxt->name;
-    if ((failed == -1) || (name == NULL)) {
-	if (CUR == '>')
-	    NEXT;
-        return;
+    if (xmlCtxtPushInput(ctxt, input) < 0) {
+        xmlFreeNode(root);
+        return(NULL);
     }
 
+    htmlnamePush(ctxt, rootName);
+    nodePush(ctxt, root);
+
+    htmlParseContent(ctxt);
+
     /*
-     * Lookup the info for that element.
+     * Only check for truncated multi-byte sequences
      */
-    info = htmlTagLookup(name);
-    if (info == NULL) {
-	htmlParseErr(ctxt, XML_HTML_UNKNOWN_TAG,
-	             "Tag %s invalid\n", name, NULL);
-    }
+    xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR);
 
-    /*
-     * Check for an Empty Element labeled the XML/SGML way
-     */
-    if ((CUR == '/') && (NXT(1) == '>')) {
-        SKIP(2);
-	if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
-	    ctxt->sax->endElement(ctxt->userData, name);
-	htmlnamePop(ctxt);
-	return;
-    }
-
-    if (CUR == '>') {
-        NEXT;
-    } else {
-	htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
-	             "Couldn't find end of Start Tag %s\n", name, NULL);
-
-	/*
-	 * end of parsing of this node.
-	 */
-	if (xmlStrEqual(name, ctxt->name)) {
-	    nodePop(ctxt);
-	    htmlnamePop(ctxt);
-	}
-
-        if (ctxt->record_info)
-            htmlNodeInfoPush(ctxt, &node_info);
-        htmlParserFinishElementParsing(ctxt);
-	return;
-    }
-
-    /*
-     * Check for an Empty Element from DTD definition
-     */
-    if ((info != NULL) && (info->empty)) {
-	if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
-	    ctxt->sax->endElement(ctxt->userData, name);
-	htmlnamePop(ctxt);
-	return;
-    }
-
-    if (ctxt->record_info)
-        htmlNodeInfoPush(ctxt, &node_info);
-}
-
-/**
- * htmlParseContentInternal:
- * @ctxt:  an HTML parser context
- *
- * Parse a content: comment, sub-element, reference or text.
- * New version for non recursive htmlParseElementInternal
- */
-
-static void
-htmlParseContentInternal(htmlParserCtxtPtr ctxt) {
-    xmlChar *currentNode;
-    int depth;
-    const xmlChar *name;
-
-    depth = ctxt->nameNr;
-    if (depth <= 0) {
-        currentNode = NULL;
-    } else {
-        currentNode = xmlStrdup(ctxt->name);
-        if (currentNode == NULL) {
-            htmlErrMemory(ctxt);
-            return;
-        }
-    }
-    while (PARSER_STOPPED(ctxt) == 0) {
-        GROW;
-
-	/*
-	 * Our tag or one of it's parent or children is ending.
-	 */
-        if ((CUR == '<') && (NXT(1) == '/')) {
-	    if (htmlParseEndTag(ctxt) &&
-		((currentNode != NULL) || (ctxt->nameNr == 0))) {
-		if (currentNode != NULL)
-		    xmlFree(currentNode);
-
-	        depth = ctxt->nameNr;
-                if (depth <= 0) {
-                    currentNode = NULL;
-                } else {
-                    currentNode = xmlStrdup(ctxt->name);
-                    if (currentNode == NULL) {
-                        htmlErrMemory(ctxt);
-                        break;
-                    }
-                }
-	    }
-	    continue; /* while */
-        }
-
-	else if ((CUR == '<') &&
-	         ((IS_ASCII_LETTER(NXT(1))) ||
-		  (NXT(1) == '_') || (NXT(1) == ':'))) {
-	    name = htmlParseHTMLName_nonInvasive(ctxt);
-	    if (name == NULL) {
-	        htmlParseErr(ctxt, XML_ERR_NAME_REQUIRED,
-			 "htmlParseStartTag: invalid element name\n",
-			 NULL, NULL);
-	        /* Dump the bogus tag like browsers do */
-	        while ((CUR == 0) && (CUR != '>'))
-	            NEXT;
-
-	        htmlParserFinishElementParsing(ctxt);
-	        if (currentNode != NULL)
-	            xmlFree(currentNode);
-
-                if (ctxt->name == NULL) {
-                    currentNode = NULL;
-                } else {
-                    currentNode = xmlStrdup(ctxt->name);
-                    if (currentNode == NULL) {
-                        htmlErrMemory(ctxt);
-                        break;
-                    }
-                }
-	        depth = ctxt->nameNr;
-	        continue;
-	    }
-
-	    if (ctxt->name != NULL) {
-	        if (htmlCheckAutoClose(name, ctxt->name) == 1) {
-	            htmlAutoClose(ctxt, name);
-	            continue;
-	        }
-	    }
-	}
-
-	/*
-	 * Has this node been popped out during parsing of
-	 * the next element
-	 */
-        if ((ctxt->nameNr > 0) && (depth >= ctxt->nameNr) &&
-	    (!xmlStrEqual(currentNode, ctxt->name)))
-	     {
-	    htmlParserFinishElementParsing(ctxt);
-	    if (currentNode != NULL) xmlFree(currentNode);
-
-            if (ctxt->name == NULL) {
-                currentNode = NULL;
-            } else {
-                currentNode = xmlStrdup(ctxt->name);
-                if (currentNode == NULL) {
-                    htmlErrMemory(ctxt);
-                    break;
-                }
-            }
-	    depth = ctxt->nameNr;
-	    continue;
-	}
-
-	if ((CUR != 0) && ((xmlStrEqual(currentNode, BAD_CAST"script")) ||
-	    (xmlStrEqual(currentNode, BAD_CAST"style")))) {
-	    /*
-	     * Handle SCRIPT/STYLE separately
-	     */
-	    htmlParseScript(ctxt);
-	}
-
-        else if ((CUR == '<') && (NXT(1) == '!')) {
-            /*
-             * Sometimes DOCTYPE arrives in the middle of the document
-             */
-            if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
-                (UPP(4) == 'C') && (UPP(5) == 'T') &&
-                (UPP(6) == 'Y') && (UPP(7) == 'P') &&
-                (UPP(8) == 'E')) {
-                htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
-                             "Misplaced DOCTYPE declaration\n",
-                             BAD_CAST "DOCTYPE" , NULL);
-                htmlParseDocTypeDecl(ctxt);
-            }
-            /*
-             * First case :  a comment
-             */
-            else if ((NXT(2) == '-') && (NXT(3) == '-')) {
-                htmlParseComment(ctxt);
-            }
-            else {
-                htmlSkipBogusComment(ctxt);
-            }
-        }
+    /* TODO: Use xmlCtxtIsCatastrophicError */
+    if (ctxt->errNo != XML_ERR_NO_MEMORY) {
+        xmlNodePtr cur;
 
         /*
-         * Second case : a Processing Instruction.
+         * Unlink newly created node list.
          */
-        else if ((CUR == '<') && (NXT(1) == '?')) {
-            htmlParsePI(ctxt);
-        }
-
-        /*
-         * Third case :  a sub-element.
-         */
-        else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) {
-            htmlParseElementInternal(ctxt);
-            if (currentNode != NULL) xmlFree(currentNode);
-
-            if (ctxt->name == NULL) {
-                currentNode = NULL;
-            } else {
-                currentNode = xmlStrdup(ctxt->name);
-                if (currentNode == NULL) {
-                    htmlErrMemory(ctxt);
-                    break;
-                }
-            }
-            depth = ctxt->nameNr;
-        }
-        else if (CUR == '<') {
-            if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
-                (ctxt->sax->characters != NULL))
-                ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1);
-            NEXT;
-        }
-
-        /*
-         * Fourth case : a reference. If if has not been resolved,
-         *    parsing returns it's Name, create the node
-         */
-        else if (CUR == '&') {
-            htmlParseReference(ctxt);
-        }
-
-        /*
-         * Fifth case : end of the resource
-         */
-        else if (CUR == 0) {
-            htmlAutoCloseOnEnd(ctxt);
-            break;
-        }
-
-        /*
-         * Last case, text. Note that References are handled directly.
-         */
-        else {
-            htmlParseCharData(ctxt);
-        }
-
-        SHRINK;
-        GROW;
+        list = root->children;
+        root->children = NULL;
+        root->last = NULL;
+        for (cur = list; cur != NULL; cur = cur->next)
+            cur->parent = NULL;
     }
-    if (currentNode != NULL) xmlFree(currentNode);
-}
 
-/**
- * htmlParseContent:
- * @ctxt:  an HTML parser context
- *
- * Parse a content: comment, sub-element, reference or text.
- * This is the entry point when called from parser.c
- */
+    nodePop(ctxt);
+    htmlnamePop(ctxt);
 
-void
-__htmlParseContent(void *ctxt) {
-    if (ctxt != NULL)
-	htmlParseContentInternal((htmlParserCtxtPtr) ctxt);
+    xmlCtxtPopInput(ctxt);
+
+    xmlFreeNode(root);
+    return(list);
 }
 
 /**
@@ -4761,8 +4439,14 @@
     xmlDetectEncoding(ctxt);
 
     /*
-     * This is wrong but matches long-standing behavior. In most cases,
-     * a document starting with an XML declaration will specify UTF-8.
+     * TODO: Implement HTML5 prescan algorithm
+     */
+
+    /*
+     * This is wrong but matches long-standing behavior. In most
+     * cases, a document starting with an XML declaration will
+     * specify UTF-8. The HTML5 prescan algorithm handles
+     * XML declarations in a better way.
      */
     if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
         (xmlStrncmp(ctxt->input->cur, BAD_CAST "<?xm", 4) == 0))
@@ -4772,10 +4456,6 @@
      * Wipe out everything which is before the first '<'
      */
     SKIP_BLANKS;
-    if (CUR == 0) {
-	htmlParseErr(ctxt, XML_ERR_DOCUMENT_EMPTY,
-	             "Document is empty\n", NULL, NULL);
-    }
 
     if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX))
 	ctxt->sax->startDocument(ctxt->userData);
@@ -4783,15 +4463,19 @@
     /*
      * Parse possible comments and PIs before any content
      */
-    while (((CUR == '<') && (NXT(1) == '!') &&
-            (NXT(2) == '-') && (NXT(3) == '-')) ||
-	   ((CUR == '<') && (NXT(1) == '?'))) {
-        htmlParseComment(ctxt);
-        htmlParsePI(ctxt);
+    while (CUR == '<') {
+        if ((NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) {
+            SKIP(4);
+            htmlParseComment(ctxt, /* bogus */ 0);
+        } else if (NXT(1) == '?') {
+            SKIP(1);
+            htmlParseComment(ctxt, /* bogus */ 1);
+        } else {
+            break;
+        }
 	SKIP_BLANKS;
     }
 
-
     /*
      * Then possibly doc type declaration(s) and more Misc
      * (doctypedecl Misc*)?
@@ -4801,6 +4485,7 @@
 	(UPP(4) == 'C') && (UPP(5) == 'T') &&
 	(UPP(6) == 'Y') && (UPP(7) == 'P') &&
 	(UPP(8) == 'E')) {
+        ctxt->instate = XML_PARSER_MISC;
 	htmlParseDocTypeDecl(ctxt);
     }
     SKIP_BLANKS;
@@ -4808,26 +4493,30 @@
     /*
      * Parse possible comments and PIs before any content
      */
-    while ((PARSER_STOPPED(ctxt) == 0) &&
-           (((CUR == '<') && (NXT(1) == '!') &&
-             (NXT(2) == '-') && (NXT(3) == '-')) ||
-	    ((CUR == '<') && (NXT(1) == '?')))) {
-        htmlParseComment(ctxt);
-        htmlParsePI(ctxt);
+    ctxt->instate = XML_PARSER_PROLOG;
+    while (CUR == '<') {
+        if ((NXT(1) == '!') && (NXT(2) == '-') && (NXT(3) == '-')) {
+            SKIP(4);
+            htmlParseComment(ctxt, /* bogus */ 0);
+        } else if (NXT(1) == '?') {
+            SKIP(1);
+            htmlParseComment(ctxt, /* bogus */ 1);
+        } else {
+            break;
+        }
 	SKIP_BLANKS;
     }
 
     /*
      * Time to start parsing the tree itself
      */
-    htmlParseContentInternal(ctxt);
+    ctxt->instate = XML_PARSER_CONTENT;
+    htmlParseContent(ctxt);
 
     /*
-     * autoclose
+     * Only check for truncated multi-byte sequences
      */
-    if (CUR == 0)
-	htmlAutoCloseOnEnd(ctxt);
-
+    xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR);
 
     /*
      * SAX: end of the document processing.
@@ -4872,6 +4561,12 @@
 htmlInitParserCtxt(htmlParserCtxtPtr ctxt, const htmlSAXHandler *sax,
                    void *userData)
 {
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+    size_t initialNodeTabSize = 1;
+#else
+    size_t initialNodeTabSize = 10;
+#endif
+
     if (ctxt == NULL) return(-1);
     memset(ctxt, 0, sizeof(htmlParserCtxt));
 
@@ -4894,11 +4589,11 @@
 
     /* Allocate the Input stack */
     ctxt->inputTab = (htmlParserInputPtr *)
-                      xmlMalloc(5 * sizeof(htmlParserInputPtr));
+                      xmlMalloc(sizeof(htmlParserInputPtr));
     if (ctxt->inputTab == NULL)
 	return(-1);
     ctxt->inputNr = 0;
-    ctxt->inputMax = 5;
+    ctxt->inputMax = 1;
     ctxt->input = NULL;
     ctxt->version = NULL;
     ctxt->encoding = NULL;
@@ -4906,19 +4601,19 @@
     ctxt->instate = XML_PARSER_START;
 
     /* Allocate the Node stack */
-    ctxt->nodeTab = (htmlNodePtr *) xmlMalloc(10 * sizeof(htmlNodePtr));
+    ctxt->nodeTab = xmlMalloc(initialNodeTabSize * sizeof(htmlNodePtr));
     if (ctxt->nodeTab == NULL)
 	return(-1);
     ctxt->nodeNr = 0;
-    ctxt->nodeMax = 10;
+    ctxt->nodeMax = initialNodeTabSize;
     ctxt->node = NULL;
 
     /* Allocate the Name stack */
-    ctxt->nameTab = (const xmlChar **) xmlMalloc(10 * sizeof(xmlChar *));
+    ctxt->nameTab = xmlMalloc(initialNodeTabSize * sizeof(xmlChar *));
     if (ctxt->nameTab == NULL)
 	return(-1);
     ctxt->nameNr = 0;
-    ctxt->nameMax = 10;
+    ctxt->nameMax = initialNodeTabSize;
     ctxt->name = NULL;
 
     ctxt->nodeInfoTab = NULL;
@@ -4930,7 +4625,7 @@
     ctxt->replaceEntities = 0;
     ctxt->linenumbers = xmlLineNumbersDefaultValue;
     ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
-    ctxt->html = 1;
+    ctxt->html = INSERT_INITIAL;
     ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT;
     ctxt->vctxt.userData = ctxt;
     ctxt->vctxt.error = xmlParserValidityError;
@@ -4969,9 +4664,6 @@
  *
  * See xmlCtxtSetErrorHandler for advanced error handling.
  *
- * See xmlNewInputURL, xmlNewInputMemory, xmlNewInputIO and similar
- * functions for advanced input control.
- *
  * See htmlNewSAXParserCtxt for custom SAX parsers.
  *
  * Returns the htmlParserCtxtPtr or NULL in case of allocation error
@@ -5032,13 +4724,17 @@
     if (ctxt == NULL)
 	return(NULL);
 
-    input = xmlNewInputMemory(ctxt, url, buffer, size, encoding, 0);
+    input = xmlCtxtNewInputFromMemory(ctxt, url, buffer, size, encoding, 0);
     if (input == NULL) {
 	xmlFreeParserCtxt(ctxt);
         return(NULL);
     }
 
-    inputPush(ctxt, input);
+    if (xmlCtxtPushInput(ctxt, input) < 0) {
+        xmlFreeInputStream(input);
+        xmlFreeParserCtxt(ctxt);
+        return(NULL);
+    }
 
     return(ctxt);
 }
@@ -5085,13 +4781,18 @@
     if (ctxt == NULL)
 	return(NULL);
 
-    input = xmlNewInputString(ctxt, url, (const char *) str, encoding, 0);
+    input = xmlCtxtNewInputFromString(ctxt, url, (const char *) str,
+                                      encoding, 0);
     if (input == NULL) {
 	xmlFreeParserCtxt(ctxt);
 	return(NULL);
     }
 
-    inputPush(ctxt, input);
+    if (xmlCtxtPushInput(ctxt, input) < 0) {
+        xmlFreeInputStream(input);
+        xmlFreeParserCtxt(ctxt);
+        return(NULL);
+    }
 
     return(ctxt);
 }
@@ -5103,81 +4804,167 @@
  *									*
  ************************************************************************/
 
+typedef enum {
+    LSTATE_TAG_NAME = 0,
+    LSTATE_BEFORE_ATTR_NAME,
+    LSTATE_ATTR_NAME,
+    LSTATE_AFTER_ATTR_NAME,
+    LSTATE_BEFORE_ATTR_VALUE,
+    LSTATE_ATTR_VALUE_DQUOTED,
+    LSTATE_ATTR_VALUE_SQUOTED,
+    LSTATE_ATTR_VALUE_UNQUOTED
+} xmlLookupStates;
+
 /**
- * htmlParseLookupSequence:
+ * htmlParseLookupGt:
  * @ctxt:  an HTML parser context
- * @first:  the first char to lookup
- * @next:  the next char to lookup or zero
- * @third:  the next char to lookup or zero
- * @ignoreattrval: skip over attribute values
  *
- * Try to find if a sequence (first, next, third) or  just (first next) or
- * (first) is available in the input stream.
- * This function has a side effect of (possibly) incrementing ctxt->checkIndex
- * to avoid rescanning sequences of bytes, it DOES change the state of the
- * parser, do not use liberally.
- * This is basically similar to xmlParseLookupSequence()
- *
- * Returns the index to the current parsing point if the full sequence
- *      is available, -1 otherwise.
+ * Check whether there's enough data in the input buffer to finish parsing
+ * a tag. This has to take quotes into account.
  */
 static int
-htmlParseLookupSequence(htmlParserCtxtPtr ctxt, xmlChar first,
-                        xmlChar next, xmlChar third, int ignoreattrval)
-{
-    size_t base, len;
-    htmlParserInputPtr in;
-    const xmlChar *buf;
-    int quote;
+htmlParseLookupGt(xmlParserCtxtPtr ctxt) {
+    const xmlChar *cur;
+    const xmlChar *end = ctxt->input->end;
+    int state = ctxt->endCheckState;
+    size_t index;
 
-    in = ctxt->input;
-    if (in == NULL)
-        return (-1);
+    if (ctxt->checkIndex == 0)
+        cur = ctxt->input->cur + 2; /* Skip '<a' or '</' */
+    else
+        cur = ctxt->input->cur + ctxt->checkIndex;
 
-    base = ctxt->checkIndex;
-    quote = ctxt->endCheckState;
+    while (cur < end) {
+        int c = *cur++;
 
-    buf = in->cur;
-    len = in->end - in->cur;
-
-    /* take into account the sequence length */
-    if (third)
-        len -= 2;
-    else if (next)
-        len--;
-    for (; base < len; base++) {
-        if (base >= INT_MAX / 2) {
-            ctxt->checkIndex = 0;
-            ctxt->endCheckState = 0;
-            return (base - 2);
-        }
-        if (ignoreattrval) {
-            if (quote) {
-                if (buf[base] == quote)
-                    quote = 0;
+        if (state != LSTATE_ATTR_VALUE_SQUOTED &&
+            state != LSTATE_ATTR_VALUE_DQUOTED) {
+            if (c == '/' &&
+                state != LSTATE_BEFORE_ATTR_VALUE &&
+                state != LSTATE_ATTR_VALUE_UNQUOTED) {
+                state = LSTATE_BEFORE_ATTR_NAME;
                 continue;
-            }
-            if (buf[base] == '"' || buf[base] == '\'') {
-                quote = buf[base];
-                continue;
+            } else if (c == '>') {
+                ctxt->checkIndex = 0;
+                ctxt->endCheckState = 0;
+                return(0);
             }
         }
-        if (buf[base] == first) {
-            if (third != 0) {
-                if ((buf[base + 1] != next) || (buf[base + 2] != third))
-                    continue;
-            } else if (next != 0) {
-                if (buf[base + 1] != next)
-                    continue;
-            }
-            ctxt->checkIndex = 0;
-            ctxt->endCheckState = 0;
-            return (base);
+
+        switch (state) {
+            case LSTATE_TAG_NAME:
+                if (IS_WS_HTML(c))
+                    state = LSTATE_BEFORE_ATTR_NAME;
+                break;
+
+            case LSTATE_BEFORE_ATTR_NAME:
+                if (!IS_WS_HTML(c))
+                    state = LSTATE_ATTR_NAME;
+                break;
+
+            case LSTATE_ATTR_NAME:
+                if (c == '=')
+                    state = LSTATE_BEFORE_ATTR_VALUE;
+                else if (IS_WS_HTML(c))
+                    state = LSTATE_AFTER_ATTR_NAME;
+                break;
+
+            case LSTATE_AFTER_ATTR_NAME:
+                if (c == '=')
+                    state = LSTATE_BEFORE_ATTR_VALUE;
+                else if (!IS_WS_HTML(c))
+                    state = LSTATE_ATTR_NAME;
+                break;
+
+            case LSTATE_BEFORE_ATTR_VALUE:
+                if (c == '"')
+                    state = LSTATE_ATTR_VALUE_DQUOTED;
+                else if (c == '\'')
+                    state = LSTATE_ATTR_VALUE_SQUOTED;
+                else if (!IS_WS_HTML(c))
+                    state = LSTATE_ATTR_VALUE_UNQUOTED;
+                break;
+
+            case LSTATE_ATTR_VALUE_DQUOTED:
+                if (c == '"')
+                    state = LSTATE_BEFORE_ATTR_NAME;
+                break;
+
+            case LSTATE_ATTR_VALUE_SQUOTED:
+                if (c == '\'')
+                    state = LSTATE_BEFORE_ATTR_NAME;
+                break;
+
+            case LSTATE_ATTR_VALUE_UNQUOTED:
+                if (IS_WS_HTML(c))
+                    state = LSTATE_BEFORE_ATTR_NAME;
+                break;
         }
     }
-    ctxt->checkIndex = base;
-    ctxt->endCheckState = quote;
-    return (-1);
+
+    index = cur - ctxt->input->cur;
+    if (index > LONG_MAX) {
+        ctxt->checkIndex = 0;
+        ctxt->endCheckState = 0;
+        return(0);
+    }
+    ctxt->checkIndex = index;
+    ctxt->endCheckState = state;
+    return(-1);
+}
+
+/**
+ * htmlParseLookupString:
+ * @ctxt:  an XML parser context
+ * @startDelta: delta to apply at the start
+ * @str:  string
+ * @strLen:  length of string
+ *
+ * Check whether the input buffer contains a string.
+ */
+static int
+htmlParseLookupString(xmlParserCtxtPtr ctxt, size_t startDelta,
+                      const char *str, size_t strLen, size_t extraLen) {
+    const xmlChar *end = ctxt->input->end;
+    const xmlChar *cur, *term;
+    size_t index, rescan;
+    int ret;
+
+    if (ctxt->checkIndex == 0) {
+        cur = ctxt->input->cur + startDelta;
+    } else {
+        cur = ctxt->input->cur + ctxt->checkIndex;
+    }
+
+    term = BAD_CAST strstr((const char *) cur, str);
+    if ((term != NULL) &&
+        ((size_t) (ctxt->input->end - term) >= extraLen + 1)) {
+        ctxt->checkIndex = 0;
+
+        if (term - ctxt->input->cur > INT_MAX / 2)
+            ret = INT_MAX / 2;
+        else
+            ret = term - ctxt->input->cur;
+
+        return(ret);
+    }
+
+    /* Rescan (strLen + extraLen - 1) characters. */
+    rescan = strLen + extraLen - 1;
+    if ((size_t) (end - cur) <= rescan)
+        end = cur;
+    else
+        end -= rescan;
+    index = end - ctxt->input->cur;
+    if (index > INT_MAX / 2) {
+        ctxt->checkIndex = 0;
+        ret = INT_MAX / 2;
+    } else {
+        ctxt->checkIndex = index;
+        ret = -1;
+    }
+
+    return(ret);
 }
 
 /**
@@ -5190,7 +4977,6 @@
  * This function has a side effect of (possibly) incrementing ctxt->checkIndex
  * to avoid rescanning sequences of bytes, it DOES change the state of the
  * parser, do not use liberally.
- * This wraps to htmlParseLookupSequence()
  *
  * Returns the index to the current parsing point if the full sequence is available, -1 otherwise.
  */
@@ -5201,11 +4987,17 @@
     int offset;
 
     while (1) {
-	mark = htmlParseLookupSequence(ctxt, '-', '-', 0, 0);
+	mark = htmlParseLookupString(ctxt, 2, "--", 2, 0);
 	if (mark < 0)
             break;
+        /*
+         * <!-->    is a complete comment, but
+         * <!--!>   is not
+         * <!---!>  is not
+         * <!----!> is
+         */
         if ((NXT(mark+2) == '>') ||
-	    ((NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
+	    ((mark >= 4) && (NXT(mark+2) == '!') && (NXT(mark+3) == '>'))) {
             ctxt->checkIndex = 0;
 	    break;
 	}
@@ -5229,70 +5021,50 @@
  *
  * Returns zero if no parsing was possible
  */
-static int
+static void
 htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) {
-    int ret = 0;
-    htmlParserInputPtr in;
-    ptrdiff_t avail = 0;
-    xmlChar cur, next;
-
-    htmlParserNodeInfo node_info;
-
     while (PARSER_STOPPED(ctxt) == 0) {
+        htmlParserInputPtr in;
+        size_t avail;
 
 	in = ctxt->input;
 	if (in == NULL) break;
 	avail = in->end - in->cur;
-	if ((avail == 0) && (terminate)) {
-	    htmlAutoCloseOnEnd(ctxt);
-	    if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) {
-		/*
-		 * SAX: end of the document processing.
-		 */
-		ctxt->instate = XML_PARSER_EOF;
-		if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
-		    ctxt->sax->endDocument(ctxt->userData);
-	    }
-	}
-        if (avail < 1)
-	    goto done;
-        /*
-         * This is done to make progress and avoid an infinite loop
-         * if a parsing attempt was aborted by hitting a NUL byte. After
-         * changing htmlCurrentChar, this probably isn't necessary anymore.
-         * We should consider removing this check.
-         */
-	cur = in->cur[0];
-	if (cur == 0) {
-	    SKIP(1);
-	    continue;
-	}
 
         switch (ctxt->instate) {
             case XML_PARSER_EOF:
 	        /*
 		 * Document parsing is done !
 		 */
-	        goto done;
+	        return;
+
             case XML_PARSER_START:
                 /*
+                 * Very first chars read from the document flow.
+                 */
+                if ((!terminate) && (avail < 4))
+                    return;
+
+                xmlDetectEncoding(ctxt);
+
+                /*
+                 * TODO: Implement HTML5 prescan algorithm
+                 */
+
+                /*
                  * This is wrong but matches long-standing behavior. In most
                  * cases, a document starting with an XML declaration will
-                 * specify UTF-8.
+                 * specify UTF-8. The HTML5 prescan algorithm handles
+                 * XML declarations in a better way.
                  */
                 if (((ctxt->input->flags & XML_INPUT_HAS_ENCODING) == 0) &&
                     (xmlStrncmp(ctxt->input->cur, BAD_CAST "<?xm", 4) == 0)) {
                     xmlSwitchEncoding(ctxt, XML_CHAR_ENCODING_UTF8);
                 }
 
-	        /*
-		 * Very first chars read from the document flow.
-		 */
-		cur = in->cur[0];
-		if (IS_BLANK_CH(cur)) {
-		    SKIP_BLANKS;
-                    avail = in->end - in->cur;
-		}
+                /* fall through */
+
+            case XML_PARSER_XML_DECL:
                 if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) {
                     ctxt->sax->setDocumentLocator(ctxt->userData,
                             (xmlSAXLocator *) &xmlDefaultSAXLocator);
@@ -5301,397 +5073,140 @@
 	            (!ctxt->disableSAX))
 		    ctxt->sax->startDocument(ctxt->userData);
 
-		cur = in->cur[0];
-		next = in->cur[1];
-		if ((cur == '<') && (next == '!') &&
-		    (UPP(2) == 'D') && (UPP(3) == 'O') &&
-		    (UPP(4) == 'C') && (UPP(5) == 'T') &&
-		    (UPP(6) == 'Y') && (UPP(7) == 'P') &&
-		    (UPP(8) == 'E')) {
-		    if ((!terminate) &&
-		        (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
-			goto done;
-		    htmlParseDocTypeDecl(ctxt);
-		    ctxt->instate = XML_PARSER_PROLOG;
-                } else {
-		    ctxt->instate = XML_PARSER_MISC;
-		}
+                /* Allow callback to modify state for tests */
+                if ((ctxt->instate == XML_PARSER_START) ||
+                    (ctxt->instate == XML_PARSER_XML_DECL))
+                    ctxt->instate = XML_PARSER_MISC;
 		break;
-            case XML_PARSER_MISC:
-		SKIP_BLANKS;
-                avail = in->end - in->cur;
-		/*
-		 * no chars in buffer
-		 */
-		if (avail < 1)
-		    goto done;
-		/*
-		 * not enough chars in buffer
-		 */
-		if (avail < 2) {
-		    if (!terminate)
-			goto done;
-		    else
-			next = ' ';
-		} else {
-		    next = in->cur[1];
-		}
-		cur = in->cur[0];
-	        if ((cur == '<') && (next == '!') &&
-		    (in->cur[2] == '-') && (in->cur[3] == '-')) {
-		    if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
-			goto done;
-		    htmlParseComment(ctxt);
-		    ctxt->instate = XML_PARSER_MISC;
-	        } else if ((cur == '<') && (next == '?')) {
-		    if ((!terminate) &&
-		        (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
-			goto done;
-		    htmlParsePI(ctxt);
-		    ctxt->instate = XML_PARSER_MISC;
-		} else if ((cur == '<') && (next == '!') &&
-		    (UPP(2) == 'D') && (UPP(3) == 'O') &&
-		    (UPP(4) == 'C') && (UPP(5) == 'T') &&
-		    (UPP(6) == 'Y') && (UPP(7) == 'P') &&
-		    (UPP(8) == 'E')) {
-		    if ((!terminate) &&
-		        (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
-			goto done;
-		    htmlParseDocTypeDecl(ctxt);
-		    ctxt->instate = XML_PARSER_PROLOG;
-		} else if ((cur == '<') && (next == '!') &&
-		           (avail < 9)) {
-		    goto done;
-		} else {
-		    ctxt->instate = XML_PARSER_CONTENT;
-		}
-		break;
-            case XML_PARSER_PROLOG:
-		SKIP_BLANKS;
-                avail = in->end - in->cur;
-		if (avail < 2)
-		    goto done;
-		cur = in->cur[0];
-		next = in->cur[1];
-		if ((cur == '<') && (next == '!') &&
-		    (in->cur[2] == '-') && (in->cur[3] == '-')) {
-		    if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
-			goto done;
-		    htmlParseComment(ctxt);
-		    ctxt->instate = XML_PARSER_PROLOG;
-	        } else if ((cur == '<') && (next == '?')) {
-		    if ((!terminate) &&
-		        (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
-			goto done;
-		    htmlParsePI(ctxt);
-		    ctxt->instate = XML_PARSER_PROLOG;
-		} else if ((cur == '<') && (next == '!') &&
-		           (avail < 4)) {
-		    goto done;
-		} else {
-		    ctxt->instate = XML_PARSER_CONTENT;
-		}
-		break;
-            case XML_PARSER_EPILOG:
-                avail = in->end - in->cur;
-		if (avail < 1)
-		    goto done;
-		cur = in->cur[0];
-		if (IS_BLANK_CH(cur)) {
-		    htmlParseCharData(ctxt);
-		    goto done;
-		}
-		if (avail < 2)
-		    goto done;
-		next = in->cur[1];
-	        if ((cur == '<') && (next == '!') &&
-		    (in->cur[2] == '-') && (in->cur[3] == '-')) {
-		    if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0))
-			goto done;
-		    htmlParseComment(ctxt);
-		    ctxt->instate = XML_PARSER_EPILOG;
-	        } else if ((cur == '<') && (next == '?')) {
-		    if ((!terminate) &&
-		        (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
-			goto done;
-		    htmlParsePI(ctxt);
-		    ctxt->instate = XML_PARSER_EPILOG;
-		} else if ((cur == '<') && (next == '!') &&
-		           (avail < 4)) {
-		    goto done;
-		} else {
-		    ctxt->errNo = XML_ERR_DOCUMENT_END;
-		    ctxt->wellFormed = 0;
-		    ctxt->instate = XML_PARSER_EOF;
-		    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
-			ctxt->sax->endDocument(ctxt->userData);
-		    goto done;
-		}
-		break;
-            case XML_PARSER_START_TAG: {
-	        const xmlChar *name;
-		int failed;
-		const htmlElemDesc * info;
 
-		/*
-		 * no chars in buffer
-		 */
-		if (avail < 1)
-		    goto done;
-		/*
-		 * not enough chars in buffer
-		 */
-		if (avail < 2) {
-		    if (!terminate)
-			goto done;
-		    else
-			next = ' ';
-		} else {
-		    next = in->cur[1];
-		}
-		cur = in->cur[0];
-	        if (cur != '<') {
-		    ctxt->instate = XML_PARSER_CONTENT;
-		    break;
-		}
-		if (next == '/') {
-		    ctxt->instate = XML_PARSER_END_TAG;
-		    ctxt->checkIndex = 0;
-		    break;
-		}
+            case XML_PARSER_START_TAG:
 		if ((!terminate) &&
-		    (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
-		    goto done;
+		    (htmlParseLookupGt(ctxt) < 0))
+		    return;
 
-                /* Capture start position */
-	        if (ctxt->record_info) {
-	             node_info.begin_pos = ctxt->input->consumed +
-	                                (CUR_PTR - ctxt->input->base);
-	             node_info.begin_line = ctxt->input->line;
-	        }
-
-
-		failed = htmlParseStartTag(ctxt);
-		name = ctxt->name;
-		if ((failed == -1) ||
-		    (name == NULL)) {
-		    if (CUR == '>')
-			NEXT;
-		    break;
-		}
-
-		/*
-		 * Lookup the info for that element.
-		 */
-		info = htmlTagLookup(name);
-		if (info == NULL) {
-		    htmlParseErr(ctxt, XML_HTML_UNKNOWN_TAG,
-		                 "Tag %s invalid\n", name, NULL);
-		}
-
-		/*
-		 * Check for an Empty Element labeled the XML/SGML way
-		 */
-		if ((CUR == '/') && (NXT(1) == '>')) {
-		    SKIP(2);
-		    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
-			ctxt->sax->endElement(ctxt->userData, name);
-		    htmlnamePop(ctxt);
-		    ctxt->instate = XML_PARSER_CONTENT;
-		    break;
-		}
-
-		if (CUR == '>') {
-		    NEXT;
-		} else {
-		    htmlParseErr(ctxt, XML_ERR_GT_REQUIRED,
-		                 "Couldn't find end of Start Tag %s\n",
-				 name, NULL);
-
-		    /*
-		     * end of parsing of this node.
-		     */
-		    if (xmlStrEqual(name, ctxt->name)) {
-			nodePop(ctxt);
-			htmlnamePop(ctxt);
-		    }
-
-		    if (ctxt->record_info)
-		        htmlNodeInfoPush(ctxt, &node_info);
-
-		    ctxt->instate = XML_PARSER_CONTENT;
-		    break;
-		}
-
-		/*
-		 * Check for an Empty Element from DTD definition
-		 */
-		if ((info != NULL) && (info->empty)) {
-		    if ((ctxt->sax != NULL) && (ctxt->sax->endElement != NULL))
-			ctxt->sax->endElement(ctxt->userData, name);
-		    htmlnamePop(ctxt);
-		}
-
-                if (ctxt->record_info)
-	            htmlNodeInfoPush(ctxt, &node_info);
+                htmlParseElementInternal(ctxt);
 
 		ctxt->instate = XML_PARSER_CONTENT;
                 break;
-	    }
+
+            case XML_PARSER_MISC: /* initial */
+            case XML_PARSER_PROLOG: /* before html */
             case XML_PARSER_CONTENT: {
-		xmlChar chr[2] = { 0, 0 };
+                int mode;
 
+                if ((ctxt->instate == XML_PARSER_MISC) ||
+                    (ctxt->instate == XML_PARSER_PROLOG)) {
+                    SKIP_BLANKS;
+                    avail = in->end - in->cur;
+                }
+
+		if (avail < 1)
+		    return;
                 /*
-		 * Handle preparsed entities and charRef
-		 */
-		if ((avail == 1) && (terminate)) {
-		    cur = in->cur[0];
-		    if ((cur != '<') && (cur != '&')) {
-			if (ctxt->sax != NULL) {
-                            chr[0] = cur;
-			    if (IS_BLANK_CH(cur)) {
-				if (ctxt->keepBlanks) {
-				    if (ctxt->sax->characters != NULL)
-					ctxt->sax->characters(
-						ctxt->userData, chr, 1);
-				} else {
-				    if (ctxt->sax->ignorableWhitespace != NULL)
-					ctxt->sax->ignorableWhitespace(
-						ctxt->userData, chr, 1);
-				}
-			    } else {
-				htmlCheckParagraph(ctxt);
-				if (ctxt->sax->characters != NULL)
-				    ctxt->sax->characters(
-					    ctxt->userData, chr, 1);
-			    }
-			}
-			ctxt->checkIndex = 0;
-			in->cur++;
-			break;
-		    }
-		}
-		if (avail < 2)
-		    goto done;
-		cur = in->cur[0];
-		next = in->cur[1];
-		if ((xmlStrEqual(ctxt->name, BAD_CAST"script")) ||
-		    (xmlStrEqual(ctxt->name, BAD_CAST"style"))) {
-		    /*
-		     * Handle SCRIPT/STYLE separately
-		     */
-		    if (!terminate) {
-		        int idx;
-			xmlChar val;
+                 * Note that endCheckState is also used by
+                 * xmlParseLookupGt.
+                 */
+                mode = ctxt->endCheckState;
 
-			idx = htmlParseLookupSequence(ctxt, '<', '/', 0, 0);
-			if (idx < 0)
-			    goto done;
-		        val = in->cur[idx + 2];
-			if (val == 0) { /* bad cut of input */
-                            /*
-                             * FIXME: htmlParseScript checks for additional
-                             * characters after '</'.
-                             */
-                            ctxt->checkIndex = idx;
-			    goto done;
-                        }
-		    }
-		    htmlParseScript(ctxt);
-		    if ((cur == '<') && (next == '/')) {
-			ctxt->instate = XML_PARSER_END_TAG;
-			ctxt->checkIndex = 0;
-			break;
-		    }
-		} else if ((cur == '<') && (next == '!')) {
-                    if (avail < 4)
-                        goto done;
-                    /*
-                     * Sometimes DOCTYPE arrives in the middle of the document
-                     */
-                    if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
-                        (UPP(4) == 'C') && (UPP(5) == 'T') &&
-                        (UPP(6) == 'Y') && (UPP(7) == 'P') &&
-                        (UPP(8) == 'E')) {
-                        if ((!terminate) &&
-                            (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0))
-                            goto done;
-                        htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
-                                     "Misplaced DOCTYPE declaration\n",
-                                     BAD_CAST "DOCTYPE" , NULL);
-                        htmlParseDocTypeDecl(ctxt);
-                    } else if ((in->cur[2] == '-') && (in->cur[3] == '-')) {
-                        if ((!terminate) &&
-                            (htmlParseLookupCommentEnd(ctxt) < 0))
-                            goto done;
-                        htmlParseComment(ctxt);
-                        ctxt->instate = XML_PARSER_CONTENT;
+                if (mode != 0) {
+                    if (htmlParseCharData(ctxt, !terminate) == 0)
+                        return;
+		} else if (in->cur[0] == '<') {
+                    int next;
+
+                    if (avail < 2) {
+                        if (!terminate)
+                            return;
+                        next = ' ';
                     } else {
-                        if ((!terminate) &&
-                            (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
-                            goto done;
-                        htmlSkipBogusComment(ctxt);
+                        next = in->cur[1];
                     }
-                } else if ((cur == '<') && (next == '?')) {
-                    if ((!terminate) &&
-                        (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
-                        goto done;
-                    htmlParsePI(ctxt);
-                    ctxt->instate = XML_PARSER_CONTENT;
-                } else if ((cur == '<') && (next == '/')) {
-                    ctxt->instate = XML_PARSER_END_TAG;
-                    ctxt->checkIndex = 0;
-                    break;
-                } else if ((cur == '<') && IS_ASCII_LETTER(next)) {
-                    if ((!terminate) && (next == 0))
-                        goto done;
-                    ctxt->instate = XML_PARSER_START_TAG;
-                    ctxt->checkIndex = 0;
-                    break;
-                } else if (cur == '<') {
-                    if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
-                        (ctxt->sax->characters != NULL))
-                        ctxt->sax->characters(ctxt->userData,
-                                              BAD_CAST "<", 1);
-                    NEXT;
-                } else {
-                    /*
-                     * check that the text sequence is complete
-                     * before handing out the data to the parser
-                     * to avoid problems with erroneous end of
-                     * data detection.
-                     */
-                    if ((!terminate) &&
-                        (htmlParseLookupSequence(ctxt, '<', 0, 0, 0) < 0))
-                        goto done;
-                    ctxt->checkIndex = 0;
-                    while ((PARSER_STOPPED(ctxt) == 0) &&
-                           (cur != '<') && (in->cur < in->end)) {
-                        if (cur == '&') {
-                            htmlParseReference(ctxt);
-                        } else {
-                            htmlParseCharData(ctxt);
+
+                    if (next == '!') {
+                        if ((!terminate) && (avail < 4))
+                            return;
+                        if ((in->cur[2] == '-') && (in->cur[3] == '-')) {
+                            if ((!terminate) &&
+                                (htmlParseLookupCommentEnd(ctxt) < 0))
+                                return;
+                            SKIP(4);
+                            htmlParseComment(ctxt, /* bogus */ 0);
+                            /* don't change state */
+                            break;
                         }
-                        cur = in->cur[0];
+
+                        if ((!terminate) && (avail < 9))
+                            return;
+                        if ((UPP(2) == 'D') && (UPP(3) == 'O') &&
+                            (UPP(4) == 'C') && (UPP(5) == 'T') &&
+                            (UPP(6) == 'Y') && (UPP(7) == 'P') &&
+                            (UPP(8) == 'E')) {
+                            if ((!terminate) &&
+                                (htmlParseLookupString(ctxt, 9, ">", 1,
+                                                       0) < 0))
+                                return;
+                            htmlParseDocTypeDecl(ctxt);
+                            if (ctxt->instate == XML_PARSER_MISC)
+                                ctxt->instate = XML_PARSER_PROLOG;
+                            else
+                                ctxt->instate = XML_PARSER_CONTENT;
+                        } else {
+                            ctxt->instate = XML_PARSER_CONTENT;
+                            if ((!terminate) &&
+                                (htmlParseLookupString(ctxt, 2, ">", 1, 0) < 0))
+                                return;
+                            SKIP(2);
+                            htmlParseComment(ctxt, /* bogus */ 1);
+                        }
+                    } else if (next == '?') {
+                        if ((!terminate) &&
+                            (htmlParseLookupString(ctxt, 2, ">", 1, 0) < 0))
+                            return;
+                        SKIP(1);
+                        htmlParseComment(ctxt, /* bogus */ 1);
+                        /* don't change state */
+                    } else if (next == '/') {
+                        ctxt->instate = XML_PARSER_END_TAG;
+                        ctxt->checkIndex = 0;
+                    } else if (IS_ASCII_LETTER(next)) {
+                        ctxt->instate = XML_PARSER_START_TAG;
+                        ctxt->checkIndex = 0;
+                    } else {
+                        ctxt->instate = XML_PARSER_CONTENT;
+                        htmlStartCharData(ctxt);
+                        if ((ctxt->sax != NULL) && (!ctxt->disableSAX) &&
+                            (ctxt->sax->characters != NULL))
+                            ctxt->sax->characters(ctxt->userData,
+                                                  BAD_CAST "<", 1);
+                        SKIP(1);
                     }
+                } else {
+                    ctxt->instate = XML_PARSER_CONTENT;
+                    /*
+                     * We follow the logic of the XML push parser
+                     */
+		    if (avail < HTML_PARSER_BIG_BUFFER_SIZE) {
+                        if ((!terminate) &&
+                            (htmlParseLookupString(ctxt, 0, "<", 1, 0) < 0))
+                            return;
+                    }
+                    ctxt->checkIndex = 0;
+                    if (htmlParseCharData(ctxt, !terminate) == 0)
+                        return;
 		}
 
 		break;
 	    }
+
             case XML_PARSER_END_TAG:
-		if (avail < 2)
-		    goto done;
 		if ((!terminate) &&
-		    (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0))
-		    goto done;
+		    (htmlParseLookupGt(ctxt) < 0))
+		    return;
 		htmlParseEndTag(ctxt);
-		if (ctxt->nameNr == 0) {
-		    ctxt->instate = XML_PARSER_EPILOG;
-		} else {
-		    ctxt->instate = XML_PARSER_CONTENT;
-		}
+		ctxt->instate = XML_PARSER_CONTENT;
 		ctxt->checkIndex = 0;
 	        break;
+
 	    default:
 		htmlParseErr(ctxt, XML_ERR_INTERNAL_ERROR,
 			     "HPP: internal error\n", NULL, NULL);
@@ -5699,33 +5214,6 @@
 		break;
 	}
     }
-done:
-    if ((avail == 0) && (terminate)) {
-	htmlAutoCloseOnEnd(ctxt);
-	if ((ctxt->nameNr == 0) && (ctxt->instate != XML_PARSER_EOF)) {
-	    /*
-	     * SAX: end of the document processing.
-	     */
-	    ctxt->instate = XML_PARSER_EOF;
-	    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
-		ctxt->sax->endDocument(ctxt->userData);
-	}
-    }
-    if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) && (ctxt->myDoc != NULL) &&
-	((terminate) || (ctxt->instate == XML_PARSER_EOF) ||
-	 (ctxt->instate == XML_PARSER_EPILOG))) {
-	xmlDtdPtr dtd;
-	dtd = xmlGetIntSubset(ctxt->myDoc);
-	if (dtd == NULL) {
-	    ctxt->myDoc->intSubset =
-		xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html",
-		    BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN",
-		    BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd");
-            if (ctxt->myDoc->intSubset == NULL)
-                htmlErrMemory(ctxt);
-        }
-    }
-    return(ret);
 }
 
 /**
@@ -5752,12 +5240,15 @@
 int
 htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
               int terminate) {
-    if ((ctxt == NULL) || (ctxt->input == NULL))
+    if ((ctxt == NULL) ||
+        (ctxt->input == NULL) || (ctxt->input->buf == NULL) ||
+        (size < 0) ||
+        ((size > 0) && (chunk == NULL)))
 	return(XML_ERR_ARGUMENT);
     if (PARSER_STOPPED(ctxt) != 0)
         return(ctxt->errNo);
-    if ((size > 0) && (chunk != NULL) && (ctxt->input != NULL) &&
-        (ctxt->input->buf != NULL))  {
+
+    if (size > 0)  {
 	size_t pos = ctxt->input->cur - ctxt->input->base;
 	int res;
 
@@ -5770,14 +5261,37 @@
 	    return (ctxt->errNo);
 	}
     }
+
     htmlParseTryOrFinish(ctxt, terminate);
-    if (terminate) {
-	if (ctxt->instate != XML_PARSER_EOF) {
-	    if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
-		ctxt->sax->endDocument(ctxt->userData);
-	}
+
+    if ((terminate) && (ctxt->instate != XML_PARSER_EOF)) {
+        htmlAutoCloseOnEnd(ctxt);
+
+        /*
+         * Only check for truncated multi-byte sequences
+         */
+        xmlParserCheckEOF(ctxt, XML_ERR_INTERNAL_ERROR);
+
+        if ((ctxt->sax) && (ctxt->sax->endDocument != NULL))
+            ctxt->sax->endDocument(ctxt->userData);
+
+        if ((!(ctxt->options & HTML_PARSE_NODEFDTD)) &&
+            (ctxt->myDoc != NULL)) {
+            xmlDtdPtr dtd;
+            dtd = xmlGetIntSubset(ctxt->myDoc);
+            if (dtd == NULL) {
+                ctxt->myDoc->intSubset =
+                    xmlCreateIntSubset(ctxt->myDoc, BAD_CAST "html",
+                        BAD_CAST "-//W3C//DTD HTML 4.0 Transitional//EN",
+                        BAD_CAST "http://www.w3.org/TR/REC-html40/loose.dtd");
+                if (ctxt->myDoc->intSubset == NULL)
+                    htmlErrMemory(ctxt);
+            }
+        }
+
 	ctxt->instate = XML_PARSER_EOF;
     }
+
     return((xmlParserErrors) ctxt->errNo);
 }
 
@@ -5814,12 +5328,20 @@
 	return(NULL);
 
     encoding = xmlGetCharEncodingName(enc);
-    input = xmlNewInputPush(ctxt, filename, chunk, size, encoding);
+    input = xmlNewPushInput(filename, chunk, size);
     if (input == NULL) {
 	htmlFreeParserCtxt(ctxt);
 	return(NULL);
     }
-    inputPush(ctxt, input);
+
+    if (xmlCtxtPushInput(ctxt, input) < 0) {
+        xmlFreeInputStream(input);
+        xmlFreeParserCtxt(ctxt);
+        return(NULL);
+    }
+
+    if (encoding != NULL)
+        xmlSwitchEncodingName(ctxt, encoding);
 
     return(ctxt);
 }
@@ -5917,12 +5439,16 @@
 	return(NULL);
     }
 
-    input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0);
+    input = xmlCtxtNewInputFromUrl(ctxt, filename, NULL, encoding, 0);
     if (input == NULL) {
 	xmlFreeParserCtxt(ctxt);
 	return(NULL);
     }
-    inputPush(ctxt, input);
+    if (xmlCtxtPushInput(ctxt, input) < 0) {
+        xmlFreeInputStream(input);
+        xmlFreeParserCtxt(ctxt);
+        return(NULL);
+    }
 
     return(ctxt);
 }
@@ -5979,8 +5505,6 @@
  *
  * Parse an HTML file and build a tree.
  *
- * See xmlNewInputURL for details.
- *
  * Returns the resulting document tree
  */
 
@@ -6013,113 +5537,64 @@
  * @parent: HTML parent element
  * @elt: HTML element
  *
- * Checks whether an HTML element may be a direct child of a parent element.
- * Note - doesn't check for deprecated elements
+ * DEPRECATED: Don't use.
  *
- * Returns 1 if allowed; 0 otherwise.
+ * Returns 1
  */
 int
-htmlElementAllowedHere(const htmlElemDesc* parent, const xmlChar* elt) {
-  const char** p ;
-
-  if ( ! elt || ! parent || ! parent->subelts )
-	return 0 ;
-
-  for ( p = parent->subelts; *p; ++p )
-    if ( !xmlStrcmp((const xmlChar *)*p, elt) )
-      return 1 ;
-
-  return 0 ;
+htmlElementAllowedHere(const htmlElemDesc* parent ATTRIBUTE_UNUSED,
+                       const xmlChar* elt ATTRIBUTE_UNUSED) {
+    return(1);
 }
+
 /**
  * htmlElementStatusHere:
  * @parent: HTML parent element
  * @elt: HTML element
  *
- * Checks whether an HTML element may be a direct child of a parent element.
- * and if so whether it is valid or deprecated.
+ * DEPRECATED: Don't use.
  *
- * Returns one of HTML_VALID, HTML_DEPRECATED, HTML_INVALID
+ * Returns HTML_VALID
  */
 htmlStatus
-htmlElementStatusHere(const htmlElemDesc* parent, const htmlElemDesc* elt) {
-  if ( ! parent || ! elt )
-    return HTML_INVALID ;
-  if ( ! htmlElementAllowedHere(parent, (const xmlChar*) elt->name ) )
-    return HTML_INVALID ;
-
-  return ( elt->dtd == 0 ) ? HTML_VALID : HTML_DEPRECATED ;
+htmlElementStatusHere(const htmlElemDesc* parent ATTRIBUTE_UNUSED,
+                      const htmlElemDesc* elt ATTRIBUTE_UNUSED) {
+    return(HTML_VALID);
 }
+
 /**
  * htmlAttrAllowed:
  * @elt: HTML element
  * @attr: HTML attribute
  * @legacy: whether to allow deprecated attributes
  *
- * Checks whether an attribute is valid for an element
- * Has full knowledge of Required and Deprecated attributes
+ * DEPRECATED: Don't use.
  *
- * Returns one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, HTML_INVALID
+ * Returns HTML_VALID
  */
 htmlStatus
-htmlAttrAllowed(const htmlElemDesc* elt, const xmlChar* attr, int legacy) {
-  const char** p ;
-
-  if ( !elt || ! attr )
-	return HTML_INVALID ;
-
-  if ( elt->attrs_req )
-    for ( p = elt->attrs_req; *p; ++p)
-      if ( !xmlStrcmp((const xmlChar*)*p, attr) )
-        return HTML_REQUIRED ;
-
-  if ( elt->attrs_opt )
-    for ( p = elt->attrs_opt; *p; ++p)
-      if ( !xmlStrcmp((const xmlChar*)*p, attr) )
-        return HTML_VALID ;
-
-  if ( legacy && elt->attrs_depr )
-    for ( p = elt->attrs_depr; *p; ++p)
-      if ( !xmlStrcmp((const xmlChar*)*p, attr) )
-        return HTML_DEPRECATED ;
-
-  return HTML_INVALID ;
+htmlAttrAllowed(const htmlElemDesc* elt ATTRIBUTE_UNUSED,
+                const xmlChar* attr ATTRIBUTE_UNUSED,
+                int legacy ATTRIBUTE_UNUSED) {
+    return(HTML_VALID);
 }
+
 /**
  * htmlNodeStatus:
  * @node: an htmlNodePtr in a tree
  * @legacy: whether to allow deprecated elements (YES is faster here
  *	for Element nodes)
  *
- * Checks whether the tree node is valid.  Experimental (the author
- *     only uses the HTML enhancements in a SAX parser)
+ * DEPRECATED: Don't use.
  *
- * Return: for Element nodes, a return from htmlElementAllowedHere (if
- *	legacy allowed) or htmlElementStatusHere (otherwise).
- *	for Attribute nodes, a return from htmlAttrAllowed
- *	for other nodes, HTML_NA (no checks performed)
+ * Returns HTML_VALID
  */
 htmlStatus
-htmlNodeStatus(htmlNodePtr node, int legacy) {
-  if ( ! node )
-    return HTML_INVALID ;
-
-  switch ( node->type ) {
-    case XML_ELEMENT_NODE:
-      return legacy
-	? ( htmlElementAllowedHere (
-		htmlTagLookup(node->parent->name) , node->name
-		) ? HTML_VALID : HTML_INVALID )
-	: htmlElementStatusHere(
-		htmlTagLookup(node->parent->name) ,
-		htmlTagLookup(node->name) )
-	;
-    case XML_ATTRIBUTE_NODE:
-      return htmlAttrAllowed(
-	htmlTagLookup(node->parent->name) , node->name, legacy) ;
-    default: return HTML_NA ;
-  }
+htmlNodeStatus(htmlNodePtr node ATTRIBUTE_UNUSED,
+               int legacy ATTRIBUTE_UNUSED) {
+    return(HTML_VALID);
 }
+
 /************************************************************************
  *									*
  *	New set (2.6.0) of simpler and more flexible APIs		*
@@ -6154,7 +5629,7 @@
 
     dict = ctxt->dict;
 
-    while ((input = inputPop(ctxt)) != NULL) { /* Non consuming */
+    while ((input = xmlCtxtPopInput(ctxt)) != NULL) { /* Non consuming */
         xmlFreeInputStream(input);
     }
     ctxt->inputNr = 0;
@@ -6198,7 +5673,7 @@
     ctxt->standalone = -1;
     ctxt->hasExternalSubset = 0;
     ctxt->hasPErefs = 0;
-    ctxt->html = 1;
+    ctxt->html = INSERT_INITIAL;
     ctxt->instate = XML_PARSER_START;
 
     ctxt->wellFormed = 1;
@@ -6233,12 +5708,178 @@
         xmlResetError(&ctxt->lastError);
 }
 
+static int
+htmlCtxtSetOptionsInternal(xmlParserCtxtPtr ctxt, int options, int keepMask)
+{
+    int allMask;
+
+    if (ctxt == NULL)
+        return(-1);
+
+    allMask = HTML_PARSE_RECOVER |
+              HTML_PARSE_HTML5 |
+              HTML_PARSE_NODEFDTD |
+              HTML_PARSE_NOERROR |
+              HTML_PARSE_NOWARNING |
+              HTML_PARSE_PEDANTIC |
+              HTML_PARSE_NOBLANKS |
+              HTML_PARSE_NONET |
+              HTML_PARSE_NOIMPLIED |
+              HTML_PARSE_COMPACT |
+              HTML_PARSE_HUGE |
+              HTML_PARSE_IGNORE_ENC |
+              HTML_PARSE_BIG_LINES;
+
+    ctxt->options = (ctxt->options & keepMask) | (options & allMask);
+
+    /*
+     * For some options, struct members are historically the source
+     * of truth. See xmlCtxtSetOptionsInternal.
+     */
+    ctxt->keepBlanks = (options & HTML_PARSE_NOBLANKS) ? 0 : 1;
+
+    /*
+     * Changing SAX callbacks is a bad idea. This should be fixed.
+     */
+    if (options & HTML_PARSE_NOBLANKS) {
+        ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
+    }
+    if (options & HTML_PARSE_HUGE) {
+        if (ctxt->dict != NULL)
+            xmlDictSetLimit(ctxt->dict, 0);
+    }
+
+    /*
+     * It would be useful to allow this feature.
+     */
+    ctxt->dictNames = 0;
+
+    ctxt->linenumbers = 1;
+
+    return(options & ~allMask);
+}
+
+/**
+ * htmlCtxtSetOptions:
+ * @ctxt: an HTML parser context
+ * @options:  a bitmask of xmlParserOption values
+ *
+ * Applies the options to the parser context. Unset options are
+ * cleared.
+ *
+ * Available since 2.14.0. With older versions, you can use
+ * htmlCtxtUseOptions.
+ *
+ * HTML_PARSE_RECOVER
+ *
+ * No effect as of 2.14.0.
+ *
+ * HTML_PARSE_HTML5
+ *
+ * Make the tokenizer emit a SAX callback for each token. This results
+ * in unbalanced invocations of startElement and endElement.
+ *
+ * For now, this is only usable with custom SAX callbacks.
+ *
+ * HTML_PARSE_NODEFDTD
+ *
+ * Do not default to a doctype if none was found.
+ *
+ * HTML_PARSE_NOERROR
+ *
+ * Disable error and warning reports to the error handlers.
+ * Errors are still accessible with xmlCtxtGetLastError.
+ *
+ * HTML_PARSE_NOWARNING
+ *
+ * Disable warning reports.
+ *
+ * HTML_PARSE_PEDANTIC
+ *
+ * No effect.
+ *
+ * HTML_PARSE_NOBLANKS
+ *
+ * Remove some text nodes containing only whitespace from the
+ * result document. Which nodes are removed depends on a conservative
+ * heuristic. The reindenting feature of the serialization code relies
+ * on this option to be set when parsing. Use of this option is
+ * DISCOURAGED.
+ *
+ * HTML_PARSE_NONET
+ *
+ * No effect.
+ *
+ * HTML_PARSE_NOIMPLIED
+ *
+ * Do not add implied html, head or body elements.
+ *
+ * HTML_PARSE_COMPACT
+ *
+ * Store small strings directly in the node struct to save
+ * memory.
+ *
+ * HTML_PARSE_HUGE
+ *
+ * Relax some internal limits.
+ *
+ * Available since 2.14.0. Use XML_PARSE_HUGE works with older
+ * versions.
+ *
+ * Maximum size of text nodes, tags, comments, CDATA sections
+ *
+ * normal: 10M
+ * huge:    1B
+ *
+ * Maximum size of names, system literals, pubid literals
+ *
+ * normal: 50K
+ * huge:   10M
+ *
+ * Maximum nesting depth of elements
+ *
+ * normal:  256
+ * huge:   2048
+ *
+ * HTML_PARSE_IGNORE_ENC
+ *
+ * Ignore the encoding in the HTML declaration. This option is
+ * mostly unneeded these days. The only effect is to enforce
+ * UTF-8 decoding of ASCII-like data.
+ *
+ * HTML_PARSE_BIG_LINES
+ *
+ * Enable reporting of line numbers larger than 65535.
+ *
+ * Available since 2.14.0.
+ *
+ * Returns 0 in case of success, the set of unknown or unimplemented options
+ *         in case of error.
+ */
+int
+htmlCtxtSetOptions(xmlParserCtxtPtr ctxt, int options)
+{
+    return(htmlCtxtSetOptionsInternal(ctxt, options, 0));
+}
+
 /**
  * htmlCtxtUseOptions:
  * @ctxt: an HTML parser context
  * @options:  a combination of htmlParserOption(s)
  *
- * Applies the options to the parser context
+ * DEPRECATED: Use htmlCtxtSetOptions.
+ *
+ * Applies the options to the parser context. The following options
+ * are never cleared and can only be enabled:
+ *
+ * HTML_PARSE_NODEFDTD
+ * HTML_PARSE_NOERROR
+ * HTML_PARSE_NOWARNING
+ * HTML_PARSE_NOIMPLIED
+ * HTML_PARSE_COMPACT
+ * HTML_PARSE_HUGE
+ * HTML_PARSE_IGNORE_ENC
+ * HTML_PARSE_BIG_LINES
  *
  * Returns 0 in case of success, the set of unknown or unimplemented options
  *         in case of error.
@@ -6246,63 +5887,21 @@
 int
 htmlCtxtUseOptions(htmlParserCtxtPtr ctxt, int options)
 {
-    if (ctxt == NULL)
-        return(-1);
+    int keepMask;
 
-    if (options & HTML_PARSE_NOWARNING) {
-        ctxt->sax->warning = NULL;
-        ctxt->vctxt.warning = NULL;
-        options -= XML_PARSE_NOWARNING;
-	ctxt->options |= XML_PARSE_NOWARNING;
-    }
-    if (options & HTML_PARSE_NOERROR) {
-        ctxt->sax->error = NULL;
-        ctxt->vctxt.error = NULL;
-        ctxt->sax->fatalError = NULL;
-        options -= XML_PARSE_NOERROR;
-	ctxt->options |= XML_PARSE_NOERROR;
-    }
-    if (options & HTML_PARSE_PEDANTIC) {
-        ctxt->pedantic = 1;
-        options -= XML_PARSE_PEDANTIC;
-	ctxt->options |= XML_PARSE_PEDANTIC;
-    } else
-        ctxt->pedantic = 0;
-    if (options & XML_PARSE_NOBLANKS) {
-        ctxt->keepBlanks = 0;
-        ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
-        options -= XML_PARSE_NOBLANKS;
-	ctxt->options |= XML_PARSE_NOBLANKS;
-    } else
-        ctxt->keepBlanks = 1;
-    if (options & HTML_PARSE_RECOVER) {
-        ctxt->recovery = 1;
-	options -= HTML_PARSE_RECOVER;
-    } else
-        ctxt->recovery = 0;
-    if (options & HTML_PARSE_COMPACT) {
-	ctxt->options |= HTML_PARSE_COMPACT;
-        options -= HTML_PARSE_COMPACT;
-    }
-    if (options & XML_PARSE_HUGE) {
-	ctxt->options |= XML_PARSE_HUGE;
-        options -= XML_PARSE_HUGE;
-    }
-    if (options & HTML_PARSE_NODEFDTD) {
-	ctxt->options |= HTML_PARSE_NODEFDTD;
-        options -= HTML_PARSE_NODEFDTD;
-    }
-    if (options & HTML_PARSE_IGNORE_ENC) {
-	ctxt->options |= HTML_PARSE_IGNORE_ENC;
-        options -= HTML_PARSE_IGNORE_ENC;
-    }
-    if (options & HTML_PARSE_NOIMPLIED) {
-        ctxt->options |= HTML_PARSE_NOIMPLIED;
-        options -= HTML_PARSE_NOIMPLIED;
-    }
-    ctxt->dictNames = 0;
-    ctxt->linenumbers = 1;
-    return (options);
+    /*
+     * For historic reasons, some options can only be enabled.
+     */
+    keepMask = HTML_PARSE_NODEFDTD |
+               HTML_PARSE_NOERROR |
+               HTML_PARSE_NOWARNING |
+               HTML_PARSE_NOIMPLIED |
+               HTML_PARSE_COMPACT |
+               HTML_PARSE_HUGE |
+               HTML_PARSE_IGNORE_ENC |
+               HTML_PARSE_BIG_LINES;
+
+    return(htmlCtxtSetOptionsInternal(ctxt, options, keepMask));
 }
 
 /**
@@ -6321,32 +5920,29 @@
 {
     htmlDocPtr ret;
 
-    if ((ctxt == NULL) || (input == NULL))
-        return(NULL);
-
-    /* assert(ctxt->inputNr == 0); */
-    while (ctxt->inputNr > 0)
-        xmlFreeInputStream(inputPop(ctxt));
-
-    if (inputPush(ctxt, input) < 0) {
+    if ((ctxt == NULL) || (input == NULL)) {
+        xmlFatalErr(ctxt, XML_ERR_ARGUMENT, NULL);
         xmlFreeInputStream(input);
         return(NULL);
     }
 
-    ctxt->html = 1;
+    /* assert(ctxt->inputNr == 0); */
+    while (ctxt->inputNr > 0)
+        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
+
+    if (xmlCtxtPushInput(ctxt, input) < 0) {
+        xmlFreeInputStream(input);
+        return(NULL);
+    }
+
+    ctxt->html = INSERT_INITIAL;
     htmlParseDocument(ctxt);
 
-    if (ctxt->errNo != XML_ERR_NO_MEMORY) {
-        ret = ctxt->myDoc;
-    } else {
-        ret = NULL;
-        xmlFreeDoc(ctxt->myDoc);
-    }
-    ctxt->myDoc = NULL;
+    ret = xmlCtxtGetDocument(ctxt);
 
     /* assert(ctxt->inputNr == 1); */
     while (ctxt->inputNr > 0)
-        xmlFreeInputStream(inputPop(ctxt));
+        xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 
     return(ret);
 }
@@ -6371,7 +5967,7 @@
 {
     htmlParserCtxtPtr ctxt;
     xmlParserInputPtr input;
-    htmlDocPtr doc;
+    htmlDocPtr doc = NULL;
 
     ctxt = htmlNewParserCtxt();
     if (ctxt == NULL)
@@ -6379,10 +5975,11 @@
 
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputString(ctxt, url, (const char *) str, encoding,
-                              XML_INPUT_BUF_STATIC);
+    input = xmlCtxtNewInputFromString(ctxt, url, (const char *) str, encoding,
+                                      XML_INPUT_BUF_STATIC);
 
-    doc = htmlCtxtParseDocument(ctxt, input);
+    if (input != NULL)
+        doc = htmlCtxtParseDocument(ctxt, input);
 
     htmlFreeParserCtxt(ctxt);
     return(doc);
@@ -6406,7 +6003,7 @@
 {
     htmlParserCtxtPtr ctxt;
     xmlParserInputPtr input;
-    htmlDocPtr doc;
+    htmlDocPtr doc = NULL;
 
     ctxt = htmlNewParserCtxt();
     if (ctxt == NULL)
@@ -6414,9 +6011,10 @@
 
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0);
+    input = xmlCtxtNewInputFromUrl(ctxt, filename, NULL, encoding, 0);
 
-    doc = htmlCtxtParseDocument(ctxt, input);
+    if (input != NULL)
+        doc = htmlCtxtParseDocument(ctxt, input);
 
     htmlFreeParserCtxt(ctxt);
     return(doc);
@@ -6443,7 +6041,7 @@
 {
     htmlParserCtxtPtr ctxt;
     xmlParserInputPtr input;
-    htmlDocPtr doc;
+    htmlDocPtr doc = NULL;
 
     if (size < 0)
 	return(NULL);
@@ -6454,10 +6052,11 @@
 
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputMemory(ctxt, url, buffer, size, encoding,
-                              XML_INPUT_BUF_STATIC);
+    input = xmlCtxtNewInputFromMemory(ctxt, url, buffer, size, encoding,
+                                      XML_INPUT_BUF_STATIC);
 
-    doc = htmlCtxtParseDocument(ctxt, input);
+    if (input != NULL)
+        doc = htmlCtxtParseDocument(ctxt, input);
 
     htmlFreeParserCtxt(ctxt);
     return(doc);
@@ -6485,7 +6084,7 @@
 {
     htmlParserCtxtPtr ctxt;
     xmlParserInputPtr input;
-    htmlDocPtr doc;
+    htmlDocPtr doc = NULL;
 
     ctxt = htmlNewParserCtxt();
     if (ctxt == NULL)
@@ -6493,9 +6092,10 @@
 
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputFd(ctxt, url, fd, encoding, 0);
+    input = xmlCtxtNewInputFromFd(ctxt, url, fd, encoding, 0);
 
-    doc = htmlCtxtParseDocument(ctxt, input);
+    if (input != NULL)
+        doc = htmlCtxtParseDocument(ctxt, input);
 
     htmlFreeParserCtxt(ctxt);
     return(doc);
@@ -6523,7 +6123,7 @@
 {
     htmlParserCtxtPtr ctxt;
     xmlParserInputPtr input;
-    htmlDocPtr doc;
+    htmlDocPtr doc = NULL;
 
     ctxt = htmlNewParserCtxt();
     if (ctxt == NULL)
@@ -6531,9 +6131,11 @@
 
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputIO(ctxt, url, ioread, ioclose, ioctx, encoding, 0);
+    input = xmlCtxtNewInputFromIO(ctxt, url, ioread, ioclose, ioctx,
+                                  encoding, 0);
 
-    doc = htmlCtxtParseDocument(ctxt, input);
+    if (input != NULL)
+        doc = htmlCtxtParseDocument(ctxt, input);
 
     htmlFreeParserCtxt(ctxt);
     return(doc);
@@ -6565,7 +6167,10 @@
     htmlCtxtReset(ctxt);
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputString(ctxt, URL, (const char *) str, encoding, 0);
+    input = xmlCtxtNewInputFromString(ctxt, URL, (const char *) str,
+                                      encoding, 0);
+    if (input == NULL)
+        return(NULL);
 
     return(htmlCtxtParseDocument(ctxt, input));
 }
@@ -6580,7 +6185,7 @@
  * Parse an HTML file from the filesystem, the network or a
  * user-defined resource loader.
  *
- * See xmlNewInputURL and htmlCtxtUseOptions for details.
+ * See htmlCtxtUseOptions for details.
  *
  * Returns the resulting document tree
  */
@@ -6596,7 +6201,9 @@
     htmlCtxtReset(ctxt);
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputURL(ctxt, filename, NULL, encoding, 0);
+    input = xmlCtxtNewInputFromUrl(ctxt, filename, NULL, encoding, 0);
+    if (input == NULL)
+        return(NULL);
 
     return(htmlCtxtParseDocument(ctxt, input));
 }
@@ -6629,8 +6236,10 @@
     htmlCtxtReset(ctxt);
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputMemory(ctxt, URL, buffer, size, encoding,
-                              XML_INPUT_BUF_STATIC);
+    input = xmlCtxtNewInputFromMemory(ctxt, URL, buffer, size, encoding,
+                                      XML_INPUT_BUF_STATIC);
+    if (input == NULL)
+        return(NULL);
 
     return(htmlCtxtParseDocument(ctxt, input));
 }
@@ -6664,7 +6273,9 @@
     htmlCtxtReset(ctxt);
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputFd(ctxt, URL, fd, encoding, 0);
+    input = xmlCtxtNewInputFromFd(ctxt, URL, fd, encoding, 0);
+    if (input == NULL)
+        return(NULL);
 
     return(htmlCtxtParseDocument(ctxt, input));
 }
@@ -6681,7 +6292,7 @@
  *
  * Parse an HTML document from I/O functions and source and build a tree.
  *
- * See xmlNewInputIO and htmlCtxtUseOptions for details.
+ * See htmlCtxtUseOptions for details.
  *
  * Returns the resulting document tree
  */
@@ -6699,7 +6310,10 @@
     htmlCtxtReset(ctxt);
     htmlCtxtUseOptions(ctxt, options);
 
-    input = xmlNewInputIO(ctxt, URL, ioread, ioclose, ioctx, encoding, 0);
+    input = xmlCtxtNewInputFromIO(ctxt, URL, ioread, ioclose, ioctx,
+                                  encoding, 0);
+    if (input == NULL)
+        return(NULL);
 
     return(htmlCtxtParseDocument(ctxt, input));
 }
diff --git a/HTMLtree.c b/HTMLtree.c
index 8fa022c..4173a36 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -311,6 +311,8 @@
  * htmlIsBooleanAttr:
  * @name:  the name of the attribute to check
  *
+ * DEPRECATED: Internal function, don't use.
+ *
  * Determine if a given attribute is a boolean attribute.
  *
  * returns: false if the attribute is not boolean, true otherwise.
@@ -331,74 +333,19 @@
 #ifdef LIBXML_OUTPUT_ENABLED
 /************************************************************************
  *									*
- *			Output error handlers				*
- *									*
- ************************************************************************/
-
-/**
- * htmlSaveErr:
- * @code:  the error number
- * @node:  the location of the error.
- * @extra:  extra information
- *
- * Handle an out of memory condition
- */
-static void
-htmlSaveErr(int code, xmlNodePtr node, const char *extra)
-{
-    const char *msg = NULL;
-    int res;
-
-    switch(code) {
-        case XML_SAVE_NOT_UTF8:
-	    msg = "string is not in UTF-8\n";
-	    break;
-	case XML_SAVE_CHAR_INVALID:
-	    msg = "invalid character value\n";
-	    break;
-	case XML_SAVE_UNKNOWN_ENCODING:
-	    msg = "unknown encoding %s\n";
-	    break;
-	case XML_SAVE_NO_DOCTYPE:
-	    msg = "HTML has no DOCTYPE\n";
-	    break;
-	default:
-	    msg = "unexpected error number\n";
-    }
-
-    res = __xmlRaiseError(NULL, NULL, NULL, NULL, node,
-                          XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0,
-                          extra, NULL, NULL, 0, 0,
-                          msg, extra);
-    if (res < 0)
-        xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_OUTPUT, NULL);
-}
-
-/************************************************************************
- *									*
  *		Dumping HTML tree content to a simple buffer		*
  *									*
  ************************************************************************/
 
-static xmlCharEncodingHandler *
-htmlFindOutputEncoder(const char *encoding) {
-    xmlCharEncodingHandler *handler = NULL;
+static xmlParserErrors
+htmlFindOutputEncoder(const char *encoding, xmlCharEncodingHandler **out) {
+    /*
+     * Fallback to HTML if the encoding is unspecified
+     */
+    if (encoding == NULL)
+        encoding = "HTML";
 
-    if (encoding != NULL) {
-        int res;
-
-        res = xmlOpenCharEncodingHandler(encoding, /* output */ 1,
-                                         &handler);
-        if (res != XML_ERR_OK)
-            htmlSaveErr(XML_SAVE_UNKNOWN_ENCODING, NULL, encoding);
-    } else {
-        /*
-         * Fallback to HTML when the encoding is unspecified
-         */
-        xmlOpenCharEncodingHandler("HTML", /* output */ 1, &handler);
-    }
-
-    return(handler);
+    return(xmlOpenCharEncodingHandler(encoding, /* output */ 1, out));
 }
 
 /**
@@ -460,7 +407,8 @@
 int
 htmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur) {
     xmlBufPtr buffer;
-    size_t ret;
+    size_t ret1;
+    int ret2;
 
     if ((buf == NULL) || (cur == NULL))
         return(-1);
@@ -470,14 +418,13 @@
     if (buffer == NULL)
         return(-1);
 
-    xmlBufSetAllocationScheme(buffer, XML_BUFFER_ALLOC_DOUBLEIT);
-    ret = htmlBufNodeDumpFormat(buffer, doc, cur, 1);
+    ret1 = htmlBufNodeDumpFormat(buffer, doc, cur, 1);
 
-    xmlBufBackToBuffer(buffer);
+    ret2 = xmlBufBackToBuffer(buffer, buf);
 
-    if (ret > INT_MAX)
+    if ((ret1 == (size_t) -1) || (ret2 < 0))
         return(-1);
-    return((int) ret);
+    return(ret1 > INT_MAX ? INT_MAX : ret1);
 }
 
 /**
@@ -506,12 +453,11 @@
     /*
      * save the content to a temp buffer.
      */
-    handler = htmlFindOutputEncoder(encoding);
+    if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK)
+        return(-1);
     buf = xmlOutputBufferCreateFile(out, handler);
-    if (buf == NULL) {
-        xmlCharEncCloseFunc(handler);
-        return(0);
-    }
+    if (buf == NULL)
+        return(-1);
 
     htmlNodeDumpFormatOutput(buf, doc, cur, NULL, format);
 
@@ -559,12 +505,11 @@
 	return;
 
     encoding = (const char *) htmlGetMetaEncoding(cur);
-    handler = htmlFindOutputEncoder(encoding);
-    buf = xmlAllocOutputBufferInternal(handler);
-    if (buf == NULL) {
-        xmlCharEncCloseFunc(handler);
+    if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK)
+        return;
+    buf = xmlAllocOutputBuffer(handler);
+    if (buf == NULL)
 	return;
-    }
 
     htmlDocContentDumpFormatOutput(buf, cur, NULL, format);
 
@@ -619,10 +564,8 @@
 	          const char *encoding ATTRIBUTE_UNUSED) {
     xmlDtdPtr cur = doc->intSubset;
 
-    if (cur == NULL) {
-	htmlSaveErr(XML_SAVE_NO_DOCTYPE, (xmlNodePtr) doc, NULL);
+    if (cur == NULL)
 	return;
-    }
     xmlOutputBufferWriteString(buf, "<!DOCTYPE ");
     xmlOutputBufferWriteString(buf, (const char *)cur->name);
     if (cur->ExternalID != NULL) {
@@ -1027,12 +970,11 @@
     }
 
     encoding = (const char *) htmlGetMetaEncoding(cur);
-    handler = htmlFindOutputEncoder(encoding);
-    buf = xmlOutputBufferCreateFile(f, handler);
-    if (buf == NULL) {
-        xmlCharEncCloseFunc(handler);
+    if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK)
         return(-1);
-    }
+    buf = xmlOutputBufferCreateFile(f, handler);
+    if (buf == NULL)
+        return(-1);
     htmlDocContentDumpOutput(buf, cur, NULL);
 
     ret = xmlOutputBufferClose(buf);
@@ -1061,12 +1003,11 @@
     xmlInitParser();
 
     encoding = (const char *) htmlGetMetaEncoding(cur);
-    handler = htmlFindOutputEncoder(encoding);
+    if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK)
+        return(-1);
     buf = xmlOutputBufferCreateFilename(filename, handler, cur->compression);
-    if (buf == NULL) {
-        xmlCharEncCloseFunc(handler);
-        return(0);
-    }
+    if (buf == NULL)
+        return(-1);
 
     htmlDocContentDumpOutput(buf, cur, NULL);
 
@@ -1097,7 +1038,8 @@
 
     xmlInitParser();
 
-    handler = htmlFindOutputEncoder(encoding);
+    if (htmlFindOutputEncoder(encoding, &handler) != XML_ERR_OK)
+        return(-1);
     if (handler != NULL)
         htmlSetMetaEncoding(cur, (const xmlChar *) handler->name);
     else
@@ -1107,10 +1049,8 @@
      * save the content to a temp buffer.
      */
     buf = xmlOutputBufferCreateFilename(filename, handler, 0);
-    if (buf == NULL) {
-        xmlCharEncCloseFunc(handler);
+    if (buf == NULL)
         return(0);
-    }
 
     htmlDocContentDumpFormatOutput(buf, cur, encoding, format);
 
diff --git a/MAINTAINERS.md b/MAINTAINERS.md
index 76ba488..9aa75f6 100644
--- a/MAINTAINERS.md
+++ b/MAINTAINERS.md
@@ -50,23 +50,13 @@
 
 ### Bump the version number
 
-Edit the version number in `configure.ac` if you haven't done so already.
+Update the version number in `VERSION` if you haven't done so already.
 
-### Build the tarball
+### Commit and verify tarball
 
-I'd recommend to build the tarball by running
-
-    make distcheck
-
-which performs some useful checks as well.
-
-### Upload the tarball
-
-Follow the instructions at
-<https://wiki.gnome.org/MaintainersCorner/Releasing>:
-
-    scp libxml2-[version].tar.xz master.gnome.org:
-    ssh master.gnome.org ftpadmin install libxml2-[version].tar.xz
+Release tarballs are generated with a CI job and the `.gitlab-ci/dist.sh`
+script. Push the release commit and inspect the tarball artifact generated
+by Gitlab CI.
 
 ### Tag the release
 
@@ -75,9 +65,13 @@
     git tag -a [version] -m 'Release [version]'
     git push origin [version]
 
+This will upload the release to the downloads server using the GNOME
+Release Service. For more details, see
+<https://handbook.gnome.org/maintainers/release-pipeline.html>
+
 ### Create a GitLab release
 
-Create a new GitLab release on
+Create or update a GitLab release on
 <https://gitlab.gnome.org/GNOME/libxml2/-/releases>.
 
 ### Announce the release
@@ -106,9 +100,9 @@
 ## Updating the CI Docker image
 
 Note that the CI image is used for libxslt as well. First create a
-GitLab access token with `read_registry` and `write_registry`
-permissions. Then run the following commands with the Dockerfile in the
-.gitlab-ci directory:
+GitLab access token with maintainer role and `read_registry` and
+`write_registry` permissions. Then run the following commands with the
+Dockerfile in the .gitlab-ci directory:
 
     docker login -u <username> -p <access_token> \
         registry.gitlab.gnome.org
diff --git a/Makefile.am b/Makefile.am
index 908e11e..cff88d4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,6 @@
 	runtest \
 	runxmlconf \
 	testModule \
-	testThreads \
 	testapi \
 	testchar \
 	testdict \
@@ -27,7 +26,7 @@
 	testparser \
 	testrecurse
 
-bin_PROGRAMS = xmllint xmlcatalog
+bin_PROGRAMS = xmllint
 
 bin_SCRIPTS = xml2-config
 
@@ -36,11 +35,7 @@
 libxml2_la_LIBADD = $(XML_PRIVATE_LIBS)
 
 libxml2_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \
-		     -version-info $(LIBXML_VERSION_INFO) \
-		     $(MODULE_PLATFORM_LIBS)
-if USE_VERSION_SCRIPT
-libxml2_la_LDFLAGS += $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
-endif
+		     -version-info $(LIBXML_VERSION_INFO)
 
 libxml2_la_SOURCES = buf.c chvalid.c dict.c entities.c encoding.c error.c \
 		     globals.c hash.c list.c parser.c parserInternals.c \
@@ -50,26 +45,26 @@
 libxml2_la_SOURCES += c14n.c
 endif
 if WITH_CATALOG_SOURCES
+if WITH_OUTPUT_SOURCES
+bin_PROGRAMS += xmlcatalog
+
+xmlcatalog_SOURCES = xmlcatalog.c
+xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
+xmlcatalog_DEPENDENCIES = $(DEPS)
+xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
+endif
+
 libxml2_la_SOURCES += catalog.c
 endif
 if WITH_DEBUG_SOURCES
 libxml2_la_SOURCES += debugXML.c
 endif
-if WITH_FTP_SOURCES
-libxml2_la_SOURCES += nanoftp.c
-endif
 if WITH_HTML_SOURCES
 libxml2_la_SOURCES += HTMLparser.c HTMLtree.c
 endif
 if WITH_HTTP_SOURCES
 libxml2_la_SOURCES += nanohttp.c
 endif
-if WITH_LEGACY_SOURCES
-libxml2_la_SOURCES += legacy.c
-if WITH_SAX1_SOURCES
-libxml2_la_SOURCES += SAX.c
-endif
-endif
 if WITH_LZMA_SOURCES
 libxml2_la_SOURCES += xzlib.c
 endif
@@ -88,11 +83,11 @@
 if WITH_REGEXPS_SOURCES
 libxml2_la_SOURCES += xmlregexp.c xmlunicode.c
 endif
-if WITH_SCHEMAS_SOURCES
-libxml2_la_SOURCES += relaxng.c xmlschemas.c xmlschemastypes.c
-if !WITH_XPATH_SOURCES
-libxml2_la_SOURCES += xpath.c
+if WITH_RELAXNG_SOURCES
+libxml2_la_SOURCES += relaxng.c
 endif
+if WITH_SCHEMAS_SOURCES
+libxml2_la_SOURCES += xmlschemas.c xmlschemastypes.c
 endif
 if WITH_SCHEMATRON_SOURCES
 libxml2_la_SOURCES += schematron.c
@@ -113,13 +108,9 @@
 DEPS = libxml2.la
 LDADDS = libxml2.la
 
-
-m4datadir = $(datadir)/aclocal
-dist_m4data_DATA = libxml.m4
-
 runtest_SOURCES=runtest.c
 runtest_DEPENDENCIES = $(DEPS)
-runtest_LDADD= $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
+runtest_LDADD= $(THREAD_LIBS) $(LDADDS)
 
 testrecurse_SOURCES=testrecurse.c
 testrecurse_DEPENDENCIES = $(DEPS)
@@ -145,25 +136,16 @@
 runsuite_DEPENDENCIES = $(DEPS)
 runsuite_LDADD= $(LDADDS)
 
-xmllint_SOURCES=xmllint.c
+xmllint_SOURCES = xmllint.c shell.c lintmain.c
 xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
 xmllint_DEPENDENCIES = $(DEPS)
 xmllint_LDADD=  $(RDL_LIBS) $(LDADDS)
 
-xmlcatalog_SOURCES=xmlcatalog.c
-xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
-xmlcatalog_DEPENDENCIES = $(DEPS)
-xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
-
-testThreads_SOURCES = testThreads.c
-testThreads_DEPENDENCIES = $(DEPS)
-testThreads_LDADD= $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
-
 testModule_SOURCES=testModule.c
 testModule_DEPENDENCIES = $(DEPS)
 testModule_LDADD= $(LDADDS)
 
-noinst_LTLIBRARIES = testdso.la
+check_LTLIBRARIES = testdso.la
 testdso_la_SOURCES = testdso.c
 testdso_la_LDFLAGS = $(AM_LDFLAGS) \
 		     -module -no-undefined -avoid-version -rpath $(libdir)
@@ -171,7 +153,7 @@
 # that one forces the rebuild when "make rebuild" is run on doc/
 rebuild_testapi:
 	-@(if [ "$(PYTHON)" != "" ] ; then \
-	    $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
+	    $(PYTHON) $(srcdir)/tools/gentest.py $(srcdir) ; fi )
 
 testapi_SOURCES=testapi.c
 testapi_DEPENDENCIES = $(DEPS)
@@ -191,9 +173,16 @@
 	$(CHECKER) ./testdict$(EXEEXT)
 	$(CHECKER) ./testparser$(EXEEXT)
 	$(CHECKER) ./testModule$(EXEEXT)
-	$(CHECKER) ./testThreads$(EXEEXT)
-	$(CHECKER) ./runxmlconf$(EXEEXT)
+	$(CHECKER) ./runxmlconf$(EXEEXT) -d $(srcdir)/xmlconf
 	$(CHECKER) ./runsuite$(EXEEXT)
+if WITH_DEBUG_SOURCES
+	test/scripts/test.sh ./xmllint$(EXEEXT)
+endif
+if WITH_CATALOG_SOURCES
+if WITH_OUTPUT_SOURCES
+	ASAN_OPTIONS=detect_leaks=0 test/catalogs/test.sh ./xmlcatalog$(EXEEXT)
+endif
+endif
 
 # Compatibility name of the check target
 runtests: check
@@ -207,185 +196,26 @@
 	@echo '## rebuilding for ASAN'
 	./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff  ; $(MAKE) clean ; $(MAKE)
 
-# Old test suite. This should be ported to C.
-
-OLD_TESTS = Timingtests
-if WITH_CATALOG_SOURCES
-OLD_TESTS += Catatests
-endif
-if WITH_DEBUG_SOURCES
-OLD_TESTS += Scripttests
-endif
-if WITH_SCHEMAS_SOURCES
-if WITH_PYTHON
-OLD_TESTS += RelaxNGPythonTests SchemasPythonTests
-endif
-endif
-if WITH_SCHEMATRON_SOURCES
-OLD_TESTS += Schematrontests
-endif
-if WITH_VALID_SOURCES
-OLD_TESTS += VTimingtests
-endif
-
-tests: $(OLD_TESTS)
-
-Scripttests : xmllint$(EXEEXT)
-	@echo "## Scripts regression tests"
-	@echo "## Some of the base computations may be different if srcdir != ."
-	-@(for i in $(srcdir)/test/scripts/*.script ; do \
-	  name=`basename $$i .script`; \
-	  xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
-	  if [ -f $$xml ] ; then \
-	  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 ; \
-	  else \
-	      log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
-	      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 ; \
-	      rm result.$$name result.$$name.err ; \
-	  fi ; fi ; done)
-
-Catatests : xmlcatalog$(EXEEXT)
-	@echo "## Catalog regression tests"
-	-@(for i in $(srcdir)/test/catalogs/*.script ; do \
-	  name=`basename $$i .script`; \
-	  xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
-	  if [ -f $$xml ] ; then \
-	  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 ; \
-	  else \
-	      log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
-	      diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
-	      if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
-	      rm result.$$name ; \
-	  fi ; fi ; done)
-	-@(for i in $(srcdir)/test/catalogs/*.script ; do \
-	  name=`basename $$i .script`; \
-	  sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
-	  if [ -f $$sgml ] ; then \
-	  if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
-	      echo New test file $$name ; \
-	      $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
-	  else \
-	      log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
-	      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; \
-	$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
-	$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
-	$(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
-	diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
-	$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
-	$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
-	$(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
-	diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
-	rm -f $(srcdir)/result/catalogs/mycatalog)
-
-dba100000.xml: dbgenattr.pl
-	@echo "## generating dba100000.xml"
-	@($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml)
-
-Timingtests: xmllint$(EXEEXT) dba100000.xml
-	@echo "## Timing tests to try to detect performance"
-	@echo "## as well a memory usage breakage when streaming"
-	@echo "## 1/ using the file interface"
-	@echo "## 2/ using the memory interface"
-	@echo "## 3/ repeated DOM parsing"
-	@echo "## 4/ repeated DOM validation"
-	-@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
-	   if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
-	   exit 0)
-	-@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
-	   if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
-	   exit 0)
-	-@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
-	   if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
-	   exit 0)
-
-VTimingtests: xmllint$(EXEEXT)
-	-@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
-	   if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
-	   exit 0)
-
-Schematrontests: xmllint$(EXEEXT)
-	@echo "## Schematron regression tests"
-	-@(for i in $(srcdir)/test/schematron/*.sct ; do \
-	  name=`basename $$i | sed 's+\.sct++'`; \
-	  for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \
-	      if [ -f $$j ] ; then \
-	      xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
-	      if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
-	      then \
-		  echo New test file "$$name"_"$$xno" ; \
-		  $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
-		    > $(srcdir)/result/schematron/"$$name"_"$$xno" \
-		    2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
-	      else \
-	          log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
-		    > res.$$name 2> err.$$name;\
-	          diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
-		       res.$$name;\
-	          diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
-		       err.$$name | grep -v "error detected at";\
-		  grep Unimplemented err.$$name`; \
-		  if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \
-	          rm res.$$name err.$$name ; \
-	       fi ; fi ; \
-	  done; done)
-
-RelaxNGPythonTests:
-	@(if [ -x $(PYTHON) ] ; then \
-	    PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \
-	    export PYTHONPATH; \
-	    LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
-	    export LD_LIBRARY_PATH; \
-	    echo "## Relax-NG Python based test suite 1" ; \
-	    $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \
-	    echo "## Relax-NG Python based test suite 2" ; \
-	    $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \
-	  fi)
-
-SchemasPythonTests:
-	@(if [ -x $(PYTHON) ] ; then \
-	    PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \
-	    export PYTHONPATH; \
-	    LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
-	    export LD_LIBRARY_PATH; \
-	    echo "## XML Schemas datatypes Python based test suite" ; \
-	    echo "## It is normal to see 11 errors reported" ; \
-	    $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \
-	  fi)
-	@(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi)
-
 cleanup:
 	-@(find . -name .\#\* -exec rm {} \;)
 	-@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;)
 	-@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;)
 
 dist-hook: cleanup
-	(cd $(srcdir) ; tar -cf - --exclude .git win32 os400 test result) | (cd $(distdir); tar xf -)
+	(cd $(srcdir) ; tar -cf - --exclude .git win32 test result) | (cd $(distdir); tar xf -)
 
 CLEANFILES = runsuite.log runxmlconf.log test.out *.gcda *.gcno *.res
 DISTCLEANFILES = COPYING missing.lst
 
-EXTRA_DIST = Copyright check-xml-test-suite.py gentest.py \
-	     check-relaxng-test-suite.py check-relaxng-test-suite2.py \
-	     check-xsddata-test-suite.py check-xinclude-test-suite.py \
-	     libxml2-config.cmake.in autogen.sh \
+EXTRA_DIST = Copyright libxml2-config.cmake.in autogen.sh \
 	     libxml.h \
-	     genUnicode.py \
-	     dbgen.pl dbgenattr.pl \
-	     libxml2.syms timsort.h \
+	     html5ent.inc iso8859x.inc \
+	     tools/gentest.py \
+	     tools/genChRanges.py tools/genEscape.py tools/genUnicode.py \
+	     timsort.h \
 	     README.zOS README.md \
 	     CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \
-	     meson.build meson_options.txt
+	     meson.build meson_options.txt xml2-config-meson
 
 
 pkgconfigdir = $(libdir)/pkgconfig
diff --git a/NEWS b/NEWS
index 516fdbd..b96ad0f 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,196 @@
 NEWS file for libxml2
 
+v2.14.2: Apr 17 2025
+
+### Security
+
+- [CVE-2025-32415] schemas: Fix heap buffer overflow in
+  xmlSchemaIDCFillNodeTables
+- [CVE-2025-32414] python: Read at most len/4 characters. (Maks Verver)
+
+### Build
+
+- error: Fix initGenericErrorDefaultFunc compatibility macro
+- meson: don't link with pthreads on Windows (Benjamin Gilbert)
+- cmake, meson: Align Darwin version info with Autotools
+- globals: Fix --with-thread-alloc build
+- meson: ensure relaxng option supports minimum option (Lovell Fuller)
+
+
+v2.14.1: Apr 3 2025
+
+### Regressions
+
+- parser: Fix XML_PARSE_NOBLANKS dropping non-whitespace text
+
+### Build systems
+
+- win32-legacy: Fix build (ThomasK)
+- meson: Fix build from tarball
+- cmake, meson: Change library filename to libxml2.so.16.0.0
+
+
+v2.14.0: Mar 27 2025
+
+### Major changes
+
+The HTML tokenizer now conforms fully to HTML5. Several non-standard
+syntax warnings were removed. Note that HTML5 tree construction isn't
+implemented yet.
+
+Binary compatibility is restricted to versions 2.14 or newer. On ELF
+systems, the soname was bumped from libxml2.so.2 to libxml2.so.16.
+
+The serialization API will now take user-provided or default encodings
+into account when serializing attribute values, matching the
+serialization of text and avoiding unnecessary escaping.
+
+The XML parser won't try to merge consecutive CDATA sections as before
+to align with web standards. Each CDATA section will create exactly one
+node or SAX callback.
+
+Support for RELAX NG can now be disabled with a new configuration
+option independently of XML Schemas support. It is still enabled by
+default.
+
+The "legacy" configuration option won't enable support for HTTP and
+LZMA anymore. These features will be removed in the next release.
+
+Parts of the xmllint executable were refactored, allowing the
+combination of more options. OOM errors should be reported reliably now.
+
+Several improvements were made to the build systems. Meson is fully
+supported now.
+
+Parts of the buffering code were reworked and simplified.
+
+Overflow checks before reallocations were hardenend.
+
+Some unprefixed symbols were renamed to avoid namespace pollution.
+
+### Other potentially incompatible changes
+
+Strings passed to the "characters" callback of the HTML SAX parser
+aren't null-terminated anymore, matching the behavior of the XML
+parser. Custom SAX parsers must use the "len" argument.
+
+xmlIOParseDTD doesn't allow null bytes at the end of the input anymore.
+
+Type and layout of conversion callbacks in struct xmlCharEncodingHandler
+were changed. Applications using libxml2's encoding conversion API
+should use functions xmlCharEncInFunc and xmlCharEncOutFunc instead of
+accessing the callbacks directly.
+
+### New features
+
+Input callbacks can now be set on a parser context and an improved API
+to create parser input is available. The following new functions,
+taking a parser input object, were added:
+
+- xmlCtxtParseDocument
+- xmlCtxtParseContent as replacement for xmlParseBalancedChunkMemory
+  and xmlParseInNodeContext
+- xmlCtxtParseDtd
+
+The xmlSave API now has additional options to replace global settings.
+
+Parser options XML_PARSE_UNZIP, XML_PARSE_NO_SYS_CATALOG and
+XML_PARSE_CATALOG_PI were added.
+
+An API function to install a custom character encoding converter is
+now available. This makes it possible to use ICU for encoding conversion
+even if libxml2 was compiled without ICU support, see example/icu.c.
+
+### Deprecations
+
+Access to many public struct members is now deprecated. Several accessor
+functions were added to use instead.
+
+More internal functions were deprecated.
+
+### Removals
+
+Metadata about the HTML4 content model was removed from the htmlElemDesc
+struct and related functions were deprecated.
+
+The FTP module and related functions were removed.
+
+Support for the range and point extensions of the xpointer() scheme
+was removed. The rest of the XPointer implementation isn't affected.
+The xpointer() scheme now behaves like the xpath1() scheme.
+
+Several legacy symbols and the functions in xmlunicode.h were removed.
+
+Some unprefixed, internal macros like ATTRIBUTE_UNUSED were removed
+from public headers.
+
+ELF version information was removed.
+
+The shell was moved from libxml2 to xmllint. Several related functions
+are no longer available.
+
+The libxml.m4 file containing autoconf macros was removed.
+
+The --with-tree configuration option was removed.
+
+The hack to detect single-threaded programs under glibc was removed.
+
+### Planned removals
+
+Support for HTTP and LZMA compression is planned to be removed in the
+2.15 release.
+
+The following features are considered for removal:
+
+- Modules API (xmlmodule.h)
+- Schematron support
+- Support for zlib compressed file I/O
+- Legacy Windows build system in win32
+
+RELAX NG support is still in a bad state and a long-term removal
+candidate.
+
+### Thanks
+
+Thanks to the following contributors:
+
+- Andrew Potter
+- Benjamin Gilbert
+- Chun-wei Fan
+- correctmost
+- Daniel Cheng
+- Daniel E
+- Florin Haja
+- Grzegorz Szymaszek
+- Heiko Becker
+- Himanshibansal
+- Jan Alexander Steffens (heftig)
+- Kjell Ahlstedt
+- makise-homura
+- Markus Rickert
+- Mike Dalessio
+- Miklos Vajna
+- Rosen Penev
+- Ruslan Garipov
+- Ryan Carsten Schmidt
+- Saleem Abdulrasool
+- Sam James
+- Satadru Pramanik
+- Taylor R Campbell
+- triallax
+- Yegor Yefremov
+- Zak Ridouh
+
+
+v2.13.7: Mar 27 2025
+
+### Regressions
+
+- tree: Fix xmlTextMerge with NULL args
+- io: Fix `compressed` flag for uncompressed stdin
+- parser: Fix parsing of DTD content
+
+
 v2.13.6: Feb 18 2025
 
 ### Security
diff --git a/README.fuchsia b/README.fuchsia
index d0454b2..9638600 100644
--- a/README.fuchsia
+++ b/README.fuchsia
@@ -3,10 +3,10 @@
 License: MIT
 License File: Copyright
 Upstream Git: https://github.com/GNOME/libxml2
-Version: 2.13.6
+Version: 2.14.2
 Description:
 
-This is the Fuchsia build of libxml2 based off of upstream's v2.13.6 release.
+This is the Fuchsia build of libxml2 based off of upstream's v2.14.2 release.
 
 Local Modifications:
 - The 'config.h' and 'include/libxml2/xmlversion.h' files are generated via the
diff --git a/README.md b/README.md
index 58c9433..f5fb7c8 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,9 @@
 <https://gitlab.gnome.org/GNOME/libxml2>
 
 Bugs should be reported at
-<https://gitlab.gnome.org/GNOME/libxml2/-/issues>
+<https://gitlab.gnome.org/GNOME/libxml2/-/issues>.
+Please report *security issues* to our bug tracker as well. Make sure to
+mark the issue as *confidential*.
 
 Documentation is available at
 <https://gitlab.gnome.org/GNOME/libxml2/-/wikis>
@@ -21,8 +23,7 @@
 
 ## Build instructions
 
-libxml2 can be built with GNU Autotools, CMake, meson or several other
-build systems in platform-specific subdirectories.
+libxml2 can be built with GNU Autotools, CMake or meson.
 
 ### Autotools (for POSIX systems like Linux, BSD, macOS)
 
@@ -45,9 +46,9 @@
 
     --with-c14n             Canonical XML 1.0 support (on)
     --with-catalog          XML Catalogs support (on)
-    --with-debug            debugging module and shell (on)
-    --with-history          history support for shell (off)
-    --with-readline[=DIR]   use readline in DIR (for shell history)
+    --with-debug            debugging module (on)
+    --with-history          history support for xmllint shell (off)
+    --with-readline[=DIR]   use readline in DIR for shell (off)
     --with-html             HTML parser (on)
     --with-http             HTTP support (off)
     --with-iconv[=DIR]      iconv support (on)
@@ -61,12 +62,12 @@
     --with-python           Python bindings (on)
     --with-reader           xmlReader parsing interface (on)
     --with-regexps          regular expressions support (on)
+    --with-relaxng          RELAX NG support (on)
     --with-sax1             older SAX1 interface (on)
-    --with-schemas          XML Schemas 1.0 and RELAX NG support (on)
+    --with-schemas          XML Schemas 1.0 support (on)
     --with-schematron       Schematron support (on)
     --with-threads          multithreading support (on)
     --with-thread-alloc     per-thread malloc hooks (off)
-    --with-tree             DOM like tree manipulation APIs (on)
     --with-valid            DTD validation support (on)
     --with-writer           xmlWriter serialization interface (on)
     --with-xinclude         XInclude 1.0 support (on)
@@ -99,12 +100,13 @@
 
 ### CMake (mainly for Windows)
 
-Another option for compiling libxml is using CMake:
+Example commands:
 
-    cmake -E tar xf libxml2-xxx.tar.gz
-    cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
-    cmake --build libxml2-xxx-build
-    cmake --install libxml2-xxx-build
+    cmake -E tar xf libxml2-xxx.tar.xz
+    cmake -S libxml2-xxx -B builddir [options]
+    cmake --build builddir
+    ctest --test-dir builddir
+    cmake --install builddir
 
 Common CMake options include:
 
@@ -112,52 +114,49 @@
     -D CMAKE_BUILD_TYPE=Release         # specify build type
     -D CMAKE_INSTALL_PREFIX=/usr/local  # specify the install path
     -D LIBXML2_WITH_ICONV=OFF           # disable iconv
-    -D LIBXML2_WITH_LZMA=OFF            # disable liblzma
     -D LIBXML2_WITH_PYTHON=OFF          # disable Python
-    -D LIBXML2_WITH_ZLIB=OFF            # disable libz
+    -D LIBXML2_WITH_ZLIB=ON             # enable zlib
 
 You can also open the libxml source directory with its CMakeLists.txt
 directly in various IDEs such as CLion, QtCreator, or Visual Studio.
 
 ### Meson
 
-Libxml can also be built with meson. Without option, simply call
+Example commands:
 
-meson setup builddir
-ninja -C builddir
+    meson setup [options] builddir
+    ninja -C builddir
+    meson test -C builddir
+    ninja -C builddir install
 
-To add options, see the meson_options.txt file. For example:
+See the `meson_options.txt` file for options. For example:
 
-meson setup -Dprefix=$prefix -Dftp=true -Dhistory=true -Dicu=true -Dhttp=true builddir
-
-To install libxml:
-
-ninja -C builddir install
-
-To launch tests:
-
-meson test -C builddir
+    -Dprefix=$prefix
+    -Dhistory=enabled
+    -Dhttp=enabled
+    -Dschematron=disabled
+    -Dzlib=enabled
 
 ## Dependencies
 
-Libxml does not require any other libraries. A platform with somewhat
-recent POSIX support should be sufficient (please report any violation
-to this rule you may find).
+libxml2 supports POSIX and Windows operating systems.
 
 The iconv function is required for conversion of character encodings.
 This function is part of POSIX.1-2001. If your platform doesn't provide
 iconv, you need an external libiconv library, for example
-[GNU libiconv](https://www.gnu.org/software/libiconv/). Alternatively,
-you can use [ICU](https://icu.unicode.org/).
+[GNU libiconv](https://www.gnu.org/software/libiconv/). Using
+[ICU](https://icu.unicode.org/) is also supported but discouraged.
 
 If enabled, libxml uses [libz](https://zlib.net/) or
 [liblzma](https://tukaani.org/xz/) to support reading compressed files.
 Use of this feature is discouraged.
 
+The xmllint executable uses libreadline and libhistory if enabled.
+
 ## Contributing
 
-The current version of the code can be found in GNOME's GitLab at 
-at <https://gitlab.gnome.org/GNOME/libxml2>. The best way to get involved
+The current version of the code can be found in GNOME's GitLab at
+<https://gitlab.gnome.org/GNOME/libxml2>. The best way to get involved
 is by creating issues and merge requests on GitLab.
 
 All code must conform to C89 and pass the GitLab CI tests. Add regression
diff --git a/SAX.c b/SAX.c
deleted file mode 100644
index 7f2f297..0000000
--- a/SAX.c
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * SAX.c : Old SAX v1 handlers to build a tree.
- *         Deprecated except for compatibility
- *
- * See Copyright for the status of this software.
- *
- * Daniel Veillard <daniel@veillard.com>
- */
-
-
-#define IN_LIBXML
-#include "libxml.h"
-#include <stdlib.h>
-#include <string.h>
-#include <libxml/xmlmemory.h>
-#include <libxml/tree.h>
-#include <libxml/parser.h>
-#include <libxml/parserInternals.h>
-#include <libxml/valid.h>
-#include <libxml/entities.h>
-#include <libxml/xmlerror.h>
-#include <libxml/debugXML.h>
-#include <libxml/xmlIO.h>
-#include <libxml/SAX.h>
-#include <libxml/uri.h>
-#include <libxml/valid.h>
-#include <libxml/HTMLtree.h>
-#include <libxml/SAX2.h>
-
-#ifdef LIBXML_LEGACY_ENABLED
-#ifdef LIBXML_SAX1_ENABLED
-/**
- * initxmlDefaultSAXHandler:
- * @hdlr:  the SAX handler
- * @warning:  flag if non-zero sets the handler warning procedure
- *
- * Initialize the default XML SAX version 1 handler
- * DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks
- */
-void
-initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning)
-{
-
-    if(hdlr->initialized == 1)
-	return;
-
-    hdlr->internalSubset = xmlSAX2InternalSubset;
-    hdlr->externalSubset = xmlSAX2ExternalSubset;
-    hdlr->isStandalone = xmlSAX2IsStandalone;
-    hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
-    hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
-    hdlr->resolveEntity = xmlSAX2ResolveEntity;
-    hdlr->getEntity = xmlSAX2GetEntity;
-    hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
-    hdlr->entityDecl = xmlSAX2EntityDecl;
-    hdlr->attributeDecl = xmlSAX2AttributeDecl;
-    hdlr->elementDecl = xmlSAX2ElementDecl;
-    hdlr->notationDecl = xmlSAX2NotationDecl;
-    hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
-    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
-    hdlr->startDocument = xmlSAX2StartDocument;
-    hdlr->endDocument = xmlSAX2EndDocument;
-    hdlr->startElement = xmlSAX2StartElement;
-    hdlr->endElement = xmlSAX2EndElement;
-    hdlr->reference = xmlSAX2Reference;
-    hdlr->characters = xmlSAX2Characters;
-    hdlr->cdataBlock = xmlSAX2CDataBlock;
-    hdlr->ignorableWhitespace = xmlSAX2Characters;
-    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
-    if (warning == 0)
-	hdlr->warning = NULL;
-    else
-	hdlr->warning = xmlParserWarning;
-    hdlr->error = xmlParserError;
-    hdlr->fatalError = xmlParserError;
-
-    hdlr->initialized = 1;
-}
-
-#ifdef LIBXML_HTML_ENABLED
-
-/**
- * inithtmlDefaultSAXHandler:
- * @hdlr:  the SAX handler
- *
- * Initialize the default HTML SAX version 1 handler
- * DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks
- */
-void
-inithtmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
-{
-    if(hdlr->initialized == 1)
-	return;
-
-    hdlr->internalSubset = xmlSAX2InternalSubset;
-    hdlr->externalSubset = NULL;
-    hdlr->isStandalone = NULL;
-    hdlr->hasInternalSubset = NULL;
-    hdlr->hasExternalSubset = NULL;
-    hdlr->resolveEntity = NULL;
-    hdlr->getEntity = xmlSAX2GetEntity;
-    hdlr->getParameterEntity = NULL;
-    hdlr->entityDecl = NULL;
-    hdlr->attributeDecl = NULL;
-    hdlr->elementDecl = NULL;
-    hdlr->notationDecl = NULL;
-    hdlr->unparsedEntityDecl = NULL;
-    hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
-    hdlr->startDocument = xmlSAX2StartDocument;
-    hdlr->endDocument = xmlSAX2EndDocument;
-    hdlr->startElement = xmlSAX2StartElement;
-    hdlr->endElement = xmlSAX2EndElement;
-    hdlr->reference = NULL;
-    hdlr->characters = xmlSAX2Characters;
-    hdlr->cdataBlock = xmlSAX2CDataBlock;
-    hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
-    hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
-    hdlr->comment = xmlSAX2Comment;
-    hdlr->warning = xmlParserWarning;
-    hdlr->error = xmlParserError;
-    hdlr->fatalError = xmlParserError;
-
-    hdlr->initialized = 1;
-}
-
-#endif /* LIBXML_HTML_ENABLED */
-
-#endif /* LIBXML_SAX1_ENABLED */
-
-#endif /* LIBXML_LEGACY_ENABLED */
diff --git a/SAX2.c b/SAX2.c
index 3d0257c..b5c2e47 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -21,7 +21,6 @@
 #include <libxml/valid.h>
 #include <libxml/entities.h>
 #include <libxml/xmlerror.h>
-#include <libxml/debugXML.h>
 #include <libxml/xmlIO.h>
 #include <libxml/uri.h>
 #include <libxml/valid.h>
@@ -31,8 +30,6 @@
 #include "private/parser.h"
 #include "private/tree.h"
 
-#define XML_MAX_URI_LENGTH 2000
-
 /*
  * xmlSAX2ErrMemory:
  * @ctxt:  an XML validation parser context
@@ -247,10 +244,10 @@
 
     if (ctxt->myDoc == NULL)
 	return;
+    if ((ctxt->html) && (ctxt->instate != XML_PARSER_MISC))
+        return;
     dtd = xmlGetIntSubset(ctxt->myDoc);
     if (dtd != NULL) {
-	if (ctxt->html)
-	    return;
 	xmlUnlinkNode((xmlNodePtr) dtd);
 	xmlFreeDtd(dtd);
 	ctxt->myDoc->intSubset = NULL;
@@ -291,6 +288,11 @@
 	const xmlChar *oldencoding;
         unsigned long consumed;
         size_t buffered;
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+        int inputMax = 1;
+#else
+        int inputMax = 5;
+#endif
 
 	/*
 	 * Ask the Entity resolver to load the damn thing
@@ -318,22 +320,16 @@
 	oldencoding = ctxt->encoding;
 	ctxt->encoding = NULL;
 
-	ctxt->inputTab = (xmlParserInputPtr *)
-	                 xmlMalloc(5 * sizeof(xmlParserInputPtr));
+	ctxt->inputTab = xmlMalloc(inputMax * sizeof(xmlParserInputPtr));
 	if (ctxt->inputTab == NULL) {
 	    xmlSAX2ErrMemory(ctxt);
-            xmlFreeInputStream(input);
-	    ctxt->input = oldinput;
-	    ctxt->inputNr = oldinputNr;
-	    ctxt->inputMax = oldinputMax;
-	    ctxt->inputTab = oldinputTab;
-	    ctxt->encoding = oldencoding;
-	    return;
+            goto error;
 	}
 	ctxt->inputNr = 0;
-	ctxt->inputMax = 5;
+	ctxt->inputMax = inputMax;
 	ctxt->input = NULL;
-	xmlPushInput(ctxt, input);
+	if (xmlCtxtPushInput(ctxt, input) < 0)
+            goto error;
 
 	if (input->filename == NULL)
 	    input->filename = (char *) xmlCanonicPath(SystemID);
@@ -353,7 +349,7 @@
 	 */
 
 	while (ctxt->inputNr > 1)
-	    xmlPopInput(ctxt);
+	    xmlFreeInputStream(xmlCtxtPopInput(ctxt));
 
         consumed = ctxt->input->consumed;
         buffered = ctxt->input->cur - ctxt->input->base;
@@ -366,7 +362,8 @@
         else
             ctxt->sizeentities += consumed;
 
-	xmlFreeInputStream(ctxt->input);
+error:
+	xmlFreeInputStream(input);
         xmlFree(ctxt->inputTab);
 
 	/*
@@ -391,16 +388,14 @@
  * @publicId: The public ID of the entity
  * @systemId: The system ID of the entity
  *
- * The entity loader, to control the loading of external entities,
- * the application can either:
- *    - override this xmlSAX2ResolveEntity() callback in the SAX block
- *    - or better use the xmlSetExternalEntityLoader() function to
- *      set up it's own entity resolution routine
+ * This is only used to load DTDs. The preferred way to install
+ * custom resolvers is xmlCtxtSetResourceLoader.
  *
- * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
+ * Returns a parser input.
  */
 xmlParserInputPtr
-xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId, const xmlChar *systemId)
+xmlSAX2ResolveEntity(void *ctx, const xmlChar *publicId,
+                     const xmlChar *systemId)
 {
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlParserInputPtr ret = NULL;
@@ -443,8 +438,8 @@
         }
     }
 
-    ret = xmlLoadExternalEntity((const char *) URI,
-                                (const char *) publicId, ctxt);
+    ret = xmlLoadResource(ctxt, (const char *) URI,
+                          (const char *) publicId, XML_RESOURCE_DTD);
 
     xmlFree(URI);
     return(ret);
@@ -631,7 +626,8 @@
 {
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlAttributePtr attr;
-    xmlChar *name = NULL, *prefix = NULL;
+    const xmlChar *name = NULL;
+    xmlChar *prefix = NULL;
 
     /* Avoid unused variable warning if features are disabled. */
     (void) attr;
@@ -649,8 +645,7 @@
 	      "xml:id : attribute type should be ID\n", NULL, NULL);
 	ctxt->valid = tmp;
     }
-    /* TODO: optimize name/prefix allocation */
-    name = xmlSplitQName(ctxt, fullname, &prefix);
+    name = xmlSplitQName4(fullname, &prefix);
     if (name == NULL)
         xmlSAX2ErrMemory(ctxt);
     ctxt->vctxt.valid = 1;
@@ -666,7 +661,6 @@
         xmlFatalErrMsg(ctxt, XML_ERR_INTERNAL_ERROR,
 	     "SAX.xmlSAX2AttributeDecl(%s) called while not in subset\n",
 	               name, NULL);
-	xmlFree(name);
 	xmlFree(prefix);
 	xmlFreeEnumeration(tree);
 	return;
@@ -681,8 +675,6 @@
 #endif /* LIBXML_VALID_ENABLED */
     if (prefix != NULL)
 	xmlFree(prefix);
-    if (name != NULL)
-	xmlFree(name);
 }
 
 /**
@@ -927,7 +919,7 @@
     }
 }
 
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
+#if defined(LIBXML_SAX1_ENABLED)
 /**
  * xmlNsErrMsg:
  * @ctxt:  an XML parser context
@@ -947,95 +939,37 @@
 }
 
 /**
- * xmlSAX2AttributeInternal:
+ * xmlSAX1Attribute:
  * @ctx: the user data (XML parser context)
  * @fullname:  The attribute name, including namespace prefix
  * @value:  The attribute value
- * @prefix: the prefix on the element node
  *
  * Handle an attribute that has been read by the parser.
- * The default handling is to convert the attribute into an
- * DOM subtree and past it in a new xmlAttr element added to
- * the element.
+ *
+ * Deprecated SAX1 interface.
  */
 static void
-xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
-             const xmlChar *value, const xmlChar *prefix ATTRIBUTE_UNUSED)
+xmlSAX1Attribute(xmlParserCtxtPtr ctxt, const xmlChar *fullname,
+                 const xmlChar *value, const xmlChar *prefix)
 {
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlAttrPtr ret;
-    xmlChar *name;
+    const xmlChar *name;
     xmlChar *ns;
-    xmlChar *nval;
     xmlNsPtr namespace;
 
-    if (ctxt->html) {
-	name = xmlStrdup(fullname);
-	ns = NULL;
-	namespace = NULL;
-    } else {
-	/*
-	 * Split the full name into a namespace prefix and the tag name
-	 */
-	name = xmlSplitQName(ctxt, fullname, &ns);
-	if ((name != NULL) && (name[0] == 0)) {
-	    if (xmlStrEqual(ns, BAD_CAST "xmlns")) {
-		xmlNsErrMsg(ctxt, XML_ERR_NS_DECL_ERROR,
-			    "invalid namespace declaration '%s'\n",
-			    fullname, NULL);
-	    } else {
-		xmlNsWarnMsg(ctxt, XML_WAR_NS_COLUMN,
-			     "Avoid attribute ending with ':' like '%s'\n",
-			     fullname, NULL);
-	    }
-	    if (ns != NULL)
-		xmlFree(ns);
-	    ns = NULL;
-	    xmlFree(name);
-	    name = xmlStrdup(fullname);
-	}
-    }
+    /*
+     * Split the full name into a namespace prefix and the tag name
+     */
+    name = xmlSplitQName4(fullname, &ns);
     if (name == NULL) {
         xmlSAX2ErrMemory(ctxt);
-	if (ns != NULL)
-	    xmlFree(ns);
-	return;
-    }
-
-#ifdef LIBXML_HTML_ENABLED
-    if ((ctxt->html) &&
-        (value == NULL) && (htmlIsBooleanAttr(fullname))) {
-            nval = xmlStrdup(fullname);
-            if (nval == NULL)
-                xmlSAX2ErrMemory(ctxt);
-            value = (const xmlChar *) nval;
-    } else
-#endif
-    {
-#ifdef LIBXML_VALID_ENABLED
-        /*
-         * Do the last stage of the attribute normalization
-         * Needed for HTML too:
-         *   http://www.w3.org/TR/html4/types.html#h-6.2
-         */
-        ctxt->vctxt.valid = 1;
-        nval = xmlValidCtxtNormalizeAttributeValue(&ctxt->vctxt,
-                                               ctxt->myDoc, ctxt->node,
-                                               fullname, value);
-        if (ctxt->vctxt.valid != 1) {
-            ctxt->valid = 0;
-        }
-        if (nval != NULL)
-            value = nval;
-#else
-        nval = NULL;
-#endif /* LIBXML_VALID_ENABLED */
+        return;
     }
 
     /*
      * Check whether it's a namespace definition
      */
-    if ((!ctxt->html) && (ns == NULL) &&
+    if ((ns == NULL) &&
         (name[0] == 'x') && (name[1] == 'm') && (name[2] == 'l') &&
         (name[3] == 'n') && (name[4] == 's') && (name[5] == 0)) {
 	xmlNsPtr nsret;
@@ -1049,10 +983,6 @@
 	    val = xmlExpandEntitiesInAttValue(ctxt, value, /* normalize */ 0);
 	    if (val == NULL) {
 	        xmlSAX2ErrMemory(ctxt);
-		if (name != NULL)
-		    xmlFree(name);
-                if (nval != NULL)
-                    xmlFree(nval);
 		return;
 	    }
 	} else {
@@ -1093,16 +1023,11 @@
 					   ctxt->node, prefix, nsret, val);
         }
 #endif /* LIBXML_VALID_ENABLED */
-	if (name != NULL)
-	    xmlFree(name);
-	if (nval != NULL)
-	    xmlFree(nval);
 	if (val != value)
 	    xmlFree(val);
 	return;
     }
-    if ((!ctxt->html) &&
-	(ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
+    if ((ns != NULL) && (ns[0] == 'x') && (ns[1] == 'm') && (ns[2] == 'l') &&
         (ns[3] == 'n') && (ns[4] == 's') && (ns[5] == 0)) {
 	xmlNsPtr nsret;
 	xmlChar *val;
@@ -1116,10 +1041,6 @@
 	    if (val == NULL) {
 	        xmlSAX2ErrMemory(ctxt);
 	        xmlFree(ns);
-		if (name != NULL)
-		    xmlFree(name);
-                if (nval != NULL)
-                    xmlFree(nval);
 		return;
 	    }
 	} else {
@@ -1165,10 +1086,6 @@
 					   ctxt->node, prefix, nsret, value);
         }
 #endif /* LIBXML_VALID_ENABLED */
-	if (name != NULL)
-	    xmlFree(name);
-	if (nval != NULL)
-	    xmlFree(nval);
 	if (val != value)
 	    xmlFree(val);
 	return;
@@ -1199,8 +1116,6 @@
                                    name, NULL, NULL, 0,
                                    "Attribute %s in %s redefined\n",
                                    name, namespace->href);
-                        if (name != NULL)
-                            xmlFree(name);
                         goto error;
                     }
                 }
@@ -1212,13 +1127,13 @@
     }
 
     /* !!!!!! <a toto:arg="" xmlns:toto="http://toto.com"> */
-    ret = xmlNewNsPropEatName(ctxt->node, namespace, name, NULL);
+    ret = xmlNewNsProp(ctxt->node, namespace, name, NULL);
     if (ret == NULL) {
         xmlSAX2ErrMemory(ctxt);
         goto error;
     }
 
-    if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
+    if (ctxt->replaceEntities == 0) {
         if (xmlNodeParseContent((xmlNodePtr) ret, value, INT_MAX) < 0)
             xmlSAX2ErrMemory(ctxt);
     } else if (value != NULL) {
@@ -1232,7 +1147,7 @@
     }
 
 #ifdef LIBXML_VALID_ENABLED
-    if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&
+    if (ctxt->validate && ctxt->wellFormed &&
         ctxt->myDoc && ctxt->myDoc->intSubset) {
 
 	/*
@@ -1310,8 +1225,6 @@
     }
 
 error:
-    if (nval != NULL)
-	xmlFree(nval);
     if (ns != NULL)
 	xmlFree(ns);
 }
@@ -1320,6 +1233,8 @@
  * xmlCheckDefaultedAttributes:
  *
  * Check defaulted attributes from the DTD
+ *
+ * Deprecated SAX1 interface.
  */
 static void
 xmlCheckDefaultedAttributes(xmlParserCtxtPtr ctxt, const xmlChar *name,
@@ -1452,8 +1367,8 @@
 			    }
 			}
 			if (att == NULL) {
-			    xmlSAX2AttributeInternal(ctxt, fulln,
-						 attr->defaultValue, prefix);
+			    xmlSAX1Attribute(ctxt, fulln,
+					     attr->defaultValue, prefix);
 			}
 			if ((fulln != fn) && (fulln != attr->name))
 			    xmlFree(fulln);
@@ -1472,25 +1387,27 @@
 }
 
 /**
- * xmlSAX2StartElement:
+ * xmlSAX1StartElement:
  * @ctx: the user data (XML parser context)
  * @fullname:  The element name, including namespace prefix
  * @atts:  An array of name/value attributes pairs, NULL terminated
  *
  * called when an opening tag has been processed.
+ *
+ * Deprecated SAX1 interface.
  */
-void
-xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
+static void
+xmlSAX1StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts)
 {
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
     xmlNodePtr ret;
     xmlNodePtr parent;
     xmlNsPtr ns;
-    xmlChar *name;
+    const xmlChar *name;
     xmlChar *prefix;
     const xmlChar *att;
     const xmlChar *value;
-    int i;
+    int i, res;
 
     if ((ctx == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL)) return;
 
@@ -1508,18 +1425,13 @@
 	ctxt->validate = 0;
     }
 
-    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);
-        if (name == NULL) {
-            xmlSAX2ErrMemory(ctxt);
-            return;
-        }
+    /*
+     * Split the full name into a namespace prefix and the tag name
+     */
+    name = xmlSplitQName4(fullname, &prefix);
+    if (name == NULL) {
+        xmlSAX2ErrMemory(ctxt);
+        return;
     }
 
     /*
@@ -1527,7 +1439,7 @@
      *        attributes parsing, since local namespace can be defined as
      *        an attribute at this level.
      */
-    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, name, NULL);
+    ret = xmlNewDocNode(ctxt->myDoc, NULL, name, NULL);
     if (ret == NULL) {
 	xmlFree(prefix);
 	xmlSAX2ErrMemory(ctxt);
@@ -1556,64 +1468,60 @@
         return;
     }
 
-    if (!ctxt->html) {
-        int res;
+    /*
+     * Insert all the defaulted attributes from the DTD especially
+     * namespaces
+     */
+    if ((ctxt->myDoc->intSubset != NULL) ||
+        (ctxt->myDoc->extSubset != NULL)) {
+        xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
+    }
 
-        /*
-         * Insert all the defaulted attributes from the DTD especially
-         * namespaces
-         */
-        if ((ctxt->myDoc->intSubset != NULL) ||
-            (ctxt->myDoc->extSubset != NULL)) {
-            xmlCheckDefaultedAttributes(ctxt, name, prefix, atts);
-        }
+    /*
+     * process all the attributes whose name start with "xmlns"
+     */
+    if (atts != NULL) {
+        i = 0;
+        att = atts[i++];
+        value = atts[i++];
+        while ((att != NULL) && (value != NULL)) {
+            if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
+                (att[3] == 'n') && (att[4] == 's'))
+                xmlSAX1Attribute(ctxt, att, value, prefix);
 
-        /*
-         * process all the attributes whose name start with "xmlns"
-         */
-        if (atts != NULL) {
-            i = 0;
             att = atts[i++];
             value = atts[i++];
-	    while ((att != NULL) && (value != NULL)) {
-		if ((att[0] == 'x') && (att[1] == 'm') && (att[2] == 'l') &&
-		    (att[3] == 'n') && (att[4] == 's'))
-		    xmlSAX2AttributeInternal(ctxt, att, value, prefix);
-
-		att = atts[i++];
-		value = atts[i++];
-	    }
         }
+    }
 
-        /*
-         * Search the namespace, note that since the attributes have been
-         * processed, the local namespaces are available.
-         */
-        res = xmlSearchNsSafe(ret, prefix, &ns);
+    /*
+     * Search the namespace, note that since the attributes have been
+     * processed, the local namespaces are available.
+     */
+    res = xmlSearchNsSafe(ret, prefix, &ns);
+    if (res < 0)
+        xmlSAX2ErrMemory(ctxt);
+    if ((ns == NULL) && (parent != NULL)) {
+        res = xmlSearchNsSafe(parent, prefix, &ns);
         if (res < 0)
             xmlSAX2ErrMemory(ctxt);
-        if ((ns == NULL) && (parent != NULL)) {
-            res = xmlSearchNsSafe(parent, prefix, &ns);
-            if (res < 0)
-                xmlSAX2ErrMemory(ctxt);
-        }
-        if ((prefix != NULL) && (ns == NULL)) {
-            xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
-                         "Namespace prefix %s is not defined\n",
-                         prefix, NULL);
-            ns = xmlNewNs(ret, NULL, prefix);
-            if (ns == NULL)
-                xmlSAX2ErrMemory(ctxt);
-        }
-
-        /*
-         * set the namespace node, making sure that if the default namespace
-         * is unbound on a parent we simply keep it NULL
-         */
-        if ((ns != NULL) && (ns->href != NULL) &&
-            ((ns->href[0] != 0) || (ns->prefix != NULL)))
-            xmlSetNs(ret, ns);
     }
+    if ((prefix != NULL) && (ns == NULL)) {
+        xmlNsWarnMsg(ctxt, XML_NS_ERR_UNDEFINED_NAMESPACE,
+                     "Namespace prefix %s is not defined\n",
+                     prefix, NULL);
+        ns = xmlNewNs(ret, NULL, prefix);
+        if (ns == NULL)
+            xmlSAX2ErrMemory(ctxt);
+    }
+
+    /*
+     * set the namespace node, making sure that if the default namespace
+     * is unbound on a parent we simply keep it NULL
+     */
+    if ((ns != NULL) && (ns->href != NULL) &&
+        ((ns->href[0] != 0) || (ns->prefix != NULL)))
+        xmlSetNs(ret, ns);
 
     /*
      * process all the other attributes
@@ -1622,25 +1530,17 @@
         i = 0;
 	att = atts[i++];
 	value = atts[i++];
-	if (ctxt->html) {
-	    while (att != NULL) {
-		xmlSAX2AttributeInternal(ctxt, att, value, NULL);
-		att = atts[i++];
-		value = atts[i++];
-	    }
-	} else {
-	    while ((att != NULL) && (value != NULL)) {
-		if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
-		    (att[3] != 'n') || (att[4] != 's'))
-		    xmlSAX2AttributeInternal(ctxt, att, value, NULL);
+        while ((att != NULL) && (value != NULL)) {
+            if ((att[0] != 'x') || (att[1] != 'm') || (att[2] != 'l') ||
+                (att[3] != 'n') || (att[4] != 's'))
+                xmlSAX1Attribute(ctxt, att, value, NULL);
 
-		/*
-		 * Next ones
-		 */
-		att = atts[i++];
-		value = atts[i++];
-	    }
-	}
+            /*
+             * Next ones
+             */
+            att = atts[i++];
+            value = atts[i++];
+        }
     }
 
 #ifdef LIBXML_VALID_ENABLED
@@ -1666,37 +1566,187 @@
 	xmlFree(prefix);
 
 }
+#endif /* LIBXML_SAX1_ENABLED */
+
+#ifdef LIBXML_HTML_ENABLED
+static void
+xmlSAX2HtmlAttribute(xmlParserCtxtPtr ctxt, const xmlChar *fullname,
+                     const xmlChar *value) {
+    xmlAttrPtr ret;
+    xmlChar *nval = NULL;
+
+    ret = xmlNewNsProp(ctxt->node, NULL, fullname, NULL);
+    if (ret == NULL) {
+        xmlSAX2ErrMemory(ctxt);
+        return;
+    }
+
+    if ((value == NULL) && (htmlIsBooleanAttr(fullname))) {
+        nval = xmlStrdup(fullname);
+        if (nval == NULL) {
+            xmlSAX2ErrMemory(ctxt);
+            return;
+        }
+        value = nval;
+    }
+
+    if (value != NULL) {
+        ret->children = xmlNewDocText(ctxt->myDoc, value);
+        if (ret->children == NULL) {
+            xmlSAX2ErrMemory(ctxt);
+        } else {
+            ret->last = ret->children;
+            ret->children->parent = (xmlNodePtr) ret;
+        }
+    }
+
+    if (((ctxt->loadsubset & XML_SKIP_IDS) == 0) &&
+        /*
+         * Don't create IDs containing entity references (should
+         * be always the case with HTML)
+         */
+        (ret->children != NULL) &&
+        (ret->children->type == XML_TEXT_NODE) &&
+        (ret->children->next == NULL)) {
+        int res = xmlIsID(ctxt->myDoc, ctxt->node, ret);
+
+        if (res < 0)
+            xmlCtxtErrMemory(ctxt);
+        else if (res > 0)
+            xmlAddID(&ctxt->vctxt, ctxt->myDoc, ret->children->content, ret);
+    }
+
+    if (nval != NULL)
+        xmlFree(nval);
+}
+
+/**
+ * xmlSAX2StartHtmlElement:
+ * @ctxt:  parser context
+ * @fullname:  The element name, including namespace prefix
+ * @atts:  An array of name/value attributes pairs, NULL terminated
+ *
+ * Called when an opening tag has been processed.
+ */
+static void
+xmlSAX2StartHtmlElement(xmlParserCtxtPtr ctxt, const xmlChar *fullname,
+                        const xmlChar **atts) {
+    xmlNodePtr ret;
+    xmlNodePtr parent;
+    const xmlChar *att;
+    const xmlChar *value;
+    int i;
+
+    ret = xmlNewDocNode(ctxt->myDoc, NULL, fullname, NULL);
+    if (ret == NULL) {
+	xmlSAX2ErrMemory(ctxt);
+        return;
+    }
+    ctxt->nodemem = -1;
+
+    /* Initialize parent before pushing node */
+    parent = ctxt->node;
+    if (parent == NULL)
+        parent = (xmlNodePtr) ctxt->myDoc;
+
+    /*
+     * Link the child element
+     */
+    xmlSAX2AppendChild(ctxt, ret);
+
+    /*
+     * We are parsing a new node.
+     */
+    if (nodePush(ctxt, ret) < 0) {
+        xmlUnlinkNode(ret);
+        xmlFreeNode(ret);
+        return;
+    }
+
+    if (atts != NULL) {
+        i = 0;
+	att = atts[i++];
+	value = atts[i++];
+        while (att != NULL) {
+            xmlSAX2HtmlAttribute(ctxt, att, value);
+            att = atts[i++];
+            value = atts[i++];
+        }
+    }
+}
+#endif /* LIBXML_HTML_ENABLED */
+
+/**
+ * xmlSAX2StartElement:
+ * @ctx: the user data (XML parser context)
+ * @fullname:  The element name, including namespace prefix
+ * @atts:  An array of name/value attributes pairs, NULL terminated
+ *
+ * DEPRECATED: Don't call this function directly.
+ *
+ * Called when an opening tag has been processed.
+ *
+ * Used for HTML and SAX1.
+ */
+void
+xmlSAX2StartElement(void *ctx, const xmlChar *fullname, const xmlChar **atts) {
+    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
+
+    (void) atts;
+
+    if ((ctxt == NULL) || (fullname == NULL) || (ctxt->myDoc == NULL))
+        return;
+
+#ifdef LIBXML_SAX1_ENABLED
+    if (!ctxt->html) {
+        xmlSAX1StartElement(ctxt, fullname, atts);
+        return;
+    }
+#endif
+
+#ifdef LIBXML_HTML_ENABLED
+    if (ctxt->html) {
+        xmlSAX2StartHtmlElement(ctxt, fullname, atts);
+        return;
+    }
+#endif
+}
 
 /**
  * xmlSAX2EndElement:
  * @ctx: the user data (XML parser context)
  * @name:  The element name
  *
+ * DEPRECATED: Don't call this function directly.
+ *
  * called when the end of an element has been detected.
+ *
+ * Used for HTML and SAX1.
  */
 void
 xmlSAX2EndElement(void *ctx, const xmlChar *name ATTRIBUTE_UNUSED)
 {
     xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
 
-    if (ctx == NULL) return;
+    if (ctxt == NULL)
+        return;
 
-    ctxt->nodemem = -1;
-
-#ifdef LIBXML_VALID_ENABLED
-    if (ctxt->validate && ctxt->wellFormed &&
+#if defined(LIBXML_SAX1_ENABLED) && defined(LIBXML_VALID_ENABLED)
+    if (!ctxt->html && ctxt->validate && ctxt->wellFormed &&
         ctxt->myDoc && ctxt->myDoc->intSubset)
         ctxt->valid &= xmlValidateOneElement(&ctxt->vctxt, ctxt->myDoc,
 					     ctxt->node);
 #endif /* LIBXML_VALID_ENABLED */
 
+#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
+    ctxt->nodemem = -1;
 
     /*
      * end of parsing of this node.
      */
     nodePop(ctxt);
+#endif
 }
-#endif /* LIBXML_SAX1_ENABLED || LIBXML_HTML_ENABLED || LIBXML_LEGACY_ENABLED */
 
 /*
  * xmlSAX2TextNode:
@@ -1732,7 +1782,7 @@
      * intern the formatting blanks found between tags, or the
      * very short strings
      */
-    if (ctxt->dictNames) {
+    if ((!ctxt->html) && (ctxt->dictNames)) {
         xmlChar cur = str[len];
 
 	if ((len < (int) (2 * sizeof(void *))) &&
@@ -1779,7 +1829,7 @@
     } else
 	ret->content = (xmlChar *) intern;
 
-    if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
+    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
 	xmlRegisterNodeDefaultValue(ret);
     return(ret);
 }
@@ -1895,7 +1945,7 @@
             xmlSAX2ErrMemory(ctxt);
     }
 
-    if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
+    if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
         xmlRegisterNodeDefaultValue((xmlNodePtr)ret);
 
     if ((ctxt->replaceEntities == 0) && (!ctxt->html)) {
@@ -2088,12 +2138,14 @@
     /*
      * First check on validity:
      */
-    if (ctxt->validate && (ctxt->myDoc->extSubset == NULL) &&
-        ((ctxt->myDoc->intSubset == NULL) ||
-	 ((ctxt->myDoc->intSubset->notations == NULL) &&
-	  (ctxt->myDoc->intSubset->elements == NULL) &&
-	  (ctxt->myDoc->intSubset->attributes == NULL) &&
-	  (ctxt->myDoc->intSubset->entities == NULL)))) {
+    if (ctxt->validate &&
+        ((ctxt->myDoc == NULL) ||
+         ((ctxt->myDoc->extSubset == NULL) &&
+          ((ctxt->myDoc->intSubset == NULL) ||
+	   ((ctxt->myDoc->intSubset->notations == NULL) &&
+	    (ctxt->myDoc->intSubset->elements == NULL) &&
+	    (ctxt->myDoc->intSubset->attributes == NULL) &&
+	    (ctxt->myDoc->intSubset->entities == NULL)))))) {
 	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 	  "Validation failed: no DTD found !", NULL, NULL);
 	ctxt->validate = 0;
@@ -2144,7 +2196,7 @@
 		return;
 	    }
 	}
-	if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
+	if ((xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue))
 	    xmlRegisterNodeDefaultValue(ret);
     } else {
 	if (ctxt->dictNames)
@@ -2153,8 +2205,7 @@
 	else if (lname == NULL)
 	    ret = xmlNewDocNode(ctxt->myDoc, NULL, localname, NULL);
 	else
-	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL,
-	                               (xmlChar *) lname, NULL);
+	    ret = xmlNewDocNodeEatName(ctxt->myDoc, NULL, lname, NULL);
 	if (ret == NULL) {
 	    xmlSAX2ErrMemory(ctxt);
 	    return;
@@ -2431,9 +2482,9 @@
     } else {
 	int coalesceText = (lastChild != NULL) &&
 	    (lastChild->type == type) &&
-	    ((type != XML_TEXT_NODE) ||
+	    (((ctxt->html) && (type != XML_TEXT_NODE)) ||
              (lastChild->name == xmlStringText));
-	if ((coalesceText) && (ctxt->nodemem != 0)) {
+	if ((coalesceText) && (ctxt->nodemem > 0)) {
             int maxLength = (ctxt->options & XML_PARSE_HUGE) ?
                             XML_MAX_HUGE_LENGTH :
                             XML_MAX_TEXT_LENGTH;
@@ -2518,7 +2569,7 @@
         else {
             lastChild->line = USHRT_MAX;
             if (ctxt->options & XML_PARSE_BIG_LINES)
-                lastChild->psvi = (void *) (ptrdiff_t) ctxt->input->line;
+                lastChild->psvi = XML_INT_TO_PTR(ctxt->input->line);
         }
     }
 }
@@ -2615,32 +2666,23 @@
     xmlSAX2Text((xmlParserCtxtPtr) ctx, value, len, XML_CDATA_SECTION_NODE);
 }
 
-static int xmlSAX2DefaultVersionValue = 2;
-
 #ifdef LIBXML_SAX1_ENABLED
 /**
  * xmlSAXDefaultVersion:
- * @version:  the version, 1 or 2
+ * @version:  the version, must be 2
  *
  * DEPRECATED: Use parser option XML_PARSE_SAX1.
  *
- * Set the default version of SAX used globally by the library.
- * By default, during initialization the default is set to 2.
- * Note that it is generally a better coding style to use
- * xmlSAXVersion() to set up the version explicitly for a given
- * parsing context.
+ * Has no effect.
  *
- * Returns the previous value in case of success and -1 in case of error.
+ * Returns 2 in case of success and -1 in case of error.
  */
 int
 xmlSAXDefaultVersion(int version)
 {
-    int ret = xmlSAX2DefaultVersionValue;
-
-    if ((version != 1) && (version != 2))
+    if (version != 2)
         return(-1);
-    xmlSAX2DefaultVersionValue = version;
-    return(ret);
+    return(2);
 }
 #endif /* LIBXML_SAX1_ENABLED */
 
@@ -2717,11 +2759,9 @@
     if ((hdlr == NULL) || (hdlr->initialized != 0))
 	return;
 
-    xmlSAXVersion(hdlr, xmlSAX2DefaultVersionValue);
+    xmlSAXVersion(hdlr, 2);
     if (warning == 0)
 	hdlr->warning = NULL;
-    else
-	hdlr->warning = xmlParserWarning;
 }
 
 /**
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..7243b12
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+2.14.2
diff --git a/autogen.sh b/autogen.sh
index 4cd43fe..98881a0 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -64,8 +64,7 @@
         mkdir $srcdir/m4
 fi
 
-# Replaced by autoreconf below
-autoreconf -if -Wall || exit 1
+aclocal
 
 if ! grep -q pkg.m4 aclocal.m4; then
     cat <<EOF
@@ -76,6 +75,8 @@
     exit 1
 fi
 
+autoreconf -if -Wall || exit 1
+
 cd $THEDIR
 
 if test x$OBJ_DIR != x; then
diff --git a/buf.c b/buf.c
index f9f59b2..f24a819 100644
--- a/buf.c
+++ b/buf.c
@@ -15,16 +15,13 @@
 #define IN_LIBXML
 #include "libxml.h"
 
-#include <string.h> /* for memset() only ! */
+#include <string.h>
 #include <limits.h>
-#include <ctype.h>
-#include <stdlib.h>
 
+#include <libxml/parser.h>
 #include <libxml/tree.h>
-#include <libxml/parserInternals.h> /* for XML_MAX_TEXT_LENGTH */
 
 #include "private/buf.h"
-#include "private/error.h"
 
 #ifndef SIZE_MAX
 #define SIZE_MAX ((size_t) -1)
@@ -32,6 +29,13 @@
 
 #define WITH_BUFFER_COMPAT
 
+#define BUF_FLAG_OOM        (1u << 0)
+#define BUF_FLAG_OVERFLOW   (1u << 1)
+#define BUF_FLAG_STATIC     (1u << 2)
+
+#define BUF_ERROR(buf) ((buf)->flags & (BUF_FLAG_OOM | BUF_FLAG_OVERFLOW))
+#define BUF_STATIC(buf) ((buf)->flags & BUF_FLAG_STATIC)
+
 /**
  * xmlBuf:
  *
@@ -42,14 +46,15 @@
 
 struct _xmlBuf {
     xmlChar *content;		/* The buffer content UTF8 */
+#ifdef WITH_BUFFER_COMPAT
     unsigned int compat_use;    /* for binary compatibility */
     unsigned int compat_size;   /* for binary compatibility */
-    xmlBufferAllocationScheme alloc; /* The realloc method */
-    xmlChar *contentIO;		/* in IO mode we may have a different base */
+#endif
+    xmlChar *mem;		/* Start of the allocation */
     size_t use;		        /* The buffer size used */
-    size_t size;		/* The buffer size */
-    xmlBufferPtr buffer;        /* wrapper for an old buffer */
-    int error;                  /* an error code if a failure occurred */
+    size_t size;		/* The buffer size, excluding terminating 0 */
+    size_t maxSize;             /* The maximum buffer size */
+    unsigned flags;             /* flags */
 };
 
 #ifdef WITH_BUFFER_COMPAT
@@ -91,8 +96,8 @@
 static void
 xmlBufMemoryError(xmlBufPtr buf)
 {
-    if (buf->error == 0)
-        buf->error = XML_ERR_NO_MEMORY;
+    if (!BUF_ERROR(buf))
+        buf->flags |= BUF_FLAG_OOM;
 }
 
 /**
@@ -105,72 +110,96 @@
 static void
 xmlBufOverflowError(xmlBufPtr buf)
 {
-    if (buf->error == 0)
-        buf->error = XML_BUF_OVERFLOW;
+    if (!BUF_ERROR(buf))
+        buf->flags |= BUF_FLAG_OVERFLOW;
 }
 
-
 /**
  * xmlBufCreate:
- *
- * routine to create an XML buffer.
- * returns the new structure.
- */
-xmlBufPtr
-xmlBufCreate(void) {
-    xmlBufPtr ret;
-
-    ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf));
-    if (ret == NULL)
-        return(NULL);
-    ret->use = 0;
-    ret->error = 0;
-    ret->buffer = NULL;
-    ret->size = xmlDefaultBufferSize;
-    UPDATE_COMPAT(ret);
-    ret->alloc = xmlBufferAllocScheme;
-    ret->content = (xmlChar *) xmlMallocAtomic(ret->size);
-    if (ret->content == NULL) {
-	xmlFree(ret);
-        return(NULL);
-    }
-    ret->content[0] = 0;
-    ret->contentIO = NULL;
-    return(ret);
-}
-
-/**
- * xmlBufCreateSize:
  * @size: initial size of buffer
  *
  * routine to create an XML buffer.
  * returns the new structure.
  */
 xmlBufPtr
-xmlBufCreateSize(size_t size) {
+xmlBufCreate(size_t size) {
     xmlBufPtr ret;
 
     if (size == SIZE_MAX)
         return(NULL);
-    ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf));
+
+    ret = xmlMalloc(sizeof(*ret));
     if (ret == NULL)
         return(NULL);
+
     ret->use = 0;
-    ret->error = 0;
-    ret->buffer = NULL;
-    ret->alloc = xmlBufferAllocScheme;
-    ret->size = (size ? size + 1 : 0);         /* +1 for ending null */
+    ret->flags = 0;
+    ret->size = size;
+    ret->maxSize = SIZE_MAX - 1;
+
+    ret->mem = xmlMalloc(ret->size + 1);
+    if (ret->mem == NULL) {
+        xmlFree(ret);
+        return(NULL);
+    }
+    ret->content = ret->mem;
+    ret->content[0] = 0;
+
     UPDATE_COMPAT(ret);
-    if (ret->size){
-        ret->content = (xmlChar *) xmlMallocAtomic(ret->size);
-        if (ret->content == NULL) {
+    return(ret);
+}
+
+/**
+ * xmlBufCreateMem:
+ * @mem:  a memory area
+ * @size:  size of the buffer excluding terminator
+ * @isStatic:  whether the memory area is static
+ *
+ * Create a buffer initialized with memory.
+ *
+ * If @isStatic is set, uses the memory area directly as backing store.
+ * The memory must be zero-terminated and not be modified for the
+ * lifetime of the buffer. A static buffer can't be grown, modified or
+ * detached, but it can be shrunk.
+ *
+ * Returns a new buffer.
+ */
+xmlBufPtr
+xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic) {
+    xmlBufPtr ret;
+
+    if (mem == NULL)
+        return(NULL);
+
+    ret = xmlMalloc(sizeof(*ret));
+    if (ret == NULL)
+        return(NULL);
+
+    if (isStatic) {
+        /* Check that memory is zero-terminated */
+        if (mem[size] != 0) {
             xmlFree(ret);
             return(NULL);
         }
-        ret->content[0] = 0;
-    } else
-	ret->content = NULL;
-    ret->contentIO = NULL;
+        ret->flags = BUF_FLAG_STATIC;
+        ret->mem = (xmlChar *) mem;
+    } else {
+        ret->flags = 0;
+        ret->mem = xmlMalloc(size + 1);
+        if (ret->mem == NULL) {
+            xmlFree(ret);
+            return(NULL);
+        }
+        memcpy(ret->mem, mem, size);
+        ret->mem[size] = 0;
+    }
+
+    ret->use = size;
+    ret->size = size;
+    ret->maxSize = SIZE_MAX - 1;
+    ret->content = ret->mem;
+
+    UPDATE_COMPAT(ret);
     return(ret);
 }
 
@@ -188,84 +217,26 @@
 xmlBufDetach(xmlBufPtr buf) {
     xmlChar *ret;
 
-    if (buf == NULL)
-        return(NULL);
-    if (buf->buffer != NULL)
-        return(NULL);
-    if (buf->error)
+    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
         return(NULL);
 
-    if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
-        (buf->content != buf->contentIO)) {
+    if (buf->content != buf->mem) {
         ret = xmlStrndup(buf->content, buf->use);
-        xmlFree(buf->contentIO);
+        xmlFree(buf->mem);
     } else {
-        ret = buf->content;
+        ret = buf->mem;
     }
 
     buf->content = NULL;
-    buf->contentIO = NULL;
+    buf->mem = NULL;
     buf->size = 0;
     buf->use = 0;
+
     UPDATE_COMPAT(buf);
-
     return ret;
 }
 
 /**
- * xmlBufGetAllocationScheme:
- * @buf:  the buffer
- *
- * Get the buffer allocation scheme
- *
- * Returns the scheme or -1 in case of error
- */
-int
-xmlBufGetAllocationScheme(xmlBufPtr buf) {
-    if (buf == NULL) {
-        return(-1);
-    }
-    return(buf->alloc);
-}
-
-/**
- * xmlBufSetAllocationScheme:
- * @buf:  the buffer to tune
- * @scheme:  allocation scheme to use
- *
- * Sets the allocation scheme for this buffer
- *
- * returns 0 in case of success and -1 in case of failure
- */
-int
-xmlBufSetAllocationScheme(xmlBufPtr buf,
-                          xmlBufferAllocationScheme scheme) {
-    if ((buf == NULL) || (buf->error != 0)) {
-        return(-1);
-    }
-    if (buf->alloc == XML_BUFFER_ALLOC_IO)
-        return(-1);
-    if ((scheme == XML_BUFFER_ALLOC_DOUBLEIT) ||
-        (scheme == XML_BUFFER_ALLOC_EXACT) ||
-        (scheme == XML_BUFFER_ALLOC_HYBRID) ||
-	(scheme == XML_BUFFER_ALLOC_BOUNDED)) {
-	buf->alloc = scheme;
-        if (buf->buffer)
-            buf->buffer->alloc = scheme;
-        return(0);
-    }
-    /*
-     * Switching a buffer ALLOC_IO has the side effect of initializing
-     * the contentIO field with the current content
-     */
-    if (scheme == XML_BUFFER_ALLOC_IO) {
-        buf->alloc = XML_BUFFER_ALLOC_IO;
-        buf->contentIO = buf->content;
-    }
-    return(-1);
-}
-
-/**
  * xmlBufFree:
  * @buf:  the buffer to free
  *
@@ -274,16 +245,11 @@
  */
 void
 xmlBufFree(xmlBufPtr buf) {
-    if (buf == NULL) {
+    if (buf == NULL)
 	return;
-    }
 
-    if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
-        (buf->contentIO != NULL)) {
-        xmlFree(buf->contentIO);
-    } else if (buf->content != NULL) {
-        xmlFree(buf->content);
-    }
+    if (!BUF_STATIC(buf))
+        xmlFree(buf->mem);
     xmlFree(buf);
 }
 
@@ -295,20 +261,17 @@
  */
 void
 xmlBufEmpty(xmlBufPtr buf) {
-    if ((buf == NULL) || (buf->error != 0)) return;
-    if (buf->content == NULL) return;
+    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
+        return;
+    if (buf->mem == NULL)
+        return;
     CHECK_COMPAT(buf)
-    buf->use = 0;
-    if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
-               (buf->contentIO != NULL)) {
-        size_t start_buf = buf->content - buf->contentIO;
 
-	buf->size += start_buf;
-        buf->content = buf->contentIO;
-        buf->content[0] = 0;
-    } else {
-        buf->content[0] = 0;
-    }
+    buf->use = 0;
+    buf->size += buf->content - buf->mem;
+    buf->content = buf->mem;
+    buf->content[0] = 0;
+
     UPDATE_COMPAT(buf)
 }
 
@@ -317,6 +280,8 @@
  * @buf:  the buffer to dump
  * @len:  the number of xmlChar to remove
  *
+ * DEPRECATED: Don't use.
+ *
  * Remove the beginning of an XML buffer.
  * NOTE that this routine behaviour differs from xmlBufferShrink()
  * as it will return 0 on error instead of -1 due to size_t being
@@ -326,37 +291,19 @@
  */
 size_t
 xmlBufShrink(xmlBufPtr buf, size_t len) {
-    if ((buf == NULL) || (buf->error != 0)) return(0);
+    if ((buf == NULL) || (BUF_ERROR(buf)))
+        return(0);
+    if (len == 0)
+        return(0);
     CHECK_COMPAT(buf)
-    if (len == 0) return(0);
-    if (len > buf->use) return(0);
+
+    if (len > buf->use)
+        return(0);
 
     buf->use -= len;
-    if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
-	/*
-	 * we just move the content pointer, but also make sure
-	 * the perceived buffer size has shrunk accordingly
-	 */
-        buf->content += len;
-	buf->size -= len;
+    buf->content += len;
+    buf->size -= len;
 
-        /*
-	 * sometimes though it maybe be better to really shrink
-	 * on IO buffers
-	 */
-	if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
-	    size_t start_buf = buf->content - buf->contentIO;
-	    if (start_buf >= buf->size) {
-		memmove(buf->contentIO, &buf->content[0], buf->use);
-		buf->content = buf->contentIO;
-		buf->content[buf->use] = 0;
-		buf->size += start_buf;
-	    }
-	}
-    } else {
-	memmove(buf->content, &buf->content[len], buf->use);
-	buf->content[buf->use] = 0;
-    }
     UPDATE_COMPAT(buf)
     return(len);
 }
@@ -367,66 +314,65 @@
  * @len:  the minimum free size to allocate
  *
  * Grow the available space of an XML buffer, @len is the target value
- * Error checking should be done on buf->error since using the return
- * value doesn't work that well
  *
- * Returns 0 in case of error or the length made available otherwise
+ * Returns 0 on success, -1 in case of error
  */
-static size_t
+static int
 xmlBufGrowInternal(xmlBufPtr buf, size_t len) {
     size_t size;
+    size_t start;
     xmlChar *newbuf;
 
-    if ((buf == NULL) || (buf->error != 0)) return(0);
-    CHECK_COMPAT(buf)
-
-    if (len < buf->size - buf->use)
-        return(buf->size - buf->use - 1);
-    if (len >= SIZE_MAX - buf->use) {
-        xmlBufMemoryError(buf);
+    /*
+     * If there's enough space at the start of the buffer,
+     * move the contents.
+     */
+    start = buf->content - buf->mem;
+    if (len <= start + buf->size - buf->use) {
+        memmove(buf->mem, buf->content, buf->use + 1);
+        buf->size += start;
+        buf->content = buf->mem;
         return(0);
     }
 
+    if (len > buf->maxSize - buf->use) {
+        xmlBufOverflowError(buf);
+        return(-1);
+    }
+
     if (buf->size > (size_t) len) {
-        size = buf->size > SIZE_MAX / 2 ? SIZE_MAX : buf->size * 2;
+        if (buf->size <= buf->maxSize / 2)
+            size = buf->size * 2;
+        else
+            size = buf->maxSize;
     } else {
         size = buf->use + len;
-        size = size > SIZE_MAX - 100 ? SIZE_MAX : size + 100;
+        if (size <= buf->maxSize - 100)
+            size += 100;
     }
 
-    if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-        /*
-	 * Used to provide parsing limits
-	 */
-        if ((buf->use + len + 1 >= XML_MAX_TEXT_LENGTH) ||
-	    (buf->size >= XML_MAX_TEXT_LENGTH)) {
-	    xmlBufMemoryError(buf);
-	    return(0);
-	}
-	if (size >= XML_MAX_TEXT_LENGTH)
-	    size = XML_MAX_TEXT_LENGTH;
-    }
-    if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
-        size_t start_buf = buf->content - buf->contentIO;
-
-	newbuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + size);
-	if (newbuf == NULL) {
-	    xmlBufMemoryError(buf);
-	    return(0);
-	}
-	buf->contentIO = newbuf;
-	buf->content = newbuf + start_buf;
+    if (buf->content == buf->mem) {
+        newbuf = xmlRealloc(buf->mem, size + 1);
+        if (newbuf == NULL) {
+            xmlBufMemoryError(buf);
+            return(-1);
+        }
     } else {
-	newbuf = (xmlChar *) xmlRealloc(buf->content, size);
-	if (newbuf == NULL) {
-	    xmlBufMemoryError(buf);
-	    return(0);
-	}
-	buf->content = newbuf;
+        newbuf = xmlMalloc(size + 1);
+        if (newbuf == NULL) {
+            xmlBufMemoryError(buf);
+            return(-1);
+        }
+        if (buf->content != NULL)
+            memcpy(newbuf, buf->content, buf->use + 1);
+        xmlFree(buf->mem);
     }
+
+    buf->mem = newbuf;
+    buf->content = newbuf;
     buf->size = size;
-    UPDATE_COMPAT(buf)
-    return(buf->size - buf->use - 1);
+
+    return(0);
 }
 
 /**
@@ -437,44 +383,22 @@
  * Grow the available space of an XML buffer, @len is the target value
  * This is been kept compatible with xmlBufferGrow() as much as possible
  *
- * Returns -1 in case of error or the length made available otherwise
+ * Returns 0 on succes, -1 in case of error
  */
 int
-xmlBufGrow(xmlBufPtr buf, int len) {
-    size_t ret;
-
-    if ((buf == NULL) || (len < 0)) return(-1);
-    if (len == 0)
-        return(0);
-    ret = xmlBufGrowInternal(buf, len);
-    if (buf->error != 0)
+xmlBufGrow(xmlBufPtr buf, size_t len) {
+    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
         return(-1);
-    return(ret > INT_MAX ? INT_MAX : ret);
-}
-
-/**
- * xmlBufDump:
- * @file:  the file output
- * @buf:  the buffer to dump
- *
- * Dumps an XML buffer to  a FILE *.
- * Returns the number of #xmlChar written
- */
-size_t
-xmlBufDump(FILE *file, xmlBufPtr buf) {
-    size_t ret;
-
-    if ((buf == NULL) || (buf->error != 0)) {
-	return(0);
-    }
-    if (buf->content == NULL) {
-	return(0);
-    }
     CHECK_COMPAT(buf)
-    if (file == NULL)
-	file = stdout;
-    ret = fwrite(buf->content, 1, buf->use, file);
-    return(ret);
+
+    if (len <= buf->size - buf->use)
+        return(0);
+
+    if (xmlBufGrowInternal(buf, len) < 0)
+        return(-1);
+
+    UPDATE_COMPAT(buf)
+    return(0);
 }
 
 /**
@@ -489,7 +413,7 @@
 xmlChar *
 xmlBufContent(const xmlBuf *buf)
 {
-    if ((!buf) || (buf->error))
+    if ((!buf) || (BUF_ERROR(buf)))
         return NULL;
 
     return(buf->content);
@@ -507,7 +431,7 @@
 xmlChar *
 xmlBufEnd(xmlBufPtr buf)
 {
-    if ((!buf) || (buf->error))
+    if ((!buf) || (BUF_ERROR(buf)))
         return NULL;
     CHECK_COMPAT(buf)
 
@@ -527,10 +451,10 @@
  */
 int
 xmlBufAddLen(xmlBufPtr buf, size_t len) {
-    if ((buf == NULL) || (buf->error))
+    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
         return(-1);
     CHECK_COMPAT(buf)
-    if (len >= (buf->size - buf->use))
+    if (len > buf->size - buf->use)
         return(-1);
     buf->use += len;
     buf->content[buf->use] = 0;
@@ -539,25 +463,6 @@
 }
 
 /**
- * xmlBufLength:
- * @buf:  the buffer
- *
- * Function to get the length of a buffer
- *
- * Returns the length of data in the internal content
- */
-
-size_t
-xmlBufLength(const xmlBufPtr buf)
-{
-    if ((!buf) || (buf->error))
-        return 0;
-    CHECK_COMPAT(buf)
-
-    return(buf->use);
-}
-
-/**
  * xmlBufUse:
  * @buf:  the buffer
  *
@@ -569,7 +474,7 @@
 size_t
 xmlBufUse(const xmlBufPtr buf)
 {
-    if ((!buf) || (buf->error))
+    if ((!buf) || (BUF_ERROR(buf)))
         return 0;
     CHECK_COMPAT(buf)
 
@@ -591,11 +496,11 @@
 size_t
 xmlBufAvail(const xmlBufPtr buf)
 {
-    if ((!buf) || (buf->error))
+    if ((!buf) || (BUF_ERROR(buf)))
         return 0;
     CHECK_COMPAT(buf)
 
-    return((buf->size > buf->use) ? (buf->size - buf->use - 1) : 0);
+    return(buf->size - buf->use);
 }
 
 /**
@@ -609,7 +514,7 @@
 int
 xmlBufIsEmpty(const xmlBufPtr buf)
 {
-    if ((!buf) || (buf->error))
+    if ((!buf) || (BUF_ERROR(buf)))
         return(-1);
     CHECK_COMPAT(buf)
 
@@ -617,132 +522,6 @@
 }
 
 /**
- * xmlBufResize:
- * @buf:  the buffer to resize
- * @size:  the desired size
- *
- * Resize a buffer to accommodate minimum size of @size.
- *
- * Returns  0 in case of problems, 1 otherwise
- */
-int
-xmlBufResize(xmlBufPtr buf, size_t size)
-{
-    size_t newSize;
-    xmlChar* rebuf = NULL;
-    size_t start_buf;
-
-    if ((buf == NULL) || (buf->error))
-        return(0);
-    CHECK_COMPAT(buf)
-
-    if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-        /*
-	 * Used to provide parsing limits
-	 */
-        if (size >= XML_MAX_TEXT_LENGTH) {
-	    xmlBufMemoryError(buf);
-	    return(0);
-	}
-    }
-
-    /* Don't resize if we don't have to */
-    if (size < buf->size)
-        return 1;
-
-    /* figure out new size */
-    switch (buf->alloc){
-	case XML_BUFFER_ALLOC_IO:
-	case XML_BUFFER_ALLOC_DOUBLEIT:
-	    /*take care of empty case*/
-            if (buf->size == 0) {
-                newSize = (size > SIZE_MAX - 10 ? SIZE_MAX : size + 10);
-            } else {
-                newSize = buf->size;
-            }
-	    while (size > newSize) {
-	        if (newSize > SIZE_MAX / 2) {
-	            xmlBufMemoryError(buf);
-	            return 0;
-	        }
-	        newSize *= 2;
-	    }
-	    break;
-	case XML_BUFFER_ALLOC_EXACT:
-            newSize = (size > SIZE_MAX - 10 ? SIZE_MAX : size + 10);
-	    break;
-        case XML_BUFFER_ALLOC_HYBRID:
-            if (buf->use < BASE_BUFFER_SIZE)
-                newSize = size;
-            else {
-                newSize = buf->size;
-                while (size > newSize) {
-                    if (newSize > SIZE_MAX / 2) {
-                        xmlBufMemoryError(buf);
-                        return 0;
-                    }
-                    newSize *= 2;
-                }
-            }
-            break;
-
-	default:
-            newSize = (size > SIZE_MAX - 10 ? SIZE_MAX : size + 10);
-	    break;
-    }
-
-    if ((buf->alloc == XML_BUFFER_ALLOC_IO) && (buf->contentIO != NULL)) {
-        start_buf = buf->content - buf->contentIO;
-
-        if (start_buf > newSize) {
-	    /* move data back to start */
-	    memmove(buf->contentIO, buf->content, buf->use);
-	    buf->content = buf->contentIO;
-	    buf->content[buf->use] = 0;
-	    buf->size += start_buf;
-	} else {
-	    rebuf = (xmlChar *) xmlRealloc(buf->contentIO, start_buf + newSize);
-	    if (rebuf == NULL) {
-		xmlBufMemoryError(buf);
-		return 0;
-	    }
-	    buf->contentIO = rebuf;
-	    buf->content = rebuf + start_buf;
-	}
-    } else {
-	if (buf->content == NULL) {
-	    rebuf = (xmlChar *) xmlMallocAtomic(newSize);
-	    buf->use = 0;
-            if (rebuf != NULL)
-	        rebuf[buf->use] = 0;
-	} else if (buf->size - buf->use < 100) {
-	    rebuf = (xmlChar *) xmlRealloc(buf->content, newSize);
-        } else {
-	    /*
-	     * if we are reallocating a buffer far from being full, it's
-	     * better to make a new allocation and copy only the used range
-	     * and free the old one.
-	     */
-	    rebuf = (xmlChar *) xmlMallocAtomic(newSize);
-	    if (rebuf != NULL) {
-		memcpy(rebuf, buf->content, buf->use);
-		xmlFree(buf->content);
-		rebuf[buf->use] = 0;
-	    }
-	}
-	if (rebuf == NULL) {
-	    xmlBufMemoryError(buf);
-	    return 0;
-	}
-	buf->content = rebuf;
-    }
-    buf->size = newSize;
-    UPDATE_COMPAT(buf)
-
-    return 1;
-}
-
-/**
  * xmlBufAdd:
  * @buf:  the buffer to dump
  * @str:  the #xmlChar string
@@ -754,55 +533,32 @@
  * Returns 0 if successful, -1 in case of error.
  */
 int
-xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len) {
-    size_t needSize;
-
-    if ((str == NULL) || (buf == NULL) || (buf->error))
-	return -1;
+xmlBufAdd(xmlBufPtr buf, const xmlChar *str, size_t len) {
+    if ((buf == NULL) || (BUF_ERROR(buf)) || (BUF_STATIC(buf)))
+        return(-1);
+    if (len == 0)
+        return(0);
+    if (str == NULL)
+	return(-1);
     CHECK_COMPAT(buf)
 
-    if (len < -1) {
-	return -1;
-    }
-    if (len == 0) return 0;
-
-    if (len < 0)
-        len = xmlStrlen(str);
-
-    if (len < 0) return -1;
-    if (len == 0) return 0;
-
-    /* Note that both buf->size and buf->use can be zero here. */
-    if ((size_t) len >= buf->size - buf->use) {
-        if ((size_t) len >= SIZE_MAX - buf->use) {
-            xmlBufMemoryError(buf);
-            return(-1);
-        }
-        needSize = buf->use + len + 1;
-	if (buf->alloc == XML_BUFFER_ALLOC_BOUNDED) {
-	    /*
-	     * Used to provide parsing limits
-	     */
-	    if (needSize >= XML_MAX_TEXT_LENGTH) {
-		xmlBufMemoryError(buf);
-		return(-1);
-	    }
-	}
-        if (!xmlBufResize(buf, needSize))
+    if (len > buf->size - buf->use) {
+        if (xmlBufGrowInternal(buf, len) < 0)
             return(-1);
     }
 
     memmove(&buf->content[buf->use], str, len);
     buf->use += len;
     buf->content[buf->use] = 0;
+
     UPDATE_COMPAT(buf)
-    return 0;
+    return(0);
 }
 
 /**
  * xmlBufCat:
  * @buf:  the buffer to add to
- * @str:  the #xmlChar string
+ * @str:  the #xmlChar string (optional)
  *
  * Append a zero terminated string to an XML buffer.
  *
@@ -811,11 +567,9 @@
  */
 int
 xmlBufCat(xmlBufPtr buf, const xmlChar *str) {
-    if ((buf == NULL) || (buf->error))
-        return(-1);
-    CHECK_COMPAT(buf)
-    if (str == NULL) return -1;
-    return xmlBufAdd(buf, str, -1);
+    if (str == NULL)
+        return(0);
+    return(xmlBufAdd(buf, str, strlen((const char *) str)));
 }
 
 /**
@@ -836,25 +590,39 @@
     if (buffer == NULL)
         return(NULL);
 
-    ret = (xmlBufPtr) xmlMalloc(sizeof(xmlBuf));
-    if (ret == NULL) {
+    ret = xmlMalloc(sizeof(xmlBuf));
+    if (ret == NULL)
         return(NULL);
-    }
-    ret->use = buffer->use;
-    ret->size = buffer->size;
-    UPDATE_COMPAT(ret);
-    ret->error = 0;
-    ret->buffer = buffer;
-    ret->alloc = buffer->alloc;
-    ret->content = buffer->content;
-    ret->contentIO = buffer->contentIO;
 
+    ret->use = buffer->use;
+    ret->flags = 0;
+    ret->maxSize = SIZE_MAX - 1;
+
+    if (buffer->content == NULL) {
+        ret->size = 50;
+        ret->mem = xmlMalloc(ret->size + 1);
+        ret->content = ret->mem;
+        if (ret->mem == NULL)
+            xmlBufMemoryError(ret);
+        else
+            ret->content[0] = 0;
+    } else {
+        ret->size = buffer->size - 1;
+        ret->content = buffer->content;
+        if (buffer->alloc == XML_BUFFER_ALLOC_IO)
+            ret->mem = buffer->contentIO;
+        else
+            ret->mem = buffer->content;
+    }
+
+    UPDATE_COMPAT(ret);
     return(ret);
 }
 
 /**
  * xmlBufBackToBuffer:
  * @buf: new buffer wrapping the old one
+ * @ret: old buffer
  *
  * Function to be called once internal processing had been done to
  * update back the buffer provided by the user. This can lead to
@@ -862,59 +630,35 @@
  * than what an xmlBuffer can support on 64 bits (INT_MAX)
  * The xmlBufPtr @buf wrapper is deallocated by this call in any case.
  *
- * Returns the old xmlBufferPtr unless the call failed and NULL is returned
+ * Returns 0 on success, -1 on error.
  */
-xmlBufferPtr
-xmlBufBackToBuffer(xmlBufPtr buf) {
-    xmlBufferPtr ret;
+int
+xmlBufBackToBuffer(xmlBufPtr buf, xmlBufferPtr ret) {
+    if ((buf == NULL) || (ret == NULL))
+        return(-1);
 
-    if (buf == NULL)
-        return(NULL);
-    CHECK_COMPAT(buf)
-    ret = buf->buffer;
-
-    if ((buf->error) || (ret == NULL)) {
+    if ((BUF_ERROR(buf)) || (BUF_STATIC(buf)) ||
+        (buf->use >= INT_MAX)) {
         xmlBufFree(buf);
-        if (ret != NULL) {
-            ret->content = NULL;
-            ret->contentIO = NULL;
-            ret->use = 0;
-            ret->size = 0;
-        }
-        return(NULL);
+        ret->content = NULL;
+        ret->contentIO = NULL;
+        ret->use = 0;
+        ret->size = 0;
+        return(-1);
     }
 
-    /*
-     * What to do in case of error in the buffer ???
-     */
-    if (buf->use > INT_MAX) {
-        /*
-         * Worse case, we really allocated and used more than the
-         * maximum allowed memory for an xmlBuffer on this architecture.
-         * Keep the buffer but provide a truncated size value.
-         */
-        xmlBufOverflowError(buf);
-        ret->use = INT_MAX;
-        ret->size = INT_MAX;
-    } else if (buf->size > INT_MAX) {
-        /*
-         * milder case, we allocated more than the maximum allowed memory
-         * for an xmlBuffer on this architecture, but used less than the
-         * limit.
-         * Keep the buffer but provide a truncated size value.
-         */
-        xmlBufOverflowError(buf);
-        ret->use = buf->use;
+    ret->use = buf->use;
+    if (buf->size >= INT_MAX) {
+        /* Keep the buffer but provide a truncated size value. */
         ret->size = INT_MAX;
     } else {
-        ret->use = buf->use;
-        ret->size = buf->size;
+        ret->size = buf->size + 1;
     }
-    ret->alloc = buf->alloc;
+    ret->alloc = XML_BUFFER_ALLOC_IO;
     ret->content = buf->content;
-    ret->contentIO = buf->contentIO;
+    ret->contentIO = buf->mem;
     xmlFree(buf);
-    return(ret);
+    return(0);
 }
 
 /**
@@ -953,3 +697,580 @@
     return(0);
 }
 
+/************************************************************************
+ *									*
+ *			Old buffer implementation			*
+ *									*
+ ************************************************************************/
+
+/**
+ * xmlSetBufferAllocationScheme:
+ * @scheme:  allocation method to use
+ *
+ * DEPRECATED: Use xmlBufferSetAllocationScheme.
+ *
+ * Set the buffer allocation method.  Types are
+ * XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down
+ * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed,
+ *                             improves performance
+ */
+void
+xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme ATTRIBUTE_UNUSED) {
+}
+
+/**
+ * xmlGetBufferAllocationScheme:
+ *
+ * DEPRECATED: Use xmlBufferSetAllocationScheme.
+ *
+ * Types are
+ * XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down
+ * XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed,
+ *                             improves performance
+ * XML_BUFFER_ALLOC_HYBRID - use exact sizes on small strings to keep memory usage tight
+ *                            in normal usage, and doubleit on large strings to avoid
+ *                            pathological performance.
+ *
+ * Returns the current allocation scheme
+ */
+xmlBufferAllocationScheme
+xmlGetBufferAllocationScheme(void) {
+    return(XML_BUFFER_ALLOC_EXACT);
+}
+
+/**
+ * xmlBufferCreate:
+ *
+ * routine to create an XML buffer.
+ * returns the new structure.
+ */
+xmlBufferPtr
+xmlBufferCreate(void) {
+    xmlBufferPtr ret;
+
+    ret = xmlMalloc(sizeof(*ret));
+    if (ret == NULL)
+        return(NULL);
+
+    ret->use = 0;
+    ret->size = 256;
+    ret->alloc = XML_BUFFER_ALLOC_IO;
+    ret->contentIO = xmlMalloc(ret->size);
+    if (ret->contentIO == NULL) {
+	xmlFree(ret);
+        return(NULL);
+    }
+    ret->content = ret->contentIO;
+    ret->content[0] = 0;
+
+    return(ret);
+}
+
+/**
+ * xmlBufferCreateSize:
+ * @size: initial size of buffer
+ *
+ * routine to create an XML buffer.
+ * returns the new structure.
+ */
+xmlBufferPtr
+xmlBufferCreateSize(size_t size) {
+    xmlBufferPtr ret;
+
+    if (size >= INT_MAX)
+        return(NULL);
+
+    ret = xmlMalloc(sizeof(*ret));
+    if (ret == NULL)
+        return(NULL);
+
+    ret->use = 0;
+    ret->alloc = XML_BUFFER_ALLOC_IO;
+    ret->size = (size ? size + 1 : 0);         /* +1 for ending null */
+
+    if (ret->size) {
+        ret->contentIO = xmlMalloc(ret->size);
+        if (ret->contentIO == NULL) {
+            xmlFree(ret);
+            return(NULL);
+        }
+        ret->content = ret->contentIO;
+        ret->content[0] = 0;
+    } else {
+        ret->contentIO = NULL;
+	ret->content = NULL;
+    }
+
+    return(ret);
+}
+
+/**
+ * xmlBufferDetach:
+ * @buf:  the buffer
+ *
+ * Remove the string contained in a buffer and gie it back to the
+ * caller. The buffer is reset to an empty content.
+ * This doesn't work with immutable buffers as they can't be reset.
+ *
+ * Returns the previous string contained by the buffer.
+ */
+xmlChar *
+xmlBufferDetach(xmlBufferPtr buf) {
+    xmlChar *ret;
+
+    if (buf == NULL)
+        return(NULL);
+
+    if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
+        (buf->content != buf->contentIO)) {
+        ret = xmlStrndup(buf->content, buf->use);
+        xmlFree(buf->contentIO);
+    } else {
+        ret = buf->content;
+    }
+
+    buf->contentIO = NULL;
+    buf->content = NULL;
+    buf->size = 0;
+    buf->use = 0;
+
+    return ret;
+}
+
+/**
+ * xmlBufferCreateStatic:
+ * @mem: the memory area
+ * @size:  the size in byte
+ *
+ * Returns an XML buffer initialized with bytes.
+ */
+xmlBufferPtr
+xmlBufferCreateStatic(void *mem, size_t size) {
+    xmlBufferPtr buf = xmlBufferCreateSize(size);
+
+    xmlBufferAdd(buf, mem, size);
+    return(buf);
+}
+
+/**
+ * xmlBufferSetAllocationScheme:
+ * @buf:  the buffer to tune
+ * @scheme:  allocation scheme to use
+ *
+ * Sets the allocation scheme for this buffer.
+ *
+ * For libxml2 before 2.14, it is recommended to set this to
+ * XML_BUFFER_ALLOC_DOUBLE_IT. Has no effect on 2.14 or later.
+ */
+void
+xmlBufferSetAllocationScheme(xmlBufferPtr buf ATTRIBUTE_UNUSED,
+                             xmlBufferAllocationScheme scheme ATTRIBUTE_UNUSED) {
+}
+
+/**
+ * xmlBufferFree:
+ * @buf:  the buffer to free
+ *
+ * Frees an XML buffer. It frees both the content and the structure which
+ * encapsulate it.
+ */
+void
+xmlBufferFree(xmlBufferPtr buf) {
+    if (buf == NULL)
+	return;
+
+    if (buf->alloc == XML_BUFFER_ALLOC_IO)
+        xmlFree(buf->contentIO);
+    else
+        xmlFree(buf->content);
+
+    xmlFree(buf);
+}
+
+/**
+ * xmlBufferEmpty:
+ * @buf:  the buffer
+ *
+ * empty a buffer.
+ */
+void
+xmlBufferEmpty(xmlBufferPtr buf) {
+    if (buf == NULL)
+        return;
+    if (buf->content == NULL)
+        return;
+
+    buf->use = 0;
+
+    if (buf->alloc == XML_BUFFER_ALLOC_IO) {
+	buf->size += buf->content - buf->contentIO;
+        buf->content = buf->contentIO;
+        buf->content[0] = 0;
+    } else {
+        buf->content[0] = 0;
+    }
+}
+
+/**
+ * xmlBufferShrink:
+ * @buf:  the buffer to dump
+ * @len:  the number of xmlChar to remove
+ *
+ * DEPRECATED: Don't use.
+ *
+ * Remove the beginning of an XML buffer.
+ *
+ * Returns the number of #xmlChar removed, or -1 in case of failure.
+ */
+int
+xmlBufferShrink(xmlBufferPtr buf, unsigned int len) {
+    if (buf == NULL)
+        return(-1);
+    if (len == 0)
+        return(0);
+    if (len > buf->use)
+        return(-1);
+
+    buf->use -= len;
+
+    if (buf->alloc == XML_BUFFER_ALLOC_IO) {
+        buf->content += len;
+	buf->size -= len;
+    } else {
+	memmove(buf->content, &buf->content[len], buf->use + 1);
+    }
+
+    return(len);
+}
+
+/**
+ * xmlBufferGrow:
+ * @buf:  the buffer
+ * @len:  the minimum free size to allocate
+ *
+ * DEPRECATED: Don't use.
+ *
+ * Grow the available space of an XML buffer.
+ *
+ * Returns the new available space or -1 in case of error
+ */
+int
+xmlBufferGrow(xmlBufferPtr buf, unsigned int len) {
+    unsigned int size;
+    xmlChar *newbuf;
+
+    if (buf == NULL)
+        return(-1);
+
+    if (len < buf->size - buf->use)
+        return(0);
+    if (len >= INT_MAX - buf->use)
+        return(-1);
+
+    if (buf->size > (size_t) len) {
+        if (buf->size <= INT_MAX / 2)
+            size = buf->size * 2;
+        else
+            size = INT_MAX;
+    } else {
+        size = buf->use + len + 1;
+        if (size <= INT_MAX - 100)
+            size += 100;
+    }
+
+    if ((buf->alloc == XML_BUFFER_ALLOC_IO) &&
+        (buf->content != buf->contentIO)) {
+        newbuf = xmlMalloc(size);
+        if (newbuf == NULL)
+            return(-1);
+        if (buf->content != NULL)
+            memcpy(newbuf, buf->content, buf->use + 1);
+        xmlFree(buf->contentIO);
+    } else {
+        newbuf = xmlRealloc(buf->content, size);
+        if (newbuf == NULL)
+            return(-1);
+    }
+
+    if (buf->alloc == XML_BUFFER_ALLOC_IO)
+        buf->contentIO = newbuf;
+    buf->content = newbuf;
+    buf->size = size;
+
+    return(buf->size - buf->use - 1);
+}
+
+/**
+ * xmlBufferDump:
+ * @file:  the file output
+ * @buf:  the buffer to dump
+ *
+ * Dumps an XML buffer to  a FILE *.
+ * Returns the number of #xmlChar written
+ */
+int
+xmlBufferDump(FILE *file, xmlBufferPtr buf) {
+    size_t ret;
+
+    if (buf == NULL)
+	return(0);
+    if (buf->content == NULL)
+	return(0);
+    if (file == NULL)
+	file = stdout;
+    ret = fwrite(buf->content, 1, buf->use, file);
+    return(ret > INT_MAX ? INT_MAX : ret);
+}
+
+/**
+ * xmlBufferContent:
+ * @buf:  the buffer
+ *
+ * Function to extract the content of a buffer
+ *
+ * Returns the internal content
+ */
+
+const xmlChar *
+xmlBufferContent(const xmlBuffer *buf)
+{
+    if(!buf)
+        return NULL;
+
+    return buf->content;
+}
+
+/**
+ * xmlBufferLength:
+ * @buf:  the buffer
+ *
+ * Function to get the length of a buffer
+ *
+ * Returns the length of data in the internal content
+ */
+
+int
+xmlBufferLength(const xmlBuffer *buf)
+{
+    if(!buf)
+        return 0;
+
+    return buf->use;
+}
+
+/**
+ * xmlBufferResize:
+ * @buf:  the buffer to resize
+ * @size:  the desired size
+ *
+ * DEPRECATED: Don't use.
+
+ * Resize a buffer to accommodate minimum size of @size.
+ *
+ * Returns  0 in case of problems, 1 otherwise
+ */
+int
+xmlBufferResize(xmlBufferPtr buf, unsigned int size)
+{
+    int res;
+
+    if (buf == NULL)
+        return(0);
+    if (size < buf->size)
+        return(1);
+    res = xmlBufferGrow(buf, size - buf->use);
+
+    return(res < 0 ? 0 : 1);
+}
+
+/**
+ * xmlBufferAdd:
+ * @buf:  the buffer to dump
+ * @str:  the #xmlChar string
+ * @len:  the number of #xmlChar to add
+ *
+ * Add a string range to an XML buffer. if len == -1, the length of
+ * str is recomputed.
+ *
+ * Returns a xmlParserErrors code.
+ */
+int
+xmlBufferAdd(xmlBufferPtr buf, const xmlChar *str, int len) {
+    if ((buf == NULL) || (str == NULL))
+	return(XML_ERR_ARGUMENT);
+    if (len < 0)
+        len = xmlStrlen(str);
+    if (len == 0)
+        return(XML_ERR_OK);
+
+    /* Note that both buf->size and buf->use can be zero here. */
+    if ((unsigned) len >= buf->size - buf->use) {
+        if (xmlBufferGrow(buf, len) < 0)
+            return(XML_ERR_NO_MEMORY);
+    }
+
+    memmove(&buf->content[buf->use], str, len);
+    buf->use += len;
+    buf->content[buf->use] = 0;
+    return(XML_ERR_OK);
+}
+
+/**
+ * xmlBufferAddHead:
+ * @buf:  the buffer
+ * @str:  the #xmlChar string
+ * @len:  the number of #xmlChar to add
+ *
+ * Add a string range to the beginning of an XML buffer.
+ * if len == -1, the length of @str is recomputed.
+ *
+ * Returns a xmlParserErrors code.
+ */
+int
+xmlBufferAddHead(xmlBufferPtr buf, const xmlChar *str, int len) {
+    unsigned start = 0;
+
+    if ((buf == NULL) || (str == NULL))
+	return(XML_ERR_ARGUMENT);
+    if (len < 0)
+        len = xmlStrlen(str);
+    if (len == 0)
+        return(XML_ERR_OK);
+
+    if (buf->alloc == XML_BUFFER_ALLOC_IO) {
+        start = buf->content - buf->contentIO;
+
+        /*
+         * We can add it in the space previously shrunk
+         */
+        if ((unsigned) len <= start) {
+            buf->content -= len;
+            memmove(&buf->content[0], str, len);
+            buf->use += len;
+            buf->size += len;
+            return(0);
+        }
+        if ((unsigned) len < buf->size + start - buf->use) {
+            memmove(&buf->contentIO[len], buf->content, buf->use + 1);
+            memmove(buf->contentIO, str, len);
+            buf->content = buf->contentIO;
+            buf->use += len;
+            buf->size += start;
+            return(0);
+        }
+    }
+
+    if ((unsigned) len >= buf->size - buf->use) {
+        if (xmlBufferGrow(buf, len) < 0)
+            return(-1);
+    }
+
+    memmove(&buf->content[len], buf->content, buf->use + 1);
+    memmove(buf->content, str, len);
+    buf->use += len;
+    return (0);
+}
+
+/**
+ * xmlBufferCat:
+ * @buf:  the buffer to add to
+ * @str:  the #xmlChar string
+ *
+ * Append a zero terminated string to an XML buffer.
+ *
+ * Returns 0 successful, a positive error code number otherwise
+ *         and -1 in case of internal or API error.
+ */
+int
+xmlBufferCat(xmlBufferPtr buf, const xmlChar *str) {
+    return(xmlBufferAdd(buf, str, -1));
+}
+
+/**
+ * xmlBufferCCat:
+ * @buf:  the buffer to dump
+ * @str:  the C char string
+ *
+ * Append a zero terminated C string to an XML buffer.
+ *
+ * Returns 0 successful, a positive error code number otherwise
+ *         and -1 in case of internal or API error.
+ */
+int
+xmlBufferCCat(xmlBufferPtr buf, const char *str) {
+    return(xmlBufferAdd(buf, (const xmlChar *) str, -1));
+}
+
+/**
+ * xmlBufferWriteCHAR:
+ * @buf:  the XML buffer
+ * @string:  the string to add
+ *
+ * routine which manages and grows an output buffer. This one adds
+ * xmlChars at the end of the buffer.
+ */
+void
+xmlBufferWriteCHAR(xmlBufferPtr buf, const xmlChar *string) {
+    xmlBufferAdd(buf, string, -1);
+}
+
+/**
+ * xmlBufferWriteChar:
+ * @buf:  the XML buffer output
+ * @string:  the string to add
+ *
+ * routine which manage and grows an output buffer. This one add
+ * C chars at the end of the array.
+ */
+void
+xmlBufferWriteChar(xmlBufferPtr buf, const char *string) {
+    xmlBufferAdd(buf, (const xmlChar *) string, -1);
+}
+
+
+/**
+ * xmlBufferWriteQuotedString:
+ * @buf:  the XML buffer output
+ * @string:  the string to add
+ *
+ * routine which manage and grows an output buffer. This one writes
+ * a quoted or double quoted #xmlChar string, checking first if it holds
+ * quote or double-quotes internally
+ */
+void
+xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar *string) {
+    const xmlChar *cur, *base;
+    if (buf == NULL)
+        return;
+    if (xmlStrchr(string, '\"')) {
+        if (xmlStrchr(string, '\'')) {
+	    xmlBufferCCat(buf, "\"");
+            base = cur = string;
+            while(*cur != 0){
+                if(*cur == '"'){
+                    if (base != cur)
+                        xmlBufferAdd(buf, base, cur - base);
+                    xmlBufferAdd(buf, BAD_CAST "&quot;", 6);
+                    cur++;
+                    base = cur;
+                }
+                else {
+                    cur++;
+                }
+            }
+            if (base != cur)
+                xmlBufferAdd(buf, base, cur - base);
+	    xmlBufferCCat(buf, "\"");
+	}
+        else{
+	    xmlBufferCCat(buf, "\'");
+            xmlBufferCat(buf, string);
+	    xmlBufferCCat(buf, "\'");
+        }
+    } else {
+        xmlBufferCCat(buf, "\"");
+        xmlBufferCat(buf, string);
+        xmlBufferCCat(buf, "\"");
+    }
+}
+
diff --git a/c14n.c b/c14n.c
index 964ac99..c9bbd22 100644
--- a/c14n.c
+++ b/c14n.c
@@ -25,6 +25,7 @@
 
 #include "private/error.h"
 #include "private/io.h"
+#include "private/memory.h"
 
 /************************************************************************
  *									*
@@ -306,30 +307,26 @@
        ((cur->nsTab != NULL) && (cur->nodeTab == NULL)))
 	return (1);
 
-    if ((cur->nsTab == NULL) && (cur->nodeTab == NULL)) {
-        cur->nsTab = (xmlNsPtr*) xmlMalloc(XML_NAMESPACES_DEFAULT * sizeof(xmlNsPtr));
-        cur->nodeTab = (xmlNodePtr*) xmlMalloc(XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr));
-	if ((cur->nsTab == NULL) || (cur->nodeTab == NULL))
-	    return (-1);
-	memset(cur->nsTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNsPtr));
-	memset(cur->nodeTab, 0 , XML_NAMESPACES_DEFAULT * sizeof(xmlNodePtr));
-        cur->nsMax = XML_NAMESPACES_DEFAULT;
-    } else if(cur->nsMax == cur->nsCurEnd) {
-	void *tmp;
-	int tmpSize;
+    if (cur->nsMax <= cur->nsCurEnd) {
+	xmlNsPtr *tmp1;
+        xmlNodePtr *tmp2;
+	int newSize;
 
-	tmpSize = 2 * cur->nsMax;
-	tmp = xmlRealloc(cur->nsTab, tmpSize * sizeof(xmlNsPtr));
-	if (tmp == NULL)
-	    return (-1);
-	cur->nsTab = (xmlNsPtr*)tmp;
+        newSize = xmlGrowCapacity(cur->nsMax,
+                                  sizeof(tmp1[0]) + sizeof(tmp2[0]),
+                                  XML_NAMESPACES_DEFAULT, XML_MAX_ITEMS);
 
-	tmp = xmlRealloc(cur->nodeTab, tmpSize * sizeof(xmlNodePtr));
-	if (tmp == NULL)
+	tmp1 = xmlRealloc(cur->nsTab, newSize * sizeof(tmp1[0]));
+	if (tmp1 == NULL)
 	    return (-1);
-	cur->nodeTab = (xmlNodePtr*)tmp;
+	cur->nsTab = tmp1;
 
-	cur->nsMax = tmpSize;
+	tmp2 = xmlRealloc(cur->nodeTab, newSize * sizeof(tmp2[0]));
+	if (tmp2 == NULL)
+	    return (-1);
+	cur->nodeTab = tmp2;
+
+	cur->nsMax = newSize;
     }
     cur->nsTab[cur->nsCurEnd] = ns;
     cur->nodeTab[cur->nsCurEnd] = node;
@@ -644,7 +641,7 @@
      *     have non-empty values in XPath)
      */
     if(visible && !has_empty_ns) {
-        static xmlNs ns_default;
+        xmlNs ns_default;
 
         memset(&ns_default, 0, sizeof(ns_default));
         if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) {
@@ -821,7 +818,7 @@
      */
     if(visible && has_visibly_utilized_empty_ns &&
 	    !has_empty_ns && !has_empty_ns_in_inclusive_list) {
-        static xmlNs ns_default;
+        xmlNs ns_default;
 
         memset(&ns_default, 0, sizeof(ns_default));
 
@@ -830,7 +827,7 @@
 	    xmlC14NPrintNamespaces(&ns_default, ctx);
 	}
     } else if(visible && !has_empty_ns && has_empty_ns_in_inclusive_list) {
-        static xmlNs ns_default;
+        xmlNs ns_default;
 
         memset(&ns_default, 0, sizeof(ns_default));
         if(!xmlC14NVisibleNsStackFind(ctx->ns_rendered, &ns_default)) {
@@ -2133,7 +2130,7 @@
      * allocate an translation buffer.
      */
     buffer_size = 1000;
-    buffer = (xmlChar *) xmlMallocAtomic(buffer_size);
+    buffer = xmlMalloc(buffer_size);
     if (buffer == NULL)
         return (NULL);
     out = buffer;
@@ -2142,14 +2139,20 @@
         if ((out - buffer) > (buffer_size - 10)) {
             xmlChar *tmp;
             int indx = out - buffer;
+            int newSize;
 
-            buffer_size *= 2;
-            tmp = xmlRealloc(buffer, buffer_size);
+            newSize = xmlGrowCapacity(buffer_size, 1, 1, XML_MAX_ITEMS);
+            if (newSize < 0) {
+                xmlFree(buffer);
+                return(NULL);
+            }
+            tmp = xmlRealloc(buffer, newSize);
             if (tmp == NULL) {
                 xmlFree(buffer);
                 return(NULL);
             }
             buffer = tmp;
+            buffer_size = newSize;
             out = &buffer[indx];
         }
 
diff --git a/catalog.c b/catalog.c
index 27af95f..dc22e27 100644
--- a/catalog.c
+++ b/catalog.c
@@ -19,17 +19,16 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#elif defined (_WIN32)
-#include <io.h>
-#endif
-#ifdef HAVE_FCNTL_H
+
 #include <fcntl.h>
+#include <sys/stat.h>
+
+#ifdef _WIN32
+  #include <io.h>
+#else
+  #include <unistd.h>
 #endif
+
 #include <libxml/xmlmemory.h>
 #include <libxml/hash.h>
 #include <libxml/uri.h>
@@ -38,8 +37,11 @@
 #include <libxml/xmlerror.h>
 #include <libxml/threads.h>
 
+#include "private/cata.h"
 #include "private/buf.h"
 #include "private/error.h"
+#include "private/memory.h"
+#include "private/threads.h"
 
 #define MAX_DELEGATE	50
 #define MAX_CATAL_DEPTH	50
@@ -53,10 +55,10 @@
 #define XML_URN_PUBID "urn:publicid:"
 #define XML_CATAL_BREAK ((xmlChar *) -1)
 #ifndef XML_XML_DEFAULT_CATALOG
-#define XML_XML_DEFAULT_CATALOG "file://" SYSCONFDIR "/xml/catalog"
+#define XML_XML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/xml/catalog"
 #endif
 #ifndef XML_SGML_DEFAULT_CATALOG
-#define XML_SGML_DEFAULT_CATALOG "file://" SYSCONFDIR "/sgml/catalog"
+#define XML_SGML_DEFAULT_CATALOG "file://" XML_SYSCONFDIR "/sgml/catalog"
 #endif
 
 static xmlChar *xmlCatalogNormalizePublic(const xmlChar *pubID);
@@ -169,10 +171,10 @@
  * It also protects xmlCatalogXMLFiles
  * The core of this readers/writer scheme is in xmlFetchXMLCatalogFile()
  */
-static xmlRMutexPtr xmlCatalogMutex = NULL;
+static xmlRMutex xmlCatalogMutex;
 
 /*
- * Whether the catalog support was initialized.
+ * Whether the default system catalog was initialized.
  */
 static int xmlCatalogInitialized = 0;
 
@@ -210,15 +212,23 @@
 {
     int res;
 
-    res = __xmlRaiseError(NULL, NULL, NULL, catal, node,
-                          XML_FROM_CATALOG, error, XML_ERR_ERROR, NULL, 0,
-                          (const char *) str1, (const char *) str2,
-                          (const char *) str3, 0, 0,
-                          msg, str1, str2, str3);
+    res = xmlRaiseError(NULL, NULL, NULL, catal, node,
+                        XML_FROM_CATALOG, error, XML_ERR_ERROR, NULL, 0,
+                        (const char *) str1, (const char *) str2,
+                        (const char *) str3, 0, 0,
+                        msg, str1, str2, str3);
     if (res < 0)
         xmlCatalogErrMemory();
 }
 
+static void
+xmlCatalogPrintDebug(const char *fmt, ...) {
+    va_list ap;
+
+    va_start(ap, fmt);
+    xmlVPrintErrorMessage(fmt, ap);
+    va_end(ap);
+}
 
 /************************************************************************
  *									*
@@ -306,13 +316,13 @@
 
     if (xmlDebugCatalogs) {
 	if (ret->name != NULL)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		    "Free catalog entry %s\n", ret->name);
 	else if (ret->value != NULL)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		    "Free catalog entry %s\n", ret->value);
 	else
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		    "Free catalog entry\n");
     }
 
@@ -770,7 +780,7 @@
 	return(-1);
 
     if (xmlDebugCatalogs) {
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Converting SGML catalog to XML\n");
     }
     xmlHashScan(catal->sgml, xmlCatalogConvertEntry, &catal);
@@ -888,7 +898,11 @@
     inputStream->buf = buf;
     xmlBufResetInput(buf->buffer, inputStream);
 
-    inputPush(ctxt, inputStream);
+    if (xmlCtxtPushInput(ctxt, inputStream) < 0) {
+        xmlFreeInputStream(inputStream);
+        xmlFreeParserCtxt(ctxt);
+        return(NULL);
+    }
 
     ctxt->valid = 0;
     ctxt->validate = 0;
@@ -921,60 +935,33 @@
 static xmlChar *
 xmlLoadFileContent(const char *filename)
 {
-#ifdef HAVE_STAT
     int fd;
-#else
-    FILE *fd;
-#endif
     int len;
     long size;
 
-#ifdef HAVE_STAT
     struct stat info;
-#endif
     xmlChar *content;
 
     if (filename == NULL)
         return (NULL);
 
-#ifdef HAVE_STAT
     if (stat(filename, &info) < 0)
         return (NULL);
-#endif
 
-#ifdef HAVE_STAT
-    if ((fd = open(filename, O_RDONLY)) < 0)
-#else
-    if ((fd = fopen(filename, "rb")) == NULL)
-#endif
+    fd = open(filename, O_RDONLY);
+    if (fd  < 0)
     {
         return (NULL);
     }
-#ifdef HAVE_STAT
     size = info.st_size;
-#else
-    if (fseek(fd, 0, SEEK_END) || (size = ftell(fd)) == EOF || fseek(fd, 0, SEEK_SET)) {        /* File operations denied? ok, just close and return failure */
-        fclose(fd);
-        return (NULL);
-    }
-#endif
-    content = (xmlChar*)xmlMallocAtomic(size + 10);
+    content = xmlMalloc(size + 10);
     if (content == NULL) {
         xmlCatalogErrMemory();
-#ifdef HAVE_STAT
 	close(fd);
-#else
-	fclose(fd);
-#endif
         return (NULL);
     }
-#ifdef HAVE_STAT
     len = read(fd, content, size);
     close(fd);
-#else
-    len = fread(content, 1, size, fd);
-    fclose(fd);
-#endif
     if (len < 0) {
         xmlFree(content);
         return (NULL);
@@ -1145,10 +1132,10 @@
     if (URL != NULL) {
 	if (xmlDebugCatalogs > 1) {
 	    if (nameValue != NULL)
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Found %s: '%s' '%s'\n", name, nameValue, URL);
 	    else
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Found %s: '%s'\n", name, URL);
 	}
 	ret = xmlNewCatalogEntry(type, nameValue, uriValue, URL, prefer, cgroup);
@@ -1317,14 +1304,14 @@
     doc = xmlParseCatalogFile((const char *) filename);
     if (doc == NULL) {
 	if (xmlDebugCatalogs)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		    "Failed to parse catalog %s\n", filename);
 	return(NULL);
     }
 
     if (xmlDebugCatalogs)
-	fprintf(stderr,
-		"%d Parsing catalog %s\n", xmlGetThreadId(), filename);
+	xmlCatalogPrintDebug(
+		"Parsing catalog %s\n", filename);
 
     cur = xmlDocGetRootElement(doc);
     if ((cur != NULL) && (xmlStrEqual(cur->name, BAD_CAST "catalog")) &&
@@ -1384,10 +1371,10 @@
     /*
      * lock the whole catalog for modification
      */
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlRMutexLock(&xmlCatalogMutex);
     if (catal->children != NULL) {
 	/* Okay someone else did it in the meantime */
-	xmlRMutexUnlock(xmlCatalogMutex);
+	xmlRMutexUnlock(&xmlCatalogMutex);
 	return(0);
     }
 
@@ -1396,7 +1383,7 @@
 	    xmlHashLookup(xmlCatalogXMLFiles, catal->URL);
 	if (doc != NULL) {
 	    if (xmlDebugCatalogs)
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 		    "Found %s in file hash\n", catal->URL);
 
 	    if (catal->type == XML_CATA_CATALOG)
@@ -1404,11 +1391,11 @@
 	    else
 		catal->children = doc;
 	    catal->dealloc = 0;
-	    xmlRMutexUnlock(xmlCatalogMutex);
+	    xmlRMutexUnlock(&xmlCatalogMutex);
 	    return(0);
 	}
 	if (xmlDebugCatalogs)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		"%s not found in file hash\n", catal->URL);
     }
 
@@ -1420,7 +1407,7 @@
     doc = xmlParseXMLCatalogFile(catal->prefer, catal->URL);
     if (doc == NULL) {
 	catal->type = XML_CATA_BROKEN_CATALOG;
-	xmlRMutexUnlock(xmlCatalogMutex);
+	xmlRMutexUnlock(&xmlCatalogMutex);
 	return(-1);
     }
 
@@ -1435,11 +1422,11 @@
 	xmlCatalogXMLFiles = xmlHashCreate(10);
     if (xmlCatalogXMLFiles != NULL) {
 	if (xmlDebugCatalogs)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		"%s added to file hash\n", catal->URL);
 	xmlHashAddEntry(xmlCatalogXMLFiles, catal->URL, doc);
     }
-    xmlRMutexUnlock(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
     return(0);
 }
 
@@ -1481,7 +1468,7 @@
     typ = xmlGetXMLCatalogEntryType(type);
     if (typ == XML_CATA_NONE) {
 	if (xmlDebugCatalogs)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		    "Failed to add unknown element %s to catalog\n", type);
 	return(-1);
     }
@@ -1495,7 +1482,7 @@
 	    if ((orig != NULL) && (cur->type == typ) &&
 		(xmlStrEqual(orig, cur->name))) {
 		if (xmlDebugCatalogs)
-		    fprintf(stderr,
+		    xmlCatalogPrintDebug(
 			    "Updating element %s to catalog\n", type);
 		if (cur->value != NULL)
 		    xmlFree(cur->value);
@@ -1511,7 +1498,7 @@
 	}
     }
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Adding element %s to catalog\n", type);
     if (cur == NULL)
 	catal->children = xmlNewCatalogEntry(typ, orig, replace,
@@ -1563,10 +1550,10 @@
 	    (xmlStrEqual(value, cur->value))) {
 	    if (xmlDebugCatalogs) {
 		if (cur->name != NULL)
-		    fprintf(stderr,
+		    xmlCatalogPrintDebug(
 			    "Removing element %s from catalog\n", cur->name);
 		else
-		    fprintf(stderr,
+		    xmlCatalogPrintDebug(
 			    "Removing element %s from catalog\n", cur->value);
 	    }
 	    cur->type = XML_CATA_REMOVED;
@@ -1622,7 +1609,7 @@
 		case XML_CATA_SYSTEM:
 		    if (xmlStrEqual(sysID, cur->name)) {
 			if (xmlDebugCatalogs)
-			    fprintf(stderr,
+			    xmlCatalogPrintDebug(
 				    "Found system match %s, using %s\n",
 				            cur->name, cur->URL);
 			catal->depth--;
@@ -1651,7 +1638,7 @@
 	}
 	if (rewrite != NULL) {
 	    if (xmlDebugCatalogs)
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Using rewriting rule %s\n", rewrite->name);
 	    ret = xmlStrdup(rewrite->URL);
 	    if (ret != NULL)
@@ -1686,7 +1673,7 @@
 		    }
 		    if (cur->children != NULL) {
 			if (xmlDebugCatalogs)
-			    fprintf(stderr,
+			    xmlCatalogPrintDebug(
 				    "Trying system delegate %s\n", cur->URL);
 			ret = xmlCatalogListXMLResolve(
 				cur->children, NULL, sysID);
@@ -1716,7 +1703,7 @@
 		case XML_CATA_PUBLIC:
 		    if (xmlStrEqual(pubID, cur->name)) {
 			if (xmlDebugCatalogs)
-			    fprintf(stderr,
+			    xmlCatalogPrintDebug(
 				    "Found public match %s\n", cur->name);
 			catal->depth--;
 			return(xmlStrdup(cur->URL));
@@ -1765,7 +1752,7 @@
 		    }
 		    if (cur->children != NULL) {
 			if (xmlDebugCatalogs)
-			    fprintf(stderr,
+			    xmlCatalogPrintDebug(
 				    "Trying public delegate %s\n", cur->URL);
 			ret = xmlCatalogListXMLResolve(
 				cur->children, pubID, NULL);
@@ -1855,7 +1842,7 @@
 	    case XML_CATA_URI:
 		if (xmlStrEqual(URI, cur->name)) {
 		    if (xmlDebugCatalogs)
-			fprintf(stderr,
+			xmlCatalogPrintDebug(
 				"Found URI match %s\n", cur->name);
 		    return(xmlStrdup(cur->URL));
 		}
@@ -1882,7 +1869,7 @@
     }
     if (rewrite != NULL) {
 	if (xmlDebugCatalogs)
-	    fprintf(stderr,
+	    xmlCatalogPrintDebug(
 		    "Using rewriting rule %s\n", rewrite->name);
 	ret = xmlStrdup(rewrite->URL);
 	if (ret != NULL)
@@ -1917,7 +1904,7 @@
 		}
 		if (cur->children != NULL) {
 		    if (xmlDebugCatalogs)
-			fprintf(stderr,
+			xmlCatalogPrintDebug(
 				"Trying URI delegate %s\n", cur->URL);
 		    ret = xmlCatalogListXMLResolveURI(
 			    cur->children, URI);
@@ -1986,10 +1973,10 @@
 	urnID = xmlCatalogUnWrapURN(pubID);
 	if (xmlDebugCatalogs) {
 	    if (urnID == NULL)
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Public URN ID %s expanded to NULL\n", pubID);
 	    else
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Public URN ID expanded to %s\n", urnID);
 	}
 	ret = xmlCatalogListXMLResolve(catal, urnID, sysID);
@@ -2003,10 +1990,10 @@
 	urnID = xmlCatalogUnWrapURN(sysID);
 	if (xmlDebugCatalogs) {
 	    if (urnID == NULL)
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"System URN ID %s expanded to NULL\n", sysID);
 	    else
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"System URN ID expanded to %s\n", urnID);
 	}
 	if (pubID == NULL)
@@ -2070,10 +2057,10 @@
 	urnID = xmlCatalogUnWrapURN(URI);
 	if (xmlDebugCatalogs) {
 	    if (urnID == NULL)
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"URN ID %s expanded to NULL\n", URI);
 	    else
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"URN ID expanded to %s\n", urnID);
 	}
 	ret = xmlCatalogListXMLResolve(catal, urnID, NULL);
@@ -2142,7 +2129,7 @@
  */
 static const xmlChar *
 xmlParseSGMLCatalogPubid(const xmlChar *cur, xmlChar **id) {
-    xmlChar *buf = NULL, *tmp;
+    xmlChar *buf = NULL;
     int len = 0;
     int size = 50;
     xmlChar stop;
@@ -2158,7 +2145,7 @@
     } else {
 	stop = ' ';
     }
-    buf = (xmlChar *) xmlMallocAtomic(size);
+    buf = xmlMalloc(size);
     if (buf == NULL) {
         xmlCatalogErrMemory();
 	return(NULL);
@@ -2169,14 +2156,23 @@
 	if ((stop == ' ') && (IS_BLANK_CH(*cur)))
 	    break;
 	if (len + 1 >= size) {
-	    size *= 2;
-	    tmp = (xmlChar *) xmlRealloc(buf, size);
+            xmlChar *tmp;
+            int newSize;
+
+            newSize = xmlGrowCapacity(size, 1, 1, XML_MAX_ITEMS);
+            if (newSize < 0) {
+		xmlCatalogErrMemory();
+		xmlFree(buf);
+		return(NULL);
+            }
+	    tmp = xmlRealloc(buf, newSize);
 	    if (tmp == NULL) {
 		xmlCatalogErrMemory();
 		xmlFree(buf);
 		return(NULL);
 	    }
 	    buf = tmp;
+            size = newSize;
 	}
 	buf[len++] = *cur;
 	NEXT;
@@ -2752,7 +2748,7 @@
 	return(NULL);
 
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Resolve sysID %s\n", sysID);
 
     if (catal->type == XML_XML_CATALOG_TYPE) {
@@ -2787,7 +2783,7 @@
 	return(NULL);
 
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Resolve pubID %s\n", pubID);
 
     if (catal->type == XML_XML_CATALOG_TYPE) {
@@ -2826,13 +2822,13 @@
 
     if (xmlDebugCatalogs) {
          if ((pubID != NULL) && (sysID != NULL)) {
-             fprintf(stderr,
+             xmlCatalogPrintDebug(
                              "Resolve: pubID %s sysID %s\n", pubID, sysID);
          } else if (pubID != NULL) {
-             fprintf(stderr,
+             xmlCatalogPrintDebug(
                              "Resolve: pubID %s\n", pubID);
          } else {
-             fprintf(stderr,
+             xmlCatalogPrintDebug(
                              "Resolve: sysID %s\n", sysID);
          }
     }
@@ -2869,7 +2865,7 @@
 	return(NULL);
 
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Resolve URI %s\n", URI);
 
     if (catal->type == XML_XML_CATALOG_TYPE) {
@@ -3041,41 +3037,31 @@
  ************************************************************************/
 
 /**
- * xmlInitializeCatalogData:
+ * xmlInitCatalogInternal:
  *
  * Do the catalog initialization only of global data, doesn't try to load
  * any catalog actually.
- * this function is not thread safe, catalog initialization should
- * preferably be done once at startup
  */
-static void
-xmlInitializeCatalogData(void) {
-    if (xmlCatalogInitialized != 0)
-	return;
-
+void
+xmlInitCatalogInternal(void) {
     if (getenv("XML_DEBUG_CATALOG"))
 	xmlDebugCatalogs = 1;
-    xmlCatalogMutex = xmlNewRMutex();
-
-    xmlCatalogInitialized = 1;
+    xmlInitRMutex(&xmlCatalogMutex);
 }
+
 /**
  * xmlInitializeCatalog:
  *
- * Do the catalog initialization.
- * this function is not thread safe, catalog initialization should
- * preferably be done once at startup
+ * Load the default system catalog.
  */
 void
 xmlInitializeCatalog(void) {
     if (xmlCatalogInitialized != 0)
 	return;
 
-    xmlInitializeCatalogData();
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlInitParser();
 
-    if (getenv("XML_DEBUG_CATALOG"))
-	xmlDebugCatalogs = 1;
+    xmlRMutexLock(&xmlCatalogMutex);
 
     if (xmlDefaultCatalog == NULL) {
 	const char *catalogs;
@@ -3116,7 +3102,9 @@
 	}
     }
 
-    xmlRMutexUnlock(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
+
+    xmlCatalogInitialized = 1;
 }
 
 
@@ -3137,25 +3125,25 @@
     int ret;
     xmlCatalogPtr catal;
 
-    if (!xmlCatalogInitialized)
-	xmlInitializeCatalogData();
+    xmlInitParser();
 
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlRMutexLock(&xmlCatalogMutex);
 
     if (xmlDefaultCatalog == NULL) {
 	catal = xmlLoadACatalog(filename);
 	if (catal == NULL) {
-	    xmlRMutexUnlock(xmlCatalogMutex);
+	    xmlRMutexUnlock(&xmlCatalogMutex);
 	    return(-1);
 	}
 
 	xmlDefaultCatalog = catal;
-	xmlRMutexUnlock(xmlCatalogMutex);
+	xmlRMutexUnlock(&xmlCatalogMutex);
+        xmlCatalogInitialized = 1;
 	return(0);
     }
 
     ret = xmlExpandCatalog(xmlDefaultCatalog, filename);
-    xmlRMutexUnlock(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
     return(ret);
 }
 
@@ -3213,12 +3201,9 @@
  */
 void
 xmlCatalogCleanup(void) {
-    if (xmlCatalogInitialized == 0)
-        return;
-
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlRMutexLock(&xmlCatalogMutex);
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Catalogs cleanup\n");
     if (xmlCatalogXMLFiles != NULL)
 	xmlHashFree(xmlCatalogXMLFiles, xmlFreeCatalogHashEntryList);
@@ -3228,8 +3213,17 @@
     xmlDefaultCatalog = NULL;
     xmlDebugCatalogs = 0;
     xmlCatalogInitialized = 0;
-    xmlRMutexUnlock(xmlCatalogMutex);
-    xmlFreeRMutex(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
+}
+
+/**
+ * xmlCleanupCatalogInternal:
+ *
+ * Free global data.
+ */
+void
+xmlCleanupCatalogInternal(void) {
+    xmlCleanupRMutex(&xmlCatalogMutex);
 }
 
 /**
@@ -3349,10 +3343,9 @@
 xmlCatalogAdd(const xmlChar *type, const xmlChar *orig, const xmlChar *replace) {
     int res = -1;
 
-    if (!xmlCatalogInitialized)
-	xmlInitializeCatalogData();
+    xmlInitParser();
 
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlRMutexLock(&xmlCatalogMutex);
     /*
      * Specific case where one want to override the default catalog
      * put in place by xmlInitializeCatalog();
@@ -3365,12 +3358,13 @@
 	   xmlDefaultCatalog->xml = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL,
 				    orig, NULL,  xmlCatalogDefaultPrefer, NULL);
 	}
-	xmlRMutexUnlock(xmlCatalogMutex);
+	xmlRMutexUnlock(&xmlCatalogMutex);
+        xmlCatalogInitialized = 1;
 	return(0);
     }
 
     res = xmlACatalogAdd(xmlDefaultCatalog, type, orig, replace);
-    xmlRMutexUnlock(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
     return(res);
 }
 
@@ -3389,9 +3383,9 @@
     if (!xmlCatalogInitialized)
 	xmlInitializeCatalog();
 
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlRMutexLock(&xmlCatalogMutex);
     res = xmlACatalogRemove(xmlDefaultCatalog, value);
-    xmlRMutexUnlock(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
     return(res);
 }
 
@@ -3409,9 +3403,9 @@
     if (!xmlCatalogInitialized)
 	xmlInitializeCatalog();
 
-    xmlRMutexLock(xmlCatalogMutex);
+    xmlRMutexLock(&xmlCatalogMutex);
     res = xmlConvertSGMLCatalog(xmlDefaultCatalog);
-    xmlRMutexUnlock(xmlCatalogMutex);
+    xmlRMutexUnlock(&xmlCatalogMutex);
     return(res);
 }
 
@@ -3424,6 +3418,9 @@
 /**
  * xmlCatalogGetDefaults:
  *
+ * DEPRECATED: Use XML_PARSE_NO_SYS_CATALOG and
+ * XML_PARSE_CATALOG_PI.
+ *
  * Used to get the user preference w.r.t. to what catalogs should
  * be accepted
  *
@@ -3438,6 +3435,9 @@
  * xmlCatalogSetDefaults:
  * @allow:  what catalogs should be accepted
  *
+ * DEPRECATED: Use XML_PARSE_NO_SYS_CATALOG and
+ * XML_PARSE_CATALOG_PI.
+ *
  * Used to set the user preference w.r.t. to what catalogs should
  * be accepted
  */
@@ -3446,19 +3446,19 @@
     if (xmlDebugCatalogs) {
 	switch (allow) {
 	    case XML_CATA_ALLOW_NONE:
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Disabling catalog usage\n");
 		break;
 	    case XML_CATA_ALLOW_GLOBAL:
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Allowing only global catalogs\n");
 		break;
 	    case XML_CATA_ALLOW_DOCUMENT:
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Allowing only catalogs from the document\n");
 		break;
 	    case XML_CATA_ALLOW_ALL:
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Allowing all catalogs\n");
 		break;
 	}
@@ -3470,6 +3470,8 @@
  * xmlCatalogSetDefaultPrefer:
  * @prefer:  the default preference for delegation
  *
+ * DEPRECATED: This setting is global and not thread-safe.
+ *
  * Allows to set the preference between public and system for deletion
  * in XML Catalog resolution. C.f. section 4.1.1 of the spec
  * Values accepted are XML_CATA_PREFER_PUBLIC or XML_CATA_PREFER_SYSTEM
@@ -3486,11 +3488,11 @@
     if (xmlDebugCatalogs) {
 	switch (prefer) {
 	    case XML_CATA_PREFER_PUBLIC:
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Setting catalog preference to PUBLIC\n");
 		break;
 	    case XML_CATA_PREFER_SYSTEM:
-		fprintf(stderr,
+		xmlCatalogPrintDebug(
 			"Setting catalog preference to SYSTEM\n");
 		break;
 	    default:
@@ -3537,9 +3539,6 @@
 xmlCatalogFreeLocal(void *catalogs) {
     xmlCatalogEntryPtr catal;
 
-    if (!xmlCatalogInitialized)
-	xmlInitializeCatalog();
-
     catal = (xmlCatalogEntryPtr) catalogs;
     if (catal != NULL)
 	xmlFreeCatalogEntryList(catal);
@@ -3559,14 +3558,13 @@
 xmlCatalogAddLocal(void *catalogs, const xmlChar *URL) {
     xmlCatalogEntryPtr catal, add;
 
-    if (!xmlCatalogInitialized)
-	xmlInitializeCatalog();
+    xmlInitParser();
 
     if (URL == NULL)
 	return(catalogs);
 
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Adding document catalog %s\n", URL);
 
     add = xmlNewCatalogEntry(XML_CATA_CATALOG, NULL, URL, NULL,
@@ -3602,21 +3600,18 @@
     xmlCatalogEntryPtr catal;
     xmlChar *ret;
 
-    if (!xmlCatalogInitialized)
-	xmlInitializeCatalog();
-
     if ((pubID == NULL) && (sysID == NULL))
 	return(NULL);
 
     if (xmlDebugCatalogs) {
         if ((pubID != NULL) && (sysID != NULL)) {
-            fprintf(stderr,
+            xmlCatalogPrintDebug(
                             "Local Resolve: pubID %s sysID %s\n", pubID, sysID);
         } else if (pubID != NULL) {
-            fprintf(stderr,
+            xmlCatalogPrintDebug(
                             "Local Resolve: pubID %s\n", pubID);
         } else {
-            fprintf(stderr,
+            xmlCatalogPrintDebug(
                             "Local Resolve: sysID %s\n", sysID);
         }
     }
@@ -3646,14 +3641,11 @@
     xmlCatalogEntryPtr catal;
     xmlChar *ret;
 
-    if (!xmlCatalogInitialized)
-	xmlInitializeCatalog();
-
     if (URI == NULL)
 	return(NULL);
 
     if (xmlDebugCatalogs)
-	fprintf(stderr,
+	xmlCatalogPrintDebug(
 		"Resolve URI %s\n", URI);
 
     catal = (xmlCatalogEntryPtr) catalogs;
@@ -3689,7 +3681,7 @@
 	xmlInitializeCatalog();
 
     if (msg == 0) {
-	fprintf(stderr,
+	xmlPrintErrorMessage(
 		"Use of deprecated xmlCatalogGetSystem() call\n");
 	msg++;
     }
@@ -3733,7 +3725,7 @@
 	xmlInitializeCatalog();
 
     if (msg == 0) {
-	fprintf(stderr,
+	xmlPrintErrorMessage(
 		"Use of deprecated xmlCatalogGetPublic() call\n");
 	msg++;
     }
diff --git a/check-relaxng-test-suite.py b/check-relaxng-test-suite.py
deleted file mode 100755
index 3e15212..0000000
--- a/check-relaxng-test-suite.py
+++ /dev/null
@@ -1,397 +0,0 @@
-#!/usr/bin/env python3
-import sys
-import time
-import os
-try:
-    # Python 2
-    from StringIO import StringIO
-except ImportError:
-    # Python 3
-    from io import StringIO
-sys.path.insert(0, "python")
-import libxml2
-
-# Memory debug specific
-libxml2.debugMemory(1)
-debug = 0
-verbose = 0
-quiet = 1
-
-#
-# the testsuite description
-#
-CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/OASIS/spectest.xml")
-LOG="check-relaxng-test-suite.log"
-RES="relaxng-test-results.xml"
-
-log = open(LOG, "w")
-nb_schemas_tests = 0
-nb_schemas_success = 0
-nb_schemas_failed = 0
-nb_instances_tests = 0
-nb_instances_success = 0
-nb_instances_failed = 0
-
-libxml2.lineNumbersDefault(1)
-#
-# Error and warnng callbacks
-#
-def callback(ctx, str):
-    global log
-    log.write("%s%s" % (ctx, str))
-
-libxml2.registerErrorHandler(callback, "")
-
-#
-# Resolver callback
-#
-resources = {}
-def resolver(URL, ID, ctxt):
-    global resources
-
-    if URL.find('#') != -1:
-        URL = URL[0:URL.find('#')]
-    if URL in resources:
-        return(StringIO(resources[URL]))
-    log.write("Resolver failure: asked %s\n" % (URL))
-    log.write("resources: %s\n" % (resources))
-    return None
-
-#
-# Load the previous results
-#
-#results = {}
-#previous = {}
-#
-#try:
-#    res = libxml2.parseFile(RES)
-#except:
-#    log.write("Could not parse %s" % (RES))
-
-#
-# handle a valid instance
-#
-def handle_valid(node, schema):
-    global log
-    global nb_instances_success
-    global nb_instances_failed
-
-    instance = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            instance = instance + child.serialize()
-        child = child.next
-
-    try:
-        doc = libxml2.parseDoc(instance)
-    except:
-        doc = None
-
-    if doc is None:
-        log.write("\nFailed to parse correct instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-        return
-
-    try:
-        ctxt = schema.relaxNGNewValidCtxt()
-        ret = doc.relaxNGValidateDoc(ctxt)
-    except:
-        ret = -1
-    if ret != 0:
-        log.write("\nFailed to validate correct instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-    else:
-        nb_instances_success = nb_instances_success + 1
-    doc.freeDoc()
-
-#
-# handle an invalid instance
-#
-def handle_invalid(node, schema):
-    global log
-    global nb_instances_success
-    global nb_instances_failed
-
-    instance = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            instance = instance + child.serialize()
-        child = child.next
-
-    try:
-        doc = libxml2.parseDoc(instance)
-    except:
-        doc = None
-
-    if doc is None:
-        log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        return
-
-    try:
-        ctxt = schema.relaxNGNewValidCtxt()
-        ret = doc.relaxNGValidateDoc(ctxt)
-    except:
-        ret = -1
-    if ret == 0:
-        log.write("\nFailed to detect validation problem in instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-    else:
-        nb_instances_success = nb_instances_success + 1
-    doc.freeDoc()
-
-#
-# handle an incorrect test
-#
-def handle_correct(node):
-    global log
-    global nb_schemas_success
-    global nb_schemas_failed
-
-    schema = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            schema = schema + child.serialize()
-        child = child.next
-
-    try:
-        rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
-        rngs = rngp.relaxNGParse()
-    except:
-        rngs = None
-    if rngs is None:
-        log.write("\nFailed to compile correct schema:\n-----\n")
-        log.write(schema)
-        log.write("\n-----\n")
-        nb_schemas_failed = nb_schemas_failed + 1
-    else:
-        nb_schemas_success = nb_schemas_success + 1
-    return rngs
-
-def handle_incorrect(node):
-    global log
-    global nb_schemas_success
-    global nb_schemas_failed
-
-    schema = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            schema = schema + child.serialize()
-        child = child.next
-
-    try:
-        rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
-        rngs = rngp.relaxNGParse()
-    except:
-        rngs = None
-    if rngs != None:
-        log.write("\nFailed to detect schema error in:\n-----\n")
-        log.write(schema)
-        log.write("\n-----\n")
-        nb_schemas_failed = nb_schemas_failed + 1
-    else:
-#        log.write("\nSuccess detecting schema error in:\n-----\n")
-#        log.write(schema)
-#        log.write("\n-----\n")
-        nb_schemas_success = nb_schemas_success + 1
-    return None
-
-#
-# resource handling: keep a dictionary of URL->string mappings
-#
-def handle_resource(node, dir):
-    global resources
-
-    try:
-        name = node.prop('name')
-    except:
-        name = None
-
-    if name is None or name == '':
-        log.write("resource has no name")
-        return;
-
-    if dir != None:
-#        name = libxml2.buildURI(name, dir)
-        name = dir + '/' + name
-
-    res = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            res = res + child.serialize()
-        child = child.next
-    resources[name] = res
-
-#
-# dir handling: pseudo directory resources
-#
-def handle_dir(node, dir):
-    try:
-        name = node.prop('name')
-    except:
-        name = None
-
-    if name is None or name == '':
-        log.write("resource has no name")
-        return;
-
-    if dir != None:
-#        name = libxml2.buildURI(name, dir)
-        name = dir + '/' + name
-
-    dirs = node.xpathEval('dir')
-    for dir in dirs:
-        handle_dir(dir, name)
-    res = node.xpathEval('resource')
-    for r in res:
-        handle_resource(r, name)
-
-#
-# handle a testCase element
-#
-def handle_testCase(node):
-    global nb_schemas_tests
-    global nb_instances_tests
-    global resources
-
-    sections = node.xpathEval('string(section)')
-    log.write("\n    ======== test %d line %d section %s ==========\n" % (
-
-              nb_schemas_tests, node.lineNo(), sections))
-    resources = {}
-    if debug:
-        print("test %d line %d" % (nb_schemas_tests, node.lineNo()))
-
-    dirs = node.xpathEval('dir')
-    for dir in dirs:
-        handle_dir(dir, None)
-    res = node.xpathEval('resource')
-    for r in res:
-        handle_resource(r, None)
-
-    tsts = node.xpathEval('incorrect')
-    if tsts != []:
-        if len(tsts) != 1:
-            print("warning test line %d has more than one <incorrect> example" %(node.lineNo()))
-        schema = handle_incorrect(tsts[0])
-    else:
-        tsts = node.xpathEval('correct')
-        if tsts != []:
-            if len(tsts) != 1:
-                print("warning test line %d has more than one <correct> example"% (node.lineNo()))
-            schema = handle_correct(tsts[0])
-        else:
-            print("warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo()))
-
-    nb_schemas_tests = nb_schemas_tests + 1;
-
-    valids = node.xpathEval('valid')
-    invalids = node.xpathEval('invalid')
-    nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
-    if schema != None:
-        for valid in valids:
-            handle_valid(valid, schema)
-        for invalid in invalids:
-            handle_invalid(invalid, schema)
-
-
-#
-# handle a testSuite element
-#
-def handle_testSuite(node, level = 0):
-    global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
-    global nb_instances_tests, nb_instances_success, nb_instances_failed
-    global quiet
-    if level >= 1:
-        old_schemas_tests = nb_schemas_tests
-        old_schemas_success = nb_schemas_success
-        old_schemas_failed = nb_schemas_failed
-        old_instances_tests = nb_instances_tests
-        old_instances_success = nb_instances_success
-        old_instances_failed = nb_instances_failed
-
-    docs = node.xpathEval('documentation')
-    authors = node.xpathEval('author')
-    if docs != []:
-        msg = ""
-        for doc in docs:
-            msg = msg + doc.content + " "
-        if authors != []:
-            msg = msg + "written by "
-            for author in authors:
-                msg = msg + author.content + " "
-        if quiet == 0:
-            print(msg)
-    sections = node.xpathEval('section')
-    if sections != [] and level <= 0:
-        msg = ""
-        for section in sections:
-            msg = msg + section.content + " "
-        if quiet == 0:
-            print("Tests for section %s" % (msg))
-    for test in node.xpathEval('testCase'):
-        handle_testCase(test)
-    for test in node.xpathEval('testSuite'):
-        handle_testSuite(test, level + 1)
-
-
-    if verbose and level >= 1 and sections != []:
-        msg = ""
-        for section in sections:
-            msg = msg + section.content + " "
-        print("Result of tests for section %s" % (msg))
-        if nb_schemas_tests != old_schemas_tests:
-            print("found %d test schemas: %d success %d failures" % (
-                  nb_schemas_tests - old_schemas_tests,
-                  nb_schemas_success - old_schemas_success,
-                  nb_schemas_failed - old_schemas_failed))
-        if nb_instances_tests != old_instances_tests:
-            print("found %d test instances: %d success %d failures" % (
-                  nb_instances_tests - old_instances_tests,
-                  nb_instances_success - old_instances_success,
-                  nb_instances_failed - old_instances_failed))
-#
-# Parse the conf file
-#
-libxml2.substituteEntitiesDefault(1);
-testsuite = libxml2.parseFile(CONF)
-libxml2.setEntityLoader(resolver)
-root = testsuite.getRootElement()
-if root.name != 'testSuite':
-    print("%s doesn't start with a testSuite element, aborting" % (CONF))
-    sys.exit(1)
-if quiet == 0:
-    print("Running Relax NG testsuite")
-handle_testSuite(root)
-
-if quiet == 0:
-    print("\nTOTAL:\n")
-if quiet == 0 or nb_schemas_failed != 0:
-    print("found %d test schemas: %d success %d failures" % (
-      nb_schemas_tests, nb_schemas_success, nb_schemas_failed))
-if quiet == 0 or nb_instances_failed != 0:
-    print("found %d test instances: %d success %d failures" % (
-      nb_instances_tests, nb_instances_success, nb_instances_failed))
-
-testsuite.freeDoc()
-
-# Memory debug specific
-libxml2.relaxNGCleanupTypes()
-libxml2.cleanupParser()
-if libxml2.debugMemory(1) == 0:
-    if quiet == 0:
-        print("OK")
-else:
-    print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
diff --git a/check-relaxng-test-suite2.py b/check-relaxng-test-suite2.py
deleted file mode 100755
index 779cefa..0000000
--- a/check-relaxng-test-suite2.py
+++ /dev/null
@@ -1,421 +0,0 @@
-#!/usr/bin/env python3
-import sys
-import time
-import os
-try:
-    # Python 2
-    from StringIO import StringIO
-except ImportError:
-    # Python 3
-    from io import StringIO
-sys.path.insert(0, "python")
-import libxml2
-
-# Memory debug specific
-libxml2.debugMemory(1)
-debug = 0
-quiet = 1
-
-#
-# the testsuite description
-#
-CONF=os.path.join(os.path.dirname(__file__), "test/relaxng/testsuite.xml")
-LOG="check-relaxng-test-suite2.log"
-
-log = open(LOG, "w")
-nb_schemas_tests = 0
-nb_schemas_success = 0
-nb_schemas_failed = 0
-nb_instances_tests = 0
-nb_instances_success = 0
-nb_instances_failed = 0
-
-libxml2.lineNumbersDefault(1)
-#
-# Resolver callback
-#
-resources = {}
-def resolver(URL, ID, ctxt):
-    global resources
-
-    if URL in resources:
-        return(StringIO(resources[URL]))
-    log.write("Resolver failure: asked %s\n" % (URL))
-    log.write("resources: %s\n" % (resources))
-    return None
-
-#
-# Load the previous results
-#
-#results = {}
-#previous = {}
-#
-#try:
-#    res = libxml2.parseFile(RES)
-#except:
-#    log.write("Could not parse %s" % (RES))
-
-#
-# handle a valid instance
-#
-def handle_valid(node, schema):
-    global log
-    global nb_instances_success
-    global nb_instances_failed
-
-    instance = node.prop("dtd")
-    if instance is None:
-        instance = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            instance = instance + child.serialize()
-        child = child.next
-
-#    mem = libxml2.debugMemory(1);
-    try:
-        doc = libxml2.parseDoc(instance)
-    except:
-        doc = None
-
-    if doc is None:
-        log.write("\nFailed to parse correct instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-        return
-
-    if debug:
-        print("instance line %d" % (node.lineNo()))
-
-    try:
-        ctxt = schema.relaxNGNewValidCtxt()
-        ret = doc.relaxNGValidateDoc(ctxt)
-        del ctxt
-    except:
-        ret = -1
-
-    doc.freeDoc()
-#    if mem != libxml2.debugMemory(1):
-#        print("validating instance %d line %d leaks" % (
-#                  nb_instances_tests, node.lineNo()))
-
-    if ret != 0:
-        log.write("\nFailed to validate correct instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-    else:
-        nb_instances_success = nb_instances_success + 1
-
-#
-# handle an invalid instance
-#
-def handle_invalid(node, schema):
-    global log
-    global nb_instances_success
-    global nb_instances_failed
-
-    instance = node.prop("dtd")
-    if instance is None:
-        instance = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            instance = instance + child.serialize()
-        child = child.next
-
-#    mem = libxml2.debugMemory(1);
-
-    try:
-        doc = libxml2.parseDoc(instance)
-    except:
-        doc = None
-
-    if doc is None:
-        log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        return
-
-    if debug:
-        print("instance line %d" % (node.lineNo()))
-
-    try:
-        ctxt = schema.relaxNGNewValidCtxt()
-        ret = doc.relaxNGValidateDoc(ctxt)
-        del ctxt
-
-    except:
-        ret = -1
-
-    doc.freeDoc()
-#    mem2 = libxml2.debugMemory(1)
-#    if mem != mem2:
-#        print("validating instance %d line %d leaks %d bytes" % (
-#                  nb_instances_tests, node.lineNo(), mem2 - mem))
-
-    if ret == 0:
-        log.write("\nFailed to detect validation problem in instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-    else:
-        nb_instances_success = nb_instances_success + 1
-
-#
-# handle an incorrect test
-#
-def handle_correct(node):
-    global log
-    global nb_schemas_success
-    global nb_schemas_failed
-
-    schema = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            schema = schema + child.serialize()
-        child = child.next
-
-    try:
-        rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
-        rngs = rngp.relaxNGParse()
-    except:
-        rngs = None
-    if rngs is None:
-        log.write("\nFailed to compile correct schema:\n-----\n")
-        log.write(schema)
-        log.write("\n-----\n")
-        nb_schemas_failed = nb_schemas_failed + 1
-    else:
-        nb_schemas_success = nb_schemas_success + 1
-    return rngs
-
-def handle_incorrect(node):
-    global log
-    global nb_schemas_success
-    global nb_schemas_failed
-
-    schema = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            schema = schema + child.serialize()
-        child = child.next
-
-    try:
-        rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
-        rngs = rngp.relaxNGParse()
-    except:
-        rngs = None
-    if rngs != None:
-        log.write("\nFailed to detect schema error in:\n-----\n")
-        log.write(schema)
-        log.write("\n-----\n")
-        nb_schemas_failed = nb_schemas_failed + 1
-    else:
-#        log.write("\nSuccess detecting schema error in:\n-----\n")
-#        log.write(schema)
-#        log.write("\n-----\n")
-        nb_schemas_success = nb_schemas_success + 1
-    return None
-
-#
-# resource handling: keep a dictionary of URL->string mappings
-#
-def handle_resource(node, dir):
-    global resources
-
-    try:
-        name = node.prop('name')
-    except:
-        name = None
-
-    if name is None or name == '':
-        log.write("resource has no name")
-        return;
-
-    if dir != None:
-#        name = libxml2.buildURI(name, dir)
-        name = dir + '/' + name
-
-    res = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            res = res + child.serialize()
-        child = child.next
-    resources[name] = res
-
-#
-# dir handling: pseudo directory resources
-#
-def handle_dir(node, dir):
-    try:
-        name = node.prop('name')
-    except:
-        name = None
-
-    if name is None or name == '':
-        log.write("resource has no name")
-        return;
-
-    if dir != None:
-#        name = libxml2.buildURI(name, dir)
-        name = dir + '/' + name
-
-    dirs = node.xpathEval('dir')
-    for dir in dirs:
-        handle_dir(dir, name)
-    res = node.xpathEval('resource')
-    for r in res:
-        handle_resource(r, name)
-
-#
-# handle a testCase element
-#
-def handle_testCase(node):
-    global nb_schemas_tests
-    global nb_instances_tests
-    global resources
-
-    sections = node.xpathEval('string(section)')
-    log.write("\n    ======== test %d line %d section %s ==========\n" % (
-
-              nb_schemas_tests, node.lineNo(), sections))
-    resources = {}
-    if debug:
-        print("test %d line %d" % (nb_schemas_tests, node.lineNo()))
-
-    dirs = node.xpathEval('dir')
-    for dir in dirs:
-        handle_dir(dir, None)
-    res = node.xpathEval('resource')
-    for r in res:
-        handle_resource(r, None)
-
-    tsts = node.xpathEval('incorrect')
-    if tsts != []:
-        if len(tsts) != 1:
-            print("warning test line %d has more than one <incorrect> example" %(node.lineNo()))
-        schema = handle_incorrect(tsts[0])
-    else:
-        tsts = node.xpathEval('correct')
-        if tsts != []:
-            if len(tsts) != 1:
-                print("warning test line %d has more than one <correct> example"% (node.lineNo()))
-            schema = handle_correct(tsts[0])
-        else:
-            print("warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo()))
-
-    nb_schemas_tests = nb_schemas_tests + 1;
-
-    valids = node.xpathEval('valid')
-    invalids = node.xpathEval('invalid')
-    nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
-    if schema != None:
-        for valid in valids:
-            handle_valid(valid, schema)
-        for invalid in invalids:
-            handle_invalid(invalid, schema)
-
-
-#
-# handle a testSuite element
-#
-def handle_testSuite(node, level = 0):
-    global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
-    global nb_instances_tests, nb_instances_success, nb_instances_failed
-    if level >= 1:
-        old_schemas_tests = nb_schemas_tests
-        old_schemas_success = nb_schemas_success
-        old_schemas_failed = nb_schemas_failed
-        old_instances_tests = nb_instances_tests
-        old_instances_success = nb_instances_success
-        old_instances_failed = nb_instances_failed
-
-    docs = node.xpathEval('documentation')
-    authors = node.xpathEval('author')
-    if docs != []:
-        msg = ""
-        for doc in docs:
-            msg = msg + doc.content + " "
-        if authors != []:
-            msg = msg + "written by "
-            for author in authors:
-                msg = msg + author.content + " "
-        if quiet == 0:
-            print(msg)
-    sections = node.xpathEval('section')
-    if sections != [] and level <= 0:
-        msg = ""
-        for section in sections:
-            msg = msg + section.content + " "
-        if quiet == 0:
-            print("Tests for section %s" % (msg))
-    for test in node.xpathEval('testCase'):
-        handle_testCase(test)
-    for test in node.xpathEval('testSuite'):
-        handle_testSuite(test, level + 1)
-
-
-    if level >= 1 and sections != []:
-        msg = ""
-        for section in sections:
-            msg = msg + section.content + " "
-        print("Result of tests for section %s" % (msg))
-        if nb_schemas_tests != old_schemas_tests:
-            print("found %d test schemas: %d success %d failures" % (
-                  nb_schemas_tests - old_schemas_tests,
-                  nb_schemas_success - old_schemas_success,
-                  nb_schemas_failed - old_schemas_failed))
-        if nb_instances_tests != old_instances_tests:
-            print("found %d test instances: %d success %d failures" % (
-                  nb_instances_tests - old_instances_tests,
-                  nb_instances_success - old_instances_success,
-                  nb_instances_failed - old_instances_failed))
-#
-# Parse the conf file
-#
-libxml2.substituteEntitiesDefault(1);
-testsuite = libxml2.parseFile(CONF)
-
-#
-# Error and warnng callbacks
-#
-def callback(ctx, str):
-    global log
-    log.write("%s%s" % (ctx, str))
-
-libxml2.registerErrorHandler(callback, "")
-
-libxml2.setEntityLoader(resolver)
-root = testsuite.getRootElement()
-if root.name != 'testSuite':
-    print("%s doesn't start with a testSuite element, aborting" % (CONF))
-    sys.exit(1)
-if quiet == 0:
-    print("Running Relax NG testsuite")
-handle_testSuite(root)
-
-if quiet == 0:
-    print("\nTOTAL:\n")
-if quiet == 0 or nb_schemas_failed != 0:
-    print("found %d test schemas: %d success %d failures" % (
-      nb_schemas_tests, nb_schemas_success, nb_schemas_failed))
-if quiet == 0 or nb_instances_failed != 0:
-    print("found %d test instances: %d success %d failures" % (
-      nb_instances_tests, nb_instances_success, nb_instances_failed))
-
-log.close()
-testsuite.freeDoc()
-
-# Memory debug specific
-libxml2.relaxNGCleanupTypes()
-libxml2.cleanupParser()
-if libxml2.debugMemory(1) == 0:
-    if quiet == 0:
-        print("OK")
-else:
-    print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
diff --git a/check-xinclude-test-suite.py b/check-xinclude-test-suite.py
deleted file mode 100755
index a0ee028..0000000
--- a/check-xinclude-test-suite.py
+++ /dev/null
@@ -1,220 +0,0 @@
-#!/usr/bin/env python3
-import sys
-import time
-import os
-sys.path.insert(0, "python")
-import libxml2
-
-#
-# the testsuite description
-#
-DIR="xinclude-test-suite"
-CONF="testdescr.xml"
-LOG="check-xinclude-test-suite.log"
-
-log = open(LOG, "w")
-
-os.chdir(DIR)
-
-test_nr = 0
-test_succeed = 0
-test_failed = 0
-test_error = 0
-#
-# Error and warning handlers
-#
-error_nr = 0
-error_msg = ''
-
-def errorHandler(ctx, str):
-    global error_nr
-    global error_msg
-
-    if str.find("error:") >= 0:
-        error_nr = error_nr + 1
-    if len(error_msg) < 300:
-        if len(error_msg) == 0 or error_msg[-1] == '\n':
-            error_msg = error_msg + "   >>" + str
-        else:
-            error_msg = error_msg + str
-
-libxml2.registerErrorHandler(errorHandler, None)
-
-def testXInclude(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    print("testXInclude(%s, %s)" % (filename, id))
-    return 1
-
-def runTest(test, basedir):
-    global test_nr
-    global test_failed
-    global test_error
-    global test_succeed
-    global error_msg
-    global log
-
-    fatal_error = 0
-    uri = test.prop('href')
-    id = test.prop('id')
-    type = test.prop('type')
-    if uri is None:
-        print("Test without ID:", uri)
-        return -1
-    if id is None:
-        print("Test without URI:", id)
-        return -1
-    if type is None:
-        print("Test without URI:", id)
-        return -1
-    if basedir != None:
-        URI = basedir + "/" + uri
-    else:
-        URI = uri
-    if os.access(URI, os.R_OK) == 0:
-        print("Test %s missing: base %s uri %s" % (URI, basedir, uri))
-        return -1
-
-    expected = None
-    outputfile = None
-    diff = None
-    if type != 'error':
-        output = test.xpathEval('string(output)')
-        if output == 'No output file.':
-            output = None
-        if output == '':
-            output = None
-        if output != None:
-            if basedir != None:
-                output = basedir + "/" + output
-            if os.access(output, os.R_OK) == 0:
-                print("Result for %s missing: %s" % (id, output))
-                output = None
-            else:
-                try:
-                    f = open(output)
-                    expected = f.read()
-                    outputfile = output
-                except:
-                    print("Result for %s unreadable: %s" % (id, output))
-
-    try:
-        # print("testing %s" % (URI))
-        doc = libxml2.parseFile(URI)
-    except:
-        doc = None
-    if doc != None:
-        res = doc.xincludeProcess()
-        if res >= 0 and expected != None:
-            result = doc.serialize()
-            if result != expected:
-                print("Result for %s differs" % (id))
-                open("xinclude.res", "w").write(result)
-                diff = os.popen("diff %s xinclude.res" % outputfile).read()
-
-        doc.freeDoc()
-    else:
-        print("Failed to parse %s" % (URI))
-        res = -1
-
-
-
-    test_nr = test_nr + 1
-    if type == 'success':
-        if res > 0:
-            test_succeed = test_succeed + 1
-        elif res == 0:
-            test_failed = test_failed + 1
-            print("Test %s: no substitution done ???" % (id))
-        elif res < 0:
-            test_error = test_error + 1
-            print("Test %s: failed valid XInclude processing" % (id))
-    elif type == 'error':
-        if res > 0:
-            test_error = test_error + 1
-            print("Test %s: failed to detect invalid XInclude processing" % (id))
-        elif res == 0:
-            test_failed = test_failed + 1
-            print("Test %s: Invalid but no substitution done" % (id))
-        elif res < 0:
-            test_succeed = test_succeed + 1
-    elif type == 'optional':
-        if res > 0:
-            test_succeed = test_succeed + 1
-        else:
-            print("Test %s: failed optional test" % (id))
-
-    # Log the ontext
-    if res != 1:
-        log.write("Test ID %s\n" % (id))
-        log.write("   File: %s\n" % (URI))
-        content = test.content.strip()
-        while content[-1] == '\n':
-            content = content[0:-1]
-        log.write("   %s:%s\n\n" % (type, content))
-        if error_msg != '':
-            log.write("   ----\n%s   ----\n" % (error_msg))
-            error_msg = ''
-        log.write("\n")
-    if diff != None:
-        log.write("diff from test %s:\n" %(id))
-        log.write("   -----------\n%s\n   -----------\n" % (diff));
-
-    return 0
-
-
-def runTestCases(case):
-    creator = case.prop('creator')
-    if creator != None:
-        print("=>", creator)
-    base = case.getBase(None)
-    basedir = case.prop('basedir')
-    if basedir != None:
-        base = libxml2.buildURI(basedir, base)
-    test = case.children
-    while test != None:
-        if test.name == 'testcase':
-            runTest(test, base)
-        if test.name == 'testcases':
-            runTestCases(test)
-        test = test.next
-
-conf = libxml2.parseFile(CONF)
-if conf is None:
-    print("Unable to load %s" % CONF)
-    sys.exit(1)
-
-testsuite = conf.getRootElement()
-if testsuite.name != 'testsuite':
-    print("Expecting TESTSUITE root element: aborting")
-    sys.exit(1)
-
-profile = testsuite.prop('PROFILE')
-if profile != None:
-    print(profile)
-
-start = time.time()
-
-case = testsuite.children
-while case != None:
-    if case.name == 'testcases':
-        old_test_nr = test_nr
-        old_test_succeed = test_succeed
-        old_test_failed = test_failed
-        old_test_error = test_error
-        runTestCases(case)
-        print("   Ran %d tests: %d succeeded, %d failed and %d generated an error" % (
-               test_nr - old_test_nr, test_succeed - old_test_succeed,
-               test_failed - old_test_failed, test_error - old_test_error))
-    case = case.next
-
-conf.freeDoc()
-log.close()
-
-print("Ran %d tests: %d succeeded, %d failed and %d generated an error in %.2f s." % (
-      test_nr, test_succeed, test_failed, test_error, time.time() - start))
diff --git a/check-xml-test-suite.py b/check-xml-test-suite.py
deleted file mode 100755
index 284f7f0..0000000
--- a/check-xml-test-suite.py
+++ /dev/null
@@ -1,408 +0,0 @@
-#!/usr/bin/env python3
-import sys
-import time
-import os
-sys.path.insert(0, "python")
-import libxml2
-
-test_nr = 0
-test_succeed = 0
-test_failed = 0
-test_error = 0
-
-#
-# the testsuite description
-#
-CONF="xml-test-suite/xmlconf/xmlconf.xml"
-LOG="check-xml-test-suite.log"
-
-log = open(LOG, "w")
-
-#
-# Error and warning handlers
-#
-error_nr = 0
-error_msg = ''
-def errorHandler(ctx, str):
-    global error_nr
-    global error_msg
-
-    error_nr = error_nr + 1
-    if len(error_msg) < 300:
-        if len(error_msg) == 0 or error_msg[-1] == '\n':
-            error_msg = error_msg + "   >>" + str
-        else:
-            error_msg = error_msg + str
-
-libxml2.registerErrorHandler(errorHandler, None)
-
-#warning_nr = 0
-#warning = ''
-#def warningHandler(ctx, str):
-#    global warning_nr
-#    global warning
-#
-#    warning_nr = warning_nr + 1
-#    warning = warning + str
-#
-#libxml2.registerWarningHandler(warningHandler, None)
-
-#
-# Used to load the XML testsuite description
-#
-def loadNoentDoc(filename):
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return None
-    ctxt.replaceEntities(1)
-    ctxt.parseDocument()
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    if ctxt.wellFormed() != 1:
-        doc.freeDoc()
-        return None
-    return doc
-
-#
-# The conformance testing routines
-#
-
-def testNotWf(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ret = ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    if doc != None:
-        doc.freeDoc()
-    if ret == 0 or ctxt.wellFormed() != 0:
-        print("%s: error: Well Formedness error not detected" % (id))
-        log.write("%s: error: Well Formedness error not detected\n" % (id))
-        return 0
-    return 1
-
-def testNotWfEnt(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ctxt.replaceEntities(1)
-    ret = ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    if doc != None:
-        doc.freeDoc()
-    if ret == 0 or ctxt.wellFormed() != 0:
-        print("%s: error: Well Formedness error not detected" % (id))
-        log.write("%s: error: Well Formedness error not detected\n" % (id))
-        return 0
-    return 1
-
-def testNotWfEntDtd(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ctxt.replaceEntities(1)
-    ctxt.loadSubset(1)
-    ret = ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    if doc != None:
-        doc.freeDoc()
-    if ret == 0 or ctxt.wellFormed() != 0:
-        print("%s: error: Well Formedness error not detected" % (id))
-        log.write("%s: error: Well Formedness error not detected\n" % (id))
-        return 0
-    return 1
-
-def testWfEntDtd(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ctxt.replaceEntities(1)
-    ctxt.loadSubset(1)
-    ret = ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    if doc is None or ret != 0 or ctxt.wellFormed() == 0:
-        print("%s: error: wrongly failed to parse the document" % (id))
-        log.write("%s: error: wrongly failed to parse the document\n" % (id))
-        if doc != None:
-            doc.freeDoc()
-        return 0
-    if error_nr != 0:
-        print("%s: warning: WF document generated an error msg" % (id))
-        log.write("%s: error: WF document generated an error msg\n" % (id))
-        doc.freeDoc()
-        return 2
-    doc.freeDoc()
-    return 1
-
-def testError(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ctxt.replaceEntities(1)
-    ctxt.loadSubset(1)
-    ret = ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    if doc != None:
-        doc.freeDoc()
-    if ctxt.wellFormed() == 0:
-        print("%s: warning: failed to parse the document but accepted" % (id))
-        log.write("%s: warning: failed to parse the document but accepte\n" % (id))
-        return 2
-    if error_nr != 0:
-        print("%s: warning: WF document generated an error msg" % (id))
-        log.write("%s: error: WF document generated an error msg\n" % (id))
-        return 2
-    return 1
-
-def testInvalid(filename, id):
-    global error_nr
-    global error_msg
-    global log
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ctxt.validate(1)
-    ret = ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    valid = ctxt.isValid()
-    if doc is None:
-        print("%s: error: wrongly failed to parse the document" % (id))
-        log.write("%s: error: wrongly failed to parse the document\n" % (id))
-        return 0
-    if valid == 1:
-        print("%s: error: Validity error not detected" % (id))
-        log.write("%s: error: Validity error not detected\n" % (id))
-        doc.freeDoc()
-        return 0
-    if error_nr == 0:
-        print("%s: warning: Validity error not reported" % (id))
-        log.write("%s: warning: Validity error not reported\n" % (id))
-        doc.freeDoc()
-        return 2
-
-    doc.freeDoc()
-    return 1
-
-def testValid(filename, id):
-    global error_nr
-    global error_msg
-
-    error_nr = 0
-    error_msg = ''
-
-    ctxt = libxml2.createFileParserCtxt(filename)
-    if ctxt is None:
-        return -1
-    ctxt.validate(1)
-    ctxt.parseDocument()
-
-    try:
-        doc = ctxt.doc()
-    except:
-        doc = None
-    valid = ctxt.isValid()
-    if doc is None:
-        print("%s: error: wrongly failed to parse the document" % (id))
-        log.write("%s: error: wrongly failed to parse the document\n" % (id))
-        return 0
-    if valid != 1:
-        print("%s: error: Validity check failed" % (id))
-        log.write("%s: error: Validity check failed\n" % (id))
-        doc.freeDoc()
-        return 0
-    if error_nr != 0 or valid != 1:
-        print("%s: warning: valid document reported an error" % (id))
-        log.write("%s: warning: valid document reported an error\n" % (id))
-        doc.freeDoc()
-        return 2
-    doc.freeDoc()
-    return 1
-
-def runTest(test):
-    global test_nr
-    global test_succeed
-    global test_failed
-    global error_msg
-    global log
-
-    uri = test.prop('URI')
-    id = test.prop('ID')
-    if uri is None:
-        print("Test without ID:", uri)
-        return -1
-    if id is None:
-        print("Test without URI:", id)
-        return -1
-    base = test.getBase(None)
-    URI = libxml2.buildURI(uri, base)
-    if os.access(URI, os.R_OK) == 0:
-        print("Test %s missing: base %s uri %s" % (URI, base, uri))
-        return -1
-    type = test.prop('TYPE')
-    if type is None:
-        print("Test %s missing TYPE" % (id))
-        return -1
-
-    extra = None
-    if type == "invalid":
-        res = testInvalid(URI, id)
-    elif type == "valid":
-        res = testValid(URI, id)
-    elif type == "not-wf":
-        extra =  test.prop('ENTITIES')
-        # print(URI)
-        #if extra is None:
-        #    res = testNotWfEntDtd(URI, id)
-         #elif extra == 'none':
-        #    res = testNotWf(URI, id)
-        #elif extra == 'general':
-        #    res = testNotWfEnt(URI, id)
-        #elif extra == 'both' or extra == 'parameter':
-        res = testNotWfEntDtd(URI, id)
-        #else:
-        #    print("Unknown value %s for an ENTITIES test value" % (extra))
-        #    return -1
-    elif type == "error":
-        res = testError(URI, id)
-    else:
-        # TODO skipped for now
-        return -1
-
-    test_nr = test_nr + 1
-    if res > 0:
-        test_succeed = test_succeed + 1
-    elif res == 0:
-        test_failed = test_failed + 1
-    elif res < 0:
-        test_error = test_error + 1
-
-    # Log the ontext
-    if res != 1:
-        log.write("   File: %s\n" % (URI))
-        content = test.content.strip()
-        while content[-1] == '\n':
-            content = content[0:-1]
-        if extra != None:
-            log.write("   %s:%s:%s\n" % (type, extra, content))
-        else:
-            log.write("   %s:%s\n\n" % (type, content))
-        if error_msg != '':
-            log.write("   ----\n%s   ----\n" % (error_msg))
-            error_msg = ''
-        log.write("\n")
-
-    return 0
-
-
-def runTestCases(case):
-    profile = case.prop('PROFILE')
-    if profile != None and \
-       profile.find("IBM XML Conformance Test Suite - Production") < 0:
-        print("=>", profile)
-    test = case.children
-    while test != None:
-        if test.name == 'TEST':
-            runTest(test)
-        if test.name == 'TESTCASES':
-            runTestCases(test)
-        test = test.next
-
-conf = loadNoentDoc(CONF)
-if conf is None:
-    print("Unable to load %s" % CONF)
-    sys.exit(1)
-
-testsuite = conf.getRootElement()
-if testsuite.name != 'TESTSUITE':
-    print("Expecting TESTSUITE root element: aborting")
-    sys.exit(1)
-
-profile = testsuite.prop('PROFILE')
-if profile != None:
-    print(profile)
-
-start = time.time()
-
-case = testsuite.children
-while case != None:
-    if case.name == 'TESTCASES':
-        old_test_nr = test_nr
-        old_test_succeed = test_succeed
-        old_test_failed = test_failed
-        old_test_error = test_error
-        runTestCases(case)
-        print("   Ran %d tests: %d succeeded, %d failed and %d generated an error" % (
-               test_nr - old_test_nr, test_succeed - old_test_succeed,
-               test_failed - old_test_failed, test_error - old_test_error))
-    case = case.next
-
-conf.freeDoc()
-log.close()
-
-print("Ran %d tests: %d succeeded, %d failed and %d generated an error in %.2f s." % (
-      test_nr, test_succeed, test_failed, test_error, time.time() - start))
diff --git a/check-xsddata-test-suite.py b/check-xsddata-test-suite.py
deleted file mode 100755
index a08e6af..0000000
--- a/check-xsddata-test-suite.py
+++ /dev/null
@@ -1,423 +0,0 @@
-#!/usr/bin/env python3
-import sys
-import time
-import os
-try:
-    # Python 2
-    from StringIO import StringIO
-except ImportError:
-    # Python 3
-    from io import StringIO
-sys.path.insert(0, "python")
-import libxml2
-
-# Memory debug specific
-libxml2.debugMemory(1)
-debug = 0
-verbose = 0
-quiet = 1
-
-#
-# the testsuite description
-#
-CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml")
-LOG="check-xsddata-test-suite.log"
-
-log = open(LOG, "w")
-nb_schemas_tests = 0
-nb_schemas_success = 0
-nb_schemas_failed = 0
-nb_instances_tests = 0
-nb_instances_success = 0
-nb_instances_failed = 0
-
-libxml2.lineNumbersDefault(1)
-#
-# Error and warnng callbacks
-#
-def callback(ctx, str):
-    global log
-    log.write("%s%s" % (ctx, str))
-
-libxml2.registerErrorHandler(callback, "")
-
-#
-# Resolver callback
-#
-resources = {}
-def resolver(URL, ID, ctxt):
-    global resources
-
-    if URL in resources:
-        return(StringIO(resources[URL]))
-    log.write("Resolver failure: asked %s\n" % (URL))
-    log.write("resources: %s\n" % (resources))
-    return None
-
-#
-# handle a valid instance
-#
-def handle_valid(node, schema):
-    global log
-    global nb_instances_success
-    global nb_instances_failed
-
-    instance = node.prop("dtd")
-    if instance is None:
-        instance = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            instance = instance + child.serialize()
-        child = child.next
-
-    mem = libxml2.debugMemory(1);
-    try:
-        doc = libxml2.parseDoc(instance)
-    except:
-        doc = None
-
-    if doc is None:
-        log.write("\nFailed to parse correct instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-        return
-
-    if debug:
-        print("instance line %d" % (node.lineNo()))
-
-    try:
-        ctxt = schema.relaxNGNewValidCtxt()
-        ret = doc.relaxNGValidateDoc(ctxt)
-        del ctxt
-    except:
-        ret = -1
-
-    doc.freeDoc()
-    if mem != libxml2.debugMemory(1):
-        print("validating instance %d line %d leaks" % (
-                  nb_instances_tests, node.lineNo()))
-
-    if ret != 0:
-        log.write("\nFailed to validate correct instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-    else:
-        nb_instances_success = nb_instances_success + 1
-
-#
-# handle an invalid instance
-#
-def handle_invalid(node, schema):
-    global log
-    global nb_instances_success
-    global nb_instances_failed
-
-    instance = node.prop("dtd")
-    if instance is None:
-        instance = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            instance = instance + child.serialize()
-        child = child.next
-
-#    mem = libxml2.debugMemory(1);
-
-    try:
-        doc = libxml2.parseDoc(instance)
-    except:
-        doc = None
-
-    if doc is None:
-        log.write("\nStrange: failed to parse incorrect instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        return
-
-    if debug:
-        print("instance line %d" % (node.lineNo()))
-
-    try:
-        ctxt = schema.relaxNGNewValidCtxt()
-        ret = doc.relaxNGValidateDoc(ctxt)
-        del ctxt
-
-    except:
-        ret = -1
-
-    doc.freeDoc()
-#    if mem != libxml2.debugMemory(1):
-#        print("validating instance %d line %d leaks" % (
-#                  nb_instances_tests, node.lineNo()))
-
-    if ret == 0:
-        log.write("\nFailed to detect validation problem in instance:\n-----\n")
-        log.write(instance)
-        log.write("\n-----\n")
-        nb_instances_failed = nb_instances_failed + 1
-    else:
-        nb_instances_success = nb_instances_success + 1
-
-#
-# handle an incorrect test
-#
-def handle_correct(node):
-    global log
-    global nb_schemas_success
-    global nb_schemas_failed
-
-    schema = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            schema = schema + child.serialize()
-        child = child.next
-
-    try:
-        rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
-        rngs = rngp.relaxNGParse()
-    except:
-        rngs = None
-    if rngs is None:
-        log.write("\nFailed to compile correct schema:\n-----\n")
-        log.write(schema)
-        log.write("\n-----\n")
-        nb_schemas_failed = nb_schemas_failed + 1
-    else:
-        nb_schemas_success = nb_schemas_success + 1
-    return rngs
-
-def handle_incorrect(node):
-    global log
-    global nb_schemas_success
-    global nb_schemas_failed
-
-    schema = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            schema = schema + child.serialize()
-        child = child.next
-
-    try:
-        rngp = libxml2.relaxNGNewMemParserCtxt(schema, len(schema))
-        rngs = rngp.relaxNGParse()
-    except:
-        rngs = None
-    if rngs != None:
-        log.write("\nFailed to detect schema error in:\n-----\n")
-        log.write(schema)
-        log.write("\n-----\n")
-        nb_schemas_failed = nb_schemas_failed + 1
-    else:
-#        log.write("\nSuccess detecting schema error in:\n-----\n")
-#        log.write(schema)
-#        log.write("\n-----\n")
-        nb_schemas_success = nb_schemas_success + 1
-    return None
-
-#
-# resource handling: keep a dictionary of URL->string mappings
-#
-def handle_resource(node, dir):
-    global resources
-
-    try:
-        name = node.prop('name')
-    except:
-        name = None
-
-    if name is None or name == '':
-        log.write("resource has no name")
-        return;
-
-    if dir != None:
-#        name = libxml2.buildURI(name, dir)
-        name = dir + '/' + name
-
-    res = ""
-    child = node.children
-    while child != None:
-        if child.type != 'text':
-            res = res + child.serialize()
-        child = child.next
-    resources[name] = res
-
-#
-# dir handling: pseudo directory resources
-#
-def handle_dir(node, dir):
-    try:
-        name = node.prop('name')
-    except:
-        name = None
-
-    if name is None or name == '':
-        log.write("resource has no name")
-        return;
-
-    if dir != None:
-#        name = libxml2.buildURI(name, dir)
-        name = dir + '/' + name
-
-    dirs = node.xpathEval('dir')
-    for dir in dirs:
-        handle_dir(dir, name)
-    res = node.xpathEval('resource')
-    for r in res:
-        handle_resource(r, name)
-
-#
-# handle a testCase element
-#
-def handle_testCase(node):
-    global nb_schemas_tests
-    global nb_instances_tests
-    global resources
-
-    sections = node.xpathEval('string(section)')
-    log.write("\n    ======== test %d line %d section %s ==========\n" % (
-
-              nb_schemas_tests, node.lineNo(), sections))
-    resources = {}
-    if debug:
-        print("test %d line %d" % (nb_schemas_tests, node.lineNo()))
-
-    dirs = node.xpathEval('dir')
-    for dir in dirs:
-        handle_dir(dir, None)
-    res = node.xpathEval('resource')
-    for r in res:
-        handle_resource(r, None)
-
-    tsts = node.xpathEval('incorrect')
-    if tsts != []:
-        if len(tsts) != 1:
-            print("warning test line %d has more than one <incorrect> example" %(node.lineNo()))
-        schema = handle_incorrect(tsts[0])
-    else:
-        tsts = node.xpathEval('correct')
-        if tsts != []:
-            if len(tsts) != 1:
-                print("warning test line %d has more than one <correct> example"% (node.lineNo()))
-            schema = handle_correct(tsts[0])
-        else:
-            print("warning <testCase> line %d has no <correct> nor <incorrect> child" % (node.lineNo()))
-
-    nb_schemas_tests = nb_schemas_tests + 1;
-
-    valids = node.xpathEval('valid')
-    invalids = node.xpathEval('invalid')
-    nb_instances_tests = nb_instances_tests + len(valids) + len(invalids)
-    if schema != None:
-        for valid in valids:
-            handle_valid(valid, schema)
-        for invalid in invalids:
-            handle_invalid(invalid, schema)
-
-
-#
-# handle a testSuite element
-#
-def handle_testSuite(node, level = 0):
-    global nb_schemas_tests, nb_schemas_success, nb_schemas_failed
-    global nb_instances_tests, nb_instances_success, nb_instances_failed
-    if verbose and level >= 0:
-        old_schemas_tests = nb_schemas_tests
-        old_schemas_success = nb_schemas_success
-        old_schemas_failed = nb_schemas_failed
-        old_instances_tests = nb_instances_tests
-        old_instances_success = nb_instances_success
-        old_instances_failed = nb_instances_failed
-
-    docs = node.xpathEval('documentation')
-    authors = node.xpathEval('author')
-    if docs != []:
-        msg = ""
-        for doc in docs:
-            msg = msg + doc.content + " "
-        if authors != []:
-            msg = msg + "written by "
-            for author in authors:
-                msg = msg + author.content + " "
-        if quiet == 0:
-            print(msg)
-    sections = node.xpathEval('section')
-    if verbose and sections != [] and level <= 0:
-        msg = ""
-        for section in sections:
-            msg = msg + section.content + " "
-        if quiet == 0:
-            print("Tests for section %s" % (msg))
-    for test in node.xpathEval('testCase'):
-        handle_testCase(test)
-    for test in node.xpathEval('testSuite'):
-        handle_testSuite(test, level + 1)
-
-
-    if verbose and level >= 0 :
-        if sections != []:
-            msg = ""
-            for section in sections:
-                msg = msg + section.content + " "
-            print("Result of tests for section %s" % (msg))
-        elif docs != []:
-            msg = ""
-            for doc in docs:
-                msg = msg + doc.content + " "
-            print("Result of tests for %s" % (msg))
-
-        if nb_schemas_tests != old_schemas_tests:
-            print("found %d test schemas: %d success %d failures" % (
-                  nb_schemas_tests - old_schemas_tests,
-                  nb_schemas_success - old_schemas_success,
-                  nb_schemas_failed - old_schemas_failed))
-        if nb_instances_tests != old_instances_tests:
-            print("found %d test instances: %d success %d failures" % (
-                  nb_instances_tests - old_instances_tests,
-                  nb_instances_success - old_instances_success,
-                  nb_instances_failed - old_instances_failed))
-#
-# Parse the conf file
-#
-libxml2.substituteEntitiesDefault(1);
-testsuite = libxml2.parseFile(CONF)
-
-#
-# Error and warnng callbacks
-#
-def callback(ctx, str):
-    global log
-    log.write("%s%s" % (ctx, str))
-
-libxml2.registerErrorHandler(callback, "")
-
-libxml2.setEntityLoader(resolver)
-root = testsuite.getRootElement()
-if root.name != 'testSuite':
-    print("%s doesn't start with a testSuite element, aborting" % (CONF))
-    sys.exit(1)
-if quiet == 0:
-    print("Running Relax NG testsuite")
-handle_testSuite(root)
-
-if quiet == 0 or nb_schemas_failed != 0:
-    print("\nTOTAL:\nfound %d test schemas: %d success %d failures" % (
-      nb_schemas_tests, nb_schemas_success, nb_schemas_failed))
-if quiet == 0 or nb_instances_failed != 0:
-    print("found %d test instances: %d success %d failures" % (
-      nb_instances_tests, nb_instances_success, nb_instances_failed))
-
-testsuite.freeDoc()
-
-# Memory debug specific
-libxml2.relaxNGCleanupTypes()
-libxml2.cleanupParser()
-if libxml2.debugMemory(1) == 0:
-    if quiet == 0:
-        print("OK")
-else:
-    print("Memory leak %d bytes" % (libxml2.debugMemory(1)))
diff --git a/config.h b/config.h
index c0065cd..b91758d 100644
--- a/config.h
+++ b/config.h
@@ -1,14 +1,17 @@
 /* config.h.  Generated from config.h.in by configure.  */
 /* config.h.in.  Generated from configure.ac by autoheader.  */
 
-/* A form that will not confuse apibuild.py */
-#define ATTRIBUTE_DESTRUCTOR __attribute__((destructor))
+/* Define to 1 if you have the declaration of 'getentropy', and to 0 if you
+   don't. */
+#define HAVE_DECL_GETENTROPY 1
 
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-/* #undef HAVE_ARPA_INET_H */
+/* Define to 1 if you have the declaration of 'glob', and to 0 if you don't.
+   */
+#define HAVE_DECL_GLOB 1
 
-/* Define if __attribute__((destructor)) is accepted */
-#define HAVE_ATTRIBUTE_DESTRUCTOR 1
+/* Define to 1 if you have the declaration of 'mmap', and to 0 if you don't.
+   */
+#define HAVE_DECL_MMAP 1
 
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
@@ -16,65 +19,33 @@
 /* Have dlopen based dso */
 #define HAVE_DLOPEN /**/
 
-/* Define to 1 if you have the <dl.h> header file. */
-/* #undef HAVE_DL_H */
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the 'ftime' function. */
-#define HAVE_FTIME 1
+/* Define to 1 if the system has the `destructor' function attribute */
+#define HAVE_FUNC_ATTRIBUTE_DESTRUCTOR 1
 
 /* getentropy */
 #define HAVE_GETENTROPY 1
 
-/* Define to 1 if you have the 'gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
-
-/* Define to 1 if you have the <glob.h> header file. */
-#define HAVE_GLOB_H 1
-
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
-/* Define if history library is there (-lhistory) */
+/* Define if history library is available */
 /* #undef HAVE_LIBHISTORY */
 
-/* Define if readline library is there (-lreadline) */
+/* Define if readline library is available */
 /* #undef HAVE_LIBREADLINE */
 
 /* Define to 1 if you have the <lzma.h> header file. */
 /* #undef HAVE_LZMA_H */
 
-/* Define to 1 if you have the 'mmap' function. */
-#define HAVE_MMAP 1
-
-/* Define to 1 if you have the 'munmap' function. */
-#define HAVE_MUNMAP 1
-
-/* mmap() is no good without munmap() */
-#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
-#  undef /**/ HAVE_MMAP
-#endif
-
-/* Define to 1 if you have the <netdb.h> header file. */
-/* #undef HAVE_NETDB_H */
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-/* #undef HAVE_NETINET_IN_H */
-
 /* Define to 1 if you have the <poll.h> header file. */
 /* #undef HAVE_POLL_H */
 
 /* Define to 1 if you have the <pthread.h> header file. */
-#define HAVE_PTHREAD_H /**/
+#define HAVE_PTHREAD_H 1
 
 /* Have shl_load based dso */
 /* #undef HAVE_SHLLOAD */
 
-/* Define to 1 if you have the 'stat' function. */
-#define HAVE_STAT 1
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
 
@@ -90,27 +61,9 @@
 /* Define to 1 if you have the <string.h> header file. */
 #define HAVE_STRING_H 1
 
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#define HAVE_SYS_MMAN_H 1
-
-/* Define to 1 if you have the <sys/random.h> header file. */
-#define HAVE_SYS_RANDOM_H 1
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-/* #undef HAVE_SYS_SELECT_H */
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-/* #undef HAVE_SYS_SOCKET_H */
-
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #define HAVE_SYS_STAT_H 1
 
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#define HAVE_SYS_TIMEB_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
-
 /* Define to 1 if you have the <sys/types.h> header file. */
 #define HAVE_SYS_TYPES_H 1
 
@@ -133,7 +86,7 @@
 #define PACKAGE_NAME "libxml2"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libxml2 2.13.6"
+#define PACKAGE_STRING "libxml2 2.14.2"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libxml2"
@@ -142,21 +95,18 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "2.13.6"
+#define PACKAGE_VERSION "2.14.2"
 
 /* Define to 1 if all of the C89 standard headers exist (not just the ones
    required in a freestanding environment). This macro is provided for
    backward compatibility; new code need not use it. */
 #define STDC_HEADERS 1
 
-/* Support for IPv6 */
-/* #undef SUPPORT_IP6 */
-
 /* Version number of package */
-#define VERSION "2.13.6"
+#define VERSION "2.14.2"
 
-/* Determine what socket length (socklen_t) data type is */
-/* #undef XML_SOCKLEN_T */
+/* System configuration directory (/etc) */
+#define XML_SYSCONFDIR "/usr/local/etc"
 
 /* TLS specifier */
 /* #undef XML_THREAD_LOCAL */
diff --git a/config.h.cmake.in b/config.h.cmake.in
index 2f4aeba..a2f7d9b 100644
--- a/config.h.cmake.in
+++ b/config.h.cmake.in
@@ -1,106 +1,38 @@
-/* A form that will not confuse apibuild.py */
-#cmakedefine ATTRIBUTE_DESTRUCTOR @ATTRIBUTE_DESTRUCTOR@
+/* Define to 1 if you have the declaration of 'getentropy', and to 0 if you
+   don't. */
+#cmakedefine01 HAVE_DECL_GETENTROPY
 
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#cmakedefine HAVE_ARPA_INET_H 1
+/* Define to 1 if you have the declaration of 'glob', and to 0 if you don't.
+   */
+#cmakedefine01 HAVE_DECL_GLOB
+
+/* Define to 1 if you have the declaration of 'mmap', and to 0 if you don't.
+   */
+#cmakedefine01 HAVE_DECL_MMAP
 
 /* Define if __attribute__((destructor)) is accepted */
-#cmakedefine HAVE_ATTRIBUTE_DESTRUCTOR 1
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#cmakedefine HAVE_DLFCN_H 1
+#cmakedefine HAVE_FUNC_ATTRIBUTE_DESTRUCTOR 1
 
 /* Have dlopen based dso */
 #cmakedefine HAVE_DLOPEN 1
 
-/* Define to 1 if you have the <dl.h> header file. */
-#cmakedefine HAVE_DL_H 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#cmakedefine HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the `ftime' function. */
-#cmakedefine HAVE_FTIME 1
-
-/* Define to 1 if you have the `getentropy' function. */
-#cmakedefine HAVE_GETENTROPY 1
-
-/* Define to 1 if you have the `gettimeofday' function. */
-#cmakedefine HAVE_GETTIMEOFDAY 1
-
 /* Define if history library is there (-lhistory) */
 #cmakedefine HAVE_LIBHISTORY 1
 
 /* Define if readline library is there (-lreadline) */
 #cmakedefine HAVE_LIBREADLINE 1
 
-/* Define to 1 if you have the `mmap' function. */
-#cmakedefine HAVE_MMAP 1
-
-/* Define to 1 if you have the `munmap' function. */
-#cmakedefine HAVE_MUNMAP 1
-
-/* mmap() is no good without munmap() */
-#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
-#  undef /**/ HAVE_MMAP
-#endif
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#cmakedefine HAVE_NETDB_H 1
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#cmakedefine HAVE_NETINET_IN_H 1
-
 /* Define to 1 if you have the <poll.h> header file. */
 #cmakedefine HAVE_POLL_H 1
 
-/* Define to 1 if you have the <pthread.h> header file. */
-#cmakedefine HAVE_PTHREAD_H 1
-
 /* Have shl_load based dso */
 #cmakedefine HAVE_SHLLOAD 1
 
-/* Define to 1 if you have the `stat' function. */
-#cmakedefine HAVE_STAT 1
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #cmakedefine HAVE_STDINT_H 1
 
-/* Define to 1 if you have the <sys/mman.h> header file. */
-#cmakedefine HAVE_SYS_MMAN_H 1
-
-/* Define to 1 if you have the <sys/random.h> header file. */
-#cmakedefine HAVE_SYS_RANDOM_H 1
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#cmakedefine HAVE_SYS_SELECT_H 1
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#cmakedefine HAVE_SYS_SOCKET_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#cmakedefine HAVE_SYS_TIMEB_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#cmakedefine HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the <zlib.h> header file. */
-#cmakedefine HAVE_ZLIB_H 1
-
-/* Support for IPv6 */
-#cmakedefine SUPPORT_IP6 1
-
-/* Version number of package */
-#cmakedefine VERSION "@VERSION@"
-
-/* Determine what socket length (socklen_t) data type is */
-#cmakedefine XML_SOCKLEN_T @XML_SOCKLEN_T@
+/* System configuration directory (/etc) */
+#cmakedefine XML_SYSCONFDIR "@XML_SYSCONFDIR@"
 
 /* TLS specifier */
 #cmakedefine XML_THREAD_LOCAL @XML_THREAD_LOCAL@
diff --git a/configure.ac b/configure.ac
index 425e68f..855639f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,23 +1,26 @@
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ([2.63])
 
-m4_define([MAJOR_VERSION], 2)
-m4_define([MINOR_VERSION], 13)
-m4_define([MICRO_VERSION], 6)
+m4_define([version_macro], m4_normalize(m4_include([VERSION])))
 
-AC_INIT([libxml2],[MAJOR_VERSION.MINOR_VERSION.MICRO_VERSION])
+AC_INIT([libxml2],[version_macro])
 AC_CONFIG_SRCDIR([entities.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_AUX_DIR([.])
 AC_CANONICAL_HOST
 
-LIBXML_MAJOR_VERSION=MAJOR_VERSION
-LIBXML_MINOR_VERSION=MINOR_VERSION
-LIBXML_MICRO_VERSION=MICRO_VERSION
+LIBXML_VERSION=version_macro
+LIBXML_MAJOR_VERSION=`echo $LIBXML_VERSION | cut -d . -f 1`
+LIBXML_MINOR_VERSION=`echo $LIBXML_VERSION | cut -d . -f 2`
+LIBXML_MICRO_VERSION=`echo $LIBXML_VERSION | cut -d . -f 3`
 LIBXML_MICRO_VERSION_SUFFIX=
-LIBXML_VERSION=$LIBXML_MAJOR_VERSION.$LIBXML_MINOR_VERSION.$LIBXML_MICRO_VERSION$LIBXML_MICRO_VERSION_SUFFIX
-LIBXML_VERSION_INFO=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`:$LIBXML_MICRO_VERSION:$LIBXML_MINOR_VERSION
+
+# The oldest minor version we are compatible with.
+LIBXML_MINOR_COMPAT=14
+LIBXML_CURRENT=`expr $LIBXML_MAJOR_VERSION + $LIBXML_MINOR_VERSION`
+LIBXML_AGE=`expr $LIBXML_MINOR_VERSION - $LIBXML_MINOR_COMPAT`
+LIBXML_VERSION_INFO=$LIBXML_CURRENT:$LIBXML_MICRO_VERSION:$LIBXML_AGE
 
 LIBXML_VERSION_NUMBER=`expr $LIBXML_MAJOR_VERSION \* 10000 + $LIBXML_MINOR_VERSION \* 100 + $LIBXML_MICRO_VERSION`
 
@@ -38,9 +41,7 @@
 AC_SUBST(LIBXML_VERSION_NUMBER)
 AC_SUBST(LIBXML_VERSION_EXTRA)
 
-VERSION=${LIBXML_VERSION}
-
-AM_INIT_AUTOMAKE([1.16.3 foreign no-dist-gzip dist-xz])
+AM_INIT_AUTOMAKE([1.16.3 foreign subdir-objects no-dist-gzip dist-xz])
 AM_MAINTAINER_MODE([enable])
 AM_SILENT_RULES([yes])
 
@@ -50,7 +51,6 @@
 AC_PROG_LN_S
 AC_PROG_MKDIR_P
 AC_PATH_PROG(TAR, tar, /bin/tar)
-AC_PATH_PROG(PERL, perl, /usr/bin/perl)
 AC_PATH_PROG(WGET, wget, /usr/bin/wget)
 AC_PATH_PROG(XSLTPROC, xsltproc, /usr/bin/xsltproc)
 PKG_PROG_PKG_CONFIG
@@ -69,13 +69,11 @@
 AC_ARG_WITH(catalog,
 [  --with-catalog          XML Catalogs support (on)])
 AC_ARG_WITH(debug,
-[  --with-debug            debugging module and shell (on)])
-AC_ARG_WITH(ftp,
-[  --with-ftp              FTP support (off)])
+[  --with-debug            debugging module (on)])
 AC_ARG_WITH(history,
-[  --with-history          history support for shell (off)])
+[  --with-history          history support for xmllint shell (off)])
 AC_ARG_WITH(readline,
-[  --with-readline[[=DIR]]   use readline in DIR (for shell history)])
+[  --with-readline[[=DIR]]   use readline in DIR for shell (off)])
 AC_ARG_WITH(html,
 [  --with-html             HTML parser (on)])
 AC_ARG_WITH(http,
@@ -102,18 +100,18 @@
 [  --with-reader           xmlReader parsing interface (on)])
 AC_ARG_WITH(regexps,
 [  --with-regexps          regular expressions support (on)])
+AC_ARG_WITH(relaxng,
+[  --with-relaxng          RELAX NG support (on)])
 AC_ARG_WITH(sax1,
 [  --with-sax1             older SAX1 interface (on)])
 AC_ARG_WITH(schemas,
-[  --with-schemas          XML Schemas 1.0 and RELAX NG support (on)])
+[  --with-schemas          XML Schemas 1.0 support (on)])
 AC_ARG_WITH(schematron,
 [  --with-schematron       Schematron support (on)])
 AC_ARG_WITH(threads,
 [  --with-threads          multithreading support (on)])
 AC_ARG_WITH(thread-alloc,
 [  --with-thread-alloc     per-thread malloc hooks (off)])
-AC_ARG_WITH(tree,
-[  --with-tree             DOM like tree manipulation APIs (on)])
 AC_ARG_WITH(valid,
 [  --with-valid            DTD validation support (on)])
 AC_ARG_WITH(writer,
@@ -124,8 +122,6 @@
 [  --with-xpath            XPath 1.0 support (on)])
 AC_ARG_WITH(xptr,
 [  --with-xptr             XPointer support (on)])
-AC_ARG_WITH(xptr-locs,
-[  --with-xptr-locs        XPointer ranges and points (off)])
 AC_ARG_WITH(zlib,
 [  --with-zlib[[=DIR]]       use libz in DIR (off)])
 
@@ -141,12 +137,6 @@
 dnl Legacy defaults
 dnl
 if test "$with_legacy" = "yes"; then
-    if test "$with_http" = ""; then
-        with_http=yes
-    fi
-    if test "$with_lzma" = ""; then
-        with_lzma=yes
-    fi
     if test "$with_zlib" = ""; then
         with_zlib=yes
     fi
@@ -165,6 +155,16 @@
     fi
     with_xpath=yes
 fi
+if test "$with_relaxng" = "yes"; then
+    if test "$with_regexps" = "no"; then
+        echo WARNING: --with-relaxng overrides --without-regexps
+    fi
+    with_regexps=yes
+    if test "$with_schemas" = "no"; then
+        echo WARNING: --with-relaxng overrides --without-schemas
+    fi
+    with_schemas=yes
+fi
 if test "$with_schemas" = "yes"; then
     if test "$with_pattern" = "no"; then
         echo WARNING: --with-schemas overrides --without-pattern
@@ -180,10 +180,6 @@
         echo WARNING: --with-schematron overrides --without-pattern
     fi
     with_pattern=yes
-    if test "$with_tree" = "no"; then
-        echo WARNING: --with-schematron overrides --without-tree
-    fi
-    with_tree=yes
     if test "$with_xpath" = "no"; then
         echo WARNING: --with-schematron overrides --without-xpath
     fi
@@ -194,10 +190,6 @@
         echo WARNING: --with-reader overrides --without-push
     fi
     with_push=yes
-    if test "$with_tree" = "no"; then
-        echo WARNING: --with-reader overrides --without-tree
-    fi
-    with_tree=yes
 fi
 if test "$with_writer" = "yes"; then
     if test "$with_output" = "no"; then
@@ -209,24 +201,21 @@
     fi
     with_push=yes
 fi
-if test "$with_xinclude" = "yes"; then
-    if test "$with_xpath" = "no"; then
-        echo WARNING: --with-xinclude overrides --without-xpath
-    fi
-    with_xpath=yes
-fi
-if test "$with_xptr_locs" = "yes"; then
-    if test "$with_xptr" = "no"; then
-        echo WARNING: --with-xptr-locs overrides --without-xptr
-    fi
-    with_xptr=yes
-fi
 if test "$with_xptr" = "yes"; then
     if test "$with_xpath" = "no"; then
         echo WARNING: --with-xptr overrides --without-xpath
     fi
     with_xpath=yes
 fi
+if test "$with_history" = "yes"; then
+    if test "$with_readline" = "no"; then
+        echo WARNING: --with-history overrides --without-readline
+        with_readline=yes
+    fi
+    if test "$with_readline" = ""; then
+        with_readline=yes
+    fi
+fi
 
 if test "$with_minimum" = "yes"; then
     dnl
@@ -249,12 +238,12 @@
     test "$with_reader" = "" && with_reader=no
     test "$with_readline" = "" && with_readline=no
     test "$with_regexps" = "" && with_regexps=no
+    test "$with_relaxng" = "" && with_relaxng=no
     test "$with_sax1" = "" && with_sax1=no
     test "$with_schemas" = "" && with_schemas=no
     test "$with_schematron" = "" && with_schematron=no
     test "$with_threads" = "" && with_threads=no
     test "$with_thread_alloc" = "" && with_thread_alloc=no
-    test "$with_tree" = "" && with_tree=no
     test "$with_valid" = "" && with_valid=no
     test "$with_writer" = "" && with_writer=no
     test "$with_xinclude" = "" && with_xinclude=no
@@ -279,44 +268,46 @@
         with_writer=no
     fi
     if test "$with_regexps" = "no"; then
+        with_relaxng=no
         with_schemas=no
     fi
-    if test "$with_tree" = "no"; then
-        with_reader=no
-        with_schematron=no
+    if test "$with_schemas" = "no"; then
+        with_relaxng=no
     fi
     if test "$with_xpath" = "no"; then
         with_c14n=no
         with_schematron=no
-        with_xinclude=no
         with_xptr=no
     fi
 fi
 
+dnl
+dnl Extra flags
+dnl
+XML_LIBDIR='-L${libdir}'
+XML_INCLUDEDIR='-I${includedir}/libxml2'
+XML_CFLAGS=""
+XML_STATIC_CFLAGS=""
+XML_PC_CFLAGS_PRIVATE=""
+
 XML_PRIVATE_LIBS=
 XML_PRIVATE_CFLAGS=
 XML_PC_LIBS=
 XML_PC_REQUIRES=
 
+AX_GCC_FUNC_ATTRIBUTE([destructor])
+
 dnl
 dnl Checks for header files.
 dnl
 AC_CHECK_HEADERS([stdint.h])
-AC_CHECK_HEADERS([fcntl.h unistd.h sys/stat.h])
-AC_CHECK_HEADERS([sys/mman.h])
-AC_CHECK_HEADERS([sys/time.h sys/timeb.h])
-AC_CHECK_HEADERS([sys/random.h])
-AC_CHECK_HEADERS([dl.h dlfcn.h])
-AC_CHECK_HEADERS([glob.h])
-AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_header_glob_h" = "yes")
 
 dnl Checks for library functions.
-AC_CHECK_FUNCS([gettimeofday ftime stat mmap munmap])
+AC_CHECK_DECLS([getentropy], [], [], [#include <sys/random.h>])
+AC_CHECK_DECLS([glob], [], [], [#include <glob.h>])
+AC_CHECK_DECLS([mmap], [], [], [#include <sys/mman.h>])
 
-AH_VERBATIM([HAVE_MUNMAP_AFTER],[/* mmap() is no good without munmap() */
-#if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP)
-#  undef /**/ HAVE_MMAP
-#endif])
+AM_CONDITIONAL(WITH_GLOB, test "$ac_cv_have_decl_glob" = "yes")
 
 AC_CHECK_DECL([getentropy],
               [AC_DEFINE([HAVE_GETENTROPY], [1], [getentropy])], [],
@@ -325,9 +316,8 @@
 dnl
 dnl Checks for inet libraries
 dnl
-if test "$with_http" = "yes" || test "$with_ftp" = "yes"; then
-    AC_CHECK_HEADERS([sys/socket.h netinet/in.h arpa/inet.h netdb.h])
-    AC_CHECK_HEADERS([sys/select.h poll.h])
+if test "$with_http" = "yes"; then
+    AC_CHECK_HEADERS([poll.h])
 
     case "$host" in
         *-*-mingw*)
@@ -349,72 +339,10 @@
             ;;
     esac
 
-    dnl Determine what socket length (socklen_t) data type is
-    AC_MSG_CHECKING([for type of socket length (socklen_t)])
-    AC_TRY_COMPILE2([
-    #include <stddef.h>
-    #ifdef _WIN32
-      #include <ws2tcpip.h>
-    #else
-      #include <sys/socket.h>
-    #endif],[
-    (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL)],[
-      AC_MSG_RESULT(socklen_t *)
-      XML_SOCKLEN_T=socklen_t],[
-      AC_TRY_COMPILE2([
-    #include <stddef.h>
-    #include <sys/socket.h>],[
-    (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL)],[
-        AC_MSG_RESULT(size_t *)
-        XML_SOCKLEN_T=size_t],[
-        AC_TRY_COMPILE2([
-    #include <stddef.h>
-    #include <sys/socket.h>],[
-    (void)getsockopt (1, 1, 1, NULL, (int *)NULL)],[
-          AC_MSG_RESULT(int *)
-          XML_SOCKLEN_T=int],[
-          AC_MSG_WARN(could not determine)
-          XML_SOCKLEN_T="int"])])])
-    AC_DEFINE_UNQUOTED(XML_SOCKLEN_T, $XML_SOCKLEN_T, [Determine what socket length (socklen_t) data type is])
-
-    dnl
-    dnl Checking for availability of IPv6
-    dnl
-    AC_ARG_ENABLE(ipv6, [  --enable-ipv6[[=yes/no]]  enables compilation of IPv6 code [[default=yes]]],, enable_ipv6=yes)
-    if test "$with_minimum" = "yes"
-    then
-        enable_ipv6=no
-    fi
-    if test $enable_ipv6 = yes; then
-        AC_MSG_CHECKING([whether to enable IPv6])
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-            #ifdef _WIN32
-              #include <winsock2.h>
-            #else
-              #include <sys/socket.h>
-              #ifdef HAVE_NETDB_H
-                #include <netdb.h>
-              #endif
-            #endif
-            ]], [[
-            struct sockaddr_storage ss;
-            socket(AF_INET6, SOCK_STREAM, 0);
-            getaddrinfo(0, 0, 0, 0);
-            ]])], [
-            AC_DEFINE([SUPPORT_IP6], [], [Support for IPv6])
-            AC_MSG_RESULT([yes])], [
-            AC_MSG_RESULT([no])]
-        )
-    fi
+    XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${NET_LIBS}"
+    XML_PC_LIBS="${XML_PC_LIBS} ${NET_LIBS}"
 fi
 
-dnl
-dnl Extra flags
-dnl
-XML_LIBDIR='-L${libdir}'
-XML_INCLUDEDIR='-I${includedir}/libxml2'
-XML_CFLAGS=""
-
 dnl Thread-local storage
 if test "$with_tls" = "yes"; then
     AC_COMPILE_IFELSE([
@@ -426,43 +354,9 @@
     AC_COMPILE_IFELSE([
         AC_LANG_SOURCE([__declspec(thread) int v;]) ], [
         AC_DEFINE([XML_THREAD_LOCAL], [__declspec(thread)], [TLS specifier]) ], [
-    WARN_NO_TLS=1 ])])])
+    ])])])
 fi
 
-dnl Checking whether __attribute__((destructor)) is accepted by the compiler
-AC_MSG_CHECKING([whether __attribute__((destructor)) is accepted])
-AC_TRY_COMPILE2([
-void __attribute__((destructor))
-f(void) {}], [], [
-  AC_MSG_RESULT(yes)
-  AC_DEFINE([HAVE_ATTRIBUTE_DESTRUCTOR], [1],[Define if __attribute__((destructor)) is accepted])
-  AC_DEFINE([ATTRIBUTE_DESTRUCTOR], [__attribute__((destructor))],[A form that will not confuse apibuild.py])],[
-  AC_MSG_RESULT(no)])
-
-dnl
-dnl Linker version scripts for symbol versioning
-dnl
-VERSION_SCRIPT_FLAGS=
-# lt_cv_prog_gnu_ld is from libtool 2.+
-if test "$lt_cv_prog_gnu_ld" = yes; then
-  case $host in
-    *-*-cygwin* | *-*-mingw* | *-*-msys* )
-      ;;
-    *)
-      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
-  case $host in
-  *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
-  esac
-fi
-AC_SUBST(VERSION_SCRIPT_FLAGS)
-AM_CONDITIONAL([USE_VERSION_SCRIPT], [test -n "$VERSION_SCRIPT_FLAGS"])
-
 dnl
 dnl Workaround for native compilers
 dnl  HP  : http://bugs.gnome.org/db/31/3163.html
@@ -484,7 +378,7 @@
     # warnings we'd like to see
     AM_CFLAGS="${AM_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes"
     # warnings we'd like to suppress
-    AM_CFLAGS="${AM_CFLAGS} -Wno-long-long -Wno-format-extra-args"
+    AM_CFLAGS="${AM_CFLAGS} -Wno-long-long -Wno-format-extra-args -Wno-array-bounds"
     case "${host}" in
           alpha*-*-linux* )
 	       AM_CFLAGS="${AM_CFLAGS} -mieee"
@@ -504,9 +398,13 @@
         # work properly (without it, xmlexports.h would force the use of
         # DLL imports, which obviously aren't present in a static
         # library).
-        if test "x$enable_shared" = "xno"; then
-            XML_CFLAGS="$XML_CFLAGS -DLIBXML_STATIC"
-            AM_CFLAGS="$AM_CFLAGS -DLIBXML_STATIC"
+        XML_STATIC_CFLAGS="-DLIBXML_STATIC"
+        if test "x$enable_shared" = "xyes"; then
+            XML_PC_CFLAGS_PRIVATE="
+Cflags.private:"
+        else
+            XML_CFLAGS="$XML_STATIC_CFLAGS"
+            AM_CFLAGS="$AM_CFLAGS $XML_STATIC_CFLAGS"
         fi
         ;;
 esac
@@ -516,23 +414,6 @@
 dnl Simple API modules
 dnl
 
-if test "$with_tree" = "no" ; then
-    echo Disabling DOM like tree manipulation APIs
-    WITH_TREE=0
-else
-    WITH_TREE=1
-fi
-AC_SUBST(WITH_TREE)
-
-if test "$with_ftp" != "yes" ; then
-    WITH_FTP=0
-else
-    echo Enabling FTP support
-    WITH_FTP=1
-fi
-AC_SUBST(WITH_FTP)
-AM_CONDITIONAL(WITH_FTP_SOURCES, test "$WITH_FTP" = "1")
-
 if test "$with_http" != "yes" ; then
     WITH_HTTP=0
 else
@@ -542,15 +423,6 @@
 AC_SUBST(WITH_HTTP)
 AM_CONDITIONAL(WITH_HTTP_SOURCES, test "$WITH_HTTP" = "1")
 
-if test "$with_legacy" != "yes" ; then
-    WITH_LEGACY=0
-else
-    echo Enabling deprecated APIs
-    WITH_LEGACY=1
-fi
-AC_SUBST(WITH_LEGACY)
-AM_CONDITIONAL(WITH_LEGACY_SOURCES, test "$WITH_LEGACY" = "1")
-
 if test "$with_reader" = "no" ; then
     echo Disabling the xmlReader parsing interface
     WITH_READER=0
@@ -625,21 +497,12 @@
 if test "$with_xptr" = "no" ; then
     echo Disabling XPointer support
     WITH_XPTR=0
-    WITH_XPTR_LOCS=0
 else
     WITH_XPTR=1
 fi
 AC_SUBST(WITH_XPTR)
 AM_CONDITIONAL(WITH_XPTR_SOURCES, test "$WITH_XPTR" = "1")
 
-if test "$with_xptr_locs" != "yes" ; then
-    WITH_XPTR_LOCS=0
-else
-    echo Enabling Xpointer locations support
-    WITH_XPTR_LOCS=1
-fi
-AC_SUBST(WITH_XPTR_LOCS)
-
 if test "$with_c14n" = "no" ; then
     echo Disabling C14N support
     WITH_C14N=0
@@ -693,8 +556,17 @@
 fi
 AC_SUBST(WITH_ISO8859X)
 
+if test "$with_relaxng" = "no" ; then
+    echo "Disabling Relax-NG support"
+    WITH_RELAXNG=0
+else
+    WITH_RELAXNG=1
+fi
+AC_SUBST(WITH_RELAXNG)
+AM_CONDITIONAL(WITH_RELAXNG_SOURCES, test "$WITH_RELAXNG" = "1")
+
 if test "$with_schemas" = "no" ; then
-    echo "Disabling Schemas/Relax-NG support"
+    echo "Disabling Schemas support"
     WITH_SCHEMAS=0
 else
     WITH_SCHEMAS=1
@@ -773,21 +645,27 @@
         AC_SEARCH_LIBS([dlopen], [dl], [
             WITH_MODULES=1
             if test "$ac_cv_search_dlopen" != "none required"; then
-                MODULE_PLATFORM_LIBS=$ac_cv_search_dlopen
+                MODULE_LIBS=$ac_cv_search_dlopen
             fi
             AC_DEFINE([HAVE_DLOPEN], [], [Have dlopen based dso])], [
             AC_SEARCH_LIBS([shl_load], [dld], [
                 WITH_MODULES=1
                 if test "$ac_cv_search_shl_load" != "none required"; then
-                    MODULE_PLATFORM_LIBS=$ac_cv_search_shl_load
+                    MODULE_LIBS=$ac_cv_search_shl_load
                 fi
                 AC_DEFINE([HAVE_SHLLOAD], [], [Have shl_load based dso])])])
         LIBS=$_libs
     fi
+
+    if test "$WITH_MODULES" = "0"; then
+        AC_MSG_ERROR([dlopen or equivalent not found])
+    fi
+
+    XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${MODULE_LIBS}"
+    XML_PC_LIBS="${XML_PC_LIBS} ${MODULE_LIBS}"
 fi
 
 AC_SUBST(WITH_MODULES)
-AC_SUBST(MODULE_PLATFORM_LIBS)
 AC_SUBST(MODULE_EXTENSION)
 AM_CONDITIONAL(WITH_MODULES_SOURCES, test "$WITH_MODULES" = "1")
 
@@ -795,7 +673,6 @@
 dnl Thread-related stuff
 dnl
 THREAD_LIBS=""
-BASE_THREAD_LIBS=""
 WITH_THREADS=0
 WITH_THREAD_ALLOC=0
 
@@ -815,69 +692,101 @@
                     WITH_THREADS="1"
                     if test "$ac_cv_search_pthread_create" != "none required"; then
                         THREAD_LIBS=$ac_cv_search_pthread_create
-                    fi
-                    AC_DEFINE([HAVE_PTHREAD_H], [],
-                              [Define if <pthread.h> is there])]))
+                    fi]))
             LIBS=$_libs
             ;;
     esac
 
-    case $host_os in
-        *linux*)
-            if test "${GCC}" = "yes" ; then
-                BASE_THREAD_LIBS="$THREAD_LIBS"
-                THREAD_LIBS=""
-            fi
-            ;;
-    esac
+    if test "$WITH_THREADS" = "0"; then
+        AC_MSG_ERROR([libpthread not found])
+    fi
+
+    XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${THREAD_LIBS}"
+    XML_PC_LIBS="${XML_PC_LIBS} ${THREAD_LIBS}"
 fi
 if test "$with_thread_alloc" = "yes" && test "$WITH_THREADS" = "1" ; then
     WITH_THREAD_ALLOC=1
 fi
 
 AC_SUBST(THREAD_LIBS)
-AC_SUBST(BASE_THREAD_LIBS)
 AC_SUBST(WITH_THREADS)
 AC_SUBST(WITH_THREAD_ALLOC)
 
 dnl
-dnl xmllint shell history
+dnl Checks for readline and history libraries.
 dnl
-if test "$with_history" = "yes" && test "$with_readline" != "no"; then
-    echo Enabling xmllint shell history
-    dnl check for terminal library. this is a very cool solution
-    dnl from octave's configure.in
-    unset tcap
-    for termlib in ncurses curses termcap terminfo termlib; do
-	AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
-	test -n "$tcap" && break
-    done
+if test "$with_readline" != "no" && test "$with_readline" != ""; then
+    WITH_READLINE=0
+    WITH_HISTORY=0
 
-    _cppflags=$CPPFLAGS
-    _libs=$LIBS
-    if test "$with_readline" != "" && test "$with_readline" != "yes"; then
+    if test "$with_readline" != "yes"; then
         RDL_DIR=$with_readline
-        CPPFLAGS="${CPPFLAGS} -I$RDL_DIR/include"
-        LIBS="${LIBS} -L$RDL_DIR/lib"
     fi
-    AC_CHECK_HEADER(readline/history.h,
-	AC_CHECK_LIB(history, append_history,[
-	    RDL_LIBS="-lhistory"
-            if test "x${RDL_DIR}" != "x"; then
-                RDL_CFLAGS="-I$RDL_DIR/include"
-                RDL_LIBS="-L$RDL_DIR/lib $RDL_LIBS"
+
+    if test "$RDL_DIR" = ""; then
+        PKG_CHECK_MODULES([RDL], [readline], [ WITH_READLINE=1 ], [:])
+    fi
+
+    if test "$WITH_READLINE" = "0"; then
+        _cppflags=$CPPFLAGS
+        _libs=$LIBS
+
+        if test "$RDL_DIR" != ""; then
+            CPPFLAGS="${CPPFLAGS} -I$RDL_DIR/include"
+            LIBS="${LIBS} -L$RDL_DIR/lib"
+        fi
+        AC_CHECK_HEADER(readline/readline.h,
+            AC_CHECK_LIB(readline, readline, [
+                WITH_READLINE=1
+                RDL_LIBS="-lreadline"
+            ], [
+                AC_MSG_ERROR([libreadline not found])
+            ]))
+
+        CPPFLAGS=$_cppflags
+        LIBS=$_libs
+    fi
+
+    AC_DEFINE([HAVE_LIBREADLINE], [],
+              [Define if readline library is available])
+
+    if test "$with_history" = "yes"; then
+        if test "$RDL_DIR" = ""; then
+            PKG_CHECK_MODULES([HISTORY], [history], [
+                WITH_HISTORY=1
+                RDL_CFLAGS="$HISTORY_CFLAGS $RDL_CFLAGS"
+                RDL_LIBS="$HISTORY_LIBS $RDL_LIBS"
+            ], [:])
+        fi
+
+        if test "$WITH_HISTORY" = "0"; then
+            _cppflags=$CPPFLAGS
+            _libs=$LIBS
+
+            if test "$RDL_DIR" != ""; then
+                CPPFLAGS="${CPPFLAGS} -I$RDL_DIR/include"
+                LIBS="${LIBS} -L$RDL_DIR/lib"
             fi
-	    AC_DEFINE([HAVE_LIBHISTORY], [], [Define if history library is there (-lhistory)])]))
-    AC_CHECK_HEADER(readline/readline.h,
-	AC_CHECK_LIB(readline, readline,[
-	    RDL_LIBS="-lreadline $RDL_LIBS $tcap"
-            if test "x$RDL_DIR" != "x"; then
-                RDL_CFLAGS="-I$RDL_DIR/include"
-                RDL_LIBS="-L$RDL_DIR/lib $RDL_LIBS"
-            fi
-	    AC_DEFINE([HAVE_LIBREADLINE], [], [Define if readline library is there (-lreadline)])], , $tcap))
-    CPPFLAGS=$_cppflags
-    LIBS=$_libs
+            AC_CHECK_HEADER(readline/history.h,
+                AC_CHECK_LIB(history, append_history, [
+                    WITH_HISTORY=1
+                    RDL_LIBS="-lhistory $RDL_LIBS"
+                ], [
+                    AC_MSG_ERROR([libhistory not found])
+                ]))
+
+            CPPFLAGS=$_cppflags
+            LIBS=$_libs
+        fi
+
+        AC_DEFINE([HAVE_LIBHISTORY], [],
+                  [Define if history library is available])
+    fi
+
+    if test "$RDL_DIR" != ""; then
+        RDL_CFLAGS="-I$RDL_DIR/include"
+        RDL_LIBS="-L$RDL_DIR/lib $RDL_LIBS"
+    fi
 fi
 AC_SUBST(RDL_CFLAGS)
 AC_SUBST(RDL_LIBS)
@@ -929,6 +838,10 @@
         LIBS=$_libs
     fi
 
+    if test "$WITH_ZLIB" = "0"; then
+        AC_MSG_ERROR([zlib not found])
+    fi
+
     XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${Z_CFLAGS}"
     XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${Z_LIBS}"
 fi
@@ -979,6 +892,10 @@
         LIBS=$_libs
     fi
 
+    if test "$WITH_LZMA" = "0"; then
+        AC_MSG_ERROR([liblzma not found])
+    fi
+
     XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${LZMA_CFLAGS}"
     XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${LZMA_LIBS}"
 fi
@@ -1018,14 +935,21 @@
             AC_MSG_RESULT([no])
         ])
     ])
+
+    if test "$WITH_ICONV" = "0"; then
+        AC_MSG_ERROR([libiconv not found])
+    fi
+
     if test "$WITH_ICONV" = "1" && test "$ICONV_DIR" != ""; then
         ICONV_CFLAGS="-I$ICONV_DIR/include"
         ICONV_LIBS="-L$ICONV_DIR/lib $ICONV_LIBS"
-	# Export this since our headers include iconv.h
-	XML_INCLUDEDIR="$XML_INCLUDEDIR -I$ICONV_DIR/include"
     fi
     CPPFLAGS=$_cppflags
     LIBS=$_libs
+
+    XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICONV_CFLAGS}"
+    XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${ICONV_LIBS}"
+    XML_PC_LIBS="${XML_PC_LIBS} ${ICONV_LIBS}"
 fi
 AC_SUBST(WITH_ICONV)
 AC_SUBST(ICONV_CFLAGS)
@@ -1040,10 +964,10 @@
 
     # Try pkg-config first so that static linking works.
     # If this succeeeds, we ignore the WITH_ICU directory.
-    PKG_CHECK_MODULES([ICU], [icu-i18n], [
-        WITH_ICU=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} icu-i18n"
+    PKG_CHECK_MODULES([ICU], [icu-uc], [
+        WITH_ICU=1; XML_PC_REQUIRES="${XML_PC_REQUIRES} icu-uc"
         m4_ifdef([PKG_CHECK_VAR],
-            [PKG_CHECK_VAR([ICU_DEFS], [icu-i18n], [DEFS])])
+            [PKG_CHECK_VAR([ICU_DEFS], [icu-uc], [DEFS])])
         if test "x$ICU_DEFS" != "x"; then
             ICU_CFLAGS="$ICU_CFLAGS $ICU_DEFS"
         fi],[:])
@@ -1079,6 +1003,10 @@
         fi
     fi
 
+    if test "$WITH_ICU" = "0"; then
+        AC_MSG_ERROR([ICU not found])
+    fi
+
     XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICU_CFLAGS}"
     XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${ICU_LIBS}"
 fi
@@ -1090,15 +1018,14 @@
 case "$host" in
     *-*-mingw*)
         CRYPTO_LIBS="-lbcrypt"
+        XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${CRYPTO_LIBS}"
+        XML_PC_LIBS="${XML_PC_LIBS} ${CRYPTO_LIBS}"
         ;;
 esac
 
 XML_LIBS="-lxml2"
-XML_LIBTOOLLIBS="libxml2.la"
-NON_PC_LIBS="${THREAD_LIBS} ${ICONV_LIBS} ${LIBM} ${NET_LIBS} ${CRYPTO_LIBS}"
-XML_PC_LIBS="${XML_PC_LIBS} ${NON_PC_LIBS}"
-XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${NON_PC_LIBS}"
-XML_PRIVATE_CFLAGS="${XML_PRIVATE_CFLAGS} ${ICONV_CFLAGS}"
+XML_PC_LIBS="${XML_PC_LIBS} ${LIBM}"
+XML_PRIVATE_LIBS="${XML_PRIVATE_LIBS} ${LIBM}"
 
 dnl When static-only:
 dnl * Duplicate xml-config static --libs into --dynamic.
@@ -1116,9 +1043,11 @@
 AC_SUBST(XML_PRIVATE_LIBS_NO_SHARED)
 AC_SUBST(XML_PC_PRIVATE)
 AC_SUBST(XML_PC_LIBS_PRIVATE)
+AC_SUBST(XML_PC_CFLAGS_PRIVATE)
 AM_SUBST_NOTMAKE(XML_PRIVATE_LIBS_NO_SHARED)
 AM_SUBST_NOTMAKE(XML_PC_PRIVATE)
 AM_SUBST_NOTMAKE(XML_PC_LIBS_PRIVATE)
+AM_SUBST_NOTMAKE(XML_PC_CFLAGS_PRIVATE)
 
 AC_SUBST(XML_PC_LIBS)
 AC_SUBST(XML_PC_REQUIRES)
@@ -1128,28 +1057,20 @@
 AC_SUBST(AM_CFLAGS)
 AC_SUBST(AM_LDFLAGS)
 AC_SUBST(XML_CFLAGS)
+AC_SUBST(XML_STATIC_CFLAGS)
 
 AC_SUBST(XML_LIBDIR)
 AC_SUBST(XML_LIBS)
 AC_SUBST(XML_PRIVATE_LIBS)
 AC_SUBST(XML_PRIVATE_CFLAGS)
-AC_SUBST(XML_LIBTOOLLIBS)
 AC_SUBST(XML_INCLUDEDIR)
 
-dnl for the spec file
-RELDATE=`date +'%a %b %e %Y'`
-AC_SUBST(RELDATE)
+AX_RECURSIVE_EVAL(["$sysconfdir"], [XML_SYSCONFDIR])
+AC_DEFINE_UNQUOTED([XML_SYSCONFDIR], ["$XML_SYSCONFDIR"],
+                   [System configuration directory (/etc)])
 
 # keep on one line for cygwin c.f. #130896
-AC_CONFIG_FILES([Makefile include/Makefile include/libxml/Makefile include/private/Makefile doc/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml-2.0-uninstalled.pc libxml2-config.cmake])
+AC_CONFIG_FILES([Makefile include/Makefile include/libxml/Makefile include/private/Makefile doc/Makefile doc/devhelp/Makefile example/Makefile fuzz/Makefile python/Makefile python/tests/Makefile xstc/Makefile include/libxml/xmlversion.h libxml-2.0.pc libxml2-config.cmake])
 AC_CONFIG_FILES([python/setup.py], [chmod +x python/setup.py])
 AC_CONFIG_FILES([xml2-config], [chmod +x xml2-config])
 AC_OUTPUT
-
-if test "$WARN_NO_TLS" != ""; then
-    echo "================================================================"
-    echo "WARNING: Your C compiler appears to not support thread-local"
-    echo "storage. Future versions of libxml2 will require this feature"
-    echo "for multi-threading."
-    echo "================================================================"
-fi
diff --git a/dbgen.pl b/dbgen.pl
deleted file mode 100755
index 1383d6e..0000000
--- a/dbgen.pl
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/perl
-
-$size = shift;
-
-if ($size eq "") 
-{
-    die "usage:  dbgen.pl [size]\n";
-}
-
-@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood", 
-               "George", "Hank", "Inki", "James");
-@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman", 
-              "Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
-@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", 
-           "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", 
-           "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", 
-           "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", 
-           "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
-
-print "<?xml version=\"1.0\"?>\n";
-print "\n";
-print "<table>\n";
-
-for ($i=0; $i<$size; $i++)
-{
-    $first = $firstnames [$i % 10];
-    $last = $lastnames [($i / 10) % 10];
-    $state = $states [($i / 100) % 50];
-    $zip = 22000 + $i / 5000;
-
-    printf "  <row>\n";
-    printf "    <id>%04d</id>\n", $i;
-    printf "    <firstname>$first</firstname>\n", $i;
-    printf "    <lastname>$last</lastname>\n", $i;
-    printf "    <street>%d Any St.</street>\n", ($i % 100) + 1;
-    printf "    <city>Anytown</city>\n";
-    printf "    <state>$state</state>\n";
-    printf "    <zip>%d</zip>\n", $zip;
-    printf "  </row>\n";
-}
-
-print "</table>\n";
-
diff --git a/dbgenattr.pl b/dbgenattr.pl
deleted file mode 100755
index dce11cd..0000000
--- a/dbgenattr.pl
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/perl
-
-$size = shift;
-
-if ($size eq "") 
-{
-    die "usage:  dbgen.pl [size]\n";
-}
-
-@firstnames = ("Al", "Bob", "Charles", "David", "Egon", "Farbood", 
-               "George", "Hank", "Inki", "James");
-@lastnames = ("Aranow", "Barker", "Corsetti", "Dershowitz", "Engleman", 
-              "Franklin", "Grice", "Haverford", "Ilvedson", "Jones");
-@states = ("AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "FL", "GA", 
-           "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", 
-           "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", 
-           "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", 
-           "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY");
-
-print "<?xml version=\"1.0\"?>\n";
-print "\n";
-print "<table>\n";
-
-for ($i=0; $i<$size; $i++)
-{
-    $first = $firstnames [$i % 10];
-    $last = $lastnames [($i / 10) % 10];
-    $state = $states [($i / 100) % 50];
-    $zip = 22000 + $i / 5000;
-
-    printf "  <row\n";
-    printf "    id='%04d'\n", $i;
-    printf "    firstname='$first'\n", $i;
-    printf "    lastname='$last'\n", $i;
-    printf "    street='%d Any St.'\n", ($i % 100) + 1;
-    printf "    city='Anytown'\n";
-    printf "    state='$state'\n";
-    printf "    zip='%d'/>\n", $zip;
-}
-
-print "</table>\n";
-
diff --git a/debugXML.c b/debugXML.c
index ed56b0f..f5ffe60 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -14,19 +14,14 @@
 #include <string.h>
 #include <stdlib.h>
 
+#include <libxml/debugXML.h>
 #include <libxml/xmlmemory.h>
 #include <libxml/tree.h>
 #include <libxml/parser.h>
 #include <libxml/parserInternals.h>
-#include <libxml/debugXML.h>
 #include <libxml/HTMLtree.h>
 #include <libxml/HTMLparser.h>
 #include <libxml/xmlerror.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/uri.h>
-#ifdef LIBXML_SCHEMAS_ENABLED
-#include <libxml/relaxng.h>
-#endif
 
 #include "private/error.h"
 
@@ -240,12 +235,10 @@
 	    xmlDebugErr(ctxt, XML_CHECK_NO_NAME, "Name is NULL");
 	    return;
 	}
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
         if (xmlValidateName(name, 0)) {
 	    xmlDebugErr3(ctxt, XML_CHECK_NOT_NCNAME,
 			 "Name is not an NCName '%s'", (const char *) name);
 	}
-#endif
 	if ((ctxt->dict != NULL) &&
 	    (!xmlDictOwns(ctxt->dict, name)) &&
             ((ctxt->doc == NULL) ||
@@ -274,12 +267,6 @@
     } else {
 	dict = doc->dict;
 	if ((dict == NULL) && (ctxt->nodict == 0)) {
-#if 0
-            /* deactivated right now as it raises too many errors */
-	    if (doc->type == XML_DOCUMENT_NODE)
-		xmlDebugErr(ctxt, XML_CHECK_NO_DICT,
-			    "Document has no dictionary\n");
-#endif
 	    ctxt->nodict = 1;
 	}
 	if (ctxt->doc == NULL)
@@ -1570,1847 +1557,4 @@
     return(ctxt.errors);
 }
 
-/************************************************************************
- *									*
- *			Helpers for Shell				*
- *									*
- ************************************************************************/
-
-/**
- * xmlLsCountNode:
- * @node:  the node to count
- *
- * Count the children of @node.
- *
- * Returns the number of children of @node.
- */
-int
-xmlLsCountNode(xmlNodePtr node) {
-    int ret = 0;
-    xmlNodePtr list = NULL;
-
-    if (node == NULL)
-	return(0);
-
-    switch (node->type) {
-	case XML_ELEMENT_NODE:
-	    list = node->children;
-	    break;
-	case XML_DOCUMENT_NODE:
-	case XML_HTML_DOCUMENT_NODE:
-	    list = ((xmlDocPtr) node)->children;
-	    break;
-	case XML_ATTRIBUTE_NODE:
-	    list = ((xmlAttrPtr) node)->children;
-	    break;
-	case XML_TEXT_NODE:
-	case XML_CDATA_SECTION_NODE:
-	case XML_PI_NODE:
-	case XML_COMMENT_NODE:
-	    if (node->content != NULL) {
-		ret = xmlStrlen(node->content);
-            }
-	    break;
-	case XML_ENTITY_REF_NODE:
-	case XML_DOCUMENT_TYPE_NODE:
-	case XML_ENTITY_NODE:
-	case XML_DOCUMENT_FRAG_NODE:
-	case XML_NOTATION_NODE:
-	case XML_DTD_NODE:
-        case XML_ELEMENT_DECL:
-        case XML_ATTRIBUTE_DECL:
-        case XML_ENTITY_DECL:
-	case XML_NAMESPACE_DECL:
-	case XML_XINCLUDE_START:
-	case XML_XINCLUDE_END:
-	    ret = 1;
-	    break;
-    }
-    for (;list != NULL;ret++)
-        list = list->next;
-    return(ret);
-}
-
-/**
- * xmlLsOneNode:
- * @output:  the FILE * for the output
- * @node:  the node to dump
- *
- * Dump to @output the type and name of @node.
- */
-void
-xmlLsOneNode(FILE *output, xmlNodePtr node) {
-    if (output == NULL) return;
-    if (node == NULL) {
-	fprintf(output, "NULL\n");
-	return;
-    }
-    switch (node->type) {
-	case XML_ELEMENT_NODE:
-	    fprintf(output, "-");
-	    break;
-	case XML_ATTRIBUTE_NODE:
-	    fprintf(output, "a");
-	    break;
-	case XML_TEXT_NODE:
-	    fprintf(output, "t");
-	    break;
-	case XML_CDATA_SECTION_NODE:
-	    fprintf(output, "C");
-	    break;
-	case XML_ENTITY_REF_NODE:
-	    fprintf(output, "e");
-	    break;
-	case XML_ENTITY_NODE:
-	    fprintf(output, "E");
-	    break;
-	case XML_PI_NODE:
-	    fprintf(output, "p");
-	    break;
-	case XML_COMMENT_NODE:
-	    fprintf(output, "c");
-	    break;
-	case XML_DOCUMENT_NODE:
-	    fprintf(output, "d");
-	    break;
-	case XML_HTML_DOCUMENT_NODE:
-	    fprintf(output, "h");
-	    break;
-	case XML_DOCUMENT_TYPE_NODE:
-	    fprintf(output, "T");
-	    break;
-	case XML_DOCUMENT_FRAG_NODE:
-	    fprintf(output, "F");
-	    break;
-	case XML_NOTATION_NODE:
-	    fprintf(output, "N");
-	    break;
-	case XML_NAMESPACE_DECL:
-	    fprintf(output, "n");
-	    break;
-	default:
-	    fprintf(output, "?");
-    }
-    if (node->type != XML_NAMESPACE_DECL) {
-	if (node->properties != NULL)
-	    fprintf(output, "a");
-	else
-	    fprintf(output, "-");
-	if (node->nsDef != NULL)
-	    fprintf(output, "n");
-	else
-	    fprintf(output, "-");
-    }
-
-    fprintf(output, " %8d ", xmlLsCountNode(node));
-
-    switch (node->type) {
-	case XML_ELEMENT_NODE:
-	    if (node->name != NULL) {
-                if ((node->ns != NULL) && (node->ns->prefix != NULL))
-                    fprintf(output, "%s:", node->ns->prefix);
-		fprintf(output, "%s", (const char *) node->name);
-            }
-	    break;
-	case XML_ATTRIBUTE_NODE:
-	    if (node->name != NULL)
-		fprintf(output, "%s", (const char *) node->name);
-	    break;
-	case XML_TEXT_NODE:
-	    if (node->content != NULL) {
-		xmlDebugDumpString(output, node->content);
-            }
-	    break;
-	case XML_CDATA_SECTION_NODE:
-	    break;
-	case XML_ENTITY_REF_NODE:
-	    if (node->name != NULL)
-		fprintf(output, "%s", (const char *) node->name);
-	    break;
-	case XML_ENTITY_NODE:
-	    if (node->name != NULL)
-		fprintf(output, "%s", (const char *) node->name);
-	    break;
-	case XML_PI_NODE:
-	    if (node->name != NULL)
-		fprintf(output, "%s", (const char *) node->name);
-	    break;
-	case XML_COMMENT_NODE:
-	    break;
-	case XML_DOCUMENT_NODE:
-	    break;
-	case XML_HTML_DOCUMENT_NODE:
-	    break;
-	case XML_DOCUMENT_TYPE_NODE:
-	    break;
-	case XML_DOCUMENT_FRAG_NODE:
-	    break;
-	case XML_NOTATION_NODE:
-	    break;
-	case XML_NAMESPACE_DECL: {
-	    xmlNsPtr ns = (xmlNsPtr) node;
-
-	    if (ns->prefix == NULL)
-		fprintf(output, "default -> %s", (char *)ns->href);
-	    else
-		fprintf(output, "%s -> %s", (char *)ns->prefix,
-			(char *)ns->href);
-	    break;
-	}
-	default:
-	    if (node->name != NULL)
-		fprintf(output, "%s", (const char *) node->name);
-    }
-    fprintf(output, "\n");
-}
-
-/**
- * xmlBoolToText:
- * @boolval: a bool to turn into text
- *
- * Convenient way to turn bool into text
- *
- * Returns a pointer to either "True" or "False"
- */
-const char *
-xmlBoolToText(int boolval)
-{
-    if (boolval)
-        return("True");
-    else
-        return("False");
-}
-
-#ifdef LIBXML_XPATH_ENABLED
-/****************************************************************
- *								*
- *		The XML shell related functions			*
- *								*
- ****************************************************************/
-
-
-
-/*
- * TODO: Improvement/cleanups for the XML shell
- *     - allow to shell out an editor on a subpart
- *     - cleanup function registrations (with help) and calling
- *     - provide registration routines
- */
-
-/**
- * xmlShellPrintXPathError:
- * @errorType: valid xpath error id
- * @arg: the argument that cause xpath to fail
- *
- * Print the xpath error to libxml default error channel
- */
-void
-xmlShellPrintXPathError(int errorType, const char *arg)
-{
-    const char *default_arg = "Result";
-
-    if (!arg)
-        arg = default_arg;
-
-    switch (errorType) {
-        case XPATH_UNDEFINED:
-            fprintf(stderr,
-                            "%s: no such node\n", arg);
-            break;
-
-        case XPATH_BOOLEAN:
-            fprintf(stderr,
-                            "%s is a Boolean\n", arg);
-            break;
-        case XPATH_NUMBER:
-            fprintf(stderr,
-                            "%s is a number\n", arg);
-            break;
-        case XPATH_STRING:
-            fprintf(stderr,
-                            "%s is a string\n", arg);
-            break;
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-        case XPATH_POINT:
-            fprintf(stderr,
-                            "%s is a point\n", arg);
-            break;
-        case XPATH_RANGE:
-            fprintf(stderr,
-                            "%s is a range\n", arg);
-            break;
-        case XPATH_LOCATIONSET:
-            fprintf(stderr,
-                            "%s is a range\n", arg);
-            break;
-#endif /* LIBXML_XPTR_LOCS_ENABLED */
-        case XPATH_USERS:
-            fprintf(stderr,
-                            "%s is user-defined\n", arg);
-            break;
-        case XPATH_XSLT_TREE:
-            fprintf(stderr,
-                            "%s is an XSLT value tree\n", arg);
-            break;
-    }
-#if 0
-    fprintf(stderr,
-                    "Try casting the result string function (xpath builtin)\n",
-                    arg);
-#endif
-}
-
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/**
- * xmlShellPrintNodeCtxt:
- * @ctxt : a non-null shell context
- * @node : a non-null node to print to the output FILE
- *
- * Print node to the output FILE
- */
-static void
-xmlShellPrintNodeCtxt(xmlShellCtxtPtr ctxt,xmlNodePtr node)
-{
-    FILE *fp;
-
-    if (!node)
-        return;
-    if (ctxt == NULL)
-	fp = stdout;
-    else
-	fp = ctxt->output;
-
-    if (node->type == XML_DOCUMENT_NODE)
-        xmlDocDump(fp, (xmlDocPtr) node);
-    else if (node->type == XML_ATTRIBUTE_NODE)
-        xmlDebugDumpAttrList(fp, (xmlAttrPtr) node, 0);
-    else
-        xmlElemDump(fp, node->doc, node);
-
-    fprintf(fp, "\n");
-}
-
-/**
- * xmlShellPrintNode:
- * @node : a non-null node to print to the output FILE
- *
- * Print node to the output FILE
- */
-void
-xmlShellPrintNode(xmlNodePtr node)
-{
-    xmlShellPrintNodeCtxt(NULL, node);
-}
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/**
- * xmlShellPrintXPathResultCtxt:
- * @ctxt: a valid shell context
- * @list: a valid result generated by an xpath evaluation
- *
- * Prints result to the output FILE
- */
-static void
-xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list)
-{
-    if (!ctxt)
-       return;
-
-    if (list != NULL) {
-        switch (list->type) {
-            case XPATH_NODESET:{
-#ifdef LIBXML_OUTPUT_ENABLED
-                    int indx;
-
-                    if (list->nodesetval) {
-                        for (indx = 0; indx < list->nodesetval->nodeNr;
-                             indx++) {
-                            xmlShellPrintNodeCtxt(ctxt,
-				    list->nodesetval->nodeTab[indx]);
-                        }
-                    } else {
-                        fprintf(ctxt->output,
-                                        "Empty node set\n");
-                    }
-                    break;
-#else
-		    fprintf(ctxt->output,
-				    "Node set\n");
-#endif /* LIBXML_OUTPUT_ENABLED */
-                }
-            case XPATH_BOOLEAN:
-                fprintf(ctxt->output,
-                                "Is a Boolean:%s\n",
-                                xmlBoolToText(list->boolval));
-                break;
-            case XPATH_NUMBER:
-                fprintf(ctxt->output,
-                                "Is a number:%0g\n", list->floatval);
-                break;
-            case XPATH_STRING:
-                fprintf(ctxt->output,
-                                "Is a string:%s\n", list->stringval);
-                break;
-
-            default:
-                xmlShellPrintXPathError(list->type, NULL);
-        }
-    }
-}
-
-/**
- * xmlShellPrintXPathResult:
- * @list: a valid result generated by an xpath evaluation
- *
- * Prints result to the output FILE
- */
-void
-xmlShellPrintXPathResult(xmlXPathObjectPtr list)
-{
-    xmlShellPrintXPathResultCtxt(NULL, list);
-}
-
-/**
- * xmlShellList:
- * @ctxt:  the shell context
- * @arg:  unused
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "ls"
- * Does an Unix like listing of the given node (like a directory)
- *
- * Returns 0
- */
-int
-xmlShellList(xmlShellCtxtPtr ctxt,
-             char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
-             xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlNodePtr cur;
-    if (!ctxt)
-        return (0);
-    if (node == NULL) {
-	fprintf(ctxt->output, "NULL\n");
-	return (0);
-    }
-    if ((node->type == XML_DOCUMENT_NODE) ||
-        (node->type == XML_HTML_DOCUMENT_NODE)) {
-        cur = ((xmlDocPtr) node)->children;
-    } else if (node->type == XML_NAMESPACE_DECL) {
-        xmlLsOneNode(ctxt->output, node);
-        return (0);
-    } else if (node->children != NULL) {
-        cur = node->children;
-    } else {
-        xmlLsOneNode(ctxt->output, node);
-        return (0);
-    }
-    while (cur != NULL) {
-        xmlLsOneNode(ctxt->output, cur);
-        cur = cur->next;
-    }
-    return (0);
-}
-
-/**
- * xmlShellBase:
- * @ctxt:  the shell context
- * @arg:  unused
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "base"
- * dumps the current XML base of the node
- *
- * Returns 0
- */
-int
-xmlShellBase(xmlShellCtxtPtr ctxt,
-             char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
-             xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlChar *base;
-    if (!ctxt)
-        return 0;
-    if (node == NULL) {
-	fprintf(ctxt->output, "NULL\n");
-	return (0);
-    }
-
-    base = xmlNodeGetBase(node->doc, node);
-
-    if (base == NULL) {
-        fprintf(ctxt->output, " No base found !!!\n");
-    } else {
-        fprintf(ctxt->output, "%s\n", base);
-        xmlFree(base);
-    }
-    return (0);
-}
-
-#ifdef LIBXML_TREE_ENABLED
-/**
- * xmlShellSetBase:
- * @ctxt:  the shell context
- * @arg:  the new base
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "setbase"
- * change the current XML base of the node
- *
- * Returns 0
- */
-static int
-xmlShellSetBase(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
-             char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
-             xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlNodeSetBase(node, (xmlChar*) arg);
-    return (0);
-}
-#endif
-
-#ifdef LIBXML_XPATH_ENABLED
-/**
- * xmlShellRegisterNamespace:
- * @ctxt:  the shell context
- * @arg:  a string in prefix=nsuri format
- * @node:  unused
- * @node2:  unused
- *
- * Implements the XML shell function "setns"
- * register/unregister a prefix=namespace pair
- * on the XPath context
- *
- * Returns 0 on success and a negative value otherwise.
- */
-static int
-xmlShellRegisterNamespace(xmlShellCtxtPtr ctxt, char *arg,
-      xmlNodePtr node ATTRIBUTE_UNUSED, xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlChar* nsListDup;
-    xmlChar* prefix;
-    xmlChar* href;
-    xmlChar* next;
-
-    nsListDup = xmlStrdup((xmlChar *) arg);
-    next = nsListDup;
-    while(next != NULL) {
-	/* skip spaces */
-	/*while((*next) == ' ') next++;*/
-	if((*next) == '\0') break;
-
-	/* find prefix */
-	prefix = next;
-	next = (xmlChar*)xmlStrchr(next, '=');
-	if(next == NULL) {
-	    fprintf(ctxt->output, "setns: prefix=[nsuri] required\n");
-	    xmlFree(nsListDup);
-	    return(-1);
-	}
-	*(next++) = '\0';
-
-	/* find href */
-	href = next;
-	next = (xmlChar*)xmlStrchr(next, ' ');
-	if(next != NULL) {
-	    *(next++) = '\0';
-	}
-
-	/* do register namespace */
-	if(xmlXPathRegisterNs(ctxt->pctxt, prefix, href) != 0) {
-	    fprintf(ctxt->output,"Error: unable to register NS with prefix=\"%s\" and href=\"%s\"\n", prefix, href);
-	    xmlFree(nsListDup);
-	    return(-1);
-	}
-    }
-
-    xmlFree(nsListDup);
-    return(0);
-}
-/**
- * xmlShellRegisterRootNamespaces:
- * @ctxt:  the shell context
- * @arg:  unused
- * @node:  the root element
- * @node2:  unused
- *
- * Implements the XML shell function "setrootns"
- * which registers all namespaces declarations found on the root element.
- *
- * Returns 0 on success and a negative value otherwise.
- */
-static int
-xmlShellRegisterRootNamespaces(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
-      xmlNodePtr root, xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlNsPtr ns;
-
-    if ((root == NULL) || (root->type != XML_ELEMENT_NODE) ||
-        (root->nsDef == NULL) || (ctxt == NULL) || (ctxt->pctxt == NULL))
-	return(-1);
-    ns = root->nsDef;
-    while (ns != NULL) {
-        if (ns->prefix == NULL)
-	    xmlXPathRegisterNs(ctxt->pctxt, BAD_CAST "defaultns", ns->href);
-	else
-	    xmlXPathRegisterNs(ctxt->pctxt, ns->prefix, ns->href);
-        ns = ns->next;
-    }
-    return(0);
-}
-#endif
-
-/**
- * xmlShellGrep:
- * @ctxt:  the shell context
- * @arg:  the string or regular expression to find
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "grep"
- * dumps information about the node (namespace, attributes, content).
- *
- * Returns 0
- */
-static int
-xmlShellGrep(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
-            char *arg, xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    if (!ctxt)
-        return (0);
-    if (node == NULL)
-	return (0);
-    if (arg == NULL)
-	return (0);
-#ifdef LIBXML_REGEXP_ENABLED
-    if ((xmlStrchr((xmlChar *) arg, '?')) ||
-	(xmlStrchr((xmlChar *) arg, '*')) ||
-	(xmlStrchr((xmlChar *) arg, '.')) ||
-	(xmlStrchr((xmlChar *) arg, '['))) {
-    }
-#endif
-    while (node != NULL) {
-        if (node->type == XML_COMMENT_NODE) {
-	    if (xmlStrstr(node->content, (xmlChar *) arg)) {
-
-		fprintf(ctxt->output, "%s : ", xmlGetNodePath(node));
-                xmlShellList(ctxt, NULL, node, NULL);
-	    }
-        } else if (node->type == XML_TEXT_NODE) {
-	    if (xmlStrstr(node->content, (xmlChar *) arg)) {
-
-		fprintf(ctxt->output, "%s : ", xmlGetNodePath(node->parent));
-                xmlShellList(ctxt, NULL, node->parent, NULL);
-	    }
-        }
-
-        /*
-         * Browse the full subtree, deep first
-         */
-
-        if ((node->type == XML_DOCUMENT_NODE) ||
-            (node->type == XML_HTML_DOCUMENT_NODE)) {
-            node = ((xmlDocPtr) node)->children;
-        } else if ((node->children != NULL)
-                   && (node->type != XML_ENTITY_REF_NODE)) {
-            /* deep first */
-            node = node->children;
-        } else if (node->next != NULL) {
-            /* then siblings */
-            node = node->next;
-        } else {
-            /* go up to parents->next if needed */
-            while (node != NULL) {
-                if (node->parent != NULL) {
-                    node = node->parent;
-                }
-                if (node->next != NULL) {
-                    node = node->next;
-                    break;
-                }
-                if (node->parent == NULL) {
-                    node = NULL;
-                    break;
-                }
-            }
-	}
-    }
-    return (0);
-}
-
-/**
- * xmlShellDir:
- * @ctxt:  the shell context
- * @arg:  unused
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "dir"
- * dumps information about the node (namespace, attributes, content).
- *
- * Returns 0
- */
-int
-xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
-            char *arg ATTRIBUTE_UNUSED, xmlNodePtr node,
-            xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    if (!ctxt)
-        return (0);
-    if (node == NULL) {
-	fprintf(ctxt->output, "NULL\n");
-	return (0);
-    }
-    if ((node->type == XML_DOCUMENT_NODE) ||
-        (node->type == XML_HTML_DOCUMENT_NODE)) {
-        xmlDebugDumpDocumentHead(ctxt->output, (xmlDocPtr) node);
-    } else if (node->type == XML_ATTRIBUTE_NODE) {
-        xmlDebugDumpAttr(ctxt->output, (xmlAttrPtr) node, 0);
-    } else {
-        xmlDebugDumpOneNode(ctxt->output, node, 0);
-    }
-    return (0);
-}
-
-/**
- * xmlShellSetContent:
- * @ctxt:  the shell context
- * @value:  the content as a string
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "dir"
- * dumps information about the node (namespace, attributes, content).
- *
- * Returns 0
- */
-static int
-xmlShellSetContent(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
-            char *value, xmlNodePtr node,
-            xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlNodePtr results;
-    xmlParserErrors ret;
-
-    if (!ctxt)
-        return (0);
-    if (node == NULL) {
-	fprintf(ctxt->output, "NULL\n");
-	return (0);
-    }
-    if (value == NULL) {
-        fprintf(ctxt->output, "NULL\n");
-	return (0);
-    }
-
-    ret = xmlParseInNodeContext(node, value, strlen(value), 0, &results);
-    if (ret == XML_ERR_OK) {
-	if (node->children != NULL) {
-	    xmlFreeNodeList(node->children);
-	    node->children = NULL;
-	    node->last = NULL;
-	}
-	xmlAddChildList(node, results);
-    } else {
-        fprintf(ctxt->output, "failed to parse content\n");
-    }
-    return (0);
-}
-
-static void
-xmlShellPrintf(void *ctx, const char *msg, ...) {
-    xmlShellCtxtPtr sctxt = ctx;
-    va_list ap;
-
-    va_start(ap, msg);
-    vfprintf(sctxt->output, msg, ap);
-    va_end(ap);
-}
-
-#ifdef LIBXML_SCHEMAS_ENABLED
-/**
- * xmlShellRNGValidate:
- * @ctxt:  the shell context
- * @schemas:  the path to the Relax-NG schemas
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "relaxng"
- * validating the instance against a Relax-NG schemas
- *
- * Returns 0
- */
-static int
-xmlShellRNGValidate(xmlShellCtxtPtr sctxt, char *schemas,
-            xmlNodePtr node ATTRIBUTE_UNUSED,
-	    xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlRelaxNGPtr relaxngschemas;
-    xmlRelaxNGParserCtxtPtr ctxt;
-    xmlRelaxNGValidCtxtPtr vctxt;
-    int ret;
-
-    ctxt = xmlRelaxNGNewParserCtxt(schemas);
-    xmlRelaxNGSetParserErrors(ctxt, xmlShellPrintf, xmlShellPrintf, sctxt);
-    relaxngschemas = xmlRelaxNGParse(ctxt);
-    xmlRelaxNGFreeParserCtxt(ctxt);
-    if (relaxngschemas == NULL) {
-	fprintf(sctxt->output,
-		"Relax-NG schema %s failed to compile\n", schemas);
-	return(-1);
-    }
-    vctxt = xmlRelaxNGNewValidCtxt(relaxngschemas);
-    xmlRelaxNGSetValidErrors(vctxt, xmlShellPrintf, xmlShellPrintf, sctxt);
-    ret = xmlRelaxNGValidateDoc(vctxt, sctxt->doc);
-    if (ret == 0) {
-	fprintf(sctxt->output, "%s validates\n", sctxt->filename);
-    } else if (ret > 0) {
-	fprintf(sctxt->output, "%s fails to validate\n", sctxt->filename);
-    } else {
-	fprintf(sctxt->output, "%s validation generated an internal error\n",
-	       sctxt->filename);
-    }
-    xmlRelaxNGFreeValidCtxt(vctxt);
-    if (relaxngschemas != NULL)
-	xmlRelaxNGFree(relaxngschemas);
-    return(0);
-}
-#endif
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/**
- * xmlShellCat:
- * @ctxt:  the shell context
- * @arg:  unused
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "cat"
- * dumps the serialization node content (XML or HTML).
- *
- * Returns 0
- */
-int
-xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
-            xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    if (!ctxt)
-        return (0);
-    if (node == NULL) {
-	fprintf(ctxt->output, "NULL\n");
-	return (0);
-    }
-    if (ctxt->doc->type == XML_HTML_DOCUMENT_NODE) {
-#ifdef LIBXML_HTML_ENABLED
-        if (node->type == XML_HTML_DOCUMENT_NODE)
-            htmlDocDump(ctxt->output, (htmlDocPtr) node);
-        else
-            htmlNodeDumpFile(ctxt->output, ctxt->doc, node);
-#else
-        if (node->type == XML_DOCUMENT_NODE)
-            xmlDocDump(ctxt->output, (xmlDocPtr) node);
-        else
-            xmlElemDump(ctxt->output, ctxt->doc, node);
-#endif /* LIBXML_HTML_ENABLED */
-    } else {
-        if (node->type == XML_DOCUMENT_NODE)
-            xmlDocDump(ctxt->output, (xmlDocPtr) node);
-        else
-            xmlElemDump(ctxt->output, ctxt->doc, node);
-    }
-    fprintf(ctxt->output, "\n");
-    return (0);
-}
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/**
- * xmlShellLoad:
- * @ctxt:  the shell context
- * @filename:  the file name
- * @node:  unused
- * @node2:  unused
- *
- * Implements the XML shell function "load"
- * loads a new document specified by the filename
- *
- * Returns 0 or -1 if loading failed
- */
-int
-xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename,
-             xmlNodePtr node ATTRIBUTE_UNUSED,
-             xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlDocPtr doc;
-    int html = 0;
-
-    if ((ctxt == NULL) || (filename == NULL)) return(-1);
-    if (ctxt->doc != NULL)
-        html = (ctxt->doc->type == XML_HTML_DOCUMENT_NODE);
-
-    if (html) {
-#ifdef LIBXML_HTML_ENABLED
-        doc = htmlParseFile(filename, NULL);
-#else
-        fprintf(ctxt->output, "HTML support not compiled in\n");
-        doc = NULL;
-#endif /* LIBXML_HTML_ENABLED */
-    } else {
-        doc = xmlReadFile(filename,NULL,0);
-    }
-    if (doc != NULL) {
-        if (ctxt->loaded == 1) {
-            xmlFreeDoc(ctxt->doc);
-        }
-        ctxt->loaded = 1;
-#ifdef LIBXML_XPATH_ENABLED
-        xmlXPathFreeContext(ctxt->pctxt);
-#endif /* LIBXML_XPATH_ENABLED */
-        xmlFree(ctxt->filename);
-        ctxt->doc = doc;
-        ctxt->node = (xmlNodePtr) doc;
-#ifdef LIBXML_XPATH_ENABLED
-        ctxt->pctxt = xmlXPathNewContext(doc);
-#endif /* LIBXML_XPATH_ENABLED */
-        ctxt->filename = (char *) xmlCanonicPath((xmlChar *) filename);
-    } else
-        return (-1);
-    return (0);
-}
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/**
- * xmlShellWrite:
- * @ctxt:  the shell context
- * @filename:  the file name
- * @node:  a node in the tree
- * @node2:  unused
- *
- * Implements the XML shell function "write"
- * Write the current node to the filename, it saves the serialization
- * of the subtree under the @node specified
- *
- * Returns 0 or -1 in case of error
- */
-int
-xmlShellWrite(xmlShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
-              xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    if (node == NULL)
-        return (-1);
-    if ((filename == NULL) || (filename[0] == 0)) {
-        return (-1);
-    }
-#ifdef W_OK
-    if (access((char *) filename, W_OK)) {
-        fprintf(ctxt->output,
-                        "Cannot write to %s\n", filename);
-        return (-1);
-    }
-#endif
-    switch (node->type) {
-        case XML_DOCUMENT_NODE:
-            if (xmlSaveFile((char *) filename, ctxt->doc) < -1) {
-                fprintf(ctxt->output,
-                                "Failed to write to %s\n", filename);
-                return (-1);
-            }
-            break;
-        case XML_HTML_DOCUMENT_NODE:
-#ifdef LIBXML_HTML_ENABLED
-            if (htmlSaveFile((char *) filename, ctxt->doc) < 0) {
-                fprintf(ctxt->output,
-                                "Failed to write to %s\n", filename);
-                return (-1);
-            }
-#else
-            if (xmlSaveFile((char *) filename, ctxt->doc) < -1) {
-                fprintf(ctxt->output,
-                                "Failed to write to %s\n", filename);
-                return (-1);
-            }
-#endif /* LIBXML_HTML_ENABLED */
-            break;
-        default:{
-                FILE *f;
-
-                f = fopen((char *) filename, "w");
-                if (f == NULL) {
-                    fprintf(ctxt->output,
-                                    "Failed to write to %s\n", filename);
-                    return (-1);
-                }
-                xmlElemDump(f, ctxt->doc, node);
-                fclose(f);
-            }
-    }
-    return (0);
-}
-
-/**
- * xmlShellSave:
- * @ctxt:  the shell context
- * @filename:  the file name (optional)
- * @node:  unused
- * @node2:  unused
- *
- * Implements the XML shell function "save"
- * Write the current document to the filename, or it's original name
- *
- * Returns 0 or -1 in case of error
- */
-int
-xmlShellSave(xmlShellCtxtPtr ctxt, char *filename,
-             xmlNodePtr node ATTRIBUTE_UNUSED,
-             xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    if ((ctxt == NULL) || (ctxt->doc == NULL))
-        return (-1);
-    if ((filename == NULL) || (filename[0] == 0))
-        filename = ctxt->filename;
-    if (filename == NULL)
-        return (-1);
-#ifdef W_OK
-    if (access((char *) filename, W_OK)) {
-        fprintf(ctxt->output,
-                        "Cannot save to %s\n", filename);
-        return (-1);
-    }
-#endif
-    switch (ctxt->doc->type) {
-        case XML_DOCUMENT_NODE:
-            if (xmlSaveFile((char *) filename, ctxt->doc) < 0) {
-                fprintf(ctxt->output,
-                                "Failed to save to %s\n", filename);
-            }
-            break;
-        case XML_HTML_DOCUMENT_NODE:
-#ifdef LIBXML_HTML_ENABLED
-            if (htmlSaveFile((char *) filename, ctxt->doc) < 0) {
-                fprintf(ctxt->output,
-                                "Failed to save to %s\n", filename);
-            }
-#else
-            if (xmlSaveFile((char *) filename, ctxt->doc) < 0) {
-                fprintf(ctxt->output,
-                                "Failed to save to %s\n", filename);
-            }
-#endif /* LIBXML_HTML_ENABLED */
-            break;
-        default:
-            fprintf(ctxt->output,
-	    "To save to subparts of a document use the 'write' command\n");
-            return (-1);
-
-    }
-    return (0);
-}
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-#ifdef LIBXML_VALID_ENABLED
-/**
- * xmlShellValidate:
- * @ctxt:  the shell context
- * @dtd:  the DTD URI (optional)
- * @node:  unused
- * @node2:  unused
- *
- * Implements the XML shell function "validate"
- * Validate the document, if a DTD path is provided, then the validation
- * is done against the given DTD.
- *
- * Returns 0 or -1 in case of error
- */
-int
-xmlShellValidate(xmlShellCtxtPtr ctxt, char *dtd,
-                 xmlNodePtr node ATTRIBUTE_UNUSED,
-                 xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlValidCtxt vctxt;
-    int res = -1;
-
-    if ((ctxt == NULL) || (ctxt->doc == NULL)) return(-1);
-    memset(&vctxt, 0, sizeof(vctxt));
-    vctxt.error = xmlShellPrintf;
-    vctxt.warning = xmlShellPrintf;
-    vctxt.userData = ctxt;
-
-    if ((dtd == NULL) || (dtd[0] == 0)) {
-        res = xmlValidateDocument(&vctxt, ctxt->doc);
-    } else {
-        xmlDtdPtr subset;
-
-        subset = xmlParseDTD(NULL, (xmlChar *) dtd);
-        if (subset != NULL) {
-            res = xmlValidateDtd(&vctxt, ctxt->doc, subset);
-
-            xmlFreeDtd(subset);
-        }
-    }
-    return (res);
-}
-#endif /* LIBXML_VALID_ENABLED */
-
-/**
- * xmlShellDu:
- * @ctxt:  the shell context
- * @arg:  unused
- * @tree:  a node defining a subtree
- * @node2:  unused
- *
- * Implements the XML shell function "du"
- * show the structure of the subtree under node @tree
- * If @tree is null, the command works on the current node.
- *
- * Returns 0 or -1 in case of error
- */
-int
-xmlShellDu(xmlShellCtxtPtr ctxt,
-           char *arg ATTRIBUTE_UNUSED, xmlNodePtr tree,
-           xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlNodePtr node;
-    int indent = 0, i;
-
-    if (!ctxt)
-	return (-1);
-
-    if (tree == NULL)
-        return (-1);
-    node = tree;
-    while (node != NULL) {
-        if ((node->type == XML_DOCUMENT_NODE) ||
-            (node->type == XML_HTML_DOCUMENT_NODE)) {
-            fprintf(ctxt->output, "/\n");
-        } else if (node->type == XML_ELEMENT_NODE) {
-            for (i = 0; i < indent; i++)
-                fprintf(ctxt->output, "  ");
-            if ((node->ns) && (node->ns->prefix))
-                fprintf(ctxt->output, "%s:", node->ns->prefix);
-            fprintf(ctxt->output, "%s\n", node->name);
-        } else {
-        }
-
-        /*
-         * Browse the full subtree, deep first
-         */
-
-        if ((node->type == XML_DOCUMENT_NODE) ||
-            (node->type == XML_HTML_DOCUMENT_NODE)) {
-            node = ((xmlDocPtr) node)->children;
-        } else if ((node->children != NULL)
-                   && (node->type != XML_ENTITY_REF_NODE)) {
-            /* deep first */
-            node = node->children;
-            indent++;
-        } else if ((node != tree) && (node->next != NULL)) {
-            /* then siblings */
-            node = node->next;
-        } else if (node != tree) {
-            /* go up to parents->next if needed */
-            while (node != tree) {
-                if (node->parent != NULL) {
-                    node = node->parent;
-                    indent--;
-                }
-                if ((node != tree) && (node->next != NULL)) {
-                    node = node->next;
-                    break;
-                }
-                if (node->parent == NULL) {
-                    node = NULL;
-                    break;
-                }
-                if (node == tree) {
-                    node = NULL;
-                    break;
-                }
-            }
-            /* exit condition */
-            if (node == tree)
-                node = NULL;
-        } else
-            node = NULL;
-    }
-    return (0);
-}
-
-/**
- * xmlShellPwd:
- * @ctxt:  the shell context
- * @buffer:  the output buffer
- * @node:  a node
- * @node2:  unused
- *
- * Implements the XML shell function "pwd"
- * Show the full path from the root to the node, if needed building
- * thumblers when similar elements exists at a given ancestor level.
- * The output is compatible with XPath commands.
- *
- * Returns 0 or -1 in case of error
- */
-int
-xmlShellPwd(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED, char *buffer,
-            xmlNodePtr node, xmlNodePtr node2 ATTRIBUTE_UNUSED)
-{
-    xmlChar *path;
-
-    if ((node == NULL) || (buffer == NULL))
-        return (-1);
-
-    path = xmlGetNodePath(node);
-    if (path == NULL)
-	return (-1);
-
-    /*
-     * This test prevents buffer overflow, because this routine
-     * is only called by xmlShell, in which the second argument is
-     * 500 chars long.
-     * It is a dirty hack before a cleaner solution is found.
-     * Documentation should mention that the second argument must
-     * be at least 500 chars long, and could be stripped if too long.
-     */
-    snprintf(buffer, 499, "%s", path);
-    buffer[499] = '0';
-    xmlFree(path);
-
-    return (0);
-}
-
-/**
- * xmlShell:
- * @doc:  the initial document
- * @filename:  the output buffer
- * @input:  the line reading function
- * @output:  the output FILE*, defaults to stdout if NULL
- *
- * Implements the XML shell
- * This allow to load, validate, view, modify and save a document
- * using a environment similar to a UNIX commandline.
- */
-void
-xmlShell(xmlDocPtr doc, const char *filename, xmlShellReadlineFunc input,
-         FILE * output)
-{
-    char prompt[500] = "/ > ";
-    char *cmdline = NULL, *cur;
-    char command[100];
-    char arg[400];
-    int i;
-    xmlShellCtxtPtr ctxt;
-    xmlXPathObjectPtr list;
-
-    if (doc == NULL)
-        return;
-    if (filename == NULL)
-        return;
-    if (input == NULL)
-        return;
-    if (output == NULL)
-        output = stdout;
-    ctxt = (xmlShellCtxtPtr) xmlMalloc(sizeof(xmlShellCtxt));
-    if (ctxt == NULL)
-        return;
-    ctxt->loaded = 0;
-    ctxt->doc = doc;
-    ctxt->input = input;
-    ctxt->output = output;
-    ctxt->filename = (char *) xmlStrdup((xmlChar *) filename);
-    ctxt->node = (xmlNodePtr) ctxt->doc;
-
-#ifdef LIBXML_XPATH_ENABLED
-    ctxt->pctxt = xmlXPathNewContext(ctxt->doc);
-    if (ctxt->pctxt == NULL) {
-        xmlFree(ctxt);
-        return;
-    }
-#endif /* LIBXML_XPATH_ENABLED */
-    while (1) {
-        if (ctxt->node == (xmlNodePtr) ctxt->doc)
-            snprintf(prompt, sizeof(prompt), "%s > ", "/");
-        else if ((ctxt->node != NULL) && (ctxt->node->name) &&
-                 (ctxt->node->ns) && (ctxt->node->ns->prefix))
-            snprintf(prompt, sizeof(prompt), "%s:%s > ",
-                     (ctxt->node->ns->prefix), ctxt->node->name);
-        else if ((ctxt->node != NULL) && (ctxt->node->name))
-            snprintf(prompt, sizeof(prompt), "%s > ", ctxt->node->name);
-        else
-            snprintf(prompt, sizeof(prompt), "? > ");
-        prompt[sizeof(prompt) - 1] = 0;
-
-        /*
-         * Get a new command line
-         */
-        cmdline = ctxt->input(prompt);
-        if (cmdline == NULL)
-            break;
-
-        /*
-         * Parse the command itself
-         */
-        cur = cmdline;
-        while ((*cur == ' ') || (*cur == '\t'))
-            cur++;
-        i = 0;
-        while ((*cur != ' ') && (*cur != '\t') &&
-               (*cur != '\n') && (*cur != '\r')) {
-            if (*cur == 0)
-                break;
-            command[i++] = *cur++;
-        }
-        command[i] = 0;
-        if (i == 0)
-            continue;
-
-        /*
-         * Parse the argument
-         */
-        while ((*cur == ' ') || (*cur == '\t'))
-            cur++;
-        i = 0;
-        while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
-            if (*cur == 0)
-                break;
-            arg[i++] = *cur++;
-        }
-        arg[i] = 0;
-
-        /*
-         * start interpreting the command
-         */
-        if (!strcmp(command, "exit"))
-            break;
-        if (!strcmp(command, "quit"))
-            break;
-        if (!strcmp(command, "bye"))
-            break;
-		if (!strcmp(command, "help")) {
-		  fprintf(ctxt->output, "\tbase         display XML base of the node\n");
-		  fprintf(ctxt->output, "\tsetbase URI  change the XML base of the node\n");
-		  fprintf(ctxt->output, "\tbye          leave shell\n");
-		  fprintf(ctxt->output, "\tcat [node]   display node or current node\n");
-		  fprintf(ctxt->output, "\tcd [path]    change directory to path or to root\n");
-		  fprintf(ctxt->output, "\tdir [path]   dumps information about the node (namespace, attributes, content)\n");
-		  fprintf(ctxt->output, "\tdu [path]    show the structure of the subtree under path or the current node\n");
-		  fprintf(ctxt->output, "\texit         leave shell\n");
-		  fprintf(ctxt->output, "\thelp         display this help\n");
-		  fprintf(ctxt->output, "\tfree         display memory usage\n");
-		  fprintf(ctxt->output, "\tload [name]  load a new document with name\n");
-		  fprintf(ctxt->output, "\tls [path]    list contents of path or the current directory\n");
-		  fprintf(ctxt->output, "\tset xml_fragment replace the current node content with the fragment parsed in context\n");
-#ifdef LIBXML_XPATH_ENABLED
-		  fprintf(ctxt->output, "\txpath expr   evaluate the XPath expression in that context and print the result\n");
-		  fprintf(ctxt->output, "\tsetns nsreg  register a namespace to a prefix in the XPath evaluation context\n");
-		  fprintf(ctxt->output, "\t             format for nsreg is: prefix=[nsuri] (i.e. prefix= unsets a prefix)\n");
-		  fprintf(ctxt->output, "\tsetrootns    register all namespace found on the root element\n");
-		  fprintf(ctxt->output, "\t             the default namespace if any uses 'defaultns' prefix\n");
-#endif /* LIBXML_XPATH_ENABLED */
-		  fprintf(ctxt->output, "\tpwd          display current working directory\n");
-		  fprintf(ctxt->output, "\twhereis      display absolute path of [path] or current working directory\n");
-		  fprintf(ctxt->output, "\tquit         leave shell\n");
-#ifdef LIBXML_OUTPUT_ENABLED
-		  fprintf(ctxt->output, "\tsave [name]  save this document to name or the original name\n");
-		  fprintf(ctxt->output, "\twrite [name] write the current node to the filename\n");
-#endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_VALID_ENABLED
-		  fprintf(ctxt->output, "\tvalidate     check the document for errors\n");
-#endif /* LIBXML_VALID_ENABLED */
-#ifdef LIBXML_SCHEMAS_ENABLED
-		  fprintf(ctxt->output, "\trelaxng rng  validate the document against the Relax-NG schemas\n");
-#endif
-		  fprintf(ctxt->output, "\tgrep string  search for a string in the subtree\n");
-#ifdef LIBXML_VALID_ENABLED
-        } else if (!strcmp(command, "validate")) {
-            xmlShellValidate(ctxt, arg, NULL, NULL);
-#endif /* LIBXML_VALID_ENABLED */
-        } else if (!strcmp(command, "load")) {
-            xmlShellLoad(ctxt, arg, NULL, NULL);
-#ifdef LIBXML_SCHEMAS_ENABLED
-        } else if (!strcmp(command, "relaxng")) {
-            xmlShellRNGValidate(ctxt, arg, NULL, NULL);
-#endif
-#ifdef LIBXML_OUTPUT_ENABLED
-        } else if (!strcmp(command, "save")) {
-            xmlShellSave(ctxt, arg, NULL, NULL);
-        } else if (!strcmp(command, "write")) {
-	    if (arg[0] == 0)
-		fprintf(ctxt->output,
-                        "Write command requires a filename argument\n");
-	    else
-		xmlShellWrite(ctxt, arg, ctxt->node, NULL);
-#endif /* LIBXML_OUTPUT_ENABLED */
-        } else if (!strcmp(command, "grep")) {
-            xmlShellGrep(ctxt, arg, ctxt->node, NULL);
-        } else if (!strcmp(command, "pwd")) {
-            char dir[500];
-
-            if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
-                fprintf(ctxt->output, "%s\n", dir);
-        } else if (!strcmp(command, "du")) {
-            if (arg[0] == 0) {
-                xmlShellDu(ctxt, NULL, ctxt->node, NULL);
-            } else {
-                ctxt->pctxt->node = ctxt->node;
-#ifdef LIBXML_XPATH_ENABLED
-                ctxt->pctxt->node = ctxt->node;
-                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
-#else
-                list = NULL;
-#endif /* LIBXML_XPATH_ENABLED */
-                if (list != NULL) {
-                    switch (list->type) {
-                        case XPATH_UNDEFINED:
-                            fprintf(ctxt->output,
-                                            "%s: no such node\n", arg);
-                            break;
-                        case XPATH_NODESET:{
-                            int indx;
-
-                            if (list->nodesetval == NULL)
-                                break;
-
-                            for (indx = 0;
-                                 indx < list->nodesetval->nodeNr;
-                                 indx++)
-                                xmlShellDu(ctxt, NULL,
-                                           list->nodesetval->
-                                           nodeTab[indx], NULL);
-                            break;
-                        }
-                        case XPATH_BOOLEAN:
-                            fprintf(ctxt->output,
-                                            "%s is a Boolean\n", arg);
-                            break;
-                        case XPATH_NUMBER:
-                            fprintf(ctxt->output,
-                                            "%s is a number\n", arg);
-                            break;
-                        case XPATH_STRING:
-                            fprintf(ctxt->output,
-                                            "%s is a string\n", arg);
-                            break;
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-                        case XPATH_POINT:
-                            fprintf(ctxt->output,
-                                            "%s is a point\n", arg);
-                            break;
-                        case XPATH_RANGE:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-                        case XPATH_LOCATIONSET:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-#endif /* LIBXML_XPTR_LOCS_ENABLED */
-                        case XPATH_USERS:
-                            fprintf(ctxt->output,
-                                            "%s is user-defined\n", arg);
-                            break;
-                        case XPATH_XSLT_TREE:
-                            fprintf(ctxt->output,
-                                            "%s is an XSLT value tree\n",
-                                            arg);
-                            break;
-                    }
-#ifdef LIBXML_XPATH_ENABLED
-                    xmlXPathFreeObject(list);
-#endif
-                } else {
-                    fprintf(ctxt->output,
-                                    "%s: no such node\n", arg);
-                }
-                ctxt->pctxt->node = NULL;
-            }
-        } else if (!strcmp(command, "base")) {
-            xmlShellBase(ctxt, NULL, ctxt->node, NULL);
-        } else if (!strcmp(command, "set")) {
-	    xmlShellSetContent(ctxt, arg, ctxt->node, NULL);
-#ifdef LIBXML_XPATH_ENABLED
-        } else if (!strcmp(command, "setns")) {
-            if (arg[0] == 0) {
-		fprintf(ctxt->output,
-				"setns: prefix=[nsuri] required\n");
-            } else {
-                xmlShellRegisterNamespace(ctxt, arg, NULL, NULL);
-            }
-        } else if (!strcmp(command, "setrootns")) {
-	    xmlNodePtr root;
-
-	    root = xmlDocGetRootElement(ctxt->doc);
-	    xmlShellRegisterRootNamespaces(ctxt, NULL, root, NULL);
-        } else if (!strcmp(command, "xpath")) {
-            if (arg[0] == 0) {
-		fprintf(ctxt->output,
-				"xpath: expression required\n");
-	    } else {
-                ctxt->pctxt->node = ctxt->node;
-                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
-		xmlXPathDebugDumpObject(ctxt->output, list, 0);
-		xmlXPathFreeObject(list);
-	    }
-#endif /* LIBXML_XPATH_ENABLED */
-#ifdef LIBXML_TREE_ENABLED
-        } else if (!strcmp(command, "setbase")) {
-            xmlShellSetBase(ctxt, arg, ctxt->node, NULL);
-#endif
-        } else if ((!strcmp(command, "ls")) || (!strcmp(command, "dir"))) {
-            int dir = (!strcmp(command, "dir"));
-
-            if (arg[0] == 0) {
-                if (dir)
-                    xmlShellDir(ctxt, NULL, ctxt->node, NULL);
-                else
-                    xmlShellList(ctxt, NULL, ctxt->node, NULL);
-            } else {
-                ctxt->pctxt->node = ctxt->node;
-#ifdef LIBXML_XPATH_ENABLED
-                ctxt->pctxt->node = ctxt->node;
-                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
-#else
-                list = NULL;
-#endif /* LIBXML_XPATH_ENABLED */
-                if (list != NULL) {
-                    switch (list->type) {
-                        case XPATH_UNDEFINED:
-                            fprintf(ctxt->output,
-                                            "%s: no such node\n", arg);
-                            break;
-                        case XPATH_NODESET:{
-                                int indx;
-
-				if (list->nodesetval == NULL)
-				    break;
-
-                                for (indx = 0;
-                                     indx < list->nodesetval->nodeNr;
-                                     indx++) {
-                                    if (dir)
-                                        xmlShellDir(ctxt, NULL,
-                                                    list->nodesetval->
-                                                    nodeTab[indx], NULL);
-                                    else
-                                        xmlShellList(ctxt, NULL,
-                                                     list->nodesetval->
-                                                     nodeTab[indx], NULL);
-                                }
-                                break;
-                            }
-                        case XPATH_BOOLEAN:
-                            fprintf(ctxt->output,
-                                            "%s is a Boolean\n", arg);
-                            break;
-                        case XPATH_NUMBER:
-                            fprintf(ctxt->output,
-                                            "%s is a number\n", arg);
-                            break;
-                        case XPATH_STRING:
-                            fprintf(ctxt->output,
-                                            "%s is a string\n", arg);
-                            break;
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-                        case XPATH_POINT:
-                            fprintf(ctxt->output,
-                                            "%s is a point\n", arg);
-                            break;
-                        case XPATH_RANGE:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-                        case XPATH_LOCATIONSET:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-#endif /* LIBXML_XPTR_LOCS_ENABLED */
-                        case XPATH_USERS:
-                            fprintf(ctxt->output,
-                                            "%s is user-defined\n", arg);
-                            break;
-                        case XPATH_XSLT_TREE:
-                            fprintf(ctxt->output,
-                                            "%s is an XSLT value tree\n",
-                                            arg);
-                            break;
-                    }
-#ifdef LIBXML_XPATH_ENABLED
-                    xmlXPathFreeObject(list);
-#endif
-                } else {
-                    fprintf(ctxt->output,
-                                    "%s: no such node\n", arg);
-                }
-                ctxt->pctxt->node = NULL;
-            }
-        } else if (!strcmp(command, "whereis")) {
-            char dir[500];
-
-            if (arg[0] == 0) {
-                if (!xmlShellPwd(ctxt, dir, ctxt->node, NULL))
-                    fprintf(ctxt->output, "%s\n", dir);
-            } else {
-                ctxt->pctxt->node = ctxt->node;
-#ifdef LIBXML_XPATH_ENABLED
-                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
-#else
-                list = NULL;
-#endif /* LIBXML_XPATH_ENABLED */
-                if (list != NULL) {
-                    switch (list->type) {
-                        case XPATH_UNDEFINED:
-                            fprintf(ctxt->output,
-                                            "%s: no such node\n", arg);
-                            break;
-                        case XPATH_NODESET:{
-                                int indx;
-
-				if (list->nodesetval == NULL)
-				    break;
-
-                                for (indx = 0;
-                                     indx < list->nodesetval->nodeNr;
-                                     indx++) {
-                                    if (!xmlShellPwd(ctxt, dir, list->nodesetval->
-                                                     nodeTab[indx], NULL))
-                                        fprintf(ctxt->output, "%s\n", dir);
-                                }
-                                break;
-                            }
-                        case XPATH_BOOLEAN:
-                            fprintf(ctxt->output,
-                                            "%s is a Boolean\n", arg);
-                            break;
-                        case XPATH_NUMBER:
-                            fprintf(ctxt->output,
-                                            "%s is a number\n", arg);
-                            break;
-                        case XPATH_STRING:
-                            fprintf(ctxt->output,
-                                            "%s is a string\n", arg);
-                            break;
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-                        case XPATH_POINT:
-                            fprintf(ctxt->output,
-                                            "%s is a point\n", arg);
-                            break;
-                        case XPATH_RANGE:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-                        case XPATH_LOCATIONSET:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-#endif /* LIBXML_XPTR_LOCS_ENABLED */
-                        case XPATH_USERS:
-                            fprintf(ctxt->output,
-                                            "%s is user-defined\n", arg);
-                            break;
-                        case XPATH_XSLT_TREE:
-                            fprintf(ctxt->output,
-                                            "%s is an XSLT value tree\n",
-                                            arg);
-                            break;
-                    }
-#ifdef LIBXML_XPATH_ENABLED
-                    xmlXPathFreeObject(list);
-#endif
-                } else {
-                    fprintf(ctxt->output,
-                                    "%s: no such node\n", arg);
-                }
-                ctxt->pctxt->node = NULL;
-            }
-        } else if (!strcmp(command, "cd")) {
-            if (arg[0] == 0) {
-                ctxt->node = (xmlNodePtr) ctxt->doc;
-            } else {
-#ifdef LIBXML_XPATH_ENABLED
-                int l;
-
-                ctxt->pctxt->node = ctxt->node;
-		l = strlen(arg);
-		if ((l >= 2) && (arg[l - 1] == '/'))
-		    arg[l - 1] = 0;
-                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
-#else
-                list = NULL;
-#endif /* LIBXML_XPATH_ENABLED */
-                if (list != NULL) {
-                    switch (list->type) {
-                        case XPATH_UNDEFINED:
-                            fprintf(ctxt->output,
-                                            "%s: no such node\n", arg);
-                            break;
-                        case XPATH_NODESET:
-                            if (list->nodesetval != NULL) {
-				if (list->nodesetval->nodeNr == 1) {
-				    ctxt->node = list->nodesetval->nodeTab[0];
-				    if ((ctxt->node != NULL) &&
-				        (ctxt->node->type ==
-					 XML_NAMESPACE_DECL)) {
-					fprintf(ctxt->output,
-						    "cannot cd to namespace\n");
-					ctxt->node = NULL;
-				    }
-				} else
-				    fprintf(ctxt->output,
-						    "%s is a %d Node Set\n",
-						    arg,
-						    list->nodesetval->nodeNr);
-                            } else
-                                fprintf(ctxt->output,
-                                                "%s is an empty Node Set\n",
-                                                arg);
-                            break;
-                        case XPATH_BOOLEAN:
-                            fprintf(ctxt->output,
-                                            "%s is a Boolean\n", arg);
-                            break;
-                        case XPATH_NUMBER:
-                            fprintf(ctxt->output,
-                                            "%s is a number\n", arg);
-                            break;
-                        case XPATH_STRING:
-                            fprintf(ctxt->output,
-                                            "%s is a string\n", arg);
-                            break;
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-                        case XPATH_POINT:
-                            fprintf(ctxt->output,
-                                            "%s is a point\n", arg);
-                            break;
-                        case XPATH_RANGE:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-                        case XPATH_LOCATIONSET:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-#endif /* LIBXML_XPTR_LOCS_ENABLED */
-                        case XPATH_USERS:
-                            fprintf(ctxt->output,
-                                            "%s is user-defined\n", arg);
-                            break;
-                        case XPATH_XSLT_TREE:
-                            fprintf(ctxt->output,
-                                            "%s is an XSLT value tree\n",
-                                            arg);
-                            break;
-                    }
-#ifdef LIBXML_XPATH_ENABLED
-                    xmlXPathFreeObject(list);
-#endif
-                } else {
-                    fprintf(ctxt->output,
-                                    "%s: no such node\n", arg);
-                }
-                ctxt->pctxt->node = NULL;
-            }
-#ifdef LIBXML_OUTPUT_ENABLED
-        } else if (!strcmp(command, "cat")) {
-            if (arg[0] == 0) {
-                xmlShellCat(ctxt, NULL, ctxt->node, NULL);
-            } else {
-                ctxt->pctxt->node = ctxt->node;
-#ifdef LIBXML_XPATH_ENABLED
-                ctxt->pctxt->node = ctxt->node;
-                list = xmlXPathEval((xmlChar *) arg, ctxt->pctxt);
-#else
-                list = NULL;
-#endif /* LIBXML_XPATH_ENABLED */
-                if (list != NULL) {
-                    switch (list->type) {
-                        case XPATH_UNDEFINED:
-                            fprintf(ctxt->output,
-                                            "%s: no such node\n", arg);
-                            break;
-                        case XPATH_NODESET:{
-                                int indx;
-
-				if (list->nodesetval == NULL)
-				    break;
-
-                                for (indx = 0;
-                                     indx < list->nodesetval->nodeNr;
-                                     indx++) {
-                                    if (i > 0)
-                                        fprintf(ctxt->output, " -------\n");
-                                    xmlShellCat(ctxt, NULL,
-                                                list->nodesetval->
-                                                nodeTab[indx], NULL);
-                                }
-                                break;
-                            }
-                        case XPATH_BOOLEAN:
-                            fprintf(ctxt->output,
-                                            "%s is a Boolean\n", arg);
-                            break;
-                        case XPATH_NUMBER:
-                            fprintf(ctxt->output,
-                                            "%s is a number\n", arg);
-                            break;
-                        case XPATH_STRING:
-                            fprintf(ctxt->output,
-                                            "%s is a string\n", arg);
-                            break;
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-                        case XPATH_POINT:
-                            fprintf(ctxt->output,
-                                            "%s is a point\n", arg);
-                            break;
-                        case XPATH_RANGE:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-                        case XPATH_LOCATIONSET:
-                            fprintf(ctxt->output,
-                                            "%s is a range\n", arg);
-                            break;
-#endif /* LIBXML_XPTR_LOCS_ENABLED */
-                        case XPATH_USERS:
-                            fprintf(ctxt->output,
-                                            "%s is user-defined\n", arg);
-                            break;
-                        case XPATH_XSLT_TREE:
-                            fprintf(ctxt->output,
-                                            "%s is an XSLT value tree\n",
-                                            arg);
-                            break;
-                    }
-#ifdef LIBXML_XPATH_ENABLED
-                    xmlXPathFreeObject(list);
-#endif
-                } else {
-                    fprintf(ctxt->output,
-                                    "%s: no such node\n", arg);
-                }
-                ctxt->pctxt->node = NULL;
-            }
-#endif /* LIBXML_OUTPUT_ENABLED */
-        } else {
-            fprintf(ctxt->output,
-                            "Unknown command %s\n", command);
-        }
-        free(cmdline);          /* not xmlFree here ! */
-	cmdline = NULL;
-    }
-#ifdef LIBXML_XPATH_ENABLED
-    xmlXPathFreeContext(ctxt->pctxt);
-#endif /* LIBXML_XPATH_ENABLED */
-    if (ctxt->loaded) {
-        xmlFreeDoc(ctxt->doc);
-    }
-    if (ctxt->filename != NULL)
-        xmlFree(ctxt->filename);
-    xmlFree(ctxt);
-    if (cmdline != NULL)
-        free(cmdline);          /* not xmlFree here ! */
-}
-
-#endif /* LIBXML_XPATH_ENABLED */
-
 #endif /* LIBXML_DEBUG_ENABLED */
diff --git a/dict.c b/dict.c
index a238cd9..1ef1870 100644
--- a/dict.c
+++ b/dict.c
@@ -25,6 +25,7 @@
 #include <string.h>
 
 #include "private/dict.h"
+#include "private/error.h"
 #include "private/globals.h"
 #include "private/threads.h"
 
@@ -699,7 +700,7 @@
                       const xmlChar *name, int maybeLen, int update) {
     xmlDictEntry *entry = NULL;
     const xmlChar *ret;
-    unsigned hashValue;
+    unsigned hashValue, newSize;
     size_t maxLen, len, plen, klen;
     int found = 0;
 
@@ -726,10 +727,21 @@
     /*
      * Check for an existing entry
      */
-    if (dict->size > 0)
+    if (dict->size == 0) {
+        newSize = MIN_HASH_SIZE;
+    } else {
         entry = xmlDictFindEntry(dict, prefix, name, klen, hashValue, &found);
-    if (found)
-        return(entry);
+        if (found)
+            return(entry);
+
+        if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
+            if (dict->size >= MAX_HASH_SIZE)
+                return(NULL);
+            newSize = dict->size * 2;
+        } else {
+            newSize = 0;
+        }
+    }
 
     if ((dict->subdict != NULL) && (dict->subdict->size > 0)) {
         xmlDictEntry *subEntry;
@@ -753,16 +765,9 @@
     /*
      * Grow the hash table if needed
      */
-    if (dict->nbElems + 1 > dict->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
-        unsigned newSize, mask, displ, pos;
+    if (newSize > 0) {
+        unsigned mask, displ, pos;
 
-        if (dict->size == 0) {
-            newSize = MIN_HASH_SIZE;
-        } else {
-            if (dict->size >= MAX_HASH_SIZE)
-                return(NULL);
-            newSize = dict->size * 2;
-        }
         if (xmlDictGrow(dict, newSize) != 0)
             return(NULL);
 
@@ -929,13 +934,11 @@
   #include <windows.h>
   #include <bcrypt.h>
 #else
-  #if defined(HAVE_GETENTROPY)
-    #ifdef HAVE_UNISTD_H
-      #include <unistd.h>
-    #endif
-    #ifdef HAVE_SYS_RANDOM_H
-      #include <sys/random.h>
-    #endif
+  #if HAVE_DECL_GETENTROPY
+    /* POSIX 2024 */
+    #include <unistd.h>
+    /* Older platforms */
+    #include <sys/random.h>
   #endif
   #include <time.h>
 #endif
@@ -958,18 +961,23 @@
 #ifdef _WIN32
         NTSTATUS status;
 
+        /*
+         * You can find many (recent as of 2025) discussions how
+         * to get a pseudo-random seed on Windows in projects like
+         * Golang, Rust, Chromium and Firefox.
+         *
+         * TODO: Support ProcessPrng available since Windows 10.
+         */
         status = BCryptGenRandom(NULL, (unsigned char *) globalRngState,
                                  sizeof(globalRngState),
                                  BCRYPT_USE_SYSTEM_PREFERRED_RNG);
-        if (!BCRYPT_SUCCESS(status)) {
-            fprintf(stderr, "libxml2: BCryptGenRandom failed with "
-                    "error code %lu\n", GetLastError());
-            abort();
-        }
+        if (!BCRYPT_SUCCESS(status))
+            xmlAbort("libxml2: BCryptGenRandom failed with error code %lu\n",
+                     GetLastError());
 #else
         int var;
 
-#if defined(HAVE_GETENTROPY)
+#if HAVE_DECL_GETENTROPY
         while (1) {
             if (getentropy(globalRngState, sizeof(globalRngState)) == 0)
                 return;
@@ -983,14 +991,20 @@
             if (errno == ENOSYS)
                 break;
 
-            if (errno != EINTR) {
-                fprintf(stderr, "libxml2: getentropy failed with "
-                        "error code %d\n", errno);
-                abort();
-            }
+            /*
+             * We really don't want to fallback to the unsafe PRNG
+             * for possibly accidental reasons, so we abort on any
+             * unknown error.
+             */
+            if (errno != EINTR)
+                xmlAbort("libxml2: getentropy failed with error code %d\n",
+                         errno);
         }
 #endif
 
+        /*
+         * TODO: Fallback to /dev/urandom for older POSIX systems.
+         */
         globalRngState[0] =
                 (unsigned) time(NULL) ^
                 HASH_ROL((unsigned) ((size_t) &xmlInitRandom & 0xFFFFFFFF), 8);
@@ -1052,10 +1066,6 @@
  */
 unsigned
 xmlRandom(void) {
-#ifdef LIBXML_THREAD_ENABLED
     return(xoroshiro64ss(xmlGetLocalRngState()));
-#else
-    return(xmlGlobalRandom());
-#endif
 }
 
diff --git a/doc/apibuild.py b/doc/apibuild.py
index 9255413..dbe9e12 100755
--- a/doc/apibuild.py
+++ b/doc/apibuild.py
@@ -21,9 +21,8 @@
 ignored_files = {
   "config.h": "generated portability layer",
   "libxml.h": "internal only",
-  "rngparser.c": "not yet integrated",
+  "lintmain.c": "executable",
   "testModule.c": "test tool",
-  "testThreads.c": "test tool",
   "testapi.c": "generated regression tests",
   "runtest.c": "regression tests program",
   "runsuite.c": "regression tests program",
@@ -32,6 +31,11 @@
   "testdso.c": "test for dynamid shared libraries",
   "testrecurse.c": "test for entities recursions",
   "timsort.h": "Internal header only for xpath.c 2.9.0",
+  "nanoftp.h": "empty",
+  "SAX.h": "empty",
+  "xmlunicode.h": "empty",
+  "xmllint.c": "executable",
+  "xmlcatalog.c": "executable",
 }
 
 ignored_words = {
@@ -57,12 +61,9 @@
   "LIBXML_ATTR_ALLOC_SIZE": (3, "macro for gcc checking extension"),
   "ATTRIBUTE_NO_SANITIZE": (3, "macro keyword"),
   "ATTRIBUTE_NO_SANITIZE_INTEGER": (0, "macro keyword"),
+  "ATTRIBUTE_COUNTED_BY": (3, "macro keyword"),
   "XML_DEPRECATED": (0, "macro keyword"),
-  "XML_GLOBALS_ALLOC": (0, "macro keyword"),
-  "XML_GLOBALS_ERROR": (0, "macro keyword"),
-  "XML_GLOBALS_IO": (0, "macro keyword"),
-  "XML_GLOBALS_PARSER": (0, "macro keyword"),
-  "XML_GLOBALS_TREE": (0, "macro keyword"),
+  "XML_DEPRECATED_MEMBER": (0, "macro keyword"),
   "XML_THREAD_LOCAL": (0, "macro keyword"),
 }
 
@@ -1161,10 +1162,8 @@
                     fname = token[1]
                     token = self.token()
                     if token[0] == "sep" and token[1] == ";":
-                        self.comment = None
                         token = self.token()
-                        fields.append((self.type, fname, self.comment))
-                        self.comment = None
+                        fields.append((self.type, fname))
                     else:
                         self.error("parseStruct: expecting ;", token)
                 elif token != None and token[0] == "sep" and token[1] == "{":
@@ -1714,12 +1713,7 @@
                 output.write(">\n");
                 try:
                     for field in self.idx.structs[name].info:
-                        desc = field[2]
-                        if desc == None:
-                            desc = ''
-                        else:
-                            desc = escape(desc)
-                        output.write("      <field name='%s' type='%s' info='%s'/>\n" % (field[1] , field[0], desc))
+                        output.write("      <field name='%s' type='%s'/>\n" % (field[1] , field[0]))
                 except:
                     print("Failed to serialize struct %s" % (name))
                 output.write("    </struct>\n")
diff --git a/doc/devhelp/general.html b/doc/devhelp/general.html
index 8b7ae7b..1212cdd 100644
--- a/doc/devhelp/general.html
+++ b/doc/devhelp/general.html
@@ -16,6 +16,6 @@
 <th width="100%" align="center">libxml2 Reference Manual</th>
 </tr></table>
 <h2><span class="refentrytitle">libxml2 API Modules</span></h2>
-<p><a href="libxml2-HTMLparser.html">HTMLparser</a> - interface for an HTML 4.0 non-verifying parser<br><a href="libxml2-HTMLtree.html">HTMLtree</a> - specific APIs to process HTML tree, especially serialization<br><a href="libxml2-SAX.html">SAX</a> - Old SAX version 1 handler, deprecated<br><a href="libxml2-SAX2.html">SAX2</a> - SAX2 parser interface used to build the DOM tree<br><a href="libxml2-c14n.html">c14n</a> - Provide Canonical XML and Exclusive XML Canonicalization<br><a href="libxml2-catalog.html">catalog</a> - interfaces to the Catalog handling system<br><a href="libxml2-chvalid.html">chvalid</a> - Unicode character range checking<br><a href="libxml2-debugXML.html">debugXML</a> - Tree debugging APIs<br><a href="libxml2-dict.html">dict</a> - string dictionary<br><a href="libxml2-encoding.html">encoding</a> - interface for the encoding conversion functions<br><a href="libxml2-entities.html">entities</a> - interface for the XML entities handling<br><a href="libxml2-globals.html">globals</a> - interface for all global variables of the library<br><a href="libxml2-hash.html">hash</a> - Chained hash tables<br><a href="libxml2-list.html">list</a> - lists interfaces<br><a href="libxml2-nanoftp.html">nanoftp</a> - minimal FTP implementation<br><a href="libxml2-nanohttp.html">nanohttp</a> - minimal HTTP implementation<br><a href="libxml2-parser.html">parser</a> - the core parser module<br><a href="libxml2-parserInternals.html">parserInternals</a> - internals routines and limits exported by the parser.<br><a href="libxml2-pattern.html">pattern</a> - pattern expression handling<br><a href="libxml2-relaxng.html">relaxng</a> - implementation of the Relax-NG validation<br><a href="libxml2-schemasInternals.html">schemasInternals</a> - internal interfaces for XML Schemas<br><a href="libxml2-schematron.html">schematron</a> - XML Schematron implementation<br><a href="libxml2-threads.html">threads</a> - interfaces for thread handling<br><a href="libxml2-tree.html">tree</a> - interfaces for tree manipulation<br><a href="libxml2-uri.html">uri</a> - library of generic URI related routines<br><a href="libxml2-valid.html">valid</a> - The DTD validation<br><a href="libxml2-xinclude.html">xinclude</a> - implementation of XInclude<br><a href="libxml2-xlink.html">xlink</a> - unfinished XLink detection module<br><a href="libxml2-xmlIO.html">xmlIO</a> - interface for the I/O interfaces used by the parser<br><a href="libxml2-xmlautomata.html">xmlautomata</a> - API to build regexp automata<br><a href="libxml2-xmlerror.html">xmlerror</a> - error handling<br><a href="libxml2-xmlexports.html">xmlexports</a> - macros for marking symbols as exportable/importable.<br><a href="libxml2-xmlmemory.html">xmlmemory</a> - interface for the memory allocator<br><a href="libxml2-xmlmodule.html">xmlmodule</a> - dynamic module loading<br><a href="libxml2-xmlreader.html">xmlreader</a> - the XMLReader implementation<br><a href="libxml2-xmlregexp.html">xmlregexp</a> - regular expressions handling<br><a href="libxml2-xmlsave.html">xmlsave</a> - the XML document serializer<br><a href="libxml2-xmlschemas.html">xmlschemas</a> - incomplete XML Schemas structure implementation<br><a href="libxml2-xmlschemastypes.html">xmlschemastypes</a> - implementation of XML Schema Datatypes<br><a href="libxml2-xmlstring.html">xmlstring</a> - set of routines to process strings<br><a href="libxml2-xmlunicode.html">xmlunicode</a> - Unicode character APIs<br><a href="libxml2-xmlversion.html">xmlversion</a> - compile-time version information<br><a href="libxml2-xmlwriter.html">xmlwriter</a> - text writing API for XML<br><a href="libxml2-xpath.html">xpath</a> - XML Path Language implementation<br><a href="libxml2-xpathInternals.html">xpathInternals</a> - internal interfaces for XML Path Language implementation<br><a href="libxml2-xpointer.html">xpointer</a> - API to handle XML Pointers<br></p>
+<p><a href="libxml2-HTMLparser.html">HTMLparser</a> - interface for an HTML 4.0 non-verifying parser<br><a href="libxml2-HTMLtree.html">HTMLtree</a> - specific APIs to process HTML tree, especially serialization<br><a href="libxml2-SAX2.html">SAX2</a> - SAX2 parser interface used to build the DOM tree<br><a href="libxml2-c14n.html">c14n</a> - Provide Canonical XML and Exclusive XML Canonicalization<br><a href="libxml2-catalog.html">catalog</a> - interfaces to the Catalog handling system<br><a href="libxml2-chvalid.html">chvalid</a> - Unicode character range checking<br><a href="libxml2-debugXML.html">debugXML</a> - Tree debugging APIs<br><a href="libxml2-dict.html">dict</a> - string dictionary<br><a href="libxml2-encoding.html">encoding</a> - interface for the encoding conversion functions<br><a href="libxml2-entities.html">entities</a> - interface for the XML entities handling<br><a href="libxml2-globals.html">globals</a> - interface for all global variables of the library<br><a href="libxml2-hash.html">hash</a> - Chained hash tables<br><a href="libxml2-list.html">list</a> - lists interfaces<br><a href="libxml2-nanohttp.html">nanohttp</a> - minimal HTTP implementation<br><a href="libxml2-parser.html">parser</a> - the core parser module<br><a href="libxml2-parserInternals.html">parserInternals</a> - internals routines and limits exported by the parser.<br><a href="libxml2-pattern.html">pattern</a> - pattern expression handling<br><a href="libxml2-relaxng.html">relaxng</a> - implementation of the Relax-NG validation<br><a href="libxml2-schemasInternals.html">schemasInternals</a> - internal interfaces for XML Schemas<br><a href="libxml2-schematron.html">schematron</a> - XML Schematron implementation<br><a href="libxml2-threads.html">threads</a> - interfaces for thread handling<br><a href="libxml2-tree.html">tree</a> - interfaces for tree manipulation<br><a href="libxml2-uri.html">uri</a> - library of generic URI related routines<br><a href="libxml2-valid.html">valid</a> - The DTD validation<br><a href="libxml2-xinclude.html">xinclude</a> - implementation of XInclude<br><a href="libxml2-xlink.html">xlink</a> - unfinished XLink detection module<br><a href="libxml2-xmlIO.html">xmlIO</a> - interface for the I/O interfaces used by the parser<br><a href="libxml2-xmlautomata.html">xmlautomata</a> - API to build regexp automata<br><a href="libxml2-xmlerror.html">xmlerror</a> - error handling<br><a href="libxml2-xmlexports.html">xmlexports</a> - macros for marking symbols as exportable/importable.<br><a href="libxml2-xmlmemory.html">xmlmemory</a> - interface for the memory allocator<br><a href="libxml2-xmlmodule.html">xmlmodule</a> - dynamic module loading<br><a href="libxml2-xmlreader.html">xmlreader</a> - the XMLReader implementation<br><a href="libxml2-xmlregexp.html">xmlregexp</a> - regular expressions handling<br><a href="libxml2-xmlsave.html">xmlsave</a> - the XML document serializer<br><a href="libxml2-xmlschemas.html">xmlschemas</a> - incomplete XML Schemas structure implementation<br><a href="libxml2-xmlschemastypes.html">xmlschemastypes</a> - implementation of XML Schema Datatypes<br><a href="libxml2-xmlstring.html">xmlstring</a> - set of routines to process strings<br><a href="libxml2-xmlversion.html">xmlversion</a> - compile-time version information<br><a href="libxml2-xmlwriter.html">xmlwriter</a> - text writing API for XML<br><a href="libxml2-xpath.html">xpath</a> - XML Path Language implementation<br><a href="libxml2-xpathInternals.html">xpathInternals</a> - internal interfaces for XML Path Language implementation<br><a href="libxml2-xpointer.html">xpointer</a> - API to handle XML Pointers<br></p>
 </body>
 </html>
diff --git a/doc/devhelp/libxml2-HTMLparser.html b/doc/devhelp/libxml2-HTMLparser.html
index 22942a8..6e6d1c5 100644
--- a/doc/devhelp/libxml2-HTMLparser.html
+++ b/doc/devhelp/libxml2-HTMLparser.html
@@ -21,7 +21,8 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">#define <a href="#htmlDefaultSubelement">htmlDefaultSubelement</a>(elt);
+<pre class="synopsis">#define <a href="#UTF8ToHtml">UTF8ToHtml</a>;
+#define <a href="#htmlDefaultSubelement">htmlDefaultSubelement</a>(elt);
 #define <a href="#htmlElementAllowedHereDesc">htmlElementAllowedHereDesc</a>(parent, elt);
 #define <a href="#htmlRequiredAttrs">htmlRequiredAttrs</a>(elt);
 typedef <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> <a href="#htmlDocPtr">htmlDocPtr</a>;
@@ -39,7 +40,6 @@
 typedef <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> <a href="#htmlSAXHandler">htmlSAXHandler</a>;
 typedef <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> <a href="#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a>;
 typedef enum <a href="#htmlStatus">htmlStatus</a>;
-int	<a href="#UTF8ToHtml">UTF8ToHtml</a>			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
 <a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a>	<a href="#htmlAttrAllowed">htmlAttrAllowed</a>		(const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * elt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * attr, <br>					 int legacy);
 int	<a href="#htmlAutoCloseTag">htmlAutoCloseTag</a>		(<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem);
 <a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a>	<a href="#htmlCreateFileParserCtxt">htmlCreateFileParserCtxt</a>	(const char * filename, <br>							 const char * encoding);
@@ -52,6 +52,7 @@
 <a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	<a href="#htmlCtxtReadIO">htmlCtxtReadIO</a>		(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioread, <br>					 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioclose, <br>					 void * ioctx, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options);
 <a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	<a href="#htmlCtxtReadMemory">htmlCtxtReadMemory</a>	(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br>					 const char * buffer, <br>					 int size, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options);
 void	<a href="#htmlCtxtReset">htmlCtxtReset</a>			(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt);
+int	<a href="#htmlCtxtSetOptions">htmlCtxtSetOptions</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int options);
 int	<a href="#htmlCtxtUseOptions">htmlCtxtUseOptions</a>		(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br>					 int options);
 int	<a href="#htmlElementAllowedHere">htmlElementAllowedHere</a>		(const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * parent, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elt);
 <a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a>	<a href="#htmlElementStatusHere">htmlElementStatusHere</a>	(const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * parent, <br>					 const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * elt);
@@ -81,6 +82,7 @@
 <a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	<a href="#htmlSAXParseDoc">htmlSAXParseDoc</a>		(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);
 <a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	<a href="#htmlSAXParseFile">htmlSAXParseFile</a>	(const char * filename, <br>					 const char * encoding, <br>					 <a href="libxml2-HTMLparser.html#htmlSAXHandlerPtr">htmlSAXHandlerPtr</a> sax, <br>					 void * userData);
 const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> *	<a href="#htmlTagLookup">htmlTagLookup</a>	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * tag);
+int	<a href="#htmlUTF8ToHtml">htmlUTF8ToHtml</a>			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
 </pre>
 </div>
 <div class="refsect1" lang="en"><h2>Description</h2></div>
@@ -89,6 +91,14 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
+<a name="UTF8ToHtml">Macro </a>UTF8ToHtml</h3>
+<pre class="programlisting">#define <a href="#UTF8ToHtml">UTF8ToHtml</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="htmlDefaultSubelement">Macro </a>htmlDefaultSubelement</h3>
 <pre class="programlisting">#define <a href="#htmlDefaultSubelement">htmlDefaultSubelement</a>(elt);
 </pre>
@@ -150,20 +160,21 @@
 <h3>
 <a name="htmlElemDesc">Structure </a>htmlElemDesc</h3>
 <pre class="programlisting">struct _htmlElemDesc {
-    const char *	name	: The tag name
-    char	startTag	: Whether the start tag can be implied
-    char	endTag	: Whether the end tag can be implied
-    char	saveEndTag	: Whether the end tag should be saved
-    char	empty	: Is this an empty element ?
-    char	depr	: Is this a deprecated element ?
-    char	dtd	: 1: only in Loose DTD, 2: only Frameset one
-    char	isinline	: is this a block 0 or inline 1 element
-    const char *	desc	: the description NRK Jan.2003 * New fields encapsulating HTML structur
-    const char **	subelts	: allowed sub-elements of this element
-    const char *	defaultsubelt	: subelement for suggested auto-repair if necessary or NULL
-    const char **	attrs_opt	: Optional Attributes
-    const char **	attrs_depr	: Additional deprecated attributes
-    const char **	attrs_req	: Required attributes
+    const char *	name
+    char	startTag
+    char	endTag
+    char	saveEndTag
+    char	empty
+    char	depr
+    char	dtd
+    char	isinline
+    const char *	desc
+    const char **	subelts
+    const char *	defaultsubelt
+    const char **	attrs_opt
+    const char **	attrs_depr
+    const char **	attrs_req
+    int	dataMode
 } htmlElemDesc;
 </pre>
 <p></p>
@@ -181,9 +192,9 @@
 <h3>
 <a name="htmlEntityDesc">Structure </a>htmlEntityDesc</h3>
 <pre class="programlisting">struct _htmlEntityDesc {
-    unsigned int	value	: the UNICODE value for the character
-    const char *	name	: The entity name
-    const char *	desc	: the description
+    unsigned int	value
+    const char *	name
+    const char *	desc
 } htmlEntityDesc;
 </pre>
 <p></p>
@@ -249,16 +260,19 @@
 <h3>
 <a name="htmlParserOption">Enum </a>htmlParserOption</h3>
 <pre class="programlisting">enum <a href="#htmlParserOption">htmlParserOption</a> {
-    <a name="HTML_PARSE_RECOVER">HTML_PARSE_RECOVER</a> = 1 /* Relaxed parsing */
+    <a name="HTML_PARSE_RECOVER">HTML_PARSE_RECOVER</a> = 1 /* No effect */
+    <a name="HTML_PARSE_HTML5">HTML_PARSE_HTML5</a> = 2 /* HTML5 support */
     <a name="HTML_PARSE_NODEFDTD">HTML_PARSE_NODEFDTD</a> = 4 /* do not default a doctype if not found */
     <a name="HTML_PARSE_NOERROR">HTML_PARSE_NOERROR</a> = 32 /* suppress error reports */
     <a name="HTML_PARSE_NOWARNING">HTML_PARSE_NOWARNING</a> = 64 /* suppress warning reports */
-    <a name="HTML_PARSE_PEDANTIC">HTML_PARSE_PEDANTIC</a> = 128 /* pedantic error reporting */
+    <a name="HTML_PARSE_PEDANTIC">HTML_PARSE_PEDANTIC</a> = 128 /* No effect */
     <a name="HTML_PARSE_NOBLANKS">HTML_PARSE_NOBLANKS</a> = 256 /* remove blank nodes */
-    <a name="HTML_PARSE_NONET">HTML_PARSE_NONET</a> = 2048 /* Forbid network access */
+    <a name="HTML_PARSE_NONET">HTML_PARSE_NONET</a> = 2048 /* No effect */
     <a name="HTML_PARSE_NOIMPLIED">HTML_PARSE_NOIMPLIED</a> = 8192 /* Do not add implied html/body... elements */
     <a name="HTML_PARSE_COMPACT">HTML_PARSE_COMPACT</a> = 65536 /* compact small text nodes */
-    <a name="HTML_PARSE_IGNORE_ENC">HTML_PARSE_IGNORE_ENC</a> = 2097152 /*  ignore internal document encoding hint */
+    <a name="HTML_PARSE_HUGE">HTML_PARSE_HUGE</a> = 524288 /* relax any hardcoded limit from the parser */
+    <a name="HTML_PARSE_IGNORE_ENC">HTML_PARSE_IGNORE_ENC</a> = 2097152 /* ignore internal document encoding hint */
+    <a name="HTML_PARSE_BIG_LINES">HTML_PARSE_BIG_LINES</a> = 4194304 /*  Store big lines numbers in text PSVI field */
 };
 </pre>
 <p></p>
@@ -304,43 +318,10 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="UTF8ToHtml"></a>UTF8ToHtml ()</h3>
-<pre class="programlisting">int	UTF8ToHtml			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
-</pre>
-<p>Take a block of UTF-8 chars in and try to convert it to an ASCII plus HTML entities block of chars out.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>out</tt></i>:</span></td>
-<td>a pointer to an array of bytes to store the result</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
-<td>the length of @out</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>in</tt></i>:</span></td>
-<td>a pointer to an array of UTF-8 chars</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
-<td>the length of @in</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed as the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="htmlAttrAllowed"></a>htmlAttrAllowed ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a>	htmlAttrAllowed		(const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * elt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * attr, <br>					 int legacy)<br>
 </pre>
-<p>Checks whether an <a href="libxml2-SAX.html#attribute">attribute</a> is valid for an element Has full knowledge of Required and Deprecated attributes</p>
+<p>DEPRECATED: Don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -350,8 +331,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>HTML <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>HTML attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>legacy</tt></i>:</span></td>
@@ -359,8 +339,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, <a href="libxml2-HTMLparser.html#HTML_INVALID">HTML_INVALID</a>
-</td>
+<td><a href="libxml2-HTMLparser.html#HTML_VALID">HTML_VALID</a></td>
 </tr>
 </tbody>
 </table></div>
@@ -371,7 +350,7 @@
 <a name="htmlAutoCloseTag"></a>htmlAutoCloseTag ()</h3>
 <pre class="programlisting">int	htmlAutoCloseTag		(<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem)<br>
 </pre>
-<p>The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if the element or one of it's children would autoclose the given tag.</p>
+<p>DEPRECATED: Internal function, don't use. The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if the element or one of it's children would autoclose the given tag.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -590,7 +569,7 @@
 <a name="htmlCtxtReadFile"></a>htmlCtxtReadFile ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	htmlCtxtReadFile	(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br>					 const char * filename, <br>					 const char * encoding, <br>					 int options)<br>
 </pre>
-<p>Parse an HTML file from the filesystem, the network or a user-defined resource loader. See xmlNewInputURL and <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a> for details.</p>
+<p>Parse an HTML file from the filesystem, the network or a user-defined resource loader. See <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a> for details.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -623,7 +602,7 @@
 <a name="htmlCtxtReadIO"></a>htmlCtxtReadIO ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	htmlCtxtReadIO		(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioread, <br>					 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioclose, <br>					 void * ioctx, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options)<br>
 </pre>
-<p>Parse an HTML document from I/O functions and source and build a tree. See xmlNewInputIO and <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a> for details.</p>
+<p>Parse an HTML document from I/O functions and source and build a tree. See <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a> for details.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -721,10 +700,35 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="htmlCtxtSetOptions"></a>htmlCtxtSetOptions ()</h3>
+<pre class="programlisting">int	htmlCtxtSetOptions		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int options)<br>
+</pre>
+<p>Applies the options to the parser context. Unset options are cleared. Available since 2.14.0. With older versions, you can use <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a>. <a href="libxml2-HTMLparser.html#HTML_PARSE_RECOVER">HTML_PARSE_RECOVER</a> No effect as of 2.14.0. <a href="libxml2-HTMLparser.html#HTML_PARSE_HTML5">HTML_PARSE_HTML5</a> Make the tokenizer emit a SAX callback for each token. This results in unbalanced invocations of startElement and endElement. For now, this is only usable with custom SAX callbacks. <a href="libxml2-HTMLparser.html#HTML_PARSE_NODEFDTD">HTML_PARSE_NODEFDTD</a> Do not default to a doctype if none was found. <a href="libxml2-HTMLparser.html#HTML_PARSE_NOERROR">HTML_PARSE_NOERROR</a> Disable error and warning reports to the error handlers. Errors are still accessible with <a href="libxml2-xmlerror.html#xmlCtxtGetLastError">xmlCtxtGetLastError</a>. <a href="libxml2-HTMLparser.html#HTML_PARSE_NOWARNING">HTML_PARSE_NOWARNING</a> Disable warning reports. <a href="libxml2-HTMLparser.html#HTML_PARSE_PEDANTIC">HTML_PARSE_PEDANTIC</a> No effect. <a href="libxml2-HTMLparser.html#HTML_PARSE_NOBLANKS">HTML_PARSE_NOBLANKS</a> Remove some text nodes containing only whitespace from the result document. Which nodes are removed depends on a conservative heuristic. The reindenting feature of the serialization code relies on this option to be set when parsing. Use of this option is DISCOURAGED. <a href="libxml2-HTMLparser.html#HTML_PARSE_NONET">HTML_PARSE_NONET</a> No effect. <a href="libxml2-HTMLparser.html#HTML_PARSE_NOIMPLIED">HTML_PARSE_NOIMPLIED</a> Do not add implied html, head or body elements. <a href="libxml2-HTMLparser.html#HTML_PARSE_COMPACT">HTML_PARSE_COMPACT</a> Store small strings directly in the node struct to save memory. <a href="libxml2-HTMLparser.html#HTML_PARSE_HUGE">HTML_PARSE_HUGE</a> Relax some internal limits. Available since 2.14.0. Use <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> works with older versions. Maximum size of text nodes, tags, comments, CDATA sections normal: 10M huge: 1B Maximum size of names, system literals, pubid literals normal: 50K huge: 10M Maximum nesting depth of elements normal: 256 huge: 2048 <a href="libxml2-HTMLparser.html#HTML_PARSE_IGNORE_ENC">HTML_PARSE_IGNORE_ENC</a> Ignore the encoding in the HTML declaration. This option is mostly unneeded these days. The only effect is to enforce UTF-8 decoding of ASCII-like data. <a href="libxml2-HTMLparser.html#HTML_PARSE_BIG_LINES">HTML_PARSE_BIG_LINES</a> Enable reporting of line numbers larger than 65535. Available since 2.14.0.</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 HTML parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>options</tt></i>:</span></td>
+<td>a bitmask of <a href="libxml2-parser.html#xmlParserOption">xmlParserOption</a> values</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>0 in case of success, the set of unknown or unimplemented options in case of error.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="htmlCtxtUseOptions"></a>htmlCtxtUseOptions ()</h3>
 <pre class="programlisting">int	htmlCtxtUseOptions		(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt, <br>					 int options)<br>
 </pre>
-<p>Applies the options to the parser context</p>
+<p>DEPRECATED: Use <a href="libxml2-HTMLparser.html#htmlCtxtSetOptions">htmlCtxtSetOptions</a>. Applies the options to the parser context. The following options are never cleared and can only be enabled: <a href="libxml2-HTMLparser.html#HTML_PARSE_NODEFDTD">HTML_PARSE_NODEFDTD</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_NOERROR">HTML_PARSE_NOERROR</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_NOWARNING">HTML_PARSE_NOWARNING</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_NOIMPLIED">HTML_PARSE_NOIMPLIED</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_COMPACT">HTML_PARSE_COMPACT</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_HUGE">HTML_PARSE_HUGE</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_IGNORE_ENC">HTML_PARSE_IGNORE_ENC</a> <a href="libxml2-HTMLparser.html#HTML_PARSE_BIG_LINES">HTML_PARSE_BIG_LINES</a></p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -749,7 +753,7 @@
 <a name="htmlElementAllowedHere"></a>htmlElementAllowedHere ()</h3>
 <pre class="programlisting">int	htmlElementAllowedHere		(const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * parent, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elt)<br>
 </pre>
-<p>Checks whether an HTML element may be a direct child of a parent element. Note - doesn't check for deprecated elements</p>
+<p>DEPRECATED: Don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -763,7 +767,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if allowed; 0 otherwise.</td>
+<td>1</td>
 </tr>
 </tbody>
 </table></div>
@@ -774,7 +778,7 @@
 <a name="htmlElementStatusHere"></a>htmlElementStatusHere ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a>	htmlElementStatusHere	(const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * parent, <br>					 const <a href="libxml2-HTMLparser.html#htmlElemDesc">htmlElemDesc</a> * elt)<br>
 </pre>
-<p>Checks whether an HTML element may be a direct child of a parent element. and if so whether it is valid or deprecated.</p>
+<p>DEPRECATED: Don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -788,8 +792,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>one of HTML_VALID, HTML_DEPRECATED, <a href="libxml2-HTMLparser.html#HTML_INVALID">HTML_INVALID</a>
-</td>
+<td><a href="libxml2-HTMLparser.html#HTML_VALID">HTML_VALID</a></td>
 </tr>
 </tbody>
 </table></div>
@@ -923,7 +926,7 @@
 <a name="htmlIsAutoClosed"></a>htmlIsAutoClosed ()</h3>
 <pre class="programlisting">int	htmlIsAutoClosed		(<a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a> doc, <br>					 <a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> elem)<br>
 </pre>
-<p>The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it's child</p>
+<p>DEPRECATED: Internal function, don't use. The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it's child</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -948,17 +951,17 @@
 <a name="htmlIsScriptAttribute"></a>htmlIsScriptAttribute ()</h3>
 <pre class="programlisting">int	htmlIsScriptAttribute		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Check if an <a href="libxml2-SAX.html#attribute">attribute</a> is of content type Script</p>
+<p>Check if an attribute is of content type Script</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>an attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 is the <a href="libxml2-SAX.html#attribute">attribute</a> is a script 0 otherwise</td>
+<td>1 is the attribute is a script 0 otherwise</td>
 </tr>
 </tbody>
 </table></div>
@@ -969,7 +972,7 @@
 <a name="htmlNewParserCtxt"></a>htmlNewParserCtxt ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a>	htmlNewParserCtxt	(void)<br>
 </pre>
-<p>Allocate and initialize a new HTML parser context. This can be used to parse HTML documents into DOM trees with functions like <a href="libxml2-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> or <a href="libxml2-parser.html#xmlCtxtReadMemory">xmlCtxtReadMemory</a>. See <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a> for parser options. See <a href="libxml2-parser.html#xmlCtxtSetErrorHandler">xmlCtxtSetErrorHandler</a> for advanced error handling. See xmlNewInputURL, xmlNewInputMemory, xmlNewInputIO and similar functions for advanced input control. See <a href="libxml2-HTMLparser.html#htmlNewSAXParserCtxt">htmlNewSAXParserCtxt</a> for custom SAX parsers.</p>
+<p>Allocate and initialize a new HTML parser context. This can be used to parse HTML documents into DOM trees with functions like <a href="libxml2-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> or <a href="libxml2-parser.html#xmlCtxtReadMemory">xmlCtxtReadMemory</a>. See <a href="libxml2-HTMLparser.html#htmlCtxtUseOptions">htmlCtxtUseOptions</a> for parser options. See <a href="libxml2-parser.html#xmlCtxtSetErrorHandler">xmlCtxtSetErrorHandler</a> for advanced error handling. See <a href="libxml2-HTMLparser.html#htmlNewSAXParserCtxt">htmlNewSAXParserCtxt</a> for custom SAX parsers.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -1009,7 +1012,7 @@
 <a name="htmlNodeStatus"></a>htmlNodeStatus ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlStatus">htmlStatus</a>	htmlNodeStatus		(<a href="libxml2-HTMLparser.html#htmlNodePtr">htmlNodePtr</a> node, <br>					 int legacy)<br>
 </pre>
-<p>Checks whether the tree node is valid. Experimental (the author only uses the HTML enhancements in a SAX parser)</p>
+<p>DEPRECATED: Don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1023,7 +1026,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>for Element nodes, a return from <a href="libxml2-HTMLparser.html#htmlElementAllowedHere">htmlElementAllowedHere</a> (if legacy allowed) or <a href="libxml2-HTMLparser.html#htmlElementStatusHere">htmlElementStatusHere</a> (otherwise). for Attribute nodes, a return from <a href="libxml2-HTMLparser.html#htmlAttrAllowed">htmlAttrAllowed</a> for other nodes, <a href="libxml2-HTMLparser.html#HTML_NA">HTML_NA</a> (no checks performed)</td>
+<td><a href="libxml2-HTMLparser.html#HTML_VALID">HTML_VALID</a></td>
 </tr>
 </tbody>
 </table></div>
@@ -1034,7 +1037,7 @@
 <a name="htmlParseCharRef"></a>htmlParseCharRef ()</h3>
 <pre class="programlisting">int	htmlParseCharRef		(<a href="libxml2-HTMLparser.html#htmlParserCtxtPtr">htmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>DEPRECATED: Internal function, don't use. parse Reference declarations [66] CharRef ::= '&amp;#' [0-9]+ ';' | '&amp;#x' [0-9a-fA-F]+ ';'</p>
+<p>DEPRECATED: Internal function, don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1044,7 +1047,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the value parsed (as an int)</td>
+<td>0</td>
 </tr>
 </tbody>
 </table></div>
@@ -1150,7 +1153,7 @@
 <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>DEPRECATED: Internal function, don't use. parse an HTML ENTITY references [68] EntityRef ::= '&amp;' Name ';'</p>
+<p>DEPRECATED: Internal function, don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1164,7 +1167,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the associated <a href="libxml2-HTMLparser.html#htmlEntityDescPtr">htmlEntityDescPtr</a> if found, or NULL otherwise, if non-NULL *str will have to be freed by the caller.</td>
+<td>NULL.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1175,7 +1178,7 @@
 <a name="htmlParseFile"></a>htmlParseFile ()</h3>
 <pre class="programlisting"><a href="libxml2-HTMLparser.html#htmlDocPtr">htmlDocPtr</a>	htmlParseFile		(const char * filename, <br>					 const char * encoding)<br>
 </pre>
-<p>Parse an HTML file and build a tree. See xmlNewInputURL for details.</p>
+<p>Parse an HTML file and build a tree.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1456,6 +1459,39 @@
 </table></div>
 </div>
 <hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="htmlUTF8ToHtml"></a>htmlUTF8ToHtml ()</h3>
+<pre class="programlisting">int	htmlUTF8ToHtml			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
+</pre>
+<p>Take a block of UTF-8 chars in and try to convert it to an ASCII plus HTML entities block of chars out.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>a pointer to an array of bytes to store the result</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
+<td>the length of @out</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>in</tt></i>:</span></td>
+<td>a pointer to an array of UTF-8 chars</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
+<td>the length of @in</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>0 if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed as the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
 </div>
 </div>
 </body>
diff --git a/doc/devhelp/libxml2-HTMLtree.html b/doc/devhelp/libxml2-HTMLtree.html
index 7e60ab6..8066266 100644
--- a/doc/devhelp/libxml2-HTMLtree.html
+++ b/doc/devhelp/libxml2-HTMLtree.html
@@ -13,7 +13,7 @@
 <td><a accesskey="p" href="libxml2-HTMLparser.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 <td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<td><a accesskey="n" href="libxml2-SAX.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<td><a accesskey="n" href="libxml2-SAX2.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 <th width="100%" align="center">libxml2 Reference Manual</th>
 </tr></table>
 <h2><span class="refentrytitle">HTMLtree</span></h2>
@@ -56,7 +56,7 @@
 <a name="HTML_COMMENT_NODE">Macro </a>HTML_COMMENT_NODE</h3>
 <pre class="programlisting">#define <a href="#HTML_COMMENT_NODE">HTML_COMMENT_NODE</a>;
 </pre>
-<p>Macro. A <a href="libxml2-SAX.html#comment">comment</a> in a HTML document is really implemented the same way as a <a href="libxml2-SAX.html#comment">comment</a> in an XML document.</p>
+<p>Macro. A comment in a HTML document is really implemented the same way as a comment in an XML document.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -64,7 +64,7 @@
 <a name="HTML_ENTITY_REF_NODE">Macro </a>HTML_ENTITY_REF_NODE</h3>
 <pre class="programlisting">#define <a href="#HTML_ENTITY_REF_NODE">HTML_ENTITY_REF_NODE</a>;
 </pre>
-<p>Macro. An entity <a href="libxml2-SAX.html#reference">reference</a> in a HTML document is really implemented the same way as an entity <a href="libxml2-SAX.html#reference">reference</a> in an XML document.</p>
+<p>Macro. An entity reference in a HTML document is really implemented the same way as an entity reference in an XML document.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -250,17 +250,17 @@
 <a name="htmlIsBooleanAttr"></a>htmlIsBooleanAttr ()</h3>
 <pre class="programlisting">int	htmlIsBooleanAttr		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Determine if a given <a href="libxml2-SAX.html#attribute">attribute</a> is a boolean <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>DEPRECATED: Internal function, don't use. Determine if a given attribute is a boolean attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the name of the <a href="libxml2-SAX.html#attribute">attribute</a> to check</td>
+<td>the name of the attribute to check</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>false if the <a href="libxml2-SAX.html#attribute">attribute</a> is not boolean, true otherwise.</td>
+<td>false if the attribute is not boolean, true otherwise.</td>
 </tr>
 </tbody>
 </table></div>
diff --git a/doc/devhelp/libxml2-SAX2.html b/doc/devhelp/libxml2-SAX2.html
index 410229c..b4ac60b 100644
--- a/doc/devhelp/libxml2-SAX2.html
+++ b/doc/devhelp/libxml2-SAX2.html
@@ -10,7 +10,7 @@
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
-<td><a accesskey="p" href="libxml2-SAX.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="p" href="libxml2-HTMLtree.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 <td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 <td><a accesskey="n" href="libxml2-c14n.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
@@ -85,7 +85,7 @@
 <a name="xmlSAX2AttributeDecl"></a>xmlSAX2AttributeDecl ()</h3>
 <pre class="programlisting">void	xmlSAX2AttributeDecl		(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br>					 int type, <br>					 int def, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br>					 <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)<br>
 </pre>
-<p>An <a href="libxml2-SAX.html#attribute">attribute</a> definition has been parsed</p>
+<p>An attribute definition has been parsed</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -99,11 +99,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>fullname</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>type</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> type</td>
+<td>the attribute type</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>def</tt></i>:</span></td>
@@ -111,7 +111,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>defaultValue</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> default value</td>
+<td>the attribute default value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>tree</tt></i>:</span></td>
@@ -242,7 +242,7 @@
 <a name="xmlSAX2EndElement"></a>xmlSAX2EndElement ()</h3>
 <pre class="programlisting">void	xmlSAX2EndElement		(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>called when the end of an element has been detected.</p>
+<p>DEPRECATED: Don't call this function directly. called when the end of an element has been detected. Used for HTML and SAX1.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -721,7 +721,7 @@
 <a name="xmlSAX2ResolveEntity"></a>xmlSAX2ResolveEntity ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlSAX2ResolveEntity	(void * ctx, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId)<br>
 </pre>
-<p>The entity loader, to control the loading of external entities, the application can either: - override this xmlSAX2ResolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it's own entity resolution routine</p>
+<p>This is only used to load DTDs. The preferred way to install custom resolvers is <a href="libxml2-parser.html#xmlCtxtSetResourceLoader">xmlCtxtSetResourceLoader</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -739,7 +739,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> if inlined or NULL for DOM behaviour.</td>
+<td>a parser input.</td>
 </tr>
 </tbody>
 </table></div>
@@ -750,7 +750,7 @@
 <a name="xmlSAX2SetDocumentLocator"></a>xmlSAX2SetDocumentLocator ()</h3>
 <pre class="programlisting">void	xmlSAX2SetDocumentLocator	(void * ctx, <br>					 <a href="libxml2-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc)<br>
 </pre>
-<p>Receive the document locator at startup, actually <a href="libxml2-parser.html#xmlDefaultSAXLocator">xmlDefaultSAXLocator</a> Everything is available on the context, so this is useless in our case.</p>
+<p>Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -786,7 +786,7 @@
 <a name="xmlSAX2StartElement"></a>xmlSAX2StartElement ()</h3>
 <pre class="programlisting">void	xmlSAX2StartElement		(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** atts)<br>
 </pre>
-<p>called when an opening tag has been processed.</p>
+<p>DEPRECATED: Don't call this function directly. Called when an opening tag has been processed. Used for HTML and SAX1.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -849,7 +849,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attributes</tt></i>:</span></td>
-<td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml2-SAX.html#attribute">attribute</a> values.</td>
+<td>pointer to the array of (localname/prefix/URI/value/end) attribute values.</td>
 </tr>
 </tbody>
 </table></div>
@@ -893,17 +893,17 @@
 <a name="xmlSAXDefaultVersion"></a>xmlSAXDefaultVersion ()</h3>
 <pre class="programlisting">int	xmlSAXDefaultVersion		(int version)<br>
 </pre>
-<p>DEPRECATED: Use parser option <a href="libxml2-parser.html#XML_PARSE_SAX1">XML_PARSE_SAX1</a>. Set the default version of SAX used globally by the library. By default, during initialization the default is set to 2. Note that it is generally a better coding style to use xmlSAXVersion() to set up the version explicitly for a given parsing context.</p>
+<p>DEPRECATED: Use parser option <a href="libxml2-parser.html#XML_PARSE_SAX1">XML_PARSE_SAX1</a>. Has no effect.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>version</tt></i>:</span></td>
-<td>the version, 1 or 2</td>
+<td>the version, must be 2</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the previous value in case of success and -1 in case of error.</td>
+<td>2 in case of success and -1 in case of error.</td>
 </tr>
 </tbody>
 </table></div>
diff --git a/doc/devhelp/libxml2-catalog.html b/doc/devhelp/libxml2-catalog.html
index 39d65dc..f00b095 100644
--- a/doc/devhelp/libxml2-catalog.html
+++ b/doc/devhelp/libxml2-catalog.html
@@ -242,7 +242,7 @@
 <a name="xmlACatalogResolvePublic"></a>xmlACatalogResolvePublic ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlACatalogResolvePublic	(<a href="libxml2-catalog.html#xmlCatalogPtr">xmlCatalogPtr</a> catal, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * pubID)<br>
 </pre>
-<p>Try to lookup the catalog local <a href="libxml2-SAX.html#reference">reference</a> associated to a public ID in that catalog</p>
+<p>Try to lookup the catalog local reference associated to a public ID in that catalog</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -424,7 +424,7 @@
 <a name="xmlCatalogGetDefaults"></a>xmlCatalogGetDefaults ()</h3>
 <pre class="programlisting"><a href="libxml2-catalog.html#xmlCatalogAllow">xmlCatalogAllow</a>	xmlCatalogGetDefaults	(void)<br>
 </pre>
-<p>Used to get the user preference w.r.t. to what catalogs should be accepted</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#XML_PARSE_NO_SYS_CATALOG">XML_PARSE_NO_SYS_CATALOG</a> and <a href="libxml2-parser.html#XML_PARSE_CATALOG_PI">XML_PARSE_CATALOG_PI</a>. Used to get the user preference w.r.t. to what catalogs should be accepted</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -439,7 +439,7 @@
 <a name="xmlCatalogGetPublic"></a>xmlCatalogGetPublic ()</h3>
 <pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlCatalogGetPublic	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * pubID)<br>
 </pre>
-<p>Try to lookup the catalog <a href="libxml2-SAX.html#reference">reference</a> associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()</p>
+<p>Try to lookup the catalog reference associated to a public ID DEPRECATED, use xmlCatalogResolvePublic()</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -460,7 +460,7 @@
 <a name="xmlCatalogGetSystem"></a>xmlCatalogGetSystem ()</h3>
 <pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlCatalogGetSystem	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * sysID)<br>
 </pre>
-<p>Try to lookup the catalog <a href="libxml2-SAX.html#reference">reference</a> associated to a system ID DEPRECATED, use xmlCatalogResolveSystem()</p>
+<p>Try to lookup the catalog reference associated to a system ID DEPRECATED, use xmlCatalogResolveSystem()</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -602,7 +602,7 @@
 <a name="xmlCatalogResolvePublic"></a>xmlCatalogResolvePublic ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlCatalogResolvePublic	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * pubID)<br>
 </pre>
-<p>Try to lookup the catalog <a href="libxml2-SAX.html#reference">reference</a> associated to a public ID</p>
+<p>Try to lookup the catalog reference associated to a public ID</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -686,7 +686,7 @@
 <a name="xmlCatalogSetDefaultPrefer"></a>xmlCatalogSetDefaultPrefer ()</h3>
 <pre class="programlisting"><a href="libxml2-catalog.html#xmlCatalogPrefer">xmlCatalogPrefer</a>	xmlCatalogSetDefaultPrefer	(<a href="libxml2-catalog.html#xmlCatalogPrefer">xmlCatalogPrefer</a> prefer)<br>
 </pre>
-<p>Allows to set the preference between public and system for deletion in XML Catalog resolution. C.f. section 4.1.1 of the spec Values accepted are <a href="libxml2-catalog.html#XML_CATA_PREFER_PUBLIC">XML_CATA_PREFER_PUBLIC</a> or <a href="libxml2-catalog.html#XML_CATA_PREFER_SYSTEM">XML_CATA_PREFER_SYSTEM</a></p>
+<p>DEPRECATED: This setting is global and not thread-safe. Allows to set the preference between public and system for deletion in XML Catalog resolution. C.f. section 4.1.1 of the spec Values accepted are <a href="libxml2-catalog.html#XML_CATA_PREFER_PUBLIC">XML_CATA_PREFER_PUBLIC</a> or <a href="libxml2-catalog.html#XML_CATA_PREFER_SYSTEM">XML_CATA_PREFER_SYSTEM</a></p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -707,7 +707,7 @@
 <a name="xmlCatalogSetDefaults"></a>xmlCatalogSetDefaults ()</h3>
 <pre class="programlisting">void	xmlCatalogSetDefaults		(<a href="libxml2-catalog.html#xmlCatalogAllow">xmlCatalogAllow</a> allow)<br>
 </pre>
-<p>Used to set the user preference w.r.t. to what catalogs should be accepted</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#XML_PARSE_NO_SYS_CATALOG">XML_PARSE_NO_SYS_CATALOG</a> and <a href="libxml2-parser.html#XML_PARSE_CATALOG_PI">XML_PARSE_CATALOG_PI</a>. Used to set the user preference w.r.t. to what catalogs should be accepted</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -758,7 +758,7 @@
 <a name="xmlInitializeCatalog"></a>xmlInitializeCatalog ()</h3>
 <pre class="programlisting">void	xmlInitializeCatalog		(void)<br>
 </pre>
-<p>Do the catalog initialization. this function is not thread safe, catalog initialization should preferably be done once at startup</p>
+<p>Load the default system catalog.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
diff --git a/doc/devhelp/libxml2-chvalid.html b/doc/devhelp/libxml2-chvalid.html
index 121c9ff..8eba838 100644
--- a/doc/devhelp/libxml2-chvalid.html
+++ b/doc/devhelp/libxml2-chvalid.html
@@ -292,7 +292,7 @@
 <pre class="programlisting">struct _xmlChRangeGroup {
     int	nbShortRange
     int	nbLongRange
-    const <a href="libxml2-chvalid.html#xmlChSRange">xmlChSRange</a> *	shortRange	: points to an array of ranges
+    const <a href="libxml2-chvalid.html#xmlChSRange">xmlChSRange</a> *	shortRange
     const <a href="libxml2-chvalid.html#xmlChLRange">xmlChLRange</a> *	longRange
 } xmlChRangeGroup;
 </pre>
diff --git a/doc/devhelp/libxml2-debugXML.html b/doc/devhelp/libxml2-debugXML.html
index ec134dc..3433670 100644
--- a/doc/devhelp/libxml2-debugXML.html
+++ b/doc/devhelp/libxml2-debugXML.html
@@ -22,10 +22,7 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">typedef struct _xmlShellCtxt <a href="#xmlShellCtxt">xmlShellCtxt</a>;
-typedef <a href="libxml2-debugXML.html#xmlShellCtxt">xmlShellCtxt</a> * <a href="#xmlShellCtxtPtr">xmlShellCtxtPtr</a>;
-const char *	<a href="#xmlBoolToText">xmlBoolToText</a>		(int boolval);
-int	<a href="#xmlDebugCheckDocument">xmlDebugCheckDocument</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
+<pre class="synopsis">int	<a href="#xmlDebugCheckDocument">xmlDebugCheckDocument</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
 void	<a href="#xmlDebugDumpAttr">xmlDebugDumpAttr</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth);
 void	<a href="#xmlDebugDumpAttrList">xmlDebugDumpAttrList</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth);
 void	<a href="#xmlDebugDumpDTD">xmlDebugDumpDTD</a>			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd);
@@ -36,24 +33,6 @@
 void	<a href="#xmlDebugDumpNodeList">xmlDebugDumpNodeList</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth);
 void	<a href="#xmlDebugDumpOneNode">xmlDebugDumpOneNode</a>		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int depth);
 void	<a href="#xmlDebugDumpString">xmlDebugDumpString</a>		(FILE * output, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str);
-int	<a href="#xmlLsCountNode">xmlLsCountNode</a>			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
-void	<a href="#xmlLsOneNode">xmlLsOneNode</a>			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
-void	<a href="#xmlShell">xmlShell</a>			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const char * filename, <br>					 <a href="libxml2-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a> input, <br>					 FILE * output);
-int	<a href="#xmlShellBase">xmlShellBase</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellCat">xmlShellCat</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-typedef int <a href="#xmlShellCmd">xmlShellCmd</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellDir">xmlShellDir</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellDu">xmlShellDu</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellList">xmlShellList</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellLoad">xmlShellLoad</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-void	<a href="#xmlShellPrintNode">xmlShellPrintNode</a>		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
-void	<a href="#xmlShellPrintXPathError">xmlShellPrintXPathError</a>		(int errorType, <br>					 const char * arg);
-void	<a href="#xmlShellPrintXPathResult">xmlShellPrintXPathResult</a>	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> list);
-int	<a href="#xmlShellPwd">xmlShellPwd</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * buffer, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-typedef char * <a href="#xmlShellReadlineFunc">xmlShellReadlineFunc</a>		(char * prompt);
-int	<a href="#xmlShellSave">xmlShellSave</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellValidate">xmlShellValidate</a>		(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * dtd, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
-int	<a href="#xmlShellWrite">xmlShellWrite</a>			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2);
 </pre>
 </div>
 <div class="refsect1" lang="en"><h2>Description</h2></div>
@@ -62,105 +41,6 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlShellCtxt">Structure </a>xmlShellCtxt</h3>
-<pre class="programlisting">struct _xmlShellCtxt {
-    char *	filename
-    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
-    <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>	pctxt
-    int	loaded
-    FILE *	output
-    <a href="libxml2-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a>	input
-} xmlShellCtxt;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellCtxtPtr">Typedef </a>xmlShellCtxtPtr</h3>
-<pre class="programlisting"><a href="libxml2-debugXML.html#xmlShellCtxt">xmlShellCtxt</a> * xmlShellCtxtPtr;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellCmd"></a>Function type xmlShellCmd</h3>
-<pre class="programlisting">int	xmlShellCmd			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>This is a generic signature for the XML shell functions.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>a shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>a string argument</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a first node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>a second node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>an int, negative returns indicating errors.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellReadlineFunc"></a>Function type xmlShellReadlineFunc</h3>
-<pre class="programlisting">char *	xmlShellReadlineFunc		(char * prompt)<br>
-</pre>
-<p>This is a generic signature for the XML shell input function.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>prompt</tt></i>:</span></td>
-<td>a string prompt</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a string which will be freed by the Shell.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlBoolToText"></a>xmlBoolToText ()</h3>
-<pre class="programlisting">const char *	xmlBoolToText		(int boolval)<br>
-</pre>
-<p>Convenient way to turn bool into text</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>boolval</tt></i>:</span></td>
-<td>a bool to turn into text</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to either "True" or "False"</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlDebugCheckDocument"></a>xmlDebugCheckDocument ()</h3>
 <pre class="programlisting">int	xmlDebugCheckDocument		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
 </pre>
@@ -189,7 +69,7 @@
 <a name="xmlDebugDumpAttr"></a>xmlDebugDumpAttr ()</h3>
 <pre class="programlisting">void	xmlDebugDumpAttr		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth)<br>
 </pre>
-<p>Dumps debug information for the <a href="libxml2-SAX.html#attribute">attribute</a></p>
+<p>Dumps debug information for the attribute</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -199,8 +79,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>depth</tt></i>:</span></td>
@@ -215,7 +94,7 @@
 <a name="xmlDebugDumpAttrList"></a>xmlDebugDumpAttrList ()</h3>
 <pre class="programlisting">void	xmlDebugDumpAttrList		(FILE * output, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 int depth)<br>
 </pre>
-<p>Dumps debug information for the <a href="libxml2-SAX.html#attribute">attribute</a> list</p>
+<p>Dumps debug information for the attribute list</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -225,7 +104,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> list</td>
+<td>the attribute list</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>depth</tt></i>:</span></td>
@@ -415,458 +294,6 @@
 </table></div>
 </div>
 <hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlLsCountNode"></a>xmlLsCountNode ()</h3>
-<pre class="programlisting">int	xmlLsCountNode			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br>
-</pre>
-<p>Count the children of @node.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>the node to count</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of children of @node.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlLsOneNode"></a>xmlLsOneNode ()</h3>
-<pre class="programlisting">void	xmlLsOneNode			(FILE * output, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br>
-</pre>
-<p>Dump to @output the type and name of @node.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>output</tt></i>:</span></td>
-<td>the FILE * for the output</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>the node to dump</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShell"></a>xmlShell ()</h3>
-<pre class="programlisting">void	xmlShell			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const char * filename, <br>					 <a href="libxml2-debugXML.html#xmlShellReadlineFunc">xmlShellReadlineFunc</a> input, <br>					 FILE * output)<br>
-</pre>
-<p>Implements the XML shell This allow to load, validate, view, modify and save a document using a environment similar to a UNIX commandline.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>doc</tt></i>:</span></td>
-<td>the initial document</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>filename</tt></i>:</span></td>
-<td>the output buffer</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>input</tt></i>:</span></td>
-<td>the line reading function</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>output</tt></i>:</span></td>
-<td>the output FILE*, defaults to stdout if NULL</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellBase"></a>xmlShellBase ()</h3>
-<pre class="programlisting">int	xmlShellBase			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "base" dumps the current XML base of the node</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellCat"></a>xmlShellCat ()</h3>
-<pre class="programlisting">int	xmlShellCat			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "cat" dumps the serialization node content (XML or HTML).</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellDir"></a>xmlShellDir ()</h3>
-<pre class="programlisting">int	xmlShellDir			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "dir" dumps information about the node (namespace, attributes, content).</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellDu"></a>xmlShellDu ()</h3>
-<pre class="programlisting">int	xmlShellDu			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "du" show the structure of the subtree under node @tree If @tree is null, the command works on the current node.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>tree</tt></i>:</span></td>
-<td>a node defining a subtree</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellList"></a>xmlShellList ()</h3>
-<pre class="programlisting">int	xmlShellList			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * arg, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "ls" Does an Unix like listing of the given node (like a directory)</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellLoad"></a>xmlShellLoad ()</h3>
-<pre class="programlisting">int	xmlShellLoad			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "load" loads a new document specified by the filename</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>filename</tt></i>:</span></td>
-<td>the file name</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 or -1 if loading failed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellPrintNode"></a>xmlShellPrintNode ()</h3>
-<pre class="programlisting">void	xmlShellPrintNode		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node)<br>
-</pre>
-<p>Print node to the output FILE</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a non-null node to print to the output FILE</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellPrintXPathError"></a>xmlShellPrintXPathError ()</h3>
-<pre class="programlisting">void	xmlShellPrintXPathError		(int errorType, <br>					 const char * arg)<br>
-</pre>
-<p>Print the xpath error to libxml default error channel</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>errorType</tt></i>:</span></td>
-<td>valid xpath error id</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>arg</tt></i>:</span></td>
-<td>the argument that cause xpath to fail</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellPrintXPathResult"></a>xmlShellPrintXPathResult ()</h3>
-<pre class="programlisting">void	xmlShellPrintXPathResult	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> list)<br>
-</pre>
-<p>Prints result to the output FILE</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>list</tt></i>:</span></td>
-<td>a valid result generated by an xpath evaluation</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellPwd"></a>xmlShellPwd ()</h3>
-<pre class="programlisting">int	xmlShellPwd			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * buffer, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "pwd" Show the full path from the root to the node, if needed building thumblers when similar elements exists at a given ancestor level. The output is compatible with XPath commands.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>buffer</tt></i>:</span></td>
-<td>the output buffer</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellSave"></a>xmlShellSave ()</h3>
-<pre class="programlisting">int	xmlShellSave			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "save" Write the current document to the filename, or it's original name</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>filename</tt></i>:</span></td>
-<td>the file name (optional)</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellValidate"></a>xmlShellValidate ()</h3>
-<pre class="programlisting">int	xmlShellValidate		(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * dtd, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "validate" Validate the document, if a DTD path is provided, then the validation is done against the given DTD.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>dtd</tt></i>:</span></td>
-<td>the DTD URI (optional)</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlShellWrite"></a>xmlShellWrite ()</h3>
-<pre class="programlisting">int	xmlShellWrite			(<a href="libxml2-debugXML.html#xmlShellCtxtPtr">xmlShellCtxtPtr</a> ctxt, <br>					 char * filename, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node2)<br>
-</pre>
-<p>Implements the XML shell function "write" Write the current node to the filename, it saves the serialization of the subtree under the @node specified</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the shell context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>filename</tt></i>:</span></td>
-<td>the file name</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node</tt></i>:</span></td>
-<td>a node in the tree</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>node2</tt></i>:</span></td>
-<td>unused</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
 </div>
 </div>
 </body>
diff --git a/doc/devhelp/libxml2-dict.html b/doc/devhelp/libxml2-dict.html
index d2a56c1..282d86f 100644
--- a/doc/devhelp/libxml2-dict.html
+++ b/doc/devhelp/libxml2-dict.html
@@ -258,7 +258,7 @@
 <a name="xmlDictReference"></a>xmlDictReference ()</h3>
 <pre class="programlisting">int	xmlDictReference		(<a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict)<br>
 </pre>
-<p>Increment the <a href="libxml2-SAX.html#reference">reference</a> counter of a dictionary</p>
+<p>Increment the reference counter of a dictionary</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/devhelp/libxml2-encoding.html b/doc/devhelp/libxml2-encoding.html
index f656c16..3b9708d 100644
--- a/doc/devhelp/libxml2-encoding.html
+++ b/doc/devhelp/libxml2-encoding.html
@@ -22,21 +22,27 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">typedef enum <a href="#xmlCharEncError">xmlCharEncError</a>;
+<pre class="synopsis">#define <a href="#UTF8Toisolat1">UTF8Toisolat1</a>;
+#define <a href="#isolat1ToUTF8">isolat1ToUTF8</a>;
+typedef enum <a href="#xmlCharEncError">xmlCharEncError</a>;
+typedef enum <a href="#xmlCharEncFlags">xmlCharEncFlags</a>;
 typedef enum <a href="#xmlCharEncoding">xmlCharEncoding</a>;
 typedef struct _xmlCharEncodingHandler <a href="#xmlCharEncodingHandler">xmlCharEncodingHandler</a>;
 typedef <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> * <a href="#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>;
-int	<a href="#UTF8Toisolat1">UTF8Toisolat1</a>			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
-int	<a href="#isolat1ToUTF8">isolat1ToUTF8</a>			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
 int	<a href="#xmlAddEncodingAlias">xmlAddEncodingAlias</a>		(const char * name, <br>					 const char * alias);
 int	<a href="#xmlCharEncCloseFunc">xmlCharEncCloseFunc</a>		(<a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> * handler);
+typedef void <a href="#xmlCharEncConvCtxtDtor">xmlCharEncConvCtxtDtor</a>		(void * vctxt);
+typedef <a href="libxml2-encoding.html#xmlCharEncError">xmlCharEncError</a> <a href="#xmlCharEncConvFunc">xmlCharEncConvFunc</a>	(void * vctxt, <br>					 unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen, <br>					 int flush);
+typedef <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> <a href="#xmlCharEncConvImpl">xmlCharEncConvImpl</a>	(void * vctxt, <br>					 const char * name, <br>					 <a href="libxml2-encoding.html#xmlCharEncFlags">xmlCharEncFlags</a> flags, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
 int	<a href="#xmlCharEncFirstLine">xmlCharEncFirstLine</a>		(<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);
 int	<a href="#xmlCharEncInFunc">xmlCharEncInFunc</a>		(<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);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlCharEncNewCustomHandler">xmlCharEncNewCustomHandler</a>	(const char * name, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvFunc">xmlCharEncConvFunc</a> input, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvFunc">xmlCharEncConvFunc</a> output, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvCtxtDtor">xmlCharEncConvCtxtDtor</a> ctxtDtor, <br>						 void * inputCtxt, <br>						 void * outputCtxt, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
 int	<a href="#xmlCharEncOutFunc">xmlCharEncOutFunc</a>		(<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);
 typedef int <a href="#xmlCharEncodingInputFunc">xmlCharEncodingInputFunc</a>	(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
 typedef int <a href="#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a>	(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
 void	<a href="#xmlCleanupCharEncodingHandlers">xmlCleanupCharEncodingHandlers</a>	(void);
 void	<a href="#xmlCleanupEncodingAliases">xmlCleanupEncodingAliases</a>	(void);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlCreateCharEncodingHandler">xmlCreateCharEncodingHandler</a>	(const char * name, <br>						 <a href="libxml2-encoding.html#xmlCharEncFlags">xmlCharEncFlags</a> flags, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvImpl">xmlCharEncConvImpl</a> impl, <br>						 void * implCtxt, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
 int	<a href="#xmlDelEncodingAlias">xmlDelEncodingAlias</a>		(const char * alias);
 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a>	<a href="#xmlDetectCharEncoding">xmlDetectCharEncoding</a>	(const unsigned char * in, <br>					 int len);
 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	<a href="#xmlFindCharEncodingHandler">xmlFindCharEncodingHandler</a>	(const char * name);
@@ -44,11 +50,13 @@
 const char *	<a href="#xmlGetCharEncodingName">xmlGetCharEncodingName</a>	(<a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
 const char *	<a href="#xmlGetEncodingAlias">xmlGetEncodingAlias</a>	(const char * alias);
 void	<a href="#xmlInitCharEncodingHandlers">xmlInitCharEncodingHandlers</a>	(void);
-int	<a href="#xmlLookupCharEncodingHandler">xmlLookupCharEncodingHandler</a>	(<a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
+int	<a href="#xmlIsolat1ToUTF8">xmlIsolat1ToUTF8</a>		(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlLookupCharEncodingHandler">xmlLookupCharEncodingHandler</a>	(<a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	<a href="#xmlNewCharEncodingHandler">xmlNewCharEncodingHandler</a>	(const char * name, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingInputFunc">xmlCharEncodingInputFunc</a> input, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> output);
-int	<a href="#xmlOpenCharEncodingHandler">xmlOpenCharEncodingHandler</a>	(const char * name, <br>					 int output, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlOpenCharEncodingHandler">xmlOpenCharEncodingHandler</a>	(const char * name, <br>						 int output, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out);
 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a>	<a href="#xmlParseCharEncoding">xmlParseCharEncoding</a>	(const char * name);
 void	<a href="#xmlRegisterCharEncodingHandler">xmlRegisterCharEncodingHandler</a>	(<a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> handler);
+int	<a href="#xmlUTF8ToIsolat1">xmlUTF8ToIsolat1</a>		(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen);
 </pre>
 </div>
 <div class="refsect1" lang="en"><h2>Description</h2></div>
@@ -57,13 +65,28 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
+<a name="UTF8Toisolat1">Macro </a>UTF8Toisolat1</h3>
+<pre class="programlisting">#define <a href="#UTF8Toisolat1">UTF8Toisolat1</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="isolat1ToUTF8">Macro </a>isolat1ToUTF8</h3>
+<pre class="programlisting">#define <a href="#isolat1ToUTF8">isolat1ToUTF8</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCharEncError">Enum </a>xmlCharEncError</h3>
 <pre class="programlisting">enum <a href="#xmlCharEncError">xmlCharEncError</a> {
-    <a name="XML_ENC_ERR_MEMORY">XML_ENC_ERR_MEMORY</a> = -5
-    <a name="XML_ENC_ERR_INTERNAL">XML_ENC_ERR_INTERNAL</a> = -4
-    <a name="XML_ENC_ERR_PARTIAL">XML_ENC_ERR_PARTIAL</a> = -3
+    <a name="XML_ENC_ERR_MEMORY">XML_ENC_ERR_MEMORY</a> = -4
+    <a name="XML_ENC_ERR_SPACE">XML_ENC_ERR_SPACE</a> = -3
     <a name="XML_ENC_ERR_INPUT">XML_ENC_ERR_INPUT</a> = -2
-    <a name="XML_ENC_ERR_SPACE">XML_ENC_ERR_SPACE</a> = -1
+    <a name="XML_ENC_ERR_INTERNAL">XML_ENC_ERR_INTERNAL</a> = -1
     <a name="XML_ENC_ERR_SUCCESS">XML_ENC_ERR_SUCCESS</a> = 0
 };
 </pre>
@@ -72,6 +95,17 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCharEncFlags">Enum </a>xmlCharEncFlags</h3>
+<pre class="programlisting">enum <a href="#xmlCharEncFlags">xmlCharEncFlags</a> {
+    <a name="XML_ENC_INPUT">XML_ENC_INPUT</a> = 1
+    <a name="XML_ENC_OUTPUT">XML_ENC_OUTPUT</a> = 2
+};
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCharEncoding">Enum </a>xmlCharEncoding</h3>
 <pre class="programlisting">enum <a href="#xmlCharEncoding">xmlCharEncoding</a> {
     <a name="XML_CHAR_ENCODING_ERROR">XML_CHAR_ENCODING_ERROR</a> = -1 /* No char encoding detected */
@@ -97,7 +131,15 @@
     <a name="XML_CHAR_ENCODING_2022_JP">XML_CHAR_ENCODING_2022_JP</a> = 19 /* ISO-2022-JP */
     <a name="XML_CHAR_ENCODING_SHIFT_JIS">XML_CHAR_ENCODING_SHIFT_JIS</a> = 20 /* Shift_JIS */
     <a name="XML_CHAR_ENCODING_EUC_JP">XML_CHAR_ENCODING_EUC_JP</a> = 21 /* EUC-JP */
-    <a name="XML_CHAR_ENCODING_ASCII">XML_CHAR_ENCODING_ASCII</a> = 22 /*  pure ASCII */
+    <a name="XML_CHAR_ENCODING_ASCII">XML_CHAR_ENCODING_ASCII</a> = 22 /* pure ASCII Available since 2.14.0 */
+    <a name="XML_CHAR_ENCODING_UTF16">XML_CHAR_ENCODING_UTF16</a> = 23 /* UTF-16 native */
+    <a name="XML_CHAR_ENCODING_HTML">XML_CHAR_ENCODING_HTML</a> = 24 /* HTML (output only) */
+    <a name="XML_CHAR_ENCODING_8859_10">XML_CHAR_ENCODING_8859_10</a> = 25 /* ISO-8859-10 */
+    <a name="XML_CHAR_ENCODING_8859_11">XML_CHAR_ENCODING_8859_11</a> = 26 /* ISO-8859-11 */
+    <a name="XML_CHAR_ENCODING_8859_13">XML_CHAR_ENCODING_8859_13</a> = 27 /* ISO-8859-13 */
+    <a name="XML_CHAR_ENCODING_8859_14">XML_CHAR_ENCODING_8859_14</a> = 28 /* ISO-8859-14 */
+    <a name="XML_CHAR_ENCODING_8859_15">XML_CHAR_ENCODING_8859_15</a> = 29 /* ISO-8859-15 */
+    <a name="XML_CHAR_ENCODING_8859_16">XML_CHAR_ENCODING_8859_16</a> = 30 /*  ISO-8859-16 */
 };
 </pre>
 <p></p>
@@ -108,12 +150,10 @@
 <a name="xmlCharEncodingHandler">Structure </a>xmlCharEncodingHandler</h3>
 <pre class="programlisting">struct _xmlCharEncodingHandler {
     char *	name
-    <a href="libxml2-encoding.html#xmlCharEncodingInputFunc">xmlCharEncodingInputFunc</a>	input
-    <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a>	output
-    iconv_t	iconv_in
-    iconv_t	iconv_out
-    struct _uconv_t *	uconv_in
-    struct _uconv_t *	uconv_out
+    void *	inputCtxt
+    void *	outputCtxt
+    <a href="libxml2-encoding.html#xmlCharEncConvCtxtDtor">xmlCharEncConvCtxtDtor</a>	ctxtDtor
+    int	flags
 } xmlCharEncodingHandler;
 </pre>
 <p></p>
@@ -129,10 +169,99 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCharEncConvCtxtDtor"></a>Function type xmlCharEncConvCtxtDtor</h3>
+<pre class="programlisting">void	xmlCharEncConvCtxtDtor		(void * vctxt)<br>
+</pre>
+<p>Free a conversion context.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody><tr>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
+<td>conversion context</td>
+</tr></tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCharEncConvFunc"></a>Function type xmlCharEncConvFunc</h3>
+<pre class="programlisting"><a href="libxml2-encoding.html#xmlCharEncError">xmlCharEncError</a>	xmlCharEncConvFunc	(void * vctxt, <br>					 unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen, <br>					 int flush)<br>
+</pre>
+<p>Convert between character encodings. The value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced. If the converter can consume partial multi-byte sequences, the @flush flag can be used to detect truncated sequences at EOF. Otherwise, the flag can be ignored.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
+<td>conversion context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>a pointer to an array of bytes to store the result</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
+<td>the length of @out</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>in</tt></i>:</span></td>
+<td>a pointer to an array of input bytes</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
+<td>the length of @in</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flush</tt></i>:</span></td>
+<td>end of input</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>an XML_ENC_ERR code.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCharEncConvImpl"></a>Function type xmlCharEncConvImpl</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlCharEncConvImpl	(void * vctxt, <br>					 const char * name, <br>					 <a href="libxml2-encoding.html#xmlCharEncFlags">xmlCharEncFlags</a> flags, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
+</pre>
+<p>If this function returns XML_ERR_OK, it must fill the @out pointer with an encoding handler. The handler can be obtained from <a href="libxml2-encoding.html#xmlCharEncNewCustomHandler">xmlCharEncNewCustomHandler</a>. @flags can contain XML_ENC_INPUT, <a href="libxml2-encoding.html#XML_ENC_OUTPUT">XML_ENC_OUTPUT</a> or both.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
+<td>user data</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>name</tt></i>:</span></td>
+<td>encoding name</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>bit mask of flags</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>pointer to resulting handler</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCharEncodingInputFunc"></a>Function type xmlCharEncodingInputFunc</h3>
 <pre class="programlisting">int	xmlCharEncodingInputFunc	(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
 </pre>
-<p>Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.</p>
+<p>Convert characters to UTF-8. On success, the value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -154,7 +283,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets consumed.</td>
+<td>the number of bytes written or an XML_ENC_ERR code.</td>
 </tr>
 </tbody>
 </table></div>
@@ -165,7 +294,7 @@
 <a name="xmlCharEncodingOutputFunc"></a>Function type xmlCharEncodingOutputFunc</h3>
 <pre class="programlisting">int	xmlCharEncodingOutputFunc	(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
 </pre>
-<p>Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.</p>
+<p>Convert characters from UTF-8. On success, the value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -187,73 +316,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets produced.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="UTF8Toisolat1"></a>UTF8Toisolat1 ()</h3>
-<pre class="programlisting">int	UTF8Toisolat1			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
-</pre>
-<p>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>out</tt></i>:</span></td>
-<td>a pointer to an array of bytes to store the result</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
-<td>the length of @out</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>in</tt></i>:</span></td>
-<td>a pointer to an array of UTF-8 chars</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
-<td>the length of @in</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of bytes written 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.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="isolat1ToUTF8"></a>isolat1ToUTF8 ()</h3>
-<pre class="programlisting">int	isolat1ToUTF8			(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
-</pre>
-<p>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>out</tt></i>:</span></td>
-<td>a pointer to an array of bytes to store the result</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
-<td>the length of @out</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>in</tt></i>:</span></td>
-<td>a pointer to an array of ISO Latin 1 chars</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
-<td>the length of @in</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of bytes written 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.</td>
+<td>the number of bytes written or an XML_ENC_ERR code.</td>
 </tr>
 </tbody>
 </table></div>
@@ -264,7 +327,7 @@
 <a name="xmlAddEncodingAlias"></a>xmlAddEncodingAlias ()</h3>
 <pre class="programlisting">int	xmlAddEncodingAlias		(const char * name, <br>					 const char * alias)<br>
 </pre>
-<p>Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</p>
+<p>DEPRECATED: This function modifies global state and is not thread-safe. Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -289,7 +352,7 @@
 <a name="xmlCharEncCloseFunc"></a>xmlCharEncCloseFunc ()</h3>
 <pre class="programlisting">int	xmlCharEncCloseFunc		(<a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> * handler)<br>
 </pre>
-<p>Generic front-end for encoding handler close function</p>
+<p>Releases an <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a>. Must be called after a handler is no longer in use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -299,7 +362,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 if success, or -1 in case of error</td>
+<td>0.</td>
 </tr>
 </tbody>
 </table></div>
@@ -365,6 +428,51 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCharEncNewCustomHandler"></a>xmlCharEncNewCustomHandler ()</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlCharEncNewCustomHandler	(const char * name, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvFunc">xmlCharEncConvFunc</a> input, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvFunc">xmlCharEncConvFunc</a> output, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvCtxtDtor">xmlCharEncConvCtxtDtor</a> ctxtDtor, <br>						 void * inputCtxt, <br>						 void * outputCtxt, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
+</pre>
+<p>Create a custom <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a>.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>name</tt></i>:</span></td>
+<td>the encoding name</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>input</tt></i>:</span></td>
+<td>input callback which converts to UTF-8</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>output</tt></i>:</span></td>
+<td>output callback which converts from UTF-8</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>ctxtDtor</tt></i>:</span></td>
+<td>context destructor</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>inputCtxt</tt></i>:</span></td>
+<td>context for input callback</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>outputCtxt</tt></i>:</span></td>
+<td>context for output callback</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>pointer to resulting handler</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCharEncOutFunc"></a>xmlCharEncOutFunc ()</h3>
 <pre class="programlisting">int	xmlCharEncOutFunc		(<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>
@@ -405,7 +513,44 @@
 <a name="xmlCleanupEncodingAliases"></a>xmlCleanupEncodingAliases ()</h3>
 <pre class="programlisting">void	xmlCleanupEncodingAliases	(void)<br>
 </pre>
-<p>Unregisters all aliases</p>
+<p>DEPRECATED: This function modifies global state and is not thread-safe. Unregisters all aliases</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCreateCharEncodingHandler"></a>xmlCreateCharEncodingHandler ()</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlCreateCharEncodingHandler	(const char * name, <br>						 <a href="libxml2-encoding.html#xmlCharEncFlags">xmlCharEncFlags</a> flags, <br>						 <a href="libxml2-encoding.html#xmlCharEncConvImpl">xmlCharEncConvImpl</a> impl, <br>						 void * implCtxt, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
+</pre>
+<p>Find or create a handler matching the encoding. The following converters are looked up in order: - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - Custom implementation if provided - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled The handler must be closed with <a href="libxml2-encoding.html#xmlCharEncCloseFunc">xmlCharEncCloseFunc</a>. If the encoding is UTF-8, a NULL handler and no error code will be returned. @flags can contain XML_ENC_INPUT, <a href="libxml2-encoding.html#XML_ENC_OUTPUT">XML_ENC_OUTPUT</a> or both. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>name</tt></i>:</span></td>
+<td>a string describing the char encoding.</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>bit mask of flags</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>impl</tt></i>:</span></td>
+<td>a conversion implementation (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>implCtxt</tt></i>:</span></td>
+<td>user data for conversion implementation (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>pointer to result</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>XML_ERR_OK, <a href="libxml2-xmlerror.html#XML_ERR_UNSUPPORTED_ENCODING">XML_ERR_UNSUPPORTED_ENCODING</a> or another <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> error code.</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -413,7 +558,7 @@
 <a name="xmlDelEncodingAlias"></a>xmlDelEncodingAlias ()</h3>
 <pre class="programlisting">int	xmlDelEncodingAlias		(const char * alias)<br>
 </pre>
-<p>Unregisters an encoding alias @alias</p>
+<p>DEPRECATED: This function modifies global state and is not thread-safe. Unregisters an encoding alias @alias</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -459,7 +604,7 @@
 <a name="xmlFindCharEncodingHandler"></a>xmlFindCharEncodingHandler ()</h3>
 <pre class="programlisting"><a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	xmlFindCharEncodingHandler	(const char * name)<br>
 </pre>
-<p>DEPRECATED: Use <a href="libxml2-encoding.html#xmlOpenCharEncodingHandler">xmlOpenCharEncodingHandler</a> which has better error reporting.</p>
+<p>DEPRECATED: Use <a href="libxml2-encoding.html#xmlOpenCharEncodingHandler">xmlOpenCharEncodingHandler</a> which has better error reporting. If the encoding is UTF-8, this will return a no-op handler that shouldn't be used.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -522,7 +667,7 @@
 <a name="xmlGetEncodingAlias"></a>xmlGetEncodingAlias ()</h3>
 <pre class="programlisting">const char *	xmlGetEncodingAlias	(const char * alias)<br>
 </pre>
-<p>Lookup an encoding name for the given alias.</p>
+<p>DEPRECATED: This function is not thread-safe. Lookup an encoding name for the given alias.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -548,10 +693,43 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlLookupCharEncodingHandler"></a>xmlLookupCharEncodingHandler ()</h3>
-<pre class="programlisting">int	xmlLookupCharEncodingHandler	(<a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
+<a name="xmlIsolat1ToUTF8"></a>xmlIsolat1ToUTF8 ()</h3>
+<pre class="programlisting">int	xmlIsolat1ToUTF8		(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
 </pre>
-<p>Find or create a handler matching the encoding. If no default or registered handler could be found, try to create a handler using iconv or ICU if supported. The handler must be closed with <a href="libxml2-encoding.html#xmlCharEncCloseFunc">xmlCharEncCloseFunc</a>. Available since 2.13.0.</p>
+<p>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>a pointer to an array of bytes to store the result</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
+<td>the length of @out</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>in</tt></i>:</span></td>
+<td>a pointer to an array of ISO Latin 1 chars</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
+<td>the length of @in</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the number of bytes written 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.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlLookupCharEncodingHandler"></a>xmlLookupCharEncodingHandler ()</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlLookupCharEncodingHandler	(<a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
+</pre>
+<p>Find or create a handler matching the encoding. The following converters are looked up in order: - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled The handler must be closed with <a href="libxml2-encoding.html#xmlCharEncCloseFunc">xmlCharEncCloseFunc</a>. If the encoding is UTF-8, a NULL handler and no error code will be returned. Available since 2.13.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -565,7 +743,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> error code.</td>
+<td>XML_ERR_OK, <a href="libxml2-xmlerror.html#XML_ERR_UNSUPPORTED_ENCODING">XML_ERR_UNSUPPORTED_ENCODING</a> or another <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> error code.</td>
 </tr>
 </tbody>
 </table></div>
@@ -576,7 +754,7 @@
 <a name="xmlNewCharEncodingHandler"></a>xmlNewCharEncodingHandler ()</h3>
 <pre class="programlisting"><a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	xmlNewCharEncodingHandler	(const char * name, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingInputFunc">xmlCharEncodingInputFunc</a> input, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> output)<br>
 </pre>
-<p>Create and registers an <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a>.</p>
+<p>DEPRECATED: This function modifies global state and is not thread-safe. Create and registers an <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -603,9 +781,9 @@
 <div class="refsect2" lang="en">
 <h3>
 <a name="xmlOpenCharEncodingHandler"></a>xmlOpenCharEncodingHandler ()</h3>
-<pre class="programlisting">int	xmlOpenCharEncodingHandler	(const char * name, <br>					 int output, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlOpenCharEncodingHandler	(const char * name, <br>						 int output, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandler">xmlCharEncodingHandler</a> ** out)<br>
 </pre>
-<p>Find or create a handler matching the encoding. If no default or registered handler could be found, try to create a handler using iconv or ICU if supported. The handler must be closed with <a href="libxml2-encoding.html#xmlCharEncCloseFunc">xmlCharEncCloseFunc</a>. Available since 2.13.0.</p>
+<p>Find or create a handler matching the encoding. The following converters are looked up in order: - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled The handler must be closed with <a href="libxml2-encoding.html#xmlCharEncCloseFunc">xmlCharEncCloseFunc</a>. If the encoding is UTF-8, a NULL handler and no error code will be returned. Available since 2.13.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -623,7 +801,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> error code.</td>
+<td>XML_ERR_OK, <a href="libxml2-xmlerror.html#XML_ERR_UNSUPPORTED_ENCODING">XML_ERR_UNSUPPORTED_ENCODING</a> or another <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> error code.</td>
 </tr>
 </tbody>
 </table></div>
@@ -655,7 +833,7 @@
 <a name="xmlRegisterCharEncodingHandler"></a>xmlRegisterCharEncodingHandler ()</h3>
 <pre class="programlisting">void	xmlRegisterCharEncodingHandler	(<a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> handler)<br>
 </pre>
-<p>Register the char encoding handler, surprising, isn't it ?</p>
+<p>DEPRECATED: This function modifies global state and is not thread-safe. Register the char encoding handler.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -665,6 +843,39 @@
 </table></div>
 </div>
 <hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlUTF8ToIsolat1"></a>xmlUTF8ToIsolat1 ()</h3>
+<pre class="programlisting">int	xmlUTF8ToIsolat1		(unsigned char * out, <br>					 int * outlen, <br>					 const unsigned char * in, <br>					 int * inlen)<br>
+</pre>
+<p>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>a pointer to an array of bytes to store the result</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>outlen</tt></i>:</span></td>
+<td>the length of @out</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>in</tt></i>:</span></td>
+<td>a pointer to an array of UTF-8 chars</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>inlen</tt></i>:</span></td>
+<td>the length of @in</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the number of bytes written 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.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
 </div>
 </div>
 </body>
diff --git a/doc/devhelp/libxml2-entities.html b/doc/devhelp/libxml2-entities.html
index 243f354..13fb36b 100644
--- a/doc/devhelp/libxml2-entities.html
+++ b/doc/devhelp/libxml2-entities.html
@@ -28,12 +28,10 @@
 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	<a href="#xmlAddDocEntity">xmlAddDocEntity</a>		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	<a href="#xmlAddDtdEntity">xmlAddDtdEntity</a>		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
 int	<a href="#xmlAddEntity">xmlAddEntity</a>			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 int extSubset, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content, <br>					 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> * out);
-void	<a href="#xmlCleanupPredefinedEntities">xmlCleanupPredefinedEntities</a>	(void);
 <a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a>	<a href="#xmlCopyEntitiesTable">xmlCopyEntitiesTable</a>	(<a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a> table);
 <a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a>	<a href="#xmlCreateEntitiesTable">xmlCreateEntitiesTable</a>	(void);
 void	<a href="#xmlDumpEntitiesTable">xmlDumpEntitiesTable</a>		(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a> table);
 void	<a href="#xmlDumpEntityDecl">xmlDumpEntityDecl</a>		(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> ent);
-const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlEncodeEntities">xmlEncodeEntities</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input);
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input);
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlEncodeSpecialChars">xmlEncodeSpecialChars</a>	(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input);
 void	<a href="#xmlFreeEntitiesTable">xmlFreeEntitiesTable</a>		(<a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a> table);
@@ -42,7 +40,6 @@
 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	<a href="#xmlGetDtdEntity">xmlGetDtdEntity</a>		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	<a href="#xmlGetParameterEntity">xmlGetParameterEntity</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	<a href="#xmlGetPredefinedEntity">xmlGetPredefinedEntity</a>	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
-void	<a href="#xmlInitializePredefinedEntities">xmlInitializePredefinedEntities</a>	(void);
 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	<a href="#xmlNewEntity">xmlNewEntity</a>		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
 </pre>
 </div>
@@ -216,14 +213,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlCleanupPredefinedEntities"></a>xmlCleanupPredefinedEntities ()</h3>
-<pre class="programlisting">void	xmlCleanupPredefinedEntities	(void)<br>
-</pre>
-<p>Cleanup up the predefined entities table. Deprecated call</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlCopyEntitiesTable"></a>xmlCopyEntitiesTable ()</h3>
 <pre class="programlisting"><a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a>	xmlCopyEntitiesTable	(<a href="libxml2-entities.html#xmlEntitiesTablePtr">xmlEntitiesTablePtr</a> table)<br>
 </pre>
@@ -302,35 +291,10 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlEncodeEntities"></a>xmlEncodeEntities ()</h3>
-<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlEncodeEntities	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input)<br>
-</pre>
-<p>TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility People must migrate their code to <a href="libxml2-entities.html#xmlEncodeEntitiesReentrant">xmlEncodeEntitiesReentrant</a> ! This routine will issue a warning when encountered.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>doc</tt></i>:</span></td>
-<td>the document containing the string</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>input</tt></i>:</span></td>
-<td>A string to convert to XML.</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>NULL</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlEncodeEntitiesReentrant"></a>xmlEncodeEntitiesReentrant ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlEncodeEntitiesReentrant	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input)<br>
 </pre>
-<p>Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated.</p>
+<p>Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated. This escapes '&lt;', '&gt;', '&amp;' and '\r'. If the document has no encoding, non-ASCII codepoints are escaped. There is some special handling for HTML documents.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -355,13 +319,13 @@
 <a name="xmlEncodeSpecialChars"></a>xmlEncodeSpecialChars ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlEncodeSpecialChars	(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * input)<br>
 </pre>
-<p>Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated.</p>
+<p>Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated. This escapes '&lt;', '&gt;', '&amp;', '"' and '\r' chars.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>doc</tt></i>:</span></td>
-<td>the document containing the string</td>
+<td>unused</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>input</tt></i>:</span></td>
@@ -503,14 +467,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlInitializePredefinedEntities"></a>xmlInitializePredefinedEntities ()</h3>
-<pre class="programlisting">void	xmlInitializePredefinedEntities	(void)<br>
-</pre>
-<p>Set up the predefined entities. Deprecated call</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlNewEntity"></a>xmlNewEntity ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	xmlNewEntity		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-globals.html b/doc/devhelp/libxml2-globals.html
index bf8bbd1..59c882e 100644
--- a/doc/devhelp/libxml2-globals.html
+++ b/doc/devhelp/libxml2-globals.html
@@ -22,65 +22,12 @@
 <p>Author(s): </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">typedef struct _xmlGlobalState <a href="#xmlGlobalState">xmlGlobalState</a>;
-typedef <a href="libxml2-globals.html#xmlGlobalState">xmlGlobalState</a> * <a href="#xmlGlobalStatePtr">xmlGlobalStatePtr</a>;
-<a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a>	<a href="#xmlGetGlobalState">xmlGetGlobalState</a>	(void);
-void	<a href="#xmlInitializeGlobalState">xmlInitializeGlobalState</a>	(<a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> gs);
-</pre>
+<pre class="synopsis"></pre>
 </div>
 <div class="refsect1" lang="en"><h2>Description</h2></div>
 <div class="refsect1" lang="en">
 <h2>Details</h2>
-<div class="refsect2" lang="en">
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlGlobalState">Structure </a>xmlGlobalState</h3>
-<pre class="programlisting">struct _xmlGlobalState {
-The content of this structure is not made public by the API.
-} xmlGlobalState;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlGlobalStatePtr">Typedef </a>xmlGlobalStatePtr</h3>
-<pre class="programlisting"><a href="libxml2-globals.html#xmlGlobalState">xmlGlobalState</a> * xmlGlobalStatePtr;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlGetGlobalState"></a>xmlGetGlobalState ()</h3>
-<pre class="programlisting"><a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a>	xmlGetGlobalState	(void)<br>
-</pre>
-<p>DEPRECATED</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>NULL.</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlInitializeGlobalState"></a>xmlInitializeGlobalState ()</h3>
-<pre class="programlisting">void	xmlInitializeGlobalState	(<a href="libxml2-globals.html#xmlGlobalStatePtr">xmlGlobalStatePtr</a> gs)<br>
-</pre>
-<p>DEPRECATED: No-op.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>gs</tt></i>:</span></td>
-<td>a pointer to a newly allocated global state</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-</div>
+<div class="refsect2" lang="en"></div>
 </div>
 </body>
 </html>
diff --git a/doc/devhelp/libxml2-list.html b/doc/devhelp/libxml2-list.html
index 6d18802..95928ca 100644
--- a/doc/devhelp/libxml2-list.html
+++ b/doc/devhelp/libxml2-list.html
@@ -13,7 +13,7 @@
 <td><a accesskey="p" href="libxml2-hash.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 <td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<td><a accesskey="n" href="libxml2-nanoftp.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<td><a accesskey="n" href="libxml2-nanohttp.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 <th width="100%" align="center">libxml2 Reference Manual</th>
 </tr></table>
 <h2><span class="refentrytitle">list</span></h2>
diff --git a/doc/devhelp/libxml2-nanohttp.html b/doc/devhelp/libxml2-nanohttp.html
index aa382ea..9596449 100644
--- a/doc/devhelp/libxml2-nanohttp.html
+++ b/doc/devhelp/libxml2-nanohttp.html
@@ -10,7 +10,7 @@
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
-<td><a accesskey="p" href="libxml2-nanoftp.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="p" href="libxml2-list.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 <td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 <td><a accesskey="n" href="libxml2-parser.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
diff --git a/doc/devhelp/libxml2-parser.html b/doc/devhelp/libxml2-parser.html
index 8a3e30b..064855d 100644
--- a/doc/devhelp/libxml2-parser.html
+++ b/doc/devhelp/libxml2-parser.html
@@ -26,6 +26,7 @@
 #define <a href="#XML_SAX2_MAGIC">XML_SAX2_MAGIC</a>;
 typedef struct _xmlAttrHashBucket <a href="#xmlAttrHashBucket">xmlAttrHashBucket</a>;
 typedef enum <a href="#xmlFeature">xmlFeature</a>;
+typedef enum <a href="#xmlParserInputFlags">xmlParserInputFlags</a>;
 typedef enum <a href="#xmlParserInputState">xmlParserInputState</a>;
 typedef enum <a href="#xmlParserMode">xmlParserMode</a>;
 typedef struct _xmlParserNodeInfo <a href="#xmlParserNodeInfo">xmlParserNodeInfo</a>;
@@ -34,6 +35,8 @@
 typedef <a href="libxml2-parser.html#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a> * <a href="#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a>;
 typedef struct _xmlParserNsData <a href="#xmlParserNsData">xmlParserNsData</a>;
 typedef enum <a href="#xmlParserOption">xmlParserOption</a>;
+typedef enum <a href="#xmlParserStatus">xmlParserStatus</a>;
+typedef enum <a href="#xmlResourceType">xmlResourceType</a>;
 typedef struct _xmlSAXHandlerV1 <a href="#xmlSAXHandlerV1">xmlSAXHandlerV1</a>;
 typedef <a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> * <a href="#xmlSAXHandlerV1Ptr">xmlSAXHandlerV1Ptr</a>;
 typedef struct _xmlStartTag <a href="#xmlStartTag">xmlStartTag</a>;
@@ -75,7 +78,22 @@
 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlCreateDocParserCtxt">xmlCreateDocParserCtxt</a>	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str);
 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlCreateIOParserCtxt">xmlCreateIOParserCtxt</a>	(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>						 void * user_data, <br>						 <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioread, <br>						 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioclose, <br>						 void * ioctx, <br>						 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a>	(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>						 void * user_data, <br>						 const char * chunk, <br>						 int size, <br>						 const char * filename);
+void *	<a href="#xmlCtxtGetCatalogs">xmlCtxtGetCatalogs</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlCtxtGetDeclaredEncoding">xmlCtxtGetDeclaredEncoding</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	<a href="#xmlCtxtGetDict">xmlCtxtGetDict</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlCtxtGetDocument">xmlCtxtGetDocument</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+int	<a href="#xmlCtxtGetOptions">xmlCtxtGetOptions</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+void *	<a href="#xmlCtxtGetPrivate">xmlCtxtGetPrivate</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> *	<a href="#xmlCtxtGetSaxHandler">xmlCtxtGetSaxHandler</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+int	<a href="#xmlCtxtGetStandalone">xmlCtxtGetStandalone</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-parser.html#xmlParserStatus">xmlParserStatus</a>	<a href="#xmlCtxtGetStatus">xmlCtxtGetStatus</a>	(<a href="libxml2-tree.html#xmlParserCtxt">xmlParserCtxt</a> * ctxt);
+<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a>	<a href="#xmlCtxtGetValidCtxt">xmlCtxtGetValidCtxt</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlCtxtGetVersion">xmlCtxtGetVersion</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+int	<a href="#xmlCtxtIsHtml">xmlCtxtIsHtml</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+int	<a href="#xmlCtxtIsStopped">xmlCtxtIsStopped</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlCtxtParseContent">xmlCtxtParseContent</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int hasTextDecl);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlCtxtParseDocument">xmlCtxtParseDocument</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
+<a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	<a href="#xmlCtxtParseDtd">xmlCtxtParseDtd</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlCtxtReadDoc">xmlCtxtReadDoc</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlCtxtReadFd">xmlCtxtReadFd</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int fd, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlCtxtReadFile">xmlCtxtReadFile</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * filename, <br>					 const char * encoding, <br>					 int options);
@@ -83,25 +101,37 @@
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlCtxtReadMemory">xmlCtxtReadMemory</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * buffer, <br>					 int size, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options);
 void	<a href="#xmlCtxtReset">xmlCtxtReset</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 int	<a href="#xmlCtxtResetPush">xmlCtxtResetPush</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * chunk, <br>					 int size, <br>					 const char * filename, <br>					 const char * encoding);
+void	<a href="#xmlCtxtSetCatalogs">xmlCtxtSetCatalogs</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 void * catalogs);
+void	<a href="#xmlCtxtSetCharEncConvImpl">xmlCtxtSetCharEncConvImpl</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-encoding.html#xmlCharEncConvImpl">xmlCharEncConvImpl</a> impl, <br>					 void * vctxt);
+void	<a href="#xmlCtxtSetDict">xmlCtxtSetDict</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict);
 void	<a href="#xmlCtxtSetErrorHandler">xmlCtxtSetErrorHandler</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> handler, <br>					 void * data);
 void	<a href="#xmlCtxtSetMaxAmplification">xmlCtxtSetMaxAmplification</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 unsigned maxAmpl);
 int	<a href="#xmlCtxtSetOptions">xmlCtxtSetOptions</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int options);
+void	<a href="#xmlCtxtSetPrivate">xmlCtxtSetPrivate</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 void * priv);
+void	<a href="#xmlCtxtSetResourceLoader">xmlCtxtSetResourceLoader</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * vctxt);
+int	<a href="#xmlCtxtSetSaxHandler">xmlCtxtSetSaxHandler</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * sax);
 int	<a href="#xmlCtxtUseOptions">xmlCtxtUseOptions</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int options);
+int	<a href="#xmlCtxtValidateDocument">xmlCtxtValidateDocument</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
+int	<a href="#xmlCtxtValidateDtd">xmlCtxtValidateDtd</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd);
 typedef <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> <a href="#xmlExternalEntityLoader">xmlExternalEntityLoader</a>	(const char * URL, <br>						 const char * ID, <br>						 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> context);
 void	<a href="#xmlFreeParserCtxt">xmlFreeParserCtxt</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 <a href="libxml2-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a>	<a href="#xmlGetExternalEntityLoader">xmlGetExternalEntityLoader</a>	(void);
-int	<a href="#xmlGetFeature">xmlGetFeature</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * name, <br>					 void * result);
-int	<a href="#xmlGetFeaturesList">xmlGetFeaturesList</a>		(int * len, <br>					 const char ** result);
 int	<a href="#xmlHasFeature">xmlHasFeature</a>			(<a href="libxml2-parser.html#xmlFeature">xmlFeature</a> feature);
 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	<a href="#xmlIOParseDTD">xmlIOParseDTD</a>		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
 void	<a href="#xmlInitGlobals">xmlInitGlobals</a>			(void);
 void	<a href="#xmlInitNodeInfoSeq">xmlInitNodeInfoSeq</a>		(<a href="libxml2-parser.html#xmlParserNodeInfoSeqPtr">xmlParserNodeInfoSeqPtr</a> seq);
 void	<a href="#xmlInitParser">xmlInitParser</a>			(void);
 int	<a href="#xmlInitParserCtxt">xmlInitParserCtxt</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlInputSetEncodingHandler">xmlInputSetEncodingHandler</a>	(<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> handler);
 int	<a href="#xmlKeepBlanksDefault">xmlKeepBlanksDefault</a>		(int val);
 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> buf, <br>						 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc);
+<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewInputFromFd">xmlNewInputFromFd</a>	(const char * url, <br>						 int fd, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags);
+<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewInputFromIO">xmlNewInputFromIO</a>	(const char * url, <br>						 <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioRead, <br>						 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioClose, <br>						 void * ioCtxt, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags);
+<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewInputFromMemory">xmlNewInputFromMemory</a>	(const char * url, <br>						 const void * mem, <br>						 size_t size, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags);
+<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewInputFromString">xmlNewInputFromString</a>	(const char * url, <br>						 const char * str, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlNewInputFromUrl">xmlNewInputFromUrl</a>	(const char * filename, <br>					 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> * out);
 <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>	(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);
@@ -115,7 +145,7 @@
 int	<a href="#xmlParseExtParsedEnt">xmlParseExtParsedEnt</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 int	<a href="#xmlParseExternalEntity">xmlParseExternalEntity</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> * URL, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ID, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * list);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlParseFile">xmlParseFile</a>		(const char * filename);
-<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlParseInNodeContext">xmlParseInNodeContext</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const char * data, <br>					 int datalen, <br>					 int options, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlParseInNodeContext">xmlParseInNodeContext</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const char * data, <br>					 int datalen, <br>					 int options, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * listOut);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlParseMemory">xmlParseMemory</a>		(const char * buffer, <br>					 int size);
 void	<a href="#xmlParserAddNodeInfo">xmlParserAddNodeInfo</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlParserNodeInfoPtr">xmlParserNodeInfoPtr</a> info);
 const <a href="libxml2-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a> *	<a href="#xmlParserFindNodeInfo">xmlParserFindNodeInfo</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctx, <br>							 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node);
@@ -132,6 +162,7 @@
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlRecoverDoc">xmlRecoverDoc</a>		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * cur);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlRecoverFile">xmlRecoverFile</a>		(const char * filename);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlRecoverMemory">xmlRecoverMemory</a>	(const char * buffer, <br>					 int size);
+typedef <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> <a href="#xmlResourceLoader">xmlResourceLoader</a>	(void * ctxt, <br>					 const char * url, <br>					 const char * publicId, <br>					 <a href="libxml2-parser.html#xmlResourceType">xmlResourceType</a> type, <br>					 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> * out);
 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	<a href="#xmlSAXParseDTD">xmlSAXParseDTD</a>		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlSAXParseDoc">xmlSAXParseDoc</a>		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * cur, <br>					 int recovery);
 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	<a href="#xmlSAXParseEntity">xmlSAXParseEntity</a>	(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 const char * filename);
@@ -142,7 +173,6 @@
 int	<a href="#xmlSAXUserParseFile">xmlSAXUserParseFile</a>		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 void * user_data, <br>					 const char * filename);
 int	<a href="#xmlSAXUserParseMemory">xmlSAXUserParseMemory</a>		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 void * user_data, <br>					 const char * buffer, <br>					 int size);
 void	<a href="#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>	(<a href="libxml2-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a> f);
-int	<a href="#xmlSetFeature">xmlSetFeature</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * name, <br>					 void * value);
 void	<a href="#xmlSetupParserForBuffer">xmlSetupParserForBuffer</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * buffer, <br>					 const char * filename);
 void	<a href="#xmlStopParser">xmlStopParser</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 int	<a href="#xmlSubstituteEntitiesDefault">xmlSubstituteEntitiesDefault</a>	(int val);
@@ -151,7 +181,6 @@
 int	<a href="#xmlThrDefKeepBlanksDefaultValue">xmlThrDefKeepBlanksDefaultValue</a>	(int v);
 int	<a href="#xmlThrDefLineNumbersDefaultValue">xmlThrDefLineNumbersDefaultValue</a>	(int v);
 int	<a href="#xmlThrDefLoadExtDtdDefaultValue">xmlThrDefLoadExtDtdDefaultValue</a>	(int v);
-int	<a href="#xmlThrDefParserDebugEntities">xmlThrDefParserDebugEntities</a>	(int v);
 int	<a href="#xmlThrDefPedanticParserDefaultValue">xmlThrDefPedanticParserDefaultValue</a>	(int v);
 int	<a href="#xmlThrDefSubstituteEntitiesDefaultValue">xmlThrDefSubstituteEntitiesDefaultValue</a>	(int v);
 </pre>
@@ -223,6 +252,7 @@
     <a name="XML_WITH_ZLIB">XML_WITH_ZLIB</a> = 31
     <a name="XML_WITH_ICU">XML_WITH_ICU</a> = 32
     <a name="XML_WITH_LZMA">XML_WITH_LZMA</a> = 33
+    <a name="XML_WITH_RELAXNG">XML_WITH_RELAXNG</a> = 34 /* since 2.14.0 */
     <a name="XML_WITH_NONE">XML_WITH_NONE</a> = 99999 /*  just to be sure of allocation size */
 };
 </pre>
@@ -231,6 +261,19 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlParserInputFlags">Enum </a>xmlParserInputFlags</h3>
+<pre class="programlisting">enum <a href="#xmlParserInputFlags">xmlParserInputFlags</a> {
+    <a name="XML_INPUT_BUF_STATIC">XML_INPUT_BUF_STATIC</a> = 2
+    <a name="XML_INPUT_BUF_ZERO_TERMINATED">XML_INPUT_BUF_ZERO_TERMINATED</a> = 4
+    <a name="XML_INPUT_UNZIP">XML_INPUT_UNZIP</a> = 8
+    <a name="XML_INPUT_NETWORK">XML_INPUT_NETWORK</a> = 16
+};
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlParserInputState">Enum </a>xmlParserInputState</h3>
 <pre class="programlisting">enum <a href="#xmlParserInputState">xmlParserInputState</a> {
     <a name="XML_PARSER_EOF">XML_PARSER_EOF</a> = -1 /* nothing is to be parsed */
@@ -276,7 +319,7 @@
 <h3>
 <a name="xmlParserNodeInfo">Structure </a>xmlParserNodeInfo</h3>
 <pre class="programlisting">struct _xmlParserNodeInfo {
-    const struct _xmlNode *	node	: Position &amp; line # that text that created the node begins &amp; ends on
+    const struct _xmlNode *	node
     unsigned long	begin_pos
     unsigned long	begin_line
     unsigned long	end_pos
@@ -350,8 +393,40 @@
     <a name="XML_PARSE_HUGE">XML_PARSE_HUGE</a> = 524288 /* relax any hardcoded limit from the parser */
     <a name="XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a> = 1048576 /* parse using SAX2 interface before 2.7.0 */
     <a name="XML_PARSE_IGNORE_ENC">XML_PARSE_IGNORE_ENC</a> = 2097152 /* ignore internal document encoding hint */
-    <a name="XML_PARSE_BIG_LINES">XML_PARSE_BIG_LINES</a> = 4194304 /* Store big lines numbers in text PSVI field */
-    <a name="XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> = 8388608 /*  disable loading of external content */
+    <a name="XML_PARSE_BIG_LINES">XML_PARSE_BIG_LINES</a> = 4194304 /* Store big lines numbers in text PSVI field since 2.13.0 */
+    <a name="XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> = 8388608 /* disable loading of external content since 2.14.0 */
+    <a name="XML_PARSE_UNZIP">XML_PARSE_UNZIP</a> = 16777216 /* allow compressed content */
+    <a name="XML_PARSE_NO_SYS_CATALOG">XML_PARSE_NO_SYS_CATALOG</a> = 33554432 /* disable global system catalog */
+    <a name="XML_PARSE_CATALOG_PI">XML_PARSE_CATALOG_PI</a> = 67108864 /*  allow catalog PIs */
+};
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlParserStatus">Enum </a>xmlParserStatus</h3>
+<pre class="programlisting">enum <a href="#xmlParserStatus">xmlParserStatus</a> {
+    <a name="XML_STATUS_NOT_WELL_FORMED">XML_STATUS_NOT_WELL_FORMED</a> = 1
+    <a name="XML_STATUS_NOT_NS_WELL_FORMED">XML_STATUS_NOT_NS_WELL_FORMED</a> = 2
+    <a name="XML_STATUS_DTD_VALIDATION_FAILED">XML_STATUS_DTD_VALIDATION_FAILED</a> = 4
+    <a name="XML_STATUS_CATASTROPHIC_ERROR">XML_STATUS_CATASTROPHIC_ERROR</a> = 8
+};
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlResourceType">Enum </a>xmlResourceType</h3>
+<pre class="programlisting">enum <a href="#xmlResourceType">xmlResourceType</a> {
+    <a name="XML_RESOURCE_UNKNOWN">XML_RESOURCE_UNKNOWN</a> = 0
+    <a name="XML_RESOURCE_MAIN_DOCUMENT">XML_RESOURCE_MAIN_DOCUMENT</a> = 1
+    <a name="XML_RESOURCE_DTD">XML_RESOURCE_DTD</a> = 2
+    <a name="XML_RESOURCE_GENERAL_ENTITY">XML_RESOURCE_GENERAL_ENTITY</a> = 3
+    <a name="XML_RESOURCE_PARAMETER_ENTITY">XML_RESOURCE_PARAMETER_ENTITY</a> = 4
+    <a name="XML_RESOURCE_XINCLUDE">XML_RESOURCE_XINCLUDE</a> = 5
+    <a name="XML_RESOURCE_XINCLUDE_TEXT">XML_RESOURCE_XINCLUDE_TEXT</a> = 6
 };
 </pre>
 <p></p>
@@ -384,7 +459,7 @@
     <a href="libxml2-parser.html#commentSAXFunc">commentSAXFunc</a>	comment
     <a href="libxml2-parser.html#warningSAXFunc">warningSAXFunc</a>	warning
     <a href="libxml2-parser.html#errorSAXFunc">errorSAXFunc</a>	error
-    <a href="libxml2-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a>	fatalError	: unused error() get all the errors
+    <a href="libxml2-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a>	fatalError
     <a href="libxml2-parser.html#getParameterEntitySAXFunc">getParameterEntitySAXFunc</a>	getParameterEntity
     <a href="libxml2-parser.html#cdataBlockSAXFunc">cdataBlockSAXFunc</a>	cdataBlock
     <a href="libxml2-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a>	externalSubset
@@ -417,7 +492,7 @@
 <a name="attributeDeclSAXFunc"></a>Function type attributeDeclSAXFunc</h3>
 <pre class="programlisting">void	attributeDeclSAXFunc		(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * fullname, <br>					 int type, <br>					 int def, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br>					 <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)<br>
 </pre>
-<p>An <a href="libxml2-SAX.html#attribute">attribute</a> definition has been parsed.</p>
+<p>An attribute definition has been parsed.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -431,11 +506,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>fullname</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>type</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> type</td>
+<td>the attribute type</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>def</tt></i>:</span></td>
@@ -443,7 +518,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>defaultValue</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> default value</td>
+<td>the attribute default value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>tree</tt></i>:</span></td>
@@ -458,7 +533,7 @@
 <a name="attributeSAXFunc"></a>Function type attributeSAXFunc</h3>
 <pre class="programlisting">void	attributeSAXFunc		(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>Handle an <a href="libxml2-SAX.html#attribute">attribute</a> that has been read by the parser. The default handling is to convert the <a href="libxml2-SAX.html#attribute">attribute</a> into an DOM subtree and past it in a new <a href="libxml2-tree.html#xmlAttr">xmlAttr</a> element added to the element.</p>
+<p>Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new <a href="libxml2-tree.html#xmlAttr">xmlAttr</a> element added to the element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -468,11 +543,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>The <a href="libxml2-SAX.html#attribute">attribute</a> name, including namespace prefix</td>
+<td>The attribute name, including namespace prefix</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>The <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>The attribute value</td>
 </tr>
 </tbody>
 </table></div>
@@ -534,7 +609,7 @@
 <a name="commentSAXFunc"></a>Function type commentSAXFunc</h3>
 <pre class="programlisting">void	commentSAXFunc			(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>A <a href="libxml2-SAX.html#comment">comment</a> has been parsed.</p>
+<p>A comment has been parsed.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -544,7 +619,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#comment">comment</a> content</td>
+<td>the comment content</td>
 </tr>
 </tbody>
 </table></div>
@@ -857,7 +932,7 @@
 <a name="ignorableWhitespaceSAXFunc"></a>Function type ignorableWhitespaceSAXFunc</h3>
 <pre class="programlisting">void	ignorableWhitespaceSAXFunc	(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ch, <br>					 int len)<br>
 </pre>
-<p>Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use <a href="libxml2-SAX.html#characters">characters</a>.</p>
+<p>Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -987,7 +1062,7 @@
 <a name="referenceSAXFunc"></a>Function type referenceSAXFunc</h3>
 <pre class="programlisting">void	referenceSAXFunc		(void * ctx, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Called when an entity <a href="libxml2-SAX.html#reference">reference</a> is detected.</p>
+<p>Called when an entity reference is detected.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1037,7 +1112,7 @@
 <a name="setDocumentLocatorSAXFunc"></a>Function type setDocumentLocatorSAXFunc</h3>
 <pre class="programlisting">void	setDocumentLocatorSAXFunc	(void * ctx, <br>					 <a href="libxml2-tree.html#xmlSAXLocatorPtr">xmlSAXLocatorPtr</a> loc)<br>
 </pre>
-<p>Receive the document locator at startup, actually <a href="libxml2-parser.html#xmlDefaultSAXLocator">xmlDefaultSAXLocator</a>. Everything is available on the context, so this is useless in our case.</p>
+<p>Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1111,7 +1186,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attributes</tt></i>:</span></td>
-<td>pointer to the array of (localname/prefix/URI/value/end) <a href="libxml2-SAX.html#attribute">attribute</a> values.</td>
+<td>pointer to the array of (localname/prefix/URI/value/end) attribute values.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1246,34 +1321,43 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="oldXMLWDcompatibility">Variable </a>oldXMLWDcompatibility</h3>
-<pre class="programlisting">const int oldXMLWDcompatibility;
+<a name="xmlResourceLoader"></a>Function type xmlResourceLoader</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlResourceLoader	(void * ctxt, <br>					 const char * url, <br>					 const char * publicId, <br>					 <a href="libxml2-parser.html#xmlResourceType">xmlResourceType</a> type, <br>					 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> * out)<br>
 </pre>
-<p>Global setting, DEPRECATED.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlDefaultSAXHandler">Variable </a>xmlDefaultSAXHandler</h3>
-<pre class="programlisting">const <a href="libxml2-parser.html#xmlSAXHandlerV1">xmlSAXHandlerV1</a> xmlDefaultSAXHandler;
-</pre>
-<p>DEPRECATED: This handler is unused and will be removed from future versions. Default SAX version1 handler for XML, builds the DOM tree</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlDefaultSAXLocator">Variable </a>xmlDefaultSAXLocator</h3>
-<pre class="programlisting">const <a href="libxml2-tree.html#xmlSAXLocator">xmlSAXLocator</a> xmlDefaultSAXLocator;
-</pre>
-<p>DEPRECATED: Don't use The default SAX Locator { getPublicId, getSystemId, getLineNumber, getColumnNumber}</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlParserDebugEntities">Variable </a>xmlParserDebugEntities</h3>
-<pre class="programlisting">const int xmlParserDebugEntities;
-</pre>
-<p>DEPRECATED: Don't use Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default</p>
+<p>Callback for custom resource loaders. @flags can contain <a href="libxml2-parser.html#XML_INPUT_UNZIP">XML_INPUT_UNZIP</a> and <a href="libxml2-parser.html#XML_INPUT_NETWORK">XML_INPUT_NETWORK</a>. On success, @out should be set to a new parser input object and <a href="libxml2-xmlerror.html#XML_ERR_OK">XML_ERR_OK</a> should be returned.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>url</tt></i>:</span></td>
+<td>URL to load</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>publicId</tt></i>:</span></td>
+<td>publid ID from DTD (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>type</tt></i>:</span></td>
+<td>resource type</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>flags</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>result pointer</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
+</tr>
+</tbody>
+</table></div>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -1289,7 +1373,7 @@
 <a name="xmlByteConsumed"></a>xmlByteConsumed ()</h3>
 <pre class="programlisting">long	xmlByteConsumed			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.</p>
+<p>DEPRECATED: Don't use. This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1318,7 +1402,7 @@
 <a name="xmlCleanupParser"></a>xmlCleanupParser ()</h3>
 <pre class="programlisting">void	xmlCleanupParser		(void)<br>
 </pre>
-<p>This function name is somewhat misleading. It does not clean up parser state, it cleans up memory allocated by the library itself. It is a cleanup function for the XML library. It tries to reclaim all related global memory allocated for the library processing. It doesn't deallocate any document related memory. One should call xmlCleanupParser() only when the process has finished using the library and all XML/HTML documents built with it. See also xmlInitParser() which has the opposite function of preparing the library for operations. 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>
+<p>This function is named somewhat misleadingly. It does not clean up parser state but global memory allocated by the library itself. Since 2.9.11, cleanup is performed automatically if a shared or dynamic libxml2 library is unloaded. This function should only be used to avoid false positives from memory leak checkers in static builds. WARNING: <a href="libxml2-parser.html#xmlCleanupParser">xmlCleanupParser</a> assumes that all other threads that called libxml2 functions have terminated. No library calls must be made after calling this function. In general, THIS FUNCTION SHOULD ONLY BE CALLED RIGHT BEFORE THE WHOLE PROCESS EXITS.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -1419,7 +1503,7 @@
 <a name="xmlCreatePushParserCtxt"></a>xmlCreatePushParserCtxt ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	xmlCreatePushParserCtxt	(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>						 void * user_data, <br>						 const char * chunk, <br>						 int size, <br>						 const char * filename)<br>
 </pre>
-<p>Create a parser context for using the XML parser in push mode. See <a href="libxml2-parser.html#xmlParseChunk">xmlParseChunk</a>. Passing an initial chunk is useless and deprecated. @filename is used as base URI to fetch external entities and for error reports.</p>
+<p>Create a parser context for using the XML parser in push mode. See <a href="libxml2-parser.html#xmlParseChunk">xmlParseChunk</a>. Passing an initial chunk is useless and deprecated. The push parser doesn't support recovery mode or the <a href="libxml2-parser.html#XML_PARSE_NOBLANKS">XML_PARSE_NOBLANKS</a> option. @filename is used as base URI to fetch external entities and for error reports.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1445,7 +1529,313 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the new parser context or NULL in case of error.</td>
+<td>the new parser context or NULL if a memory allocation failed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetCatalogs"></a>xmlCtxtGetCatalogs ()</h3>
+<pre class="programlisting">void *	xmlCtxtGetCatalogs		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the local catalogs.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetDeclaredEncoding"></a>xmlCtxtGetDeclaredEncoding ()</h3>
+<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlCtxtGetDeclaredEncoding	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the encoding from the encoding declaration. This can differ from the actual encoding.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetDict"></a>xmlCtxtGetDict ()</h3>
+<pre class="programlisting"><a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	xmlCtxtGetDict		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the dictionary.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetDocument"></a>xmlCtxtGetDocument ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	xmlCtxtGetDocument	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the parsed document or NULL if a fatal error occurred when parsing. The document must be freed by the caller. Resets the context's document to NULL.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetOptions"></a>xmlCtxtGetOptions ()</h3>
+<pre class="programlisting">int	xmlCtxtGetOptions		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Get the current options of the parser context. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>an XML parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the current options set in the parser context, or -1 if ctxt is NULL.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetPrivate"></a>xmlCtxtGetPrivate ()</h3>
+<pre class="programlisting">void *	xmlCtxtGetPrivate		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the private application data.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetSaxHandler"></a>xmlCtxtGetSaxHandler ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> *	xmlCtxtGetSaxHandler	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the SAX handler struct. This is not a copy and must not be freed. Handlers can be updated.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetStandalone"></a>xmlCtxtGetStandalone ()</h3>
+<pre class="programlisting">int	xmlCtxtGetStandalone		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the value from the standalone document declaration.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetStatus"></a>xmlCtxtGetStatus ()</h3>
+<pre class="programlisting"><a href="libxml2-parser.html#xmlParserStatus">xmlParserStatus</a>	xmlCtxtGetStatus	(<a href="libxml2-tree.html#xmlParserCtxt">xmlParserCtxt</a> * ctxt)<br>
+</pre>
+<p>Get well-formedness and validation status after parsing. Also reports catastrophic errors which are not related to parsing like out-of-memory, I/O or other errors. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>an XML parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>a bitmask of XML_STATUS_* flags ORed together.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetValidCtxt"></a>xmlCtxtGetValidCtxt ()</h3>
+<pre class="programlisting"><a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a>	xmlCtxtGetValidCtxt	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the validation context.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtGetVersion"></a>xmlCtxtGetVersion ()</h3>
+<pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlCtxtGetVersion	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the version from the XML declaration.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtIsHtml"></a>xmlCtxtIsHtml ()</h3>
+<pre class="programlisting">int	xmlCtxtIsHtml			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>1 if this is a HTML parser context, 0 otherwise.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtIsStopped"></a>xmlCtxtIsStopped ()</h3>
+<pre class="programlisting">int	xmlCtxtIsStopped		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>1 if the parser is stopped, 0 otherwise.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtParseContent"></a>xmlCtxtParseContent ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlCtxtParseContent	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 int hasTextDecl)<br>
+</pre>
+<p>Parse a well-balanced chunk of XML matching the 'content' production. Namespaces in scope of @node and entities of @node's document are recognized. When validating, the DTD of @node's document is used. Always consumes @input even in error case. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>input</tt></i>:</span></td>
+<td>parser input</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>node</tt></i>:</span></td>
+<td>target node or document</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>hasTextDecl</tt></i>:</span></td>
+<td>whether to parse text declaration</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>a node list or NULL in case of error.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1478,6 +1868,39 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCtxtParseDtd"></a>xmlCtxtParseDtd ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	xmlCtxtParseDtd		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * publicId, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * systemId)<br>
+</pre>
+<p>Parse a DTD. Option <a href="libxml2-parser.html#XML_PARSE_DTDLOAD">XML_PARSE_DTDLOAD</a> should be enabled in the parser context to make external entities work. Availabe since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>a parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>input</tt></i>:</span></td>
+<td>a parser input</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>publicId</tt></i>:</span></td>
+<td>public ID of the DTD (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>systemId</tt></i>:</span></td>
+<td>system ID of the DTD (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the resulting <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> or NULL in case of error. @input will be freed by the function in any case.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCtxtReadDoc"></a>xmlCtxtReadDoc ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	xmlCtxtReadDoc		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options)<br>
 </pre>
@@ -1557,7 +1980,7 @@
 <a name="xmlCtxtReadFile"></a>xmlCtxtReadFile ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	xmlCtxtReadFile		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * filename, <br>					 const char * encoding, <br>					 int options)<br>
 </pre>
-<p>Parse an XML file from the filesystem, the network or a user-defined resource loader.</p>
+<p>Parse an XML file from the filesystem, the network or a user-defined resource loader. This function always enables the <a href="libxml2-parser.html#XML_PARSE_UNZIP">XML_PARSE_UNZIP</a> option for backward compatibility. This feature is potentially insecure and might be removed from later versions.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1728,6 +2151,73 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCtxtSetCatalogs"></a>xmlCtxtSetCatalogs ()</h3>
+<pre class="programlisting">void	xmlCtxtSetCatalogs		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 void * catalogs)<br>
+</pre>
+<p>Available since 2.14.0. Set the local catalogs.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>catalogs</tt></i>:</span></td>
+<td>catalogs pointer</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtSetCharEncConvImpl"></a>xmlCtxtSetCharEncConvImpl ()</h3>
+<pre class="programlisting">void	xmlCtxtSetCharEncConvImpl	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-encoding.html#xmlCharEncConvImpl">xmlCharEncConvImpl</a> impl, <br>					 void * vctxt)<br>
+</pre>
+<p>Installs a custom implementation to convert between character encodings. This bypasses legacy feature like global encoding handlers or encoding aliases. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>impl</tt></i>:</span></td>
+<td>callback</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
+<td>user data</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtSetDict"></a>xmlCtxtSetDict ()</h3>
+<pre class="programlisting">void	xmlCtxtSetDict			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict)<br>
+</pre>
+<p>Available since 2.14.0. Set the dictionary. This should only be done immediately after creating a parser context.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>dict</tt></i>:</span></td>
+<td>dictionary</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCtxtSetErrorHandler"></a>xmlCtxtSetErrorHandler ()</h3>
 <pre class="programlisting">void	xmlCtxtSetErrorHandler		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> handler, <br>					 void * data)<br>
 </pre>
@@ -1777,7 +2267,7 @@
 <a name="xmlCtxtSetOptions"></a>xmlCtxtSetOptions ()</h3>
 <pre class="programlisting">int	xmlCtxtSetOptions		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int options)<br>
 </pre>
-<p>Applies the options to the parser context. Unset options are cleared. Available since 2.13.0. With older versions, you can use <a href="libxml2-parser.html#xmlCtxtUseOptions">xmlCtxtUseOptions</a>. <a href="libxml2-parser.html#XML_PARSE_RECOVER">XML_PARSE_RECOVER</a> Enable "recovery" mode which allows non-wellformed documents. How this mode behaves exactly is unspecified and may change without further notice. Use of this feature is DISCOURAGED. <a href="libxml2-parser.html#XML_PARSE_NOENT">XML_PARSE_NOENT</a> Despite the confusing name, this option enables substitution of entities. The resulting tree won't contain any entity <a href="libxml2-SAX.html#reference">reference</a> nodes. This option also enables loading of external entities (both general and parameter entities) which is dangerous. If you process untrusted data, it's recommended to set the <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> option to disable loading of external entities. <a href="libxml2-parser.html#XML_PARSE_DTDLOAD">XML_PARSE_DTDLOAD</a> Enables loading of an external DTD and the loading and substitution of external parameter entities. Has no effect if <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> is set. <a href="libxml2-parser.html#XML_PARSE_DTDATTR">XML_PARSE_DTDATTR</a> Adds default attributes from the DTD to the result document. Implies XML_PARSE_DTDLOAD, but loading of external content can be disabled with <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a>. <a href="libxml2-parser.html#XML_PARSE_DTDVALID">XML_PARSE_DTDVALID</a> This option enables DTD validation which requires to load external DTDs and external entities (both general and parameter entities) unless <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> was set. <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> Disables loading of external DTDs or entities. <a href="libxml2-parser.html#XML_PARSE_NOERROR">XML_PARSE_NOERROR</a> Disable error and warning reports to the error handlers. Errors are still accessible with <a href="libxml2-xmlerror.html#xmlCtxtGetLastError">xmlCtxtGetLastError</a>. <a href="libxml2-parser.html#XML_PARSE_NOWARNING">XML_PARSE_NOWARNING</a> Disable warning reports. <a href="libxml2-parser.html#XML_PARSE_PEDANTIC">XML_PARSE_PEDANTIC</a> Enable some pedantic warnings. <a href="libxml2-parser.html#XML_PARSE_NOBLANKS">XML_PARSE_NOBLANKS</a> Remove some text nodes containing only whitespace from the result document. Which nodes are removed depends on DTD element declarations or a conservative heuristic. The reindenting feature of the serialization code relies on this option to be set when parsing. Use of this option is DISCOURAGED. <a href="libxml2-parser.html#XML_PARSE_SAX1">XML_PARSE_SAX1</a> Always invoke the deprecated SAX1 <a href="libxml2-SAX.html#startElement">startElement</a> and <a href="libxml2-SAX.html#endElement">endElement</a> handlers. This option is DEPRECATED. <a href="libxml2-parser.html#XML_PARSE_NONET">XML_PARSE_NONET</a> Disable network access with the builtin HTTP and FTP clients. <a href="libxml2-parser.html#XML_PARSE_NODICT">XML_PARSE_NODICT</a> Create a document without interned strings, making all strings separate memory allocations. <a href="libxml2-parser.html#XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a> Remove redundant namespace declarations from the result document. <a href="libxml2-parser.html#XML_PARSE_NOCDATA">XML_PARSE_NOCDATA</a> Output normal text nodes instead of CDATA nodes. <a href="libxml2-parser.html#XML_PARSE_COMPACT">XML_PARSE_COMPACT</a> Store small strings directly in the node struct to save memory. <a href="libxml2-parser.html#XML_PARSE_OLD10">XML_PARSE_OLD10</a> Use old Name productions from before XML 1.0 Fifth Edition. This options is DEPRECATED. <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> Relax some internal limits. Maximum size of text nodes, tags, comments, processing instructions, CDATA sections, entity values normal: 10M huge: 1B Maximum size of names, system literals, pubid literals normal: 50K huge: 10M Maximum nesting depth of elements normal: 256 huge: 2048 Maximum nesting depth of entities normal: 20 huge: 40 <a href="libxml2-parser.html#XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a> Enable an unspecified legacy mode for SAX parsers. This option is DEPRECATED. <a href="libxml2-parser.html#XML_PARSE_IGNORE_ENC">XML_PARSE_IGNORE_ENC</a> Ignore the encoding in the XML declaration. This option is mostly unneeded these days. The only effect is to enforce UTF-8 decoding of ASCII-like data. <a href="libxml2-parser.html#XML_PARSE_BIG_LINES">XML_PARSE_BIG_LINES</a> Enable reporting of line numbers larger than 65535.</p>
+<p>Applies the options to the parser context. Unset options are cleared. Available since 2.13.0. With older versions, you can use <a href="libxml2-parser.html#xmlCtxtUseOptions">xmlCtxtUseOptions</a>. <a href="libxml2-parser.html#XML_PARSE_RECOVER">XML_PARSE_RECOVER</a> Enable "recovery" mode which allows non-wellformed documents. How this mode behaves exactly is unspecified and may change without further notice. Use of this feature is DISCOURAGED. Not supported by the push parser. <a href="libxml2-parser.html#XML_PARSE_NOENT">XML_PARSE_NOENT</a> Despite the confusing name, this option enables substitution of entities. The resulting tree won't contain any entity reference nodes. This option also enables loading of external entities (both general and parameter entities) which is dangerous. If you process untrusted data, it's recommended to set the <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> option to disable loading of external entities. <a href="libxml2-parser.html#XML_PARSE_DTDLOAD">XML_PARSE_DTDLOAD</a> Enables loading of an external DTD and the loading and substitution of external parameter entities. Has no effect if <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> is set. <a href="libxml2-parser.html#XML_PARSE_DTDATTR">XML_PARSE_DTDATTR</a> Adds default attributes from the DTD to the result document. Implies XML_PARSE_DTDLOAD, but loading of external content can be disabled with <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a>. <a href="libxml2-parser.html#XML_PARSE_DTDVALID">XML_PARSE_DTDVALID</a> This option enables DTD validation which requires to load external DTDs and external entities (both general and parameter entities) unless <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> was set. <a href="libxml2-parser.html#XML_PARSE_NO_XXE">XML_PARSE_NO_XXE</a> Disables loading of external DTDs or entities. Available since 2.13.0. <a href="libxml2-parser.html#XML_PARSE_NOERROR">XML_PARSE_NOERROR</a> Disable error and warning reports to the error handlers. Errors are still accessible with <a href="libxml2-xmlerror.html#xmlCtxtGetLastError">xmlCtxtGetLastError</a>. <a href="libxml2-parser.html#XML_PARSE_NOWARNING">XML_PARSE_NOWARNING</a> Disable warning reports. <a href="libxml2-parser.html#XML_PARSE_PEDANTIC">XML_PARSE_PEDANTIC</a> Enable some pedantic warnings. <a href="libxml2-parser.html#XML_PARSE_NOBLANKS">XML_PARSE_NOBLANKS</a> Remove some whitespace from the result document. Where to remove whitespace depends on DTD element declarations or a broken heuristic with unfixable bugs. Use of this option is DISCOURAGED. Not supported by the push parser. <a href="libxml2-parser.html#XML_PARSE_SAX1">XML_PARSE_SAX1</a> Always invoke the deprecated SAX1 startElement and endElement handlers. This option is DEPRECATED. <a href="libxml2-parser.html#XML_PARSE_NONET">XML_PARSE_NONET</a> Disable network access with the builtin HTTP client. <a href="libxml2-parser.html#XML_PARSE_NODICT">XML_PARSE_NODICT</a> Create a document without interned strings, making all strings separate memory allocations. <a href="libxml2-parser.html#XML_PARSE_NSCLEAN">XML_PARSE_NSCLEAN</a> Remove redundant namespace declarations from the result document. <a href="libxml2-parser.html#XML_PARSE_NOCDATA">XML_PARSE_NOCDATA</a> Output normal text nodes instead of CDATA nodes. <a href="libxml2-parser.html#XML_PARSE_COMPACT">XML_PARSE_COMPACT</a> Store small strings directly in the node struct to save memory. <a href="libxml2-parser.html#XML_PARSE_OLD10">XML_PARSE_OLD10</a> Use old Name productions from before XML 1.0 Fifth Edition. This options is DEPRECATED. <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> Relax some internal limits. Maximum size of text nodes, tags, comments, processing instructions, CDATA sections, entity values normal: 10M huge: 1B Maximum size of names, system literals, pubid literals normal: 50K huge: 10M Maximum nesting depth of elements normal: 256 huge: 2048 Maximum nesting depth of entities normal: 20 huge: 40 <a href="libxml2-parser.html#XML_PARSE_OLDSAX">XML_PARSE_OLDSAX</a> Enable an unspecified legacy mode for SAX parsers. This option is DEPRECATED. <a href="libxml2-parser.html#XML_PARSE_IGNORE_ENC">XML_PARSE_IGNORE_ENC</a> Ignore the encoding in the XML declaration. This option is mostly unneeded these days. The only effect is to enforce UTF-8 decoding of ASCII-like data. <a href="libxml2-parser.html#XML_PARSE_BIG_LINES">XML_PARSE_BIG_LINES</a> Enable reporting of line numbers larger than 65535. <a href="libxml2-parser.html#XML_PARSE_UNZIP">XML_PARSE_UNZIP</a> Enable input decompression. Setting this option is discouraged to avoid zip bombs. Available since 2.14.0. <a href="libxml2-parser.html#XML_PARSE_NO_SYS_CATALOG">XML_PARSE_NO_SYS_CATALOG</a> Disables the global system XML catalog. Available since 2.14.0. <a href="libxml2-parser.html#XML_PARSE_CATALOG_PI">XML_PARSE_CATALOG_PI</a> Enable XML catalog processing instructions. Available since 2.14.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1799,6 +2289,77 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCtxtSetPrivate"></a>xmlCtxtSetPrivate ()</h3>
+<pre class="programlisting">void	xmlCtxtSetPrivate		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 void * priv)<br>
+</pre>
+<p>Available since 2.14.0. Set the private application data.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>priv</tt></i>:</span></td>
+<td>private application data</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtSetResourceLoader"></a>xmlCtxtSetResourceLoader ()</h3>
+<pre class="programlisting">void	xmlCtxtSetResourceLoader	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * vctxt)<br>
+</pre>
+<p>Installs a custom callback to load documents, DTDs or external entities. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>loader</tt></i>:</span></td>
+<td>callback</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
+<td>user data</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtSetSaxHandler"></a>xmlCtxtSetSaxHandler ()</h3>
+<pre class="programlisting">int	xmlCtxtSetSaxHandler		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * sax)<br>
+</pre>
+<p>Available since 2.14.0. Set the SAX handler struct to a copy of @sax.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>sax</tt></i>:</span></td>
+<td>SAX handler</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>0 on success or -1 if arguments are invalid or a memory allocation failed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCtxtUseOptions"></a>xmlCtxtUseOptions ()</h3>
 <pre class="programlisting">int	xmlCtxtUseOptions		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int options)<br>
 </pre>
@@ -1825,6 +2386,60 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCtxtValidateDocument"></a>xmlCtxtValidateDocument ()</h3>
+<pre class="programlisting">int	xmlCtxtValidateDocument		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
+</pre>
+<p>Validate a document. Like <a href="libxml2-valid.html#xmlValidateDocument">xmlValidateDocument</a> but uses the parser context's error handler. Option <a href="libxml2-parser.html#XML_PARSE_DTDLOAD">XML_PARSE_DTDLOAD</a> should be enabled in the parser context to make external entities work. Availabe since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>a parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>doc</tt></i>:</span></td>
+<td>a document instance</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>1 if valid or 0 otherwise.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtValidateDtd"></a>xmlCtxtValidateDtd ()</h3>
+<pre class="programlisting">int	xmlCtxtValidateDtd		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd)<br>
+</pre>
+<p>Validate a document against a DTD. Like <a href="libxml2-valid.html#xmlValidateDtd">xmlValidateDtd</a> but uses the parser context's error handler. Availabe since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>a parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>doc</tt></i>:</span></td>
+<td>a document instance</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>dtd</tt></i>:</span></td>
+<td>a dtd instance</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>1 if valid or 0 otherwise.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlFreeParserCtxt"></a>xmlFreeParserCtxt ()</h3>
 <pre class="programlisting">void	xmlFreeParserCtxt		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
@@ -1843,7 +2458,7 @@
 <a name="xmlGetExternalEntityLoader"></a>xmlGetExternalEntityLoader ()</h3>
 <pre class="programlisting"><a href="libxml2-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a>	xmlGetExternalEntityLoader	(void)<br>
 </pre>
-<p>Get the default external entity resolver function for the application</p>
+<p>DEPRECATED: See <a href="libxml2-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a>. Get the default external entity resolver function for the application</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -1855,60 +2470,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlGetFeature"></a>xmlGetFeature ()</h3>
-<pre class="programlisting">int	xmlGetFeature			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * name, <br>					 void * result)<br>
-</pre>
-<p>Read the current value of one feature of this parser instance</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/HTML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the feature name</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>result</tt></i>:</span></td>
-<td>location to store the result</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>-1 in case or error, 0 otherwise</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlGetFeaturesList"></a>xmlGetFeaturesList ()</h3>
-<pre class="programlisting">int	xmlGetFeaturesList		(int * len, <br>					 const char ** result)<br>
-</pre>
-<p>Copy at most *@len feature names into the @result array</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the length of the features name array (input/output)</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>result</tt></i>:</span></td>
-<td>an array of string to be filled with the features name.</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>-1 in case or error, or the total number of features, len is updated with the number of strings copied, strings must not be deallocated</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlHasFeature"></a>xmlHasFeature ()</h3>
 <pre class="programlisting">int	xmlHasFeature			(<a href="libxml2-parser.html#xmlFeature">xmlFeature</a> feature)<br>
 </pre>
@@ -1933,7 +2494,7 @@
 <a name="xmlIOParseDTD"></a>xmlIOParseDTD ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	xmlIOParseDTD		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br>
 </pre>
-<p>Load and parse a DTD</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlCtxtParseDtd">xmlCtxtParseDtd</a>. Load and parse a DTD</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1985,7 +2546,7 @@
 <a name="xmlInitParser"></a>xmlInitParser ()</h3>
 <pre class="programlisting">void	xmlInitParser			(void)<br>
 </pre>
-<p>Initialization function for the XML parser. Call once from the main thread before using the library in multithreaded programs.</p>
+<p>Initialization function for the XML parser. For older versions, it's recommended to call this function once from the main thread before using the library in multithreaded programs. Since 2.14.0, there's no distinction between threads. It should be unnecessary to call this function.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -2011,6 +2572,31 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlInputSetEncodingHandler"></a>xmlInputSetEncodingHandler ()</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlInputSetEncodingHandler	(<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> handler)<br>
+</pre>
+<p>Use encoding handler to decode input data. Closes the handler on error.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>input</tt></i>:</span></td>
+<td>the input stream</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>handler</tt></i>:</span></td>
+<td>the encoding handler</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlKeepBlanksDefault"></a>xmlKeepBlanksDefault ()</h3>
 <pre class="programlisting">int	xmlKeepBlanksDefault		(int val)<br>
 </pre>
@@ -2056,7 +2642,7 @@
 <a name="xmlLoadExternalEntity"></a>xmlLoadExternalEntity ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlLoadExternalEntity	(const char * URL, <br>						 const char * ID, <br>						 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>@URL is a filename or URL. If if contains the substring "://", it is assumed to be a Legacy Extended IRI. Otherwise, it is treated as a filesystem path. @ID is an optional XML public ID, typically from a doctype declaration. It is used for catalog lookups. The following resource loaders will be called if they were registered (in order of precedence): - the global external entity loader set with <a href="libxml2-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a> - the per-thread <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> set with <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a> - the default loader which will return - the result from a matching global input callback set with <a href="libxml2-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.</p>
+<p>@URL is a filename or URL. If if contains the substring "://", it is assumed to be a Legacy Extended IRI. Otherwise, it is treated as a filesystem path. @ID is an optional XML public ID, typically from a doctype declaration. It is used for catalog lookups. If catalog lookup is enabled (default is yes) and URL or ID are found in system or local XML catalogs, URL is replaced with the result. Then the following resource loaders will be called if they were registered (in order of precedence): - the resource loader set with <a href="libxml2-parser.html#xmlCtxtSetResourceLoader">xmlCtxtSetResourceLoader</a> - the global external entity loader set with <a href="libxml2-parser.html#xmlSetExternalEntityLoader">xmlSetExternalEntityLoader</a> (without catalog resolution, deprecated) - the per-thread <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> set with <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a> (deprecated) - the default loader which will return - the result from a matching global input callback set with <a href="libxml2-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> (deprecated) - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2111,6 +2697,163 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlNewInputFromFd"></a>xmlNewInputFromFd ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewInputFromFd	(const char * url, <br>						 int fd, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags)<br>
+</pre>
+<p>Creates a new parser input to read from a zero-terminated string. @url is used as base to resolve external entities and for error reporting. @fd is closed after parsing has finished. Supported @flags are <a href="libxml2-parser.html#XML_INPUT_UNZIP">XML_INPUT_UNZIP</a> to decompress data automatically. This feature is deprecated and will be removed in a future release. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>url</tt></i>:</span></td>
+<td>base URL (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>fd</tt></i>:</span></td>
+<td>file descriptor</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>input flags</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>a new parser input or NULL if a memory allocation failed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlNewInputFromIO"></a>xmlNewInputFromIO ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewInputFromIO	(const char * url, <br>						 <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioRead, <br>						 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioClose, <br>						 void * ioCtxt, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags)<br>
+</pre>
+<p>Creates a new parser input to read from input callbacks and cintext. @url is used as base to resolve external entities and for error reporting. @ioRead is called to read new data into a provided buffer. It must return the number of bytes written into the buffer ot a negative <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code on failure. @ioClose is called after parsing has finished. @ioCtxt is an opaque pointer passed to the callbacks. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>url</tt></i>:</span></td>
+<td>base URL (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>ioRead</tt></i>:</span></td>
+<td>read callback</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>ioClose</tt></i>:</span></td>
+<td>close callback (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>ioCtxt</tt></i>:</span></td>
+<td>IO context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>unused, pass 0</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>a new parser input or NULL if a memory allocation failed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlNewInputFromMemory"></a>xmlNewInputFromMemory ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewInputFromMemory	(const char * url, <br>						 const void * mem, <br>						 size_t size, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags)<br>
+</pre>
+<p>Creates a new parser input to read from a memory area. @url is used as base to resolve external entities and for error reporting. If the <a href="libxml2-parser.html#XML_INPUT_BUF_STATIC">XML_INPUT_BUF_STATIC</a> flag is set, the memory area must stay unchanged until parsing has finished. This can avoid temporary copies. If the <a href="libxml2-parser.html#XML_INPUT_BUF_ZERO_TERMINATED">XML_INPUT_BUF_ZERO_TERMINATED</a> flag is set, the memory area must contain a zero byte after the buffer at position @size. This can avoid temporary copies. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>url</tt></i>:</span></td>
+<td>base URL (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>mem</tt></i>:</span></td>
+<td>pointer to char array</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>size</tt></i>:</span></td>
+<td>size of array</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>optimization hints</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>a new parser input or NULL if a memory allocation failed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlNewInputFromString"></a>xmlNewInputFromString ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewInputFromString	(const char * url, <br>						 const char * str, <br>						 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags)<br>
+</pre>
+<p>Creates a new parser input to read from a zero-terminated string. @url is used as base to resolve external entities and for error reporting. If the <a href="libxml2-parser.html#XML_INPUT_BUF_STATIC">XML_INPUT_BUF_STATIC</a> flag is set, the string must stay unchanged until parsing has finished. This can avoid temporary copies. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>url</tt></i>:</span></td>
+<td>base URL (optional)</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>str</tt></i>:</span></td>
+<td>zero-terminated string</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>optimization hints</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>a new parser input or NULL if a memory allocation failed.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlNewInputFromUrl"></a>xmlNewInputFromUrl ()</h3>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlNewInputFromUrl	(const char * filename, <br>					 <a href="libxml2-parser.html#xmlParserInputFlags">xmlParserInputFlags</a> flags, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> * out)<br>
+</pre>
+<p>Create a new input stream based on a file or a URL. The flag <a href="libxml2-parser.html#XML_INPUT_UNZIP">XML_INPUT_UNZIP</a> allows decompression. The flag <a href="libxml2-parser.html#XML_INPUT_NETWORK">XML_INPUT_NETWORK</a> allows network access. The following resource loaders will be called if they were registered (in order of precedence): - the per-thread <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> set with <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameDefault">xmlParserInputBufferCreateFilenameDefault</a> (deprecated) - the default loader which will return - the result from a matching global input callback set with <a href="libxml2-xmlIO.html#xmlRegisterInputCallbacks">xmlRegisterInputCallbacks</a> (deprecated) - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>filename</tt></i>:</span></td>
+<td>the filename to use as entity</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>flags</tt></i>:</span></td>
+<td>XML_INPUT flags</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>out</tt></i>:</span></td>
+<td>pointer to new parser input</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>an <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlNewParserCtxt"></a>xmlNewParserCtxt ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	xmlNewParserCtxt	(void)<br>
 </pre>
@@ -2240,7 +2983,7 @@
 <a name="xmlParseChunk"></a>xmlParseChunk ()</h3>
 <pre class="programlisting">int	xmlParseChunk			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * chunk, <br>					 int size, <br>					 int terminate)<br>
 </pre>
-<p>Parse a chunk of memory in push parser mode. Assumes that the parser context was initialized with <a href="libxml2-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a>. The last chunk, which will often be empty, must be marked with the @terminate flag. With the default SAX callbacks, the resulting document will be available in ctxt-&gt;myDoc. This pointer will not be freed by the library. If the document isn't well-formed, ctxt-&gt;myDoc is set to NULL. The push parser doesn't support recovery mode.</p>
+<p>Parse a chunk of memory in push parser mode. Assumes that the parser context was initialized with <a href="libxml2-parser.html#xmlCreatePushParserCtxt">xmlCreatePushParserCtxt</a>. The last chunk, which will often be empty, must be marked with the @terminate flag. With the default SAX callbacks, the resulting document will be available in ctxt-&gt;myDoc. This pointer will not be freed when calling <a href="libxml2-parser.html#xmlFreeParserCtxt">xmlFreeParserCtxt</a> and must be freed by the caller. If the document isn't well-formed, it will still be returned in ctxt-&gt;myDoc. As an exception, <a href="libxml2-parser.html#xmlCtxtResetPush">xmlCtxtResetPush</a> will free the document in ctxt-&gt;myDoc. So ctxt-&gt;myDoc should be set to NULL after extracting the document.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2395,7 +3138,7 @@
 <a name="xmlParseExtParsedEnt"></a>xmlParseExtParsedEnt ()</h3>
 <pre class="programlisting">int	xmlParseExtParsedEnt		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
+<p>DEPRECATED: Internal function, don't use. parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt. [78] extParsedEnt ::= TextDecl? content</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2480,9 +3223,9 @@
 <div class="refsect2" lang="en">
 <h3>
 <a name="xmlParseInNodeContext"></a>xmlParseInNodeContext ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlParseInNodeContext	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const char * data, <br>					 int datalen, <br>					 int options, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * lst)<br>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlParseInNodeContext	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const char * data, <br>					 int datalen, <br>					 int options, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * listOut)<br>
 </pre>
-<p>Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node. The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</p>
+<p>Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node. The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar: [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)* This function assumes the encoding of @node's document which is typically not what you want. A better alternative is <a href="libxml2-parser.html#xmlCtxtParseContent">xmlCtxtParseContent</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2504,7 +3247,7 @@
 </td>
 </tr>
 <tr>
-<td><span class="term"><i><tt>lst</tt></i>:</span></td>
+<td><span class="term"><i><tt>listOut</tt></i>:</span></td>
 <td>the return value for the set of parsed nodes</td>
 </tr>
 <tr>
@@ -2756,7 +3499,7 @@
 <a name="xmlReadFile"></a>xmlReadFile ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	xmlReadFile		(const char * filename, <br>					 const char * encoding, <br>					 int options)<br>
 </pre>
-<p>Convenience function to parse an XML file from the filesystem, the network or a global user-define resource loader. See <a href="libxml2-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> for details.</p>
+<p>Convenience function to parse an XML file from the filesystem, the network or a global user-define resource loader. This function always enables the <a href="libxml2-parser.html#XML_PARSE_UNZIP">XML_PARSE_UNZIP</a> option for backward compatibility. If a "-" filename is passed, it will read from stdin. Both of these features are potentially insecure and might be removed from later versions. See <a href="libxml2-parser.html#xmlCtxtReadFile">xmlCtxtReadFile</a> for details.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2934,7 +3677,7 @@
 <a name="xmlSAXParseDTD"></a>xmlSAXParseDTD ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	xmlSAXParseDTD		(<a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID)<br>
 </pre>
-<p>DEPRECATED: Don't use. Load and parse an external subset.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlCtxtParseDtd">xmlCtxtParseDtd</a>. Load and parse an external subset.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3212,7 +3955,7 @@
 <a name="xmlSetExternalEntityLoader"></a>xmlSetExternalEntityLoader ()</h3>
 <pre class="programlisting">void	xmlSetExternalEntityLoader	(<a href="libxml2-parser.html#xmlExternalEntityLoader">xmlExternalEntityLoader</a> f)<br>
 </pre>
-<p>Changes the defaultexternal entity resolver function for the application</p>
+<p>DEPRECATED: This is a global setting and not thread-safe. Use <a href="libxml2-parser.html#xmlCtxtSetResourceLoader">xmlCtxtSetResourceLoader</a> or similar functions. Changes the default external entity resolver function for the application.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -3224,35 +3967,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlSetFeature"></a>xmlSetFeature ()</h3>
-<pre class="programlisting">int	xmlSetFeature			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const char * name, <br>					 void * value)<br>
-</pre>
-<p>Change the current value of one feature of this parser instance</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/HTML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the feature name</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>pointer to the location of the new value</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>-1 in case or error, 0 otherwise</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlSetupParserForBuffer"></a>xmlSetupParserForBuffer ()</h3>
 <pre class="programlisting">void	xmlSetupParserForBuffer		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * buffer, <br>					 const char * filename)<br>
 </pre>
@@ -3419,27 +4133,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlThrDefParserDebugEntities"></a>xmlThrDefParserDebugEntities ()</h3>
-<pre class="programlisting">int	xmlThrDefParserDebugEntities	(int v)<br>
-</pre>
-<p></p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>v</tt></i>:</span></td>
-<td></td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td></td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlThrDefPedanticParserDefaultValue"></a>xmlThrDefPedanticParserDefaultValue ()</h3>
 <pre class="programlisting">int	xmlThrDefPedanticParserDefaultValue	(int v)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-parserInternals.html b/doc/devhelp/libxml2-parserInternals.html
index b8e114e..9c4e6de 100644
--- a/doc/devhelp/libxml2-parserInternals.html
+++ b/doc/devhelp/libxml2-parserInternals.html
@@ -22,8 +22,7 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">#define <a href="#INPUT_CHUNK">INPUT_CHUNK</a>;
-#define <a href="#IS_ASCII_DIGIT">IS_ASCII_DIGIT</a>(c);
+<pre class="synopsis">#define <a href="#IS_ASCII_DIGIT">IS_ASCII_DIGIT</a>(c);
 #define <a href="#IS_ASCII_LETTER">IS_ASCII_LETTER</a>(c);
 #define <a href="#IS_BASECHAR">IS_BASECHAR</a>(c);
 #define <a href="#IS_BLANK">IS_BLANK</a>(c);
@@ -52,12 +51,9 @@
 #define <a href="#XML_SUBSTITUTE_NONE">XML_SUBSTITUTE_NONE</a>;
 #define <a href="#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a>;
 #define <a href="#XML_SUBSTITUTE_REF">XML_SUBSTITUTE_REF</a>;
-<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#inputPop">inputPop</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-int	<a href="#inputPush">inputPush</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value);
-const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#namePop">namePop</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-int	<a href="#namePush">namePush</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
-<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#nodePop">nodePop</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-int	<a href="#nodePush">nodePush</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> value);
+#define <a href="#inputPop">inputPop</a>;
+#define <a href="#inputPush">inputPush</a>;
+#define <a href="#xmlParserMaxDepth">xmlParserMaxDepth</a>;
 int	<a href="#xmlCheckLanguageID">xmlCheckLanguageID</a>		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * lang);
 int	<a href="#xmlCopyChar">xmlCopyChar</a>			(int len, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * out, <br>					 int val);
 int	<a href="#xmlCopyCharMultiByte">xmlCopyCharMultiByte</a>		(<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * out, <br>					 int val);
@@ -66,15 +62,11 @@
 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlCreateMemoryParserCtxt">xmlCreateMemoryParserCtxt</a>	(const char * buffer, <br>							 int size);
 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a>	<a href="#xmlCreateURLParserCtxt">xmlCreateURLParserCtxt</a>	(const char * filename, <br>						 int options);
 void	<a href="#xmlCtxtErrMemory">xmlCtxtErrMemory</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlCtxtPopInput">xmlCtxtPopInput</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
+int	<a href="#xmlCtxtPushInput">xmlCtxtPushInput</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value);
 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="#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);
-<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlNamespaceParseNCName">xmlNamespaceParseNCName</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlNamespaceParseNSDef">xmlNamespaceParseNSDef</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlNamespaceParseQName">xmlNamespaceParseQName</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** prefix);
 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewEntityInputStream">xmlNewEntityInputStream</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>						 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> ent);
 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewInputFromFile">xmlNewInputFromFile</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>						 const char * filename);
 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	<a href="#xmlNewInputStream">xmlNewInputStream</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
@@ -109,7 +101,6 @@
 void	<a href="#xmlParseMarkupDecl">xmlParseMarkupDecl</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 void	<a href="#xmlParseMisc">xmlParseMisc</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParseName">xmlParseName</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-void	<a href="#xmlParseNamespace">xmlParseNamespace</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParseNmtoken">xmlParseNmtoken</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 void	<a href="#xmlParseNotationDecl">xmlParseNotationDecl</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a>	<a href="#xmlParseNotationType">xmlParseNotationType</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
@@ -117,7 +108,6 @@
 void	<a href="#xmlParsePI">xmlParsePI</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParsePITarget">xmlParsePITarget</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParsePubidLiteral">xmlParsePubidLiteral</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParseQuotedString">xmlParseQuotedString</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 void	<a href="#xmlParseReference">xmlParseReference</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 int	<a href="#xmlParseSDDecl">xmlParseSDDecl</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParseStartTag">xmlParseStartTag</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
@@ -127,12 +117,9 @@
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlParseVersionNum">xmlParseVersionNum</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 void	<a href="#xmlParseXMLDecl">xmlParseXMLDecl</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 void	<a href="#xmlParserHandlePEReference">xmlParserHandlePEReference</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-void	<a href="#xmlParserHandleReference">xmlParserHandleReference</a>	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 void	<a href="#xmlParserInputShrink">xmlParserInputShrink</a>		(<a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> in);
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a>	<a href="#xmlPopInput">xmlPopInput</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 int	<a href="#xmlPushInput">xmlPushInput</a>			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input);
-<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlScanName">xmlScanName</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
-void	<a href="#xmlSetEntityReferenceFunc">xmlSetEntityReferenceFunc</a>	(<a href="libxml2-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> func);
 int	<a href="#xmlSkipBlankChars">xmlSkipBlankChars</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt);
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlSplitQName">xmlSplitQName</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** prefixOut);
 int	<a href="#xmlStringCurrentChar">xmlStringCurrentChar</a>		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * cur, <br>					 int * len);
@@ -150,14 +137,6 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
-<a name="INPUT_CHUNK">Macro </a>INPUT_CHUNK</h3>
-<pre class="programlisting">#define <a href="#INPUT_CHUNK">INPUT_CHUNK</a>;
-</pre>
-<p>The parser tries to always have that amount of input ready. One of the point is providing context when reporting errors.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="IS_ASCII_DIGIT">Macro </a>IS_ASCII_DIGIT</h3>
 <pre class="programlisting">#define <a href="#IS_ASCII_DIGIT">IS_ASCII_DIGIT</a>(c);
 </pre>
@@ -523,35 +502,26 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlEntityReferenceFunc"></a>Function type xmlEntityReferenceFunc</h3>
-<pre class="programlisting">void	xmlEntityReferenceFunc		(<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)<br>
+<a name="inputPop">Macro </a>inputPop</h3>
+<pre class="programlisting">#define <a href="#inputPop">inputPop</a>;
 </pre>
-<p>Callback function used when one needs to be able to track back the provenance of a chunk of nodes inherited from an entity replacement.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ent</tt></i>:</span></td>
-<td>the entity</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>firstNode</tt></i>:</span></td>
-<td>the fist node in the chunk</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>lastNode</tt></i>:</span></td>
-<td>the last nod in the chunk</td>
-</tr>
-</tbody>
-</table></div>
+<p></p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlParserMaxDepth">Variable </a>xmlParserMaxDepth</h3>
-<pre class="programlisting">const unsigned int xmlParserMaxDepth;
+<a name="inputPush">Macro </a>inputPush</h3>
+<pre class="programlisting">#define <a href="#inputPush">inputPush</a>;
 </pre>
-<p>arbitrary depth limit for the XML documents that we allow to process. This is not a limitation of the parser but a safety boundary feature. It can be disabled with the <a href="libxml2-parser.html#XML_PARSE_HUGE">XML_PARSE_HUGE</a> parser option.</p>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlParserMaxDepth">Macro </a>xmlParserMaxDepth</h3>
+<pre class="programlisting">#define <a href="#xmlParserMaxDepth">xmlParserMaxDepth</a>;
+</pre>
+<p></p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -580,148 +550,10 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="inputPop"></a>inputPop ()</h3>
-<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	inputPop	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>Pops the top parser input from the input stack</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the input just removed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="inputPush"></a>inputPush ()</h3>
-<pre class="programlisting">int	inputPush			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value)<br>
-</pre>
-<p>Pushes a new parser input on top of the input stack</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the parser input</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>-1 in case of error, the index in the stack otherwise</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="namePop"></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>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>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the name just removed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<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>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>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the element name</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>-1 in case of error, the index in the stack otherwise</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="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>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>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the node just removed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<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>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>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the element node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>-1 in case of error, the index in the stack otherwise</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlCheckLanguageID"></a>xmlCheckLanguageID ()</h3>
 <pre class="programlisting">int	xmlCheckLanguageID		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * lang)<br>
 </pre>
-<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>
+<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 reference 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>
@@ -742,7 +574,7 @@
 <a name="xmlCopyChar"></a>xmlCopyChar ()</h3>
 <pre class="programlisting">int	xmlCopyChar			(int len, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * out, <br>					 int val)<br>
 </pre>
-<p>append the char value in the array</p>
+<p>DEPRECATED: Don't use. append the char value in the array</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -772,7 +604,7 @@
 <a name="xmlCopyCharMultiByte"></a>xmlCopyCharMultiByte ()</h3>
 <pre class="programlisting">int	xmlCopyCharMultiByte		(<a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * out, <br>					 int val)<br>
 </pre>
-<p>append the char value in the array</p>
+<p>DEPRECATED: Internal function, don't use. append the char value in the array</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -911,6 +743,52 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlCtxtPopInput"></a>xmlCtxtPopInput ()</h3>
+<pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlCtxtPopInput	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
+</pre>
+<p>Pops the top parser input from the input stack</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>an XML parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the input just removed</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlCtxtPushInput"></a>xmlCtxtPushInput ()</h3>
+<pre class="programlisting">int	xmlCtxtPushInput		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> value)<br>
+</pre>
+<p>Pushes a new parser input on top of the input stack</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>an XML parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>value</tt></i>:</span></td>
+<td>the parser input</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>-1 in case of error, the index in the stack otherwise</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlCurrentChar"></a>xmlCurrentChar ()</h3>
 <pre class="programlisting">int	xmlCurrentChar			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 int * len)<br>
 </pre>
@@ -936,48 +814,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlDecodeEntities"></a>xmlDecodeEntities ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlDecodeEntities	(<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)<br>
-</pre>
-<p>This function is deprecated, we now always process entities content through <a href="libxml2-parserInternals.html#xmlStringDecodeEntities">xmlStringDecodeEntities</a> TODO: remove it in next major release. [67] Reference ::= EntityRef | CharRef [69] PEReference ::= '%' Name ';'</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the len to decode (in bytes !), -1 for no size limit</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>what</tt></i>:</span></td>
-<td>combination of <a href="libxml2-parserInternals.html#XML_SUBSTITUTE_REF">XML_SUBSTITUTE_REF</a> and <a href="libxml2-parserInternals.html#XML_SUBSTITUTE_PEREF">XML_SUBSTITUTE_PEREF</a>
-</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>an end marker xmlChar, 0 if none</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end2</tt></i>:</span></td>
-<td>an end marker xmlChar, 0 if none</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end3</tt></i>:</span></td>
-<td>an end marker xmlChar, 0 if none</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>A newly allocated string with the substitution done. The caller must deallocate it !</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>
@@ -994,31 +830,10 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlHandleEntity"></a>xmlHandleEntity ()</h3>
-<pre class="programlisting">void	xmlHandleEntity			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a> entity)<br>
-</pre>
-<p>Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ? OBSOLETE: to be removed at some point.</p>
-<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>entity</tt></i>:</span></td>
-<td>an XML entity pointer.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlIsLetter"></a>xmlIsLetter ()</h3>
 <pre class="programlisting">int	xmlIsLetter			(int c)<br>
 </pre>
-<p>Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic</p>
+<p>DEPRECATED: Internal function, don't use. Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1036,73 +851,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlNamespaceParseNCName"></a>xmlNamespaceParseNCName ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlNamespaceParseNCName	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>parse an XML namespace name. TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. [NS 3] NCName ::= (Letter | '_') (NCNameChar)* [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the namespace name or NULL</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlNamespaceParseNSDef"></a>xmlNamespaceParseNSDef ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlNamespaceParseNSDef	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>parse a namespace prefix declaration TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. [NS 1] NSDef ::= PrefixDef Eq SystemLiteral [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the namespace name</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlNamespaceParseQName"></a>xmlNamespaceParseQName ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlNamespaceParseQName	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** prefix)<br>
-</pre>
-<p>TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input. parse an XML qualified name [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName</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>prefix</tt></i>:</span></td>
-<td>a <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> **</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the local part, and prefix is updated to get the Prefix if any.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <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> ent)<br>
 </pre>
@@ -1131,7 +879,7 @@
 <a name="xmlNewInputFromFile"></a>xmlNewInputFromFile ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewInputFromFile	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>						 const char * filename)<br>
 </pre>
-<p>Create a new input stream based on a file or an URL.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromUrl">xmlNewInputFromUrl</a>. Create a new input stream based on a file or an URL.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1156,7 +904,7 @@
 <a name="xmlNewInputStream"></a>xmlNewInputStream ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewInputStream	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>Create a new input stream structure.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromUrl">xmlNewInputFromUrl</a> or similar functions. Create a new input stream structure.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1177,7 +925,7 @@
 <a name="xmlNewStringInputStream"></a>xmlNewStringInputStream ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNewStringInputStream	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * buffer)<br>
 </pre>
-<p>Create a new input stream based on a memory buffer.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromString">xmlNewInputFromString</a>. Create a new input stream based on a memory buffer.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1217,7 +965,7 @@
 <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>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>
+<p>DEPRECATED: Internal function, don't use. parse a value for an attribute 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 attribute is passed to the application or checked for validity, the XML processor must normalize it as follows: - a character reference is processed by appending the referenced character to the attribute value - an entity reference 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 characters 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 attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters 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>
@@ -1238,7 +986,7 @@
 <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: 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>
+<p>DEPRECATED: Internal function, don't use. parse an attribute [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 attribute value (other than "&amp;lt;") must not contain a &lt;. [ VC: Attribute Value Type ] The attribute 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>
@@ -1248,12 +996,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>a <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** used to store the value of the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>a <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** used to store the value of the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name, and the value in *value.</td>
+<td>the attribute name, and the value in *value.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1264,7 +1011,7 @@
 <a name="xmlParseAttributeListDecl"></a>xmlParseAttributeListDecl ()</h3>
 <pre class="programlisting">void	xmlParseAttributeListDecl	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<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>
+<p>DEPRECATED: Internal function, don't use. Parse an attribute 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>
@@ -1279,7 +1026,7 @@
 <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>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>
+<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 attribute 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 attribute specified. [ VC: ID Attribute Default ] An ID attribute 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 attribute on some element in the XML document; i.e. IDREF values must match the value of some ID attribute. [ 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>
@@ -1293,7 +1040,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> type</td>
+<td>the attribute type</td>
 </tr>
 </tbody>
 </table></div>
@@ -1340,7 +1087,7 @@
 <a name="xmlParseCharRef"></a>xmlParseCharRef ()</h3>
 <pre class="programlisting">int	xmlParseCharRef			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<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>
+<p>DEPRECATED: Internal function, don't use. Parse a numeric character reference. 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>
@@ -1361,7 +1108,7 @@
 <a name="xmlParseComment"></a>xmlParseComment ()</h3>
 <pre class="programlisting">void	xmlParseComment			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<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>
+<p>DEPRECATED: Internal function, don't use. Parse an XML (SGML) comment. 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>
@@ -1376,7 +1123,7 @@
 <a name="xmlParseContent"></a>xmlParseContent ()</h3>
 <pre class="programlisting">void	xmlParseContent			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>Parse XML element content. This is useful if you're only interested in custom SAX callbacks. If you want a node list, use <a href="libxml2-parser.html#xmlParseInNodeContext">xmlParseInNodeContext</a>.</p>
+<p>Parse XML element content. This is useful if you're only interested in custom SAX callbacks. If you want a node list, use <a href="libxml2-parser.html#xmlCtxtParseContent">xmlCtxtParseContent</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -1391,7 +1138,7 @@
 <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>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>
+<p>DEPRECATED: Internal function, don't use. Parse an attribute default declaration [60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | (('#FIXED' S)? AttValue) [ VC: Required Attribute ] if the default declaration is the keyword #REQUIRED, then the attribute 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 attribute type c.f. xmlValidateAttributeDecl() [ VC: Fixed Attribute Default ] if an attribute has a default value declared with the #FIXED keyword, instances of that attribute 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>
@@ -1401,8 +1148,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>Receive a possible fixed default value for the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>Receive a possible fixed default value for the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1447,7 +1193,7 @@
 <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>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>
+<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 reference 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>
@@ -1654,7 +1400,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the EntityValue parsed with <a href="libxml2-SAX.html#reference">reference</a> substituted or NULL</td>
+<td>the EntityValue parsed with reference substituted or NULL</td>
 </tr>
 </tbody>
 </table></div>
@@ -1665,7 +1411,7 @@
 <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>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>
+<p>DEPRECATED: Internal function, don't use. parse an Enumerated attribute 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>
@@ -1692,7 +1438,7 @@
 <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>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>
+<p>DEPRECATED: Internal function, don't use. parse an Enumeration attribute 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>
@@ -1702,7 +1448,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the enumeration <a href="libxml2-SAX.html#attribute">attribute</a> tree built while parsing</td>
+<td>the enumeration attribute tree built while parsing</td>
 </tr>
 </tbody>
 </table></div>
@@ -1742,7 +1488,7 @@
 <a name="xmlParseExternalSubset"></a>xmlParseExternalSubset ()</h3>
 <pre class="programlisting">void	xmlParseExternalSubset		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID)<br>
 </pre>
-<p>parse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *</p>
+<p>DEPRECATED: Internal function, don't use. parse Markup declarations from an external subset [30] extSubset ::= textDecl? extSubsetDecl [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1815,21 +1561,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlParseNamespace"></a>xmlParseNamespace ()</h3>
-<pre class="programlisting">void	xmlParseNamespace		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>xmlParseNamespace: parse specific PI '&lt;?namespace ...' constructs. This is what the older xml-name Working Draft specified, a bunch of other stuff may still rely on it, so support is still here as if it was declared on the root of the Tree:-( TODO: remove from library To be removed at next drop of binary compatibility</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="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>
@@ -1869,7 +1600,7 @@
 <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>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>
+<p>DEPRECATED: Internal function, don't use. parse an Notation attribute 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>
@@ -1879,7 +1610,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the notation <a href="libxml2-SAX.html#attribute">attribute</a> tree built while parsing</td>
+<td>the notation attribute tree built while parsing</td>
 </tr>
 </tbody>
 </table></div>
@@ -1890,7 +1621,7 @@
 <a name="xmlParsePEReference"></a>xmlParsePEReference ()</h3>
 <pre class="programlisting">void	xmlParsePEReference		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<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>
+<p>DEPRECATED: Internal function, don't use. Parse a parameter entity reference. 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 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 "standalone='yes'", ... ... 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 "standalone='no'", ... ... 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.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -1959,27 +1690,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlParseQuotedString"></a>xmlParseQuotedString ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlParseQuotedString	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>Parse and return a string between quotes or doublequotes TODO: Deprecated, to be removed at next drop of binary compatibility</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the string parser or NULL.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlParseReference"></a>xmlParseReference ()</h3>
 <pre class="programlisting">void	xmlParseReference		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
@@ -1998,7 +1708,7 @@
 <a name="xmlParseSDDecl"></a>xmlParseSDDecl ()</h3>
 <pre class="programlisting">int	xmlParseSDDecl			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<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>
+<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 attribute 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>
@@ -2008,7 +1718,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if standalone="yes" 0 if standalone="no" -2 if standalone <a href="libxml2-SAX.html#attribute">attribute</a> is missing or invalid (A standalone value of -2 means that the XML declaration was found, but no value was specified for the standalone attribute).</td>
+<td>1 if standalone="yes" 0 if standalone="no" -2 if standalone attribute is missing or invalid (A standalone value of -2 means that the XML declaration was found, but no value was specified for the standalone attribute).</td>
 </tr>
 </tbody>
 </table></div>
@@ -2019,7 +1729,7 @@
 <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: 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>
+<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 attribute 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 attribute 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>
@@ -2133,22 +1843,7 @@
 <a name="xmlParserHandlePEReference"></a>xmlParserHandlePEReference ()</h3>
 <pre class="programlisting">void	xmlParserHandlePEReference	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<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>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the parser context</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlParserHandleReference"></a>xmlParserHandleReference ()</h3>
-<pre class="programlisting">void	xmlParserHandleReference	(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>TODO: Remove, now deprecated ... the test is done directly in the content parsing routines. [67] Reference ::= EntityRef | CharRef [68] EntityRef ::= '&amp;' Name ';' [ WFC: Entity Declared ] 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. [ WFC: Parsed Entity ] An entity <a href="libxml2-SAX.html#reference">reference</a> must not contain the name of an unparsed entity [66] CharRef ::= '&amp;#' [0-9]+ ';' | '&amp;#x' [0-9a-fA-F]+ ';' 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</p>
+<p>DEPRECATED: Internal function, do not use. [69] PEReference ::= '%' Name ';' [ 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 "standalone='yes'", ... ... 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 "standalone='no'", ... ... 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</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -2178,7 +1873,7 @@
 <a name="xmlPopInput"></a>xmlPopInput ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a>	xmlPopInput			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>xmlPopInput: the current input pointed by ctxt-&gt;input came to an end pop it and return the next char.</p>
+<p>DEPRECATED: Internal function, don't use.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2199,7 +1894,7 @@
 <a name="xmlPushInput"></a>xmlPushInput ()</h3>
 <pre class="programlisting">int	xmlPushInput			(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> input)<br>
 </pre>
-<p>Push an input stream onto the stack.</p>
+<p>DEPRECATED: Internal function, don't use. Push an input stream onto the stack.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2221,42 +1916,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlScanName"></a>xmlScanName ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlScanName		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
-</pre>
-<p>Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references. TODO: seems deprecated now, only used in the default part of <a href="libxml2-parserInternals.html#xmlParserHandleReference">xmlParserHandleReference</a> [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar | Extender [5] Name ::= (Letter | '_' | ':') (NameChar)* [6] Names ::= Name (S Name)*</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XML parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the Name parsed or NULL</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlSetEntityReferenceFunc"></a>xmlSetEntityReferenceFunc ()</h3>
-<pre class="programlisting">void	xmlSetEntityReferenceFunc	(<a href="libxml2-parserInternals.html#xmlEntityReferenceFunc">xmlEntityReferenceFunc</a> func)<br>
-</pre>
-<p>Set the function to call call back when a xml <a href="libxml2-SAX.html#reference">reference</a> has been made</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>func</tt></i>:</span></td>
-<td>A valid function</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlSkipBlankChars"></a>xmlSkipBlankChars ()</h3>
 <pre class="programlisting">int	xmlSkipBlankChars		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
@@ -2281,7 +1940,7 @@
 <a name="xmlSplitQName"></a>xmlSplitQName ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlSplitQName		(<a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** prefixOut)<br>
 </pre>
-<p>parse an UTF8 encoded XML qualified name string [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName</p>
+<p>DEPRECATED: Don't use. parse an UTF8 encoded XML qualified name string [NS 5] QName ::= (Prefix ':')? LocalPart [NS 6] Prefix ::= NCName [NS 7] LocalPart ::= NCName</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/devhelp/libxml2-pattern.html b/doc/devhelp/libxml2-pattern.html
index 332ca7b..c4ddb14 100644
--- a/doc/devhelp/libxml2-pattern.html
+++ b/doc/devhelp/libxml2-pattern.html
@@ -400,7 +400,7 @@
 <a name="xmlStreamPushAttr"></a>xmlStreamPushAttr ()</h3>
 <pre class="programlisting">int	xmlStreamPushAttr		(<a href="libxml2-pattern.html#xmlStreamCtxtPtr">xmlStreamCtxtPtr</a> stream, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ns)<br>
 </pre>
-<p>Push new <a href="libxml2-SAX.html#attribute">attribute</a> data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an attribute-node.</p>
+<p>Push new attribute data onto the stream. NOTE: if the call xmlPatterncompile() indicated a dictionary, then strings for name and ns will be expected to come from the dictionary. Both @name and @ns being NULL means the / i.e. the root of the document. This can also act as a reset. Otherwise the function will act as if it has been given an attribute-node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/devhelp/libxml2-relaxng.html b/doc/devhelp/libxml2-relaxng.html
index 7a01a4d..e71e25b 100644
--- a/doc/devhelp/libxml2-relaxng.html
+++ b/doc/devhelp/libxml2-relaxng.html
@@ -46,6 +46,7 @@
 <a href="libxml2-relaxng.html#xmlRelaxNGPtr">xmlRelaxNGPtr</a>	<a href="#xmlRelaxNGParse">xmlRelaxNGParse</a>		(<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt);
 void	<a href="#xmlRelaxNGSetParserErrors">xmlRelaxNGSetParserErrors</a>	(<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br>					 <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br>					 void * ctx);
 void	<a href="#xmlRelaxNGSetParserStructuredErrors">xmlRelaxNGSetParserStructuredErrors</a>	(<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
+void	<a href="#xmlRelaxNGSetResourceLoader">xmlRelaxNGSetResourceLoader</a>	(<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * vctxt);
 void	<a href="#xmlRelaxNGSetValidErrors">xmlRelaxNGSetValidErrors</a>	(<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br>					 <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br>					 void * ctx);
 void	<a href="#xmlRelaxNGSetValidStructuredErrors">xmlRelaxNGSetValidStructuredErrors</a>	(<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
 int	<a href="#xmlRelaxNGValidateDoc">xmlRelaxNGValidateDoc</a>		(<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
@@ -568,6 +569,31 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlRelaxNGSetResourceLoader"></a>xmlRelaxNGSetResourceLoader ()</h3>
+<pre class="programlisting">void	xmlRelaxNGSetResourceLoader	(<a href="libxml2-relaxng.html#xmlRelaxNGParserCtxtPtr">xmlRelaxNGParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * vctxt)<br>
+</pre>
+<p>Set the callback function used to load external resources.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>a Relax-NG parser context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>loader</tt></i>:</span></td>
+<td>the callback</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
+<td>contextual data for the callbacks</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlRelaxNGSetValidErrors"></a>xmlRelaxNGSetValidErrors ()</h3>
 <pre class="programlisting">void	xmlRelaxNGSetValidErrors	(<a href="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr">xmlRelaxNGValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc">xmlRelaxNGValidityErrorFunc</a> err, <br>					 <a href="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc">xmlRelaxNGValidityWarningFunc</a> warn, <br>					 void * ctx)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-schemasInternals.html b/doc/devhelp/libxml2-schemasInternals.html
index 8c45bdf..579b4b5 100644
--- a/doc/devhelp/libxml2-schemasInternals.html
+++ b/doc/devhelp/libxml2-schemasInternals.html
@@ -154,7 +154,7 @@
 <a name="XML_SCHEMAS_ANYATTR_SKIP">Macro </a>XML_SCHEMAS_ANYATTR_SKIP</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ANYATTR_SKIP">XML_SCHEMAS_ANYATTR_SKIP</a>;
 </pre>
-<p>Skip unknown <a href="libxml2-SAX.html#attribute">attribute</a> from validation Obsolete, not used anymore.</p>
+<p>Skip unknown attribute from validation Obsolete, not used anymore.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -178,7 +178,7 @@
 <a name="XML_SCHEMAS_ANY_SKIP">Macro </a>XML_SCHEMAS_ANY_SKIP</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ANY_SKIP">XML_SCHEMAS_ANY_SKIP</a>;
 </pre>
-<p>Skip unknown <a href="libxml2-SAX.html#attribute">attribute</a> from validation</p>
+<p>Skip unknown attribute from validation</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -194,7 +194,7 @@
 <a name="XML_SCHEMAS_ATTRGROUP_GLOBAL">Macro </a>XML_SCHEMAS_ATTRGROUP_GLOBAL</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ATTRGROUP_GLOBAL">XML_SCHEMAS_ATTRGROUP_GLOBAL</a>;
 </pre>
-<p>The <a href="libxml2-SAX.html#attribute">attribute</a> group has been defined.</p>
+<p>The attribute group has been defined.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -226,7 +226,7 @@
 <a name="XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED">Macro </a>XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED">XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED</a>;
 </pre>
-<p>The <a href="libxml2-SAX.html#attribute">attribute</a> wildcard has been built.</p>
+<p>The attribute wildcard has been built.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -234,7 +234,7 @@
 <a name="XML_SCHEMAS_ATTR_FIXED">Macro </a>XML_SCHEMAS_ATTR_FIXED</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ATTR_FIXED">XML_SCHEMAS_ATTR_FIXED</a>;
 </pre>
-<p>the <a href="libxml2-SAX.html#attribute">attribute</a> has a fixed value</p>
+<p>the attribute has a fixed value</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -266,7 +266,7 @@
 <a name="XML_SCHEMAS_ATTR_USE_OPTIONAL">Macro </a>XML_SCHEMAS_ATTR_USE_OPTIONAL</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ATTR_USE_OPTIONAL">XML_SCHEMAS_ATTR_USE_OPTIONAL</a>;
 </pre>
-<p>The <a href="libxml2-SAX.html#attribute">attribute</a> is optional.</p>
+<p>The attribute is optional.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -274,7 +274,7 @@
 <a name="XML_SCHEMAS_ATTR_USE_PROHIBITED">Macro </a>XML_SCHEMAS_ATTR_USE_PROHIBITED</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ATTR_USE_PROHIBITED">XML_SCHEMAS_ATTR_USE_PROHIBITED</a>;
 </pre>
-<p>Used by wildcards. The <a href="libxml2-SAX.html#attribute">attribute</a> is prohibited.</p>
+<p>Used by wildcards. The attribute is prohibited.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -282,7 +282,7 @@
 <a name="XML_SCHEMAS_ATTR_USE_REQUIRED">Macro </a>XML_SCHEMAS_ATTR_USE_REQUIRED</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ATTR_USE_REQUIRED">XML_SCHEMAS_ATTR_USE_REQUIRED</a>;
 </pre>
-<p>The <a href="libxml2-SAX.html#attribute">attribute</a> is required.</p>
+<p>The attribute is required.</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -322,7 +322,7 @@
 <a name="XML_SCHEMAS_ELEM_BLOCK_ABSENT">Macro </a>XML_SCHEMAS_ELEM_BLOCK_ABSENT</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ELEM_BLOCK_ABSENT">XML_SCHEMAS_ELEM_BLOCK_ABSENT</a>;
 </pre>
-<p>the "block" <a href="libxml2-SAX.html#attribute">attribute</a> is absent</p>
+<p>the "block" attribute is absent</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -442,7 +442,7 @@
 <a name="XML_SCHEMAS_ELEM_REF">Macro </a>XML_SCHEMAS_ELEM_REF</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_ELEM_REF">XML_SCHEMAS_ELEM_REF</a>;
 </pre>
-<p>the element is a <a href="libxml2-SAX.html#reference">reference</a> to a type</p>
+<p>the element is a reference to a type</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -722,7 +722,7 @@
 <a name="XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD">Macro </a>XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD</h3>
 <pre class="programlisting">#define <a href="#XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD">XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD</a>;
 </pre>
-<p>the complexType owns an <a href="libxml2-SAX.html#attribute">attribute</a> wildcard, i.e. it can be freed by the complexType</p>
+<p>the complexType owns an attribute wildcard, i.e. it can be freed by the complexType</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -802,7 +802,7 @@
 <a name="xmlSchemaAnnot">Structure </a>xmlSchemaAnnot</h3>
 <pre class="programlisting">struct _xmlSchemaAnnot {
     struct _xmlSchemaAnnot *	next
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	content	: the annotation
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	content
 } xmlSchemaAnnot;
 </pre>
 <p></p>
@@ -821,24 +821,24 @@
 <a name="xmlSchemaAttribute">Structure </a>xmlSchemaAttribute</h3>
 <pre class="programlisting">struct _xmlSchemaAttribute {
     <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
-    struct _xmlSchemaAttribute *	next	: the next <a href="libxml2-SAX.html#attribute">attribute</a> (not used?)
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the name of the declaration
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	typeName	: the local name of the type definition
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	typeNs	: the ns URI of the type definition
+    struct _xmlSchemaAttribute *	next
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	typeName
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	typeNs
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	base	: Deprecated; not used
-    int	occurs	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	defValue	: The initial value of the value constraint
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	subtypes	: the type definition
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	base
+    int	occurs
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	defValue
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	subtypes
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace
     int	flags
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix	: Deprecated; not used
-    <a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a>	defVal	: The compiled value constraint
-    <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	refDecl	: Deprecated; not used
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix
+    <a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a>	defVal
+    <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	refDecl
 } xmlSchemaAttribute;
 </pre>
 <p></p>
@@ -848,19 +848,19 @@
 <h3>
 <a name="xmlSchemaAttributeGroup">Structure </a>xmlSchemaAttributeGroup</h3>
 <pre class="programlisting">struct _xmlSchemaAttributeGroup {
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type	: The kind of type
-    struct _xmlSchemaAttribute *	next	: the next <a href="libxml2-SAX.html#attribute">attribute</a> if in a group ...
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
+    struct _xmlSchemaAttribute *	next
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs	: Deprecated; not used
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
-    <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	attributes	: Deprecated; not used
+    <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	attributes
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
     int	flags
     <a href="libxml2-schemasInternals.html#xmlSchemaWildcardPtr">xmlSchemaWildcardPtr</a>	attributeWildcard
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix	: Deprecated; not used
-    <a href="libxml2-schemasInternals.html#xmlSchemaAttributeGroupPtr">xmlSchemaAttributeGroupPtr</a>	refItem	: Deprecated; not used
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix
+    <a href="libxml2-schemasInternals.html#xmlSchemaAttributeGroupPtr">xmlSchemaAttributeGroupPtr</a>	refItem
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace
     void *	attrUses
 } xmlSchemaAttributeGroup;
@@ -880,8 +880,8 @@
 <h3>
 <a name="xmlSchemaAttributeLink">Structure </a>xmlSchemaAttributeLink</h3>
 <pre class="programlisting">struct _xmlSchemaAttributeLink {
-    struct _xmlSchemaAttributeLink *	next	: the next <a href="libxml2-SAX.html#attribute">attribute</a> link ...
-    struct _xmlSchemaAttribute *	attr	: the linked <a href="libxml2-SAX.html#attribute">attribute</a>
+    struct _xmlSchemaAttributeLink *	next
+    struct _xmlSchemaAttribute *	attr
 } xmlSchemaAttributeLink;
 </pre>
 <p></p>
@@ -924,18 +924,18 @@
 <h3>
 <a name="xmlSchemaElement">Structure </a>xmlSchemaElement</h3>
 <pre class="programlisting">struct _xmlSchemaElement {
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type	: The kind of type
-    struct _xmlSchemaType *	next	: Not used?
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
+    struct _xmlSchemaType *	next
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs	: Deprecated; not used
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	subtypes	: the type definition
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	subtypes
     <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	attributes
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
-    int	minOccurs	: Deprecated; not used
-    int	maxOccurs	: Deprecated; not used
+    int	minOccurs
+    int	maxOccurs
     int	flags
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	namedType
@@ -943,13 +943,13 @@
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	substGroup
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	substGroupNs
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	scope
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value	: The original value of the value constraint.
-    struct _xmlSchemaElement *	refDecl	: This will now be used for the substitution group affiliation
-    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	contModel	: Obsolete for WXS, maybe used for RelaxNG
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value
+    struct _xmlSchemaElement *	refDecl
+    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	contModel
     <a href="libxml2-schemasInternals.html#xmlSchemaContentType">xmlSchemaContentType</a>	contentType
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix	: Deprecated; not used
-    <a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a>	defVal	: The compiled value constraint.
-    void *	idcs	: The identity-constraint defs
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix
+    <a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a>	defVal
+    void *	idcs
 } xmlSchemaElement;
 </pre>
 <p></p>
@@ -967,16 +967,16 @@
 <h3>
 <a name="xmlSchemaFacet">Structure </a>xmlSchemaFacet</h3>
 <pre class="programlisting">struct _xmlSchemaFacet {
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type	: The kind of type
-    struct _xmlSchemaFacet *	next	: the next type if in a sequence ...
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value	: The original value
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Obsolete
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
+    struct _xmlSchemaFacet *	next
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
-    int	fixed	: XML_SCHEMAS_FACET_PRESERVE, etc.
+    int	fixed
     int	whitespace
-    <a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a>	val	: The compiled value
-    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	regexp	: The regex for patterns
+    <a href="libxml2-schemasInternals.html#xmlSchemaValPtr">xmlSchemaValPtr</a>	val
+    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	regexp
 } xmlSchemaFacet;
 </pre>
 <p></p>
@@ -986,8 +986,8 @@
 <h3>
 <a name="xmlSchemaFacetLink">Structure </a>xmlSchemaFacetLink</h3>
 <pre class="programlisting">struct _xmlSchemaFacetLink {
-    struct _xmlSchemaFacetLink *	next	: the next facet link ...
-    <a href="libxml2-schemasInternals.html#xmlSchemaFacetPtr">xmlSchemaFacetPtr</a>	facet	: the linked facet
+    struct _xmlSchemaFacetLink *	next
+    <a href="libxml2-schemasInternals.html#xmlSchemaFacetPtr">xmlSchemaFacetPtr</a>	facet
 } xmlSchemaFacetLink;
 </pre>
 <p></p>
@@ -1013,7 +1013,7 @@
 <h3>
 <a name="xmlSchemaNotation">Structure </a>xmlSchemaNotation</h3>
 <pre class="programlisting">struct _xmlSchemaNotation {
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type	: The kind of type
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	identifier
@@ -1035,34 +1035,34 @@
 <h3>
 <a name="xmlSchemaType">Structure </a>xmlSchemaType</h3>
 <pre class="programlisting">struct _xmlSchemaType {
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type	: The kind of type
-    struct _xmlSchemaType *	next	: the next type if in a sequence ...
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
+    struct _xmlSchemaType *	next
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref	: Deprecated; not used
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs	: Deprecated; not used
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ref
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refNs
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
     <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	subtypes
-    <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	attributes	: Deprecated; not used
+    <a href="libxml2-schemasInternals.html#xmlSchemaAttributePtr">xmlSchemaAttributePtr</a>	attributes
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
-    int	minOccurs	: Deprecated; not used
-    int	maxOccurs	: Deprecated; not used
+    int	minOccurs
+    int	maxOccurs
     int	flags
     <a href="libxml2-schemasInternals.html#xmlSchemaContentType">xmlSchemaContentType</a>	contentType
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	base	: Base type's local name
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	baseNs	: Base type's target namespace
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	baseType	: The base type component
-    <a href="libxml2-schemasInternals.html#xmlSchemaFacetPtr">xmlSchemaFacetPtr</a>	facets	: Local facets
-    struct _xmlSchemaType *	redef	: Deprecated; not used
-    int	recurse	: Obsolete
-    <a href="libxml2-schemasInternals.html#xmlSchemaAttributeLinkPtr">xmlSchemaAttributeLinkPtr</a> *	attributeUses	: Deprecated; not used
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	base
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	baseNs
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	baseType
+    <a href="libxml2-schemasInternals.html#xmlSchemaFacetPtr">xmlSchemaFacetPtr</a>	facets
+    struct _xmlSchemaType *	redef
+    int	recurse
+    <a href="libxml2-schemasInternals.html#xmlSchemaAttributeLinkPtr">xmlSchemaAttributeLinkPtr</a> *	attributeUses
     <a href="libxml2-schemasInternals.html#xmlSchemaWildcardPtr">xmlSchemaWildcardPtr</a>	attributeWildcard
-    int	builtInType	: Type of built-in types.
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeLinkPtr">xmlSchemaTypeLinkPtr</a>	memberTypes	: member-types if a union type.
-    <a href="libxml2-schemasInternals.html#xmlSchemaFacetLinkPtr">xmlSchemaFacetLinkPtr</a>	facetSet	: All facets (incl. inherited)
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix	: Deprecated; not used
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	contentTypeDef	: Used for the simple content of complex types. Could we use @subtypes
-    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	contModel	: Holds the automaton of the content model
+    int	builtInType
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeLinkPtr">xmlSchemaTypeLinkPtr</a>	memberTypes
+    <a href="libxml2-schemasInternals.html#xmlSchemaFacetLinkPtr">xmlSchemaFacetLinkPtr</a>	facetSet
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	refPrefix
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	contentTypeDef
+    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	contModel
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace
     void *	attrUses
 } xmlSchemaType;
@@ -1074,8 +1074,8 @@
 <h3>
 <a name="xmlSchemaTypeLink">Structure </a>xmlSchemaTypeLink</h3>
 <pre class="programlisting">struct _xmlSchemaTypeLink {
-    struct _xmlSchemaTypeLink *	next	: the next type link ...
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	type	: the linked type
+    struct _xmlSchemaTypeLink *	next
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypePtr">xmlSchemaTypePtr</a>	type
 } xmlSchemaTypeLink;
 </pre>
 <p></p>
@@ -1224,16 +1224,16 @@
 <h3>
 <a name="xmlSchemaWildcard">Structure </a>xmlSchemaWildcard</h3>
 <pre class="programlisting">struct _xmlSchemaWildcard {
-    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type	: The kind of type
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Deprecated; not used
+    <a href="libxml2-schemasInternals.html#xmlSchemaTypeType">xmlSchemaTypeType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
     <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
-    int	minOccurs	: Deprecated; not used
-    int	maxOccurs	: Deprecated; not used
+    int	minOccurs
+    int	maxOccurs
     int	processContents
-    int	any	: Indicates if the ns constraint is of ##any
-    <a href="libxml2-schemasInternals.html#xmlSchemaWildcardNsPtr">xmlSchemaWildcardNsPtr</a>	nsSet	: The list of allowed namespaces
-    <a href="libxml2-schemasInternals.html#xmlSchemaWildcardNsPtr">xmlSchemaWildcardNsPtr</a>	negNsSet	: The negated namespace
+    int	any
+    <a href="libxml2-schemasInternals.html#xmlSchemaWildcardNsPtr">xmlSchemaWildcardNsPtr</a>	nsSet
+    <a href="libxml2-schemasInternals.html#xmlSchemaWildcardNsPtr">xmlSchemaWildcardNsPtr</a>	negNsSet
     int	flags
 } xmlSchemaWildcard;
 </pre>
@@ -1244,8 +1244,8 @@
 <h3>
 <a name="xmlSchemaWildcardNs">Structure </a>xmlSchemaWildcardNs</h3>
 <pre class="programlisting">struct _xmlSchemaWildcardNs {
-    struct _xmlSchemaWildcardNs *	next	: the next constraint link ...
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value	: the value
+    struct _xmlSchemaWildcardNs *	next
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value
 } xmlSchemaWildcardNs;
 </pre>
 <p></p>
diff --git a/doc/devhelp/libxml2-threads.html b/doc/devhelp/libxml2-threads.html
index 6efceb7..691d63d 100644
--- a/doc/devhelp/libxml2-threads.html
+++ b/doc/devhelp/libxml2-threads.html
@@ -30,9 +30,7 @@
 void	<a href="#xmlCleanupThreads">xmlCleanupThreads</a>		(void);
 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);
-int	<a href="#xmlGetThreadId">xmlGetThreadId</a>			(void);
 void	<a href="#xmlInitThreads">xmlInitThreads</a>			(void);
-int	<a href="#xmlIsMainThread">xmlIsMainThread</a>			(void);
 void	<a href="#xmlLockLibrary">xmlLockLibrary</a>			(void);
 void	<a href="#xmlMutexLock">xmlMutexLock</a>			(<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
 void	<a href="#xmlMutexUnlock">xmlMutexUnlock</a>			(<a href="libxml2-threads.html#xmlMutexPtr">xmlMutexPtr</a> tok);
@@ -93,7 +91,7 @@
 <col align="left">
 <tbody><tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 on success or -1 if a memory allocation failed. A failed allocation signals a typically fatal and irrecoverable out-of-memory situation. Don't call any library functions in this case. This function never fails if the library is compiled with support for thread-local storage. This function never fails for the "main" thread which is the first thread calling <a href="libxml2-parser.html#xmlInitParser">xmlInitParser</a>. Available since v2.12.0.</td>
+<td>0 on success or -1 if a memory allocation failed. A failed allocation signals a typically fatal and irrecoverable out-of-memory situation. Don't call any library functions in this case. Available since 2.12.0.</td>
 </tr></tbody>
 </table></div>
 </div>
@@ -138,21 +136,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlGetThreadId"></a>xmlGetThreadId ()</h3>
-<pre class="programlisting">int	xmlGetThreadId			(void)<br>
-</pre>
-<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>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the current thread ID number</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlInitThreads"></a>xmlInitThreads ()</h3>
 <pre class="programlisting">void	xmlInitThreads			(void)<br>
 </pre>
@@ -161,21 +144,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlIsMainThread"></a>xmlIsMainThread ()</h3>
-<pre class="programlisting">int	xmlIsMainThread			(void)<br>
-</pre>
-<p>DEPRECATED: Internal function, do not use. Check whether the current thread is the main thread.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if the current thread is the main thread, 0 otherwise</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlLockLibrary"></a>xmlLockLibrary ()</h3>
 <pre class="programlisting">void	xmlLockLibrary			(void)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-tree.html b/doc/devhelp/libxml2-tree.html
index 814163a..3400e1f 100644
--- a/doc/devhelp/libxml2-tree.html
+++ b/doc/devhelp/libxml2-tree.html
@@ -22,14 +22,15 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">#define <a href="#BASE_BUFFER_SIZE">BASE_BUFFER_SIZE</a>;
-#define <a href="#LIBXML2_NEW_BUFFER">LIBXML2_NEW_BUFFER</a>;
+<pre class="synopsis">#define <a href="#LIBXML2_NEW_BUFFER">LIBXML2_NEW_BUFFER</a>;
 #define <a href="#XML_GET_CONTENT">XML_GET_CONTENT</a>;
 #define <a href="#XML_GET_LINE">XML_GET_LINE</a>;
 #define <a href="#XML_LOCAL_NAMESPACE">XML_LOCAL_NAMESPACE</a>;
 #define <a href="#XML_XML_ID">XML_XML_ID</a>;
 #define <a href="#XML_XML_NAMESPACE">XML_XML_NAMESPACE</a>;
+#define <a href="#xmlBufferAllocScheme">xmlBufferAllocScheme</a>;
 #define <a href="#xmlChildrenNode">xmlChildrenNode</a>;
+#define <a href="#xmlDefaultBufferSize">xmlDefaultBufferSize</a>;
 #define <a href="#xmlRootNode">xmlRootNode</a>;
 typedef struct _xmlAttr <a href="#xmlAttr">xmlAttr</a>;
 typedef <a href="libxml2-tree.html#xmlAttr">xmlAttr</a> * <a href="#xmlAttrPtr">xmlAttrPtr</a>;
@@ -188,7 +189,6 @@
 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlNewDocText">xmlNewDocText</a>		(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content);
 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlNewDocTextLen">xmlNewDocTextLen</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content, <br>					 int len);
 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a>	<a href="#xmlNewDtd">xmlNewDtd</a>		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ExternalID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID);
-<a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a>	<a href="#xmlNewGlobalNs">xmlNewGlobalNs</a>		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * href, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix);
 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlNewNode">xmlNewNode</a>		(<a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlNewNodeEatName">xmlNewNodeEatName</a>	(<a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a>	<a href="#xmlNewNs">xmlNewNs</a>		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * href, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix);
@@ -249,8 +249,6 @@
 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlStringLenGetNodeList">xmlStringLenGetNodeList</a>	(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value, <br>					 int len);
 int	<a href="#xmlTextConcat">xmlTextConcat</a>			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content, <br>					 int len);
 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlTextMerge">xmlTextMerge</a>		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> first, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> second);
-<a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a>	<a href="#xmlThrDefBufferAllocScheme">xmlThrDefBufferAllocScheme</a>	(<a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> v);
-int	<a href="#xmlThrDefDefaultBufferSize">xmlThrDefDefaultBufferSize</a>	(int v);
 <a href="libxml2-tree.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a>	<a href="#xmlThrDefDeregisterNodeDefault">xmlThrDefDeregisterNodeDefault</a>	(<a href="libxml2-tree.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a> func);
 <a href="libxml2-tree.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a>	<a href="#xmlThrDefRegisterNodeDefault">xmlThrDefRegisterNodeDefault</a>	(<a href="libxml2-tree.html#xmlRegisterNodeFunc">xmlRegisterNodeFunc</a> func);
 void	<a href="#xmlUnlinkNode">xmlUnlinkNode</a>			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur);
@@ -268,14 +266,6 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
-<a name="BASE_BUFFER_SIZE">Macro </a>BASE_BUFFER_SIZE</h3>
-<pre class="programlisting">#define <a href="#BASE_BUFFER_SIZE">BASE_BUFFER_SIZE</a>;
-</pre>
-<p>default buffer size 4000.</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="LIBXML2_NEW_BUFFER">Macro </a>LIBXML2_NEW_BUFFER</h3>
 <pre class="programlisting">#define <a href="#LIBXML2_NEW_BUFFER">LIBXML2_NEW_BUFFER</a>;
 </pre>
@@ -311,7 +301,7 @@
 <a name="XML_XML_ID">Macro </a>XML_XML_ID</h3>
 <pre class="programlisting">#define <a href="#XML_XML_ID">XML_XML_ID</a>;
 </pre>
-<p>This is the name for the special xml:id <a href="libxml2-SAX.html#attribute">attribute</a></p>
+<p>This is the name for the special xml:id attribute</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -324,6 +314,14 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlBufferAllocScheme">Macro </a>xmlBufferAllocScheme</h3>
+<pre class="programlisting">#define <a href="#xmlBufferAllocScheme">xmlBufferAllocScheme</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlChildrenNode">Macro </a>xmlChildrenNode</h3>
 <pre class="programlisting">#define <a href="#xmlChildrenNode">xmlChildrenNode</a>;
 </pre>
@@ -332,6 +330,14 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlDefaultBufferSize">Macro </a>xmlDefaultBufferSize</h3>
+<pre class="programlisting">#define <a href="#xmlDefaultBufferSize">xmlDefaultBufferSize</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlRootNode">Macro </a>xmlRootNode</h3>
 <pre class="programlisting">#define <a href="#xmlRootNode">xmlRootNode</a>;
 </pre>
@@ -342,19 +348,19 @@
 <h3>
 <a name="xmlAttr">Structure </a>xmlAttr</h3>
 <pre class="programlisting">struct _xmlAttr {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: XML_ATTRIBUTE_NODE, must be second !
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the name of the property
-    struct _xmlNode *	children	: the value of the property
-    struct _xmlNode *	last	: NULL
-    struct _xmlNode *	parent	: child-&gt;parent link
-    struct _xmlAttr *	next	: next sibling link
-    struct _xmlAttr *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: the containing document
-    <a href="libxml2-tree.html#xmlNs">xmlNs</a> *	ns	: pointer to the associated namespace
-    <a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a>	atype	: the <a href="libxml2-SAX.html#attribute">attribute</a> type if validating
-    void *	psvi	: for type/PSVI information
-    struct _xmlID *	id	: the ID struct
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlNode *	parent
+    struct _xmlAttr *	next
+    struct _xmlAttr *	prev
+    struct _xmlDoc *	doc
+    <a href="libxml2-tree.html#xmlNs">xmlNs</a> *	ns
+    <a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a>	atype
+    void *	psvi
+    struct _xmlID *	id
 } xmlAttr;
 </pre>
 <p></p>
@@ -372,22 +378,22 @@
 <h3>
 <a name="xmlAttribute">Structure </a>xmlAttribute</h3>
 <pre class="programlisting">struct _xmlAttribute {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: XML_ATTRIBUTE_DECL, must be second !
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Attribute name
-    struct _xmlNode *	children	: NULL
-    struct _xmlNode *	last	: NULL
-    struct _xmlDtd *	parent	: -&gt; DTD
-    struct _xmlNode *	next	: next sibling link
-    struct _xmlNode *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: the containing document
-    struct _xmlAttribute *	nexth	: next in hash table
-    <a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a>	atype	: The <a href="libxml2-SAX.html#attribute">attribute</a> type
-    <a href="libxml2-tree.html#xmlAttributeDefault">xmlAttributeDefault</a>	def	: the default
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	defaultValue	: or the default value
-    <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a>	tree	: or the enumeration tree if any
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix	: the namespace prefix if any
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	elem	: Element holding the <a href="libxml2-SAX.html#attribute">attribute</a>
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlDtd *	parent
+    struct _xmlNode *	next
+    struct _xmlNode *	prev
+    struct _xmlDoc *	doc
+    struct _xmlAttribute *	nexth
+    <a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a>	atype
+    <a href="libxml2-tree.html#xmlAttributeDefault">xmlAttributeDefault</a>	def
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	defaultValue
+    <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a>	tree
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	elem
 } xmlAttribute;
 </pre>
 <p></p>
@@ -455,11 +461,11 @@
 <h3>
 <a name="xmlBuffer">Structure </a>xmlBuffer</h3>
 <pre class="programlisting">struct _xmlBuffer {
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	content	: The buffer content UTF8
-    unsigned int	use	: The buffer size used
-    unsigned int	size	: The buffer size
-    <a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a>	alloc	: The realloc method
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	contentIO	: in IO mode we may have a different base
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	content
+    unsigned int	use
+    unsigned int	size
+    <a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a>	alloc
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	contentIO
 } xmlBuffer;
 </pre>
 <p></p>
@@ -492,9 +498,9 @@
 <h3>
 <a name="xmlDOMWrapCtxt">Structure </a>xmlDOMWrapCtxt</h3>
 <pre class="programlisting">struct _xmlDOMWrapCtxt {
-    void *	_private	: * The type of this context, just in case we need specialized * context
-    int	type	: * Internal namespace map used for various operations. *
-    void *	namespaceMap	: * Use this one to acquire an <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> intended for node-&gt;ns. * (Note t
+    void *	_private
+    int	type
+    void *	namespaceMap
     <a href="libxml2-tree.html#xmlDOMWrapAcquireNsFunction">xmlDOMWrapAcquireNsFunction</a>	getNsForNodeFunc
 } xmlDOMWrapCtxt;
 </pre>
@@ -513,30 +519,30 @@
 <h3>
 <a name="xmlDoc">Structure </a>xmlDoc</h3>
 <pre class="programlisting">struct _xmlDoc {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: XML_DOCUMENT_NODE, must be second !
-    char *	name	: name/filename/URI of the document
-    struct _xmlNode *	children	: the document tree
-    struct _xmlNode *	last	: last child link
-    struct _xmlNode *	parent	: child-&gt;parent link
-    struct _xmlNode *	next	: next sibling link
-    struct _xmlNode *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: autoreference to itself End of common part
-    int	compression	: level of zlib compression
-    int	standalone	: standalone document (no external refs) 1 if standalone="yes" 0 if sta
-    struct _xmlDtd *	intSubset	: the document internal subset
-    struct _xmlDtd *	extSubset	: the document external subset
-    struct _xmlNs *	oldNs	: Global namespace, the old way
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version	: the XML version string
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	encoding	: actual encoding, if any
-    void *	ids	: Hash table for ID attributes if any
-    void *	refs	: Hash table for IDREFs attributes if any
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	URL	: The URI for that document
-    int	charset	: unused
-    struct _xmlDict *	dict	: dict used to allocate names or NULL
-    void *	psvi	: for type/PSVI information
-    int	parseFlags	: set of <a href="libxml2-parser.html#xmlParserOption">xmlParserOption</a> used to parse the document
-    int	properties	: set of <a href="libxml2-tree.html#xmlDocProperties">xmlDocProperties</a> for this document set at the end of parsing
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    char *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlNode *	parent
+    struct _xmlNode *	next
+    struct _xmlNode *	prev
+    struct _xmlDoc *	doc
+    int	compression
+    int	standalone
+    struct _xmlDtd *	intSubset
+    struct _xmlDtd *	extSubset
+    struct _xmlNs *	oldNs
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	encoding
+    void *	ids
+    void *	refs
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	URL
+    int	charset
+    struct _xmlDict *	dict
+    void *	psvi
+    int	parseFlags
+    int	properties
 } xmlDoc;
 </pre>
 <p></p>
@@ -571,22 +577,22 @@
 <h3>
 <a name="xmlDtd">Structure </a>xmlDtd</h3>
 <pre class="programlisting">struct _xmlDtd {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: XML_DTD_NODE, must be second !
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Name of the DTD
-    struct _xmlNode *	children	: the value of the property link
-    struct _xmlNode *	last	: last child link
-    struct _xmlDoc *	parent	: child-&gt;parent link
-    struct _xmlNode *	next	: next sibling link
-    struct _xmlNode *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: the containing document End of common part
-    void *	notations	: Hash table for notations if any
-    void *	elements	: Hash table for elements if any
-    void *	attributes	: Hash table for attributes if any
-    void *	entities	: Hash table for entities if any
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ExternalID	: External identifier for PUBLIC DTD
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	SystemID	: URI for a SYSTEM or PUBLIC DTD
-    void *	pentities	: Hash table for param entities if any
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlDoc *	parent
+    struct _xmlNode *	next
+    struct _xmlNode *	prev
+    struct _xmlDoc *	doc
+    void *	notations
+    void *	elements
+    void *	attributes
+    void *	entities
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ExternalID
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	SystemID
+    void *	pentities
 } xmlDtd;
 </pre>
 <p></p>
@@ -604,20 +610,20 @@
 <h3>
 <a name="xmlElement">Structure </a>xmlElement</h3>
 <pre class="programlisting">struct _xmlElement {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: XML_ELEMENT_DECL, must be second !
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Element name
-    struct _xmlNode *	children	: NULL
-    struct _xmlNode *	last	: NULL
-    struct _xmlDtd *	parent	: -&gt; DTD
-    struct _xmlNode *	next	: next sibling link
-    struct _xmlNode *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: the containing document
-    <a href="libxml2-tree.html#xmlElementTypeVal">xmlElementTypeVal</a>	etype	: The type
-    <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	content	: the allowed element content
-    <a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a>	attributes	: List of the declared attributes
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix	: the namespace prefix if any
-    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	contModel	: the validating regexp
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlDtd *	parent
+    struct _xmlNode *	next
+    struct _xmlNode *	prev
+    struct _xmlDoc *	doc
+    <a href="libxml2-tree.html#xmlElementTypeVal">xmlElementTypeVal</a>	etype
+    <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	content
+    <a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a>	attributes
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix
+    <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a>	contModel
     void *	contModel
 } xmlElement;
 </pre>
@@ -628,13 +634,13 @@
 <h3>
 <a name="xmlElementContent">Structure </a>xmlElementContent</h3>
 <pre class="programlisting">struct _xmlElementContent {
-    <a href="libxml2-tree.html#xmlElementContentType">xmlElementContentType</a>	type	: PCDATA, ELEMENT, SEQ or OR
-    <a href="libxml2-tree.html#xmlElementContentOccur">xmlElementContentOccur</a>	ocur	: ONCE, OPT, MULT or PLUS
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Element name
-    struct _xmlElementContent *	c1	: first child
-    struct _xmlElementContent *	c2	: second child
-    struct _xmlElementContent *	parent	: parent
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix	: Namespace prefix
+    <a href="libxml2-tree.html#xmlElementContentType">xmlElementContentType</a>	type
+    <a href="libxml2-tree.html#xmlElementContentOccur">xmlElementContentOccur</a>	ocur
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlElementContent *	c1
+    struct _xmlElementContent *	c2
+    struct _xmlElementContent *	parent
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix
 } xmlElementContent;
 </pre>
 <p></p>
@@ -729,26 +735,26 @@
 <h3>
 <a name="xmlEntity">Structure </a>xmlEntity</h3>
 <pre class="programlisting">struct _xmlEntity {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: XML_ENTITY_DECL, must be second !
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Entity name
-    struct _xmlNode *	children	: First child link
-    struct _xmlNode *	last	: Last child link
-    struct _xmlDtd *	parent	: -&gt; DTD
-    struct _xmlNode *	next	: next sibling link
-    struct _xmlNode *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: the containing document
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	orig	: content without ref substitution
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	content	: content or ndata if unparsed
-    int	length	: the content length
-    <a href="libxml2-entities.html#xmlEntityType">xmlEntityType</a>	etype	: The entity type
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ExternalID	: External identifier for PUBLIC
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	SystemID	: URI for a SYSTEM or PUBLIC Entity
-    struct _xmlEntity *	nexte	: unused
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	URI	: the full URI as computed
-    int	owner	: unused
-    int	flags	: various flags
-    unsigned long	expandedSize	: expanded size
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlDtd *	parent
+    struct _xmlNode *	next
+    struct _xmlNode *	prev
+    struct _xmlDoc *	doc
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	orig
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	content
+    int	length
+    <a href="libxml2-entities.html#xmlEntityType">xmlEntityType</a>	etype
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	ExternalID
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	SystemID
+    struct _xmlEntity *	nexte
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	URI
+    int	owner
+    int	flags
+    unsigned long	expandedSize
 } xmlEntity;
 </pre>
 <p></p>
@@ -766,8 +772,8 @@
 <h3>
 <a name="xmlEnumeration">Structure </a>xmlEnumeration</h3>
 <pre class="programlisting">struct _xmlEnumeration {
-    struct _xmlEnumeration *	next	: next one
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Enumeration name
+    struct _xmlEnumeration *	next
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
 } xmlEnumeration;
 </pre>
 <p></p>
@@ -785,12 +791,12 @@
 <h3>
 <a name="xmlID">Structure </a>xmlID</h3>
 <pre class="programlisting">struct _xmlID {
-    struct _xmlID *	next	: next ID
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value	: The ID name
-    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	attr	: The <a href="libxml2-SAX.html#attribute">attribute</a> holding it
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: The <a href="libxml2-SAX.html#attribute">attribute</a> if attr is not available
-    int	lineno	: The line number if attr is not available
-    struct _xmlDoc *	doc	: The document holding the ID
+    struct _xmlID *	next
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value
+    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	attr
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    int	lineno
+    struct _xmlDoc *	doc
 } xmlID;
 </pre>
 <p></p>
@@ -808,22 +814,22 @@
 <h3>
 <a name="xmlNode">Structure </a>xmlNode</h3>
 <pre class="programlisting">struct _xmlNode {
-    void *	_private	: application data
-    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type	: type number, must be second !
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the name of the node, or the entity
-    struct _xmlNode *	children	: parent-&gt;childs link
-    struct _xmlNode *	last	: last child link
-    struct _xmlNode *	parent	: child-&gt;parent link
-    struct _xmlNode *	next	: next sibling link
-    struct _xmlNode *	prev	: previous sibling link
-    struct _xmlDoc *	doc	: the containing document End of common part
-    <a href="libxml2-tree.html#xmlNs">xmlNs</a> *	ns	: pointer to the associated namespace
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	content	: the content
-    struct _xmlAttr *	properties	: properties list
-    <a href="libxml2-tree.html#xmlNs">xmlNs</a> *	nsDef	: namespace definitions on this node
-    void *	psvi	: for type/PSVI information
-    unsigned short	line	: line number
-    unsigned short	extra	: extra data for XPath/XSLT
+    void *	_private
+    <a href="libxml2-tree.html#xmlElementType">xmlElementType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    struct _xmlNode *	children
+    struct _xmlNode *	last
+    struct _xmlNode *	parent
+    struct _xmlNode *	next
+    struct _xmlNode *	prev
+    struct _xmlDoc *	doc
+    <a href="libxml2-tree.html#xmlNs">xmlNs</a> *	ns
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	content
+    struct _xmlAttr *	properties
+    <a href="libxml2-tree.html#xmlNs">xmlNs</a> *	nsDef
+    void *	psvi
+    unsigned short	line
+    unsigned short	extra
 } xmlNode;
 </pre>
 <p></p>
@@ -841,9 +847,9 @@
 <h3>
 <a name="xmlNotation">Structure </a>xmlNotation</h3>
 <pre class="programlisting">struct _xmlNotation {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Notation name
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	PublicID	: Public identifier, if any
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	SystemID	: System identifier, if any
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	PublicID
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	SystemID
 } xmlNotation;
 </pre>
 <p></p>
@@ -861,12 +867,12 @@
 <h3>
 <a name="xmlNs">Structure </a>xmlNs</h3>
 <pre class="programlisting">struct _xmlNs {
-    struct _xmlNs *	next	: next Ns link for this node
-    <a href="libxml2-tree.html#xmlNsType">xmlNsType</a>	type	: global or local
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	href	: URL for the namespace
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix	: prefix for the namespace
-    void *	_private	: application data
-    struct _xmlDoc *	context	: normally an <a href="libxml2-tree.html#xmlDoc">xmlDoc</a>
+    struct _xmlNs *	next
+    <a href="libxml2-tree.html#xmlNsType">xmlNsType</a>	type
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	href
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	prefix
+    void *	_private
+    struct _xmlDoc *	context
 } xmlNs;
 </pre>
 <p></p>
@@ -895,10 +901,10 @@
     void *	context
     <a href="libxml2-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a>	writecallback
     <a href="libxml2-xmlIO.html#xmlOutputCloseCallback">xmlOutputCloseCallback</a>	closecallback
-    <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	encoder	: I18N conversions to UTF-8
-    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	buffer	: Local buffer encoded in UTF-8 or ISOLatin
-    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	conv	: if encoder != NULL buffer for output
-    int	written	: total number of byte written
+    <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	encoder
+    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	buffer
+    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	conv
+    int	written
     int	error
 } xmlOutputBuffer;
 </pre>
@@ -917,104 +923,108 @@
 <h3>
 <a name="xmlParserCtxt">Structure </a>xmlParserCtxt</h3>
 <pre class="programlisting">struct _xmlParserCtxt {
-    struct _xmlSAXHandler *	sax	: The SAX handler
-    void *	userData	: For SAX interface only, used by DOM build
-    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	myDoc	: the document being built
-    int	wellFormed	: is the document well formed
-    int	replaceEntities	: shall we replace entities ?
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version	: the XML version string
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	encoding	: the declared encoding, if any
-    int	standalone	: standalone document
-    int	html	: an HTML(1) document * 3 is HTML after &lt;head&gt; * 10 is HTML after &lt;body
-    <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	input	: Current input stream
-    int	inputNr	: Number of current input streams
-    int	inputMax	: Max number of input streams
-    <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> *	inputTab	: stack of inputs Node analysis stack only used for DOM building
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node	: Current parsed Node
-    int	nodeNr	: Depth of the parsing stack
-    int	nodeMax	: Max depth of the parsing stack
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> *	nodeTab	: array of nodes
-    int	record_info	: Whether node info should be kept
-    <a href="libxml2-parser.html#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>	node_seq	: info about each node parsed
-    int	errNo	: error code
-    int	hasExternalSubset	: <a href="libxml2-SAX.html#reference">reference</a> and external subset
-    int	hasPErefs	: the internal subset has PE refs
-    int	external	: unused
-    int	valid	: is the document valid
-    int	validate	: shall we try to validate ?
-    <a href="libxml2-valid.html#xmlValidCtxt">xmlValidCtxt</a>	vctxt	: The validity context
-    <a href="libxml2-parser.html#xmlParserInputState">xmlParserInputState</a>	instate	: push parser state
-    int	token	: unused
-    char *	directory	: unused Node name stack
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: Current parsed Node
-    int	nameNr	: Depth of the parsing stack
-    int	nameMax	: Max depth of the parsing stack
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * *	nameTab	: array of nodes
-    long	nbChars	: unused
-    long	checkIndex	: used by progressive parsing lookup
-    int	keepBlanks	: ugly but ...
-    int	disableSAX	: SAX callbacks are disabled
-    int	inSubset	: Parsing is in int 1/ext 2 subset
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	intSubName	: name of subset
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	extSubURI	: URI of external subset
-    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	extSubSystem	: SYSTEM ID of external subset xml:space values
-    int *	space	: Should the parser preserve spaces
-    int	spaceNr	: Depth of the parsing stack
-    int	spaceMax	: Max depth of the parsing stack
-    int *	spaceTab	: array of space infos
-    int	depth	: to prevent entity substitution loops
-    <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	entity	: unused
-    int	charset	: unused
-    int	nodelen	: Those two fields are there to
-    int	nodemem	: Speed up large node parsing
-    int	pedantic	: signal pedantic warnings
-    void *	_private	: For user data, libxml won't touch it
-    int	loadsubset	: should the external subset be loaded
-    int	linenumbers	: set line number in element content
-    void *	catalogs	: document's own catalog
-    int	recovery	: run in recovery mode
-    int	progressive	: unused
-    <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	dict	: dictionary for the parser
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * *	atts	: array for the attributes callbacks
-    int	maxatts	: the size of the array
-    int	docdict	: * pre-interned strings *
+    struct _xmlSAXHandler *	sax
+    void *	userData
+    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	myDoc
+    int	wellFormed
+    int	replaceEntities
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	encoding
+    int	standalone
+    int	html
+    <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	input
+    int	inputNr
+    int	inputMax
+    <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a> *	inputTab
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
+    int	nodeNr
+    int	nodeMax
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> *	nodeTab
+    int	record_info
+    <a href="libxml2-parser.html#xmlParserNodeInfoSeq">xmlParserNodeInfoSeq</a>	node_seq
+    int	errNo
+    int	hasExternalSubset
+    int	hasPErefs
+    int	external
+    int	valid
+    int	validate
+    <a href="libxml2-valid.html#xmlValidCtxt">xmlValidCtxt</a>	vctxt
+    <a href="libxml2-parser.html#xmlParserInputState">xmlParserInputState</a>	instate
+    int	token
+    char *	directory
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    int	nameNr
+    int	nameMax
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> **	nameTab
+    long	nbChars
+    long	checkIndex
+    int	keepBlanks
+    int	disableSAX
+    int	inSubset
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	intSubName
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	extSubURI
+    <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	extSubSystem
+    int *	space
+    int	spaceNr
+    int	spaceMax
+    int *	spaceTab
+    int	depth
+    <a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	entity
+    int	charset
+    int	nodelen
+    int	nodemem
+    int	pedantic
+    void *	_private
+    int	loadsubset
+    int	linenumbers
+    void *	catalogs
+    int	recovery
+    int	progressive
+    <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	dict
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> **	atts
+    int	maxatts
+    int	docdict
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	str_xml
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	str_xmlns
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	str_xml_ns	: * Everything below is used only by the new SAX mode *
-    int	sax2	: operating in the new SAX mode
-    int	nsNr	: the number of inherited namespaces
-    int	nsMax	: the size of the arrays
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * *	nsTab	: the array of prefix/namespace name
-    unsigned *	attallocs	: which <a href="libxml2-SAX.html#attribute">attribute</a> were allocated
-    <a href="libxml2-parser.html#xmlStartTag">xmlStartTag</a> *	pushTab	: array of data for push
-    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	attsDefault	: defaulted attributes if any
-    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	attsSpecial	: non-CDATA attributes if any
-    int	nsWellFormed	: is the document XML Namespace okay
-    int	options	: * Those fields are needed only for streaming parsing so far *
-    int	dictNames	: Use dictionary names for the tree
-    int	freeElemsNr	: number of freed element nodes
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	freeElems	: List of freed element nodes
-    int	freeAttrsNr	: number of freed attributes nodes
-    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	freeAttrs	: * the complete error information for the last error. *
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	str_xml_ns
+    int	sax2
+    int	nsNr
+    int	nsMax
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> **	nsTab
+    unsigned *	attallocs
+    <a href="libxml2-parser.html#xmlStartTag">xmlStartTag</a> *	pushTab
+    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	attsDefault
+    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	attsSpecial
+    int	nsWellFormed
+    int	options
+    int	dictNames
+    int	freeElemsNr
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	freeElems
+    int	freeAttrsNr
+    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	freeAttrs
     <a href="libxml2-xmlerror.html#xmlError">xmlError</a>	lastError
-    <a href="libxml2-parser.html#xmlParserMode">xmlParserMode</a>	parseMode	: the parser mode
-    unsigned long	nbentities	: unused
-    unsigned long	sizeentities	: size of external 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
-    int	nodeInfoMax	: Max depth of the parsing stack
-    <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
-    unsigned	maxAmpl	: maximum amplification factor
-    <a href="libxml2-parser.html#xmlParserNsData">xmlParserNsData</a> *	nsdb	: namespace database
-    unsigned	attrHashMax	: allocated size
-    <a href="libxml2-parser.html#xmlAttrHashBucket">xmlAttrHashBucket</a> *	attrHash	: atttribute hash table
+    <a href="libxml2-parser.html#xmlParserMode">xmlParserMode</a>	parseMode
+    unsigned long	nbentities
+    unsigned long	sizeentities
+    <a href="libxml2-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a> *	nodeInfo
+    int	nodeInfoNr
+    int	nodeInfoMax
+    <a href="libxml2-parser.html#xmlParserNodeInfo">xmlParserNodeInfo</a> *	nodeInfoTab
+    int	input_id
+    unsigned long	sizeentcopy
+    int	endCheckState
+    unsigned short	nbErrors
+    unsigned short	nbWarnings
+    unsigned	maxAmpl
+    <a href="libxml2-parser.html#xmlParserNsData">xmlParserNsData</a> *	nsdb
+    unsigned	attrHashMax
+    <a href="libxml2-parser.html#xmlAttrHashBucket">xmlAttrHashBucket</a> *	attrHash
     <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a>	errorHandler
     void *	errorCtxt
+    <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a>	resourceLoader
+    void *	resourceCtxt
+    <a href="libxml2-encoding.html#xmlCharEncConvImpl">xmlCharEncConvImpl</a>	convImpl
+    void *	convCtxt
 } xmlParserCtxt;
 </pre>
 <p></p>
@@ -1032,23 +1042,23 @@
 <h3>
 <a name="xmlParserInput">Structure </a>xmlParserInput</h3>
 <pre class="programlisting">struct _xmlParserInput {
-    <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	buf	: UTF-8 encoded buffer
-    const char *	filename	: The file analyzed, if any
-    const char *	directory	: unused
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	base	: Base of the array to parse
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	cur	: Current char being parsed
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	end	: end of the array to parse
-    int	length	: unused
-    int	line	: Current line
-    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	: unused
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version	: the version string for entity
-    int	flags	: Flags
-    int	id	: an unique identifier for the entity
-    unsigned long	parentConsumed	: unused
-    <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	entity	: entity, if any
+    <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	buf
+    const char *	filename
+    const char *	directory
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	base
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	cur
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	end
+    int	length
+    int	line
+    int	col
+    unsigned long	consumed
+    <a href="libxml2-parser.html#xmlParserInputDeallocate">xmlParserInputDeallocate</a>	free
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	encoding
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version
+    int	flags
+    int	id
+    unsigned long	parentConsumed
+    <a href="libxml2-tree.html#xmlEntityPtr">xmlEntityPtr</a>	entity
 } xmlParserInput;
 </pre>
 <p></p>
@@ -1061,12 +1071,12 @@
     void *	context
     <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a>	readcallback
     <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a>	closecallback
-    <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	encoder	: I18N conversions to UTF-8
-    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	buffer	: Local buffer encoded in UTF-8
-    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	raw	: if encoder != NULL buffer for raw input
-    int	compressed	: -1=unknown, 0=not compressed, 1=compressed
+    <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a>	encoder
+    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	buffer
+    <a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a>	raw
+    int	compressed
     int	error
-    unsigned long	rawconsumed	: amount consumed from raw
+    unsigned long	rawconsumed
 } xmlParserInputBuffer;
 </pre>
 <p></p>
@@ -1092,11 +1102,11 @@
 <h3>
 <a name="xmlRef">Structure </a>xmlRef</h3>
 <pre class="programlisting">struct _xmlRef {
-    struct _xmlRef *	next	: next Ref
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value	: The Ref name
-    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	attr	: The <a href="libxml2-SAX.html#attribute">attribute</a> holding it
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: The <a href="libxml2-SAX.html#attribute">attribute</a> if attr is not available
-    int	lineno	: The line number if attr is not available
+    struct _xmlRef *	next
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	value
+    <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	attr
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    int	lineno
 } xmlRef;
 </pre>
 <p></p>
@@ -1127,7 +1137,7 @@
     <a href="libxml2-parser.html#unparsedEntityDeclSAXFunc">unparsedEntityDeclSAXFunc</a>	unparsedEntityDecl
     <a href="libxml2-parser.html#setDocumentLocatorSAXFunc">setDocumentLocatorSAXFunc</a>	setDocumentLocator
     <a href="libxml2-parser.html#startDocumentSAXFunc">startDocumentSAXFunc</a>	startDocument
-    <a href="libxml2-parser.html#endDocumentSAXFunc">endDocumentSAXFunc</a>	endDocument	: * `startElement` and `endElement` are only used by the legacy SAX1 * i
+    <a href="libxml2-parser.html#endDocumentSAXFunc">endDocumentSAXFunc</a>	endDocument
     <a href="libxml2-parser.html#startElementSAXFunc">startElementSAXFunc</a>	startElement
     <a href="libxml2-parser.html#endElementSAXFunc">endElementSAXFunc</a>	endElement
     <a href="libxml2-parser.html#referenceSAXFunc">referenceSAXFunc</a>	reference
@@ -1137,11 +1147,11 @@
     <a href="libxml2-parser.html#commentSAXFunc">commentSAXFunc</a>	comment
     <a href="libxml2-parser.html#warningSAXFunc">warningSAXFunc</a>	warning
     <a href="libxml2-parser.html#errorSAXFunc">errorSAXFunc</a>	error
-    <a href="libxml2-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a>	fatalError	: unused error() get all the errors
+    <a href="libxml2-parser.html#fatalErrorSAXFunc">fatalErrorSAXFunc</a>	fatalError
     <a href="libxml2-parser.html#getParameterEntitySAXFunc">getParameterEntitySAXFunc</a>	getParameterEntity
     <a href="libxml2-parser.html#cdataBlockSAXFunc">cdataBlockSAXFunc</a>	cdataBlock
-    <a href="libxml2-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a>	externalSubset	: * `initialized` should always be set to <a href="libxml2-parser.html#XML_SAX2_MAGIC">XML_SAX2_MAGIC</a> to enable the *
-    unsigned int	initialized	: * The following members are only used by the SAX2 interface. *
+    <a href="libxml2-parser.html#externalSubsetSAXFunc">externalSubsetSAXFunc</a>	externalSubset
+    unsigned int	initialized
     void *	_private
     <a href="libxml2-parser.html#startElementNsSAX2Func">startElementNsSAX2Func</a>	startElementNs
     <a href="libxml2-parser.html#endElementNsSAX2Func">endElementNsSAX2Func</a>	endElementNs
@@ -1248,7 +1258,7 @@
 <a name="xmlAddChild"></a>xmlAddChild ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlAddChild		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> parent, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br>
 </pre>
-<p>Unlink @cur and append it to the children of @parent. If @cur is a text node, it may be merged with an adjacent text node and freed. In this case the text node containing the merged content is returned. If @cur is an <a href="libxml2-SAX.html#attribute">attribute</a> node, it is appended to the attributes of @parent. If the <a href="libxml2-SAX.html#attribute">attribute</a> list contains an <a href="libxml2-SAX.html#attribute">attribute</a> with a name matching @elem, the old <a href="libxml2-SAX.html#attribute">attribute</a> is destroyed. General notes: Move operations like <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> can cause element or <a href="libxml2-SAX.html#attribute">attribute</a> nodes to <a href="libxml2-SAX.html#reference">reference</a> namespaces that aren't declared in one of their ancestors. This can lead to use-after-free errors if the elements containing the declarations are freed later, especially when moving nodes from one document to another. You should consider calling <a href="libxml2-tree.html#xmlReconciliateNs">xmlReconciliateNs</a> after a move operation to normalize namespaces. Another option is to call <a href="libxml2-tree.html#xmlDOMWrapAdoptNode">xmlDOMWrapAdoptNode</a> with the target parent before moving a node. For the most part, move operations don't check whether the resulting tree structure is valid. Users must make sure that parent nodes only receive children of valid types. Inserted child nodes must never be an ancestor of the parent node to avoid cycles in the tree structure. In general, only document, document fragments, elements and attributes should be used as parent nodes. When moving a node between documents and a memory allocation fails, the node's content will be corrupted and it will be unlinked. In this case, the node must be freed manually. Moving DTDs between documents isn't supported.</p>
+<p>Unlink @cur and append it to the children of @parent. If @cur is a text node, it may be merged with an adjacent text node and freed. In this case the text node containing the merged content is returned. If @cur is an attribute node, it is appended to the attributes of @parent. If the attribute list contains an attribute with a name matching @cur, the old attribute is destroyed. General notes: Move operations like <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> can cause element or attribute nodes to reference namespaces that aren't declared in one of their ancestors. This can lead to use-after-free errors if the elements containing the declarations are freed later, especially when moving nodes from one document to another. You should consider calling <a href="libxml2-tree.html#xmlReconciliateNs">xmlReconciliateNs</a> after a move operation to normalize namespaces. Another option is to call <a href="libxml2-tree.html#xmlDOMWrapAdoptNode">xmlDOMWrapAdoptNode</a> with the target parent before moving a node. For the most part, move operations don't check whether the resulting tree structure is valid. Users must make sure that parent nodes only receive children of valid types. Inserted child nodes must never be an ancestor of the parent node to avoid cycles in the tree structure. In general, only document, document fragments, elements and attributes should be used as parent nodes. When moving a node between documents and a memory allocation fails, the node's content will be corrupted and it will be unlinked. In this case, the node must be freed manually. Moving DTDs between documents isn't supported.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1262,7 +1272,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>@elem or a sibling if @elem was merged. Returns NULL if arguments are invalid or a memory allocation failed.</td>
+<td>@cur or a sibling if @cur was merged. Returns NULL if arguments are invalid or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1298,7 +1308,7 @@
 <a name="xmlAddNextSibling"></a>xmlAddNextSibling ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlAddNextSibling	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> prev, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br>
 </pre>
-<p>Unlinks @cur and inserts it as next sibling after @prev. Unlike <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> this function does not merge text nodes. If @cur is an <a href="libxml2-SAX.html#attribute">attribute</a> node, it is inserted after <a href="libxml2-SAX.html#attribute">attribute</a> @prev. If the <a href="libxml2-SAX.html#attribute">attribute</a> list contains an <a href="libxml2-SAX.html#attribute">attribute</a> with a name matching @cur, the old <a href="libxml2-SAX.html#attribute">attribute</a> is destroyed. See the notes in <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a>.</p>
+<p>Unlinks @cur and inserts it as next sibling after @prev. Unlike <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> this function does not merge text nodes. If @cur is an attribute node, it is inserted after attribute @prev. If the attribute list contains an attribute with a name matching @cur, the old attribute is destroyed. See the notes in <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1323,7 +1333,7 @@
 <a name="xmlAddPrevSibling"></a>xmlAddPrevSibling ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlAddPrevSibling	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> next, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br>
 </pre>
-<p>Unlinks @cur and inserts it as previous sibling before @next. Unlike <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> this function does not merge text nodes. If @cur is an <a href="libxml2-SAX.html#attribute">attribute</a> node, it is inserted before <a href="libxml2-SAX.html#attribute">attribute</a> @next. If the <a href="libxml2-SAX.html#attribute">attribute</a> list contains an <a href="libxml2-SAX.html#attribute">attribute</a> with a name matching @cur, the old <a href="libxml2-SAX.html#attribute">attribute</a> is destroyed. See the notes in <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a>.</p>
+<p>Unlinks @cur and inserts it as previous sibling before @next. Unlike <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> this function does not merge text nodes. If @cur is an attribute node, it is inserted before attribute @next. If the attribute list contains an attribute with a name matching @cur, the old attribute is destroyed. See the notes in <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1348,7 +1358,7 @@
 <a name="xmlAddSibling"></a>xmlAddSibling ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlAddSibling		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br>
 </pre>
-<p>Unlinks @cur and inserts it as last sibling of @node. If @cur is a text node, it may be merged with an adjacent text node and freed. In this case the text node containing the merged content is returned. If @cur is an <a href="libxml2-SAX.html#attribute">attribute</a> node, it is appended to the <a href="libxml2-SAX.html#attribute">attribute</a> list containing @node. If the <a href="libxml2-SAX.html#attribute">attribute</a> list contains an <a href="libxml2-SAX.html#attribute">attribute</a> with a name matching @cur, the old <a href="libxml2-SAX.html#attribute">attribute</a> is destroyed. See the notes in <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a>.</p>
+<p>Unlinks @cur and inserts it as last sibling of @node. If @cur is a text node, it may be merged with an adjacent text node and freed. In this case the text node containing the merged content is returned. If @cur is an attribute node, it is appended to the attribute list containing @node. If the attribute list contains an attribute with a name matching @cur, the old attribute is destroyed. See the notes in <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1373,7 +1383,7 @@
 <a name="xmlAttrSerializeTxtContent"></a>xmlAttrSerializeTxtContent ()</h3>
 <pre class="programlisting">void	xmlAttrSerializeTxtContent	(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * string)<br>
 </pre>
-<p>Serialize text <a href="libxml2-SAX.html#attribute">attribute</a> values to an xml simple buffer</p>
+<p>Serialize text attribute values to an xml simple buffer</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1387,7 +1397,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> node</td>
+<td>the attribute node</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>string</tt></i>:</span></td>
@@ -1507,7 +1517,7 @@
 <a name="xmlBufShrink"></a>xmlBufShrink ()</h3>
 <pre class="programlisting">size_t	xmlBufShrink			(<a href="libxml2-tree.html#xmlBufPtr">xmlBufPtr</a> buf, <br>					 size_t len)<br>
 </pre>
-<p>Remove the beginning of an XML buffer. NOTE that this routine behaviour differs from xmlBufferShrink() as it will return 0 on error instead of -1 due to size_t being used as the return type.</p>
+<p>DEPRECATED: Don't use. Remove the beginning of an XML buffer. NOTE that this routine behaviour differs from xmlBufferShrink() as it will return 0 on error instead of -1 due to size_t being used as the return type.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1571,7 +1581,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 successful, a positive error code number otherwise and -1 in case of internal or API error.</td>
+<td>a <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1600,7 +1610,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 successful, a positive error code number otherwise and -1 in case of internal or API error.</td>
+<td>a <a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a> code.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1819,7 +1829,7 @@
 <a name="xmlBufferGrow"></a>xmlBufferGrow ()</h3>
 <pre class="programlisting">int	xmlBufferGrow			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 unsigned int len)<br>
 </pre>
-<p>Grow the available space of an XML buffer.</p>
+<p>DEPRECATED: Don't use. Grow the available space of an XML buffer.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1865,7 +1875,7 @@
 <a name="xmlBufferResize"></a>xmlBufferResize ()</h3>
 <pre class="programlisting">int	xmlBufferResize			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 unsigned int size)<br>
 </pre>
-<p>Resize a buffer to accommodate minimum size of @size.</p>
+<p>DEPRECATED: Don't use. Resize a buffer to accommodate minimum size of @size.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1890,7 +1900,7 @@
 <a name="xmlBufferSetAllocationScheme"></a>xmlBufferSetAllocationScheme ()</h3>
 <pre class="programlisting">void	xmlBufferSetAllocationScheme	(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> scheme)<br>
 </pre>
-<p>Sets the allocation scheme for this buffer</p>
+<p>Sets the allocation scheme for this buffer. For libxml2 before 2.14, it is recommended to set this to XML_BUFFER_ALLOC_DOUBLE_IT. Has no effect on 2.14 or later.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1911,7 +1921,7 @@
 <a name="xmlBufferShrink"></a>xmlBufferShrink ()</h3>
 <pre class="programlisting">int	xmlBufferShrink			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 unsigned int len)<br>
 </pre>
-<p>Remove the beginning of an XML buffer.</p>
+<p>DEPRECATED: Don't use. Remove the beginning of an XML buffer.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2187,22 +2197,21 @@
 <a name="xmlCopyProp"></a>xmlCopyProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlCopyProp		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> target, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)<br>
 </pre>
-<p>Create a copy of the <a href="libxml2-SAX.html#attribute">attribute</a>. This function sets the parent pointer of the copy to @target but doesn't set the <a href="libxml2-SAX.html#attribute">attribute</a> on the target element. Users should consider to set the <a href="libxml2-SAX.html#attribute">attribute</a> by calling <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> afterwards or reset the parent pointer to NULL.</p>
+<p>Create a copy of the attribute. This function sets the parent pointer of the copy to @target but doesn't set the attribute on the target element. Users should consider to set the attribute by calling <a href="libxml2-tree.html#xmlAddChild">xmlAddChild</a> afterwards or reset the parent pointer to NULL.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>target</tt></i>:</span></td>
-<td>the element where the <a href="libxml2-SAX.html#attribute">attribute</a> will be grafted</td>
+<td>the element where the attribute will be grafted</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the copied <a href="libxml2-SAX.html#attribute">attribute</a> or NULL if a memory allocation failed.</td>
+<td>the copied attribute or NULL if a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -2213,7 +2222,7 @@
 <a name="xmlCopyPropList"></a>xmlCopyPropList ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlCopyPropList		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> target, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)<br>
 </pre>
-<p>Create a copy of an <a href="libxml2-SAX.html#attribute">attribute</a> list. This function sets the parent pointers of the copied attributes to @target but doesn't set the attributes on the target element.</p>
+<p>Create a copy of an attribute list. This function sets the parent pointers of the copied attributes to @target but doesn't set the attributes on the target element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2223,8 +2232,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the first <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the first attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -2272,7 +2280,7 @@
 <a name="xmlDOMWrapAdoptNode"></a>xmlDOMWrapAdoptNode ()</h3>
 <pre class="programlisting">int	xmlDOMWrapAdoptNode		(<a href="libxml2-tree.html#xmlDOMWrapCtxtPtr">xmlDOMWrapCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> sourceDoc, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> destDoc, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> destParent, <br>					 int options)<br>
 </pre>
-<p>References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc-&gt;oldNs entries are used This is the case when you have an unlinked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in <a href="libxml2-SAX.html#attribute">attribute</a> values or element content. NOTE: This function was not intensively tested.</p>
+<p>References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc-&gt;oldNs entries are used This is the case when you have an unlinked node and just want to move it to the context of If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2313,7 +2321,7 @@
 <a name="xmlDOMWrapCloneNode"></a>xmlDOMWrapCloneNode ()</h3>
 <pre class="programlisting">int	xmlDOMWrapCloneNode		(<a href="libxml2-tree.html#xmlDOMWrapCtxtPtr">xmlDOMWrapCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> sourceDoc, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> * resNode, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> destDoc, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> destParent, <br>					 int deep, <br>					 int options)<br>
 </pre>
-<p>References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc-&gt;oldNs entries are used. This is the case when you don't know already where the cloned branch will be added to. If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in <a href="libxml2-SAX.html#attribute">attribute</a> values or element content. TODO: 1) What to do with XInclude? Currently this returns an error for XInclude.</p>
+<p>References of out-of scope ns-decls are remapped to point to @destDoc: 1) If @destParent is given, then nsDef entries on element-nodes are used 2) If *no* @destParent is given, then @destDoc-&gt;oldNs entries are used. This is the case when you don't know already where the cloned branch will be added to. If @destParent is given, it ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. TODO: 1) What to do with XInclude? Currently this returns an error for XInclude.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2392,7 +2400,7 @@
 <a name="xmlDOMWrapReconcileNamespaces"></a>xmlDOMWrapReconcileNamespaces ()</h3>
 <pre class="programlisting">int	xmlDOMWrapReconcileNamespaces	(<a href="libxml2-tree.html#xmlDOMWrapCtxtPtr">xmlDOMWrapCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem, <br>					 int options)<br>
 </pre>
-<p>Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in <a href="libxml2-SAX.html#attribute">attribute</a> values or element content. NOTE: This function was not intensively tested.</p>
+<p>Ensures that ns-references point to ns-decls hold on element-nodes. Ensures that the tree is namespace wellformed by creating additional ns-decls where needed. Note that, since prefixes of already existent ns-decls can be shadowed by this process, it could break QNames in attribute values or element content. NOTE: This function was not intensively tested.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2881,13 +2889,12 @@
 <a name="xmlFreeProp"></a>xmlFreeProp ()</h3>
 <pre class="programlisting">void	xmlFreeProp			(<a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)<br>
 </pre>
-<p>Free an <a href="libxml2-SAX.html#attribute">attribute</a> including all children.</p>
+<p>Free an attribute including all children.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>an attribute</td>
 </tr></tbody>
 </table></div>
 </div>
@@ -2897,12 +2904,12 @@
 <a name="xmlFreePropList"></a>xmlFreePropList ()</h3>
 <pre class="programlisting">void	xmlFreePropList			(<a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)<br>
 </pre>
-<p>Free an <a href="libxml2-SAX.html#attribute">attribute</a> list including all children.</p>
+<p>Free an attribute list including all children.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the first <a href="libxml2-SAX.html#attribute">attribute</a> in the list</td>
+<td>the first attribute in the list</td>
 </tr></tbody>
 </table></div>
 </div>
@@ -2912,7 +2919,7 @@
 <a name="xmlGetBufferAllocationScheme"></a>xmlGetBufferAllocationScheme ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a>	xmlGetBufferAllocationScheme	(void)<br>
 </pre>
-<p>Types are <a href="libxml2-tree.html#XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> - use exact sizes, keeps memory usage down <a href="libxml2-tree.html#XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> - double buffer when extra needed, improves performance <a href="libxml2-tree.html#XML_BUFFER_ALLOC_HYBRID">XML_BUFFER_ALLOC_HYBRID</a> - use exact sizes on small strings to keep memory usage tight in normal usage, and doubleit on large strings to avoid pathological performance.</p>
+<p>DEPRECATED: Use <a href="libxml2-tree.html#xmlBufferSetAllocationScheme">xmlBufferSetAllocationScheme</a>. Types are <a href="libxml2-tree.html#XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> - use exact sizes, keeps memory usage down <a href="libxml2-tree.html#XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> - double buffer when extra needed, improves performance <a href="libxml2-tree.html#XML_BUFFER_ALLOC_HYBRID">XML_BUFFER_ALLOC_HYBRID</a> - use exact sizes on small strings to keep memory usage tight in normal usage, and doubleit on large strings to avoid pathological performance.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -3026,7 +3033,7 @@
 <a name="xmlGetNoNsProp"></a>xmlGetNoNsProp ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlGetNoNsProp		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Search and get the value of an <a href="libxml2-SAX.html#attribute">attribute</a> associated to a node This does the entity substitution. This function looks in DTD <a href="libxml2-SAX.html#attribute">attribute</a> declaration for #FIXED or default declaration values. This function is similar to <a href="libxml2-tree.html#xmlGetProp">xmlGetProp</a> except it will accept only an <a href="libxml2-SAX.html#attribute">attribute</a> in no namespace. NOTE: This function doesn't allow to distinguish malloc failures from missing attributes. It's more robust to use <a href="libxml2-tree.html#xmlNodeGetAttrValue">xmlNodeGetAttrValue</a>.</p>
+<p>Search and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values. This function is similar to <a href="libxml2-tree.html#xmlGetProp">xmlGetProp</a> except it will accept only an attribute in no namespace. NOTE: This function doesn't allow to distinguish malloc failures from missing attributes. It's more robust to use <a href="libxml2-tree.html#xmlNodeGetAttrValue">xmlNodeGetAttrValue</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3036,11 +3043,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value or NULL if not found or a memory allocation failed. It's up to the caller to free the memory with xmlFree().</td>
+<td>the attribute value or NULL if not found or a memory allocation failed. It's up to the caller to free the memory with xmlFree().</td>
 </tr>
 </tbody>
 </table></div>
@@ -3126,7 +3133,7 @@
 <a name="xmlGetNsProp"></a>xmlGetNsProp ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlGetNsProp		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * nameSpace)<br>
 </pre>
-<p>Search and get the value of an <a href="libxml2-SAX.html#attribute">attribute</a> associated to a node This <a href="libxml2-SAX.html#attribute">attribute</a> has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD <a href="libxml2-SAX.html#attribute">attribute</a> declaration for #FIXED or default declaration values. NOTE: This function doesn't allow to distinguish malloc failures from missing attributes. It's more robust to use <a href="libxml2-tree.html#xmlNodeGetAttrValue">xmlNodeGetAttrValue</a>.</p>
+<p>Search and get the value of an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values. NOTE: This function doesn't allow to distinguish malloc failures from missing attributes. It's more robust to use <a href="libxml2-tree.html#xmlNodeGetAttrValue">xmlNodeGetAttrValue</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3136,7 +3143,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>nameSpace</tt></i>:</span></td>
@@ -3144,7 +3151,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value or NULL if not found or a memory allocation failed. It's up to the caller to free the memory with xmlFree().</td>
+<td>the attribute value or NULL if not found or a memory allocation failed. It's up to the caller to free the memory with xmlFree().</td>
 </tr>
 </tbody>
 </table></div>
@@ -3155,7 +3162,7 @@
 <a name="xmlGetProp"></a>xmlGetProp ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlGetProp		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Search and get the value of an <a href="libxml2-SAX.html#attribute">attribute</a> associated to a node This does the entity substitution. This function looks in DTD <a href="libxml2-SAX.html#attribute">attribute</a> declaration for #FIXED or default declaration values. NOTE: This function acts independently of namespaces associated to the <a href="libxml2-SAX.html#attribute">attribute</a>. Use xmlGetNsProp() or xmlGetNoNsProp() for namespace aware processing. NOTE: This function doesn't allow to distinguish malloc failures from missing attributes. It's more robust to use <a href="libxml2-tree.html#xmlNodeGetAttrValue">xmlNodeGetAttrValue</a>.</p>
+<p>Search and get the value of an attribute associated to a node This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values. NOTE: This function acts independently of namespaces associated to the attribute. Use xmlGetNsProp() or xmlGetNoNsProp() for namespace aware processing. NOTE: This function doesn't allow to distinguish malloc failures from missing attributes. It's more robust to use <a href="libxml2-tree.html#xmlNodeGetAttrValue">xmlNodeGetAttrValue</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3165,11 +3172,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value or NULL if not found or a memory allocation failed. It's up to the caller to free the memory with xmlFree().</td>
+<td>the attribute value or NULL if not found or a memory allocation failed. It's up to the caller to free the memory with xmlFree().</td>
 </tr>
 </tbody>
 </table></div>
@@ -3180,7 +3187,7 @@
 <a name="xmlHasNsProp"></a>xmlHasNsProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlHasNsProp		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * nameSpace)<br>
 </pre>
-<p>Search for an <a href="libxml2-SAX.html#attribute">attribute</a> associated to a node This <a href="libxml2-SAX.html#attribute">attribute</a> has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD <a href="libxml2-SAX.html#attribute">attribute</a> declaration for #FIXED or default declaration values. Note that a namespace of NULL indicates to use the default namespace.</p>
+<p>Search for an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. This function looks in DTD attribute declaration for #FIXED or default declaration values. Note that a namespace of NULL indicates to use the default namespace.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3190,7 +3197,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>nameSpace</tt></i>:</span></td>
@@ -3198,7 +3205,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> or the <a href="libxml2-SAX.html#attribute">attribute</a> declaration or NULL if neither was found. Also returns NULL if a memory allocation failed making this function unreliable.</td>
+<td>the attribute or the attribute declaration or NULL if neither was found. Also returns NULL if a memory allocation failed making this function unreliable.</td>
 </tr>
 </tbody>
 </table></div>
@@ -3209,7 +3216,7 @@
 <a name="xmlHasProp"></a>xmlHasProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlHasProp		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Search an <a href="libxml2-SAX.html#attribute">attribute</a> associated to a node This function also looks in DTD <a href="libxml2-SAX.html#attribute">attribute</a> declaration for #FIXED or default declaration values.</p>
+<p>Search an attribute associated to a node This function also looks in DTD attribute declaration for #FIXED or default declaration values.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3219,11 +3226,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> or the <a href="libxml2-SAX.html#attribute">attribute</a> declaration or NULL if neither was found. Also returns NULL if a memory allocation failed making this function unreliable.</td>
+<td>the attribute or the attribute declaration or NULL if neither was found. Also returns NULL if a memory allocation failed making this function unreliable.</td>
 </tr>
 </tbody>
 </table></div>
@@ -3330,7 +3337,7 @@
 <a name="xmlNewCharRef"></a>xmlNewCharRef ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewCharRef		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>This function is MISNAMED. It doesn't create a character <a href="libxml2-SAX.html#reference">reference</a> but an entity <a href="libxml2-SAX.html#reference">reference</a>. Create an empty entity <a href="libxml2-SAX.html#reference">reference</a> node. This function doesn't attempt to look up the entity in @doc. Entity names like '&amp;entity;' are handled as well.</p>
+<p>This function is MISNAMED. It doesn't create a character reference but an entity reference. Create an empty entity reference node. This function doesn't attempt to look up the entity in @doc. Entity names like '&amp;entity;' are handled as well.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3355,7 +3362,7 @@
 <a name="xmlNewChild"></a>xmlNewChild ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewChild		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> parent, <br>					 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Create a new child element and append it to a parent element. If @ns is NULL, the newly created element inherits the namespace of the parent. If provided, @content is expected to be a valid XML <a href="libxml2-SAX.html#attribute">attribute</a> value possibly containing character and entity references. Text and entity <a href="libxml2-SAX.html#reference">reference</a> node will be added to the child element, see <a href="libxml2-tree.html#xmlNewDocNode">xmlNewDocNode</a>.</p>
+<p>Create a new child element and append it to a parent element. If @ns is NULL, the newly created element inherits the namespace of the parent. If provided, @content is expected to be a valid XML attribute value possibly containing character and entity references. Text and entity reference node will be added to the child element, see <a href="libxml2-tree.html#xmlNewDocNode">xmlNewDocNode</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3388,13 +3395,13 @@
 <a name="xmlNewComment"></a>xmlNewComment ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewComment		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Use of this function is DISCOURAGED in favor of <a href="libxml2-tree.html#xmlNewDocComment">xmlNewDocComment</a>. Create a <a href="libxml2-SAX.html#comment">comment</a> node.</p>
+<p>Use of this function is DISCOURAGED in favor of <a href="libxml2-tree.html#xmlNewDocComment">xmlNewDocComment</a>. Create a comment node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>content</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#comment">comment</a> content (optional)</td>
+<td>the comment content (optional)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -3430,7 +3437,7 @@
 <a name="xmlNewDocComment"></a>xmlNewDocComment ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewDocComment	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Create a <a href="libxml2-SAX.html#comment">comment</a> node.</p>
+<p>Create a comment node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3440,7 +3447,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>content</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#comment">comment</a> content</td>
+<td>the comment content</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -3476,7 +3483,7 @@
 <a name="xmlNewDocNode"></a>xmlNewDocNode ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewDocNode		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Create an element node. If provided, @content is expected to be a valid XML <a href="libxml2-SAX.html#attribute">attribute</a> value possibly containing character and entity references. Syntax errors and references to undeclared entities are ignored silently. Only references are handled, nested elements, comments or PIs are not. See <a href="libxml2-tree.html#xmlNewDocRawNode">xmlNewDocRawNode</a> for an alternative. General notes on object creation: Each node and all its children are associated with the same document. The document should be provided when creating nodes to avoid a performance penalty when adding the node to a document tree. Note that a document only owns nodes reachable from the root node. Unlinked subtrees must be freed manually.</p>
+<p>Create an element node. If provided, @content is expected to be a valid XML attribute value possibly containing character and entity references. Syntax errors and references to undeclared entities are ignored silently. Only references are handled, nested elements, comments or PIs are not. See <a href="libxml2-tree.html#xmlNewDocRawNode">xmlNewDocRawNode</a> for an alternative. General notes on object creation: Each node and all its children are associated with the same document. The document should be provided when creating nodes to avoid a performance penalty when adding the node to a document tree. Note that a document only owns nodes reachable from the root node. Unlinked subtrees must be freed manually.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3571,7 +3578,7 @@
 <a name="xmlNewDocProp"></a>xmlNewDocProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlNewDocProp		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>Create an <a href="libxml2-SAX.html#attribute">attribute</a> object. If provided, @value is expected to be a valid XML <a href="libxml2-SAX.html#attribute">attribute</a> value possibly containing character and entity references. Syntax errors and references to undeclared entities are ignored silently. If you want to pass a raw string, see <a href="libxml2-tree.html#xmlNewProp">xmlNewProp</a>.</p>
+<p>Create an attribute object. If provided, @value is expected to be a valid XML attribute value possibly containing character and entity references. Syntax errors and references to undeclared entities are ignored silently. If you want to pass a raw string, see <a href="libxml2-tree.html#xmlNewProp">xmlNewProp</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3581,17 +3588,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the name of the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the name of the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> value with XML references (optional)</td>
+<td>attribute value with XML references (optional)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to the <a href="libxml2-SAX.html#attribute">attribute</a> or NULL if arguments are invalid or a memory allocation failed.</td>
+<td>a pointer to the attribute or NULL if arguments are invalid or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -3719,35 +3724,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlNewGlobalNs"></a>xmlNewGlobalNs ()</h3>
-<pre class="programlisting"><a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a>	xmlNewGlobalNs		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * href, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix)<br>
-</pre>
-<p>Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>doc</tt></i>:</span></td>
-<td>the document carrying the namespace</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>href</tt></i>:</span></td>
-<td>the URI associated</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>prefix</tt></i>:</span></td>
-<td>the prefix for the namespace</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>NULL this functionality had been removed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlNewNode"></a>xmlNewNode ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewNode		(<a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
@@ -3830,7 +3806,7 @@
 <a name="xmlNewNsProp"></a>xmlNewNsProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlNewNsProp		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>Create an <a href="libxml2-SAX.html#attribute">attribute</a> object. If provided, @value should be a raw, unescaped string. If @node is provided, the created <a href="libxml2-SAX.html#attribute">attribute</a> will be appended without checking for duplicate names. It is an error if @node is not an element.</p>
+<p>Create an attribute object. If provided, @value should be a raw, unescaped string. If @node is provided, the created attribute will be appended without checking for duplicate names. It is an error if @node is not an element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3844,16 +3820,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the local name of the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the local name of the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the value of the <a href="libxml2-SAX.html#attribute">attribute</a> (optional)</td>
+<td>the value of the attribute (optional)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to the <a href="libxml2-SAX.html#attribute">attribute</a> or NULL if arguments are invalid or a memory allocation failed.</td>
+<td>a pointer to the attribute or NULL if arguments are invalid or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -3878,16 +3853,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the local name of the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the local name of the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the value of the <a href="libxml2-SAX.html#attribute">attribute</a> (optional)</td>
+<td>the value of the attribute (optional)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to the <a href="libxml2-SAX.html#attribute">attribute</a> or NULL if arguments are invalid or a memory allocation failed.</td>
+<td>a pointer to the attribute or NULL if arguments are invalid or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -3923,7 +3897,7 @@
 <a name="xmlNewProp"></a>xmlNewProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlNewProp		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>Create an <a href="libxml2-SAX.html#attribute">attribute</a> node. If provided, @value should be a raw, unescaped string. If @node is provided, the created <a href="libxml2-SAX.html#attribute">attribute</a> will be appended without checking for duplicate names. It is an error if @node is not an element.</p>
+<p>Create an attribute node. If provided, @value should be a raw, unescaped string. If @node is provided, the created attribute will be appended without checking for duplicate names. It is an error if @node is not an element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3933,16 +3907,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the name of the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the name of the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the value of the <a href="libxml2-SAX.html#attribute">attribute</a> (optional)</td>
+<td>the value of the attribute (optional)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to the <a href="libxml2-SAX.html#attribute">attribute</a> or NULL if arguments are invalid or a memory allocation failed.</td>
+<td>a pointer to the attribute or NULL if arguments are invalid or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -3953,7 +3926,7 @@
 <a name="xmlNewReference"></a>xmlNewReference ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlNewReference		(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Create a new entity <a href="libxml2-SAX.html#reference">reference</a> node, linking the result with the entity in @doc if found. Entity names like '&amp;entity;' are handled as well.</p>
+<p>Create a new entity reference node, linking the result with the entity in @doc if found. Entity names like '&amp;entity;' are handled as well.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4231,7 +4204,7 @@
 <a name="xmlNodeGetAttrValue"></a>xmlNodeGetAttrValue ()</h3>
 <pre class="programlisting">int	xmlNodeGetAttrValue		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * nsUri, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** out)<br>
 </pre>
-<p>Search and get the value of an <a href="libxml2-SAX.html#attribute">attribute</a> associated to a node This <a href="libxml2-SAX.html#attribute">attribute</a> has to be anchored in the namespace specified. This does the entity substitution. The returned value must be freed by the caller. Available since 2.13.0.</p>
+<p>Search and get the value of an attribute associated to a node This attribute has to be anchored in the namespace specified. This does the entity substitution. The returned value must be freed by the caller. Available since 2.13.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4241,7 +4214,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>nsUri</tt></i>:</span></td>
@@ -4253,7 +4226,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 on success, 1 if no <a href="libxml2-SAX.html#attribute">attribute</a> was found, -1 if a memory allocation failed.</td>
+<td>0 on success, 1 if no attribute was found, -1 if a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -4339,7 +4312,7 @@
 <a name="xmlNodeGetLang"></a>xmlNodeGetLang ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlNodeGetLang		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * cur)<br>
 </pre>
-<p>Searches the language of a node, i.e. the values of the xml:lang <a href="libxml2-SAX.html#attribute">attribute</a> or the one carried by the nearest ancestor.</p>
+<p>Searches the language of a node, i.e. the values of the xml:lang attribute or the one carried by the nearest ancestor.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4360,7 +4333,7 @@
 <a name="xmlNodeGetSpacePreserve"></a>xmlNodeGetSpacePreserve ()</h3>
 <pre class="programlisting">int	xmlNodeGetSpacePreserve		(const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * cur)<br>
 </pre>
-<p>Searches the space preserving behaviour of a node, i.e. the values of the xml:space <a href="libxml2-SAX.html#attribute">attribute</a> or the one carried by the nearest ancestor.</p>
+<p>Searches the space preserving behaviour of a node, i.e. the values of the xml:space attribute or the one carried by the nearest ancestor.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4402,7 +4375,7 @@
 <a name="xmlNodeListGetRawString"></a>xmlNodeListGetRawString ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlNodeListGetRawString	(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * list, <br>					 int inLine)<br>
 </pre>
-<p>Serializes <a href="libxml2-SAX.html#attribute">attribute</a> children (text and entity <a href="libxml2-SAX.html#reference">reference</a> nodes) into a string. An empty list produces an empty string. If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special <a href="libxml2-SAX.html#characters">characters</a> like '&amp;' will be escaped.</p>
+<p>Serializes attribute children (text and entity reference nodes) into a string. If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special characters like '&amp;' will be escaped.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4412,7 +4385,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>list</tt></i>:</span></td>
-<td>a node list of <a href="libxml2-SAX.html#attribute">attribute</a> children (optional)</td>
+<td>a node list of attribute children</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>inLine</tt></i>:</span></td>
@@ -4431,7 +4404,7 @@
 <a name="xmlNodeListGetString"></a>xmlNodeListGetString ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlNodeListGetString	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-tree.html#xmlNode">xmlNode</a> * list, <br>					 int inLine)<br>
 </pre>
-<p>Serializes <a href="libxml2-SAX.html#attribute">attribute</a> children (text and entity <a href="libxml2-SAX.html#reference">reference</a> nodes) into a string. An empty list produces an empty string. If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special <a href="libxml2-SAX.html#characters">characters</a> like '&amp;' as well as non-ASCII chars will be escaped. See <a href="libxml2-tree.html#xmlNodeListGetRawString">xmlNodeListGetRawString</a> for an alternative option.</p>
+<p>Serializes attribute children (text and entity reference nodes) into a string. If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special characters like '&amp;' as well as non-ASCII chars will be escaped. See <a href="libxml2-tree.html#xmlNodeListGetRawString">xmlNodeListGetRawString</a> for an alternative option.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4441,7 +4414,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>list</tt></i>:</span></td>
-<td>a node list of <a href="libxml2-SAX.html#attribute">attribute</a> children (optional)</td>
+<td>a node list of attribute children</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>inLine</tt></i>:</span></td>
@@ -4460,7 +4433,7 @@
 <a name="xmlNodeSetBase"></a>xmlNodeSetBase ()</h3>
 <pre class="programlisting">int	xmlNodeSetBase			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * uri)<br>
 </pre>
-<p>Set (or reset) the base URI of a node, i.e. the value of the xml:base <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Set (or reset) the base URI of a node, i.e. the value of the xml:base attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4485,7 +4458,7 @@
 <a name="xmlNodeSetContent"></a>xmlNodeSetContent ()</h3>
 <pre class="programlisting">int	xmlNodeSetContent		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Replace the text content of a node. Sets the raw text content of text, CDATA, <a href="libxml2-SAX.html#comment">comment</a> or PI nodes. For element and <a href="libxml2-SAX.html#attribute">attribute</a> nodes, removes all children and replaces them by parsing @content which is expected to be a valid XML <a href="libxml2-SAX.html#attribute">attribute</a> value possibly containing character and entity references. Syntax errors and references to undeclared entities are ignored silently. Unfortunately, there isn't an API to pass raw content directly. An inefficient work-around is to escape the content with <a href="libxml2-entities.html#xmlEncodeSpecialChars">xmlEncodeSpecialChars</a> before passing it. A better trick is clearing the old content with xmlNodeSetContent(node, NULL) first and then calling xmlNodeAddContent(node, content). Unlike this function, <a href="libxml2-tree.html#xmlNodeAddContent">xmlNodeAddContent</a> accepts raw text.</p>
+<p>Replace the text content of a node. Sets the raw text content of text, CDATA, comment or PI nodes. For element and attribute nodes, removes all children and replaces them by parsing @content which is expected to be a valid XML attribute value possibly containing character and entity references. Syntax errors and references to undeclared entities are ignored silently. Unfortunately, there isn't an API to pass raw content directly. An inefficient work-around is to escape the content with <a href="libxml2-entities.html#xmlEncodeSpecialChars">xmlEncodeSpecialChars</a> before passing it. A better trick is clearing the old content with xmlNodeSetContent(node, NULL) first and then calling xmlNodeAddContent(node, content). Unlike this function, <a href="libxml2-tree.html#xmlNodeAddContent">xmlNodeAddContent</a> accepts raw text.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4539,7 +4512,7 @@
 <a name="xmlNodeSetLang"></a>xmlNodeSetLang ()</h3>
 <pre class="programlisting">int	xmlNodeSetLang			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * lang)<br>
 </pre>
-<p>Set the language of a node, i.e. the values of the xml:lang <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Set the language of a node, i.e. the values of the xml:lang attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4585,7 +4558,7 @@
 <a name="xmlNodeSetSpacePreserve"></a>xmlNodeSetSpacePreserve ()</h3>
 <pre class="programlisting">int	xmlNodeSetSpacePreserve		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur, <br>					 int val)<br>
 </pre>
-<p>Set (or reset) the space preserving behaviour of a node, i.e. the value of the xml:space <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Set (or reset) the space preserving behaviour of a node, i.e. the value of the xml:space attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -4677,18 +4650,17 @@
 <a name="xmlRemoveProp"></a>xmlRemoveProp ()</h3>
 <pre class="programlisting">int	xmlRemoveProp			(<a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> cur)<br>
 </pre>
-<p>Unlink and free an <a href="libxml2-SAX.html#attribute">attribute</a> including all children. Note this doesn't work for namespace declarations. The <a href="libxml2-SAX.html#attribute">attribute</a> must have a non-NULL parent pointer.</p>
+<p>Unlink and free an attribute including all children. Note this doesn't work for namespace declarations. The attribute must have a non-NULL parent pointer.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>an attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 on success or -1 if the <a href="libxml2-SAX.html#attribute">attribute</a> was not found or arguments are invalid.</td>
+<td>0 on success or -1 if the attribute was not found or arguments are invalid.</td>
 </tr>
 </tbody>
 </table></div>
@@ -4960,7 +4932,7 @@
 <a name="xmlSetBufferAllocationScheme"></a>xmlSetBufferAllocationScheme ()</h3>
 <pre class="programlisting">void	xmlSetBufferAllocationScheme	(<a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> scheme)<br>
 </pre>
-<p>Set the buffer allocation method. Types are <a href="libxml2-tree.html#XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> - use exact sizes, keeps memory usage down <a href="libxml2-tree.html#XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> - double buffer when extra needed, improves performance</p>
+<p>DEPRECATED: Use <a href="libxml2-tree.html#xmlBufferSetAllocationScheme">xmlBufferSetAllocationScheme</a>. Set the buffer allocation method. Types are <a href="libxml2-tree.html#XML_BUFFER_ALLOC_EXACT">XML_BUFFER_ALLOC_EXACT</a> - use exact sizes, keeps memory usage down <a href="libxml2-tree.html#XML_BUFFER_ALLOC_DOUBLEIT">XML_BUFFER_ALLOC_DOUBLEIT</a> - double buffer when extra needed, improves performance</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -5036,7 +5008,7 @@
 <a name="xmlSetNs"></a>xmlSetNs ()</h3>
 <pre class="programlisting">void	xmlSetNs			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns)<br>
 </pre>
-<p>Set the namespace of an element or <a href="libxml2-SAX.html#attribute">attribute</a> node. Passing a NULL namespace unsets the namespace.</p>
+<p>Set the namespace of an element or attribute node. Passing a NULL namespace unsets the namespace.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5057,7 +5029,7 @@
 <a name="xmlSetNsProp"></a>xmlSetNsProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlSetNsProp		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>Set (or reset) an <a href="libxml2-SAX.html#attribute">attribute</a> carried by a node. The ns structure must be in scope, this is not checked</p>
+<p>Set (or reset) an attribute carried by a node. The ns structure must be in scope, this is not checked</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5071,15 +5043,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>the attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> pointer.</td>
+<td>the attribute pointer.</td>
 </tr>
 </tbody>
 </table></div>
@@ -5090,7 +5062,7 @@
 <a name="xmlSetProp"></a>xmlSetProp ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlSetProp		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>Set (or reset) an <a href="libxml2-SAX.html#attribute">attribute</a> carried by a node. If @name has a prefix, then the corresponding namespace-binding will be used, if in scope; it is an error it there's no such ns-binding for the prefix in scope.</p>
+<p>Set (or reset) an attribute carried by a node. If @name has a prefix, then the corresponding namespace-binding will be used, if in scope; it is an error it there's no such ns-binding for the prefix in scope.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5100,15 +5072,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name (a QName)</td>
+<td>the attribute name (a QName)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>the attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> pointer.</td>
+<td>the attribute pointer.</td>
 </tr>
 </tbody>
 </table></div>
@@ -5194,7 +5166,7 @@
 <a name="xmlStringGetNodeList"></a>xmlStringGetNodeList ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlStringGetNodeList	(const <a href="libxml2-tree.html#xmlDoc">xmlDoc</a> * doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>DEPRECATED: Use <a href="libxml2-tree.html#xmlNodeSetContent">xmlNodeSetContent</a>. Parse an <a href="libxml2-SAX.html#attribute">attribute</a> value and build a node list containing only text and entity <a href="libxml2-SAX.html#reference">reference</a> nodes. The resulting nodes will be associated with the document if provided. The document is also used to look up entities. The input is not validated. Syntax errors or references to undeclared entities will be ignored silently with unspecified results.</p>
+<p>DEPRECATED: Use <a href="libxml2-tree.html#xmlNodeSetContent">xmlNodeSetContent</a>. Parse an attribute value and build a node list containing only text and entity reference nodes. The resulting nodes will be associated with the document if provided. The document is also used to look up entities. The input is not validated. Syntax errors or references to undeclared entities will be ignored silently with unspecified results.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5204,11 +5176,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>an attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to the first child or NULL if a memory allocation failed.</td>
+<td>a pointer to the first child or NULL if the value if empty or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -5229,15 +5201,15 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>an attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>maximum length of the <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>maximum length of the attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a pointer to the first child or NULL if a memory allocation failed.</td>
+<td>a pointer to the first child or NULL if the value if empty or a memory allocation failed.</td>
 </tr>
 </tbody>
 </table></div>
@@ -5277,7 +5249,7 @@
 <a name="xmlTextMerge"></a>xmlTextMerge ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlTextMerge		(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> first, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> second)<br>
 </pre>
-<p>Merge the second text node into the first. The second node is unlinked and freed.</p>
+<p>Merge the second text node into the first. If @first is NULL, @second is returned. Otherwise, the second node is unlinked and freed.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5299,48 +5271,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlThrDefBufferAllocScheme"></a>xmlThrDefBufferAllocScheme ()</h3>
-<pre class="programlisting"><a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a>	xmlThrDefBufferAllocScheme	(<a href="libxml2-tree.html#xmlBufferAllocationScheme">xmlBufferAllocationScheme</a> v)<br>
-</pre>
-<p></p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>v</tt></i>:</span></td>
-<td></td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td></td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlThrDefDefaultBufferSize"></a>xmlThrDefDefaultBufferSize ()</h3>
-<pre class="programlisting">int	xmlThrDefDefaultBufferSize	(int v)<br>
-</pre>
-<p></p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>v</tt></i>:</span></td>
-<td></td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td></td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlThrDefDeregisterNodeDefault"></a>xmlThrDefDeregisterNodeDefault ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a>	xmlThrDefDeregisterNodeDefault	(<a href="libxml2-tree.html#xmlDeregisterNodeFunc">xmlDeregisterNodeFunc</a> func)<br>
 </pre>
@@ -5401,7 +5331,7 @@
 <a name="xmlUnsetNsProp"></a>xmlUnsetNsProp ()</h3>
 <pre class="programlisting">int	xmlUnsetNsProp			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> ns, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Remove an <a href="libxml2-SAX.html#attribute">attribute</a> carried by a node.</p>
+<p>Remove an attribute carried by a node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5415,7 +5345,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -5430,7 +5360,7 @@
 <a name="xmlUnsetProp"></a>xmlUnsetProp ()</h3>
 <pre class="programlisting">int	xmlUnsetProp			(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> node, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Remove an <a href="libxml2-SAX.html#attribute">attribute</a> carried by a node. This handles only attributes in no namespace.</p>
+<p>Remove an attribute carried by a node. This handles only attributes in no namespace.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -5440,7 +5370,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
diff --git a/doc/devhelp/libxml2-uri.html b/doc/devhelp/libxml2-uri.html
index 04f9089..f2a1005 100644
--- a/doc/devhelp/libxml2-uri.html
+++ b/doc/devhelp/libxml2-uri.html
@@ -52,17 +52,17 @@
 <h3>
 <a name="xmlURI">Structure </a>xmlURI</h3>
 <pre class="programlisting">struct _xmlURI {
-    char *	scheme	: the URI scheme
-    char *	opaque	: opaque part
-    char *	authority	: the authority part
-    char *	server	: the server part
-    char *	user	: the user part
-    int	port	: the port number
-    char *	path	: the path string
-    char *	query	: the query string (deprecated - use with caution)
-    char *	fragment	: the fragment identifier
-    int	cleanup	: parsing potentially unclean URI
-    char *	query_raw	: the query string (as it appears in the URI)
+    char *	scheme
+    char *	opaque
+    char *	authority
+    char *	server
+    char *	user
+    int	port
+    char *	path
+    char *	query
+    char *	fragment
+    int	cleanup
+    char *	query_raw
 } xmlURI;
 </pre>
 <p></p>
@@ -87,7 +87,7 @@
 <tbody>
 <tr>
 <td><span class="term"><i><tt>URI</tt></i>:</span></td>
-<td>the URI <a href="libxml2-SAX.html#reference">reference</a> under consideration</td>
+<td>the URI reference under consideration</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>base</tt></i>:</span></td>
@@ -106,13 +106,13 @@
 <a name="xmlBuildRelativeURISafe"></a>xmlBuildRelativeURISafe ()</h3>
 <pre class="programlisting">int	xmlBuildRelativeURISafe		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * base, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** valPtr)<br>
 </pre>
-<p>Expresses the URI of the <a href="libxml2-SAX.html#reference">reference</a> in terms relative to the base. Some examples of this operation include: base = "http://site1.com/docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif pic1.gif http://site2.com/docs/pic1.gif http://site2.com/docs/pic1.gif base = "docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif Note: if the URI <a href="libxml2-SAX.html#reference">reference</a> is really weird or complicated, it may be worthwhile to first convert it into a "nice" one by calling <a href="libxml2-uri.html#xmlBuildURI">xmlBuildURI</a> (using 'base') before calling this routine, since this routine (for reasonable efficiency) assumes URI has already been through some validation. Available since 2.13.0.</p>
+<p>Expresses the URI of the reference in terms relative to the base. Some examples of this operation include: base = "http://site1.com/docs/book1.html" URI input URI returned http://site1.com/docs/pic1.gif pic1.gif http://site2.com/docs/pic1.gif http://site2.com/docs/pic1.gif base = "docs/book1.html" URI input URI returned docs/pic1.gif pic1.gif docs/img/pic1.gif img/pic1.gif img/pic1.gif ../img/pic1.gif http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif Available since 2.13.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>URI</tt></i>:</span></td>
-<td>the URI <a href="libxml2-SAX.html#reference">reference</a> under consideration</td>
+<td>the URI reference under consideration</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>base</tt></i>:</span></td>
@@ -135,7 +135,7 @@
 <a name="xmlBuildURI"></a>xmlBuildURI ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlBuildURI		(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * base)<br>
 </pre>
-<p>Computes he final URI of the <a href="libxml2-SAX.html#reference">reference</a> done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396 5.2. Resolving Relative References to Absolute Form</p>
+<p>Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396 5.2. Resolving Relative References to Absolute Form</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -160,7 +160,7 @@
 <a name="xmlBuildURISafe"></a>xmlBuildURISafe ()</h3>
 <pre class="programlisting">int	xmlBuildURISafe			(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * URI, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * base, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** valPtr)<br>
 </pre>
-<p>Computes he final URI of the <a href="libxml2-SAX.html#reference">reference</a> done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396 5.2. Resolving Relative References to Absolute Form Available since 2.13.0.</p>
+<p>Computes he final URI of the reference done by checking that the given URI is valid, and building the final URI using the base URI. This is processed according to section 5.2 of the RFC 2396 5.2. Resolving Relative References to Absolute Form Available since 2.13.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -308,7 +308,7 @@
 <a name="xmlParseURIReference"></a>xmlParseURIReference ()</h3>
 <pre class="programlisting">int	xmlParseURIReference		(<a href="libxml2-uri.html#xmlURIPtr">xmlURIPtr</a> uri, <br>					 const char * str)<br>
 </pre>
-<p>Parse an URI <a href="libxml2-SAX.html#reference">reference</a> string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = URI / relative-ref</p>
+<p>Parse an URI reference string based on RFC 3986 and fills in the appropriate fields of the @uri structure URI-reference = URI / relative-ref</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -444,7 +444,7 @@
 <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 unreserved <a href="libxml2-SAX.html#characters">characters</a> a-z, A-Z, 0-9, "-._~", a few sub-delims "!*'()", the gen-delim "@" (why?) and the <a href="libxml2-SAX.html#characters">characters</a> in the exception list.</p>
+<p>This routine escapes a string to hex, ignoring unreserved characters a-z, A-Z, 0-9, "-._~", a few sub-delims "!*'()", the gen-delim "@" (why?) and the characters 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 a66eb8f..eeef7c9 100644
--- a/doc/devhelp/libxml2-valid.html
+++ b/doc/devhelp/libxml2-valid.html
@@ -88,7 +88,7 @@
 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlValidNormalizeAttributeValue">xmlValidNormalizeAttributeValue</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
 int	<a href="#xmlValidateAttributeDecl">xmlValidateAttributeDecl</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#xmlAttributePtr">xmlAttributePtr</a> attr);
 int	<a href="#xmlValidateAttributeValue">xmlValidateAttributeValue</a>	(<a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value);
-int	<a href="#xmlValidateDocument">xmlValidateDocument</a>		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
+int	<a href="#xmlValidateDocument">xmlValidateDocument</a>		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> vctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
 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);
@@ -209,22 +209,22 @@
 <h3>
 <a name="xmlValidCtxt">Structure </a>xmlValidCtxt</h3>
 <pre class="programlisting">struct _xmlValidCtxt {
-    void *	userData	: user specific data block
-    <a href="libxml2-valid.html#xmlValidityErrorFunc">xmlValidityErrorFunc</a>	error	: the callback in case of errors
-    <a href="libxml2-valid.html#xmlValidityWarningFunc">xmlValidityWarningFunc</a>	warning	: the callback in case of warning Node analysis stack used when validat
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node	: Current parsed Node
-    int	nodeNr	: Depth of the parsing stack
-    int	nodeMax	: Max depth of the parsing stack
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> *	nodeTab	: array of nodes
-    unsigned int	flags	: internal flags
-    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc	: the document
-    int	valid	: temporary validity check result state state used for non-determinist
-    <a href="libxml2-valid.html#xmlValidState">xmlValidState</a> *	vstate	: current state
-    int	vstateNr	: Depth of the validation stack
-    int	vstateMax	: Max depth of the validation stack
-    <a href="libxml2-valid.html#xmlValidState">xmlValidState</a> *	vstateTab	: array of validation states
-    <a href="libxml2-xmlautomata.html#xmlAutomataPtr">xmlAutomataPtr</a>	am	: the automata
-    <a href="libxml2-xmlautomata.html#xmlAutomataStatePtr">xmlAutomataStatePtr</a>	state	: used to build the automata
+    void *	userData
+    <a href="libxml2-valid.html#xmlValidityErrorFunc">xmlValidityErrorFunc</a>	error
+    <a href="libxml2-valid.html#xmlValidityWarningFunc">xmlValidityWarningFunc</a>	warning
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
+    int	nodeNr
+    int	nodeMax
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> *	nodeTab
+    unsigned int	flags
+    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc
+    int	valid
+    <a href="libxml2-valid.html#xmlValidState">xmlValidState</a> *	vstate
+    int	vstateNr
+    int	vstateMax
+    <a href="libxml2-valid.html#xmlValidState">xmlValidState</a> *	vstateTab
+    <a href="libxml2-xmlautomata.html#xmlAutomataPtr">xmlAutomataPtr</a>	am
+    <a href="libxml2-xmlautomata.html#xmlAutomataStatePtr">xmlAutomataStatePtr</a>	state
     void *	am
     void *	state
 } xmlValidCtxt;
@@ -313,7 +313,7 @@
 <a name="xmlAddAttributeDecl"></a>xmlAddAttributeDecl ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a>	xmlAddAttributeDecl	(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ns, <br>					 <a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br>					 <a href="libxml2-tree.html#xmlAttributeDefault">xmlAttributeDefault</a> def, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * defaultValue, <br>					 <a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> tree)<br>
 </pre>
-<p>Register a new <a href="libxml2-SAX.html#attribute">attribute</a> declaration Note that @tree becomes the ownership of the DTD</p>
+<p>DEPRECATED: Internal function, don't use. Register a new attribute declaration Note that @tree becomes the ownership of the DTD</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -331,23 +331,23 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>ns</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> namespace prefix</td>
+<td>the attribute namespace prefix</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>type</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> type</td>
+<td>the attribute type</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>def</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> default type</td>
+<td>the attribute default type</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>defaultValue</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> default value</td>
+<td>the attribute default value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>tree</tt></i>:</span></td>
@@ -355,7 +355,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>NULL if not new, otherwise the <a href="libxml2-SAX.html#attribute">attribute</a> decl</td>
+<td>NULL if not new, otherwise the attribute decl</td>
 </tr>
 </tbody>
 </table></div>
@@ -366,7 +366,7 @@
 <a name="xmlAddElementDecl"></a>xmlAddElementDecl ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlElementPtr">xmlElementPtr</a>	xmlAddElementDecl	(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 <a href="libxml2-tree.html#xmlElementTypeVal">xmlElementTypeVal</a> type, <br>					 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content)<br>
 </pre>
-<p>Register a new element declaration</p>
+<p>DEPRECATED: Internal function, don't use. Register a new element declaration</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -421,7 +421,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> holding the ID</td>
+<td>the attribute holding the ID</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -443,11 +443,11 @@
 <tbody>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> holding the ID</td>
+<td>the attribute holding the ID</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> (ID) value</td>
+<td>the attribute (ID) value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -462,7 +462,7 @@
 <a name="xmlAddNotationDecl"></a>xmlAddNotationDecl ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNotationPtr">xmlNotationPtr</a>	xmlAddNotationDecl	(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * PublicID, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * SystemID)<br>
 </pre>
-<p>Register a new notation declaration</p>
+<p>DEPRECATED: Internal function, don't use. Register a new notation declaration</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -517,7 +517,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> holding the Ref</td>
+<td>the attribute holding the Ref</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -533,13 +533,13 @@
 <a name="xmlCopyAttributeTable"></a>xmlCopyAttributeTable ()</h3>
 <pre class="programlisting"><a href="libxml2-valid.html#xmlAttributeTablePtr">xmlAttributeTablePtr</a>	xmlCopyAttributeTable	(<a href="libxml2-valid.html#xmlAttributeTablePtr">xmlAttributeTablePtr</a> table)<br>
 </pre>
-<p>Build a copy of an <a href="libxml2-SAX.html#attribute">attribute</a> table.</p>
+<p>DEPRECATED: Internal function, don't use. Build a copy of an attribute table.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>table</tt></i>:</span></td>
-<td>An <a href="libxml2-SAX.html#attribute">attribute</a> table</td>
+<td>An attribute table</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -554,7 +554,7 @@
 <a name="xmlCopyDocElementContent"></a>xmlCopyDocElementContent ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	xmlCopyDocElementContent	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>							 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> cur)<br>
 </pre>
-<p>Build a copy of an element content description.</p>
+<p>DEPRECATED: Internal function, don't use. Build a copy of an element content description.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -579,7 +579,7 @@
 <a name="xmlCopyElementContent"></a>xmlCopyElementContent ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	xmlCopyElementContent	(<a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> cur)<br>
 </pre>
-<p>Build a copy of an element content description. Deprecated, use <a href="libxml2-valid.html#xmlCopyDocElementContent">xmlCopyDocElementContent</a> instead</p>
+<p>DEPRECATED: Internal function, don't use. Build a copy of an element content description. Deprecated, use <a href="libxml2-valid.html#xmlCopyDocElementContent">xmlCopyDocElementContent</a> instead</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -600,7 +600,7 @@
 <a name="xmlCopyElementTable"></a>xmlCopyElementTable ()</h3>
 <pre class="programlisting"><a href="libxml2-valid.html#xmlElementTablePtr">xmlElementTablePtr</a>	xmlCopyElementTable	(<a href="libxml2-valid.html#xmlElementTablePtr">xmlElementTablePtr</a> table)<br>
 </pre>
-<p>Build a copy of an element table.</p>
+<p>DEPRECATED: Internal function, don't use. Build a copy of an element table.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -621,7 +621,7 @@
 <a name="xmlCopyEnumeration"></a>xmlCopyEnumeration ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a>	xmlCopyEnumeration	(<a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> cur)<br>
 </pre>
-<p>Copy an enumeration <a href="libxml2-SAX.html#attribute">attribute</a> node (recursive).</p>
+<p>DEPRECATED: Internal function, don't use. Copy an enumeration attribute node (recursive).</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -642,7 +642,7 @@
 <a name="xmlCopyNotationTable"></a>xmlCopyNotationTable ()</h3>
 <pre class="programlisting"><a href="libxml2-valid.html#xmlNotationTablePtr">xmlNotationTablePtr</a>	xmlCopyNotationTable	(<a href="libxml2-valid.html#xmlNotationTablePtr">xmlNotationTablePtr</a> table)<br>
 </pre>
-<p>Build a copy of a notation table.</p>
+<p>DEPRECATED: Internal function, don't use. Build a copy of a notation table.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -663,7 +663,7 @@
 <a name="xmlCreateEnumeration"></a>xmlCreateEnumeration ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a>	xmlCreateEnumeration	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>create and initialize an enumeration <a href="libxml2-SAX.html#attribute">attribute</a> node.</p>
+<p>DEPRECATED: Internal function, don't use. create and initialize an enumeration attribute node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -684,7 +684,7 @@
 <a name="xmlDumpAttributeDecl"></a>xmlDumpAttributeDecl ()</h3>
 <pre class="programlisting">void	xmlDumpAttributeDecl		(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a> attr)<br>
 </pre>
-<p>DEPRECATED: Use <a href="libxml2-xmlsave.html#xmlSaveTree">xmlSaveTree</a>. This will dump the content of the <a href="libxml2-SAX.html#attribute">attribute</a> declaration as an XML DTD definition</p>
+<p>DEPRECATED: Use <a href="libxml2-xmlsave.html#xmlSaveTree">xmlSaveTree</a>. This will dump the content of the attribute declaration as an XML DTD definition</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -694,7 +694,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>An <a href="libxml2-SAX.html#attribute">attribute</a> declaration</td>
+<td>An attribute declaration</td>
 </tr>
 </tbody>
 </table></div>
@@ -705,7 +705,7 @@
 <a name="xmlDumpAttributeTable"></a>xmlDumpAttributeTable ()</h3>
 <pre class="programlisting">void	xmlDumpAttributeTable		(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-valid.html#xmlAttributeTablePtr">xmlAttributeTablePtr</a> table)<br>
 </pre>
-<p>DEPRECATED: Don't use. This will dump the content of the <a href="libxml2-SAX.html#attribute">attribute</a> table as an XML DTD definition</p>
+<p>DEPRECATED: Don't use. This will dump the content of the attribute table as an XML DTD definition</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -715,7 +715,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>table</tt></i>:</span></td>
-<td>An <a href="libxml2-SAX.html#attribute">attribute</a> table</td>
+<td>An attribute table</td>
 </tr>
 </tbody>
 </table></div>
@@ -810,12 +810,12 @@
 <a name="xmlFreeAttributeTable"></a>xmlFreeAttributeTable ()</h3>
 <pre class="programlisting">void	xmlFreeAttributeTable		(<a href="libxml2-valid.html#xmlAttributeTablePtr">xmlAttributeTablePtr</a> table)<br>
 </pre>
-<p>Deallocate the memory used by an entities hash table.</p>
+<p>DEPRECATED: Internal function, don't use. Deallocate the memory used by an entities hash table.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
 <td><span class="term"><i><tt>table</tt></i>:</span></td>
-<td>An <a href="libxml2-SAX.html#attribute">attribute</a> table</td>
+<td>An attribute table</td>
 </tr></tbody>
 </table></div>
 </div>
@@ -825,7 +825,7 @@
 <a name="xmlFreeDocElementContent"></a>xmlFreeDocElementContent ()</h3>
 <pre class="programlisting">void	xmlFreeDocElementContent	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> cur)<br>
 </pre>
-<p>Free an element content structure. The whole subtree is removed.</p>
+<p>DEPRECATED: Internal function, don't use. Free an element content structure. The whole subtree is removed.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -846,7 +846,7 @@
 <a name="xmlFreeElementContent"></a>xmlFreeElementContent ()</h3>
 <pre class="programlisting">void	xmlFreeElementContent		(<a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> cur)<br>
 </pre>
-<p>Free an element content structure. The whole subtree is removed. Deprecated, use <a href="libxml2-valid.html#xmlFreeDocElementContent">xmlFreeDocElementContent</a> instead</p>
+<p>DEPRECATED: Internal function, don't use. Free an element content structure. The whole subtree is removed. Deprecated, use <a href="libxml2-valid.html#xmlFreeDocElementContent">xmlFreeDocElementContent</a> instead</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -861,7 +861,7 @@
 <a name="xmlFreeElementTable"></a>xmlFreeElementTable ()</h3>
 <pre class="programlisting">void	xmlFreeElementTable		(<a href="libxml2-valid.html#xmlElementTablePtr">xmlElementTablePtr</a> table)<br>
 </pre>
-<p>Deallocate the memory used by an element hash table.</p>
+<p>DEPRECATED: Internal function, don't use. Deallocate the memory used by an element hash table.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -876,7 +876,7 @@
 <a name="xmlFreeEnumeration"></a>xmlFreeEnumeration ()</h3>
 <pre class="programlisting">void	xmlFreeEnumeration		(<a href="libxml2-tree.html#xmlEnumerationPtr">xmlEnumerationPtr</a> cur)<br>
 </pre>
-<p>free an enumeration <a href="libxml2-SAX.html#attribute">attribute</a> node (recursive).</p>
+<p>free an enumeration attribute node (recursive).</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -906,7 +906,7 @@
 <a name="xmlFreeNotationTable"></a>xmlFreeNotationTable ()</h3>
 <pre class="programlisting">void	xmlFreeNotationTable		(<a href="libxml2-valid.html#xmlNotationTablePtr">xmlNotationTablePtr</a> table)<br>
 </pre>
-<p>Deallocate the memory used by an entities hash table.</p>
+<p>DEPRECATED: Internal function, don't use. Deallocate the memory used by an entities hash table.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -951,7 +951,7 @@
 <a name="xmlGetDtdAttrDesc"></a>xmlGetDtdAttrDesc ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a>	xmlGetDtdAttrDesc	(<a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Search the DTD for the description of this <a href="libxml2-SAX.html#attribute">attribute</a> on this element.</p>
+<p>Search the DTD for the description of this attribute on this element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -965,7 +965,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1030,7 +1030,7 @@
 <a name="xmlGetDtdQAttrDesc"></a>xmlGetDtdQAttrDesc ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttributePtr">xmlAttributePtr</a>	xmlGetDtdQAttrDesc	(<a href="libxml2-tree.html#xmlDtdPtr">xmlDtdPtr</a> dtd, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * elem, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix)<br>
 </pre>
-<p>Search the DTD for the description of this qualified <a href="libxml2-SAX.html#attribute">attribute</a> on this element.</p>
+<p>Search the DTD for the description of this qualified attribute on this element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1044,11 +1044,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>prefix</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> namespace prefix</td>
+<td>the attribute namespace prefix</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1092,7 +1092,7 @@
 <a name="xmlGetID"></a>xmlGetID ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a>	xmlGetID		(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ID)<br>
 </pre>
-<p>Search the <a href="libxml2-SAX.html#attribute">attribute</a> declaring the given ID</p>
+<p>Search the attribute declaring the given ID</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1142,7 +1142,7 @@
 <a name="xmlIsID"></a>xmlIsID ()</h3>
 <pre class="programlisting">int	xmlIsID			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr)<br>
 </pre>
-<p>Determine whether an <a href="libxml2-SAX.html#attribute">attribute</a> is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically.</p>
+<p>Determine whether an attribute is of type ID. In case we have DTD(s) then this is done if DTD loading has been requested. In the case of HTML documents parsed with the HTML parser, then ID detection is done systematically.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1152,13 +1152,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>elem</tt></i>:</span></td>
-<td>the element carrying the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the element carrying the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1198,7 +1196,7 @@
 <a name="xmlIsRef"></a>xmlIsRef ()</h3>
 <pre class="programlisting">int	xmlIsRef			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr)<br>
 </pre>
-<p>DEPRECATED, do not use. This function will be removed from the public API. Determine whether an <a href="libxml2-SAX.html#attribute">attribute</a> is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase).</p>
+<p>DEPRECATED, do not use. This function will be removed from the public API. Determine whether an attribute is of type Ref. In case we have DTD(s) then this is simple, otherwise we use an heuristic: name Ref (upper or lowercase).</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1208,13 +1206,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>elem</tt></i>:</span></td>
-<td>the element carrying the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the element carrying the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1229,7 +1225,7 @@
 <a name="xmlNewDocElementContent"></a>xmlNewDocElementContent ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	xmlNewDocElementContent	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>						 <a href="libxml2-tree.html#xmlElementContentType">xmlElementContentType</a> type)<br>
 </pre>
-<p>Allocate an element content structure for the document.</p>
+<p>DEPRECATED: Internal function, don't use. Allocate an element content structure for the document.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1258,7 +1254,7 @@
 <a name="xmlNewElementContent"></a>xmlNewElementContent ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a>	xmlNewElementContent	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>						 <a href="libxml2-tree.html#xmlElementContentType">xmlElementContentType</a> type)<br>
 </pre>
-<p>Allocate an element content structure. Deprecated in favor of <a href="libxml2-valid.html#xmlNewDocElementContent">xmlNewDocElementContent</a></p>
+<p>DEPRECATED: Internal function, don't use. Allocate an element content structure. Deprecated in favor of <a href="libxml2-valid.html#xmlNewDocElementContent">xmlNewDocElementContent</a></p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1298,7 +1294,7 @@
 <a name="xmlRemoveID"></a>xmlRemoveID ()</h3>
 <pre class="programlisting">int	xmlRemoveID			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr)<br>
 </pre>
-<p>Remove the given <a href="libxml2-SAX.html#attribute">attribute</a> from the ID table maintained internally.</p>
+<p>Remove the given attribute from the ID table maintained internally.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1308,8 +1304,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1324,7 +1319,7 @@
 <a name="xmlRemoveRef"></a>xmlRemoveRef ()</h3>
 <pre class="programlisting">int	xmlRemoveRef			(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr)<br>
 </pre>
-<p>DEPRECATED, do not use. This function will be removed from the public API. Remove the given <a href="libxml2-SAX.html#attribute">attribute</a> from the Ref table maintained internally.</p>
+<p>DEPRECATED, do not use. This function will be removed from the public API. Remove the given attribute from the Ref table maintained internally.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1334,8 +1329,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a>
-</td>
+<td>the attribute</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1350,7 +1344,7 @@
 <a name="xmlSnprintfElementContent"></a>xmlSnprintfElementContent ()</h3>
 <pre class="programlisting">void	xmlSnprintfElementContent	(char * buf, <br>					 int size, <br>					 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content, <br>					 int englob)<br>
 </pre>
-<p>This will dump the content of the element content definition Intended just for the debug routine</p>
+<p>DEPRECATED: Internal function, don't use. This will dump the content of the element content definition Intended just for the debug routine</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1379,7 +1373,7 @@
 <a name="xmlSprintfElementContent"></a>xmlSprintfElementContent ()</h3>
 <pre class="programlisting">void	xmlSprintfElementContent	(char * buf, <br>					 <a href="libxml2-tree.html#xmlElementContentPtr">xmlElementContentPtr</a> content, <br>					 int englob)<br>
 </pre>
-<p>Deprecated, unsafe, use <a href="libxml2-valid.html#xmlSnprintfElementContent">xmlSnprintfElementContent</a></p>
+<p>DEPRECATED: Internal function, don't use. Deprecated, unsafe, use <a href="libxml2-valid.html#xmlSnprintfElementContent">xmlSnprintfElementContent</a></p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1429,7 +1423,7 @@
 <a name="xmlValidCtxtNormalizeAttributeValue"></a>xmlValidCtxtNormalizeAttributeValue ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlValidCtxtNormalizeAttributeValue	(<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>							 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>							 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>DEPRECATED: Internal function, don't use. Does the validation related extra step of the normalization of <a href="libxml2-SAX.html#attribute">attribute</a> values: 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 single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt-&gt;valid accordingly</p>
+<p>DEPRECATED: Internal function, don't use. Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character. Also check VC: Standalone Document Declaration in P32, and update ctxt-&gt;valid accordingly</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1447,11 +1441,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>the attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1532,7 +1526,7 @@
 <a name="xmlValidNormalizeAttributeValue"></a>xmlValidNormalizeAttributeValue ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlValidNormalizeAttributeValue	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>DEPRECATED: Internal function, don't use. Does the validation related extra step of the normalization of <a href="libxml2-SAX.html#attribute">attribute</a> values: 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 single space (#x20) character.</p>
+<p>DEPRECATED: Internal function, don't use. Does the validation related extra step of the normalization of attribute values: If the declared value is not CDATA, then the XML processor must further process the normalized attribute value by discarding any leading and trailing space (#x20) characters, and by replacing sequences of space (#x20) characters by single space (#x20) character.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1546,11 +1540,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>the attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>the attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1565,7 +1559,7 @@
 <a name="xmlValidateAttributeDecl"></a>xmlValidateAttributeDecl ()</h3>
 <pre class="programlisting">int	xmlValidateAttributeDecl	(<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#xmlAttributePtr">xmlAttributePtr</a> attr)<br>
 </pre>
-<p>DEPRECATED: Internal function, don't use. Try to validate a single <a href="libxml2-SAX.html#attribute">attribute</a> definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] The ID/IDREF uniqueness and matching are done separately</p>
+<p>DEPRECATED: Internal function, don't use. Try to validate a single attribute definition basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Default Legal ] - [ VC: Enumeration ] - [ VC: ID Attribute Default ] The ID/IDREF uniqueness and matching are done separately</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1579,7 +1573,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> definition</td>
+<td>an attribute definition</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1594,17 +1588,17 @@
 <a name="xmlValidateAttributeValue"></a>xmlValidateAttributeValue ()</h3>
 <pre class="programlisting">int	xmlValidateAttributeValue	(<a href="libxml2-tree.html#xmlAttributeType">xmlAttributeType</a> type, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>DEPRECATED: Internal function, don't use. Validate that the given <a href="libxml2-SAX.html#attribute">attribute</a> value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
+<p>DEPRECATED: Internal function, don't use. Validate that the given attribute value match the proper production [ VC: ID ] Values of type ID must match the Name production.... [ VC: IDREF ] Values of type IDREF must match the Name production, and values of type IDREFS must match Names ... [ VC: Entity Name ] Values of type ENTITY must match the Name production, values of type ENTITIES must match Names ... [ VC: Name Token ] Values of type NMTOKEN must match the Nmtoken production; values of type NMTOKENS must match Nmtokens.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
 <td><span class="term"><i><tt>type</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> type</td>
+<td>an attribute type</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> value</td>
+<td>an attribute value</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1617,14 +1611,14 @@
 <div class="refsect2" lang="en">
 <h3>
 <a name="xmlValidateDocument"></a>xmlValidateDocument ()</h3>
-<pre class="programlisting">int	xmlValidateDocument		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
+<pre class="programlisting">int	xmlValidateDocument		(<a href="libxml2-valid.html#xmlValidCtxtPtr">xmlValidCtxtPtr</a> vctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc)<br>
 </pre>
-<p>Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</p>
+<p>DEPRECATED: This function can't report malloc or other failures. Use <a href="libxml2-parser.html#xmlCtxtValidateDocument">xmlCtxtValidateDocument</a>. Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
 <tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td><span class="term"><i><tt>vctxt</tt></i>:</span></td>
 <td>the validation context</td>
 </tr>
 <tr>
@@ -1923,7 +1917,7 @@
 <a name="xmlValidateOneAttribute"></a>xmlValidateOneAttribute ()</h3>
 <pre class="programlisting">int	xmlValidateOneAttribute		(<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>					 <a href="libxml2-tree.html#xmlAttrPtr">xmlAttrPtr</a> attr, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * value)<br>
 </pre>
-<p>DEPRECATED: Internal function, don't use. Try to validate a single <a href="libxml2-SAX.html#attribute">attribute</a> for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately</p>
+<p>DEPRECATED: Internal function, don't use. Try to validate a single attribute for an element basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Attribute Value Type ] - [ VC: Fixed Attribute Default ] - [ VC: Entity Name ] - [ VC: Name Token ] - [ VC: ID ] - [ VC: IDREF ] - [ VC: Entity Name ] - [ VC: Notation Attributes ] The ID/IDREF uniqueness and matching are done separately</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1941,11 +1935,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>attr</tt></i>:</span></td>
-<td>an <a href="libxml2-SAX.html#attribute">attribute</a> instance</td>
+<td>an attribute instance</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value (without entities processing)</td>
+<td>the attribute value (without entities processing)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1960,7 +1954,7 @@
 <a name="xmlValidateOneElement"></a>xmlValidateOneElement ()</h3>
 <pre class="programlisting">int	xmlValidateOneElement		(<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>
-<p>DEPRECATED: Internal function, don't use. Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each <a href="libxml2-SAX.html#attribute">attribute</a> present. The ID/IDREF checkings are done separately</p>
+<p>DEPRECATED: Internal function, don't use. Try to validate a single element and it's attributes, basically it does the following checks as described by the XML-1.0 recommendation: - [ VC: Element Valid ] - [ VC: Required Attribute ] Then call xmlValidateOneAttribute() for each attribute present. The ID/IDREF checkings are done separately</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2015,7 +2009,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the <a href="libxml2-SAX.html#attribute">attribute</a> value (without entities processing)</td>
+<td>the attribute value (without entities processing)</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
diff --git a/doc/devhelp/libxml2-xinclude.html b/doc/devhelp/libxml2-xinclude.html
index eba01b7..6bdf768 100644
--- a/doc/devhelp/libxml2-xinclude.html
+++ b/doc/devhelp/libxml2-xinclude.html
@@ -46,6 +46,7 @@
 int	<a href="#xmlXIncludeProcessTreeFlagsData">xmlXIncludeProcessTreeFlagsData</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> tree, <br>					 int flags, <br>					 void * data);
 void	<a href="#xmlXIncludeSetErrorHandler">xmlXIncludeSetErrorHandler</a>	(<a href="libxml2-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> handler, <br>					 void * data);
 int	<a href="#xmlXIncludeSetFlags">xmlXIncludeSetFlags</a>		(<a href="libxml2-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br>					 int flags);
+void	<a href="#xmlXIncludeSetResourceLoader">xmlXIncludeSetResourceLoader</a>	(<a href="libxml2-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * data);
 </pre>
 </div>
 <div class="refsect1" lang="en"><h2>Description</h2></div>
@@ -432,6 +433,31 @@
 </table></div>
 </div>
 <hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlXIncludeSetResourceLoader"></a>xmlXIncludeSetResourceLoader ()</h3>
+<pre class="programlisting">void	xmlXIncludeSetResourceLoader	(<a href="libxml2-xinclude.html#xmlXIncludeCtxtPtr">xmlXIncludeCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * data)<br>
+</pre>
+<p>Register a callback function that will be called to load included documents. Available since 2.14.0.</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 XInclude processing context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>loader</tt></i>:</span></td>
+<td>resource loader</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>data</tt></i>:</span></td>
+<td>user data which will be passed to the loader</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
 </div>
 </div>
 </body>
diff --git a/doc/devhelp/libxml2-xlink.html b/doc/devhelp/libxml2-xlink.html
index 4162a9a..35796d0 100644
--- a/doc/devhelp/libxml2-xlink.html
+++ b/doc/devhelp/libxml2-xlink.html
@@ -296,7 +296,7 @@
 <a name="xlinkGetDefaultDetect"></a>xlinkGetDefaultDetect ()</h3>
 <pre class="programlisting"><a href="libxml2-xlink.html#xlinkNodeDetectFunc">xlinkNodeDetectFunc</a>	xlinkGetDefaultDetect	(void)<br>
 </pre>
-<p>Get the default xlink detection routine</p>
+<p>DEPRECATED: Don't use. Get the default xlink detection routine</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -311,7 +311,7 @@
 <a name="xlinkGetDefaultHandler"></a>xlinkGetDefaultHandler ()</h3>
 <pre class="programlisting"><a href="libxml2-xlink.html#xlinkHandlerPtr">xlinkHandlerPtr</a>	xlinkGetDefaultHandler	(void)<br>
 </pre>
-<p>Get the default xlink handler.</p>
+<p>DEPRECATED: Don't use. Get the default xlink handler.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -351,7 +351,7 @@
 <a name="xlinkSetDefaultDetect"></a>xlinkSetDefaultDetect ()</h3>
 <pre class="programlisting">void	xlinkSetDefaultDetect		(<a href="libxml2-xlink.html#xlinkNodeDetectFunc">xlinkNodeDetectFunc</a> func)<br>
 </pre>
-<p>Set the default xlink detection routine</p>
+<p>DEPRECATED: Don't use. Set the default xlink detection routine</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -366,7 +366,7 @@
 <a name="xlinkSetDefaultHandler"></a>xlinkSetDefaultHandler ()</h3>
 <pre class="programlisting">void	xlinkSetDefaultHandler		(<a href="libxml2-xlink.html#xlinkHandlerPtr">xlinkHandlerPtr</a> handler)<br>
 </pre>
-<p>Set the default xlink handlers</p>
+<p>DEPRECATED: Don't use. Set the default xlink handlers</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
diff --git a/doc/devhelp/libxml2-xmlIO.html b/doc/devhelp/libxml2-xmlIO.html
index cd8424f..223c43c 100644
--- a/doc/devhelp/libxml2-xmlIO.html
+++ b/doc/devhelp/libxml2-xmlIO.html
@@ -33,10 +33,6 @@
 void *	<a href="#xmlFileOpen">xmlFileOpen</a>			(const char * filename);
 int	<a href="#xmlFileRead">xmlFileRead</a>			(void * context, <br>					 char * buffer, <br>					 int len);
 void	<a href="#xmlFreeParserInputBuffer">xmlFreeParserInputBuffer</a>	(<a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in);
-int	<a href="#xmlIOFTPClose">xmlIOFTPClose</a>			(void * context);
-int	<a href="#xmlIOFTPMatch">xmlIOFTPMatch</a>			(const char * filename);
-void *	<a href="#xmlIOFTPOpen">xmlIOFTPOpen</a>			(const char * filename);
-int	<a href="#xmlIOFTPRead">xmlIOFTPRead</a>			(void * context, <br>					 char * buffer, <br>					 int len);
 int	<a href="#xmlIOHTTPClose">xmlIOHTTPClose</a>			(void * context);
 int	<a href="#xmlIOHTTPMatch">xmlIOHTTPMatch</a>			(const char * filename);
 void *	<a href="#xmlIOHTTPOpen">xmlIOHTTPOpen</a>			(const char * filename);
@@ -59,7 +55,7 @@
 int	<a href="#xmlOutputBufferFlush">xmlOutputBufferFlush</a>		(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out);
 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	<a href="#xmlOutputBufferGetContent">xmlOutputBufferGetContent</a>	(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out);
 size_t	<a href="#xmlOutputBufferGetSize">xmlOutputBufferGetSize</a>		(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out);
-int	<a href="#xmlOutputBufferWrite">xmlOutputBufferWrite</a>		(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 int len, <br>					 const char * buf);
+int	<a href="#xmlOutputBufferWrite">xmlOutputBufferWrite</a>		(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 int len, <br>					 const char * data);
 int	<a href="#xmlOutputBufferWriteEscape">xmlOutputBufferWriteEscape</a>	(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escaping);
 int	<a href="#xmlOutputBufferWriteString">xmlOutputBufferWriteString</a>	(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 const char * str);
 typedef int <a href="#xmlOutputCloseCallback">xmlOutputCloseCallback</a>		(void * context);
@@ -336,7 +332,7 @@
 <a name="xmlAllocOutputBuffer"></a>xmlAllocOutputBuffer ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlAllocOutputBuffer	(<a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder)<br>
 </pre>
-<p>Create a buffered parser output</p>
+<p>Create a buffered parser output Consumes @encoder even in error case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -357,7 +353,7 @@
 <a name="xmlAllocParserInputBuffer"></a>xmlAllocParserInputBuffer ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlAllocParserInputBuffer	(<a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br>
 </pre>
-<p>Create a buffered parser input for progressive parsing. The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
+<p>DEPRECATED: Use xmlNewInputFrom*. Create a buffered parser input for progressive parsing. The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -544,98 +540,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlIOFTPClose"></a>xmlIOFTPClose ()</h3>
-<pre class="programlisting">int	xmlIOFTPClose			(void * context)<br>
-</pre>
-<p>DEPRECATED: Internal function, don't use. Close an FTP I/O channel</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>context</tt></i>:</span></td>
-<td>the I/O context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlIOFTPMatch"></a>xmlIOFTPMatch ()</h3>
-<pre class="programlisting">int	xmlIOFTPMatch			(const char * filename)<br>
-</pre>
-<p>DEPRECATED: Internal function, don't use. check if the URI matches an FTP one</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>filename</tt></i>:</span></td>
-<td>the URI for matching</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if matches, 0 otherwise</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlIOFTPOpen"></a>xmlIOFTPOpen ()</h3>
-<pre class="programlisting">void *	xmlIOFTPOpen			(const char * filename)<br>
-</pre>
-<p>DEPRECATED: Internal function, don't use. open an FTP I/O channel</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>filename</tt></i>:</span></td>
-<td>the URI for matching</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>an I/O context or NULL in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlIOFTPRead"></a>xmlIOFTPRead ()</h3>
-<pre class="programlisting">int	xmlIOFTPRead			(void * context, <br>					 char * buffer, <br>					 int len)<br>
-</pre>
-<p>DEPRECATED: Internal function, don't use. Read @len bytes to @buffer from the I/O channel.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>context</tt></i>:</span></td>
-<td>the I/O context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>buffer</tt></i>:</span></td>
-<td>where to drop data</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>number of bytes to write</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of bytes written</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlIOHTTPClose"></a>xmlIOHTTPClose ()</h3>
 <pre class="programlisting">int	xmlIOHTTPClose			(void * context)<br>
 </pre>
@@ -756,7 +660,7 @@
 <a name="xmlNoNetExternalEntityLoader"></a>xmlNoNetExternalEntityLoader ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputPtr">xmlParserInputPtr</a>	xmlNoNetExternalEntityLoader	(const char * URL, <br>							 const char * ID, <br>							 <a href="libxml2-tree.html#xmlParserCtxtPtr">xmlParserCtxtPtr</a> ctxt)<br>
 </pre>
-<p>A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#XML_PARSE_NONET">XML_PARSE_NONET</a>. A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -827,7 +731,7 @@
 <a name="xmlOutputBufferCreateBuffer"></a>xmlOutputBufferCreateBuffer ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlOutputBufferCreateBuffer	(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buffer, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder)<br>
 </pre>
-<p>Create a buffered output for the progressive saving to a <a href="libxml2-tree.html#xmlBuffer">xmlBuffer</a></p>
+<p>Create a buffered output for the progressive saving to a <a href="libxml2-tree.html#xmlBuffer">xmlBuffer</a> Consumes @encoder even in error case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -853,7 +757,7 @@
 <a name="xmlOutputBufferCreateFd"></a>xmlOutputBufferCreateFd ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlOutputBufferCreateFd	(int fd, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder)<br>
 </pre>
-<p>Create a buffered output for the progressive saving to a file descriptor</p>
+<p>Create a buffered output for the progressive saving to a file descriptor Consumes @encoder even in error case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -878,7 +782,7 @@
 <a name="xmlOutputBufferCreateFile"></a>xmlOutputBufferCreateFile ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlOutputBufferCreateFile	(FILE * file, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder)<br>
 </pre>
-<p>Create a buffered output for the progressive saving to a FILE * buffered C I/O</p>
+<p>Create a buffered output for the progressive saving to a FILE * buffered C I/O Consumes @encoder even in error case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -903,7 +807,7 @@
 <a name="xmlOutputBufferCreateFilename"></a>xmlOutputBufferCreateFilename ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlOutputBufferCreateFilename	(const char * URI, <br>							 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder, <br>							 int compression)<br>
 </pre>
-<p>Create a buffered output for the progressive saving of a file If filename is "-' then we use stdout as the output. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. TODO: currently if compression is set, the library only support writing to a local file.</p>
+<p>Create a buffered output for the progressive saving of a file If filename is "-' then we use stdout as the output. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. TODO: currently if compression is set, the library only support writing to a local file. Consumes @encoder even in error case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -953,7 +857,7 @@
 <a name="xmlOutputBufferCreateIO"></a>xmlOutputBufferCreateIO ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a>	xmlOutputBufferCreateIO	(<a href="libxml2-xmlIO.html#xmlOutputWriteCallback">xmlOutputWriteCallback</a> iowrite, <br>						 <a href="libxml2-xmlIO.html#xmlOutputCloseCallback">xmlOutputCloseCallback</a> ioclose, <br>						 void * ioctx, <br>						 <a href="libxml2-encoding.html#xmlCharEncodingHandlerPtr">xmlCharEncodingHandlerPtr</a> encoder)<br>
 </pre>
-<p>Create a buffered output for the progressive saving to an I/O handler</p>
+<p>Create a buffered output for the progressive saving to an I/O handler Consumes @encoder even in error case.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1049,7 +953,7 @@
 <div class="refsect2" lang="en">
 <h3>
 <a name="xmlOutputBufferWrite"></a>xmlOutputBufferWrite ()</h3>
-<pre class="programlisting">int	xmlOutputBufferWrite		(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 int len, <br>					 const char * buf)<br>
+<pre class="programlisting">int	xmlOutputBufferWrite		(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 int len, <br>					 const char * data)<br>
 </pre>
 <p>Write the content of the array in the output I/O buffer This routine handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.</p>
 <div class="variablelist"><table border="0">
@@ -1064,7 +968,7 @@
 <td>the size in bytes of the array.</td>
 </tr>
 <tr>
-<td><span class="term"><i><tt>buf</tt></i>:</span></td>
+<td><span class="term"><i><tt>data</tt></i>:</span></td>
 <td>an char array</td>
 </tr>
 <tr>
@@ -1080,7 +984,7 @@
 <a name="xmlOutputBufferWriteEscape"></a>xmlOutputBufferWriteEscape ()</h3>
 <pre class="programlisting">int	xmlOutputBufferWriteEscape	(<a href="libxml2-tree.html#xmlOutputBufferPtr">xmlOutputBufferPtr</a> out, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escaping)<br>
 </pre>
-<p>Write the content of the string in the output I/O buffer This routine escapes the <a href="libxml2-SAX.html#characters">characters</a> and then handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.</p>
+<p>Write the content of the string in the output I/O buffer This routine escapes the characters and then handle the I18N transcoding from internal UTF-8 The buffer is lossless, i.e. will store in case of partial or delayed writes.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1155,7 +1059,7 @@
 <a name="xmlParserInputBufferCreateFd"></a>xmlParserInputBufferCreateFd ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlParserInputBufferCreateFd	(int fd, <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 a file descriptor The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromFd">xmlNewInputFromFd</a>. Create a buffered parser input for the progressive parsing for the input from a file descriptor The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1180,7 +1084,7 @@
 <a name="xmlParserInputBufferCreateFile"></a>xmlParserInputBufferCreateFile ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlParserInputBufferCreateFile	(FILE * file, <br>							 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br>
 </pre>
-<p>Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
+<p>DEPRECATED: Don't use. Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1205,7 +1109,7 @@
 <a name="xmlParserInputBufferCreateFilename"></a>xmlParserInputBufferCreateFilename ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlParserInputBufferCreateFilename	(const char * URI, <br>							 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br>
 </pre>
-<p>Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Do an encoding check if enc == <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a></p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromUrl">xmlNewInputFromUrl</a>. Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Do an encoding check if enc == <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a></p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1230,7 +1134,7 @@
 <a name="xmlParserInputBufferCreateFilenameDefault"></a>xmlParserInputBufferCreateFilenameDefault ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a>	xmlParserInputBufferCreateFilenameDefault	(<a href="libxml2-xmlIO.html#xmlParserInputBufferCreateFilenameFunc">xmlParserInputBufferCreateFilenameFunc</a> func)<br>
 </pre>
-<p>Registers a callback for URI input file handling</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlCtxtSetResourceLoader">xmlCtxtSetResourceLoader</a> or similar functions. Registers a callback for URI input file handling</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1251,7 +1155,7 @@
 <a name="xmlParserInputBufferCreateIO"></a>xmlParserInputBufferCreateIO ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlParserInputBufferCreateIO	(<a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> ioread, <br>							 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> ioclose, <br>							 void * ioctx, <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 I/O handler The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromIO">xmlNewInputFromIO</a>. Create a buffered parser input for the progressive parsing for the input from an I/O handler The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1284,7 +1188,7 @@
 <a name="xmlParserInputBufferCreateMem"></a>xmlParserInputBufferCreateMem ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a>	xmlParserInputBufferCreateMem	(const char * mem, <br>							 int size, <br>							 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc)<br>
 </pre>
-<p>Create a parser input buffer for parsing from a memory area. This function makes a copy of the whole input buffer. If you are sure that the contents of the buffer will remain valid until the document was parsed, you can avoid the copy by using <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateStatic">xmlParserInputBufferCreateStatic</a>. The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromMemory">xmlNewInputFromMemory</a>. Create a parser input buffer for parsing from a memory area. This function makes a copy of the whole input buffer. If you are sure that the contents of the buffer will remain valid until the document was parsed, you can avoid the copy by using <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateStatic">xmlParserInputBufferCreateStatic</a>. The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1313,7 +1217,7 @@
 <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 parser input buffer for parsing from a memory area. This functions assumes that the contents of the input buffer remain valid until the document was parsed. Use <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateMem">xmlParserInputBufferCreateMem</a> otherwise. The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlNewInputFromMemory">xmlNewInputFromMemory</a>. Create a parser input buffer for parsing from a memory area. This functions assumes that the contents of the input buffer remain valid until the document was parsed. Use <a href="libxml2-xmlIO.html#xmlParserInputBufferCreateMem">xmlParserInputBufferCreateMem</a> otherwise. The encoding argument is deprecated and should be set to <a href="libxml2-encoding.html#XML_CHAR_ENCODING_NONE">XML_CHAR_ENCODING_NONE</a>. The encoding can be changed with <a href="libxml2-parserInternals.html#xmlSwitchEncoding">xmlSwitchEncoding</a> or <a href="libxml2-parserInternals.html#xmlSwitchEncodingName">xmlSwitchEncodingName</a> later on.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1342,7 +1246,7 @@
 <a name="xmlParserInputBufferGrow"></a>xmlParserInputBufferGrow ()</h3>
 <pre class="programlisting">int	xmlParserInputBufferGrow	(<a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br>					 int len)<br>
 </pre>
-<p>Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode TODO: one should be able to remove one extra copy by copying directly onto in-&gt;buffer or in-&gt;raw</p>
+<p>DEPRECATED: Internal function, don't use. Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1367,7 +1271,7 @@
 <a name="xmlParserInputBufferPush"></a>xmlParserInputBufferPush ()</h3>
 <pre class="programlisting">int	xmlParserInputBufferPush	(<a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br>					 int len, <br>					 const char * buf)<br>
 </pre>
-<p>Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.</p>
+<p>DEPRECATED: Internal function, don't use. Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1396,7 +1300,7 @@
 <a name="xmlParserInputBufferRead"></a>xmlParserInputBufferRead ()</h3>
 <pre class="programlisting">int	xmlParserInputBufferRead	(<a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> in, <br>					 int len)<br>
 </pre>
-<p>Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8</p>
+<p>DEPRECATED: Internal function, don't use. Same as <a href="libxml2-xmlIO.html#xmlParserInputBufferGrow">xmlParserInputBufferGrow</a>.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1475,7 +1379,7 @@
 <a name="xmlRegisterInputCallbacks"></a>xmlRegisterInputCallbacks ()</h3>
 <pre class="programlisting">int	xmlRegisterInputCallbacks	(<a href="libxml2-xmlIO.html#xmlInputMatchCallback">xmlInputMatchCallback</a> matchFunc, <br>					 <a href="libxml2-xmlIO.html#xmlInputOpenCallback">xmlInputOpenCallback</a> openFunc, <br>					 <a href="libxml2-xmlIO.html#xmlInputReadCallback">xmlInputReadCallback</a> readFunc, <br>					 <a href="libxml2-xmlIO.html#xmlInputCloseCallback">xmlInputCloseCallback</a> closeFunc)<br>
 </pre>
-<p>Register a new set of I/O callback for handling parser input.</p>
+<p>DEPRECATED: Use <a href="libxml2-parser.html#xmlCtxtSetResourceLoader">xmlCtxtSetResourceLoader</a> or similar functions. Register a new set of I/O callback for handling parser input.</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 173f026..69e1a03 100644
--- a/doc/devhelp/libxml2-xmlerror.html
+++ b/doc/devhelp/libxml2-xmlerror.html
@@ -22,12 +22,12 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">typedef struct _xmlError <a href="#xmlError">xmlError</a>;
+<pre class="synopsis">#define <a href="#initGenericErrorDefaultFunc">initGenericErrorDefaultFunc</a>;
+typedef struct _xmlError <a href="#xmlError">xmlError</a>;
 typedef enum <a href="#xmlErrorDomain">xmlErrorDomain</a>;
 typedef enum <a href="#xmlErrorLevel">xmlErrorLevel</a>;
 typedef <a href="libxml2-xmlerror.html#xmlError">xmlError</a> * <a href="#xmlErrorPtr">xmlErrorPtr</a>;
 typedef enum <a href="#xmlParserErrors">xmlParserErrors</a>;
-void	<a href="#initGenericErrorDefaultFunc">initGenericErrorDefaultFunc</a>	(<a href="libxml2-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> * handler);
 int	<a href="#xmlCopyError">xmlCopyError</a>			(const <a href="libxml2-xmlerror.html#xmlError">xmlError</a> * from, <br>					 <a href="libxml2-xmlerror.html#xmlErrorPtr">xmlErrorPtr</a> to);
 const <a href="libxml2-xmlerror.html#xmlError">xmlError</a> *	<a href="#xmlCtxtGetLastError">xmlCtxtGetLastError</a>	(void * ctx);
 void	<a href="#xmlCtxtResetLastError">xmlCtxtResetLastError</a>		(void * ctx);
@@ -55,21 +55,29 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
+<a name="initGenericErrorDefaultFunc">Macro </a>initGenericErrorDefaultFunc</h3>
+<pre class="programlisting">#define <a href="#initGenericErrorDefaultFunc">initGenericErrorDefaultFunc</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlError">Structure </a>xmlError</h3>
 <pre class="programlisting">struct _xmlError {
-    int	domain	: What part of the library raised this error
-    int	code	: The error code, e.g. an <a href="libxml2-xmlerror.html#xmlParserError">xmlParserError</a>
-    char *	message	: human-readable informative error message
-    <a href="libxml2-xmlerror.html#xmlErrorLevel">xmlErrorLevel</a>	level	: how consequent is the error
-    char *	file	: the filename
-    int	line	: the line number if available
-    char *	str1	: extra string information
-    char *	str2	: extra string information
-    char *	str3	: extra string information
-    int	int1	: extra number information
-    int	int2	: error column # or 0 if N/A (todo: rename field when we would brk ABI)
-    void *	ctxt	: the parser context if available
-    void *	node	: the node in the tree
+    int	domain
+    int	code
+    char *	message
+    <a href="libxml2-xmlerror.html#xmlErrorLevel">xmlErrorLevel</a>	level
+    char *	file
+    int	line
+    char *	str1
+    char *	str2
+    char *	str3
+    int	int1
+    int	int2
+    void *	ctxt
+    void *	node
 } xmlError;
 </pre>
 <p></p>
@@ -936,21 +944,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="initGenericErrorDefaultFunc"></a>initGenericErrorDefaultFunc ()</h3>
-<pre class="programlisting">void	initGenericErrorDefaultFunc	(<a href="libxml2-xmlerror.html#xmlGenericErrorFunc">xmlGenericErrorFunc</a> * handler)<br>
-</pre>
-<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>
-<td><span class="term"><i><tt>handler</tt></i>:</span></td>
-<td>the handler</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlCopyError"></a>xmlCopyError ()</h3>
 <pre class="programlisting">int	xmlCopyError			(const <a href="libxml2-xmlerror.html#xmlError">xmlError</a> * from, <br>					 <a href="libxml2-xmlerror.html#xmlErrorPtr">xmlErrorPtr</a> to)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-xmlmemory.html b/doc/devhelp/libxml2-xmlmemory.html
index 57457aa..c26a88b 100644
--- a/doc/devhelp/libxml2-xmlmemory.html
+++ b/doc/devhelp/libxml2-xmlmemory.html
@@ -188,7 +188,7 @@
 <a name="xmlGcMemGet"></a>xmlGcMemGet ()</h3>
 <pre class="programlisting">int	xmlGcMemGet			(<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#xmlMallocFunc">xmlMallocFunc</a> * mallocAtomicFunc, <br>					 <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> * reallocFunc, <br>					 <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> * strdupFunc)<br>
 </pre>
-<p>Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators</p>
+<p>DEPRECATED: <a href="libxml2-xmlmemory.html#xmlMemGet">xmlMemGet</a>. Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -225,7 +225,7 @@
 <a name="xmlGcMemSetup"></a>xmlGcMemSetup ()</h3>
 <pre class="programlisting">int	xmlGcMemSetup			(<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#xmlMallocFunc">xmlMallocFunc</a> mallocAtomicFunc, <br>					 <a href="libxml2-xmlmemory.html#xmlReallocFunc">xmlReallocFunc</a> reallocFunc, <br>					 <a href="libxml2-xmlmemory.html#xmlStrdupFunc">xmlStrdupFunc</a> strdupFunc)<br>
 </pre>
-<p>Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators Should this be blocked if there was already some allocations done ?</p>
+<p>DEPRECATED: Use <a href="libxml2-xmlmemory.html#xmlMemSetup">xmlMemSetup</a>. Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas useful for garbage collected memory allocators Should this be blocked if there was already some allocations done ?</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/devhelp/libxml2-xmlreader.html b/doc/devhelp/libxml2-xmlreader.html
index e3be724..50c8ceb 100644
--- a/doc/devhelp/libxml2-xmlreader.html
+++ b/doc/devhelp/libxml2-xmlreader.html
@@ -112,6 +112,7 @@
 void	<a href="#xmlTextReaderSetErrorHandler">xmlTextReaderSetErrorHandler</a>	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 <a href="libxml2-xmlreader.html#xmlTextReaderErrorFunc">xmlTextReaderErrorFunc</a> f, <br>					 void * arg);
 void	<a href="#xmlTextReaderSetMaxAmplification">xmlTextReaderSetMaxAmplification</a>	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>						 unsigned maxAmpl);
 int	<a href="#xmlTextReaderSetParserProp">xmlTextReaderSetParserProp</a>	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 int prop, <br>					 int value);
+void	<a href="#xmlTextReaderSetResourceLoader">xmlTextReaderSetResourceLoader</a>	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * data);
 int	<a href="#xmlTextReaderSetSchema">xmlTextReaderSetSchema</a>		(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema);
 void	<a href="#xmlTextReaderSetStructuredErrorHandler">xmlTextReaderSetStructuredErrorHandler</a>	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> f, <br>						 void * arg);
 int	<a href="#xmlTextReaderSetup">xmlTextReaderSetup</a>		(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 const char * URL, <br>					 const char * encoding, <br>					 int options);
@@ -746,7 +747,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>0 i no attributes, -1 in case of error or the <a href="libxml2-SAX.html#attribute">attribute</a> count</td>
+<td>0 i no attributes, -1 in case of error or the attribute count</td>
 </tr>
 </tbody>
 </table></div>
@@ -778,7 +779,7 @@
 <a name="xmlTextReaderByteConsumed"></a>xmlTextReaderByteConsumed ()</h3>
 <pre class="programlisting">long	xmlTextReaderByteConsumed	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>This function provides the current index of the parser used by the reader, relative to the start of the current entity. This function actually just wraps a call to xmlBytesConsumed() for the parser context associated with the reader. See xmlBytesConsumed() for more information.</p>
+<p>DEPRECATED: The returned value is mostly random and useless. It reflects the parser reading ahead and is in no way related to the current node. This function provides the current index of the parser used by the reader, relative to the start of the current entity. This function actually just wraps a call to xmlBytesConsumed() for the parser context associated with the reader. See xmlBytesConsumed() for more information.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -925,7 +926,7 @@
 <a name="xmlTextReaderConstPrefix"></a>xmlTextReaderConstPrefix ()</h3>
 <pre class="programlisting">const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderConstPrefix	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>A shorthand <a href="libxml2-SAX.html#reference">reference</a> to the namespace associated with the node.</p>
+<p>A shorthand reference to the namespace associated with the node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1118,7 +1119,7 @@
 <a name="xmlTextReaderGetAttribute"></a>xmlTextReaderGetAttribute ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderGetAttribute	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Provides the value of the <a href="libxml2-SAX.html#attribute">attribute</a> with the specified qualified name.</p>
+<p>Provides the value of the attribute with the specified qualified name.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1128,7 +1129,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the qualified name of the <a href="libxml2-SAX.html#attribute">attribute</a>.</td>
+<td>the qualified name of the attribute.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1143,7 +1144,7 @@
 <a name="xmlTextReaderGetAttributeNo"></a>xmlTextReaderGetAttributeNo ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderGetAttributeNo	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>						 int no)<br>
 </pre>
-<p>Provides the value of the <a href="libxml2-SAX.html#attribute">attribute</a> with the specified index relative to the containing element.</p>
+<p>Provides the value of the attribute with the specified index relative to the containing element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1153,7 +1154,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>no</tt></i>:</span></td>
-<td>the zero-based index of the <a href="libxml2-SAX.html#attribute">attribute</a> relative to the containing element</td>
+<td>the zero-based index of the attribute relative to the containing element</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1168,7 +1169,7 @@
 <a name="xmlTextReaderGetAttributeNs"></a>xmlTextReaderGetAttributeNs ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderGetAttributeNs	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localName, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * namespaceURI)<br>
 </pre>
-<p>Provides the value of the specified <a href="libxml2-SAX.html#attribute">attribute</a></p>
+<p>Provides the value of the specified attribute</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1178,11 +1179,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>localName</tt></i>:</span></td>
-<td>the local name of the <a href="libxml2-SAX.html#attribute">attribute</a>.</td>
+<td>the local name of the attribute.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>namespaceURI</tt></i>:</span></td>
-<td>the namespace URI of the <a href="libxml2-SAX.html#attribute">attribute</a>.</td>
+<td>the namespace URI of the attribute.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1415,7 +1416,7 @@
 <a name="xmlTextReaderIsNamespaceDecl"></a>xmlTextReaderIsNamespaceDecl ()</h3>
 <pre class="programlisting">int	xmlTextReaderIsNamespaceDecl	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>Determine whether the current node is a namespace declaration rather than a regular <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Determine whether the current node is a namespace declaration rather than a regular attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1425,7 +1426,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if the current node is a namespace declaration, 0 if it is a regular <a href="libxml2-SAX.html#attribute">attribute</a> or other type of node, or -1 in case of error.</td>
+<td>1 if the current node is a namespace declaration, 0 if it is a regular attribute or other type of node, or -1 in case of error.</td>
 </tr>
 </tbody>
 </table></div>
@@ -1545,7 +1546,7 @@
 <a name="xmlTextReaderMoveToAttribute"></a>xmlTextReaderMoveToAttribute ()</h3>
 <pre class="programlisting">int	xmlTextReaderMoveToAttribute	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Moves the position of the current instance to the <a href="libxml2-SAX.html#attribute">attribute</a> with the specified qualified name.</p>
+<p>Moves the position of the current instance to the attribute with the specified qualified name.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1555,7 +1556,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the qualified name of the <a href="libxml2-SAX.html#attribute">attribute</a>.</td>
+<td>the qualified name of the attribute.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1570,7 +1571,7 @@
 <a name="xmlTextReaderMoveToAttributeNo"></a>xmlTextReaderMoveToAttributeNo ()</h3>
 <pre class="programlisting">int	xmlTextReaderMoveToAttributeNo	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 int no)<br>
 </pre>
-<p>Moves the position of the current instance to the <a href="libxml2-SAX.html#attribute">attribute</a> with the specified index relative to the containing element.</p>
+<p>Moves the position of the current instance to the attribute with the specified index relative to the containing element.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1580,7 +1581,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>no</tt></i>:</span></td>
-<td>the zero-based index of the <a href="libxml2-SAX.html#attribute">attribute</a> relative to the containing element.</td>
+<td>the zero-based index of the attribute relative to the containing element.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1595,7 +1596,7 @@
 <a name="xmlTextReaderMoveToAttributeNs"></a>xmlTextReaderMoveToAttributeNs ()</h3>
 <pre class="programlisting">int	xmlTextReaderMoveToAttributeNs	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * localName, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * namespaceURI)<br>
 </pre>
-<p>Moves the position of the current instance to the <a href="libxml2-SAX.html#attribute">attribute</a> with the specified local name and namespace URI.</p>
+<p>Moves the position of the current instance to the attribute with the specified local name and namespace URI.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1605,11 +1606,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>localName</tt></i>:</span></td>
-<td>the local name of the <a href="libxml2-SAX.html#attribute">attribute</a>.</td>
+<td>the local name of the attribute.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>namespaceURI</tt></i>:</span></td>
-<td>the namespace URI of the <a href="libxml2-SAX.html#attribute">attribute</a>.</td>
+<td>the namespace URI of the attribute.</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1645,7 +1646,7 @@
 <a name="xmlTextReaderMoveToFirstAttribute"></a>xmlTextReaderMoveToFirstAttribute ()</h3>
 <pre class="programlisting">int	xmlTextReaderMoveToFirstAttribute	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>Moves the position of the current instance to the first <a href="libxml2-SAX.html#attribute">attribute</a> associated with the current node.</p>
+<p>Moves the position of the current instance to the first attribute associated with the current node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1666,7 +1667,7 @@
 <a name="xmlTextReaderMoveToNextAttribute"></a>xmlTextReaderMoveToNextAttribute ()</h3>
 <pre class="programlisting">int	xmlTextReaderMoveToNextAttribute	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>Moves the position of the current instance to the next <a href="libxml2-SAX.html#attribute">attribute</a> associated with the current node.</p>
+<p>Moves the position of the current instance to the next attribute associated with the current node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1792,7 +1793,7 @@
 <a name="xmlTextReaderNormalization"></a>xmlTextReaderNormalization ()</h3>
 <pre class="programlisting">int	xmlTextReaderNormalization	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>The value indicating whether to normalize white space and <a href="libxml2-SAX.html#attribute">attribute</a> values. Since <a href="libxml2-SAX.html#attribute">attribute</a> value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</p>
+<p>The value indicating whether to normalize white space and attribute values. Since attribute value and end of line normalizations are a MUST in the XML specification only the value true is accepted. The broken behaviour of accepting out of range character entities like &amp;#0; is of course not supported either.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1813,7 +1814,7 @@
 <a name="xmlTextReaderPrefix"></a>xmlTextReaderPrefix ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	xmlTextReaderPrefix	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>A shorthand <a href="libxml2-SAX.html#reference">reference</a> to the namespace associated with the node.</p>
+<p>A shorthand reference to the namespace associated with the node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1884,7 +1885,7 @@
 <a name="xmlTextReaderQuoteChar"></a>xmlTextReaderQuoteChar ()</h3>
 <pre class="programlisting">int	xmlTextReaderQuoteChar		(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>The quotation mark character used to enclose the value of an <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>The quotation mark character used to enclose the value of an attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1926,7 +1927,7 @@
 <a name="xmlTextReaderReadAttributeValue"></a>xmlTextReaderReadAttributeValue ()</h3>
 <pre class="programlisting">int	xmlTextReaderReadAttributeValue	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader)<br>
 </pre>
-<p>Parses an <a href="libxml2-SAX.html#attribute">attribute</a> value into one or more Text and EntityReference nodes.</p>
+<p>Parses an attribute value into one or more Text and EntityReference nodes.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1936,7 +1937,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 in case of success, 0 if the reader was not positioned on an <a href="libxml2-SAX.html#attribute">attribute</a> node or all the <a href="libxml2-SAX.html#attribute">attribute</a> values have been read, or -1 in case of error.</td>
+<td>1 in case of success, 0 if the reader was not positioned on an attribute node or all the attribute values have been read, or -1 in case of error.</td>
 </tr>
 </tbody>
 </table></div>
@@ -2020,7 +2021,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a string containing the contents of the Element or Text node, or NULL if the reader is positioned on any other type of node. The string must be deallocated by the caller.</td>
+<td>a string containing the contents of the non-empty Element or Text node (including CDATA sections), or NULL if the reader is positioned on any other type of node. The string must be deallocated by the caller.</td>
 </tr>
 </tbody>
 </table></div>
@@ -2236,6 +2237,31 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlTextReaderSetResourceLoader"></a>xmlTextReaderSetResourceLoader ()</h3>
+<pre class="programlisting">void	xmlTextReaderSetResourceLoader	(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * data)<br>
+</pre>
+<p>Register a callback function that will be called to load external resources like entities. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>reader</tt></i>:</span></td>
+<td>thr reader</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>loader</tt></i>:</span></td>
+<td>resource loader</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>data</tt></i>:</span></td>
+<td>user data which will be passed to the loader</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlTextReaderSetSchema"></a>xmlTextReaderSetSchema ()</h3>
 <pre class="programlisting">int	xmlTextReaderSetSchema		(<a href="libxml2-xmlreader.html#xmlTextReaderPtr">xmlTextReaderPtr</a> reader, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaPtr">xmlSchemaPtr</a> schema)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-xmlregexp.html b/doc/devhelp/libxml2-xmlregexp.html
index 1286692..14b6eea 100644
--- a/doc/devhelp/libxml2-xmlregexp.html
+++ b/doc/devhelp/libxml2-xmlregexp.html
@@ -22,34 +22,10 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">typedef struct _xmlExpCtxt <a href="#xmlExpCtxt">xmlExpCtxt</a>;
-typedef <a href="libxml2-xmlregexp.html#xmlExpCtxt">xmlExpCtxt</a> * <a href="#xmlExpCtxtPtr">xmlExpCtxtPtr</a>;
-typedef struct _xmlExpNode <a href="#xmlExpNode">xmlExpNode</a>;
-typedef <a href="libxml2-xmlregexp.html#xmlExpNode">xmlExpNode</a> * <a href="#xmlExpNodePtr">xmlExpNodePtr</a>;
-typedef enum <a href="#xmlExpNodeType">xmlExpNodeType</a>;
-typedef struct _xmlRegExecCtxt <a href="#xmlRegExecCtxt">xmlRegExecCtxt</a>;
+<pre class="synopsis">typedef struct _xmlRegExecCtxt <a href="#xmlRegExecCtxt">xmlRegExecCtxt</a>;
 typedef <a href="libxml2-xmlregexp.html#xmlRegExecCtxt">xmlRegExecCtxt</a> * <a href="#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a>;
 typedef struct _xmlRegexp <a href="#xmlRegexp">xmlRegexp</a>;
 typedef <a href="libxml2-xmlregexp.html#xmlRegexp">xmlRegexp</a> * <a href="#xmlRegexpPtr">xmlRegexpPtr</a>;
-int	<a href="#xmlExpCtxtNbCons">xmlExpCtxtNbCons</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt);
-int	<a href="#xmlExpCtxtNbNodes">xmlExpCtxtNbNodes</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt);
-void	<a href="#xmlExpDump">xmlExpDump</a>			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpExpDerive">xmlExpExpDerive</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub);
-void	<a href="#xmlExpFree">xmlExpFree</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp);
-void	<a href="#xmlExpFreeCtxt">xmlExpFreeCtxt</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt);
-int	<a href="#xmlExpGetLanguage">xmlExpGetLanguage</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** langList, <br>					 int len);
-int	<a href="#xmlExpGetStart">xmlExpGetStart</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** tokList, <br>					 int len);
-int	<a href="#xmlExpIsNillable">xmlExpIsNillable</a>		(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp);
-int	<a href="#xmlExpMaxToken">xmlExpMaxToken</a>			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewAtom">xmlExpNewAtom</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int len);
-<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a>	<a href="#xmlExpNewCtxt">xmlExpNewCtxt</a>		(int maxNodes, <br>					 <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewOr">xmlExpNewOr</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewRange">xmlExpNewRange</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> subset, <br>					 int min, <br>					 int max);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpNewSeq">xmlExpNewSeq</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpParse">xmlExpParse</a>		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const char * expr);
-void	<a href="#xmlExpRef">xmlExpRef</a>			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp);
-<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	<a href="#xmlExpStringDerive">xmlExpStringDerive</a>	(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 int len);
-int	<a href="#xmlExpSubsume">xmlExpSubsume</a>			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub);
 typedef void <a href="#xmlRegExecCallbacks">xmlRegExecCallbacks</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * token, <br>					 void * transdata, <br>					 void * inputdata);
 int	<a href="#xmlRegExecErrInfo">xmlRegExecErrInfo</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** string, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal);
 int	<a href="#xmlRegExecNextValues">xmlRegExecNextValues</a>		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal);
@@ -70,57 +46,6 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlExpCtxt">Structure </a>xmlExpCtxt</h3>
-<pre class="programlisting">struct _xmlExpCtxt {
-The content of this structure is not made public by the API.
-} xmlExpCtxt;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpCtxtPtr">Typedef </a>xmlExpCtxtPtr</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpCtxt">xmlExpCtxt</a> * xmlExpCtxtPtr;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNode">Structure </a>xmlExpNode</h3>
-<pre class="programlisting">struct _xmlExpNode {
-The content of this structure is not made public by the API.
-} xmlExpNode;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNodePtr">Typedef </a>xmlExpNodePtr</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNode">xmlExpNode</a> * xmlExpNodePtr;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNodeType">Enum </a>xmlExpNodeType</h3>
-<pre class="programlisting">enum <a href="#xmlExpNodeType">xmlExpNodeType</a> {
-    <a name="XML_EXP_EMPTY">XML_EXP_EMPTY</a> = 0
-    <a name="XML_EXP_FORBID">XML_EXP_FORBID</a> = 1
-    <a name="XML_EXP_ATOM">XML_EXP_ATOM</a> = 2
-    <a name="XML_EXP_SEQ">XML_EXP_SEQ</a> = 3
-    <a name="XML_EXP_OR">XML_EXP_OR</a> = 4
-    <a name="XML_EXP_COUNT">XML_EXP_COUNT</a> = 5
-};
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlRegExecCtxt">Structure </a>xmlRegExecCtxt</h3>
 <pre class="programlisting">struct _xmlRegExecCtxt {
 The content of this structure is not made public by the API.
@@ -186,505 +111,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="emptyExp">Variable </a>emptyExp</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> emptyExp;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="forbiddenExp">Variable </a>forbiddenExp</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> forbiddenExp;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpCtxtNbCons"></a>xmlExpCtxtNbCons ()</h3>
-<pre class="programlisting">int	xmlExpCtxtNbCons		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt)<br>
-</pre>
-<p>Debugging facility provides the number of allocated nodes over lifetime</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 expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of nodes ever allocated or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpCtxtNbNodes"></a>xmlExpCtxtNbNodes ()</h3>
-<pre class="programlisting">int	xmlExpCtxtNbNodes		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt)<br>
-</pre>
-<p>Debugging facility provides the number of allocated nodes at a that point</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 expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of nodes in use or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpDump"></a>xmlExpDump ()</h3>
-<pre class="programlisting">void	xmlExpDump			(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buf, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr)<br>
-</pre>
-<p>Serialize the expression as compiled to the buffer</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>buf</tt></i>:</span></td>
-<td>a buffer to receive the output</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>expr</tt></i>:</span></td>
-<td>the compiled expression</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpExpDerive"></a>xmlExpExpDerive ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpExpDerive		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub)<br>
-</pre>
-<p>Evaluates the expression resulting from @exp consuming a sub expression @sub Based on algebraic derivation and sometimes direct Brzozowski derivation it usually takes less than linear time and can handle expressions generating infinite languages.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expressions context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the englobing expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>sub</tt></i>:</span></td>
-<td>the subexpression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the resulting expression or NULL in case of internal error, the result must be freed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpFree"></a>xmlExpFree ()</h3>
-<pre class="programlisting">void	xmlExpFree			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp)<br>
-</pre>
-<p>Dereference the expression</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the expression</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpFreeCtxt"></a>xmlExpFreeCtxt ()</h3>
-<pre class="programlisting">void	xmlExpFreeCtxt			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt)<br>
-</pre>
-<p>Free an expression context</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an expression context</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpGetLanguage"></a>xmlExpGetLanguage ()</h3>
-<pre class="programlisting">int	xmlExpGetLanguage		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** langList, <br>					 int len)<br>
-</pre>
-<p>Find all the strings used in @exp and store them in @list</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>langList</tt></i>:</span></td>
-<td>where to store the tokens</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the allocated length of @list</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpGetStart"></a>xmlExpGetStart ()</h3>
-<pre class="programlisting">int	xmlExpGetStart			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** tokList, <br>					 int len)<br>
-</pre>
-<p>Find all the strings that appears at the start of the languages accepted by @exp and store them in @list. E.g. for (a, b) | c it will return the list [a, c]</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>tokList</tt></i>:</span></td>
-<td>where to store the tokens</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the allocated length of @list</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpIsNillable"></a>xmlExpIsNillable ()</h3>
-<pre class="programlisting">int	xmlExpIsNillable		(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp)<br>
-</pre>
-<p>Finds if the expression is nillable, i.e. if it accepts the empty sequence</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if nillable, 0 if not and -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpMaxToken"></a>xmlExpMaxToken ()</h3>
-<pre class="programlisting">int	xmlExpMaxToken			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> expr)<br>
-</pre>
-<p>Indicate the maximum number of input a expression can accept</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>expr</tt></i>:</span></td>
-<td>a compiled expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the maximum length or -1 in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNewAtom"></a>xmlExpNewAtom ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewAtom		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 int len)<br>
-</pre>
-<p>Get the atom associated to this name from that context</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>the atom name</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the atom name length in byte (or -1);</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the node or NULL in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNewCtxt"></a>xmlExpNewCtxt ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a>	xmlExpNewCtxt		(int maxNodes, <br>					 <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a> dict)<br>
-</pre>
-<p>Creates a new context for manipulating expressions</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>maxNodes</tt></i>:</span></td>
-<td>the maximum number of nodes</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>dict</tt></i>:</span></td>
-<td>optional dictionary to use internally</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the context or NULL in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNewOr"></a>xmlExpNewOr ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewOr		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right)<br>
-</pre>
-<p>Get the atom associated to the choice @left | @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>left</tt></i>:</span></td>
-<td>left expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>right</tt></i>:</span></td>
-<td>right expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the node or NULL in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNewRange"></a>xmlExpNewRange ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewRange		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> subset, <br>					 int min, <br>					 int max)<br>
-</pre>
-<p>Get the atom associated to the range (@subset){@min, @max} Note that @subset is consumed in the operation, to keep an handle on it use xmlExpRef() and use xmlExpFree() to release it, this is true even in case of failure (unless ctxt == NULL).</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>subset</tt></i>:</span></td>
-<td>the expression to be repeated</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>min</tt></i>:</span></td>
-<td>the lower bound for the repetition</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>max</tt></i>:</span></td>
-<td>the upper bound for the repetition, -1 means infinite</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the node or NULL in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpNewSeq"></a>xmlExpNewSeq ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpNewSeq		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> left, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> right)<br>
-</pre>
-<p>Get the atom associated to the sequence @left , @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>left</tt></i>:</span></td>
-<td>left expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>right</tt></i>:</span></td>
-<td>right expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the node or NULL in case of error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpParse"></a>xmlExpParse ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpParse		(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 const char * expr)<br>
-</pre>
-<p>Minimal parser for regexps, it understand the following constructs - string terminals - choice operator | - sequence operator , - subexpressions (...) - usual cardinality operators + * and ? - finite sequences { min, max } - infinite sequences { min, * } There is minimal checkings made especially no checking on strings values</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expressions context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>expr</tt></i>:</span></td>
-<td>the 0 terminated string</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>a new expression or NULL in case of failure</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpRef"></a>xmlExpRef ()</h3>
-<pre class="programlisting">void	xmlExpRef			(<a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp)<br>
-</pre>
-<p>Increase the <a href="libxml2-SAX.html#reference">reference</a> count of the expression</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the expression</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpStringDerive"></a>xmlExpStringDerive ()</h3>
-<pre class="programlisting"><a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a>	xmlExpStringDerive	(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 int len)<br>
-</pre>
-<p>Do one step of Brzozowski derivation of the expression @exp with respect to the input string</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expression context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>str</tt></i>:</span></td>
-<td>the string</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the string len in bytes if available</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the resulting expression or NULL in case of internal error</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlExpSubsume"></a>xmlExpSubsume ()</h3>
-<pre class="programlisting">int	xmlExpSubsume			(<a href="libxml2-xmlregexp.html#xmlExpCtxtPtr">xmlExpCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> exp, <br>					 <a href="libxml2-xmlregexp.html#xmlExpNodePtr">xmlExpNodePtr</a> sub)<br>
-</pre>
-<p>Check whether @exp accepts all the languages accepted by @sub the input being a subexpression.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the expressions context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>exp</tt></i>:</span></td>
-<td>the englobing expression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>sub</tt></i>:</span></td>
-<td>the subexpression</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>1 if true 0 if false and -1 in case of failure.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlRegExecErrInfo"></a>xmlRegExecErrInfo ()</h3>
 <pre class="programlisting">int	xmlRegExecErrInfo		(<a href="libxml2-xmlregexp.html#xmlRegExecCtxtPtr">xmlRegExecCtxtPtr</a> exec, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** string, <br>					 int * nbval, <br>					 int * nbneg, <br>					 <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> ** values, <br>					 int * terminal)<br>
 </pre>
@@ -954,7 +380,7 @@
 <a name="xmlRegexpPrint"></a>xmlRegexpPrint ()</h3>
 <pre class="programlisting">void	xmlRegexpPrint			(FILE * output, <br>					 <a href="libxml2-xmlregexp.html#xmlRegexpPtr">xmlRegexpPtr</a> regexp)<br>
 </pre>
-<p>Print the content of the compiled regular expression</p>
+<p>DEPRECATED: Don't use. No-op since 2.14.0.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/devhelp/libxml2-xmlsave.html b/doc/devhelp/libxml2-xmlsave.html
index 083d0be..d4c4ce8 100644
--- a/doc/devhelp/libxml2-xmlsave.html
+++ b/doc/devhelp/libxml2-xmlsave.html
@@ -27,10 +27,11 @@
 typedef enum <a href="#xmlSaveOption">xmlSaveOption</a>;
 int	<a href="#xmlSaveClose">xmlSaveClose</a>			(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt);
 long	<a href="#xmlSaveDoc">xmlSaveDoc</a>			(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc);
-int	<a href="#xmlSaveFinish">xmlSaveFinish</a>			(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt);
+<a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	<a href="#xmlSaveFinish">xmlSaveFinish</a>		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt);
 int	<a href="#xmlSaveFlush">xmlSaveFlush</a>			(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt);
 int	<a href="#xmlSaveSetAttrEscape">xmlSaveSetAttrEscape</a>		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escape);
 int	<a href="#xmlSaveSetEscape">xmlSaveSetEscape</a>		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escape);
+int	<a href="#xmlSaveSetIndentString">xmlSaveSetIndentString</a>		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 const char * indent);
 <a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>	<a href="#xmlSaveToBuffer">xmlSaveToBuffer</a>		(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buffer, <br>					 const char * encoding, <br>					 int options);
 <a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>	<a href="#xmlSaveToFd">xmlSaveToFd</a>		(int fd, <br>					 const char * encoding, <br>					 int options);
 <a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>	<a href="#xmlSaveToFilename">xmlSaveToFilename</a>	(const char * filename, <br>					 const char * encoding, <br>					 int options);
@@ -74,7 +75,10 @@
     <a name="XML_SAVE_XHTML">XML_SAVE_XHTML</a> = 16 /* force XHTML1 specific rules */
     <a name="XML_SAVE_AS_XML">XML_SAVE_AS_XML</a> = 32 /* force XML serialization on HTML doc */
     <a name="XML_SAVE_AS_HTML">XML_SAVE_AS_HTML</a> = 64 /* force HTML serialization on XML doc */
-    <a name="XML_SAVE_WSNONSIG">XML_SAVE_WSNONSIG</a> = 128 /*  format with non-significant whitespace */
+    <a name="XML_SAVE_WSNONSIG">XML_SAVE_WSNONSIG</a> = 128 /* format with non-significant whitespace Available since 2.14.0 */
+    <a name="XML_SAVE_EMPTY">XML_SAVE_EMPTY</a> = 256 /* force empty tags, overriding global */
+    <a name="XML_SAVE_NO_INDENT">XML_SAVE_NO_INDENT</a> = 512 /* disable indenting */
+    <a name="XML_SAVE_INDENT">XML_SAVE_INDENT</a> = 1024 /*  force indenting, overriding global */
 };
 </pre>
 <p></p>
@@ -129,7 +133,7 @@
 <div class="refsect2" lang="en">
 <h3>
 <a name="xmlSaveFinish"></a>xmlSaveFinish ()</h3>
-<pre class="programlisting">int	xmlSaveFinish			(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt)<br>
+<pre class="programlisting"><a href="libxml2-xmlerror.html#xmlParserErrors">xmlParserErrors</a>	xmlSaveFinish		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt)<br>
 </pre>
 <p>Close a document saving context, i.e. make sure that all bytes have been output and free the associated data. Available since 2.13.0.</p>
 <div class="variablelist"><table border="0">
@@ -173,7 +177,7 @@
 <a name="xmlSaveSetAttrEscape"></a>xmlSaveSetAttrEscape ()</h3>
 <pre class="programlisting">int	xmlSaveSetAttrEscape		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escape)<br>
 </pre>
-<p>Set a custom escaping function to be used for text in <a href="libxml2-SAX.html#attribute">attribute</a> content</p>
+<p>DEPRECATED: Don't use. Has no effect.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -198,7 +202,7 @@
 <a name="xmlSaveSetEscape"></a>xmlSaveSetEscape ()</h3>
 <pre class="programlisting">int	xmlSaveSetEscape		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 <a href="libxml2-encoding.html#xmlCharEncodingOutputFunc">xmlCharEncodingOutputFunc</a> escape)<br>
 </pre>
-<p>Set a custom escaping function to be used for text in element content</p>
+<p>DEPRECATED: Don't use. Set a custom escaping function to be used for text in element content</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -220,6 +224,31 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlSaveSetIndentString"></a>xmlSaveSetIndentString ()</h3>
+<pre class="programlisting">int	xmlSaveSetIndentString		(<a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a> ctxt, <br>					 const char * indent)<br>
+</pre>
+<p>Sets the indent string. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>save context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>indent</tt></i>:</span></td>
+<td>indent string</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>0 on success, -1 if the string is NULL, empty or too long.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlSaveToBuffer"></a>xmlSaveToBuffer ()</h3>
 <pre class="programlisting"><a href="libxml2-xmlsave.html#xmlSaveCtxtPtr">xmlSaveCtxtPtr</a>	xmlSaveToBuffer		(<a href="libxml2-tree.html#xmlBufferPtr">xmlBufferPtr</a> buffer, <br>					 const char * encoding, <br>					 int options)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-xmlschemas.html b/doc/devhelp/libxml2-xmlschemas.html
index 77f1cfc..92e0e07 100644
--- a/doc/devhelp/libxml2-xmlschemas.html
+++ b/doc/devhelp/libxml2-xmlschemas.html
@@ -48,6 +48,7 @@
 int	<a href="#xmlSchemaSAXUnplug">xmlSchemaSAXUnplug</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaSAXPlugPtr">xmlSchemaSAXPlugPtr</a> plug);
 void	<a href="#xmlSchemaSetParserErrors">xmlSchemaSetParserErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx);
 void	<a href="#xmlSchemaSetParserStructuredErrors">xmlSchemaSetParserStructuredErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
+void	<a href="#xmlSchemaSetResourceLoader">xmlSchemaSetResourceLoader</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * data);
 void	<a href="#xmlSchemaSetValidErrors">xmlSchemaSetValidErrors</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx);
 int	<a href="#xmlSchemaSetValidOptions">xmlSchemaSetValidOptions</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 int options);
 void	<a href="#xmlSchemaSetValidStructuredErrors">xmlSchemaSetValidStructuredErrors</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>						 <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a> serror, <br>						 void * ctx);
@@ -58,7 +59,7 @@
 int	<a href="#xmlSchemaValidateOneElement">xmlSchemaValidateOneElement</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> elem);
 void	<a href="#xmlSchemaValidateSetFilename">xmlSchemaValidateSetFilename</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> vctxt, <br>					 const char * filename);
 void	<a href="#xmlSchemaValidateSetLocator">xmlSchemaValidateSetLocator</a>	(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> vctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a> f, <br>					 void * ctxt);
-int	<a href="#xmlSchemaValidateStream">xmlSchemaValidateStream</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 void * user_data);
+int	<a href="#xmlSchemaValidateStream">xmlSchemaValidateStream</a>		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 const <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * sax, <br>					 void * user_data);
 typedef void <a href="#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a>	(void * ctx, <br>					 const char * msg, <br>					 ... ...);
 typedef int <a href="#xmlSchemaValidityLocatorFunc">xmlSchemaValidityLocatorFunc</a>	(void * ctx, <br>					 const char ** file, <br>					 unsigned long * line);
 typedef void <a href="#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a>	(void * ctx, <br>					 const char * msg, <br>					 ... ...);
@@ -72,10 +73,10 @@
 <h3>
 <a name="xmlSchema">Structure </a>xmlSchema</h3>
 <pre class="programlisting">struct _xmlSchema {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: schema name
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace	: the target namespace
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	targetNamespace
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	version
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id	: Obsolete
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	id
     <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc
     <a href="libxml2-schemasInternals.html#xmlSchemaAnnotPtr">xmlSchemaAnnotPtr</a>	annot
     int	flags
@@ -85,14 +86,14 @@
     <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	elemDecl
     <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	notaDecl
     <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	schemasImports
-    void *	_private	: unused by the library for users or bindings
+    void *	_private
     <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	groupDecl
     <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	dict
-    void *	includes	: the includes, this is opaque for now
-    int	preserve	: whether to free the document
-    int	counter	: used to give anonymous components unique names
-    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	idcDef	: All identity-constraint defs.
-    void *	volatiles	: Obsolete
+    void *	includes
+    int	preserve
+    int	counter
+    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	idcDef
+    void *	volatiles
 } xmlSchema;
 </pre>
 <p></p>
@@ -654,6 +655,31 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlSchemaSetResourceLoader"></a>xmlSchemaSetResourceLoader ()</h3>
+<pre class="programlisting">void	xmlSchemaSetResourceLoader	(<a href="libxml2-xmlschemas.html#xmlSchemaParserCtxtPtr">xmlSchemaParserCtxtPtr</a> ctxt, <br>					 <a href="libxml2-parser.html#xmlResourceLoader">xmlResourceLoader</a> loader, <br>					 void * data)<br>
+</pre>
+<p>Register a callback function that will be called to load documents or external entities. Available since 2.14.0.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>schema parser</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>loader</tt></i>:</span></td>
+<td>resource loader</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>data</tt></i>:</span></td>
+<td>user data which will be passed to the loader</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlSchemaSetValidErrors"></a>xmlSchemaSetValidErrors ()</h3>
 <pre class="programlisting">void	xmlSchemaSetValidErrors		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc">xmlSchemaValidityErrorFunc</a> err, <br>					 <a href="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc">xmlSchemaValidityWarningFunc</a> warn, <br>					 void * ctx)<br>
 </pre>
@@ -902,7 +928,7 @@
 <div class="refsect2" lang="en">
 <h3>
 <a name="xmlSchemaValidateStream"></a>xmlSchemaValidateStream ()</h3>
-<pre class="programlisting">int	xmlSchemaValidateStream		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 <a href="libxml2-tree.html#xmlSAXHandlerPtr">xmlSAXHandlerPtr</a> sax, <br>					 void * user_data)<br>
+<pre class="programlisting">int	xmlSchemaValidateStream		(<a href="libxml2-xmlschemas.html#xmlSchemaValidCtxtPtr">xmlSchemaValidCtxtPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlParserInputBufferPtr">xmlParserInputBufferPtr</a> input, <br>					 <a href="libxml2-encoding.html#xmlCharEncoding">xmlCharEncoding</a> enc, <br>					 const <a href="libxml2-tree.html#xmlSAXHandler">xmlSAXHandler</a> * sax, <br>					 void * user_data)<br>
 </pre>
 <p>Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.</p>
 <div class="variablelist"><table border="0">
diff --git a/doc/devhelp/libxml2-xmlstring.html b/doc/devhelp/libxml2-xmlstring.html
index 1476ed2..2636a51 100644
--- a/doc/devhelp/libxml2-xmlstring.html
+++ b/doc/devhelp/libxml2-xmlstring.html
@@ -13,7 +13,7 @@
 <td><a accesskey="p" href="libxml2-xmlschemastypes.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 <td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
-<td><a accesskey="n" href="libxml2-xmlunicode.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
+<td><a accesskey="n" href="libxml2-xmlversion.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 <th width="100%" align="center">libxml2 Reference Manual</th>
 </tr></table>
 <h2><span class="refentrytitle">xmlstring</span></h2>
@@ -220,7 +220,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of <a href="libxml2-SAX.html#characters">characters</a> written to @buf or -1 if an error occurs.</td>
+<td>the number of characters written to @buf or -1 if an error occurs.</td>
 </tr>
 </tbody>
 </table></div>
@@ -282,7 +282,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of <a href="libxml2-SAX.html#characters">characters</a> written to @buf or -1 if an error occurs.</td>
+<td>the number of characters written to @buf or -1 if an error occurs.</td>
 </tr>
 </tbody>
 </table></div>
@@ -712,7 +712,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the number of <a href="libxml2-SAX.html#characters">characters</a> in the string or -1 in case of error</td>
+<td>the number of characters in the string or -1 in case of error</td>
 </tr>
 </tbody>
 </table></div>
@@ -808,11 +808,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>len</tt></i>:</span></td>
-<td>the number of <a href="libxml2-SAX.html#characters">characters</a> in the array</td>
+<td>the number of characters in the array</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the storage size of the first 'len' <a href="libxml2-SAX.html#characters">characters</a> of ARRAY</td>
+<td>the storage size of the first 'len' characters of ARRAY</td>
 </tr>
 </tbody>
 </table></div>
diff --git a/doc/devhelp/libxml2-xmlversion.html b/doc/devhelp/libxml2-xmlversion.html
index 73a0208..8cb1963 100644
--- a/doc/devhelp/libxml2-xmlversion.html
+++ b/doc/devhelp/libxml2-xmlversion.html
@@ -10,7 +10,7 @@
 </head>
 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
 <table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
-<td><a accesskey="p" href="libxml2-xmlunicode.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
+<td><a accesskey="p" href="libxml2-xmlstring.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 <td><a accesskey="u" href="general.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
 <td><a accesskey="n" href="libxml2-xmlwriter.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
@@ -27,13 +27,11 @@
 #define <a href="#LIBXML_CATALOG_ENABLED">LIBXML_CATALOG_ENABLED</a>;
 #define <a href="#LIBXML_DEBUG_ENABLED">LIBXML_DEBUG_ENABLED</a>;
 #define <a href="#LIBXML_DOTTED_VERSION">LIBXML_DOTTED_VERSION</a>;
-#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a>;
 #define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a>;
 #define <a href="#LIBXML_HTTP_ENABLED">LIBXML_HTTP_ENABLED</a>;
 #define <a href="#LIBXML_ICONV_ENABLED">LIBXML_ICONV_ENABLED</a>;
 #define <a href="#LIBXML_ICU_ENABLED">LIBXML_ICU_ENABLED</a>;
 #define <a href="#LIBXML_ISO8859X_ENABLED">LIBXML_ISO8859X_ENABLED</a>;
-#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a>;
 #define <a href="#LIBXML_LZMA_ENABLED">LIBXML_LZMA_ENABLED</a>;
 #define <a href="#LIBXML_MODULES_ENABLED">LIBXML_MODULES_ENABLED</a>;
 #define <a href="#LIBXML_MODULE_EXTENSION">LIBXML_MODULE_EXTENSION</a>;
@@ -42,6 +40,7 @@
 #define <a href="#LIBXML_PUSH_ENABLED">LIBXML_PUSH_ENABLED</a>;
 #define <a href="#LIBXML_READER_ENABLED">LIBXML_READER_ENABLED</a>;
 #define <a href="#LIBXML_REGEXP_ENABLED">LIBXML_REGEXP_ENABLED</a>;
+#define <a href="#LIBXML_RELAXNG_ENABLED">LIBXML_RELAXNG_ENABLED</a>;
 #define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a>;
 #define <a href="#LIBXML_SCHEMAS_ENABLED">LIBXML_SCHEMAS_ENABLED</a>;
 #define <a href="#LIBXML_SCHEMATRON_ENABLED">LIBXML_SCHEMATRON_ENABLED</a>;
@@ -49,7 +48,6 @@
 #define <a href="#LIBXML_THREAD_ALLOC_ENABLED">LIBXML_THREAD_ALLOC_ENABLED</a>;
 #define <a href="#LIBXML_THREAD_ENABLED">LIBXML_THREAD_ENABLED</a>;
 #define <a href="#LIBXML_TREE_ENABLED">LIBXML_TREE_ENABLED</a>;
-#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a>;
 #define <a href="#LIBXML_VALID_ENABLED">LIBXML_VALID_ENABLED</a>;
 #define <a href="#LIBXML_VERSION">LIBXML_VERSION</a>;
 #define <a href="#LIBXML_VERSION_EXTRA">LIBXML_VERSION_EXTRA</a>;
@@ -58,7 +56,6 @@
 #define <a href="#LIBXML_XINCLUDE_ENABLED">LIBXML_XINCLUDE_ENABLED</a>;
 #define <a href="#LIBXML_XPATH_ENABLED">LIBXML_XPATH_ENABLED</a>;
 #define <a href="#LIBXML_XPTR_ENABLED">LIBXML_XPTR_ENABLED</a>;
-#define <a href="#LIBXML_XPTR_LOCS_ENABLED">LIBXML_XPTR_LOCS_ENABLED</a>;
 #define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a>;
 </pre>
 </div>
@@ -108,14 +105,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="LIBXML_FTP_ENABLED">Macro </a>LIBXML_FTP_ENABLED</h3>
-<pre class="programlisting">#define <a href="#LIBXML_FTP_ENABLED">LIBXML_FTP_ENABLED</a>;
-</pre>
-<p>Whether the FTP support is configured in</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="LIBXML_HTML_ENABLED">Macro </a>LIBXML_HTML_ENABLED</h3>
 <pre class="programlisting">#define <a href="#LIBXML_HTML_ENABLED">LIBXML_HTML_ENABLED</a>;
 </pre>
@@ -156,14 +145,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="LIBXML_LEGACY_ENABLED">Macro </a>LIBXML_LEGACY_ENABLED</h3>
-<pre class="programlisting">#define <a href="#LIBXML_LEGACY_ENABLED">LIBXML_LEGACY_ENABLED</a>;
-</pre>
-<p>Whether the deprecated APIs are compiled in for compatibility</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="LIBXML_LZMA_ENABLED">Macro </a>LIBXML_LZMA_ENABLED</h3>
 <pre class="programlisting">#define <a href="#LIBXML_LZMA_ENABLED">LIBXML_LZMA_ENABLED</a>;
 </pre>
@@ -228,6 +209,14 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="LIBXML_RELAXNG_ENABLED">Macro </a>LIBXML_RELAXNG_ENABLED</h3>
+<pre class="programlisting">#define <a href="#LIBXML_RELAXNG_ENABLED">LIBXML_RELAXNG_ENABLED</a>;
+</pre>
+<p>Whether the RelaxNG validation interfaces are compiled in</p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="LIBXML_SAX1_ENABLED">Macro </a>LIBXML_SAX1_ENABLED</h3>
 <pre class="programlisting">#define <a href="#LIBXML_SAX1_ENABLED">LIBXML_SAX1_ENABLED</a>;
 </pre>
@@ -279,15 +268,7 @@
 <a name="LIBXML_TREE_ENABLED">Macro </a>LIBXML_TREE_ENABLED</h3>
 <pre class="programlisting">#define <a href="#LIBXML_TREE_ENABLED">LIBXML_TREE_ENABLED</a>;
 </pre>
-<p>Whether the DOM like tree manipulation API support is configured in</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="LIBXML_UNICODE_ENABLED">Macro </a>LIBXML_UNICODE_ENABLED</h3>
-<pre class="programlisting">#define <a href="#LIBXML_UNICODE_ENABLED">LIBXML_UNICODE_ENABLED</a>;
-</pre>
-<p>Whether the Unicode related interfaces are compiled in</p>
+<p>Always enabled since 2.14.0</p>
 </div>
 <hr>
 <div class="refsect2" lang="en">
@@ -356,14 +337,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="LIBXML_XPTR_LOCS_ENABLED">Macro </a>LIBXML_XPTR_LOCS_ENABLED</h3>
-<pre class="programlisting">#define <a href="#LIBXML_XPTR_LOCS_ENABLED">LIBXML_XPTR_LOCS_ENABLED</a>;
-</pre>
-<p>Whether support for XPointer locations is configured in</p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="LIBXML_ZLIB_ENABLED">Macro </a>LIBXML_ZLIB_ENABLED</h3>
 <pre class="programlisting">#define <a href="#LIBXML_ZLIB_ENABLED">LIBXML_ZLIB_ENABLED</a>;
 </pre>
diff --git a/doc/devhelp/libxml2-xmlwriter.html b/doc/devhelp/libxml2-xmlwriter.html
index 833c99a..cc39b64 100644
--- a/doc/devhelp/libxml2-xmlwriter.html
+++ b/doc/devhelp/libxml2-xmlwriter.html
@@ -387,7 +387,7 @@
 <a name="xmlTextWriterEndComment"></a>xmlTextWriterEndComment ()</h3>
 <pre class="programlisting">int	xmlTextWriterEndComment		(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br>
 </pre>
-<p>End the current xml <a href="libxml2-SAX.html#comment">comment</a>.</p>
+<p>End the current xml comment.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -431,7 +431,7 @@
 <a name="xmlTextWriterEndDTDAttlist"></a>xmlTextWriterEndDTDAttlist ()</h3>
 <pre class="programlisting">int	xmlTextWriterEndDTDAttlist	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br>
 </pre>
-<p>End an xml DTD <a href="libxml2-SAX.html#attribute">attribute</a> list.</p>
+<p>End an xml DTD attribute list.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -685,7 +685,7 @@
 <a name="xmlTextWriterStartAttribute"></a>xmlTextWriterStartAttribute ()</h3>
 <pre class="programlisting">int	xmlTextWriterStartAttribute	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
-<p>Start an xml <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Start an xml attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -711,7 +711,7 @@
 <a name="xmlTextWriterStartAttributeNS"></a>xmlTextWriterStartAttributeNS ()</h3>
 <pre class="programlisting">int	xmlTextWriterStartAttributeNS	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * namespaceURI)<br>
 </pre>
-<p>Start an xml <a href="libxml2-SAX.html#attribute">attribute</a> with namespace support.</p>
+<p>Start an xml attribute with namespace support.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -767,7 +767,7 @@
 <a name="xmlTextWriterStartComment"></a>xmlTextWriterStartComment ()</h3>
 <pre class="programlisting">int	xmlTextWriterStartComment	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer)<br>
 </pre>
-<p>Start an xml <a href="libxml2-SAX.html#comment">comment</a>.</p>
+<p>Start an xml comment.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1025,7 +1025,7 @@
 <a name="xmlTextWriterWriteAttribute"></a>xmlTextWriterWriteAttribute ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteAttribute	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Write an xml <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Write an xml attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1036,13 +1036,11 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>content</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> content</td>
+<td>attribute content</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1057,7 +1055,7 @@
 <a name="xmlTextWriterWriteAttributeNS"></a>xmlTextWriterWriteAttributeNS ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteAttributeNS	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * prefix, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * namespaceURI, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Write an xml <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Write an xml attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1072,8 +1070,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> local name</td>
+<td>attribute local name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>namespaceURI</tt></i>:</span></td>
@@ -1081,8 +1078,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>content</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> content</td>
+<td>attribute content</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1191,7 +1187,7 @@
 <a name="xmlTextWriterWriteComment"></a>xmlTextWriterWriteComment ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteComment	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>					 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * content)<br>
 </pre>
-<p>Write an xml <a href="libxml2-SAX.html#comment">comment</a>.</p>
+<p>Write an xml comment.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1202,8 +1198,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>content</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#comment">comment</a> string</td>
+<td>comment string</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1574,7 +1569,7 @@
 <a name="xmlTextWriterWriteFormatAttribute"></a>xmlTextWriterWriteFormatAttribute ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteFormatAttribute	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>						 const char * format, <br>						 ... ...)<br>
 </pre>
-<p>Write a formatted xml <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Write a formatted xml attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1585,8 +1580,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>format</tt></i>:</span></td>
@@ -1624,8 +1618,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> local name</td>
+<td>attribute local name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>namespaceURI</tt></i>:</span></td>
@@ -1682,7 +1675,7 @@
 <a name="xmlTextWriterWriteFormatComment"></a>xmlTextWriterWriteFormatComment ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteFormatComment	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>					 const char * format, <br>					 ... ...)<br>
 </pre>
-<p>Write an xml <a href="libxml2-SAX.html#comment">comment</a>.</p>
+<p>Write an xml comment.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2142,7 +2135,7 @@
 <a name="xmlTextWriterWriteVFormatAttribute"></a>xmlTextWriterWriteVFormatAttribute ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteVFormatAttribute	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>						 const char * format, <br>						 va_list argptr)<br>
 </pre>
-<p>Write a formatted xml <a href="libxml2-SAX.html#attribute">attribute</a>.</p>
+<p>Write a formatted xml attribute.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2153,8 +2146,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> name</td>
+<td>attribute name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>format</tt></i>:</span></td>
@@ -2192,8 +2184,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>name</tt></i>:</span></td>
-<td>
-<a href="libxml2-SAX.html#attribute">attribute</a> local name</td>
+<td>attribute local name</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>namespaceURI</tt></i>:</span></td>
@@ -2250,7 +2241,7 @@
 <a name="xmlTextWriterWriteVFormatComment"></a>xmlTextWriterWriteVFormatComment ()</h3>
 <pre class="programlisting">int	xmlTextWriterWriteVFormatComment	(<a href="libxml2-xmlwriter.html#xmlTextWriterPtr">xmlTextWriterPtr</a> writer, <br>						 const char * format, <br>						 va_list argptr)<br>
 </pre>
-<p>Write an xml <a href="libxml2-SAX.html#comment">comment</a>.</p>
+<p>Write an xml comment.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
diff --git a/doc/devhelp/libxml2-xpath.html b/doc/devhelp/libxml2-xpath.html
index fcc4273..d4f0eaf 100644
--- a/doc/devhelp/libxml2-xpath.html
+++ b/doc/devhelp/libxml2-xpath.html
@@ -171,9 +171,9 @@
 <h3>
 <a name="xmlNodeSet">Structure </a>xmlNodeSet</h3>
 <pre class="programlisting">struct _xmlNodeSet {
-    int	nodeNr	: number of nodes in the set
-    int	nodeMax	: size of the array as allocated
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> *	nodeTab	: array of nodes in no particular order @@ with_ns to check whether nam
+    int	nodeNr
+    int	nodeMax
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> *	nodeTab
 } xmlNodeSet;
 </pre>
 <p></p>
@@ -191,8 +191,8 @@
 <h3>
 <a name="xmlXPathAxis">Structure </a>xmlXPathAxis</h3>
 <pre class="programlisting">struct _xmlXPathAxis {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the axis name
-    <a href="libxml2-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a>	func	: the search function
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    <a href="libxml2-xpath.html#xmlXPathAxisFunc">xmlXPathAxisFunc</a>	func
 } xmlXPathAxis;
 </pre>
 <p></p>
@@ -228,45 +228,45 @@
 <h3>
 <a name="xmlXPathContext">Structure </a>xmlXPathContext</h3>
 <pre class="programlisting">struct _xmlXPathContext {
-    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc	: The current document
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node	: The current node
-    int	nb_variables_unused	: unused (hash table)
-    int	max_variables_unused	: unused (hash table)
-    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	varHash	: Hash table of defined variables
-    int	nb_types	: number of defined types
-    int	max_types	: max number of types
-    <a href="libxml2-xpath.html#xmlXPathTypePtr">xmlXPathTypePtr</a>	types	: Array of defined types
-    int	nb_funcs_unused	: unused (hash table)
-    int	max_funcs_unused	: unused (hash table)
-    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	funcHash	: Hash table of defined funcs
-    int	nb_axis	: number of defined axis
-    int	max_axis	: max number of axis
-    <a href="libxml2-xpath.html#xmlXPathAxisPtr">xmlXPathAxisPtr</a>	axis	: Array of defined axis the namespace nodes of the context node
-    <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> *	namespaces	: Array of namespaces
-    int	nsNr	: number of namespace in scope
-    void *	user	: function to free extra variables
-    int	contextSize	: the context size
-    int	proximityPosition	: the proximity position extra stuff for XPointer
-    int	xptr	: is this an XPointer context?
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	here	: for here()
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	origin	: for origin() the set of namespace declarations in scope for the expre
-    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	nsHash	: The namespaces hash table
-    <a href="libxml2-xpath.html#xmlXPathVariableLookupFunc">xmlXPathVariableLookupFunc</a>	varLookupFunc	: variable lookup func
-    void *	varLookupData	: variable lookup data Possibility to link in an extra item
-    void *	extra	: needed for XSLT The function name and URI when calling a function
+    <a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a>	doc
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	node
+    int	nb_variables_unused
+    int	max_variables_unused
+    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	varHash
+    int	nb_types
+    int	max_types
+    <a href="libxml2-xpath.html#xmlXPathTypePtr">xmlXPathTypePtr</a>	types
+    int	nb_funcs_unused
+    int	max_funcs_unused
+    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	funcHash
+    int	nb_axis
+    int	max_axis
+    <a href="libxml2-xpath.html#xmlXPathAxisPtr">xmlXPathAxisPtr</a>	axis
+    <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> *	namespaces
+    int	nsNr
+    void *	user
+    int	contextSize
+    int	proximityPosition
+    int	xptr
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	here
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	origin
+    <a href="libxml2-hash.html#xmlHashTablePtr">xmlHashTablePtr</a>	nsHash
+    <a href="libxml2-xpath.html#xmlXPathVariableLookupFunc">xmlXPathVariableLookupFunc</a>	varLookupFunc
+    void *	varLookupData
+    void *	extra
     const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	function
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	functionURI	: function lookup function and data
-    <a href="libxml2-xpath.html#xmlXPathFuncLookupFunc">xmlXPathFuncLookupFunc</a>	funcLookupFunc	: function lookup func
-    void *	funcLookupData	: function lookup data temporary namespace lists kept for walking the n
-    <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> *	tmpNsList	: Array of namespaces
-    int	tmpNsNr	: number of namespaces in scope error reporting mechanism
-    void *	userData	: user specific data block
-    <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a>	error	: the callback in case of errors
-    <a href="libxml2-xmlerror.html#xmlError">xmlError</a>	lastError	: the last error
-    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	debugNode	: the source node XSLT dictionary
-    <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	dict	: dictionary if any
-    int	flags	: flags to control compilation Cache for reusal of XPath objects
-    void *	cache	: Resource limits
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	functionURI
+    <a href="libxml2-xpath.html#xmlXPathFuncLookupFunc">xmlXPathFuncLookupFunc</a>	funcLookupFunc
+    void *	funcLookupData
+    <a href="libxml2-tree.html#xmlNsPtr">xmlNsPtr</a> *	tmpNsList
+    int	tmpNsNr
+    void *	userData
+    <a href="libxml2-xmlerror.html#xmlStructuredErrorFunc">xmlStructuredErrorFunc</a>	error
+    <a href="libxml2-xmlerror.html#xmlError">xmlError</a>	lastError
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	debugNode
+    <a href="libxml2-dict.html#xmlDictPtr">xmlDictPtr</a>	dict
+    int	flags
+    void *	cache
     unsigned long	opLimit
     unsigned long	opCount
     int	depth
@@ -331,8 +331,8 @@
 <h3>
 <a name="xmlXPathFunct">Structure </a>xmlXPathFunct</h3>
 <pre class="programlisting">struct _xmlXPathFunct {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the function name
-    <a href="libxml2-xpath.html#xmlXPathEvalFunc">xmlXPathEvalFunc</a>	func	: the evaluation function
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    <a href="libxml2-xpath.html#xmlXPathEvalFunc">xmlXPathEvalFunc</a>	func
 } xmlXPathFunct;
 </pre>
 <p></p>
@@ -373,9 +373,6 @@
     <a name="XPATH_BOOLEAN">XPATH_BOOLEAN</a> = 2
     <a name="XPATH_NUMBER">XPATH_NUMBER</a> = 3
     <a name="XPATH_STRING">XPATH_STRING</a> = 4
-    <a name="XPATH_POINT">XPATH_POINT</a> = 5
-    <a name="XPATH_RANGE">XPATH_RANGE</a> = 6
-    <a name="XPATH_LOCATIONSET">XPATH_LOCATIONSET</a> = 7
     <a name="XPATH_USERS">XPATH_USERS</a> = 8
     <a name="XPATH_XSLT_TREE">XPATH_XSLT_TREE</a> = 9 /*  An XSLT value tree, non modifiable */
 };
@@ -387,18 +384,18 @@
 <h3>
 <a name="xmlXPathParserContext">Structure </a>xmlXPathParserContext</h3>
 <pre class="programlisting">struct _xmlXPathParserContext {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	cur	: the current char being parsed
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	base	: the full expression
-    int	error	: error code
-    <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>	context	: the evaluation context
-    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	value	: the current value
-    int	valueNr	: number of values stacked
-    int	valueMax	: max number of values stacked
-    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> *	valueTab	: stack of values
-    <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	: always zero for compatibility
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	cur
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	base
+    int	error
+    <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>	context
+    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	value
+    int	valueNr
+    int	valueMax
+    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> *	valueTab
+    <a href="libxml2-xpath.html#xmlXPathCompExprPtr">xmlXPathCompExprPtr</a>	comp
+    int	xptr
+    <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	ancestor
+    int	valueFrame
 } xmlXPathParserContext;
 </pre>
 <p></p>
@@ -416,8 +413,8 @@
 <h3>
 <a name="xmlXPathType">Structure </a>xmlXPathType</h3>
 <pre class="programlisting">struct _xmlXPathType {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the type name
-    <a href="libxml2-xpath.html#xmlXPathConvertFunc">xmlXPathConvertFunc</a>	func	: the conversion function
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    <a href="libxml2-xpath.html#xmlXPathConvertFunc">xmlXPathConvertFunc</a>	func
 } xmlXPathType;
 </pre>
 <p></p>
@@ -435,8 +432,8 @@
 <h3>
 <a name="xmlXPathVariable">Structure </a>xmlXPathVariable</h3>
 <pre class="programlisting">struct _xmlXPathVariable {
-    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name	: the variable name
-    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	value	: the value
+    const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> *	name
+    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	value
 } xmlXPathVariable;
 </pre>
 <p></p>
diff --git a/doc/devhelp/libxml2-xpathInternals.html b/doc/devhelp/libxml2-xpathInternals.html
index 079f9b5..8a79367 100644
--- a/doc/devhelp/libxml2-xpathInternals.html
+++ b/doc/devhelp/libxml2-xpathInternals.html
@@ -32,6 +32,8 @@
 #define <a href="#CHECK_TYPE0">CHECK_TYPE0</a>(typeval);
 #define <a href="#XP_ERROR">XP_ERROR</a>(X);
 #define <a href="#XP_ERROR0">XP_ERROR0</a>(X);
+#define <a href="#valuePop">valuePop</a>;
+#define <a href="#valuePush">valuePush</a>;
 #define <a href="#xmlXPathCheckError">xmlXPathCheckError</a>(ctxt);
 #define <a href="#xmlXPathEmptyNodeSet">xmlXPathEmptyNodeSet</a>(ns);
 #define <a href="#xmlXPathGetContextNode">xmlXPathGetContextNode</a>(ctxt);
@@ -51,8 +53,6 @@
 #define <a href="#xmlXPathSetTypeError">xmlXPathSetTypeError</a>(ctxt);
 #define <a href="#xmlXPathStackIsExternal">xmlXPathStackIsExternal</a>(ctxt);
 #define <a href="#xmlXPathStackIsNodeSet">xmlXPathStackIsNodeSet</a>(ctxt);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#valuePop">valuePop</a>	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt);
-int	<a href="#valuePush">valuePush</a>			(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> value);
 void	<a href="#xmlXPathAddValues">xmlXPathAddValues</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt);
 void	<a href="#xmlXPathBooleanFunction">xmlXPathBooleanFunction</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs);
 void	<a href="#xmlXPathCeilingFunction">xmlXPathCeilingFunction</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs);
@@ -161,6 +161,8 @@
 void	<a href="#xmlXPathTranslateFunction">xmlXPathTranslateFunction</a>	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs);
 void	<a href="#xmlXPathTrueFunction">xmlXPathTrueFunction</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs);
 void	<a href="#xmlXPathValueFlipSign">xmlXPathValueFlipSign</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt);
+<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPathValuePop">xmlXPathValuePop</a>	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt);
+int	<a href="#xmlXPathValuePush">xmlXPathValuePush</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> value);
 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPathVariableLookup">xmlXPathVariableLookup</a>	(<a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name);
 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPathVariableLookupNS">xmlXPathVariableLookupNS</a>	(<a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt, <br>							 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name, <br>							 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * ns_uri);
 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPathWrapCString">xmlXPathWrapCString</a>	(char * val);
@@ -291,6 +293,22 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="valuePop">Macro </a>valuePop</h3>
+<pre class="programlisting">#define <a href="#valuePop">valuePop</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="valuePush">Macro </a>valuePush</h3>
+<pre class="programlisting">#define <a href="#valuePush">valuePush</a>;
+</pre>
+<p></p>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlXPathCheckError">Macro </a>xmlXPathCheckError</h3>
 <pre class="programlisting">#define <a href="#xmlXPathCheckError">xmlXPathCheckError</a>(ctxt);
 </pre>
@@ -612,52 +630,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="valuePop"></a>valuePop ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	valuePop	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt)<br>
-</pre>
-<p>Pops the top XPath object from the value stack</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XPath evaluation context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the XPath object just removed</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="valuePush"></a>valuePush ()</h3>
-<pre class="programlisting">int	valuePush			(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> value)<br>
-</pre>
-<p>Pushes a new XPath object on top of the value stack. If value is NULL, a memory error is recorded in the parser context.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>an XPath evaluation context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>value</tt></i>:</span></td>
-<td>the XPath object</td>
-</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. The object is destroyed in case of error.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlXPathAddValues"></a>xmlXPathAddValues ()</h3>
 <pre class="programlisting">void	xmlXPathAddValues		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt)<br>
 </pre>
@@ -984,7 +956,7 @@
 <a name="xmlXPathEvalExpr"></a>xmlXPathEvalExpr ()</h3>
 <pre class="programlisting">void	xmlXPathEvalExpr		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt)<br>
 </pre>
-<p>Parse and evaluate an XPath expression in the given context, then push the result on the context stack</p>
+<p>DEPRECATED: Internal function, don't use. Parse and evaluate an XPath expression in the given context, then push the result on the context stack</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -1160,7 +1132,7 @@
 <a name="xmlXPathIdFunction"></a>xmlXPathIdFunction ()</h3>
 <pre class="programlisting">void	xmlXPathIdFunction		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
 </pre>
-<p>Implement the id() XPath function node-set id(object) The id function selects elements by their unique ID (see [5.2.1 Unique IDs]). When the argument to id is of type node-set, then the result is the union of the result of applying id to the string value of each of the nodes in the argument node-set. When the argument to id is of any other type, the argument is converted to a string as if by a call to the string function; the string is split into a whitespace-separated list of tokens (whitespace is any sequence of <a href="libxml2-SAX.html#characters">characters</a> matching the production S); the result is a node-set containing the elements in the same document as the context node that have a unique ID equal to any of the tokens in the list.</p>
+<p>Implement the id() XPath function node-set id(object) The id function selects elements by their unique ID (see [5.2.1 Unique IDs]). When the argument to id is of type node-set, then the result is the union of the result of applying id to the string value of each of the nodes in the argument node-set. When the argument to id is of any other type, the argument is converted to a string as if by a call to the string function; the string is split into a whitespace-separated list of tokens (whitespace is any sequence of characters matching the production S); the result is a node-set containing the elements in the same document as the context node that have a unique ID equal to any of the tokens in the list.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1227,7 +1199,7 @@
 <a name="xmlXPathLangFunction"></a>xmlXPathLangFunction ()</h3>
 <pre class="programlisting">void	xmlXPathLangFunction		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
 </pre>
-<p>Implement the lang() XPath function boolean lang(string) The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang <a href="libxml2-SAX.html#attribute">attribute</a> on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang <a href="libxml2-SAX.html#attribute">attribute</a> on the nearest ancestor of the context node that has an xml:lang <a href="libxml2-SAX.html#attribute">attribute</a>. If there is no such attribute, then lang</p>
+<p>Implement the lang() XPath function boolean lang(string) The lang function returns true or false depending on whether the language of the context node as specified by xml:lang attributes is the same as or is a sublanguage of the language specified by the argument string. The language of the context node is determined by the value of the xml:lang attribute on the context node, or, if the context node has no xml:lang attribute, by the value of the xml:lang attribute on the nearest ancestor of the context node that has an xml:lang attribute. If there is no such attribute, then lang</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1623,7 +1595,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the current <a href="libxml2-SAX.html#attribute">attribute</a> in the traversal</td>
+<td>the current attribute in the traversal</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1713,7 +1685,7 @@
 <a name="xmlXPathNextFollowing"></a>xmlXPathNextFollowing ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlXPathNextFollowing	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br>
 </pre>
-<p>Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding <a href="libxml2-SAX.html#attribute">attribute</a> nodes and namespace nodes; the nodes are ordered in document order</p>
+<p>Traversal function for the "following" direction The following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes; the nodes are ordered in document order</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -1773,7 +1745,7 @@
 </tr>
 <tr>
 <td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the current <a href="libxml2-SAX.html#attribute">attribute</a> in the traversal</td>
+<td>the current attribute in the traversal</td>
 </tr>
 <tr>
 <td><span class="term"><i><tt>Returns</tt></i>:</span></td>
@@ -1813,7 +1785,7 @@
 <a name="xmlXPathNextPreceding"></a>xmlXPathNextPreceding ()</h3>
 <pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlXPathNextPreceding	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> cur)<br>
 </pre>
-<p>Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding <a href="libxml2-SAX.html#attribute">attribute</a> nodes and namespace nodes; the nodes are ordered in reverse document order</p>
+<p>Traversal function for the "preceding" direction the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes; the nodes are ordered in reverse document order</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2192,7 +2164,7 @@
 <a name="xmlXPathNormalizeFunction"></a>xmlXPathNormalizeFunction ()</h3>
 <pre class="programlisting">void	xmlXPathNormalizeFunction	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
 </pre>
-<p>Implement the normalize-space() XPath function string normalize-space(string?) The normalize-space function returns the argument string with white space normalized by stripping leading and trailing whitespace and replacing sequences of whitespace <a href="libxml2-SAX.html#characters">characters</a> by a single space. Whitespace <a href="libxml2-SAX.html#characters">characters</a> are the same allowed by the S production in XML. If the argument is omitted, it defaults to the context node converted to a string, in other words the value of the context node.</p>
+<p>Implement the normalize-space() XPath function string normalize-space(string?) The normalize-space function returns the argument string with white space normalized by stripping leading and trailing whitespace and replacing sequences of whitespace characters by a single space. Whitespace characters are the same allowed by the S production in XML. If the argument is omitted, it defaults to the context node converted to a string, in other words the value of the context node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2469,7 +2441,7 @@
 <a name="xmlXPathRegisterAllFunctions"></a>xmlXPathRegisterAllFunctions ()</h3>
 <pre class="programlisting">void	xmlXPathRegisterAllFunctions	(<a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt)<br>
 </pre>
-<p>Registers all default XPath functions in this context</p>
+<p>DEPRECATED: No-op since 2.14.0. Registers all default XPath functions in this context</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody><tr>
@@ -2831,7 +2803,7 @@
 <a name="xmlXPathStringLengthFunction"></a>xmlXPathStringLengthFunction ()</h3>
 <pre class="programlisting">void	xmlXPathStringLengthFunction	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
 </pre>
-<p>Implement the string-length() XPath function number string-length(string?) The string-length returns the number of <a href="libxml2-SAX.html#characters">characters</a> in the string (see [3.6 Strings]). If the argument is omitted, it defaults to the context node converted to a string, in other words the value of the context node.</p>
+<p>Implement the string-length() XPath function number string-length(string?) The string-length returns the number of characters in the string (see [3.6 Strings]). If the argument is omitted, it defaults to the context node converted to a string, in other words the value of the context node.</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -2909,7 +2881,7 @@
 <a name="xmlXPathSubstringFunction"></a>xmlXPathSubstringFunction ()</h3>
 <pre class="programlisting">void	xmlXPathSubstringFunction	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
 </pre>
-<p>Implement the substring() XPath function string substring(string, number, number?) The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345",2,3) returns "234". If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string. For example, substring("12345",2) returns "2345". More precisely, each character in the string (see [3.6 Strings]) is considered to have a numeric position: the position of the first character is 1, the position of the second character is 2 and so on. The returned substring contains those <a href="libxml2-SAX.html#characters">characters</a> for which the position of the character is greater than or equal to the second argument and, if the third argument is specified, less than the sum of the second and third arguments; the comparisons and addition used for the above follow the standard IEEE 754 rules. Thus: - substring("12345", 1.5, 2.6) returns "234" - substring("12345", 0, 3) returns "12" - substring("12345", 0 div 0, 3) returns "" - substring("12345", 1, 0 div 0) returns "" - substring("12345", -42, 1 div 0) returns "12345" - substring("12345", -1 div 0, 1 div 0) returns ""</p>
+<p>Implement the substring() XPath function string substring(string, number, number?) The substring function returns the substring of the first argument starting at the position specified in the second argument with length specified in the third argument. For example, substring("12345",2,3) returns "234". If the third argument is not specified, it returns the substring starting at the position specified in the second argument and continuing to the end of the string. For example, substring("12345",2) returns "2345". More precisely, each character in the string (see [3.6 Strings]) is considered to have a numeric position: the position of the first character is 1, the position of the second character is 2 and so on. The returned substring contains those characters for which the position of the character is greater than or equal to the second argument and, if the third argument is specified, less than the sum of the second and third arguments; the comparisons and addition used for the above follow the standard IEEE 754 rules. Thus: - substring("12345", 1.5, 2.6) returns "234" - substring("12345", 0, 3) returns "12" - substring("12345", 0 div 0, 3) returns "" - substring("12345", 1, 0 div 0) returns "" - substring("12345", -42, 1 div 0) returns "12345" - substring("12345", -1 div 0, 1 div 0) returns ""</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3001,7 +2973,7 @@
 <a name="xmlXPathTranslateFunction"></a>xmlXPathTranslateFunction ()</h3>
 <pre class="programlisting">void	xmlXPathTranslateFunction	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
 </pre>
-<p>Implement the translate() XPath function string translate(string, string, string) The translate function returns the first argument string with occurrences of <a href="libxml2-SAX.html#characters">characters</a> in the second argument string replaced by the character at the corresponding position in the third argument string. For example, translate("bar","abc","ABC") returns the string BAr. If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed. For example, translate("--aaa--","abc-","ABC")</p>
+<p>Implement the translate() XPath function string translate(string, string, string) The translate function returns the first argument string with occurrences of characters in the second argument string replaced by the character at the corresponding position in the third argument string. For example, translate("bar","abc","ABC") returns the string BAr. If there is a character in the second argument string with no character at a corresponding position in the third argument string (because the second argument string is longer than the third argument string), then occurrences of that character in the first argument string are removed. For example, translate("--aaa--","abc-","ABC")</p>
 <div class="variablelist"><table border="0">
 <col align="left">
 <tbody>
@@ -3055,6 +3027,52 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
+<a name="xmlXPathValuePop"></a>xmlXPathValuePop ()</h3>
+<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPathValuePop	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt)<br>
+</pre>
+<p>Pops the top XPath object from the value stack</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>an XPath evaluation context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
+<td>the XPath object just removed</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
+<a name="xmlXPathValuePush"></a>xmlXPathValuePush ()</h3>
+<pre class="programlisting">int	xmlXPathValuePush		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> value)<br>
+</pre>
+<p>Pushes a new XPath object on top of the value stack. If value is NULL, a memory error is recorded in the parser context.</p>
+<div class="variablelist"><table border="0">
+<col align="left">
+<tbody>
+<tr>
+<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
+<td>an XPath evaluation context</td>
+</tr>
+<tr>
+<td><span class="term"><i><tt>value</tt></i>:</span></td>
+<td>the XPath object</td>
+</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. The object is destroyed in case of error.</td>
+</tr>
+</tbody>
+</table></div>
+</div>
+<hr>
+<div class="refsect2" lang="en">
+<h3>
 <a name="xmlXPathVariableLookup"></a>xmlXPathVariableLookup ()</h3>
 <pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPathVariableLookup	(<a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctxt, <br>						 const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * name)<br>
 </pre>
diff --git a/doc/devhelp/libxml2-xpointer.html b/doc/devhelp/libxml2-xpointer.html
index 7f0595f..50f1ce7 100644
--- a/doc/devhelp/libxml2-xpointer.html
+++ b/doc/devhelp/libxml2-xpointer.html
@@ -21,29 +21,8 @@
 <p>Author(s): Daniel Veillard </p>
 <div class="refsynopsisdiv">
 <h2>Synopsis</h2>
-<pre class="synopsis">typedef struct _xmlLocationSet <a href="#xmlLocationSet">xmlLocationSet</a>;
-typedef <a href="libxml2-xpointer.html#xmlLocationSet">xmlLocationSet</a> * <a href="#xmlLocationSetPtr">xmlLocationSetPtr</a>;
-<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	<a href="#xmlXPtrBuildNodeList">xmlXPtrBuildNodeList</a>	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrEval">xmlXPtrEval</a>	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx);
-void	<a href="#xmlXPtrEvalRangePredicate">xmlXPtrEvalRangePredicate</a>	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt);
-void	<a href="#xmlXPtrFreeLocationSet">xmlXPtrFreeLocationSet</a>		(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> obj);
-void	<a href="#xmlXPtrLocationSetAdd">xmlXPtrLocationSetAdd</a>		(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> cur, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
-<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a>	<a href="#xmlXPtrLocationSetCreate">xmlXPtrLocationSetCreate</a>	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
-void	<a href="#xmlXPtrLocationSetDel">xmlXPtrLocationSetDel</a>		(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> cur, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val);
-<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a>	<a href="#xmlXPtrLocationSetMerge">xmlXPtrLocationSetMerge</a>	(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> val1, <br>						 <a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> val2);
-void	<a href="#xmlXPtrLocationSetRemove">xmlXPtrLocationSetRemove</a>	(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> cur, <br>					 int val);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewCollapsedRange">xmlXPtrNewCollapsedRange</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start);
+<pre class="synopsis"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrEval">xmlXPtrEval</a>	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx);
 <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>	<a href="#xmlXPtrNewContext">xmlXPtrNewContext</a>	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> here, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> origin);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewLocationSetNodeSet">xmlXPtrNewLocationSetNodeSet</a>	(<a href="libxml2-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> set);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewLocationSetNodes">xmlXPtrNewLocationSetNodes</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>							 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewRange">xmlXPtrNewRange</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>					 int startindex, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end, <br>					 int endindex);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewRangeNodeObject">xmlXPtrNewRangeNodeObject</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>							 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> end);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewRangeNodePoint">xmlXPtrNewRangeNodePoint</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>							 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> end);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewRangeNodes">xmlXPtrNewRangeNodes</a>	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewRangePointNode">xmlXPtrNewRangePointNode</a>	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> start, <br>							 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrNewRangePoints">xmlXPtrNewRangePoints</a>	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> start, <br>						 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> end);
-void	<a href="#xmlXPtrRangeToFunction">xmlXPtrRangeToFunction</a>		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs);
-<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	<a href="#xmlXPtrWrapLocationSet">xmlXPtrWrapLocationSet</a>	(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> val);
 </pre>
 </div>
 <div class="refsect1" lang="en"><h2>Description</h2></div>
@@ -52,47 +31,6 @@
 <div class="refsect2" lang="en">
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlLocationSet">Structure </a>xmlLocationSet</h3>
-<pre class="programlisting">struct _xmlLocationSet {
-    int	locNr	: number of locations in the set
-    int	locMax	: size of the array as allocated
-    <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> *	locTab	: array of locations
-} xmlLocationSet;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlLocationSetPtr">Typedef </a>xmlLocationSetPtr</h3>
-<pre class="programlisting"><a href="libxml2-xpointer.html#xmlLocationSet">xmlLocationSet</a> * xmlLocationSetPtr;
-</pre>
-<p></p>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrBuildNodeList"></a>xmlXPtrBuildNodeList ()</h3>
-<pre class="programlisting"><a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a>	xmlXPtrBuildNodeList	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> obj)<br>
-</pre>
-<p>Build a node list tree copy of the XPointer result. This will drop Attributes and Namespace declarations.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>obj</tt></i>:</span></td>
-<td>the XPointer result from the evaluation.</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>an <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> list or NULL. the caller has to free the node tree.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlXPtrEval"></a>xmlXPtrEval ()</h3>
 <pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrEval	(const <a href="libxml2-xmlstring.html#xmlChar">xmlChar</a> * str, <br>					 <a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a> ctx)<br>
 </pre>
@@ -118,168 +56,6 @@
 <hr>
 <div class="refsect2" lang="en">
 <h3>
-<a name="xmlXPtrEvalRangePredicate"></a>xmlXPtrEvalRangePredicate ()</h3>
-<pre class="programlisting">void	xmlXPtrEvalRangePredicate	(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt)<br>
-</pre>
-<p>[8] Predicate ::= '[' PredicateExpr ']' [9] PredicateExpr ::= Expr Evaluate a predicate as in xmlXPathEvalPredicate() but for a Location Set instead of a node set</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the XPointer Parser context</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrFreeLocationSet"></a>xmlXPtrFreeLocationSet ()</h3>
-<pre class="programlisting">void	xmlXPtrFreeLocationSet		(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> obj)<br>
-</pre>
-<p>Free the LocationSet compound (not the actual ranges !).</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody><tr>
-<td><span class="term"><i><tt>obj</tt></i>:</span></td>
-<td>the <a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> to free</td>
-</tr></tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrLocationSetAdd"></a>xmlXPtrLocationSetAdd ()</h3>
-<pre class="programlisting">void	xmlXPtrLocationSetAdd		(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> cur, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val)<br>
-</pre>
-<p>add a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> to an existing LocationSet If the location already exist in the set @val is freed.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the initial range set</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>val</tt></i>:</span></td>
-<td>a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrLocationSetCreate"></a>xmlXPtrLocationSetCreate ()</h3>
-<pre class="programlisting"><a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a>	xmlXPtrLocationSetCreate	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> of type double and of value @val</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>val</tt></i>:</span></td>
-<td>an initial xmlXPathObjectPtr, or NULL</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrLocationSetDel"></a>xmlXPtrLocationSetDel ()</h3>
-<pre class="programlisting">void	xmlXPtrLocationSetDel		(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> cur, <br>					 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> val)<br>
-</pre>
-<p>Removes an <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> from an existing LocationSet</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the initial range set</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>val</tt></i>:</span></td>
-<td>an <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>
-</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrLocationSetMerge"></a>xmlXPtrLocationSetMerge ()</h3>
-<pre class="programlisting"><a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a>	xmlXPtrLocationSetMerge	(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> val1, <br>						 <a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> val2)<br>
-</pre>
-<p>Merges two rangesets, all ranges from @val2 are added to @val1</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>val1</tt></i>:</span></td>
-<td>the first LocationSet</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>val2</tt></i>:</span></td>
-<td>the second LocationSet</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>val1 once extended or NULL in case of error.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrLocationSetRemove"></a>xmlXPtrLocationSetRemove ()</h3>
-<pre class="programlisting">void	xmlXPtrLocationSetRemove	(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> cur, <br>					 int val)<br>
-</pre>
-<p>Removes an entry from an existing LocationSet list.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>cur</tt></i>:</span></td>
-<td>the initial range set</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>val</tt></i>:</span></td>
-<td>the index to remove</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewCollapsedRange"></a>xmlXPtrNewCollapsedRange ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewCollapsedRange	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range using a single nodes</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting and ending node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
 <a name="xmlXPtrNewContext"></a>xmlXPtrNewContext ()</h3>
 <pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathContextPtr">xmlXPathContextPtr</a>	xmlXPtrNewContext	(<a href="libxml2-tree.html#xmlDocPtr">xmlDocPtr</a> doc, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> here, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> origin)<br>
 </pre>
@@ -307,252 +83,6 @@
 </table></div>
 </div>
 <hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewLocationSetNodeSet"></a>xmlXPtrNewLocationSetNodeSet ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewLocationSetNodeSet	(<a href="libxml2-xpath.html#xmlNodeSetPtr">xmlNodeSetPtr</a> set)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type LocationSet and initialize it with all the nodes from @set</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>set</tt></i>:</span></td>
-<td>a node set</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewLocationSetNodes"></a>xmlXPtrNewLocationSetNodes ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewLocationSetNodes	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>							 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type LocationSet and initialize it with the single range made of the two nodes @start and @end</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the start NodePtr value</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the end NodePtr value or NULL</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewRange"></a>xmlXPtrNewRange ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewRange	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>					 int startindex, <br>					 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end, <br>					 int endindex)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>startindex</tt></i>:</span></td>
-<td>the start index</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the ending point</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>endindex</tt></i>:</span></td>
-<td>the ending index</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewRangeNodeObject"></a>xmlXPtrNewRangeNodeObject ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewRangeNodeObject	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>							 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> end)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range from a not to an object</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the ending object</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewRangeNodePoint"></a>xmlXPtrNewRangeNodePoint ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewRangeNodePoint	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>							 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> end)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range from a node to a point</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the ending point</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewRangeNodes"></a>xmlXPtrNewRangeNodes ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewRangeNodes	(<a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> start, <br>						 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range using 2 nodes</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the ending node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewRangePointNode"></a>xmlXPtrNewRangePointNode ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewRangePointNode	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> start, <br>							 <a href="libxml2-tree.html#xmlNodePtr">xmlNodePtr</a> end)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range from a point to a node</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting point</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the ending node</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrNewRangePoints"></a>xmlXPtrNewRangePoints ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrNewRangePoints	(<a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> start, <br>						 <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> end)<br>
-</pre>
-<p>Create a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a> of type range using 2 Points</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>start</tt></i>:</span></td>
-<td>the starting point</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>end</tt></i>:</span></td>
-<td>the ending point</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrRangeToFunction"></a>xmlXPtrRangeToFunction ()</h3>
-<pre class="programlisting">void	xmlXPtrRangeToFunction		(<a href="libxml2-xpath.html#xmlXPathParserContextPtr">xmlXPathParserContextPtr</a> ctxt, <br>					 int nargs)<br>
-</pre>
-<p>Implement the range-to() XPointer function Obsolete. range-to is not a real function but a special type of location step which is handled in xpath.c.</p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>ctxt</tt></i>:</span></td>
-<td>the XPointer Parser context</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>nargs</tt></i>:</span></td>
-<td>the number of args</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
-<div class="refsect2" lang="en">
-<h3>
-<a name="xmlXPtrWrapLocationSet"></a>xmlXPtrWrapLocationSet ()</h3>
-<pre class="programlisting"><a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a>	xmlXPtrWrapLocationSet	(<a href="libxml2-xpointer.html#xmlLocationSetPtr">xmlLocationSetPtr</a> val)<br>
-</pre>
-<p>Wrap the LocationSet @val in a new <a href="libxml2-xpath.html#xmlXPathObjectPtr">xmlXPathObjectPtr</a></p>
-<div class="variablelist"><table border="0">
-<col align="left">
-<tbody>
-<tr>
-<td><span class="term"><i><tt>val</tt></i>:</span></td>
-<td>the LocationSet value</td>
-</tr>
-<tr>
-<td><span class="term"><i><tt>Returns</tt></i>:</span></td>
-<td>the newly created object.</td>
-</tr>
-</tbody>
-</table></div>
-</div>
-<hr>
 </div>
 </div>
 </body>
diff --git a/doc/devhelp/libxml2.devhelp2 b/doc/devhelp/libxml2.devhelp2
index 4076f96..b28dfd2 100644
--- a/doc/devhelp/libxml2.devhelp2
+++ b/doc/devhelp/libxml2.devhelp2
@@ -4,7 +4,6 @@
     <sub name="API" link="general.html">
       <sub name="HTMLparser" link="libxml2-HTMLparser.html"/>
       <sub name="HTMLtree" link="libxml2-HTMLtree.html"/>
-      <sub name="SAX" link="libxml2-SAX.html"/>
       <sub name="SAX2" link="libxml2-SAX2.html"/>
       <sub name="c14n" link="libxml2-c14n.html"/>
       <sub name="catalog" link="libxml2-catalog.html"/>
@@ -16,7 +15,6 @@
       <sub name="globals" link="libxml2-globals.html"/>
       <sub name="hash" link="libxml2-hash.html"/>
       <sub name="list" link="libxml2-list.html"/>
-      <sub name="nanoftp" link="libxml2-nanoftp.html"/>
       <sub name="nanohttp" link="libxml2-nanohttp.html"/>
       <sub name="parser" link="libxml2-parser.html"/>
       <sub name="parserInternals" link="libxml2-parserInternals.html"/>
@@ -42,7 +40,6 @@
       <sub name="xmlschemas" link="libxml2-xmlschemas.html"/>
       <sub name="xmlschemastypes" link="libxml2-xmlschemastypes.html"/>
       <sub name="xmlstring" link="libxml2-xmlstring.html"/>
-      <sub name="xmlunicode" link="libxml2-xmlunicode.html"/>
       <sub name="xmlversion" link="libxml2-xmlversion.html"/>
       <sub name="xmlwriter" link="libxml2-xmlwriter.html"/>
       <sub name="xpath" link="libxml2-xpath.html"/>
@@ -52,7 +49,6 @@
   </chapters>
   <functions>
     <keyword type="macro" name="BAD_CAST" link="libxml2-xmlstring.html#BAD_CAST"/>
-    <keyword type="macro" name="BASE_BUFFER_SIZE" link="libxml2-tree.html#BASE_BUFFER_SIZE"/>
     <keyword type="macro" name="CAST_TO_BOOLEAN" link="libxml2-xpathInternals.html#CAST_TO_BOOLEAN"/>
     <keyword type="macro" name="CAST_TO_NUMBER" link="libxml2-xpathInternals.html#CAST_TO_NUMBER"/>
     <keyword type="macro" name="CAST_TO_STRING" link="libxml2-xpathInternals.html#CAST_TO_STRING"/>
@@ -66,8 +62,6 @@
     <keyword type="macro" name="HTML_PI_NODE" link="libxml2-HTMLtree.html#HTML_PI_NODE"/>
     <keyword type="macro" name="HTML_PRESERVE_NODE" link="libxml2-HTMLtree.html#HTML_PRESERVE_NODE"/>
     <keyword type="macro" name="HTML_TEXT_NODE" link="libxml2-HTMLtree.html#HTML_TEXT_NODE"/>
-    <keyword type="macro" name="INPUT_CHUNK" link="libxml2-parserInternals.html#INPUT_CHUNK"/>
-    <keyword type="macro" name="INVALID_SOCKET" link="libxml2-nanoftp.html#INVALID_SOCKET"/>
     <keyword type="macro" name="IS_ASCII_DIGIT" link="libxml2-parserInternals.html#IS_ASCII_DIGIT"/>
     <keyword type="macro" name="IS_ASCII_LETTER" link="libxml2-parserInternals.html#IS_ASCII_LETTER"/>
     <keyword type="macro" name="IS_BASECHAR" link="libxml2-parserInternals.html#IS_BASECHAR"/>
@@ -93,13 +87,11 @@
     <keyword type="macro" name="LIBXML_CATALOG_ENABLED" link="libxml2-xmlversion.html#LIBXML_CATALOG_ENABLED"/>
     <keyword type="macro" name="LIBXML_DEBUG_ENABLED" link="libxml2-xmlversion.html#LIBXML_DEBUG_ENABLED"/>
     <keyword type="macro" name="LIBXML_DOTTED_VERSION" link="libxml2-xmlversion.html#LIBXML_DOTTED_VERSION"/>
-    <keyword type="macro" name="LIBXML_FTP_ENABLED" link="libxml2-xmlversion.html#LIBXML_FTP_ENABLED"/>
     <keyword type="macro" name="LIBXML_HTML_ENABLED" link="libxml2-xmlversion.html#LIBXML_HTML_ENABLED"/>
     <keyword type="macro" name="LIBXML_HTTP_ENABLED" link="libxml2-xmlversion.html#LIBXML_HTTP_ENABLED"/>
     <keyword type="macro" name="LIBXML_ICONV_ENABLED" link="libxml2-xmlversion.html#LIBXML_ICONV_ENABLED"/>
     <keyword type="macro" name="LIBXML_ICU_ENABLED" link="libxml2-xmlversion.html#LIBXML_ICU_ENABLED"/>
     <keyword type="macro" name="LIBXML_ISO8859X_ENABLED" link="libxml2-xmlversion.html#LIBXML_ISO8859X_ENABLED"/>
-    <keyword type="macro" name="LIBXML_LEGACY_ENABLED" link="libxml2-xmlversion.html#LIBXML_LEGACY_ENABLED"/>
     <keyword type="macro" name="LIBXML_LZMA_ENABLED" link="libxml2-xmlversion.html#LIBXML_LZMA_ENABLED"/>
     <keyword type="macro" name="LIBXML_MODULES_ENABLED" link="libxml2-xmlversion.html#LIBXML_MODULES_ENABLED"/>
     <keyword type="macro" name="LIBXML_MODULE_EXTENSION" link="libxml2-xmlversion.html#LIBXML_MODULE_EXTENSION"/>
@@ -108,6 +100,7 @@
     <keyword type="macro" name="LIBXML_PUSH_ENABLED" link="libxml2-xmlversion.html#LIBXML_PUSH_ENABLED"/>
     <keyword type="macro" name="LIBXML_READER_ENABLED" link="libxml2-xmlversion.html#LIBXML_READER_ENABLED"/>
     <keyword type="macro" name="LIBXML_REGEXP_ENABLED" link="libxml2-xmlversion.html#LIBXML_REGEXP_ENABLED"/>
+    <keyword type="macro" name="LIBXML_RELAXNG_ENABLED" link="libxml2-xmlversion.html#LIBXML_RELAXNG_ENABLED"/>
     <keyword type="macro" name="LIBXML_SAX1_ENABLED" link="libxml2-xmlversion.html#LIBXML_SAX1_ENABLED"/>
     <keyword type="macro" name="LIBXML_SCHEMAS_ENABLED" link="libxml2-xmlversion.html#LIBXML_SCHEMAS_ENABLED"/>
     <keyword type="macro" name="LIBXML_SCHEMATRON_ENABLED" link="libxml2-xmlversion.html#LIBXML_SCHEMATRON_ENABLED"/>
@@ -115,7 +108,6 @@
     <keyword type="macro" name="LIBXML_THREAD_ALLOC_ENABLED" link="libxml2-xmlversion.html#LIBXML_THREAD_ALLOC_ENABLED"/>
     <keyword type="macro" name="LIBXML_THREAD_ENABLED" link="libxml2-xmlversion.html#LIBXML_THREAD_ENABLED"/>
     <keyword type="macro" name="LIBXML_TREE_ENABLED" link="libxml2-xmlversion.html#LIBXML_TREE_ENABLED"/>
-    <keyword type="macro" name="LIBXML_UNICODE_ENABLED" link="libxml2-xmlversion.html#LIBXML_UNICODE_ENABLED"/>
     <keyword type="macro" name="LIBXML_VALID_ENABLED" link="libxml2-xmlversion.html#LIBXML_VALID_ENABLED"/>
     <keyword type="macro" name="LIBXML_VERSION" link="libxml2-xmlversion.html#LIBXML_VERSION"/>
     <keyword type="macro" name="LIBXML_VERSION_EXTRA" link="libxml2-xmlversion.html#LIBXML_VERSION_EXTRA"/>
@@ -124,9 +116,9 @@
     <keyword type="macro" name="LIBXML_XINCLUDE_ENABLED" link="libxml2-xmlversion.html#LIBXML_XINCLUDE_ENABLED"/>
     <keyword type="macro" name="LIBXML_XPATH_ENABLED" link="libxml2-xmlversion.html#LIBXML_XPATH_ENABLED"/>
     <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="SOCKET" link="libxml2-nanoftp.html#SOCKET"/>
+    <keyword type="macro" name="UTF8ToHtml" link="libxml2-HTMLparser.html#UTF8ToHtml"/>
+    <keyword type="macro" name="UTF8Toisolat1" link="libxml2-encoding.html#UTF8Toisolat1"/>
     <keyword type="macro" name="XINCLUDE_FALLBACK" link="libxml2-xinclude.html#XINCLUDE_FALLBACK"/>
     <keyword type="macro" name="XINCLUDE_HREF" link="libxml2-xinclude.html#XINCLUDE_HREF"/>
     <keyword type="macro" name="XINCLUDE_NODE" link="libxml2-xinclude.html#XINCLUDE_NODE"/>
@@ -246,7 +238,15 @@
     <keyword type="macro" name="htmlDefaultSubelement" link="libxml2-HTMLparser.html#htmlDefaultSubelement"/>
     <keyword type="macro" name="htmlElementAllowedHereDesc" link="libxml2-HTMLparser.html#htmlElementAllowedHereDesc"/>
     <keyword type="macro" name="htmlRequiredAttrs" link="libxml2-HTMLparser.html#htmlRequiredAttrs"/>
+    <keyword type="macro" name="initGenericErrorDefaultFunc" link="libxml2-xmlerror.html#initGenericErrorDefaultFunc"/>
+    <keyword type="macro" name="inputPop" link="libxml2-parserInternals.html#inputPop"/>
+    <keyword type="macro" name="inputPush" link="libxml2-parserInternals.html#inputPush"/>
+    <keyword type="macro" name="isolat1ToUTF8" link="libxml2-encoding.html#isolat1ToUTF8"/>
+    <keyword type="macro" name="valuePop" link="libxml2-xpathInternals.html#valuePop"/>
+    <keyword type="macro" name="valuePush" link="libxml2-xpathInternals.html#valuePush"/>
+    <keyword type="macro" name="xmlBufferAllocScheme" link="libxml2-tree.html#xmlBufferAllocScheme"/>
     <keyword type="macro" name="xmlChildrenNode" link="libxml2-tree.html#xmlChildrenNode"/>
+    <keyword type="macro" name="xmlDefaultBufferSize" link="libxml2-tree.html#xmlDefaultBufferSize"/>
     <keyword type="macro" name="xmlIsBaseCharQ" link="libxml2-chvalid.html#xmlIsBaseCharQ"/>
     <keyword type="macro" name="xmlIsBaseChar_ch" link="libxml2-chvalid.html#xmlIsBaseChar_ch"/>
     <keyword type="macro" name="xmlIsBlankQ" link="libxml2-chvalid.html#xmlIsBlankQ"/>
@@ -261,6 +261,7 @@
     <keyword type="macro" name="xmlIsIdeographicQ" link="libxml2-chvalid.html#xmlIsIdeographicQ"/>
     <keyword type="macro" name="xmlIsPubidCharQ" link="libxml2-chvalid.html#xmlIsPubidCharQ"/>
     <keyword type="macro" name="xmlIsPubidChar_ch" link="libxml2-chvalid.html#xmlIsPubidChar_ch"/>
+    <keyword type="macro" name="xmlParserMaxDepth" link="libxml2-parserInternals.html#xmlParserMaxDepth"/>
     <keyword type="macro" name="xmlRootNode" link="libxml2-tree.html#xmlRootNode"/>
     <keyword type="macro" name="xmlTextWriterWriteDocType" link="libxml2-xmlwriter.html#xmlTextWriterWriteDocType"/>
     <keyword type="macro" name="xmlTextWriterWriteProcessingInstruction" link="libxml2-xmlwriter.html#xmlTextWriterWriteProcessingInstruction"/>
@@ -289,7 +290,10 @@
     <keyword type="enum" name="HTML_DEPRECATED" link="libxml2-HTMLparser.html#HTML_DEPRECATED"/>
     <keyword type="enum" name="HTML_INVALID" link="libxml2-HTMLparser.html#HTML_INVALID"/>
     <keyword type="enum" name="HTML_NA" link="libxml2-HTMLparser.html#HTML_NA"/>
+    <keyword type="enum" name="HTML_PARSE_BIG_LINES" link="libxml2-HTMLparser.html#HTML_PARSE_BIG_LINES"/>
     <keyword type="enum" name="HTML_PARSE_COMPACT" link="libxml2-HTMLparser.html#HTML_PARSE_COMPACT"/>
+    <keyword type="enum" name="HTML_PARSE_HTML5" link="libxml2-HTMLparser.html#HTML_PARSE_HTML5"/>
+    <keyword type="enum" name="HTML_PARSE_HUGE" link="libxml2-HTMLparser.html#HTML_PARSE_HUGE"/>
     <keyword type="enum" name="HTML_PARSE_IGNORE_ENC" link="libxml2-HTMLparser.html#HTML_PARSE_IGNORE_ENC"/>
     <keyword type="enum" name="HTML_PARSE_NOBLANKS" link="libxml2-HTMLparser.html#HTML_PARSE_NOBLANKS"/>
     <keyword type="enum" name="HTML_PARSE_NODEFDTD" link="libxml2-HTMLparser.html#HTML_PARSE_NODEFDTD"/>
@@ -359,6 +363,12 @@
     <keyword type="enum" name="XML_CDATA_SECTION_NODE" link="libxml2-tree.html#XML_CDATA_SECTION_NODE"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_2022_JP" link="libxml2-encoding.html#XML_CHAR_ENCODING_2022_JP"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_8859_1" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_1"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_8859_10" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_10"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_8859_11" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_11"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_8859_13" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_13"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_8859_14" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_14"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_8859_15" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_15"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_8859_16" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_16"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_8859_2" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_2"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_8859_3" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_3"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_8859_4" link="libxml2-encoding.html#XML_CHAR_ENCODING_8859_4"/>
@@ -371,6 +381,7 @@
     <keyword type="enum" name="XML_CHAR_ENCODING_EBCDIC" link="libxml2-encoding.html#XML_CHAR_ENCODING_EBCDIC"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_ERROR" link="libxml2-encoding.html#XML_CHAR_ENCODING_ERROR"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_EUC_JP" link="libxml2-encoding.html#XML_CHAR_ENCODING_EUC_JP"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_HTML" link="libxml2-encoding.html#XML_CHAR_ENCODING_HTML"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_NONE" link="libxml2-encoding.html#XML_CHAR_ENCODING_NONE"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_SHIFT_JIS" link="libxml2-encoding.html#XML_CHAR_ENCODING_SHIFT_JIS"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_UCS2" link="libxml2-encoding.html#XML_CHAR_ENCODING_UCS2"/>
@@ -378,6 +389,7 @@
     <keyword type="enum" name="XML_CHAR_ENCODING_UCS4LE" link="libxml2-encoding.html#XML_CHAR_ENCODING_UCS4LE"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_UCS4_2143" link="libxml2-encoding.html#XML_CHAR_ENCODING_UCS4_2143"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_UCS4_3412" link="libxml2-encoding.html#XML_CHAR_ENCODING_UCS4_3412"/>
+    <keyword type="enum" name="XML_CHAR_ENCODING_UTF16" link="libxml2-encoding.html#XML_CHAR_ENCODING_UTF16"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_UTF16BE" link="libxml2-encoding.html#XML_CHAR_ENCODING_UTF16BE"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_UTF16LE" link="libxml2-encoding.html#XML_CHAR_ENCODING_UTF16LE"/>
     <keyword type="enum" name="XML_CHAR_ENCODING_UTF8" link="libxml2-encoding.html#XML_CHAR_ENCODING_UTF8"/>
@@ -492,9 +504,10 @@
     <keyword type="enum" name="XML_ENC_ERR_INPUT" link="libxml2-encoding.html#XML_ENC_ERR_INPUT"/>
     <keyword type="enum" name="XML_ENC_ERR_INTERNAL" link="libxml2-encoding.html#XML_ENC_ERR_INTERNAL"/>
     <keyword type="enum" name="XML_ENC_ERR_MEMORY" link="libxml2-encoding.html#XML_ENC_ERR_MEMORY"/>
-    <keyword type="enum" name="XML_ENC_ERR_PARTIAL" link="libxml2-encoding.html#XML_ENC_ERR_PARTIAL"/>
     <keyword type="enum" name="XML_ENC_ERR_SPACE" link="libxml2-encoding.html#XML_ENC_ERR_SPACE"/>
     <keyword type="enum" name="XML_ENC_ERR_SUCCESS" link="libxml2-encoding.html#XML_ENC_ERR_SUCCESS"/>
+    <keyword type="enum" name="XML_ENC_INPUT" link="libxml2-encoding.html#XML_ENC_INPUT"/>
+    <keyword type="enum" name="XML_ENC_OUTPUT" link="libxml2-encoding.html#XML_ENC_OUTPUT"/>
     <keyword type="enum" name="XML_ENTITY_DECL" link="libxml2-tree.html#XML_ENTITY_DECL"/>
     <keyword type="enum" name="XML_ENTITY_NODE" link="libxml2-tree.html#XML_ENTITY_NODE"/>
     <keyword type="enum" name="XML_ENTITY_REF_NODE" link="libxml2-tree.html#XML_ENTITY_REF_NODE"/>
@@ -611,12 +624,6 @@
     <keyword type="enum" name="XML_ERR_WARNING" link="libxml2-xmlerror.html#XML_ERR_WARNING"/>
     <keyword type="enum" name="XML_ERR_XMLDECL_NOT_FINISHED" link="libxml2-xmlerror.html#XML_ERR_XMLDECL_NOT_FINISHED"/>
     <keyword type="enum" name="XML_ERR_XMLDECL_NOT_STARTED" link="libxml2-xmlerror.html#XML_ERR_XMLDECL_NOT_STARTED"/>
-    <keyword type="enum" name="XML_EXP_ATOM" link="libxml2-xmlregexp.html#XML_EXP_ATOM"/>
-    <keyword type="enum" name="XML_EXP_COUNT" link="libxml2-xmlregexp.html#XML_EXP_COUNT"/>
-    <keyword type="enum" name="XML_EXP_EMPTY" link="libxml2-xmlregexp.html#XML_EXP_EMPTY"/>
-    <keyword type="enum" name="XML_EXP_FORBID" link="libxml2-xmlregexp.html#XML_EXP_FORBID"/>
-    <keyword type="enum" name="XML_EXP_OR" link="libxml2-xmlregexp.html#XML_EXP_OR"/>
-    <keyword type="enum" name="XML_EXP_SEQ" link="libxml2-xmlregexp.html#XML_EXP_SEQ"/>
     <keyword type="enum" name="XML_EXTERNAL_GENERAL_PARSED_ENTITY" link="libxml2-entities.html#XML_EXTERNAL_GENERAL_PARSED_ENTITY"/>
     <keyword type="enum" name="XML_EXTERNAL_GENERAL_UNPARSED_ENTITY" link="libxml2-entities.html#XML_EXTERNAL_GENERAL_UNPARSED_ENTITY"/>
     <keyword type="enum" name="XML_EXTERNAL_PARAMETER_ENTITY" link="libxml2-entities.html#XML_EXTERNAL_PARAMETER_ENTITY"/>
@@ -667,6 +674,10 @@
     <keyword type="enum" name="XML_I18N_NO_HANDLER" link="libxml2-xmlerror.html#XML_I18N_NO_HANDLER"/>
     <keyword type="enum" name="XML_I18N_NO_NAME" link="libxml2-xmlerror.html#XML_I18N_NO_NAME"/>
     <keyword type="enum" name="XML_I18N_NO_OUTPUT" link="libxml2-xmlerror.html#XML_I18N_NO_OUTPUT"/>
+    <keyword type="enum" name="XML_INPUT_BUF_STATIC" link="libxml2-parser.html#XML_INPUT_BUF_STATIC"/>
+    <keyword type="enum" name="XML_INPUT_BUF_ZERO_TERMINATED" link="libxml2-parser.html#XML_INPUT_BUF_ZERO_TERMINATED"/>
+    <keyword type="enum" name="XML_INPUT_NETWORK" link="libxml2-parser.html#XML_INPUT_NETWORK"/>
+    <keyword type="enum" name="XML_INPUT_UNZIP" link="libxml2-parser.html#XML_INPUT_UNZIP"/>
     <keyword type="enum" name="XML_INTERNAL_GENERAL_ENTITY" link="libxml2-entities.html#XML_INTERNAL_GENERAL_ENTITY"/>
     <keyword type="enum" name="XML_INTERNAL_PARAMETER_ENTITY" link="libxml2-entities.html#XML_INTERNAL_PARAMETER_ENTITY"/>
     <keyword type="enum" name="XML_INTERNAL_PREDEFINED_ENTITY" link="libxml2-entities.html#XML_INTERNAL_PREDEFINED_ENTITY"/>
@@ -768,6 +779,7 @@
     <keyword type="enum" name="XML_PARSER_VALIDATE" link="libxml2-xmlreader.html#XML_PARSER_VALIDATE"/>
     <keyword type="enum" name="XML_PARSER_XML_DECL" link="libxml2-parser.html#XML_PARSER_XML_DECL"/>
     <keyword type="enum" name="XML_PARSE_BIG_LINES" link="libxml2-parser.html#XML_PARSE_BIG_LINES"/>
+    <keyword type="enum" name="XML_PARSE_CATALOG_PI" link="libxml2-parser.html#XML_PARSE_CATALOG_PI"/>
     <keyword type="enum" name="XML_PARSE_COMPACT" link="libxml2-parser.html#XML_PARSE_COMPACT"/>
     <keyword type="enum" name="XML_PARSE_DOM" link="libxml2-parser.html#XML_PARSE_DOM"/>
     <keyword type="enum" name="XML_PARSE_DTDATTR" link="libxml2-parser.html#XML_PARSE_DTDATTR"/>
@@ -784,6 +796,7 @@
     <keyword type="enum" name="XML_PARSE_NONET" link="libxml2-parser.html#XML_PARSE_NONET"/>
     <keyword type="enum" name="XML_PARSE_NOWARNING" link="libxml2-parser.html#XML_PARSE_NOWARNING"/>
     <keyword type="enum" name="XML_PARSE_NOXINCNODE" link="libxml2-parser.html#XML_PARSE_NOXINCNODE"/>
+    <keyword type="enum" name="XML_PARSE_NO_SYS_CATALOG" link="libxml2-parser.html#XML_PARSE_NO_SYS_CATALOG"/>
     <keyword type="enum" name="XML_PARSE_NO_XXE" link="libxml2-parser.html#XML_PARSE_NO_XXE"/>
     <keyword type="enum" name="XML_PARSE_NSCLEAN" link="libxml2-parser.html#XML_PARSE_NSCLEAN"/>
     <keyword type="enum" name="XML_PARSE_OLD10" link="libxml2-parser.html#XML_PARSE_OLD10"/>
@@ -796,6 +809,7 @@
     <keyword type="enum" name="XML_PARSE_SAX" link="libxml2-parser.html#XML_PARSE_SAX"/>
     <keyword type="enum" name="XML_PARSE_SAX1" link="libxml2-parser.html#XML_PARSE_SAX1"/>
     <keyword type="enum" name="XML_PARSE_UNKNOWN" link="libxml2-parser.html#XML_PARSE_UNKNOWN"/>
+    <keyword type="enum" name="XML_PARSE_UNZIP" link="libxml2-parser.html#XML_PARSE_UNZIP"/>
     <keyword type="enum" name="XML_PARSE_XINCLUDE" link="libxml2-parser.html#XML_PARSE_XINCLUDE"/>
     <keyword type="enum" name="XML_PATTERN_DEFAULT" link="libxml2-pattern.html#XML_PATTERN_DEFAULT"/>
     <keyword type="enum" name="XML_PATTERN_XPATH" link="libxml2-pattern.html#XML_PATTERN_XPATH"/>
@@ -864,6 +878,13 @@
     <keyword type="enum" name="XML_RELAXNG_ERR_VALELEM" link="libxml2-relaxng.html#XML_RELAXNG_ERR_VALELEM"/>
     <keyword type="enum" name="XML_RELAXNG_ERR_VALUE" link="libxml2-relaxng.html#XML_RELAXNG_ERR_VALUE"/>
     <keyword type="enum" name="XML_RELAXNG_OK" link="libxml2-relaxng.html#XML_RELAXNG_OK"/>
+    <keyword type="enum" name="XML_RESOURCE_DTD" link="libxml2-parser.html#XML_RESOURCE_DTD"/>
+    <keyword type="enum" name="XML_RESOURCE_GENERAL_ENTITY" link="libxml2-parser.html#XML_RESOURCE_GENERAL_ENTITY"/>
+    <keyword type="enum" name="XML_RESOURCE_MAIN_DOCUMENT" link="libxml2-parser.html#XML_RESOURCE_MAIN_DOCUMENT"/>
+    <keyword type="enum" name="XML_RESOURCE_PARAMETER_ENTITY" link="libxml2-parser.html#XML_RESOURCE_PARAMETER_ENTITY"/>
+    <keyword type="enum" name="XML_RESOURCE_UNKNOWN" link="libxml2-parser.html#XML_RESOURCE_UNKNOWN"/>
+    <keyword type="enum" name="XML_RESOURCE_XINCLUDE" link="libxml2-parser.html#XML_RESOURCE_XINCLUDE"/>
+    <keyword type="enum" name="XML_RESOURCE_XINCLUDE_TEXT" link="libxml2-parser.html#XML_RESOURCE_XINCLUDE_TEXT"/>
     <keyword type="enum" name="XML_RNGP_ANYNAME_ATTR_ANCESTOR" link="libxml2-xmlerror.html#XML_RNGP_ANYNAME_ATTR_ANCESTOR"/>
     <keyword type="enum" name="XML_RNGP_ATTRIBUTE_CHILDREN" link="libxml2-xmlerror.html#XML_RNGP_ATTRIBUTE_CHILDREN"/>
     <keyword type="enum" name="XML_RNGP_ATTRIBUTE_CONTENT" link="libxml2-xmlerror.html#XML_RNGP_ATTRIBUTE_CONTENT"/>
@@ -990,11 +1011,14 @@
     <keyword type="enum" name="XML_SAVE_AS_HTML" link="libxml2-xmlsave.html#XML_SAVE_AS_HTML"/>
     <keyword type="enum" name="XML_SAVE_AS_XML" link="libxml2-xmlsave.html#XML_SAVE_AS_XML"/>
     <keyword type="enum" name="XML_SAVE_CHAR_INVALID" link="libxml2-xmlerror.html#XML_SAVE_CHAR_INVALID"/>
+    <keyword type="enum" name="XML_SAVE_EMPTY" link="libxml2-xmlsave.html#XML_SAVE_EMPTY"/>
     <keyword type="enum" name="XML_SAVE_FORMAT" link="libxml2-xmlsave.html#XML_SAVE_FORMAT"/>
+    <keyword type="enum" name="XML_SAVE_INDENT" link="libxml2-xmlsave.html#XML_SAVE_INDENT"/>
     <keyword type="enum" name="XML_SAVE_NOT_UTF8" link="libxml2-xmlerror.html#XML_SAVE_NOT_UTF8"/>
     <keyword type="enum" name="XML_SAVE_NO_DECL" link="libxml2-xmlsave.html#XML_SAVE_NO_DECL"/>
     <keyword type="enum" name="XML_SAVE_NO_DOCTYPE" link="libxml2-xmlerror.html#XML_SAVE_NO_DOCTYPE"/>
     <keyword type="enum" name="XML_SAVE_NO_EMPTY" link="libxml2-xmlsave.html#XML_SAVE_NO_EMPTY"/>
+    <keyword type="enum" name="XML_SAVE_NO_INDENT" link="libxml2-xmlsave.html#XML_SAVE_NO_INDENT"/>
     <keyword type="enum" name="XML_SAVE_NO_XHTML" link="libxml2-xmlsave.html#XML_SAVE_NO_XHTML"/>
     <keyword type="enum" name="XML_SAVE_UNKNOWN_ENCODING" link="libxml2-xmlerror.html#XML_SAVE_UNKNOWN_ENCODING"/>
     <keyword type="enum" name="XML_SAVE_WSNONSIG" link="libxml2-xmlsave.html#XML_SAVE_WSNONSIG"/>
@@ -1406,6 +1430,10 @@
     <keyword type="enum" name="XML_SCHEMA_WHITESPACE_PRESERVE" link="libxml2-xmlschemastypes.html#XML_SCHEMA_WHITESPACE_PRESERVE"/>
     <keyword type="enum" name="XML_SCHEMA_WHITESPACE_REPLACE" link="libxml2-xmlschemastypes.html#XML_SCHEMA_WHITESPACE_REPLACE"/>
     <keyword type="enum" name="XML_SCHEMA_WHITESPACE_UNKNOWN" link="libxml2-xmlschemastypes.html#XML_SCHEMA_WHITESPACE_UNKNOWN"/>
+    <keyword type="enum" name="XML_STATUS_CATASTROPHIC_ERROR" link="libxml2-parser.html#XML_STATUS_CATASTROPHIC_ERROR"/>
+    <keyword type="enum" name="XML_STATUS_DTD_VALIDATION_FAILED" link="libxml2-parser.html#XML_STATUS_DTD_VALIDATION_FAILED"/>
+    <keyword type="enum" name="XML_STATUS_NOT_NS_WELL_FORMED" link="libxml2-parser.html#XML_STATUS_NOT_NS_WELL_FORMED"/>
+    <keyword type="enum" name="XML_STATUS_NOT_WELL_FORMED" link="libxml2-parser.html#XML_STATUS_NOT_WELL_FORMED"/>
     <keyword type="enum" name="XML_TEXTREADER_MODE_CLOSED" link="libxml2-xmlreader.html#XML_TEXTREADER_MODE_CLOSED"/>
     <keyword type="enum" name="XML_TEXTREADER_MODE_EOF" link="libxml2-xmlreader.html#XML_TEXTREADER_MODE_EOF"/>
     <keyword type="enum" name="XML_TEXTREADER_MODE_ERROR" link="libxml2-xmlreader.html#XML_TEXTREADER_MODE_ERROR"/>
@@ -1449,6 +1477,7 @@
     <keyword type="enum" name="XML_WITH_PUSH" link="libxml2-parser.html#XML_WITH_PUSH"/>
     <keyword type="enum" name="XML_WITH_READER" link="libxml2-parser.html#XML_WITH_READER"/>
     <keyword type="enum" name="XML_WITH_REGEXP" link="libxml2-parser.html#XML_WITH_REGEXP"/>
+    <keyword type="enum" name="XML_WITH_RELAXNG" link="libxml2-parser.html#XML_WITH_RELAXNG"/>
     <keyword type="enum" name="XML_WITH_SAX1" link="libxml2-parser.html#XML_WITH_SAX1"/>
     <keyword type="enum" name="XML_WITH_SCHEMAS" link="libxml2-parser.html#XML_WITH_SCHEMAS"/>
     <keyword type="enum" name="XML_WITH_SCHEMATRON" link="libxml2-parser.html#XML_WITH_SCHEMATRON"/>
@@ -1521,14 +1550,11 @@
     <keyword type="enum" name="XPATH_INVALID_OPERAND" link="libxml2-xpath.html#XPATH_INVALID_OPERAND"/>
     <keyword type="enum" name="XPATH_INVALID_PREDICATE_ERROR" link="libxml2-xpath.html#XPATH_INVALID_PREDICATE_ERROR"/>
     <keyword type="enum" name="XPATH_INVALID_TYPE" link="libxml2-xpath.html#XPATH_INVALID_TYPE"/>
-    <keyword type="enum" name="XPATH_LOCATIONSET" link="libxml2-xpath.html#XPATH_LOCATIONSET"/>
     <keyword type="enum" name="XPATH_MEMORY_ERROR" link="libxml2-xpath.html#XPATH_MEMORY_ERROR"/>
     <keyword type="enum" name="XPATH_NODESET" link="libxml2-xpath.html#XPATH_NODESET"/>
     <keyword type="enum" name="XPATH_NUMBER" link="libxml2-xpath.html#XPATH_NUMBER"/>
     <keyword type="enum" name="XPATH_NUMBER_ERROR" link="libxml2-xpath.html#XPATH_NUMBER_ERROR"/>
     <keyword type="enum" name="XPATH_OP_LIMIT_EXCEEDED" link="libxml2-xpath.html#XPATH_OP_LIMIT_EXCEEDED"/>
-    <keyword type="enum" name="XPATH_POINT" link="libxml2-xpath.html#XPATH_POINT"/>
-    <keyword type="enum" name="XPATH_RANGE" link="libxml2-xpath.html#XPATH_RANGE"/>
     <keyword type="enum" name="XPATH_RECURSION_LIMIT_EXCEEDED" link="libxml2-xpath.html#XPATH_RECURSION_LIMIT_EXCEEDED"/>
     <keyword type="enum" name="XPATH_STACK_ERROR" link="libxml2-xpath.html#XPATH_STACK_ERROR"/>
     <keyword type="enum" name="XPATH_START_LITERAL_ERROR" link="libxml2-xpath.html#XPATH_START_LITERAL_ERROR"/>
@@ -1584,6 +1610,7 @@
     <keyword type="typedef" name="xmlChSRangePtr" link="libxml2-chvalid.html#xmlChSRangePtr"/>
     <keyword type="typedef" name="xmlChar" link="libxml2-xmlstring.html#xmlChar"/>
     <keyword type="typedef" name="xmlCharEncError" link="libxml2-encoding.html#xmlCharEncError"/>
+    <keyword type="typedef" name="xmlCharEncFlags" link="libxml2-encoding.html#xmlCharEncFlags"/>
     <keyword type="typedef" name="xmlCharEncoding" link="libxml2-encoding.html#xmlCharEncoding"/>
     <keyword type="typedef" name="xmlCharEncodingHandlerPtr" link="libxml2-encoding.html#xmlCharEncodingHandlerPtr"/>
     <keyword type="typedef" name="xmlDOMWrapCtxtPtr" link="libxml2-tree.html#xmlDOMWrapCtxtPtr"/>
@@ -1605,17 +1632,12 @@
     <keyword type="typedef" name="xmlErrorDomain" link="libxml2-xmlerror.html#xmlErrorDomain"/>
     <keyword type="typedef" name="xmlErrorLevel" link="libxml2-xmlerror.html#xmlErrorLevel"/>
     <keyword type="typedef" name="xmlErrorPtr" link="libxml2-xmlerror.html#xmlErrorPtr"/>
-    <keyword type="typedef" name="xmlExpCtxtPtr" link="libxml2-xmlregexp.html#xmlExpCtxtPtr"/>
-    <keyword type="typedef" name="xmlExpNodePtr" link="libxml2-xmlregexp.html#xmlExpNodePtr"/>
-    <keyword type="typedef" name="xmlExpNodeType" link="libxml2-xmlregexp.html#xmlExpNodeType"/>
     <keyword type="typedef" name="xmlFeature" link="libxml2-parser.html#xmlFeature"/>
-    <keyword type="typedef" name="xmlGlobalStatePtr" link="libxml2-globals.html#xmlGlobalStatePtr"/>
     <keyword type="typedef" name="xmlHashTablePtr" link="libxml2-hash.html#xmlHashTablePtr"/>
     <keyword type="typedef" name="xmlIDPtr" link="libxml2-tree.html#xmlIDPtr"/>
     <keyword type="typedef" name="xmlIDTablePtr" link="libxml2-valid.html#xmlIDTablePtr"/>
     <keyword type="typedef" name="xmlLinkPtr" link="libxml2-list.html#xmlLinkPtr"/>
     <keyword type="typedef" name="xmlListPtr" link="libxml2-list.html#xmlListPtr"/>
-    <keyword type="typedef" name="xmlLocationSetPtr" link="libxml2-xpointer.html#xmlLocationSetPtr"/>
     <keyword type="typedef" name="xmlModuleOption" link="libxml2-xmlmodule.html#xmlModuleOption"/>
     <keyword type="typedef" name="xmlModulePtr" link="libxml2-xmlmodule.html#xmlModulePtr"/>
     <keyword type="typedef" name="xmlMutexPtr" link="libxml2-threads.html#xmlMutexPtr"/>
@@ -1629,6 +1651,7 @@
     <keyword type="typedef" name="xmlParserCtxtPtr" link="libxml2-tree.html#xmlParserCtxtPtr"/>
     <keyword type="typedef" name="xmlParserErrors" link="libxml2-xmlerror.html#xmlParserErrors"/>
     <keyword type="typedef" name="xmlParserInputBufferPtr" link="libxml2-tree.html#xmlParserInputBufferPtr"/>
+    <keyword type="typedef" name="xmlParserInputFlags" link="libxml2-parser.html#xmlParserInputFlags"/>
     <keyword type="typedef" name="xmlParserInputPtr" link="libxml2-tree.html#xmlParserInputPtr"/>
     <keyword type="typedef" name="xmlParserInputState" link="libxml2-parser.html#xmlParserInputState"/>
     <keyword type="typedef" name="xmlParserMode" link="libxml2-parser.html#xmlParserMode"/>
@@ -1637,6 +1660,7 @@
     <keyword type="typedef" name="xmlParserOption" link="libxml2-parser.html#xmlParserOption"/>
     <keyword type="typedef" name="xmlParserProperties" link="libxml2-xmlreader.html#xmlParserProperties"/>
     <keyword type="typedef" name="xmlParserSeverities" link="libxml2-xmlreader.html#xmlParserSeverities"/>
+    <keyword type="typedef" name="xmlParserStatus" link="libxml2-parser.html#xmlParserStatus"/>
     <keyword type="typedef" name="xmlPatternFlags" link="libxml2-pattern.html#xmlPatternFlags"/>
     <keyword type="typedef" name="xmlPatternPtr" link="libxml2-pattern.html#xmlPatternPtr"/>
     <keyword type="typedef" name="xmlRMutexPtr" link="libxml2-threads.html#xmlRMutexPtr"/>
@@ -1650,6 +1674,7 @@
     <keyword type="typedef" name="xmlRelaxNGPtr" link="libxml2-relaxng.html#xmlRelaxNGPtr"/>
     <keyword type="typedef" name="xmlRelaxNGValidCtxtPtr" link="libxml2-relaxng.html#xmlRelaxNGValidCtxtPtr"/>
     <keyword type="typedef" name="xmlRelaxNGValidErr" link="libxml2-relaxng.html#xmlRelaxNGValidErr"/>
+    <keyword type="typedef" name="xmlResourceType" link="libxml2-parser.html#xmlResourceType"/>
     <keyword type="typedef" name="xmlSAXHandlerPtr" link="libxml2-tree.html#xmlSAXHandlerPtr"/>
     <keyword type="typedef" name="xmlSAXHandlerV1Ptr" link="libxml2-parser.html#xmlSAXHandlerV1Ptr"/>
     <keyword type="typedef" name="xmlSAXLocatorPtr" link="libxml2-tree.html#xmlSAXLocatorPtr"/>
@@ -1682,7 +1707,6 @@
     <keyword type="typedef" name="xmlSchematronPtr" link="libxml2-schematron.html#xmlSchematronPtr"/>
     <keyword type="typedef" name="xmlSchematronValidCtxtPtr" link="libxml2-schematron.html#xmlSchematronValidCtxtPtr"/>
     <keyword type="typedef" name="xmlSchematronValidOptions" link="libxml2-schematron.html#xmlSchematronValidOptions"/>
-    <keyword type="typedef" name="xmlShellCtxtPtr" link="libxml2-debugXML.html#xmlShellCtxtPtr"/>
     <keyword type="typedef" name="xmlStreamCtxtPtr" link="libxml2-pattern.html#xmlStreamCtxtPtr"/>
     <keyword type="typedef" name="xmlTextReaderLocatorPtr" link="libxml2-xmlreader.html#xmlTextReaderLocatorPtr"/>
     <keyword type="typedef" name="xmlTextReaderMode" link="libxml2-xmlreader.html#xmlTextReaderMode"/>
@@ -1729,15 +1753,11 @@
     <keyword type="struct" name="xmlEntity" link="libxml2-tree.html#xmlEntity"/>
     <keyword type="struct" name="xmlEnumeration" link="libxml2-tree.html#xmlEnumeration"/>
     <keyword type="struct" name="xmlError" link="libxml2-xmlerror.html#xmlError"/>
-    <keyword type="struct" name="xmlExpCtxt" link="libxml2-xmlregexp.html#xmlExpCtxt"/>
-    <keyword type="struct" name="xmlExpNode" link="libxml2-xmlregexp.html#xmlExpNode"/>
-    <keyword type="struct" name="xmlGlobalState" link="libxml2-globals.html#xmlGlobalState"/>
     <keyword type="struct" name="xmlHashTable" link="libxml2-hash.html#xmlHashTable"/>
     <keyword type="struct" name="xmlID" link="libxml2-tree.html#xmlID"/>
     <keyword type="struct" name="xmlIDTable" link="libxml2-valid.html#xmlIDTable"/>
     <keyword type="struct" name="xmlLink" link="libxml2-list.html#xmlLink"/>
     <keyword type="struct" name="xmlList" link="libxml2-list.html#xmlList"/>
-    <keyword type="struct" name="xmlLocationSet" link="libxml2-xpointer.html#xmlLocationSet"/>
     <keyword type="struct" name="xmlModule" link="libxml2-xmlmodule.html#xmlModule"/>
     <keyword type="struct" name="xmlMutex" link="libxml2-threads.html#xmlMutex"/>
     <keyword type="struct" name="xmlNode" link="libxml2-tree.html#xmlNode"/>
@@ -1785,7 +1805,6 @@
     <keyword type="struct" name="xmlSchematron" link="libxml2-schematron.html#xmlSchematron"/>
     <keyword type="struct" name="xmlSchematronParserCtxt" link="libxml2-schematron.html#xmlSchematronParserCtxt"/>
     <keyword type="struct" name="xmlSchematronValidCtxt" link="libxml2-schematron.html#xmlSchematronValidCtxt"/>
-    <keyword type="struct" name="xmlShellCtxt" link="libxml2-debugXML.html#xmlShellCtxt"/>
     <keyword type="struct" name="xmlStartTag" link="libxml2-parser.html#xmlStartTag"/>
     <keyword type="struct" name="xmlStreamCtxt" link="libxml2-pattern.html#xmlStreamCtxt"/>
     <keyword type="struct" name="xmlTextReader" link="libxml2-xmlreader.html#xmlTextReader"/>
@@ -1815,8 +1834,6 @@
     <keyword type="function" name="errorSAXFunc" link="libxml2-parser.html#errorSAXFunc"/>
     <keyword type="function" name="externalSubsetSAXFunc" link="libxml2-parser.html#externalSubsetSAXFunc"/>
     <keyword type="function" name="fatalErrorSAXFunc" link="libxml2-parser.html#fatalErrorSAXFunc"/>
-    <keyword type="function" name="ftpDataCallback" link="libxml2-nanoftp.html#ftpDataCallback"/>
-    <keyword type="function" name="ftpListCallback" link="libxml2-nanoftp.html#ftpListCallback"/>
     <keyword type="function" name="getEntitySAXFunc" link="libxml2-parser.html#getEntitySAXFunc"/>
     <keyword type="function" name="getParameterEntitySAXFunc" link="libxml2-parser.html#getParameterEntitySAXFunc"/>
     <keyword type="function" name="hasExternalSubsetSAXFunc" link="libxml2-parser.html#hasExternalSubsetSAXFunc"/>
@@ -1839,11 +1856,13 @@
     <keyword type="function" name="xlinkNodeDetectFunc" link="libxml2-xlink.html#xlinkNodeDetectFunc"/>
     <keyword type="function" name="xlinkSimpleLinkFunk" link="libxml2-xlink.html#xlinkSimpleLinkFunk"/>
     <keyword type="function" name="xmlC14NIsVisibleCallback" link="libxml2-c14n.html#xmlC14NIsVisibleCallback"/>
+    <keyword type="function" name="xmlCharEncConvCtxtDtor" link="libxml2-encoding.html#xmlCharEncConvCtxtDtor"/>
+    <keyword type="function" name="xmlCharEncConvFunc" link="libxml2-encoding.html#xmlCharEncConvFunc"/>
+    <keyword type="function" name="xmlCharEncConvImpl" link="libxml2-encoding.html#xmlCharEncConvImpl"/>
     <keyword type="function" name="xmlCharEncodingInputFunc" link="libxml2-encoding.html#xmlCharEncodingInputFunc"/>
     <keyword type="function" name="xmlCharEncodingOutputFunc" link="libxml2-encoding.html#xmlCharEncodingOutputFunc"/>
     <keyword type="function" name="xmlDOMWrapAcquireNsFunction" link="libxml2-tree.html#xmlDOMWrapAcquireNsFunction"/>
     <keyword type="function" name="xmlDeregisterNodeFunc" link="libxml2-tree.html#xmlDeregisterNodeFunc"/>
-    <keyword type="function" name="xmlEntityReferenceFunc" link="libxml2-parserInternals.html#xmlEntityReferenceFunc"/>
     <keyword type="function" name="xmlExternalEntityLoader" link="libxml2-parser.html#xmlExternalEntityLoader"/>
     <keyword type="function" name="xmlFreeFunc" link="libxml2-xmlmemory.html#xmlFreeFunc"/>
     <keyword type="function" name="xmlGenericErrorFunc" link="libxml2-xmlerror.html#xmlGenericErrorFunc"/>
@@ -1871,13 +1890,12 @@
     <keyword type="function" name="xmlRegisterNodeFunc" link="libxml2-tree.html#xmlRegisterNodeFunc"/>
     <keyword type="function" name="xmlRelaxNGValidityErrorFunc" link="libxml2-relaxng.html#xmlRelaxNGValidityErrorFunc"/>
     <keyword type="function" name="xmlRelaxNGValidityWarningFunc" link="libxml2-relaxng.html#xmlRelaxNGValidityWarningFunc"/>
+    <keyword type="function" name="xmlResourceLoader" link="libxml2-parser.html#xmlResourceLoader"/>
     <keyword type="function" name="xmlSchemaValidityErrorFunc" link="libxml2-xmlschemas.html#xmlSchemaValidityErrorFunc"/>
     <keyword type="function" name="xmlSchemaValidityLocatorFunc" link="libxml2-xmlschemas.html#xmlSchemaValidityLocatorFunc"/>
     <keyword type="function" name="xmlSchemaValidityWarningFunc" link="libxml2-xmlschemas.html#xmlSchemaValidityWarningFunc"/>
     <keyword type="function" name="xmlSchematronValidityErrorFunc" link="libxml2-schematron.html#xmlSchematronValidityErrorFunc"/>
     <keyword type="function" name="xmlSchematronValidityWarningFunc" link="libxml2-schematron.html#xmlSchematronValidityWarningFunc"/>
-    <keyword type="function" name="xmlShellCmd" link="libxml2-debugXML.html#xmlShellCmd"/>
-    <keyword type="function" name="xmlShellReadlineFunc" link="libxml2-debugXML.html#xmlShellReadlineFunc"/>
     <keyword type="function" name="xmlStrdupFunc" link="libxml2-xmlmemory.html#xmlStrdupFunc"/>
     <keyword type="function" name="xmlStructuredErrorFunc" link="libxml2-xmlerror.html#xmlStructuredErrorFunc"/>
     <keyword type="function" name="xmlTextReaderErrorFunc" link="libxml2-xmlreader.html#xmlTextReaderErrorFunc"/>
@@ -1889,12 +1907,7 @@
     <keyword type="function" name="xmlXPathFuncLookupFunc" link="libxml2-xpath.html#xmlXPathFuncLookupFunc"/>
     <keyword type="function" name="xmlXPathFunction" link="libxml2-xpath.html#xmlXPathFunction"/>
     <keyword type="function" name="xmlXPathVariableLookupFunc" link="libxml2-xpath.html#xmlXPathVariableLookupFunc"/>
-    <keyword type="macro" name="emptyExp" link="libxml2-xmlregexp.html#emptyExp"/>
-    <keyword type="macro" name="forbiddenExp" link="libxml2-xmlregexp.html#forbiddenExp"/>
     <keyword type="macro" name="htmlDefaultSAXHandler" link="libxml2-HTMLparser.html#htmlDefaultSAXHandler"/>
-    <keyword type="macro" name="oldXMLWDcompatibility" link="libxml2-parser.html#oldXMLWDcompatibility"/>
-    <keyword type="macro" name="xmlDefaultSAXHandler" link="libxml2-parser.html#xmlDefaultSAXHandler"/>
-    <keyword type="macro" name="xmlDefaultSAXLocator" link="libxml2-parser.html#xmlDefaultSAXLocator"/>
     <keyword type="macro" name="xmlFree" link="libxml2-xmlmemory.html#xmlFree"/>
     <keyword type="macro" name="xmlIsBaseCharGroup" link="libxml2-chvalid.html#xmlIsBaseCharGroup"/>
     <keyword type="macro" name="xmlIsCharGroup" link="libxml2-chvalid.html#xmlIsCharGroup"/>
@@ -1906,8 +1919,6 @@
     <keyword type="macro" name="xmlMalloc" link="libxml2-xmlmemory.html#xmlMalloc"/>
     <keyword type="macro" name="xmlMallocAtomic" link="libxml2-xmlmemory.html#xmlMallocAtomic"/>
     <keyword type="macro" name="xmlMemStrdup" link="libxml2-xmlmemory.html#xmlMemStrdup"/>
-    <keyword type="macro" name="xmlParserDebugEntities" link="libxml2-parser.html#xmlParserDebugEntities"/>
-    <keyword type="macro" name="xmlParserMaxDepth" link="libxml2-parserInternals.html#xmlParserMaxDepth"/>
     <keyword type="macro" name="xmlParserVersion" link="libxml2-parser.html#xmlParserVersion"/>
     <keyword type="macro" name="xmlRealloc" link="libxml2-xmlmemory.html#xmlRealloc"/>
     <keyword type="macro" name="xmlStringComment" link="libxml2-parserInternals.html#xmlStringComment"/>
@@ -1916,29 +1927,6 @@
     <keyword type="macro" name="xmlXPathNAN" link="libxml2-xpath.html#xmlXPathNAN"/>
     <keyword type="macro" name="xmlXPathNINF" link="libxml2-xpath.html#xmlXPathNINF"/>
     <keyword type="macro" name="xmlXPathPINF" link="libxml2-xpath.html#xmlXPathPINF"/>
-    <keyword type="function" name="UTF8ToHtml ()" link="libxml2-HTMLparser.html#UTF8ToHtml"/>
-    <keyword type="function" name="UTF8Toisolat1 ()" link="libxml2-encoding.html#UTF8Toisolat1"/>
-    <keyword type="function" name="attribute ()" link="libxml2-SAX.html#attribute"/>
-    <keyword type="function" name="attributeDecl ()" link="libxml2-SAX.html#attributeDecl"/>
-    <keyword type="function" name="cdataBlock ()" link="libxml2-SAX.html#cdataBlock"/>
-    <keyword type="function" name="characters ()" link="libxml2-SAX.html#characters"/>
-    <keyword type="function" name="checkNamespace ()" link="libxml2-SAX.html#checkNamespace"/>
-    <keyword type="function" name="comment ()" link="libxml2-SAX.html#comment"/>
-    <keyword type="function" name="elementDecl ()" link="libxml2-SAX.html#elementDecl"/>
-    <keyword type="function" name="endDocument ()" link="libxml2-SAX.html#endDocument"/>
-    <keyword type="function" name="endElement ()" link="libxml2-SAX.html#endElement"/>
-    <keyword type="function" name="entityDecl ()" link="libxml2-SAX.html#entityDecl"/>
-    <keyword type="function" name="externalSubset ()" link="libxml2-SAX.html#externalSubset"/>
-    <keyword type="function" name="getColumnNumber ()" link="libxml2-SAX.html#getColumnNumber"/>
-    <keyword type="function" name="getEntity ()" link="libxml2-SAX.html#getEntity"/>
-    <keyword type="function" name="getLineNumber ()" link="libxml2-SAX.html#getLineNumber"/>
-    <keyword type="function" name="getNamespace ()" link="libxml2-SAX.html#getNamespace"/>
-    <keyword type="function" name="getParameterEntity ()" link="libxml2-SAX.html#getParameterEntity"/>
-    <keyword type="function" name="getPublicId ()" link="libxml2-SAX.html#getPublicId"/>
-    <keyword type="function" name="getSystemId ()" link="libxml2-SAX.html#getSystemId"/>
-    <keyword type="function" name="globalNamespace ()" link="libxml2-SAX.html#globalNamespace"/>
-    <keyword type="function" name="hasExternalSubset ()" link="libxml2-SAX.html#hasExternalSubset"/>
-    <keyword type="function" name="hasInternalSubset ()" link="libxml2-SAX.html#hasInternalSubset"/>
     <keyword type="function" name="htmlAttrAllowed ()" link="libxml2-HTMLparser.html#htmlAttrAllowed"/>
     <keyword type="function" name="htmlAutoCloseTag ()" link="libxml2-HTMLparser.html#htmlAutoCloseTag"/>
     <keyword type="function" name="htmlCreateFileParserCtxt ()" link="libxml2-HTMLparser.html#htmlCreateFileParserCtxt"/>
@@ -1951,6 +1939,7 @@
     <keyword type="function" name="htmlCtxtReadIO ()" link="libxml2-HTMLparser.html#htmlCtxtReadIO"/>
     <keyword type="function" name="htmlCtxtReadMemory ()" link="libxml2-HTMLparser.html#htmlCtxtReadMemory"/>
     <keyword type="function" name="htmlCtxtReset ()" link="libxml2-HTMLparser.html#htmlCtxtReset"/>
+    <keyword type="function" name="htmlCtxtSetOptions ()" link="libxml2-HTMLparser.html#htmlCtxtSetOptions"/>
     <keyword type="function" name="htmlCtxtUseOptions ()" link="libxml2-HTMLparser.html#htmlCtxtUseOptions"/>
     <keyword type="function" name="htmlDefaultSAXHandlerInit ()" link="libxml2-SAX2.html#htmlDefaultSAXHandlerInit"/>
     <keyword type="function" name="htmlDocContentDumpFormatOutput ()" link="libxml2-HTMLtree.html#htmlDocContentDumpFormatOutput"/>
@@ -1999,31 +1988,7 @@
     <keyword type="function" name="htmlSaveFileFormat ()" link="libxml2-HTMLtree.html#htmlSaveFileFormat"/>
     <keyword type="function" name="htmlSetMetaEncoding ()" link="libxml2-HTMLtree.html#htmlSetMetaEncoding"/>
     <keyword type="function" name="htmlTagLookup ()" link="libxml2-HTMLparser.html#htmlTagLookup"/>
-    <keyword type="function" name="ignorableWhitespace ()" link="libxml2-SAX.html#ignorableWhitespace"/>
-    <keyword type="function" name="initGenericErrorDefaultFunc ()" link="libxml2-xmlerror.html#initGenericErrorDefaultFunc"/>
-    <keyword type="function" name="inithtmlDefaultSAXHandler ()" link="libxml2-SAX.html#inithtmlDefaultSAXHandler"/>
-    <keyword type="function" name="initxmlDefaultSAXHandler ()" link="libxml2-SAX.html#initxmlDefaultSAXHandler"/>
-    <keyword type="function" name="inputPop ()" link="libxml2-parserInternals.html#inputPop"/>
-    <keyword type="function" name="inputPush ()" link="libxml2-parserInternals.html#inputPush"/>
-    <keyword type="function" name="internalSubset ()" link="libxml2-SAX.html#internalSubset"/>
-    <keyword type="function" name="isStandalone ()" link="libxml2-SAX.html#isStandalone"/>
-    <keyword type="function" name="isolat1ToUTF8 ()" link="libxml2-encoding.html#isolat1ToUTF8"/>
-    <keyword type="function" name="namePop ()" link="libxml2-parserInternals.html#namePop"/>
-    <keyword type="function" name="namePush ()" link="libxml2-parserInternals.html#namePush"/>
-    <keyword type="function" name="namespaceDecl ()" link="libxml2-SAX.html#namespaceDecl"/>
-    <keyword type="function" name="nodePop ()" link="libxml2-parserInternals.html#nodePop"/>
-    <keyword type="function" name="nodePush ()" link="libxml2-parserInternals.html#nodePush"/>
-    <keyword type="function" name="notationDecl ()" link="libxml2-SAX.html#notationDecl"/>
-    <keyword type="function" name="processingInstruction ()" link="libxml2-SAX.html#processingInstruction"/>
-    <keyword type="function" name="reference ()" link="libxml2-SAX.html#reference"/>
-    <keyword type="function" name="resolveEntity ()" link="libxml2-SAX.html#resolveEntity"/>
-    <keyword type="function" name="setDocumentLocator ()" link="libxml2-SAX.html#setDocumentLocator"/>
-    <keyword type="function" name="setNamespace ()" link="libxml2-SAX.html#setNamespace"/>
-    <keyword type="function" name="startDocument ()" link="libxml2-SAX.html#startDocument"/>
-    <keyword type="function" name="startElement ()" link="libxml2-SAX.html#startElement"/>
-    <keyword type="function" name="unparsedEntityDecl ()" link="libxml2-SAX.html#unparsedEntityDecl"/>
-    <keyword type="function" name="valuePop ()" link="libxml2-xpathInternals.html#valuePop"/>
-    <keyword type="function" name="valuePush ()" link="libxml2-xpathInternals.html#valuePush"/>
+    <keyword type="function" name="htmlUTF8ToHtml ()" link="libxml2-HTMLparser.html#htmlUTF8ToHtml"/>
     <keyword type="function" name="xlinkGetDefaultDetect ()" link="libxml2-xlink.html#xlinkGetDefaultDetect"/>
     <keyword type="function" name="xlinkGetDefaultHandler ()" link="libxml2-xlink.html#xlinkGetDefaultHandler"/>
     <keyword type="function" name="xlinkIsLink ()" link="libxml2-xlink.html#xlinkIsLink"/>
@@ -2071,7 +2036,6 @@
     <keyword type="function" name="xmlAutomataNewTransition ()" link="libxml2-xmlautomata.html#xmlAutomataNewTransition"/>
     <keyword type="function" name="xmlAutomataNewTransition2 ()" link="libxml2-xmlautomata.html#xmlAutomataNewTransition2"/>
     <keyword type="function" name="xmlAutomataSetFinalState ()" link="libxml2-xmlautomata.html#xmlAutomataSetFinalState"/>
-    <keyword type="function" name="xmlBoolToText ()" link="libxml2-debugXML.html#xmlBoolToText"/>
     <keyword type="function" name="xmlBufContent ()" link="libxml2-tree.html#xmlBufContent"/>
     <keyword type="function" name="xmlBufEnd ()" link="libxml2-tree.html#xmlBufEnd"/>
     <keyword type="function" name="xmlBufGetNodeContent ()" link="libxml2-tree.html#xmlBufGetNodeContent"/>
@@ -2132,6 +2096,7 @@
     <keyword type="function" name="xmlCharEncCloseFunc ()" link="libxml2-encoding.html#xmlCharEncCloseFunc"/>
     <keyword type="function" name="xmlCharEncFirstLine ()" link="libxml2-encoding.html#xmlCharEncFirstLine"/>
     <keyword type="function" name="xmlCharEncInFunc ()" link="libxml2-encoding.html#xmlCharEncInFunc"/>
+    <keyword type="function" name="xmlCharEncNewCustomHandler ()" link="libxml2-encoding.html#xmlCharEncNewCustomHandler"/>
     <keyword type="function" name="xmlCharEncOutFunc ()" link="libxml2-encoding.html#xmlCharEncOutFunc"/>
     <keyword type="function" name="xmlCharInRange ()" link="libxml2-chvalid.html#xmlCharInRange"/>
     <keyword type="function" name="xmlCharStrdup ()" link="libxml2-xmlstring.html#xmlCharStrdup"/>
@@ -2149,7 +2114,6 @@
     <keyword type="function" name="xmlCleanupMemory ()" link="libxml2-xmlmemory.html#xmlCleanupMemory"/>
     <keyword type="function" name="xmlCleanupOutputCallbacks ()" link="libxml2-xmlIO.html#xmlCleanupOutputCallbacks"/>
     <keyword type="function" name="xmlCleanupParser ()" link="libxml2-parser.html#xmlCleanupParser"/>
-    <keyword type="function" name="xmlCleanupPredefinedEntities ()" link="libxml2-entities.html#xmlCleanupPredefinedEntities"/>
     <keyword type="function" name="xmlCleanupThreads ()" link="libxml2-threads.html#xmlCleanupThreads"/>
     <keyword type="function" name="xmlClearNodeInfoSeq ()" link="libxml2-parser.html#xmlClearNodeInfoSeq"/>
     <keyword type="function" name="xmlClearParserCtxt ()" link="libxml2-parser.html#xmlClearParserCtxt"/>
@@ -2172,6 +2136,7 @@
     <keyword type="function" name="xmlCopyNotationTable ()" link="libxml2-valid.html#xmlCopyNotationTable"/>
     <keyword type="function" name="xmlCopyProp ()" link="libxml2-tree.html#xmlCopyProp"/>
     <keyword type="function" name="xmlCopyPropList ()" link="libxml2-tree.html#xmlCopyPropList"/>
+    <keyword type="function" name="xmlCreateCharEncodingHandler ()" link="libxml2-encoding.html#xmlCreateCharEncodingHandler"/>
     <keyword type="function" name="xmlCreateDocParserCtxt ()" link="libxml2-parser.html#xmlCreateDocParserCtxt"/>
     <keyword type="function" name="xmlCreateEntitiesTable ()" link="libxml2-entities.html#xmlCreateEntitiesTable"/>
     <keyword type="function" name="xmlCreateEntityParserCtxt ()" link="libxml2-parserInternals.html#xmlCreateEntityParserCtxt"/>
@@ -2184,8 +2149,25 @@
     <keyword type="function" name="xmlCreateURI ()" link="libxml2-uri.html#xmlCreateURI"/>
     <keyword type="function" name="xmlCreateURLParserCtxt ()" link="libxml2-parserInternals.html#xmlCreateURLParserCtxt"/>
     <keyword type="function" name="xmlCtxtErrMemory ()" link="libxml2-parserInternals.html#xmlCtxtErrMemory"/>
+    <keyword type="function" name="xmlCtxtGetCatalogs ()" link="libxml2-parser.html#xmlCtxtGetCatalogs"/>
+    <keyword type="function" name="xmlCtxtGetDeclaredEncoding ()" link="libxml2-parser.html#xmlCtxtGetDeclaredEncoding"/>
+    <keyword type="function" name="xmlCtxtGetDict ()" link="libxml2-parser.html#xmlCtxtGetDict"/>
+    <keyword type="function" name="xmlCtxtGetDocument ()" link="libxml2-parser.html#xmlCtxtGetDocument"/>
     <keyword type="function" name="xmlCtxtGetLastError ()" link="libxml2-xmlerror.html#xmlCtxtGetLastError"/>
+    <keyword type="function" name="xmlCtxtGetOptions ()" link="libxml2-parser.html#xmlCtxtGetOptions"/>
+    <keyword type="function" name="xmlCtxtGetPrivate ()" link="libxml2-parser.html#xmlCtxtGetPrivate"/>
+    <keyword type="function" name="xmlCtxtGetSaxHandler ()" link="libxml2-parser.html#xmlCtxtGetSaxHandler"/>
+    <keyword type="function" name="xmlCtxtGetStandalone ()" link="libxml2-parser.html#xmlCtxtGetStandalone"/>
+    <keyword type="function" name="xmlCtxtGetStatus ()" link="libxml2-parser.html#xmlCtxtGetStatus"/>
+    <keyword type="function" name="xmlCtxtGetValidCtxt ()" link="libxml2-parser.html#xmlCtxtGetValidCtxt"/>
+    <keyword type="function" name="xmlCtxtGetVersion ()" link="libxml2-parser.html#xmlCtxtGetVersion"/>
+    <keyword type="function" name="xmlCtxtIsHtml ()" link="libxml2-parser.html#xmlCtxtIsHtml"/>
+    <keyword type="function" name="xmlCtxtIsStopped ()" link="libxml2-parser.html#xmlCtxtIsStopped"/>
+    <keyword type="function" name="xmlCtxtParseContent ()" link="libxml2-parser.html#xmlCtxtParseContent"/>
     <keyword type="function" name="xmlCtxtParseDocument ()" link="libxml2-parser.html#xmlCtxtParseDocument"/>
+    <keyword type="function" name="xmlCtxtParseDtd ()" link="libxml2-parser.html#xmlCtxtParseDtd"/>
+    <keyword type="function" name="xmlCtxtPopInput ()" link="libxml2-parserInternals.html#xmlCtxtPopInput"/>
+    <keyword type="function" name="xmlCtxtPushInput ()" link="libxml2-parserInternals.html#xmlCtxtPushInput"/>
     <keyword type="function" name="xmlCtxtReadDoc ()" link="libxml2-parser.html#xmlCtxtReadDoc"/>
     <keyword type="function" name="xmlCtxtReadFd ()" link="libxml2-parser.html#xmlCtxtReadFd"/>
     <keyword type="function" name="xmlCtxtReadFile ()" link="libxml2-parser.html#xmlCtxtReadFile"/>
@@ -2194,10 +2176,18 @@
     <keyword type="function" name="xmlCtxtReset ()" link="libxml2-parser.html#xmlCtxtReset"/>
     <keyword type="function" name="xmlCtxtResetLastError ()" link="libxml2-xmlerror.html#xmlCtxtResetLastError"/>
     <keyword type="function" name="xmlCtxtResetPush ()" link="libxml2-parser.html#xmlCtxtResetPush"/>
+    <keyword type="function" name="xmlCtxtSetCatalogs ()" link="libxml2-parser.html#xmlCtxtSetCatalogs"/>
+    <keyword type="function" name="xmlCtxtSetCharEncConvImpl ()" link="libxml2-parser.html#xmlCtxtSetCharEncConvImpl"/>
+    <keyword type="function" name="xmlCtxtSetDict ()" link="libxml2-parser.html#xmlCtxtSetDict"/>
     <keyword type="function" name="xmlCtxtSetErrorHandler ()" link="libxml2-parser.html#xmlCtxtSetErrorHandler"/>
     <keyword type="function" name="xmlCtxtSetMaxAmplification ()" link="libxml2-parser.html#xmlCtxtSetMaxAmplification"/>
     <keyword type="function" name="xmlCtxtSetOptions ()" link="libxml2-parser.html#xmlCtxtSetOptions"/>
+    <keyword type="function" name="xmlCtxtSetPrivate ()" link="libxml2-parser.html#xmlCtxtSetPrivate"/>
+    <keyword type="function" name="xmlCtxtSetResourceLoader ()" link="libxml2-parser.html#xmlCtxtSetResourceLoader"/>
+    <keyword type="function" name="xmlCtxtSetSaxHandler ()" link="libxml2-parser.html#xmlCtxtSetSaxHandler"/>
     <keyword type="function" name="xmlCtxtUseOptions ()" link="libxml2-parser.html#xmlCtxtUseOptions"/>
+    <keyword type="function" name="xmlCtxtValidateDocument ()" link="libxml2-parser.html#xmlCtxtValidateDocument"/>
+    <keyword type="function" name="xmlCtxtValidateDtd ()" link="libxml2-parser.html#xmlCtxtValidateDtd"/>
     <keyword type="function" name="xmlCurrentChar ()" link="libxml2-parserInternals.html#xmlCurrentChar"/>
     <keyword type="function" name="xmlDOMWrapAdoptNode ()" link="libxml2-tree.html#xmlDOMWrapAdoptNode"/>
     <keyword type="function" name="xmlDOMWrapCloneNode ()" link="libxml2-tree.html#xmlDOMWrapCloneNode"/>
@@ -2216,7 +2206,6 @@
     <keyword type="function" name="xmlDebugDumpNodeList ()" link="libxml2-debugXML.html#xmlDebugDumpNodeList"/>
     <keyword type="function" name="xmlDebugDumpOneNode ()" link="libxml2-debugXML.html#xmlDebugDumpOneNode"/>
     <keyword type="function" name="xmlDebugDumpString ()" link="libxml2-debugXML.html#xmlDebugDumpString"/>
-    <keyword type="function" name="xmlDecodeEntities ()" link="libxml2-parserInternals.html#xmlDecodeEntities"/>
     <keyword type="function" name="xmlDefaultSAXHandlerInit ()" link="libxml2-SAX2.html#xmlDefaultSAXHandlerInit"/>
     <keyword type="function" name="xmlDelEncodingAlias ()" link="libxml2-encoding.html#xmlDelEncodingAlias"/>
     <keyword type="function" name="xmlDeregisterNodeDefault ()" link="libxml2-tree.html#xmlDeregisterNodeDefault"/>
@@ -2252,28 +2241,8 @@
     <keyword type="function" name="xmlDumpNotationDecl ()" link="libxml2-valid.html#xmlDumpNotationDecl"/>
     <keyword type="function" name="xmlDumpNotationTable ()" link="libxml2-valid.html#xmlDumpNotationTable"/>
     <keyword type="function" name="xmlElemDump ()" link="libxml2-tree.html#xmlElemDump"/>
-    <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="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"/>
-    <keyword type="function" name="xmlExpExpDerive ()" link="libxml2-xmlregexp.html#xmlExpExpDerive"/>
-    <keyword type="function" name="xmlExpFree ()" link="libxml2-xmlregexp.html#xmlExpFree"/>
-    <keyword type="function" name="xmlExpFreeCtxt ()" link="libxml2-xmlregexp.html#xmlExpFreeCtxt"/>
-    <keyword type="function" name="xmlExpGetLanguage ()" link="libxml2-xmlregexp.html#xmlExpGetLanguage"/>
-    <keyword type="function" name="xmlExpGetStart ()" link="libxml2-xmlregexp.html#xmlExpGetStart"/>
-    <keyword type="function" name="xmlExpIsNillable ()" link="libxml2-xmlregexp.html#xmlExpIsNillable"/>
-    <keyword type="function" name="xmlExpMaxToken ()" link="libxml2-xmlregexp.html#xmlExpMaxToken"/>
-    <keyword type="function" name="xmlExpNewAtom ()" link="libxml2-xmlregexp.html#xmlExpNewAtom"/>
-    <keyword type="function" name="xmlExpNewCtxt ()" link="libxml2-xmlregexp.html#xmlExpNewCtxt"/>
-    <keyword type="function" name="xmlExpNewOr ()" link="libxml2-xmlregexp.html#xmlExpNewOr"/>
-    <keyword type="function" name="xmlExpNewRange ()" link="libxml2-xmlregexp.html#xmlExpNewRange"/>
-    <keyword type="function" name="xmlExpNewSeq ()" link="libxml2-xmlregexp.html#xmlExpNewSeq"/>
-    <keyword type="function" name="xmlExpParse ()" link="libxml2-xmlregexp.html#xmlExpParse"/>
-    <keyword type="function" name="xmlExpRef ()" link="libxml2-xmlregexp.html#xmlExpRef"/>
-    <keyword type="function" name="xmlExpStringDerive ()" link="libxml2-xmlregexp.html#xmlExpStringDerive"/>
-    <keyword type="function" name="xmlExpSubsume ()" link="libxml2-xmlregexp.html#xmlExpSubsume"/>
     <keyword type="function" name="xmlFileClose ()" link="libxml2-xmlIO.html#xmlFileClose"/>
     <keyword type="function" name="xmlFileMatch ()" link="libxml2-xmlIO.html#xmlFileMatch"/>
     <keyword type="function" name="xmlFileOpen ()" link="libxml2-xmlIO.html#xmlFileOpen"/>
@@ -2329,9 +2298,6 @@
     <keyword type="function" name="xmlGetDtdQElementDesc ()" link="libxml2-valid.html#xmlGetDtdQElementDesc"/>
     <keyword type="function" name="xmlGetEncodingAlias ()" link="libxml2-encoding.html#xmlGetEncodingAlias"/>
     <keyword type="function" name="xmlGetExternalEntityLoader ()" link="libxml2-parser.html#xmlGetExternalEntityLoader"/>
-    <keyword type="function" name="xmlGetFeature ()" link="libxml2-parser.html#xmlGetFeature"/>
-    <keyword type="function" name="xmlGetFeaturesList ()" link="libxml2-parser.html#xmlGetFeaturesList"/>
-    <keyword type="function" name="xmlGetGlobalState ()" link="libxml2-globals.html#xmlGetGlobalState"/>
     <keyword type="function" name="xmlGetID ()" link="libxml2-valid.html#xmlGetID"/>
     <keyword type="function" name="xmlGetIntSubset ()" link="libxml2-tree.html#xmlGetIntSubset"/>
     <keyword type="function" name="xmlGetLastChild ()" link="libxml2-tree.html#xmlGetLastChild"/>
@@ -2346,9 +2312,7 @@
     <keyword type="function" name="xmlGetPredefinedEntity ()" link="libxml2-entities.html#xmlGetPredefinedEntity"/>
     <keyword type="function" name="xmlGetProp ()" link="libxml2-tree.html#xmlGetProp"/>
     <keyword type="function" name="xmlGetRefs ()" link="libxml2-valid.html#xmlGetRefs"/>
-    <keyword type="function" name="xmlGetThreadId ()" link="libxml2-threads.html#xmlGetThreadId"/>
     <keyword type="function" name="xmlGetUTF8Char ()" link="libxml2-xmlstring.html#xmlGetUTF8Char"/>
-    <keyword type="function" name="xmlHandleEntity ()" link="libxml2-parserInternals.html#xmlHandleEntity"/>
     <keyword type="function" name="xmlHasFeature ()" link="libxml2-parser.html#xmlHasFeature"/>
     <keyword type="function" name="xmlHasNsProp ()" link="libxml2-tree.html#xmlHasNsProp"/>
     <keyword type="function" name="xmlHasProp ()" link="libxml2-tree.html#xmlHasProp"/>
@@ -2381,10 +2345,6 @@
     <keyword type="function" name="xmlHashUpdateEntry ()" link="libxml2-hash.html#xmlHashUpdateEntry"/>
     <keyword type="function" name="xmlHashUpdateEntry2 ()" link="libxml2-hash.html#xmlHashUpdateEntry2"/>
     <keyword type="function" name="xmlHashUpdateEntry3 ()" link="libxml2-hash.html#xmlHashUpdateEntry3"/>
-    <keyword type="function" name="xmlIOFTPClose ()" link="libxml2-xmlIO.html#xmlIOFTPClose"/>
-    <keyword type="function" name="xmlIOFTPMatch ()" link="libxml2-xmlIO.html#xmlIOFTPMatch"/>
-    <keyword type="function" name="xmlIOFTPOpen ()" link="libxml2-xmlIO.html#xmlIOFTPOpen"/>
-    <keyword type="function" name="xmlIOFTPRead ()" link="libxml2-xmlIO.html#xmlIOFTPRead"/>
     <keyword type="function" name="xmlIOHTTPClose ()" link="libxml2-xmlIO.html#xmlIOHTTPClose"/>
     <keyword type="function" name="xmlIOHTTPMatch ()" link="libxml2-xmlIO.html#xmlIOHTTPMatch"/>
     <keyword type="function" name="xmlIOHTTPOpen ()" link="libxml2-xmlIO.html#xmlIOHTTPOpen"/>
@@ -2400,8 +2360,7 @@
     <keyword type="function" name="xmlInitThreads ()" link="libxml2-threads.html#xmlInitThreads"/>
     <keyword type="function" name="xmlInitializeCatalog ()" link="libxml2-catalog.html#xmlInitializeCatalog"/>
     <keyword type="function" name="xmlInitializeDict ()" link="libxml2-dict.html#xmlInitializeDict"/>
-    <keyword type="function" name="xmlInitializeGlobalState ()" link="libxml2-globals.html#xmlInitializeGlobalState"/>
-    <keyword type="function" name="xmlInitializePredefinedEntities ()" link="libxml2-entities.html#xmlInitializePredefinedEntities"/>
+    <keyword type="function" name="xmlInputSetEncodingHandler ()" link="libxml2-parser.html#xmlInputSetEncodingHandler"/>
     <keyword type="function" name="xmlIsBaseChar ()" link="libxml2-chvalid.html#xmlIsBaseChar"/>
     <keyword type="function" name="xmlIsBlank ()" link="libxml2-chvalid.html#xmlIsBlank"/>
     <keyword type="function" name="xmlIsBlankNode ()" link="libxml2-tree.html#xmlIsBlankNode"/>
@@ -2412,11 +2371,11 @@
     <keyword type="function" name="xmlIsID ()" link="libxml2-valid.html#xmlIsID"/>
     <keyword type="function" name="xmlIsIdeographic ()" link="libxml2-chvalid.html#xmlIsIdeographic"/>
     <keyword type="function" name="xmlIsLetter ()" link="libxml2-parserInternals.html#xmlIsLetter"/>
-    <keyword type="function" name="xmlIsMainThread ()" link="libxml2-threads.html#xmlIsMainThread"/>
     <keyword type="function" name="xmlIsMixedElement ()" link="libxml2-valid.html#xmlIsMixedElement"/>
     <keyword type="function" name="xmlIsPubidChar ()" link="libxml2-chvalid.html#xmlIsPubidChar"/>
     <keyword type="function" name="xmlIsRef ()" link="libxml2-valid.html#xmlIsRef"/>
     <keyword type="function" name="xmlIsXHTML ()" link="libxml2-tree.html#xmlIsXHTML"/>
+    <keyword type="function" name="xmlIsolat1ToUTF8 ()" link="libxml2-encoding.html#xmlIsolat1ToUTF8"/>
     <keyword type="function" name="xmlKeepBlanksDefault ()" link="libxml2-parser.html#xmlKeepBlanksDefault"/>
     <keyword type="function" name="xmlLastElementChild ()" link="libxml2-tree.html#xmlLastElementChild"/>
     <keyword type="function" name="xmlLineNumbersDefault ()" link="libxml2-parser.html#xmlLineNumbersDefault"/>
@@ -2453,8 +2412,6 @@
     <keyword type="function" name="xmlLoadSGMLSuperCatalog ()" link="libxml2-catalog.html#xmlLoadSGMLSuperCatalog"/>
     <keyword type="function" name="xmlLockLibrary ()" link="libxml2-threads.html#xmlLockLibrary"/>
     <keyword type="function" name="xmlLookupCharEncodingHandler ()" link="libxml2-encoding.html#xmlLookupCharEncodingHandler"/>
-    <keyword type="function" name="xmlLsCountNode ()" link="libxml2-debugXML.html#xmlLsCountNode"/>
-    <keyword type="function" name="xmlLsOneNode ()" link="libxml2-debugXML.html#xmlLsOneNode"/>
     <keyword type="function" name="xmlMallocAtomicLoc ()" link="libxml2-xmlmemory.html#xmlMallocAtomicLoc"/>
     <keyword type="function" name="xmlMallocLoc ()" link="libxml2-xmlmemory.html#xmlMallocLoc"/>
     <keyword type="function" name="xmlMemBlocks ()" link="libxml2-xmlmemory.html#xmlMemBlocks"/>
@@ -2477,31 +2434,6 @@
     <keyword type="function" name="xmlModuleSymbol ()" link="libxml2-xmlmodule.html#xmlModuleSymbol"/>
     <keyword type="function" name="xmlMutexLock ()" link="libxml2-threads.html#xmlMutexLock"/>
     <keyword type="function" name="xmlMutexUnlock ()" link="libxml2-threads.html#xmlMutexUnlock"/>
-    <keyword type="function" name="xmlNamespaceParseNCName ()" link="libxml2-parserInternals.html#xmlNamespaceParseNCName"/>
-    <keyword type="function" name="xmlNamespaceParseNSDef ()" link="libxml2-parserInternals.html#xmlNamespaceParseNSDef"/>
-    <keyword type="function" name="xmlNamespaceParseQName ()" link="libxml2-parserInternals.html#xmlNamespaceParseQName"/>
-    <keyword type="function" name="xmlNanoFTPCheckResponse ()" link="libxml2-nanoftp.html#xmlNanoFTPCheckResponse"/>
-    <keyword type="function" name="xmlNanoFTPCleanup ()" link="libxml2-nanoftp.html#xmlNanoFTPCleanup"/>
-    <keyword type="function" name="xmlNanoFTPClose ()" link="libxml2-nanoftp.html#xmlNanoFTPClose"/>
-    <keyword type="function" name="xmlNanoFTPCloseConnection ()" link="libxml2-nanoftp.html#xmlNanoFTPCloseConnection"/>
-    <keyword type="function" name="xmlNanoFTPConnect ()" link="libxml2-nanoftp.html#xmlNanoFTPConnect"/>
-    <keyword type="function" name="xmlNanoFTPConnectTo ()" link="libxml2-nanoftp.html#xmlNanoFTPConnectTo"/>
-    <keyword type="function" name="xmlNanoFTPCwd ()" link="libxml2-nanoftp.html#xmlNanoFTPCwd"/>
-    <keyword type="function" name="xmlNanoFTPDele ()" link="libxml2-nanoftp.html#xmlNanoFTPDele"/>
-    <keyword type="function" name="xmlNanoFTPFreeCtxt ()" link="libxml2-nanoftp.html#xmlNanoFTPFreeCtxt"/>
-    <keyword type="function" name="xmlNanoFTPGet ()" link="libxml2-nanoftp.html#xmlNanoFTPGet"/>
-    <keyword type="function" name="xmlNanoFTPGetConnection ()" link="libxml2-nanoftp.html#xmlNanoFTPGetConnection"/>
-    <keyword type="function" name="xmlNanoFTPGetResponse ()" link="libxml2-nanoftp.html#xmlNanoFTPGetResponse"/>
-    <keyword type="function" name="xmlNanoFTPGetSocket ()" link="libxml2-nanoftp.html#xmlNanoFTPGetSocket"/>
-    <keyword type="function" name="xmlNanoFTPInit ()" link="libxml2-nanoftp.html#xmlNanoFTPInit"/>
-    <keyword type="function" name="xmlNanoFTPList ()" link="libxml2-nanoftp.html#xmlNanoFTPList"/>
-    <keyword type="function" name="xmlNanoFTPNewCtxt ()" link="libxml2-nanoftp.html#xmlNanoFTPNewCtxt"/>
-    <keyword type="function" name="xmlNanoFTPOpen ()" link="libxml2-nanoftp.html#xmlNanoFTPOpen"/>
-    <keyword type="function" name="xmlNanoFTPProxy ()" link="libxml2-nanoftp.html#xmlNanoFTPProxy"/>
-    <keyword type="function" name="xmlNanoFTPQuit ()" link="libxml2-nanoftp.html#xmlNanoFTPQuit"/>
-    <keyword type="function" name="xmlNanoFTPRead ()" link="libxml2-nanoftp.html#xmlNanoFTPRead"/>
-    <keyword type="function" name="xmlNanoFTPScanProxy ()" link="libxml2-nanoftp.html#xmlNanoFTPScanProxy"/>
-    <keyword type="function" name="xmlNanoFTPUpdateURL ()" link="libxml2-nanoftp.html#xmlNanoFTPUpdateURL"/>
     <keyword type="function" name="xmlNanoHTTPAuthHeader ()" link="libxml2-nanohttp.html#xmlNanoHTTPAuthHeader"/>
     <keyword type="function" name="xmlNanoHTTPCleanup ()" link="libxml2-nanohttp.html#xmlNanoHTTPCleanup"/>
     <keyword type="function" name="xmlNanoHTTPClose ()" link="libxml2-nanohttp.html#xmlNanoHTTPClose"/>
@@ -2541,9 +2473,13 @@
     <keyword type="function" name="xmlNewElementContent ()" link="libxml2-valid.html#xmlNewElementContent"/>
     <keyword type="function" name="xmlNewEntity ()" link="libxml2-entities.html#xmlNewEntity"/>
     <keyword type="function" name="xmlNewEntityInputStream ()" link="libxml2-parserInternals.html#xmlNewEntityInputStream"/>
-    <keyword type="function" name="xmlNewGlobalNs ()" link="libxml2-tree.html#xmlNewGlobalNs"/>
     <keyword type="function" name="xmlNewIOInputStream ()" link="libxml2-parser.html#xmlNewIOInputStream"/>
+    <keyword type="function" name="xmlNewInputFromFd ()" link="libxml2-parser.html#xmlNewInputFromFd"/>
     <keyword type="function" name="xmlNewInputFromFile ()" link="libxml2-parserInternals.html#xmlNewInputFromFile"/>
+    <keyword type="function" name="xmlNewInputFromIO ()" link="libxml2-parser.html#xmlNewInputFromIO"/>
+    <keyword type="function" name="xmlNewInputFromMemory ()" link="libxml2-parser.html#xmlNewInputFromMemory"/>
+    <keyword type="function" name="xmlNewInputFromString ()" link="libxml2-parser.html#xmlNewInputFromString"/>
+    <keyword type="function" name="xmlNewInputFromUrl ()" link="libxml2-parser.html#xmlNewInputFromUrl"/>
     <keyword type="function" name="xmlNewInputStream ()" link="libxml2-parserInternals.html#xmlNewInputStream"/>
     <keyword type="function" name="xmlNewMutex ()" link="libxml2-threads.html#xmlNewMutex"/>
     <keyword type="function" name="xmlNewNode ()" link="libxml2-tree.html#xmlNewNode"/>
@@ -2653,7 +2589,6 @@
     <keyword type="function" name="xmlParseMemory ()" link="libxml2-parser.html#xmlParseMemory"/>
     <keyword type="function" name="xmlParseMisc ()" link="libxml2-parserInternals.html#xmlParseMisc"/>
     <keyword type="function" name="xmlParseName ()" link="libxml2-parserInternals.html#xmlParseName"/>
-    <keyword type="function" name="xmlParseNamespace ()" link="libxml2-parserInternals.html#xmlParseNamespace"/>
     <keyword type="function" name="xmlParseNmtoken ()" link="libxml2-parserInternals.html#xmlParseNmtoken"/>
     <keyword type="function" name="xmlParseNotationDecl ()" link="libxml2-parserInternals.html#xmlParseNotationDecl"/>
     <keyword type="function" name="xmlParseNotationType ()" link="libxml2-parserInternals.html#xmlParseNotationType"/>
@@ -2661,7 +2596,6 @@
     <keyword type="function" name="xmlParsePI ()" link="libxml2-parserInternals.html#xmlParsePI"/>
     <keyword type="function" name="xmlParsePITarget ()" link="libxml2-parserInternals.html#xmlParsePITarget"/>
     <keyword type="function" name="xmlParsePubidLiteral ()" link="libxml2-parserInternals.html#xmlParsePubidLiteral"/>
-    <keyword type="function" name="xmlParseQuotedString ()" link="libxml2-parserInternals.html#xmlParseQuotedString"/>
     <keyword type="function" name="xmlParseReference ()" link="libxml2-parserInternals.html#xmlParseReference"/>
     <keyword type="function" name="xmlParseSDDecl ()" link="libxml2-parserInternals.html#xmlParseSDDecl"/>
     <keyword type="function" name="xmlParseStartTag ()" link="libxml2-parserInternals.html#xmlParseStartTag"/>
@@ -2680,7 +2614,6 @@
     <keyword type="function" name="xmlParserFindNodeInfoIndex ()" link="libxml2-parser.html#xmlParserFindNodeInfoIndex"/>
     <keyword type="function" name="xmlParserGetDirectory ()" link="libxml2-xmlIO.html#xmlParserGetDirectory"/>
     <keyword type="function" name="xmlParserHandlePEReference ()" link="libxml2-parserInternals.html#xmlParserHandlePEReference"/>
-    <keyword type="function" name="xmlParserHandleReference ()" link="libxml2-parserInternals.html#xmlParserHandleReference"/>
     <keyword type="function" name="xmlParserInputBufferCreateFd ()" link="libxml2-xmlIO.html#xmlParserInputBufferCreateFd"/>
     <keyword type="function" name="xmlParserInputBufferCreateFile ()" link="libxml2-xmlIO.html#xmlParserInputBufferCreateFile"/>
     <keyword type="function" name="xmlParserInputBufferCreateFilename ()" link="libxml2-xmlIO.html#xmlParserInputBufferCreateFilename"/>
@@ -2773,6 +2706,7 @@
     <keyword type="function" name="xmlRelaxNGParse ()" link="libxml2-relaxng.html#xmlRelaxNGParse"/>
     <keyword type="function" name="xmlRelaxNGSetParserErrors ()" link="libxml2-relaxng.html#xmlRelaxNGSetParserErrors"/>
     <keyword type="function" name="xmlRelaxNGSetParserStructuredErrors ()" link="libxml2-relaxng.html#xmlRelaxNGSetParserStructuredErrors"/>
+    <keyword type="function" name="xmlRelaxNGSetResourceLoader ()" link="libxml2-relaxng.html#xmlRelaxNGSetResourceLoader"/>
     <keyword type="function" name="xmlRelaxNGSetValidErrors ()" link="libxml2-relaxng.html#xmlRelaxNGSetValidErrors"/>
     <keyword type="function" name="xmlRelaxNGSetValidStructuredErrors ()" link="libxml2-relaxng.html#xmlRelaxNGSetValidStructuredErrors"/>
     <keyword type="function" name="xmlRelaxNGValidateDoc ()" link="libxml2-relaxng.html#xmlRelaxNGValidateDoc"/>
@@ -2842,13 +2776,13 @@
     <keyword type="function" name="xmlSaveFormatFileTo ()" link="libxml2-tree.html#xmlSaveFormatFileTo"/>
     <keyword type="function" name="xmlSaveSetAttrEscape ()" link="libxml2-xmlsave.html#xmlSaveSetAttrEscape"/>
     <keyword type="function" name="xmlSaveSetEscape ()" link="libxml2-xmlsave.html#xmlSaveSetEscape"/>
+    <keyword type="function" name="xmlSaveSetIndentString ()" link="libxml2-xmlsave.html#xmlSaveSetIndentString"/>
     <keyword type="function" name="xmlSaveToBuffer ()" link="libxml2-xmlsave.html#xmlSaveToBuffer"/>
     <keyword type="function" name="xmlSaveToFd ()" link="libxml2-xmlsave.html#xmlSaveToFd"/>
     <keyword type="function" name="xmlSaveToFilename ()" link="libxml2-xmlsave.html#xmlSaveToFilename"/>
     <keyword type="function" name="xmlSaveToIO ()" link="libxml2-xmlsave.html#xmlSaveToIO"/>
     <keyword type="function" name="xmlSaveTree ()" link="libxml2-xmlsave.html#xmlSaveTree"/>
     <keyword type="function" name="xmlSaveUri ()" link="libxml2-uri.html#xmlSaveUri"/>
-    <keyword type="function" name="xmlScanName ()" link="libxml2-parserInternals.html#xmlScanName"/>
     <keyword type="function" name="xmlSchemaCheckFacet ()" link="libxml2-xmlschemastypes.html#xmlSchemaCheckFacet"/>
     <keyword type="function" name="xmlSchemaCleanupTypes ()" link="libxml2-xmlschemastypes.html#xmlSchemaCleanupTypes"/>
     <keyword type="function" name="xmlSchemaCollapseString ()" link="libxml2-xmlschemastypes.html#xmlSchemaCollapseString"/>
@@ -2888,6 +2822,7 @@
     <keyword type="function" name="xmlSchemaSAXUnplug ()" link="libxml2-xmlschemas.html#xmlSchemaSAXUnplug"/>
     <keyword type="function" name="xmlSchemaSetParserErrors ()" link="libxml2-xmlschemas.html#xmlSchemaSetParserErrors"/>
     <keyword type="function" name="xmlSchemaSetParserStructuredErrors ()" link="libxml2-xmlschemas.html#xmlSchemaSetParserStructuredErrors"/>
+    <keyword type="function" name="xmlSchemaSetResourceLoader ()" link="libxml2-xmlschemas.html#xmlSchemaSetResourceLoader"/>
     <keyword type="function" name="xmlSchemaSetValidErrors ()" link="libxml2-xmlschemas.html#xmlSchemaSetValidErrors"/>
     <keyword type="function" name="xmlSchemaSetValidOptions ()" link="libxml2-xmlschemas.html#xmlSchemaSetValidOptions"/>
     <keyword type="function" name="xmlSchemaSetValidStructuredErrors ()" link="libxml2-xmlschemas.html#xmlSchemaSetValidStructuredErrors"/>
@@ -2927,9 +2862,7 @@
     <keyword type="function" name="xmlSetBufferAllocationScheme ()" link="libxml2-tree.html#xmlSetBufferAllocationScheme"/>
     <keyword type="function" name="xmlSetCompressMode ()" link="libxml2-tree.html#xmlSetCompressMode"/>
     <keyword type="function" name="xmlSetDocCompressMode ()" link="libxml2-tree.html#xmlSetDocCompressMode"/>
-    <keyword type="function" name="xmlSetEntityReferenceFunc ()" link="libxml2-parserInternals.html#xmlSetEntityReferenceFunc"/>
     <keyword type="function" name="xmlSetExternalEntityLoader ()" link="libxml2-parser.html#xmlSetExternalEntityLoader"/>
-    <keyword type="function" name="xmlSetFeature ()" link="libxml2-parser.html#xmlSetFeature"/>
     <keyword type="function" name="xmlSetGenericErrorFunc ()" link="libxml2-xmlerror.html#xmlSetGenericErrorFunc"/>
     <keyword type="function" name="xmlSetListDoc ()" link="libxml2-tree.html#xmlSetListDoc"/>
     <keyword type="function" name="xmlSetNs ()" link="libxml2-tree.html#xmlSetNs"/>
@@ -2938,20 +2871,6 @@
     <keyword type="function" name="xmlSetStructuredErrorFunc ()" link="libxml2-xmlerror.html#xmlSetStructuredErrorFunc"/>
     <keyword type="function" name="xmlSetTreeDoc ()" link="libxml2-tree.html#xmlSetTreeDoc"/>
     <keyword type="function" name="xmlSetupParserForBuffer ()" link="libxml2-parser.html#xmlSetupParserForBuffer"/>
-    <keyword type="function" name="xmlShell ()" link="libxml2-debugXML.html#xmlShell"/>
-    <keyword type="function" name="xmlShellBase ()" link="libxml2-debugXML.html#xmlShellBase"/>
-    <keyword type="function" name="xmlShellCat ()" link="libxml2-debugXML.html#xmlShellCat"/>
-    <keyword type="function" name="xmlShellDir ()" link="libxml2-debugXML.html#xmlShellDir"/>
-    <keyword type="function" name="xmlShellDu ()" link="libxml2-debugXML.html#xmlShellDu"/>
-    <keyword type="function" name="xmlShellList ()" link="libxml2-debugXML.html#xmlShellList"/>
-    <keyword type="function" name="xmlShellLoad ()" link="libxml2-debugXML.html#xmlShellLoad"/>
-    <keyword type="function" name="xmlShellPrintNode ()" link="libxml2-debugXML.html#xmlShellPrintNode"/>
-    <keyword type="function" name="xmlShellPrintXPathError ()" link="libxml2-debugXML.html#xmlShellPrintXPathError"/>
-    <keyword type="function" name="xmlShellPrintXPathResult ()" link="libxml2-debugXML.html#xmlShellPrintXPathResult"/>
-    <keyword type="function" name="xmlShellPwd ()" link="libxml2-debugXML.html#xmlShellPwd"/>
-    <keyword type="function" name="xmlShellSave ()" link="libxml2-debugXML.html#xmlShellSave"/>
-    <keyword type="function" name="xmlShellValidate ()" link="libxml2-debugXML.html#xmlShellValidate"/>
-    <keyword type="function" name="xmlShellWrite ()" link="libxml2-debugXML.html#xmlShellWrite"/>
     <keyword type="function" name="xmlSkipBlankChars ()" link="libxml2-parserInternals.html#xmlSkipBlankChars"/>
     <keyword type="function" name="xmlSnprintfElementContent ()" link="libxml2-valid.html#xmlSnprintfElementContent"/>
     <keyword type="function" name="xmlSplitQName ()" link="libxml2-parserInternals.html#xmlSplitQName"/>
@@ -3061,6 +2980,7 @@
     <keyword type="function" name="xmlTextReaderSetErrorHandler ()" link="libxml2-xmlreader.html#xmlTextReaderSetErrorHandler"/>
     <keyword type="function" name="xmlTextReaderSetMaxAmplification ()" link="libxml2-xmlreader.html#xmlTextReaderSetMaxAmplification"/>
     <keyword type="function" name="xmlTextReaderSetParserProp ()" link="libxml2-xmlreader.html#xmlTextReaderSetParserProp"/>
+    <keyword type="function" name="xmlTextReaderSetResourceLoader ()" link="libxml2-xmlreader.html#xmlTextReaderSetResourceLoader"/>
     <keyword type="function" name="xmlTextReaderSetSchema ()" link="libxml2-xmlreader.html#xmlTextReaderSetSchema"/>
     <keyword type="function" name="xmlTextReaderSetStructuredErrorHandler ()" link="libxml2-xmlreader.html#xmlTextReaderSetStructuredErrorHandler"/>
     <keyword type="function" name="xmlTextReaderSetup ()" link="libxml2-xmlreader.html#xmlTextReaderSetup"/>
@@ -3141,8 +3061,6 @@
     <keyword type="function" name="xmlTextWriterWriteVFormatPI ()" link="libxml2-xmlwriter.html#xmlTextWriterWriteVFormatPI"/>
     <keyword type="function" name="xmlTextWriterWriteVFormatRaw ()" link="libxml2-xmlwriter.html#xmlTextWriterWriteVFormatRaw"/>
     <keyword type="function" name="xmlTextWriterWriteVFormatString ()" link="libxml2-xmlwriter.html#xmlTextWriterWriteVFormatString"/>
-    <keyword type="function" name="xmlThrDefBufferAllocScheme ()" link="libxml2-tree.html#xmlThrDefBufferAllocScheme"/>
-    <keyword type="function" name="xmlThrDefDefaultBufferSize ()" link="libxml2-tree.html#xmlThrDefDefaultBufferSize"/>
     <keyword type="function" name="xmlThrDefDeregisterNodeDefault ()" link="libxml2-tree.html#xmlThrDefDeregisterNodeDefault"/>
     <keyword type="function" name="xmlThrDefDoValidityCheckingDefaultValue ()" link="libxml2-parser.html#xmlThrDefDoValidityCheckingDefaultValue"/>
     <keyword type="function" name="xmlThrDefGetWarningsDefaultValue ()" link="libxml2-parser.html#xmlThrDefGetWarningsDefaultValue"/>
@@ -3151,7 +3069,6 @@
     <keyword type="function" name="xmlThrDefLineNumbersDefaultValue ()" link="libxml2-parser.html#xmlThrDefLineNumbersDefaultValue"/>
     <keyword type="function" name="xmlThrDefLoadExtDtdDefaultValue ()" link="libxml2-parser.html#xmlThrDefLoadExtDtdDefaultValue"/>
     <keyword type="function" name="xmlThrDefOutputBufferCreateFilenameDefault ()" link="libxml2-xmlIO.html#xmlThrDefOutputBufferCreateFilenameDefault"/>
-    <keyword type="function" name="xmlThrDefParserDebugEntities ()" link="libxml2-parser.html#xmlThrDefParserDebugEntities"/>
     <keyword type="function" name="xmlThrDefParserInputBufferCreateFilenameDefault ()" link="libxml2-xmlIO.html#xmlThrDefParserInputBufferCreateFilenameDefault"/>
     <keyword type="function" name="xmlThrDefPedanticParserDefaultValue ()" link="libxml2-parser.html#xmlThrDefPedanticParserDefaultValue"/>
     <keyword type="function" name="xmlThrDefRegisterNodeDefault ()" link="libxml2-tree.html#xmlThrDefRegisterNodeDefault"/>
@@ -3160,172 +3077,6 @@
     <keyword type="function" name="xmlThrDefSetStructuredErrorFunc ()" link="libxml2-xmlerror.html#xmlThrDefSetStructuredErrorFunc"/>
     <keyword type="function" name="xmlThrDefSubstituteEntitiesDefaultValue ()" link="libxml2-parser.html#xmlThrDefSubstituteEntitiesDefaultValue"/>
     <keyword type="function" name="xmlThrDefTreeIndentString ()" link="libxml2-xmlsave.html#xmlThrDefTreeIndentString"/>
-    <keyword type="function" name="xmlUCSIsAegeanNumbers ()" link="libxml2-xmlunicode.html#xmlUCSIsAegeanNumbers"/>
-    <keyword type="function" name="xmlUCSIsAlphabeticPresentationForms ()" link="libxml2-xmlunicode.html#xmlUCSIsAlphabeticPresentationForms"/>
-    <keyword type="function" name="xmlUCSIsArabic ()" link="libxml2-xmlunicode.html#xmlUCSIsArabic"/>
-    <keyword type="function" name="xmlUCSIsArabicPresentationFormsA ()" link="libxml2-xmlunicode.html#xmlUCSIsArabicPresentationFormsA"/>
-    <keyword type="function" name="xmlUCSIsArabicPresentationFormsB ()" link="libxml2-xmlunicode.html#xmlUCSIsArabicPresentationFormsB"/>
-    <keyword type="function" name="xmlUCSIsArmenian ()" link="libxml2-xmlunicode.html#xmlUCSIsArmenian"/>
-    <keyword type="function" name="xmlUCSIsArrows ()" link="libxml2-xmlunicode.html#xmlUCSIsArrows"/>
-    <keyword type="function" name="xmlUCSIsBasicLatin ()" link="libxml2-xmlunicode.html#xmlUCSIsBasicLatin"/>
-    <keyword type="function" name="xmlUCSIsBengali ()" link="libxml2-xmlunicode.html#xmlUCSIsBengali"/>
-    <keyword type="function" name="xmlUCSIsBlock ()" link="libxml2-xmlunicode.html#xmlUCSIsBlock"/>
-    <keyword type="function" name="xmlUCSIsBlockElements ()" link="libxml2-xmlunicode.html#xmlUCSIsBlockElements"/>
-    <keyword type="function" name="xmlUCSIsBopomofo ()" link="libxml2-xmlunicode.html#xmlUCSIsBopomofo"/>
-    <keyword type="function" name="xmlUCSIsBopomofoExtended ()" link="libxml2-xmlunicode.html#xmlUCSIsBopomofoExtended"/>
-    <keyword type="function" name="xmlUCSIsBoxDrawing ()" link="libxml2-xmlunicode.html#xmlUCSIsBoxDrawing"/>
-    <keyword type="function" name="xmlUCSIsBraillePatterns ()" link="libxml2-xmlunicode.html#xmlUCSIsBraillePatterns"/>
-    <keyword type="function" name="xmlUCSIsBuhid ()" link="libxml2-xmlunicode.html#xmlUCSIsBuhid"/>
-    <keyword type="function" name="xmlUCSIsByzantineMusicalSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsByzantineMusicalSymbols"/>
-    <keyword type="function" name="xmlUCSIsCJKCompatibility ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKCompatibility"/>
-    <keyword type="function" name="xmlUCSIsCJKCompatibilityForms ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKCompatibilityForms"/>
-    <keyword type="function" name="xmlUCSIsCJKCompatibilityIdeographs ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKCompatibilityIdeographs"/>
-    <keyword type="function" name="xmlUCSIsCJKCompatibilityIdeographsSupplement ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKCompatibilityIdeographsSupplement"/>
-    <keyword type="function" name="xmlUCSIsCJKRadicalsSupplement ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKRadicalsSupplement"/>
-    <keyword type="function" name="xmlUCSIsCJKSymbolsandPunctuation ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKSymbolsandPunctuation"/>
-    <keyword type="function" name="xmlUCSIsCJKUnifiedIdeographs ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKUnifiedIdeographs"/>
-    <keyword type="function" name="xmlUCSIsCJKUnifiedIdeographsExtensionA ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKUnifiedIdeographsExtensionA"/>
-    <keyword type="function" name="xmlUCSIsCJKUnifiedIdeographsExtensionB ()" link="libxml2-xmlunicode.html#xmlUCSIsCJKUnifiedIdeographsExtensionB"/>
-    <keyword type="function" name="xmlUCSIsCat ()" link="libxml2-xmlunicode.html#xmlUCSIsCat"/>
-    <keyword type="function" name="xmlUCSIsCatC ()" link="libxml2-xmlunicode.html#xmlUCSIsCatC"/>
-    <keyword type="function" name="xmlUCSIsCatCc ()" link="libxml2-xmlunicode.html#xmlUCSIsCatCc"/>
-    <keyword type="function" name="xmlUCSIsCatCf ()" link="libxml2-xmlunicode.html#xmlUCSIsCatCf"/>
-    <keyword type="function" name="xmlUCSIsCatCo ()" link="libxml2-xmlunicode.html#xmlUCSIsCatCo"/>
-    <keyword type="function" name="xmlUCSIsCatCs ()" link="libxml2-xmlunicode.html#xmlUCSIsCatCs"/>
-    <keyword type="function" name="xmlUCSIsCatL ()" link="libxml2-xmlunicode.html#xmlUCSIsCatL"/>
-    <keyword type="function" name="xmlUCSIsCatLl ()" link="libxml2-xmlunicode.html#xmlUCSIsCatLl"/>
-    <keyword type="function" name="xmlUCSIsCatLm ()" link="libxml2-xmlunicode.html#xmlUCSIsCatLm"/>
-    <keyword type="function" name="xmlUCSIsCatLo ()" link="libxml2-xmlunicode.html#xmlUCSIsCatLo"/>
-    <keyword type="function" name="xmlUCSIsCatLt ()" link="libxml2-xmlunicode.html#xmlUCSIsCatLt"/>
-    <keyword type="function" name="xmlUCSIsCatLu ()" link="libxml2-xmlunicode.html#xmlUCSIsCatLu"/>
-    <keyword type="function" name="xmlUCSIsCatM ()" link="libxml2-xmlunicode.html#xmlUCSIsCatM"/>
-    <keyword type="function" name="xmlUCSIsCatMc ()" link="libxml2-xmlunicode.html#xmlUCSIsCatMc"/>
-    <keyword type="function" name="xmlUCSIsCatMe ()" link="libxml2-xmlunicode.html#xmlUCSIsCatMe"/>
-    <keyword type="function" name="xmlUCSIsCatMn ()" link="libxml2-xmlunicode.html#xmlUCSIsCatMn"/>
-    <keyword type="function" name="xmlUCSIsCatN ()" link="libxml2-xmlunicode.html#xmlUCSIsCatN"/>
-    <keyword type="function" name="xmlUCSIsCatNd ()" link="libxml2-xmlunicode.html#xmlUCSIsCatNd"/>
-    <keyword type="function" name="xmlUCSIsCatNl ()" link="libxml2-xmlunicode.html#xmlUCSIsCatNl"/>
-    <keyword type="function" name="xmlUCSIsCatNo ()" link="libxml2-xmlunicode.html#xmlUCSIsCatNo"/>
-    <keyword type="function" name="xmlUCSIsCatP ()" link="libxml2-xmlunicode.html#xmlUCSIsCatP"/>
-    <keyword type="function" name="xmlUCSIsCatPc ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPc"/>
-    <keyword type="function" name="xmlUCSIsCatPd ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPd"/>
-    <keyword type="function" name="xmlUCSIsCatPe ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPe"/>
-    <keyword type="function" name="xmlUCSIsCatPf ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPf"/>
-    <keyword type="function" name="xmlUCSIsCatPi ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPi"/>
-    <keyword type="function" name="xmlUCSIsCatPo ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPo"/>
-    <keyword type="function" name="xmlUCSIsCatPs ()" link="libxml2-xmlunicode.html#xmlUCSIsCatPs"/>
-    <keyword type="function" name="xmlUCSIsCatS ()" link="libxml2-xmlunicode.html#xmlUCSIsCatS"/>
-    <keyword type="function" name="xmlUCSIsCatSc ()" link="libxml2-xmlunicode.html#xmlUCSIsCatSc"/>
-    <keyword type="function" name="xmlUCSIsCatSk ()" link="libxml2-xmlunicode.html#xmlUCSIsCatSk"/>
-    <keyword type="function" name="xmlUCSIsCatSm ()" link="libxml2-xmlunicode.html#xmlUCSIsCatSm"/>
-    <keyword type="function" name="xmlUCSIsCatSo ()" link="libxml2-xmlunicode.html#xmlUCSIsCatSo"/>
-    <keyword type="function" name="xmlUCSIsCatZ ()" link="libxml2-xmlunicode.html#xmlUCSIsCatZ"/>
-    <keyword type="function" name="xmlUCSIsCatZl ()" link="libxml2-xmlunicode.html#xmlUCSIsCatZl"/>
-    <keyword type="function" name="xmlUCSIsCatZp ()" link="libxml2-xmlunicode.html#xmlUCSIsCatZp"/>
-    <keyword type="function" name="xmlUCSIsCatZs ()" link="libxml2-xmlunicode.html#xmlUCSIsCatZs"/>
-    <keyword type="function" name="xmlUCSIsCherokee ()" link="libxml2-xmlunicode.html#xmlUCSIsCherokee"/>
-    <keyword type="function" name="xmlUCSIsCombiningDiacriticalMarks ()" link="libxml2-xmlunicode.html#xmlUCSIsCombiningDiacriticalMarks"/>
-    <keyword type="function" name="xmlUCSIsCombiningDiacriticalMarksforSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsCombiningDiacriticalMarksforSymbols"/>
-    <keyword type="function" name="xmlUCSIsCombiningHalfMarks ()" link="libxml2-xmlunicode.html#xmlUCSIsCombiningHalfMarks"/>
-    <keyword type="function" name="xmlUCSIsCombiningMarksforSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsCombiningMarksforSymbols"/>
-    <keyword type="function" name="xmlUCSIsControlPictures ()" link="libxml2-xmlunicode.html#xmlUCSIsControlPictures"/>
-    <keyword type="function" name="xmlUCSIsCurrencySymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsCurrencySymbols"/>
-    <keyword type="function" name="xmlUCSIsCypriotSyllabary ()" link="libxml2-xmlunicode.html#xmlUCSIsCypriotSyllabary"/>
-    <keyword type="function" name="xmlUCSIsCyrillic ()" link="libxml2-xmlunicode.html#xmlUCSIsCyrillic"/>
-    <keyword type="function" name="xmlUCSIsCyrillicSupplement ()" link="libxml2-xmlunicode.html#xmlUCSIsCyrillicSupplement"/>
-    <keyword type="function" name="xmlUCSIsDeseret ()" link="libxml2-xmlunicode.html#xmlUCSIsDeseret"/>
-    <keyword type="function" name="xmlUCSIsDevanagari ()" link="libxml2-xmlunicode.html#xmlUCSIsDevanagari"/>
-    <keyword type="function" name="xmlUCSIsDingbats ()" link="libxml2-xmlunicode.html#xmlUCSIsDingbats"/>
-    <keyword type="function" name="xmlUCSIsEnclosedAlphanumerics ()" link="libxml2-xmlunicode.html#xmlUCSIsEnclosedAlphanumerics"/>
-    <keyword type="function" name="xmlUCSIsEnclosedCJKLettersandMonths ()" link="libxml2-xmlunicode.html#xmlUCSIsEnclosedCJKLettersandMonths"/>
-    <keyword type="function" name="xmlUCSIsEthiopic ()" link="libxml2-xmlunicode.html#xmlUCSIsEthiopic"/>
-    <keyword type="function" name="xmlUCSIsGeneralPunctuation ()" link="libxml2-xmlunicode.html#xmlUCSIsGeneralPunctuation"/>
-    <keyword type="function" name="xmlUCSIsGeometricShapes ()" link="libxml2-xmlunicode.html#xmlUCSIsGeometricShapes"/>
-    <keyword type="function" name="xmlUCSIsGeorgian ()" link="libxml2-xmlunicode.html#xmlUCSIsGeorgian"/>
-    <keyword type="function" name="xmlUCSIsGothic ()" link="libxml2-xmlunicode.html#xmlUCSIsGothic"/>
-    <keyword type="function" name="xmlUCSIsGreek ()" link="libxml2-xmlunicode.html#xmlUCSIsGreek"/>
-    <keyword type="function" name="xmlUCSIsGreekExtended ()" link="libxml2-xmlunicode.html#xmlUCSIsGreekExtended"/>
-    <keyword type="function" name="xmlUCSIsGreekandCoptic ()" link="libxml2-xmlunicode.html#xmlUCSIsGreekandCoptic"/>
-    <keyword type="function" name="xmlUCSIsGujarati ()" link="libxml2-xmlunicode.html#xmlUCSIsGujarati"/>
-    <keyword type="function" name="xmlUCSIsGurmukhi ()" link="libxml2-xmlunicode.html#xmlUCSIsGurmukhi"/>
-    <keyword type="function" name="xmlUCSIsHalfwidthandFullwidthForms ()" link="libxml2-xmlunicode.html#xmlUCSIsHalfwidthandFullwidthForms"/>
-    <keyword type="function" name="xmlUCSIsHangulCompatibilityJamo ()" link="libxml2-xmlunicode.html#xmlUCSIsHangulCompatibilityJamo"/>
-    <keyword type="function" name="xmlUCSIsHangulJamo ()" link="libxml2-xmlunicode.html#xmlUCSIsHangulJamo"/>
-    <keyword type="function" name="xmlUCSIsHangulSyllables ()" link="libxml2-xmlunicode.html#xmlUCSIsHangulSyllables"/>
-    <keyword type="function" name="xmlUCSIsHanunoo ()" link="libxml2-xmlunicode.html#xmlUCSIsHanunoo"/>
-    <keyword type="function" name="xmlUCSIsHebrew ()" link="libxml2-xmlunicode.html#xmlUCSIsHebrew"/>
-    <keyword type="function" name="xmlUCSIsHighPrivateUseSurrogates ()" link="libxml2-xmlunicode.html#xmlUCSIsHighPrivateUseSurrogates"/>
-    <keyword type="function" name="xmlUCSIsHighSurrogates ()" link="libxml2-xmlunicode.html#xmlUCSIsHighSurrogates"/>
-    <keyword type="function" name="xmlUCSIsHiragana ()" link="libxml2-xmlunicode.html#xmlUCSIsHiragana"/>
-    <keyword type="function" name="xmlUCSIsIPAExtensions ()" link="libxml2-xmlunicode.html#xmlUCSIsIPAExtensions"/>
-    <keyword type="function" name="xmlUCSIsIdeographicDescriptionCharacters ()" link="libxml2-xmlunicode.html#xmlUCSIsIdeographicDescriptionCharacters"/>
-    <keyword type="function" name="xmlUCSIsKanbun ()" link="libxml2-xmlunicode.html#xmlUCSIsKanbun"/>
-    <keyword type="function" name="xmlUCSIsKangxiRadicals ()" link="libxml2-xmlunicode.html#xmlUCSIsKangxiRadicals"/>
-    <keyword type="function" name="xmlUCSIsKannada ()" link="libxml2-xmlunicode.html#xmlUCSIsKannada"/>
-    <keyword type="function" name="xmlUCSIsKatakana ()" link="libxml2-xmlunicode.html#xmlUCSIsKatakana"/>
-    <keyword type="function" name="xmlUCSIsKatakanaPhoneticExtensions ()" link="libxml2-xmlunicode.html#xmlUCSIsKatakanaPhoneticExtensions"/>
-    <keyword type="function" name="xmlUCSIsKhmer ()" link="libxml2-xmlunicode.html#xmlUCSIsKhmer"/>
-    <keyword type="function" name="xmlUCSIsKhmerSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsKhmerSymbols"/>
-    <keyword type="function" name="xmlUCSIsLao ()" link="libxml2-xmlunicode.html#xmlUCSIsLao"/>
-    <keyword type="function" name="xmlUCSIsLatin1Supplement ()" link="libxml2-xmlunicode.html#xmlUCSIsLatin1Supplement"/>
-    <keyword type="function" name="xmlUCSIsLatinExtendedA ()" link="libxml2-xmlunicode.html#xmlUCSIsLatinExtendedA"/>
-    <keyword type="function" name="xmlUCSIsLatinExtendedAdditional ()" link="libxml2-xmlunicode.html#xmlUCSIsLatinExtendedAdditional"/>
-    <keyword type="function" name="xmlUCSIsLatinExtendedB ()" link="libxml2-xmlunicode.html#xmlUCSIsLatinExtendedB"/>
-    <keyword type="function" name="xmlUCSIsLetterlikeSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsLetterlikeSymbols"/>
-    <keyword type="function" name="xmlUCSIsLimbu ()" link="libxml2-xmlunicode.html#xmlUCSIsLimbu"/>
-    <keyword type="function" name="xmlUCSIsLinearBIdeograms ()" link="libxml2-xmlunicode.html#xmlUCSIsLinearBIdeograms"/>
-    <keyword type="function" name="xmlUCSIsLinearBSyllabary ()" link="libxml2-xmlunicode.html#xmlUCSIsLinearBSyllabary"/>
-    <keyword type="function" name="xmlUCSIsLowSurrogates ()" link="libxml2-xmlunicode.html#xmlUCSIsLowSurrogates"/>
-    <keyword type="function" name="xmlUCSIsMalayalam ()" link="libxml2-xmlunicode.html#xmlUCSIsMalayalam"/>
-    <keyword type="function" name="xmlUCSIsMathematicalAlphanumericSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsMathematicalAlphanumericSymbols"/>
-    <keyword type="function" name="xmlUCSIsMathematicalOperators ()" link="libxml2-xmlunicode.html#xmlUCSIsMathematicalOperators"/>
-    <keyword type="function" name="xmlUCSIsMiscellaneousMathematicalSymbolsA ()" link="libxml2-xmlunicode.html#xmlUCSIsMiscellaneousMathematicalSymbolsA"/>
-    <keyword type="function" name="xmlUCSIsMiscellaneousMathematicalSymbolsB ()" link="libxml2-xmlunicode.html#xmlUCSIsMiscellaneousMathematicalSymbolsB"/>
-    <keyword type="function" name="xmlUCSIsMiscellaneousSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsMiscellaneousSymbols"/>
-    <keyword type="function" name="xmlUCSIsMiscellaneousSymbolsandArrows ()" link="libxml2-xmlunicode.html#xmlUCSIsMiscellaneousSymbolsandArrows"/>
-    <keyword type="function" name="xmlUCSIsMiscellaneousTechnical ()" link="libxml2-xmlunicode.html#xmlUCSIsMiscellaneousTechnical"/>
-    <keyword type="function" name="xmlUCSIsMongolian ()" link="libxml2-xmlunicode.html#xmlUCSIsMongolian"/>
-    <keyword type="function" name="xmlUCSIsMusicalSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsMusicalSymbols"/>
-    <keyword type="function" name="xmlUCSIsMyanmar ()" link="libxml2-xmlunicode.html#xmlUCSIsMyanmar"/>
-    <keyword type="function" name="xmlUCSIsNumberForms ()" link="libxml2-xmlunicode.html#xmlUCSIsNumberForms"/>
-    <keyword type="function" name="xmlUCSIsOgham ()" link="libxml2-xmlunicode.html#xmlUCSIsOgham"/>
-    <keyword type="function" name="xmlUCSIsOldItalic ()" link="libxml2-xmlunicode.html#xmlUCSIsOldItalic"/>
-    <keyword type="function" name="xmlUCSIsOpticalCharacterRecognition ()" link="libxml2-xmlunicode.html#xmlUCSIsOpticalCharacterRecognition"/>
-    <keyword type="function" name="xmlUCSIsOriya ()" link="libxml2-xmlunicode.html#xmlUCSIsOriya"/>
-    <keyword type="function" name="xmlUCSIsOsmanya ()" link="libxml2-xmlunicode.html#xmlUCSIsOsmanya"/>
-    <keyword type="function" name="xmlUCSIsPhoneticExtensions ()" link="libxml2-xmlunicode.html#xmlUCSIsPhoneticExtensions"/>
-    <keyword type="function" name="xmlUCSIsPrivateUse ()" link="libxml2-xmlunicode.html#xmlUCSIsPrivateUse"/>
-    <keyword type="function" name="xmlUCSIsPrivateUseArea ()" link="libxml2-xmlunicode.html#xmlUCSIsPrivateUseArea"/>
-    <keyword type="function" name="xmlUCSIsRunic ()" link="libxml2-xmlunicode.html#xmlUCSIsRunic"/>
-    <keyword type="function" name="xmlUCSIsShavian ()" link="libxml2-xmlunicode.html#xmlUCSIsShavian"/>
-    <keyword type="function" name="xmlUCSIsSinhala ()" link="libxml2-xmlunicode.html#xmlUCSIsSinhala"/>
-    <keyword type="function" name="xmlUCSIsSmallFormVariants ()" link="libxml2-xmlunicode.html#xmlUCSIsSmallFormVariants"/>
-    <keyword type="function" name="xmlUCSIsSpacingModifierLetters ()" link="libxml2-xmlunicode.html#xmlUCSIsSpacingModifierLetters"/>
-    <keyword type="function" name="xmlUCSIsSpecials ()" link="libxml2-xmlunicode.html#xmlUCSIsSpecials"/>
-    <keyword type="function" name="xmlUCSIsSuperscriptsandSubscripts ()" link="libxml2-xmlunicode.html#xmlUCSIsSuperscriptsandSubscripts"/>
-    <keyword type="function" name="xmlUCSIsSupplementalArrowsA ()" link="libxml2-xmlunicode.html#xmlUCSIsSupplementalArrowsA"/>
-    <keyword type="function" name="xmlUCSIsSupplementalArrowsB ()" link="libxml2-xmlunicode.html#xmlUCSIsSupplementalArrowsB"/>
-    <keyword type="function" name="xmlUCSIsSupplementalMathematicalOperators ()" link="libxml2-xmlunicode.html#xmlUCSIsSupplementalMathematicalOperators"/>
-    <keyword type="function" name="xmlUCSIsSupplementaryPrivateUseAreaA ()" link="libxml2-xmlunicode.html#xmlUCSIsSupplementaryPrivateUseAreaA"/>
-    <keyword type="function" name="xmlUCSIsSupplementaryPrivateUseAreaB ()" link="libxml2-xmlunicode.html#xmlUCSIsSupplementaryPrivateUseAreaB"/>
-    <keyword type="function" name="xmlUCSIsSyriac ()" link="libxml2-xmlunicode.html#xmlUCSIsSyriac"/>
-    <keyword type="function" name="xmlUCSIsTagalog ()" link="libxml2-xmlunicode.html#xmlUCSIsTagalog"/>
-    <keyword type="function" name="xmlUCSIsTagbanwa ()" link="libxml2-xmlunicode.html#xmlUCSIsTagbanwa"/>
-    <keyword type="function" name="xmlUCSIsTags ()" link="libxml2-xmlunicode.html#xmlUCSIsTags"/>
-    <keyword type="function" name="xmlUCSIsTaiLe ()" link="libxml2-xmlunicode.html#xmlUCSIsTaiLe"/>
-    <keyword type="function" name="xmlUCSIsTaiXuanJingSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsTaiXuanJingSymbols"/>
-    <keyword type="function" name="xmlUCSIsTamil ()" link="libxml2-xmlunicode.html#xmlUCSIsTamil"/>
-    <keyword type="function" name="xmlUCSIsTelugu ()" link="libxml2-xmlunicode.html#xmlUCSIsTelugu"/>
-    <keyword type="function" name="xmlUCSIsThaana ()" link="libxml2-xmlunicode.html#xmlUCSIsThaana"/>
-    <keyword type="function" name="xmlUCSIsThai ()" link="libxml2-xmlunicode.html#xmlUCSIsThai"/>
-    <keyword type="function" name="xmlUCSIsTibetan ()" link="libxml2-xmlunicode.html#xmlUCSIsTibetan"/>
-    <keyword type="function" name="xmlUCSIsUgaritic ()" link="libxml2-xmlunicode.html#xmlUCSIsUgaritic"/>
-    <keyword type="function" name="xmlUCSIsUnifiedCanadianAboriginalSyllabics ()" link="libxml2-xmlunicode.html#xmlUCSIsUnifiedCanadianAboriginalSyllabics"/>
-    <keyword type="function" name="xmlUCSIsVariationSelectors ()" link="libxml2-xmlunicode.html#xmlUCSIsVariationSelectors"/>
-    <keyword type="function" name="xmlUCSIsVariationSelectorsSupplement ()" link="libxml2-xmlunicode.html#xmlUCSIsVariationSelectorsSupplement"/>
-    <keyword type="function" name="xmlUCSIsYiRadicals ()" link="libxml2-xmlunicode.html#xmlUCSIsYiRadicals"/>
-    <keyword type="function" name="xmlUCSIsYiSyllables ()" link="libxml2-xmlunicode.html#xmlUCSIsYiSyllables"/>
-    <keyword type="function" name="xmlUCSIsYijingHexagramSymbols ()" link="libxml2-xmlunicode.html#xmlUCSIsYijingHexagramSymbols"/>
     <keyword type="function" name="xmlURIEscape ()" link="libxml2-uri.html#xmlURIEscape"/>
     <keyword type="function" name="xmlURIEscapeStr ()" link="libxml2-uri.html#xmlURIEscapeStr"/>
     <keyword type="function" name="xmlURIUnescapeString ()" link="libxml2-uri.html#xmlURIUnescapeString"/>
@@ -3337,6 +3088,7 @@
     <keyword type="function" name="xmlUTF8Strpos ()" link="libxml2-xmlstring.html#xmlUTF8Strpos"/>
     <keyword type="function" name="xmlUTF8Strsize ()" link="libxml2-xmlstring.html#xmlUTF8Strsize"/>
     <keyword type="function" name="xmlUTF8Strsub ()" link="libxml2-xmlstring.html#xmlUTF8Strsub"/>
+    <keyword type="function" name="xmlUTF8ToIsolat1 ()" link="libxml2-encoding.html#xmlUTF8ToIsolat1"/>
     <keyword type="function" name="xmlUnlinkNode ()" link="libxml2-tree.html#xmlUnlinkNode"/>
     <keyword type="function" name="xmlUnlockLibrary ()" link="libxml2-threads.html#xmlUnlockLibrary"/>
     <keyword type="function" name="xmlUnsetNsProp ()" link="libxml2-tree.html#xmlUnsetNsProp"/>
@@ -3383,6 +3135,7 @@
     <keyword type="function" name="xmlXIncludeProcessTreeFlagsData ()" link="libxml2-xinclude.html#xmlXIncludeProcessTreeFlagsData"/>
     <keyword type="function" name="xmlXIncludeSetErrorHandler ()" link="libxml2-xinclude.html#xmlXIncludeSetErrorHandler"/>
     <keyword type="function" name="xmlXIncludeSetFlags ()" link="libxml2-xinclude.html#xmlXIncludeSetFlags"/>
+    <keyword type="function" name="xmlXIncludeSetResourceLoader ()" link="libxml2-xinclude.html#xmlXIncludeSetResourceLoader"/>
     <keyword type="function" name="xmlXPathAddValues ()" link="libxml2-xpathInternals.html#xmlXPathAddValues"/>
     <keyword type="function" name="xmlXPathBooleanFunction ()" link="libxml2-xpathInternals.html#xmlXPathBooleanFunction"/>
     <keyword type="function" name="xmlXPathCastBooleanToNumber ()" link="libxml2-xpath.html#xmlXPathCastBooleanToNumber"/>
@@ -3532,6 +3285,8 @@
     <keyword type="function" name="xmlXPathTranslateFunction ()" link="libxml2-xpathInternals.html#xmlXPathTranslateFunction"/>
     <keyword type="function" name="xmlXPathTrueFunction ()" link="libxml2-xpathInternals.html#xmlXPathTrueFunction"/>
     <keyword type="function" name="xmlXPathValueFlipSign ()" link="libxml2-xpathInternals.html#xmlXPathValueFlipSign"/>
+    <keyword type="function" name="xmlXPathValuePop ()" link="libxml2-xpathInternals.html#xmlXPathValuePop"/>
+    <keyword type="function" name="xmlXPathValuePush ()" link="libxml2-xpathInternals.html#xmlXPathValuePush"/>
     <keyword type="function" name="xmlXPathVariableLookup ()" link="libxml2-xpathInternals.html#xmlXPathVariableLookup"/>
     <keyword type="function" name="xmlXPathVariableLookupNS ()" link="libxml2-xpathInternals.html#xmlXPathVariableLookupNS"/>
     <keyword type="function" name="xmlXPathWrapCString ()" link="libxml2-xpathInternals.html#xmlXPathWrapCString"/>
@@ -3539,26 +3294,7 @@
     <keyword type="function" name="xmlXPathWrapNodeSet ()" link="libxml2-xpathInternals.html#xmlXPathWrapNodeSet"/>
     <keyword type="function" name="xmlXPathWrapString ()" link="libxml2-xpathInternals.html#xmlXPathWrapString"/>
     <keyword type="function" name="xmlXPatherror ()" link="libxml2-xpathInternals.html#xmlXPatherror"/>
-    <keyword type="function" name="xmlXPtrBuildNodeList ()" link="libxml2-xpointer.html#xmlXPtrBuildNodeList"/>
     <keyword type="function" name="xmlXPtrEval ()" link="libxml2-xpointer.html#xmlXPtrEval"/>
-    <keyword type="function" name="xmlXPtrEvalRangePredicate ()" link="libxml2-xpointer.html#xmlXPtrEvalRangePredicate"/>
-    <keyword type="function" name="xmlXPtrFreeLocationSet ()" link="libxml2-xpointer.html#xmlXPtrFreeLocationSet"/>
-    <keyword type="function" name="xmlXPtrLocationSetAdd ()" link="libxml2-xpointer.html#xmlXPtrLocationSetAdd"/>
-    <keyword type="function" name="xmlXPtrLocationSetCreate ()" link="libxml2-xpointer.html#xmlXPtrLocationSetCreate"/>
-    <keyword type="function" name="xmlXPtrLocationSetDel ()" link="libxml2-xpointer.html#xmlXPtrLocationSetDel"/>
-    <keyword type="function" name="xmlXPtrLocationSetMerge ()" link="libxml2-xpointer.html#xmlXPtrLocationSetMerge"/>
-    <keyword type="function" name="xmlXPtrLocationSetRemove ()" link="libxml2-xpointer.html#xmlXPtrLocationSetRemove"/>
-    <keyword type="function" name="xmlXPtrNewCollapsedRange ()" link="libxml2-xpointer.html#xmlXPtrNewCollapsedRange"/>
     <keyword type="function" name="xmlXPtrNewContext ()" link="libxml2-xpointer.html#xmlXPtrNewContext"/>
-    <keyword type="function" name="xmlXPtrNewLocationSetNodeSet ()" link="libxml2-xpointer.html#xmlXPtrNewLocationSetNodeSet"/>
-    <keyword type="function" name="xmlXPtrNewLocationSetNodes ()" link="libxml2-xpointer.html#xmlXPtrNewLocationSetNodes"/>
-    <keyword type="function" name="xmlXPtrNewRange ()" link="libxml2-xpointer.html#xmlXPtrNewRange"/>
-    <keyword type="function" name="xmlXPtrNewRangeNodeObject ()" link="libxml2-xpointer.html#xmlXPtrNewRangeNodeObject"/>
-    <keyword type="function" name="xmlXPtrNewRangeNodePoint ()" link="libxml2-xpointer.html#xmlXPtrNewRangeNodePoint"/>
-    <keyword type="function" name="xmlXPtrNewRangeNodes ()" link="libxml2-xpointer.html#xmlXPtrNewRangeNodes"/>
-    <keyword type="function" name="xmlXPtrNewRangePointNode ()" link="libxml2-xpointer.html#xmlXPtrNewRangePointNode"/>
-    <keyword type="function" name="xmlXPtrNewRangePoints ()" link="libxml2-xpointer.html#xmlXPtrNewRangePoints"/>
-    <keyword type="function" name="xmlXPtrRangeToFunction ()" link="libxml2-xpointer.html#xmlXPtrRangeToFunction"/>
-    <keyword type="function" name="xmlXPtrWrapLocationSet ()" link="libxml2-xpointer.html#xmlXPtrWrapLocationSet"/>
   </functions>
 </book>
diff --git a/doc/devhelp/meson.build b/doc/devhelp/meson.build
index 398d26e..1b204bb 100644
--- a/doc/devhelp/meson.build
+++ b/doc/devhelp/meson.build
@@ -56,6 +56,6 @@
 
 extra_files = files('home.png', 'left.png', 'right.png', 'style.css', 'up.png')
 
-devhelp = [files('libxml2.devhelp2'), html_files, html_modules, extra_files]
+devhelp = [html_files, html_modules, extra_files]
 
 install_data(devhelp, install_dir: dir_data / 'gtk-doc' / 'html' / 'libxml2')
diff --git a/doc/libxml2-api.xml b/doc/libxml2-api.xml
index 58296e5..adc6e9e 100644
--- a/doc/libxml2-api.xml
+++ b/doc/libxml2-api.xml
@@ -5,13 +5,17 @@
      <summary>interface for an HTML 4.0 non-verifying parser</summary>
      <description>this module implements an HTML 4.0 non-verifying parser with API compatible with the XML parser ones. It should be able to parse &quot;real world&quot; HTML, even if severely broken from a specification point of view. </description>
      <author>Daniel Veillard </author>
+     <exports symbol='UTF8ToHtml' type='macro'/>
      <exports symbol='htmlDefaultSubelement' type='macro'/>
      <exports symbol='htmlElementAllowedHereDesc' type='macro'/>
      <exports symbol='htmlRequiredAttrs' type='macro'/>
      <exports symbol='HTML_DEPRECATED' type='enum'/>
      <exports symbol='HTML_INVALID' type='enum'/>
      <exports symbol='HTML_NA' type='enum'/>
+     <exports symbol='HTML_PARSE_BIG_LINES' type='enum'/>
      <exports symbol='HTML_PARSE_COMPACT' type='enum'/>
+     <exports symbol='HTML_PARSE_HTML5' type='enum'/>
+     <exports symbol='HTML_PARSE_HUGE' type='enum'/>
      <exports symbol='HTML_PARSE_IGNORE_ENC' type='enum'/>
      <exports symbol='HTML_PARSE_NOBLANKS' type='enum'/>
      <exports symbol='HTML_PARSE_NODEFDTD' type='enum'/>
@@ -41,7 +45,6 @@
      <exports symbol='_htmlElemDesc' type='struct'/>
      <exports symbol='_htmlEntityDesc' type='struct'/>
      <exports symbol='htmlDefaultSAXHandler' type='variable'/>
-     <exports symbol='UTF8ToHtml' type='function'/>
      <exports symbol='htmlAttrAllowed' type='function'/>
      <exports symbol='htmlAutoCloseTag' type='function'/>
      <exports symbol='htmlCreateFileParserCtxt' type='function'/>
@@ -54,6 +57,7 @@
      <exports symbol='htmlCtxtReadIO' type='function'/>
      <exports symbol='htmlCtxtReadMemory' type='function'/>
      <exports symbol='htmlCtxtReset' type='function'/>
+     <exports symbol='htmlCtxtSetOptions' type='function'/>
      <exports symbol='htmlCtxtUseOptions' type='function'/>
      <exports symbol='htmlElementAllowedHere' type='function'/>
      <exports symbol='htmlElementStatusHere' type='function'/>
@@ -83,6 +87,7 @@
      <exports symbol='htmlSAXParseDoc' type='function'/>
      <exports symbol='htmlSAXParseFile' type='function'/>
      <exports symbol='htmlTagLookup' type='function'/>
+     <exports symbol='htmlUTF8ToHtml' type='function'/>
     </file>
     <file name='HTMLtree'>
      <summary>specific APIs to process HTML tree, especially serialization</summary>
@@ -112,48 +117,6 @@
      <exports symbol='htmlSaveFileFormat' type='function'/>
      <exports symbol='htmlSetMetaEncoding' type='function'/>
     </file>
-    <file name='SAX'>
-     <summary>Old SAX version 1 handler, deprecated</summary>
-     <description>DEPRECATED set of SAX version 1 interfaces used to build the DOM tree. </description>
-     <author>Daniel Veillard </author>
-     <deprecated/>
-     <exports symbol='attribute' type='function'/>
-     <exports symbol='attributeDecl' type='function'/>
-     <exports symbol='cdataBlock' type='function'/>
-     <exports symbol='characters' type='function'/>
-     <exports symbol='checkNamespace' type='function'/>
-     <exports symbol='comment' type='function'/>
-     <exports symbol='elementDecl' type='function'/>
-     <exports symbol='endDocument' type='function'/>
-     <exports symbol='endElement' type='function'/>
-     <exports symbol='entityDecl' type='function'/>
-     <exports symbol='externalSubset' type='function'/>
-     <exports symbol='getColumnNumber' type='function'/>
-     <exports symbol='getEntity' type='function'/>
-     <exports symbol='getLineNumber' type='function'/>
-     <exports symbol='getNamespace' type='function'/>
-     <exports symbol='getParameterEntity' type='function'/>
-     <exports symbol='getPublicId' type='function'/>
-     <exports symbol='getSystemId' type='function'/>
-     <exports symbol='globalNamespace' type='function'/>
-     <exports symbol='hasExternalSubset' type='function'/>
-     <exports symbol='hasInternalSubset' type='function'/>
-     <exports symbol='ignorableWhitespace' type='function'/>
-     <exports symbol='inithtmlDefaultSAXHandler' type='function'/>
-     <exports symbol='initxmlDefaultSAXHandler' type='function'/>
-     <exports symbol='internalSubset' type='function'/>
-     <exports symbol='isStandalone' type='function'/>
-     <exports symbol='namespaceDecl' type='function'/>
-     <exports symbol='notationDecl' type='function'/>
-     <exports symbol='processingInstruction' type='function'/>
-     <exports symbol='reference' type='function'/>
-     <exports symbol='resolveEntity' type='function'/>
-     <exports symbol='setDocumentLocator' type='function'/>
-     <exports symbol='setNamespace' type='function'/>
-     <exports symbol='startDocument' type='function'/>
-     <exports symbol='startElement' type='function'/>
-     <exports symbol='unparsedEntityDecl' type='function'/>
-    </file>
     <file name='SAX2'>
      <summary>SAX2 parser interface used to build the DOM tree</summary>
      <description>those are the default SAX2 interfaces used by the library when building DOM tree. </description>
@@ -311,10 +274,6 @@
      <summary>Tree debugging APIs</summary>
      <description>Interfaces to a set of routines used for debugging the tree produced by the XML parser. </description>
      <author>Daniel Veillard </author>
-     <exports symbol='xmlShellCtxt' type='typedef'/>
-     <exports symbol='xmlShellCtxtPtr' type='typedef'/>
-     <exports symbol='_xmlShellCtxt' type='struct'/>
-     <exports symbol='xmlBoolToText' type='function'/>
      <exports symbol='xmlDebugCheckDocument' type='function'/>
      <exports symbol='xmlDebugDumpAttr' type='function'/>
      <exports symbol='xmlDebugDumpAttrList' type='function'/>
@@ -326,24 +285,6 @@
      <exports symbol='xmlDebugDumpNodeList' type='function'/>
      <exports symbol='xmlDebugDumpOneNode' type='function'/>
      <exports symbol='xmlDebugDumpString' type='function'/>
-     <exports symbol='xmlLsCountNode' type='function'/>
-     <exports symbol='xmlLsOneNode' type='function'/>
-     <exports symbol='xmlShell' type='function'/>
-     <exports symbol='xmlShellBase' type='function'/>
-     <exports symbol='xmlShellCat' type='function'/>
-     <exports symbol='xmlShellCmd' type='function'/>
-     <exports symbol='xmlShellDir' type='function'/>
-     <exports symbol='xmlShellDu' type='function'/>
-     <exports symbol='xmlShellList' type='function'/>
-     <exports symbol='xmlShellLoad' type='function'/>
-     <exports symbol='xmlShellPrintNode' type='function'/>
-     <exports symbol='xmlShellPrintXPathError' type='function'/>
-     <exports symbol='xmlShellPrintXPathResult' type='function'/>
-     <exports symbol='xmlShellPwd' type='function'/>
-     <exports symbol='xmlShellReadlineFunc' type='function'/>
-     <exports symbol='xmlShellSave' type='function'/>
-     <exports symbol='xmlShellValidate' type='function'/>
-     <exports symbol='xmlShellWrite' type='function'/>
     </file>
     <file name='dict'>
      <summary>string dictionary</summary>
@@ -369,8 +310,16 @@
      <summary>interface for the encoding conversion functions</summary>
      <description>interface for the encoding conversion functions needed for XML basic encoding and iconv() support.  Related specs are rfc2044        (UTF-8 and UTF-16) F. Yergeau Alis Technologies [ISO-10646]    UTF-8 and UTF-16 in Annexes [ISO-8859-1]   ISO Latin-1 characters codes. [UNICODE]      The Unicode Consortium, &quot;The Unicode Standard -- Worldwide Character Encoding -- Version 1.0&quot;, Addison- Wesley, Volume 1, 1991, Volume 2, 1992.  UTF-8 is described in Unicode Technical Report #4. [US-ASCII]     Coded Character Set--7-bit American Standard Code for Information Interchange, ANSI X3.4-1986. </description>
      <author>Daniel Veillard </author>
+     <exports symbol='UTF8Toisolat1' type='macro'/>
+     <exports symbol='isolat1ToUTF8' type='macro'/>
      <exports symbol='XML_CHAR_ENCODING_2022_JP' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_8859_1' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_8859_10' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_8859_11' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_8859_13' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_8859_14' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_8859_15' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_8859_16' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_8859_2' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_8859_3' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_8859_4' type='enum'/>
@@ -383,6 +332,7 @@
      <exports symbol='XML_CHAR_ENCODING_EBCDIC' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_ERROR' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_EUC_JP' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_HTML' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_NONE' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_SHIFT_JIS' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_UCS2' type='enum'/>
@@ -390,31 +340,37 @@
      <exports symbol='XML_CHAR_ENCODING_UCS4LE' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_UCS4_2143' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_UCS4_3412' type='enum'/>
+     <exports symbol='XML_CHAR_ENCODING_UTF16' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_UTF16BE' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_UTF16LE' type='enum'/>
      <exports symbol='XML_CHAR_ENCODING_UTF8' type='enum'/>
      <exports symbol='XML_ENC_ERR_INPUT' type='enum'/>
      <exports symbol='XML_ENC_ERR_INTERNAL' type='enum'/>
      <exports symbol='XML_ENC_ERR_MEMORY' type='enum'/>
-     <exports symbol='XML_ENC_ERR_PARTIAL' type='enum'/>
      <exports symbol='XML_ENC_ERR_SPACE' type='enum'/>
      <exports symbol='XML_ENC_ERR_SUCCESS' type='enum'/>
+     <exports symbol='XML_ENC_INPUT' type='enum'/>
+     <exports symbol='XML_ENC_OUTPUT' type='enum'/>
      <exports symbol='xmlCharEncError' type='typedef'/>
+     <exports symbol='xmlCharEncFlags' type='typedef'/>
      <exports symbol='xmlCharEncoding' type='typedef'/>
      <exports symbol='xmlCharEncodingHandler' type='typedef'/>
      <exports symbol='xmlCharEncodingHandlerPtr' type='typedef'/>
      <exports symbol='_xmlCharEncodingHandler' type='struct'/>
-     <exports symbol='UTF8Toisolat1' type='function'/>
-     <exports symbol='isolat1ToUTF8' type='function'/>
      <exports symbol='xmlAddEncodingAlias' type='function'/>
      <exports symbol='xmlCharEncCloseFunc' type='function'/>
+     <exports symbol='xmlCharEncConvCtxtDtor' type='function'/>
+     <exports symbol='xmlCharEncConvFunc' type='function'/>
+     <exports symbol='xmlCharEncConvImpl' type='function'/>
      <exports symbol='xmlCharEncFirstLine' type='function'/>
      <exports symbol='xmlCharEncInFunc' type='function'/>
+     <exports symbol='xmlCharEncNewCustomHandler' type='function'/>
      <exports symbol='xmlCharEncOutFunc' type='function'/>
      <exports symbol='xmlCharEncodingInputFunc' type='function'/>
      <exports symbol='xmlCharEncodingOutputFunc' type='function'/>
      <exports symbol='xmlCleanupCharEncodingHandlers' type='function'/>
      <exports symbol='xmlCleanupEncodingAliases' type='function'/>
+     <exports symbol='xmlCreateCharEncodingHandler' type='function'/>
      <exports symbol='xmlDelEncodingAlias' type='function'/>
      <exports symbol='xmlDetectCharEncoding' type='function'/>
      <exports symbol='xmlFindCharEncodingHandler' type='function'/>
@@ -422,11 +378,13 @@
      <exports symbol='xmlGetCharEncodingName' type='function'/>
      <exports symbol='xmlGetEncodingAlias' type='function'/>
      <exports symbol='xmlInitCharEncodingHandlers' type='function'/>
+     <exports symbol='xmlIsolat1ToUTF8' type='function'/>
      <exports symbol='xmlLookupCharEncodingHandler' type='function'/>
      <exports symbol='xmlNewCharEncodingHandler' type='function'/>
      <exports symbol='xmlOpenCharEncodingHandler' type='function'/>
      <exports symbol='xmlParseCharEncoding' type='function'/>
      <exports symbol='xmlRegisterCharEncodingHandler' type='function'/>
+     <exports symbol='xmlUTF8ToIsolat1' type='function'/>
     </file>
     <file name='entities'>
      <summary>interface for the XML entities handling</summary>
@@ -445,12 +403,10 @@
      <exports symbol='xmlAddDocEntity' type='function'/>
      <exports symbol='xmlAddDtdEntity' type='function'/>
      <exports symbol='xmlAddEntity' type='function'/>
-     <exports symbol='xmlCleanupPredefinedEntities' type='function'/>
      <exports symbol='xmlCopyEntitiesTable' type='function'/>
      <exports symbol='xmlCreateEntitiesTable' type='function'/>
      <exports symbol='xmlDumpEntitiesTable' type='function'/>
      <exports symbol='xmlDumpEntityDecl' type='function'/>
-     <exports symbol='xmlEncodeEntities' type='function'/>
      <exports symbol='xmlEncodeEntitiesReentrant' type='function'/>
      <exports symbol='xmlEncodeSpecialChars' type='function'/>
      <exports symbol='xmlFreeEntitiesTable' type='function'/>
@@ -459,16 +415,11 @@
      <exports symbol='xmlGetDtdEntity' type='function'/>
      <exports symbol='xmlGetParameterEntity' type='function'/>
      <exports symbol='xmlGetPredefinedEntity' type='function'/>
-     <exports symbol='xmlInitializePredefinedEntities' type='function'/>
      <exports symbol='xmlNewEntity' type='function'/>
     </file>
     <file name='globals'>
      <summary>interface for all global variables of the library</summary>
      <description>Deprecated, don&apos;t use </description>
-     <exports symbol='xmlGlobalState' type='typedef'/>
-     <exports symbol='xmlGlobalStatePtr' type='typedef'/>
-     <exports symbol='xmlGetGlobalState' type='function'/>
-     <exports symbol='xmlInitializeGlobalState' type='function'/>
     </file>
     <file name='hash'>
      <summary>Chained hash tables</summary>
@@ -549,38 +500,6 @@
      <exports symbol='xmlListWalk' type='function'/>
      <exports symbol='xmlListWalker' type='function'/>
     </file>
-    <file name='nanoftp'>
-     <summary>minimal FTP implementation</summary>
-     <description>minimal FTP implementation allowing to fetch resources like external subset. This module is DEPRECATED, do not use any of its functions. </description>
-     <author>Daniel Veillard </author>
-     <deprecated/>
-     <exports symbol='INVALID_SOCKET' type='macro'/>
-     <exports symbol='SOCKET' type='macro'/>
-     <exports symbol='ftpDataCallback' type='function'/>
-     <exports symbol='ftpListCallback' type='function'/>
-     <exports symbol='xmlNanoFTPCheckResponse' type='function'/>
-     <exports symbol='xmlNanoFTPCleanup' type='function'/>
-     <exports symbol='xmlNanoFTPClose' type='function'/>
-     <exports symbol='xmlNanoFTPCloseConnection' type='function'/>
-     <exports symbol='xmlNanoFTPConnect' type='function'/>
-     <exports symbol='xmlNanoFTPConnectTo' type='function'/>
-     <exports symbol='xmlNanoFTPCwd' type='function'/>
-     <exports symbol='xmlNanoFTPDele' type='function'/>
-     <exports symbol='xmlNanoFTPFreeCtxt' type='function'/>
-     <exports symbol='xmlNanoFTPGet' type='function'/>
-     <exports symbol='xmlNanoFTPGetConnection' type='function'/>
-     <exports symbol='xmlNanoFTPGetResponse' type='function'/>
-     <exports symbol='xmlNanoFTPGetSocket' type='function'/>
-     <exports symbol='xmlNanoFTPInit' type='function'/>
-     <exports symbol='xmlNanoFTPList' type='function'/>
-     <exports symbol='xmlNanoFTPNewCtxt' type='function'/>
-     <exports symbol='xmlNanoFTPOpen' type='function'/>
-     <exports symbol='xmlNanoFTPProxy' type='function'/>
-     <exports symbol='xmlNanoFTPQuit' type='function'/>
-     <exports symbol='xmlNanoFTPRead' type='function'/>
-     <exports symbol='xmlNanoFTPScanProxy' type='function'/>
-     <exports symbol='xmlNanoFTPUpdateURL' type='function'/>
-    </file>
     <file name='nanohttp'>
      <summary>minimal HTTP implementation</summary>
      <description>minimal HTTP implementation allowing to fetch resources like external subset. </description>
@@ -609,6 +528,10 @@
      <author>Daniel Veillard </author>
      <exports symbol='XML_DEFAULT_VERSION' type='macro'/>
      <exports symbol='XML_SAX2_MAGIC' type='macro'/>
+     <exports symbol='XML_INPUT_BUF_STATIC' type='enum'/>
+     <exports symbol='XML_INPUT_BUF_ZERO_TERMINATED' type='enum'/>
+     <exports symbol='XML_INPUT_NETWORK' type='enum'/>
+     <exports symbol='XML_INPUT_UNZIP' type='enum'/>
      <exports symbol='XML_PARSER_ATTRIBUTE_VALUE' type='enum'/>
      <exports symbol='XML_PARSER_CDATA_SECTION' type='enum'/>
      <exports symbol='XML_PARSER_COMMENT' type='enum'/>
@@ -629,6 +552,7 @@
      <exports symbol='XML_PARSER_SYSTEM_LITERAL' type='enum'/>
      <exports symbol='XML_PARSER_XML_DECL' type='enum'/>
      <exports symbol='XML_PARSE_BIG_LINES' type='enum'/>
+     <exports symbol='XML_PARSE_CATALOG_PI' type='enum'/>
      <exports symbol='XML_PARSE_COMPACT' type='enum'/>
      <exports symbol='XML_PARSE_DOM' type='enum'/>
      <exports symbol='XML_PARSE_DTDATTR' type='enum'/>
@@ -645,6 +569,7 @@
      <exports symbol='XML_PARSE_NONET' type='enum'/>
      <exports symbol='XML_PARSE_NOWARNING' type='enum'/>
      <exports symbol='XML_PARSE_NOXINCNODE' type='enum'/>
+     <exports symbol='XML_PARSE_NO_SYS_CATALOG' type='enum'/>
      <exports symbol='XML_PARSE_NO_XXE' type='enum'/>
      <exports symbol='XML_PARSE_NSCLEAN' type='enum'/>
      <exports symbol='XML_PARSE_OLD10' type='enum'/>
@@ -657,7 +582,19 @@
      <exports symbol='XML_PARSE_SAX' type='enum'/>
      <exports symbol='XML_PARSE_SAX1' type='enum'/>
      <exports symbol='XML_PARSE_UNKNOWN' type='enum'/>
+     <exports symbol='XML_PARSE_UNZIP' type='enum'/>
      <exports symbol='XML_PARSE_XINCLUDE' type='enum'/>
+     <exports symbol='XML_RESOURCE_DTD' type='enum'/>
+     <exports symbol='XML_RESOURCE_GENERAL_ENTITY' type='enum'/>
+     <exports symbol='XML_RESOURCE_MAIN_DOCUMENT' type='enum'/>
+     <exports symbol='XML_RESOURCE_PARAMETER_ENTITY' type='enum'/>
+     <exports symbol='XML_RESOURCE_UNKNOWN' type='enum'/>
+     <exports symbol='XML_RESOURCE_XINCLUDE' type='enum'/>
+     <exports symbol='XML_RESOURCE_XINCLUDE_TEXT' type='enum'/>
+     <exports symbol='XML_STATUS_CATASTROPHIC_ERROR' type='enum'/>
+     <exports symbol='XML_STATUS_DTD_VALIDATION_FAILED' type='enum'/>
+     <exports symbol='XML_STATUS_NOT_NS_WELL_FORMED' type='enum'/>
+     <exports symbol='XML_STATUS_NOT_WELL_FORMED' type='enum'/>
      <exports symbol='XML_WITH_AUTOMATA' type='enum'/>
      <exports symbol='XML_WITH_C14N' type='enum'/>
      <exports symbol='XML_WITH_CATALOG' type='enum'/>
@@ -680,6 +617,7 @@
      <exports symbol='XML_WITH_PUSH' type='enum'/>
      <exports symbol='XML_WITH_READER' type='enum'/>
      <exports symbol='XML_WITH_REGEXP' type='enum'/>
+     <exports symbol='XML_WITH_RELAXNG' type='enum'/>
      <exports symbol='XML_WITH_SAX1' type='enum'/>
      <exports symbol='XML_WITH_SCHEMAS' type='enum'/>
      <exports symbol='XML_WITH_SCHEMATRON' type='enum'/>
@@ -694,6 +632,7 @@
      <exports symbol='XML_WITH_ZLIB' type='enum'/>
      <exports symbol='xmlAttrHashBucket' type='typedef'/>
      <exports symbol='xmlFeature' type='typedef'/>
+     <exports symbol='xmlParserInputFlags' type='typedef'/>
      <exports symbol='xmlParserInputState' type='typedef'/>
      <exports symbol='xmlParserMode' type='typedef'/>
      <exports symbol='xmlParserNodeInfo' type='typedef'/>
@@ -702,6 +641,8 @@
      <exports symbol='xmlParserNodeInfoSeqPtr' type='typedef'/>
      <exports symbol='xmlParserNsData' type='typedef'/>
      <exports symbol='xmlParserOption' type='typedef'/>
+     <exports symbol='xmlParserStatus' type='typedef'/>
+     <exports symbol='xmlResourceType' type='typedef'/>
      <exports symbol='xmlSAXHandlerV1' type='typedef'/>
      <exports symbol='xmlSAXHandlerV1Ptr' type='typedef'/>
      <exports symbol='xmlStartTag' type='typedef'/>
@@ -712,10 +653,6 @@
      <exports symbol='_xmlSAXHandler' type='struct'/>
      <exports symbol='_xmlSAXHandlerV1' type='struct'/>
      <exports symbol='_xmlSAXLocator' type='struct'/>
-     <exports symbol='oldXMLWDcompatibility' type='variable'/>
-     <exports symbol='xmlDefaultSAXHandler' type='variable'/>
-     <exports symbol='xmlDefaultSAXLocator' type='variable'/>
-     <exports symbol='xmlParserDebugEntities' type='variable'/>
      <exports symbol='xmlParserVersion' type='variable'/>
      <exports symbol='attributeDeclSAXFunc' type='function'/>
      <exports symbol='attributeSAXFunc' type='function'/>
@@ -755,7 +692,22 @@
      <exports symbol='xmlCreateDocParserCtxt' type='function'/>
      <exports symbol='xmlCreateIOParserCtxt' type='function'/>
      <exports symbol='xmlCreatePushParserCtxt' type='function'/>
+     <exports symbol='xmlCtxtGetCatalogs' type='function'/>
+     <exports symbol='xmlCtxtGetDeclaredEncoding' type='function'/>
+     <exports symbol='xmlCtxtGetDict' type='function'/>
+     <exports symbol='xmlCtxtGetDocument' type='function'/>
+     <exports symbol='xmlCtxtGetOptions' type='function'/>
+     <exports symbol='xmlCtxtGetPrivate' type='function'/>
+     <exports symbol='xmlCtxtGetSaxHandler' type='function'/>
+     <exports symbol='xmlCtxtGetStandalone' type='function'/>
+     <exports symbol='xmlCtxtGetStatus' type='function'/>
+     <exports symbol='xmlCtxtGetValidCtxt' type='function'/>
+     <exports symbol='xmlCtxtGetVersion' type='function'/>
+     <exports symbol='xmlCtxtIsHtml' type='function'/>
+     <exports symbol='xmlCtxtIsStopped' type='function'/>
+     <exports symbol='xmlCtxtParseContent' type='function'/>
      <exports symbol='xmlCtxtParseDocument' type='function'/>
+     <exports symbol='xmlCtxtParseDtd' type='function'/>
      <exports symbol='xmlCtxtReadDoc' type='function'/>
      <exports symbol='xmlCtxtReadFd' type='function'/>
      <exports symbol='xmlCtxtReadFile' type='function'/>
@@ -763,25 +715,37 @@
      <exports symbol='xmlCtxtReadMemory' type='function'/>
      <exports symbol='xmlCtxtReset' type='function'/>
      <exports symbol='xmlCtxtResetPush' type='function'/>
+     <exports symbol='xmlCtxtSetCatalogs' type='function'/>
+     <exports symbol='xmlCtxtSetCharEncConvImpl' type='function'/>
+     <exports symbol='xmlCtxtSetDict' type='function'/>
      <exports symbol='xmlCtxtSetErrorHandler' type='function'/>
      <exports symbol='xmlCtxtSetMaxAmplification' type='function'/>
      <exports symbol='xmlCtxtSetOptions' type='function'/>
+     <exports symbol='xmlCtxtSetPrivate' type='function'/>
+     <exports symbol='xmlCtxtSetResourceLoader' type='function'/>
+     <exports symbol='xmlCtxtSetSaxHandler' type='function'/>
      <exports symbol='xmlCtxtUseOptions' type='function'/>
+     <exports symbol='xmlCtxtValidateDocument' type='function'/>
+     <exports symbol='xmlCtxtValidateDtd' type='function'/>
      <exports symbol='xmlExternalEntityLoader' type='function'/>
      <exports symbol='xmlFreeParserCtxt' type='function'/>
      <exports symbol='xmlGetExternalEntityLoader' type='function'/>
-     <exports symbol='xmlGetFeature' type='function'/>
-     <exports symbol='xmlGetFeaturesList' type='function'/>
      <exports symbol='xmlHasFeature' type='function'/>
      <exports symbol='xmlIOParseDTD' type='function'/>
      <exports symbol='xmlInitGlobals' type='function'/>
      <exports symbol='xmlInitNodeInfoSeq' type='function'/>
      <exports symbol='xmlInitParser' type='function'/>
      <exports symbol='xmlInitParserCtxt' type='function'/>
+     <exports symbol='xmlInputSetEncodingHandler' type='function'/>
      <exports symbol='xmlKeepBlanksDefault' type='function'/>
      <exports symbol='xmlLineNumbersDefault' type='function'/>
      <exports symbol='xmlLoadExternalEntity' type='function'/>
      <exports symbol='xmlNewIOInputStream' type='function'/>
+     <exports symbol='xmlNewInputFromFd' type='function'/>
+     <exports symbol='xmlNewInputFromIO' type='function'/>
+     <exports symbol='xmlNewInputFromMemory' type='function'/>
+     <exports symbol='xmlNewInputFromString' type='function'/>
+     <exports symbol='xmlNewInputFromUrl' type='function'/>
      <exports symbol='xmlNewParserCtxt' type='function'/>
      <exports symbol='xmlNewSAXParserCtxt' type='function'/>
      <exports symbol='xmlParseBalancedChunkMemory' type='function'/>
@@ -812,6 +776,7 @@
      <exports symbol='xmlRecoverDoc' type='function'/>
      <exports symbol='xmlRecoverFile' type='function'/>
      <exports symbol='xmlRecoverMemory' type='function'/>
+     <exports symbol='xmlResourceLoader' type='function'/>
      <exports symbol='xmlSAXParseDTD' type='function'/>
      <exports symbol='xmlSAXParseDoc' type='function'/>
      <exports symbol='xmlSAXParseEntity' type='function'/>
@@ -822,7 +787,6 @@
      <exports symbol='xmlSAXUserParseFile' type='function'/>
      <exports symbol='xmlSAXUserParseMemory' type='function'/>
      <exports symbol='xmlSetExternalEntityLoader' type='function'/>
-     <exports symbol='xmlSetFeature' type='function'/>
      <exports symbol='xmlSetupParserForBuffer' type='function'/>
      <exports symbol='xmlStopParser' type='function'/>
      <exports symbol='xmlSubstituteEntitiesDefault' type='function'/>
@@ -831,7 +795,6 @@
      <exports symbol='xmlThrDefKeepBlanksDefaultValue' type='function'/>
      <exports symbol='xmlThrDefLineNumbersDefaultValue' type='function'/>
      <exports symbol='xmlThrDefLoadExtDtdDefaultValue' type='function'/>
-     <exports symbol='xmlThrDefParserDebugEntities' type='function'/>
      <exports symbol='xmlThrDefPedanticParserDefaultValue' type='function'/>
      <exports symbol='xmlThrDefSubstituteEntitiesDefaultValue' type='function'/>
     </file>
@@ -839,7 +802,6 @@
      <summary>internals routines and limits exported by the parser.</summary>
      <description>this module exports a number of internal parsing routines they are not really all intended for applications but can prove useful doing low level processing. </description>
      <author>Daniel Veillard </author>
-     <exports symbol='INPUT_CHUNK' type='macro'/>
      <exports symbol='IS_ASCII_DIGIT' type='macro'/>
      <exports symbol='IS_ASCII_LETTER' type='macro'/>
      <exports symbol='IS_BASECHAR' type='macro'/>
@@ -869,16 +831,12 @@
      <exports symbol='XML_SUBSTITUTE_NONE' type='macro'/>
      <exports symbol='XML_SUBSTITUTE_PEREF' type='macro'/>
      <exports symbol='XML_SUBSTITUTE_REF' type='macro'/>
-     <exports symbol='xmlParserMaxDepth' type='variable'/>
+     <exports symbol='inputPop' type='macro'/>
+     <exports symbol='inputPush' type='macro'/>
+     <exports symbol='xmlParserMaxDepth' type='macro'/>
      <exports symbol='xmlStringComment' type='variable'/>
      <exports symbol='xmlStringText' type='variable'/>
      <exports symbol='xmlStringTextNoenc' type='variable'/>
-     <exports symbol='inputPop' type='function'/>
-     <exports symbol='inputPush' type='function'/>
-     <exports symbol='namePop' type='function'/>
-     <exports symbol='namePush' type='function'/>
-     <exports symbol='nodePop' type='function'/>
-     <exports symbol='nodePush' type='function'/>
      <exports symbol='xmlCheckLanguageID' type='function'/>
      <exports symbol='xmlCopyChar' type='function'/>
      <exports symbol='xmlCopyCharMultiByte' type='function'/>
@@ -887,15 +845,11 @@
      <exports symbol='xmlCreateMemoryParserCtxt' type='function'/>
      <exports symbol='xmlCreateURLParserCtxt' type='function'/>
      <exports symbol='xmlCtxtErrMemory' type='function'/>
+     <exports symbol='xmlCtxtPopInput' type='function'/>
+     <exports symbol='xmlCtxtPushInput' type='function'/>
      <exports symbol='xmlCurrentChar' type='function'/>
-     <exports symbol='xmlDecodeEntities' type='function'/>
-     <exports symbol='xmlEntityReferenceFunc' type='function'/>
      <exports symbol='xmlFreeInputStream' type='function'/>
-     <exports symbol='xmlHandleEntity' type='function'/>
      <exports symbol='xmlIsLetter' type='function'/>
-     <exports symbol='xmlNamespaceParseNCName' type='function'/>
-     <exports symbol='xmlNamespaceParseNSDef' type='function'/>
-     <exports symbol='xmlNamespaceParseQName' type='function'/>
      <exports symbol='xmlNewEntityInputStream' type='function'/>
      <exports symbol='xmlNewInputFromFile' type='function'/>
      <exports symbol='xmlNewInputStream' type='function'/>
@@ -930,7 +884,6 @@
      <exports symbol='xmlParseMarkupDecl' type='function'/>
      <exports symbol='xmlParseMisc' type='function'/>
      <exports symbol='xmlParseName' type='function'/>
-     <exports symbol='xmlParseNamespace' type='function'/>
      <exports symbol='xmlParseNmtoken' type='function'/>
      <exports symbol='xmlParseNotationDecl' type='function'/>
      <exports symbol='xmlParseNotationType' type='function'/>
@@ -938,7 +891,6 @@
      <exports symbol='xmlParsePI' type='function'/>
      <exports symbol='xmlParsePITarget' type='function'/>
      <exports symbol='xmlParsePubidLiteral' type='function'/>
-     <exports symbol='xmlParseQuotedString' type='function'/>
      <exports symbol='xmlParseReference' type='function'/>
      <exports symbol='xmlParseSDDecl' type='function'/>
      <exports symbol='xmlParseStartTag' type='function'/>
@@ -948,12 +900,9 @@
      <exports symbol='xmlParseVersionNum' type='function'/>
      <exports symbol='xmlParseXMLDecl' type='function'/>
      <exports symbol='xmlParserHandlePEReference' type='function'/>
-     <exports symbol='xmlParserHandleReference' type='function'/>
      <exports symbol='xmlParserInputShrink' type='function'/>
      <exports symbol='xmlPopInput' type='function'/>
      <exports symbol='xmlPushInput' type='function'/>
-     <exports symbol='xmlScanName' type='function'/>
-     <exports symbol='xmlSetEntityReferenceFunc' type='function'/>
      <exports symbol='xmlSkipBlankChars' type='function'/>
      <exports symbol='xmlSplitQName' type='function'/>
      <exports symbol='xmlStringCurrentChar' type='function'/>
@@ -1065,6 +1014,7 @@
      <exports symbol='xmlRelaxNGParse' type='function'/>
      <exports symbol='xmlRelaxNGSetParserErrors' type='function'/>
      <exports symbol='xmlRelaxNGSetParserStructuredErrors' type='function'/>
+     <exports symbol='xmlRelaxNGSetResourceLoader' type='function'/>
      <exports symbol='xmlRelaxNGSetValidErrors' type='function'/>
      <exports symbol='xmlRelaxNGSetValidStructuredErrors' type='function'/>
      <exports symbol='xmlRelaxNGValidateDoc' type='function'/>
@@ -1345,9 +1295,7 @@
      <exports symbol='xmlCleanupThreads' type='function'/>
      <exports symbol='xmlFreeMutex' type='function'/>
      <exports symbol='xmlFreeRMutex' type='function'/>
-     <exports symbol='xmlGetThreadId' type='function'/>
      <exports symbol='xmlInitThreads' type='function'/>
-     <exports symbol='xmlIsMainThread' type='function'/>
      <exports symbol='xmlLockLibrary' type='function'/>
      <exports symbol='xmlMutexLock' type='function'/>
      <exports symbol='xmlMutexUnlock' type='function'/>
@@ -1361,14 +1309,15 @@
      <summary>interfaces for tree manipulation</summary>
      <description>this module describes the structures found in an tree resulting from an XML or HTML parsing, as well as the API provided for various processing on that tree </description>
      <author>Daniel Veillard </author>
-     <exports symbol='BASE_BUFFER_SIZE' type='macro'/>
      <exports symbol='LIBXML2_NEW_BUFFER' type='macro'/>
      <exports symbol='XML_GET_CONTENT' type='macro'/>
      <exports symbol='XML_GET_LINE' type='macro'/>
      <exports symbol='XML_LOCAL_NAMESPACE' type='macro'/>
      <exports symbol='XML_XML_ID' type='macro'/>
      <exports symbol='XML_XML_NAMESPACE' type='macro'/>
+     <exports symbol='xmlBufferAllocScheme' type='macro'/>
      <exports symbol='xmlChildrenNode' type='macro'/>
+     <exports symbol='xmlDefaultBufferSize' type='macro'/>
      <exports symbol='xmlRootNode' type='macro'/>
      <exports symbol='XML_ATTRIBUTE_CDATA' type='enum'/>
      <exports symbol='XML_ATTRIBUTE_DECL' type='enum'/>
@@ -1602,7 +1551,6 @@
      <exports symbol='xmlNewDocText' type='function'/>
      <exports symbol='xmlNewDocTextLen' type='function'/>
      <exports symbol='xmlNewDtd' type='function'/>
-     <exports symbol='xmlNewGlobalNs' type='function'/>
      <exports symbol='xmlNewNode' type='function'/>
      <exports symbol='xmlNewNodeEatName' type='function'/>
      <exports symbol='xmlNewNs' type='function'/>
@@ -1663,8 +1611,6 @@
      <exports symbol='xmlStringLenGetNodeList' type='function'/>
      <exports symbol='xmlTextConcat' type='function'/>
      <exports symbol='xmlTextMerge' type='function'/>
-     <exports symbol='xmlThrDefBufferAllocScheme' type='function'/>
-     <exports symbol='xmlThrDefDefaultBufferSize' type='function'/>
      <exports symbol='xmlThrDefDeregisterNodeDefault' type='function'/>
      <exports symbol='xmlThrDefRegisterNodeDefault' type='function'/>
      <exports symbol='xmlUnlinkNode' type='function'/>
@@ -1822,6 +1768,7 @@
      <exports symbol='xmlXIncludeProcessTreeFlagsData' type='function'/>
      <exports symbol='xmlXIncludeSetErrorHandler' type='function'/>
      <exports symbol='xmlXIncludeSetFlags' type='function'/>
+     <exports symbol='xmlXIncludeSetResourceLoader' type='function'/>
     </file>
     <file name='xlink'>
      <summary>unfinished XLink detection module</summary>
@@ -1874,10 +1821,6 @@
      <exports symbol='xmlFileOpen' type='function'/>
      <exports symbol='xmlFileRead' type='function'/>
      <exports symbol='xmlFreeParserInputBuffer' type='function'/>
-     <exports symbol='xmlIOFTPClose' type='function'/>
-     <exports symbol='xmlIOFTPMatch' type='function'/>
-     <exports symbol='xmlIOFTPOpen' type='function'/>
-     <exports symbol='xmlIOFTPRead' type='function'/>
      <exports symbol='xmlIOHTTPClose' type='function'/>
      <exports symbol='xmlIOHTTPMatch' type='function'/>
      <exports symbol='xmlIOHTTPOpen' type='function'/>
@@ -1961,6 +1904,7 @@
      <summary>error handling</summary>
      <description>the API used to report errors </description>
      <author>Daniel Veillard </author>
+     <exports symbol='initGenericErrorDefaultFunc' type='macro'/>
      <exports symbol='XML_BUF_OVERFLOW' type='enum'/>
      <exports symbol='XML_C14N_CREATE_CTXT' type='enum'/>
      <exports symbol='XML_C14N_CREATE_STACK' type='enum'/>
@@ -2745,7 +2689,6 @@
      <exports symbol='xmlErrorPtr' type='typedef'/>
      <exports symbol='xmlParserErrors' type='typedef'/>
      <exports symbol='_xmlError' type='struct'/>
-     <exports symbol='initGenericErrorDefaultFunc' type='function'/>
      <exports symbol='xmlCopyError' type='function'/>
      <exports symbol='xmlCtxtGetLastError' type='function'/>
      <exports symbol='xmlCtxtResetLastError' type='function'/>
@@ -2945,6 +2888,7 @@
      <exports symbol='xmlTextReaderSetErrorHandler' type='function'/>
      <exports symbol='xmlTextReaderSetMaxAmplification' type='function'/>
      <exports symbol='xmlTextReaderSetParserProp' type='function'/>
+     <exports symbol='xmlTextReaderSetResourceLoader' type='function'/>
      <exports symbol='xmlTextReaderSetSchema' type='function'/>
      <exports symbol='xmlTextReaderSetStructuredErrorHandler' type='function'/>
      <exports symbol='xmlTextReaderSetup' type='function'/>
@@ -2956,42 +2900,10 @@
      <summary>regular expressions handling</summary>
      <description>basic API for libxml regular expressions handling used for XML Schemas and validation. </description>
      <author>Daniel Veillard </author>
-     <exports symbol='XML_EXP_ATOM' type='enum'/>
-     <exports symbol='XML_EXP_COUNT' type='enum'/>
-     <exports symbol='XML_EXP_EMPTY' type='enum'/>
-     <exports symbol='XML_EXP_FORBID' type='enum'/>
-     <exports symbol='XML_EXP_OR' type='enum'/>
-     <exports symbol='XML_EXP_SEQ' type='enum'/>
-     <exports symbol='xmlExpCtxt' type='typedef'/>
-     <exports symbol='xmlExpCtxtPtr' type='typedef'/>
-     <exports symbol='xmlExpNode' type='typedef'/>
-     <exports symbol='xmlExpNodePtr' type='typedef'/>
-     <exports symbol='xmlExpNodeType' type='typedef'/>
      <exports symbol='xmlRegExecCtxt' type='typedef'/>
      <exports symbol='xmlRegExecCtxtPtr' type='typedef'/>
      <exports symbol='xmlRegexp' type='typedef'/>
      <exports symbol='xmlRegexpPtr' type='typedef'/>
-     <exports symbol='emptyExp' type='variable'/>
-     <exports symbol='forbiddenExp' type='variable'/>
-     <exports symbol='xmlExpCtxtNbCons' type='function'/>
-     <exports symbol='xmlExpCtxtNbNodes' type='function'/>
-     <exports symbol='xmlExpDump' type='function'/>
-     <exports symbol='xmlExpExpDerive' type='function'/>
-     <exports symbol='xmlExpFree' type='function'/>
-     <exports symbol='xmlExpFreeCtxt' type='function'/>
-     <exports symbol='xmlExpGetLanguage' type='function'/>
-     <exports symbol='xmlExpGetStart' type='function'/>
-     <exports symbol='xmlExpIsNillable' type='function'/>
-     <exports symbol='xmlExpMaxToken' type='function'/>
-     <exports symbol='xmlExpNewAtom' type='function'/>
-     <exports symbol='xmlExpNewCtxt' type='function'/>
-     <exports symbol='xmlExpNewOr' type='function'/>
-     <exports symbol='xmlExpNewRange' type='function'/>
-     <exports symbol='xmlExpNewSeq' type='function'/>
-     <exports symbol='xmlExpParse' type='function'/>
-     <exports symbol='xmlExpRef' type='function'/>
-     <exports symbol='xmlExpStringDerive' type='function'/>
-     <exports symbol='xmlExpSubsume' type='function'/>
      <exports symbol='xmlRegExecCallbacks' type='function'/>
      <exports symbol='xmlRegExecErrInfo' type='function'/>
      <exports symbol='xmlRegExecNextValues' type='function'/>
@@ -3011,9 +2923,12 @@
      <author>Daniel Veillard </author>
      <exports symbol='XML_SAVE_AS_HTML' type='enum'/>
      <exports symbol='XML_SAVE_AS_XML' type='enum'/>
+     <exports symbol='XML_SAVE_EMPTY' type='enum'/>
      <exports symbol='XML_SAVE_FORMAT' type='enum'/>
+     <exports symbol='XML_SAVE_INDENT' type='enum'/>
      <exports symbol='XML_SAVE_NO_DECL' type='enum'/>
      <exports symbol='XML_SAVE_NO_EMPTY' type='enum'/>
+     <exports symbol='XML_SAVE_NO_INDENT' type='enum'/>
      <exports symbol='XML_SAVE_NO_XHTML' type='enum'/>
      <exports symbol='XML_SAVE_WSNONSIG' type='enum'/>
      <exports symbol='XML_SAVE_XHTML' type='enum'/>
@@ -3026,6 +2941,7 @@
      <exports symbol='xmlSaveFlush' type='function'/>
      <exports symbol='xmlSaveSetAttrEscape' type='function'/>
      <exports symbol='xmlSaveSetEscape' type='function'/>
+     <exports symbol='xmlSaveSetIndentString' type='function'/>
      <exports symbol='xmlSaveToBuffer' type='function'/>
      <exports symbol='xmlSaveToFd' type='function'/>
      <exports symbol='xmlSaveToFilename' type='function'/>
@@ -3092,6 +3008,7 @@
      <exports symbol='xmlSchemaSAXUnplug' type='function'/>
      <exports symbol='xmlSchemaSetParserErrors' type='function'/>
      <exports symbol='xmlSchemaSetParserStructuredErrors' type='function'/>
+     <exports symbol='xmlSchemaSetResourceLoader' type='function'/>
      <exports symbol='xmlSchemaSetValidErrors' type='function'/>
      <exports symbol='xmlSchemaSetValidOptions' type='function'/>
      <exports symbol='xmlSchemaSetValidStructuredErrors' type='function'/>
@@ -3188,177 +3105,6 @@
      <exports symbol='xmlUTF8Strsize' type='function'/>
      <exports symbol='xmlUTF8Strsub' type='function'/>
     </file>
-    <file name='xmlunicode'>
-     <summary>Unicode character APIs</summary>
-     <description>API for the Unicode character APIs  This file is automatically generated from the UCS description files of the Unicode Character Database</description>
-     <author>Daniel Veillard </author>
-     <exports symbol='xmlUCSIsAegeanNumbers' type='function'/>
-     <exports symbol='xmlUCSIsAlphabeticPresentationForms' type='function'/>
-     <exports symbol='xmlUCSIsArabic' type='function'/>
-     <exports symbol='xmlUCSIsArabicPresentationFormsA' type='function'/>
-     <exports symbol='xmlUCSIsArabicPresentationFormsB' type='function'/>
-     <exports symbol='xmlUCSIsArmenian' type='function'/>
-     <exports symbol='xmlUCSIsArrows' type='function'/>
-     <exports symbol='xmlUCSIsBasicLatin' type='function'/>
-     <exports symbol='xmlUCSIsBengali' type='function'/>
-     <exports symbol='xmlUCSIsBlock' type='function'/>
-     <exports symbol='xmlUCSIsBlockElements' type='function'/>
-     <exports symbol='xmlUCSIsBopomofo' type='function'/>
-     <exports symbol='xmlUCSIsBopomofoExtended' type='function'/>
-     <exports symbol='xmlUCSIsBoxDrawing' type='function'/>
-     <exports symbol='xmlUCSIsBraillePatterns' type='function'/>
-     <exports symbol='xmlUCSIsBuhid' type='function'/>
-     <exports symbol='xmlUCSIsByzantineMusicalSymbols' type='function'/>
-     <exports symbol='xmlUCSIsCJKCompatibility' type='function'/>
-     <exports symbol='xmlUCSIsCJKCompatibilityForms' type='function'/>
-     <exports symbol='xmlUCSIsCJKCompatibilityIdeographs' type='function'/>
-     <exports symbol='xmlUCSIsCJKCompatibilityIdeographsSupplement' type='function'/>
-     <exports symbol='xmlUCSIsCJKRadicalsSupplement' type='function'/>
-     <exports symbol='xmlUCSIsCJKSymbolsandPunctuation' type='function'/>
-     <exports symbol='xmlUCSIsCJKUnifiedIdeographs' type='function'/>
-     <exports symbol='xmlUCSIsCJKUnifiedIdeographsExtensionA' type='function'/>
-     <exports symbol='xmlUCSIsCJKUnifiedIdeographsExtensionB' type='function'/>
-     <exports symbol='xmlUCSIsCat' type='function'/>
-     <exports symbol='xmlUCSIsCatC' type='function'/>
-     <exports symbol='xmlUCSIsCatCc' type='function'/>
-     <exports symbol='xmlUCSIsCatCf' type='function'/>
-     <exports symbol='xmlUCSIsCatCo' type='function'/>
-     <exports symbol='xmlUCSIsCatCs' type='function'/>
-     <exports symbol='xmlUCSIsCatL' type='function'/>
-     <exports symbol='xmlUCSIsCatLl' type='function'/>
-     <exports symbol='xmlUCSIsCatLm' type='function'/>
-     <exports symbol='xmlUCSIsCatLo' type='function'/>
-     <exports symbol='xmlUCSIsCatLt' type='function'/>
-     <exports symbol='xmlUCSIsCatLu' type='function'/>
-     <exports symbol='xmlUCSIsCatM' type='function'/>
-     <exports symbol='xmlUCSIsCatMc' type='function'/>
-     <exports symbol='xmlUCSIsCatMe' type='function'/>
-     <exports symbol='xmlUCSIsCatMn' type='function'/>
-     <exports symbol='xmlUCSIsCatN' type='function'/>
-     <exports symbol='xmlUCSIsCatNd' type='function'/>
-     <exports symbol='xmlUCSIsCatNl' type='function'/>
-     <exports symbol='xmlUCSIsCatNo' type='function'/>
-     <exports symbol='xmlUCSIsCatP' type='function'/>
-     <exports symbol='xmlUCSIsCatPc' type='function'/>
-     <exports symbol='xmlUCSIsCatPd' type='function'/>
-     <exports symbol='xmlUCSIsCatPe' type='function'/>
-     <exports symbol='xmlUCSIsCatPf' type='function'/>
-     <exports symbol='xmlUCSIsCatPi' type='function'/>
-     <exports symbol='xmlUCSIsCatPo' type='function'/>
-     <exports symbol='xmlUCSIsCatPs' type='function'/>
-     <exports symbol='xmlUCSIsCatS' type='function'/>
-     <exports symbol='xmlUCSIsCatSc' type='function'/>
-     <exports symbol='xmlUCSIsCatSk' type='function'/>
-     <exports symbol='xmlUCSIsCatSm' type='function'/>
-     <exports symbol='xmlUCSIsCatSo' type='function'/>
-     <exports symbol='xmlUCSIsCatZ' type='function'/>
-     <exports symbol='xmlUCSIsCatZl' type='function'/>
-     <exports symbol='xmlUCSIsCatZp' type='function'/>
-     <exports symbol='xmlUCSIsCatZs' type='function'/>
-     <exports symbol='xmlUCSIsCherokee' type='function'/>
-     <exports symbol='xmlUCSIsCombiningDiacriticalMarks' type='function'/>
-     <exports symbol='xmlUCSIsCombiningDiacriticalMarksforSymbols' type='function'/>
-     <exports symbol='xmlUCSIsCombiningHalfMarks' type='function'/>
-     <exports symbol='xmlUCSIsCombiningMarksforSymbols' type='function'/>
-     <exports symbol='xmlUCSIsControlPictures' type='function'/>
-     <exports symbol='xmlUCSIsCurrencySymbols' type='function'/>
-     <exports symbol='xmlUCSIsCypriotSyllabary' type='function'/>
-     <exports symbol='xmlUCSIsCyrillic' type='function'/>
-     <exports symbol='xmlUCSIsCyrillicSupplement' type='function'/>
-     <exports symbol='xmlUCSIsDeseret' type='function'/>
-     <exports symbol='xmlUCSIsDevanagari' type='function'/>
-     <exports symbol='xmlUCSIsDingbats' type='function'/>
-     <exports symbol='xmlUCSIsEnclosedAlphanumerics' type='function'/>
-     <exports symbol='xmlUCSIsEnclosedCJKLettersandMonths' type='function'/>
-     <exports symbol='xmlUCSIsEthiopic' type='function'/>
-     <exports symbol='xmlUCSIsGeneralPunctuation' type='function'/>
-     <exports symbol='xmlUCSIsGeometricShapes' type='function'/>
-     <exports symbol='xmlUCSIsGeorgian' type='function'/>
-     <exports symbol='xmlUCSIsGothic' type='function'/>
-     <exports symbol='xmlUCSIsGreek' type='function'/>
-     <exports symbol='xmlUCSIsGreekExtended' type='function'/>
-     <exports symbol='xmlUCSIsGreekandCoptic' type='function'/>
-     <exports symbol='xmlUCSIsGujarati' type='function'/>
-     <exports symbol='xmlUCSIsGurmukhi' type='function'/>
-     <exports symbol='xmlUCSIsHalfwidthandFullwidthForms' type='function'/>
-     <exports symbol='xmlUCSIsHangulCompatibilityJamo' type='function'/>
-     <exports symbol='xmlUCSIsHangulJamo' type='function'/>
-     <exports symbol='xmlUCSIsHangulSyllables' type='function'/>
-     <exports symbol='xmlUCSIsHanunoo' type='function'/>
-     <exports symbol='xmlUCSIsHebrew' type='function'/>
-     <exports symbol='xmlUCSIsHighPrivateUseSurrogates' type='function'/>
-     <exports symbol='xmlUCSIsHighSurrogates' type='function'/>
-     <exports symbol='xmlUCSIsHiragana' type='function'/>
-     <exports symbol='xmlUCSIsIPAExtensions' type='function'/>
-     <exports symbol='xmlUCSIsIdeographicDescriptionCharacters' type='function'/>
-     <exports symbol='xmlUCSIsKanbun' type='function'/>
-     <exports symbol='xmlUCSIsKangxiRadicals' type='function'/>
-     <exports symbol='xmlUCSIsKannada' type='function'/>
-     <exports symbol='xmlUCSIsKatakana' type='function'/>
-     <exports symbol='xmlUCSIsKatakanaPhoneticExtensions' type='function'/>
-     <exports symbol='xmlUCSIsKhmer' type='function'/>
-     <exports symbol='xmlUCSIsKhmerSymbols' type='function'/>
-     <exports symbol='xmlUCSIsLao' type='function'/>
-     <exports symbol='xmlUCSIsLatin1Supplement' type='function'/>
-     <exports symbol='xmlUCSIsLatinExtendedA' type='function'/>
-     <exports symbol='xmlUCSIsLatinExtendedAdditional' type='function'/>
-     <exports symbol='xmlUCSIsLatinExtendedB' type='function'/>
-     <exports symbol='xmlUCSIsLetterlikeSymbols' type='function'/>
-     <exports symbol='xmlUCSIsLimbu' type='function'/>
-     <exports symbol='xmlUCSIsLinearBIdeograms' type='function'/>
-     <exports symbol='xmlUCSIsLinearBSyllabary' type='function'/>
-     <exports symbol='xmlUCSIsLowSurrogates' type='function'/>
-     <exports symbol='xmlUCSIsMalayalam' type='function'/>
-     <exports symbol='xmlUCSIsMathematicalAlphanumericSymbols' type='function'/>
-     <exports symbol='xmlUCSIsMathematicalOperators' type='function'/>
-     <exports symbol='xmlUCSIsMiscellaneousMathematicalSymbolsA' type='function'/>
-     <exports symbol='xmlUCSIsMiscellaneousMathematicalSymbolsB' type='function'/>
-     <exports symbol='xmlUCSIsMiscellaneousSymbols' type='function'/>
-     <exports symbol='xmlUCSIsMiscellaneousSymbolsandArrows' type='function'/>
-     <exports symbol='xmlUCSIsMiscellaneousTechnical' type='function'/>
-     <exports symbol='xmlUCSIsMongolian' type='function'/>
-     <exports symbol='xmlUCSIsMusicalSymbols' type='function'/>
-     <exports symbol='xmlUCSIsMyanmar' type='function'/>
-     <exports symbol='xmlUCSIsNumberForms' type='function'/>
-     <exports symbol='xmlUCSIsOgham' type='function'/>
-     <exports symbol='xmlUCSIsOldItalic' type='function'/>
-     <exports symbol='xmlUCSIsOpticalCharacterRecognition' type='function'/>
-     <exports symbol='xmlUCSIsOriya' type='function'/>
-     <exports symbol='xmlUCSIsOsmanya' type='function'/>
-     <exports symbol='xmlUCSIsPhoneticExtensions' type='function'/>
-     <exports symbol='xmlUCSIsPrivateUse' type='function'/>
-     <exports symbol='xmlUCSIsPrivateUseArea' type='function'/>
-     <exports symbol='xmlUCSIsRunic' type='function'/>
-     <exports symbol='xmlUCSIsShavian' type='function'/>
-     <exports symbol='xmlUCSIsSinhala' type='function'/>
-     <exports symbol='xmlUCSIsSmallFormVariants' type='function'/>
-     <exports symbol='xmlUCSIsSpacingModifierLetters' type='function'/>
-     <exports symbol='xmlUCSIsSpecials' type='function'/>
-     <exports symbol='xmlUCSIsSuperscriptsandSubscripts' type='function'/>
-     <exports symbol='xmlUCSIsSupplementalArrowsA' type='function'/>
-     <exports symbol='xmlUCSIsSupplementalArrowsB' type='function'/>
-     <exports symbol='xmlUCSIsSupplementalMathematicalOperators' type='function'/>
-     <exports symbol='xmlUCSIsSupplementaryPrivateUseAreaA' type='function'/>
-     <exports symbol='xmlUCSIsSupplementaryPrivateUseAreaB' type='function'/>
-     <exports symbol='xmlUCSIsSyriac' type='function'/>
-     <exports symbol='xmlUCSIsTagalog' type='function'/>
-     <exports symbol='xmlUCSIsTagbanwa' type='function'/>
-     <exports symbol='xmlUCSIsTags' type='function'/>
-     <exports symbol='xmlUCSIsTaiLe' type='function'/>
-     <exports symbol='xmlUCSIsTaiXuanJingSymbols' type='function'/>
-     <exports symbol='xmlUCSIsTamil' type='function'/>
-     <exports symbol='xmlUCSIsTelugu' type='function'/>
-     <exports symbol='xmlUCSIsThaana' type='function'/>
-     <exports symbol='xmlUCSIsThai' type='function'/>
-     <exports symbol='xmlUCSIsTibetan' type='function'/>
-     <exports symbol='xmlUCSIsUgaritic' type='function'/>
-     <exports symbol='xmlUCSIsUnifiedCanadianAboriginalSyllabics' type='function'/>
-     <exports symbol='xmlUCSIsVariationSelectors' type='function'/>
-     <exports symbol='xmlUCSIsVariationSelectorsSupplement' type='function'/>
-     <exports symbol='xmlUCSIsYiRadicals' type='function'/>
-     <exports symbol='xmlUCSIsYiSyllables' type='function'/>
-     <exports symbol='xmlUCSIsYijingHexagramSymbols' type='function'/>
-    </file>
     <file name='xmlversion'>
      <summary>compile-time version information</summary>
      <description>compile-time version information for the XML library </description>
@@ -3368,13 +3114,11 @@
      <exports symbol='LIBXML_CATALOG_ENABLED' type='macro'/>
      <exports symbol='LIBXML_DEBUG_ENABLED' type='macro'/>
      <exports symbol='LIBXML_DOTTED_VERSION' type='macro'/>
-     <exports symbol='LIBXML_FTP_ENABLED' type='macro'/>
      <exports symbol='LIBXML_HTML_ENABLED' type='macro'/>
      <exports symbol='LIBXML_HTTP_ENABLED' type='macro'/>
      <exports symbol='LIBXML_ICONV_ENABLED' type='macro'/>
      <exports symbol='LIBXML_ICU_ENABLED' type='macro'/>
      <exports symbol='LIBXML_ISO8859X_ENABLED' type='macro'/>
-     <exports symbol='LIBXML_LEGACY_ENABLED' type='macro'/>
      <exports symbol='LIBXML_LZMA_ENABLED' type='macro'/>
      <exports symbol='LIBXML_MODULES_ENABLED' type='macro'/>
      <exports symbol='LIBXML_MODULE_EXTENSION' type='macro'/>
@@ -3383,6 +3127,7 @@
      <exports symbol='LIBXML_PUSH_ENABLED' type='macro'/>
      <exports symbol='LIBXML_READER_ENABLED' type='macro'/>
      <exports symbol='LIBXML_REGEXP_ENABLED' type='macro'/>
+     <exports symbol='LIBXML_RELAXNG_ENABLED' type='macro'/>
      <exports symbol='LIBXML_SAX1_ENABLED' type='macro'/>
      <exports symbol='LIBXML_SCHEMAS_ENABLED' type='macro'/>
      <exports symbol='LIBXML_SCHEMATRON_ENABLED' type='macro'/>
@@ -3390,7 +3135,6 @@
      <exports symbol='LIBXML_THREAD_ALLOC_ENABLED' type='macro'/>
      <exports symbol='LIBXML_THREAD_ENABLED' type='macro'/>
      <exports symbol='LIBXML_TREE_ENABLED' type='macro'/>
-     <exports symbol='LIBXML_UNICODE_ENABLED' type='macro'/>
      <exports symbol='LIBXML_VALID_ENABLED' type='macro'/>
      <exports symbol='LIBXML_VERSION' type='macro'/>
      <exports symbol='LIBXML_VERSION_EXTRA' type='macro'/>
@@ -3399,7 +3143,6 @@
      <exports symbol='LIBXML_XINCLUDE_ENABLED' type='macro'/>
      <exports symbol='LIBXML_XPATH_ENABLED' type='macro'/>
      <exports symbol='LIBXML_XPTR_ENABLED' type='macro'/>
-     <exports symbol='LIBXML_XPTR_LOCS_ENABLED' type='macro'/>
      <exports symbol='LIBXML_ZLIB_ENABLED' type='macro'/>
     </file>
     <file name='xmlwriter'>
@@ -3514,14 +3257,11 @@
      <exports symbol='XPATH_INVALID_OPERAND' type='enum'/>
      <exports symbol='XPATH_INVALID_PREDICATE_ERROR' type='enum'/>
      <exports symbol='XPATH_INVALID_TYPE' type='enum'/>
-     <exports symbol='XPATH_LOCATIONSET' type='enum'/>
      <exports symbol='XPATH_MEMORY_ERROR' type='enum'/>
      <exports symbol='XPATH_NODESET' type='enum'/>
      <exports symbol='XPATH_NUMBER' type='enum'/>
      <exports symbol='XPATH_NUMBER_ERROR' type='enum'/>
      <exports symbol='XPATH_OP_LIMIT_EXCEEDED' type='enum'/>
-     <exports symbol='XPATH_POINT' type='enum'/>
-     <exports symbol='XPATH_RANGE' type='enum'/>
      <exports symbol='XPATH_RECURSION_LIMIT_EXCEEDED' type='enum'/>
      <exports symbol='XPATH_STACK_ERROR' type='enum'/>
      <exports symbol='XPATH_START_LITERAL_ERROR' type='enum'/>
@@ -3631,6 +3371,8 @@
      <exports symbol='CHECK_TYPE0' type='macro'/>
      <exports symbol='XP_ERROR' type='macro'/>
      <exports symbol='XP_ERROR0' type='macro'/>
+     <exports symbol='valuePop' type='macro'/>
+     <exports symbol='valuePush' type='macro'/>
      <exports symbol='xmlXPathCheckError' type='macro'/>
      <exports symbol='xmlXPathEmptyNodeSet' type='macro'/>
      <exports symbol='xmlXPathGetContextNode' type='macro'/>
@@ -3650,8 +3392,6 @@
      <exports symbol='xmlXPathSetTypeError' type='macro'/>
      <exports symbol='xmlXPathStackIsExternal' type='macro'/>
      <exports symbol='xmlXPathStackIsNodeSet' type='macro'/>
-     <exports symbol='valuePop' type='function'/>
-     <exports symbol='valuePush' type='function'/>
      <exports symbol='xmlXPathAddValues' type='function'/>
      <exports symbol='xmlXPathBooleanFunction' type='function'/>
      <exports symbol='xmlXPathCeilingFunction' type='function'/>
@@ -3760,6 +3500,8 @@
      <exports symbol='xmlXPathTranslateFunction' type='function'/>
      <exports symbol='xmlXPathTrueFunction' type='function'/>
      <exports symbol='xmlXPathValueFlipSign' type='function'/>
+     <exports symbol='xmlXPathValuePop' type='function'/>
+     <exports symbol='xmlXPathValuePush' type='function'/>
      <exports symbol='xmlXPathVariableLookup' type='function'/>
      <exports symbol='xmlXPathVariableLookupNS' type='function'/>
      <exports symbol='xmlXPathWrapCString' type='function'/>
@@ -3772,39 +3514,14 @@
      <summary>API to handle XML Pointers</summary>
      <description>API to handle XML Pointers Base implementation was made accordingly to W3C Candidate Recommendation 7 June 2000</description>
      <author>Daniel Veillard </author>
-     <exports symbol='xmlLocationSet' type='typedef'/>
-     <exports symbol='xmlLocationSetPtr' type='typedef'/>
-     <exports symbol='_xmlLocationSet' type='struct'/>
-     <exports symbol='xmlXPtrBuildNodeList' type='function'/>
      <exports symbol='xmlXPtrEval' type='function'/>
-     <exports symbol='xmlXPtrEvalRangePredicate' type='function'/>
-     <exports symbol='xmlXPtrFreeLocationSet' type='function'/>
-     <exports symbol='xmlXPtrLocationSetAdd' type='function'/>
-     <exports symbol='xmlXPtrLocationSetCreate' type='function'/>
-     <exports symbol='xmlXPtrLocationSetDel' type='function'/>
-     <exports symbol='xmlXPtrLocationSetMerge' type='function'/>
-     <exports symbol='xmlXPtrLocationSetRemove' type='function'/>
-     <exports symbol='xmlXPtrNewCollapsedRange' type='function'/>
      <exports symbol='xmlXPtrNewContext' type='function'/>
-     <exports symbol='xmlXPtrNewLocationSetNodeSet' type='function'/>
-     <exports symbol='xmlXPtrNewLocationSetNodes' type='function'/>
-     <exports symbol='xmlXPtrNewRange' type='function'/>
-     <exports symbol='xmlXPtrNewRangeNodeObject' type='function'/>
-     <exports symbol='xmlXPtrNewRangeNodePoint' type='function'/>
-     <exports symbol='xmlXPtrNewRangeNodes' type='function'/>
-     <exports symbol='xmlXPtrNewRangePointNode' type='function'/>
-     <exports symbol='xmlXPtrNewRangePoints' type='function'/>
-     <exports symbol='xmlXPtrRangeToFunction' type='function'/>
-     <exports symbol='xmlXPtrWrapLocationSet' type='function'/>
     </file>
   </files>
   <symbols>
     <macro name='BAD_CAST' file='xmlstring'>
       <info>Macro to cast a string to an xmlChar * when one know its safe.</info>
     </macro>
-    <macro name='BASE_BUFFER_SIZE' file='tree'>
-      <info>default buffer size 4000.</info>
-    </macro>
     <macro name='CAST_TO_BOOLEAN' file='xpathInternals'>
       <info>Macro to try to cast the value on the top of the XPath stack to a boolean.</info>
     </macro>
@@ -3847,12 +3564,6 @@
     <macro name='HTML_TEXT_NODE' file='HTMLtree'>
       <info>Macro. A text node in a HTML document is really implemented the same way as a text node in an XML document.</info>
     </macro>
-    <macro name='INPUT_CHUNK' file='parserInternals'>
-      <info>The parser tries to always have that amount of input ready. One of the point is providing context when reporting errors.</info>
-    </macro>
-    <macro name='INVALID_SOCKET' file='nanoftp'>
-      <info>macro used to provide portability of code to windows sockets the value to be used when the socket is not valid</info>
-    </macro>
     <macro name='IS_ASCII_DIGIT' file='parserInternals'>
       <info>Macro to check [0-9]</info>
       <arg name='c' info='an xmlChar value'/>
@@ -3947,9 +3658,6 @@
     <macro name='LIBXML_DOTTED_VERSION' file='xmlversion'>
       <info>the version string like &quot;1.2.3&quot;</info>
     </macro>
-    <macro name='LIBXML_FTP_ENABLED' file='xmlversion'>
-      <info>Whether the FTP support is configured in</info>
-    </macro>
     <macro name='LIBXML_HTML_ENABLED' file='xmlversion'>
       <info>Whether the HTML support is configured in</info>
     </macro>
@@ -3965,9 +3673,6 @@
     <macro name='LIBXML_ISO8859X_ENABLED' file='xmlversion'>
       <info>Whether ISO-8859-* support is made available in case iconv is not</info>
     </macro>
-    <macro name='LIBXML_LEGACY_ENABLED' file='xmlversion'>
-      <info>Whether the deprecated APIs are compiled in for compatibility</info>
-    </macro>
     <macro name='LIBXML_LZMA_ENABLED' file='xmlversion'>
       <info>Whether the Lzma support is compiled in</info>
     </macro>
@@ -3992,6 +3697,9 @@
     <macro name='LIBXML_REGEXP_ENABLED' file='xmlversion'>
       <info>Whether the regular expressions interfaces are compiled in</info>
     </macro>
+    <macro name='LIBXML_RELAXNG_ENABLED' file='xmlversion'>
+      <info>Whether the RelaxNG validation interfaces are compiled in</info>
+    </macro>
     <macro name='LIBXML_SAX1_ENABLED' file='xmlversion'>
       <info>Whether the older SAX1 interface is configured in</info>
     </macro>
@@ -4011,10 +3719,7 @@
       <info>Whether the thread support is configured in</info>
     </macro>
     <macro name='LIBXML_TREE_ENABLED' file='xmlversion'>
-      <info>Whether the DOM like tree manipulation API support is configured in</info>
-    </macro>
-    <macro name='LIBXML_UNICODE_ENABLED' file='xmlversion'>
-      <info>Whether the Unicode related interfaces are compiled in</info>
+      <info>Always enabled since 2.14.0</info>
     </macro>
     <macro name='LIBXML_VALID_ENABLED' file='xmlversion'>
       <info>Whether the DTD validation support is configured in</info>
@@ -4040,14 +3745,12 @@
     <macro name='LIBXML_XPTR_ENABLED' file='xmlversion'>
       <info>Whether XPointer is configured in</info>
     </macro>
-    <macro name='LIBXML_XPTR_LOCS_ENABLED' file='xmlversion'>
-      <info>Whether support for XPointer locations is configured in</info>
-    </macro>
     <macro name='LIBXML_ZLIB_ENABLED' file='xmlversion'>
       <info>Whether the Zlib support is compiled in</info>
     </macro>
-    <macro name='SOCKET' file='nanoftp'>
-      <info>macro used to provide portability of code to windows sockets</info>
+    <macro name='UTF8ToHtml' file='HTMLparser'>
+    </macro>
+    <macro name='UTF8Toisolat1' file='encoding'>
     </macro>
     <macro name='XINCLUDE_FALLBACK' file='xinclude'>
       <info>Macro defining &quot;fallback&quot;</info>
@@ -4413,9 +4116,25 @@
       <info>Returns the attributes required for the specified element.</info>
       <arg name='elt' info='HTML element'/>
     </macro>
+    <macro name='initGenericErrorDefaultFunc' file='xmlerror'>
+    </macro>
+    <macro name='inputPop' file='parserInternals'>
+    </macro>
+    <macro name='inputPush' file='parserInternals'>
+    </macro>
+    <macro name='isolat1ToUTF8' file='encoding'>
+    </macro>
+    <macro name='valuePop' file='xpathInternals'>
+    </macro>
+    <macro name='valuePush' file='xpathInternals'>
+    </macro>
+    <macro name='xmlBufferAllocScheme' file='tree'>
+    </macro>
     <macro name='xmlChildrenNode' file='tree'>
       <info>Macro for compatibility naming layer with libxml1. Maps to &quot;children.&quot;</info>
     </macro>
+    <macro name='xmlDefaultBufferSize' file='tree'>
+    </macro>
     <macro name='xmlIsBaseCharQ' file='chvalid'>
       <info>Automatically generated by genChRanges.py</info>
       <arg name='c' info='char to validate'/>
@@ -4472,6 +4191,8 @@
       <info>Automatically generated by genChRanges.py</info>
       <arg name='c' info='char to validate'/>
     </macro>
+    <macro name='xmlParserMaxDepth' file='parserInternals'>
+    </macro>
     <macro name='xmlRootNode' file='tree'>
       <info>Macro for compatibility naming layer with libxml1. Maps to &quot;children&quot;.</info>
     </macro>
@@ -4579,16 +4300,19 @@
     <enum name='HTML_DEPRECATED' file='HTMLparser' value='2' type='htmlStatus'/>
     <enum name='HTML_INVALID' file='HTMLparser' value='1' type='htmlStatus'/>
     <enum name='HTML_NA' file='HTMLparser' value='0' type='htmlStatus' info='something we don&apos;t check at all'/>
+    <enum name='HTML_PARSE_BIG_LINES' file='HTMLparser' value='4194304' type='htmlParserOption' info=' Store big lines numbers in text PSVI field'/>
     <enum name='HTML_PARSE_COMPACT' file='HTMLparser' value='65536' type='htmlParserOption' info='compact small text nodes'/>
-    <enum name='HTML_PARSE_IGNORE_ENC' file='HTMLparser' value='2097152' type='htmlParserOption' info=' ignore internal document encoding hint'/>
+    <enum name='HTML_PARSE_HTML5' file='HTMLparser' value='2' type='htmlParserOption' info='HTML5 support'/>
+    <enum name='HTML_PARSE_HUGE' file='HTMLparser' value='524288' type='htmlParserOption' info='relax any hardcoded limit from the parser'/>
+    <enum name='HTML_PARSE_IGNORE_ENC' file='HTMLparser' value='2097152' type='htmlParserOption' info='ignore internal document encoding hint'/>
     <enum name='HTML_PARSE_NOBLANKS' file='HTMLparser' value='256' type='htmlParserOption' info='remove blank nodes'/>
     <enum name='HTML_PARSE_NODEFDTD' file='HTMLparser' value='4' type='htmlParserOption' info='do not default a doctype if not found'/>
     <enum name='HTML_PARSE_NOERROR' file='HTMLparser' value='32' type='htmlParserOption' info='suppress error reports'/>
     <enum name='HTML_PARSE_NOIMPLIED' file='HTMLparser' value='8192' type='htmlParserOption' info='Do not add implied html/body... elements'/>
-    <enum name='HTML_PARSE_NONET' file='HTMLparser' value='2048' type='htmlParserOption' info='Forbid network access'/>
+    <enum name='HTML_PARSE_NONET' file='HTMLparser' value='2048' type='htmlParserOption' info='No effect'/>
     <enum name='HTML_PARSE_NOWARNING' file='HTMLparser' value='64' type='htmlParserOption' info='suppress warning reports'/>
-    <enum name='HTML_PARSE_PEDANTIC' file='HTMLparser' value='128' type='htmlParserOption' info='pedantic error reporting'/>
-    <enum name='HTML_PARSE_RECOVER' file='HTMLparser' value='1' type='htmlParserOption' info='Relaxed parsing'/>
+    <enum name='HTML_PARSE_PEDANTIC' file='HTMLparser' value='128' type='htmlParserOption' info='No effect'/>
+    <enum name='HTML_PARSE_RECOVER' file='HTMLparser' value='1' type='htmlParserOption' info='No effect'/>
     <enum name='HTML_REQUIRED' file='HTMLparser' value='12' type='htmlStatus' info=' VALID bit set so ( &amp; HTML_VALID ) is TRUE'/>
     <enum name='HTML_VALID' file='HTMLparser' value='4' type='htmlStatus'/>
     <enum name='XLINK_ACTUATE_AUTO' file='xlink' value='1' type='xlinkActuate'/>
@@ -4649,6 +4373,12 @@
     <enum name='XML_CDATA_SECTION_NODE' file='tree' value='4' type='xmlElementType'/>
     <enum name='XML_CHAR_ENCODING_2022_JP' file='encoding' value='19' type='xmlCharEncoding' info='ISO-2022-JP'/>
     <enum name='XML_CHAR_ENCODING_8859_1' file='encoding' value='10' type='xmlCharEncoding' info='ISO-8859-1 ISO Latin 1'/>
+    <enum name='XML_CHAR_ENCODING_8859_10' file='encoding' value='25' type='xmlCharEncoding' info='ISO-8859-10'/>
+    <enum name='XML_CHAR_ENCODING_8859_11' file='encoding' value='26' type='xmlCharEncoding' info='ISO-8859-11'/>
+    <enum name='XML_CHAR_ENCODING_8859_13' file='encoding' value='27' type='xmlCharEncoding' info='ISO-8859-13'/>
+    <enum name='XML_CHAR_ENCODING_8859_14' file='encoding' value='28' type='xmlCharEncoding' info='ISO-8859-14'/>
+    <enum name='XML_CHAR_ENCODING_8859_15' file='encoding' value='29' type='xmlCharEncoding' info='ISO-8859-15'/>
+    <enum name='XML_CHAR_ENCODING_8859_16' file='encoding' value='30' type='xmlCharEncoding' info=' ISO-8859-16'/>
     <enum name='XML_CHAR_ENCODING_8859_2' file='encoding' value='11' type='xmlCharEncoding' info='ISO-8859-2 ISO Latin 2'/>
     <enum name='XML_CHAR_ENCODING_8859_3' file='encoding' value='12' type='xmlCharEncoding' info='ISO-8859-3'/>
     <enum name='XML_CHAR_ENCODING_8859_4' file='encoding' value='13' type='xmlCharEncoding' info='ISO-8859-4'/>
@@ -4657,10 +4387,11 @@
     <enum name='XML_CHAR_ENCODING_8859_7' file='encoding' value='16' type='xmlCharEncoding' info='ISO-8859-7'/>
     <enum name='XML_CHAR_ENCODING_8859_8' file='encoding' value='17' type='xmlCharEncoding' info='ISO-8859-8'/>
     <enum name='XML_CHAR_ENCODING_8859_9' file='encoding' value='18' type='xmlCharEncoding' info='ISO-8859-9'/>
-    <enum name='XML_CHAR_ENCODING_ASCII' file='encoding' value='22' type='xmlCharEncoding' info=' pure ASCII'/>
+    <enum name='XML_CHAR_ENCODING_ASCII' file='encoding' value='22' type='xmlCharEncoding' info='pure ASCII Available since 2.14.0'/>
     <enum name='XML_CHAR_ENCODING_EBCDIC' file='encoding' value='6' type='xmlCharEncoding' info='EBCDIC uh!'/>
     <enum name='XML_CHAR_ENCODING_ERROR' file='encoding' value='-1' type='xmlCharEncoding' info='No char encoding detected'/>
     <enum name='XML_CHAR_ENCODING_EUC_JP' file='encoding' value='21' type='xmlCharEncoding' info='EUC-JP'/>
+    <enum name='XML_CHAR_ENCODING_HTML' file='encoding' value='24' type='xmlCharEncoding' info='HTML (output only)'/>
     <enum name='XML_CHAR_ENCODING_NONE' file='encoding' value='0' type='xmlCharEncoding' info='No char encoding detected'/>
     <enum name='XML_CHAR_ENCODING_SHIFT_JIS' file='encoding' value='20' type='xmlCharEncoding' info='Shift_JIS'/>
     <enum name='XML_CHAR_ENCODING_UCS2' file='encoding' value='9' type='xmlCharEncoding' info='UCS-2'/>
@@ -4668,6 +4399,7 @@
     <enum name='XML_CHAR_ENCODING_UCS4LE' file='encoding' value='4' type='xmlCharEncoding' info='UCS-4 little endian'/>
     <enum name='XML_CHAR_ENCODING_UCS4_2143' file='encoding' value='7' type='xmlCharEncoding' info='UCS-4 unusual ordering'/>
     <enum name='XML_CHAR_ENCODING_UCS4_3412' file='encoding' value='8' type='xmlCharEncoding' info='UCS-4 unusual ordering'/>
+    <enum name='XML_CHAR_ENCODING_UTF16' file='encoding' value='23' type='xmlCharEncoding' info='UTF-16 native'/>
     <enum name='XML_CHAR_ENCODING_UTF16BE' file='encoding' value='3' type='xmlCharEncoding' info='UTF-16 big endian'/>
     <enum name='XML_CHAR_ENCODING_UTF16LE' file='encoding' value='2' type='xmlCharEncoding' info='UTF-16 little endian'/>
     <enum name='XML_CHAR_ENCODING_UTF8' file='encoding' value='1' type='xmlCharEncoding' info='UTF-8'/>
@@ -4781,11 +4513,12 @@
     <enum name='XML_ELEMENT_TYPE_MIXED' file='tree' value='3' type='xmlElementTypeVal'/>
     <enum name='XML_ELEMENT_TYPE_UNDEFINED' file='tree' value='0' type='xmlElementTypeVal'/>
     <enum name='XML_ENC_ERR_INPUT' file='encoding' value='-2' type='xmlCharEncError'/>
-    <enum name='XML_ENC_ERR_INTERNAL' file='encoding' value='-4' type='xmlCharEncError'/>
-    <enum name='XML_ENC_ERR_MEMORY' file='encoding' value='-5' type='xmlCharEncError'/>
-    <enum name='XML_ENC_ERR_PARTIAL' file='encoding' value='-3' type='xmlCharEncError'/>
-    <enum name='XML_ENC_ERR_SPACE' file='encoding' value='-1' type='xmlCharEncError'/>
+    <enum name='XML_ENC_ERR_INTERNAL' file='encoding' value='-1' type='xmlCharEncError'/>
+    <enum name='XML_ENC_ERR_MEMORY' file='encoding' value='-4' type='xmlCharEncError'/>
+    <enum name='XML_ENC_ERR_SPACE' file='encoding' value='-3' type='xmlCharEncError'/>
     <enum name='XML_ENC_ERR_SUCCESS' file='encoding' value='0' type='xmlCharEncError'/>
+    <enum name='XML_ENC_INPUT' file='encoding' value='1' type='xmlCharEncFlags'/>
+    <enum name='XML_ENC_OUTPUT' file='encoding' value='2' type='xmlCharEncFlags'/>
     <enum name='XML_ENTITY_DECL' file='tree' value='17' type='xmlElementType'/>
     <enum name='XML_ENTITY_NODE' file='tree' value='6' type='xmlElementType' info='unused'/>
     <enum name='XML_ENTITY_REF_NODE' file='tree' value='5' type='xmlElementType'/>
@@ -4902,12 +4635,6 @@
     <enum name='XML_ERR_WARNING' file='xmlerror' value='1' type='xmlErrorLevel' info='A simple warning'/>
     <enum name='XML_ERR_XMLDECL_NOT_FINISHED' file='xmlerror' value='57' type='xmlParserErrors' info='57'/>
     <enum name='XML_ERR_XMLDECL_NOT_STARTED' file='xmlerror' value='56' type='xmlParserErrors' info='56'/>
-    <enum name='XML_EXP_ATOM' file='xmlregexp' value='2' type='xmlExpNodeType'/>
-    <enum name='XML_EXP_COUNT' file='xmlregexp' value='5' type='xmlExpNodeType'/>
-    <enum name='XML_EXP_EMPTY' file='xmlregexp' value='0' type='xmlExpNodeType'/>
-    <enum name='XML_EXP_FORBID' file='xmlregexp' value='1' type='xmlExpNodeType'/>
-    <enum name='XML_EXP_OR' file='xmlregexp' value='4' type='xmlExpNodeType'/>
-    <enum name='XML_EXP_SEQ' file='xmlregexp' value='3' type='xmlExpNodeType'/>
     <enum name='XML_EXTERNAL_GENERAL_PARSED_ENTITY' file='entities' value='2' type='xmlEntityType'/>
     <enum name='XML_EXTERNAL_GENERAL_UNPARSED_ENTITY' file='entities' value='3' type='xmlEntityType'/>
     <enum name='XML_EXTERNAL_PARAMETER_ENTITY' file='entities' value='5' type='xmlEntityType'/>
@@ -4958,6 +4685,10 @@
     <enum name='XML_I18N_NO_HANDLER' file='xmlerror' value='6001' type='xmlParserErrors' info='6001'/>
     <enum name='XML_I18N_NO_NAME' file='xmlerror' value='6000' type='xmlParserErrors'/>
     <enum name='XML_I18N_NO_OUTPUT' file='xmlerror' value='6004' type='xmlParserErrors' info='6004'/>
+    <enum name='XML_INPUT_BUF_STATIC' file='parser' value='2' type='xmlParserInputFlags'/>
+    <enum name='XML_INPUT_BUF_ZERO_TERMINATED' file='parser' value='4' type='xmlParserInputFlags'/>
+    <enum name='XML_INPUT_NETWORK' file='parser' value='16' type='xmlParserInputFlags'/>
+    <enum name='XML_INPUT_UNZIP' file='parser' value='8' type='xmlParserInputFlags'/>
     <enum name='XML_INTERNAL_GENERAL_ENTITY' file='entities' value='1' type='xmlEntityType'/>
     <enum name='XML_INTERNAL_PARAMETER_ENTITY' file='entities' value='4' type='xmlEntityType'/>
     <enum name='XML_INTERNAL_PREDEFINED_ENTITY' file='entities' value='6' type='xmlEntityType'/>
@@ -5058,7 +4789,8 @@
     <enum name='XML_PARSER_SYSTEM_LITERAL' file='parser' value='13' type='xmlParserInputState' info='within a SYSTEM value'/>
     <enum name='XML_PARSER_VALIDATE' file='xmlreader' value='3' type='xmlParserProperties'/>
     <enum name='XML_PARSER_XML_DECL' file='parser' value='17' type='xmlParserInputState' info=' before XML decl (but after BOM)'/>
-    <enum name='XML_PARSE_BIG_LINES' file='parser' value='4194304' type='xmlParserOption' info='Store big lines numbers in text PSVI field'/>
+    <enum name='XML_PARSE_BIG_LINES' file='parser' value='4194304' type='xmlParserOption' info='Store big lines numbers in text PSVI field since 2.13.0'/>
+    <enum name='XML_PARSE_CATALOG_PI' file='parser' value='67108864' type='xmlParserOption' info=' allow catalog PIs'/>
     <enum name='XML_PARSE_COMPACT' file='parser' value='65536' type='xmlParserOption' info='compact small text nodes; no modification of
 the tree allowed afterwards (will possibly
 crash if you try to modify the tree)'/>
@@ -5077,7 +4809,8 @@
     <enum name='XML_PARSE_NONET' file='parser' value='2048' type='xmlParserOption' info='Forbid network access'/>
     <enum name='XML_PARSE_NOWARNING' file='parser' value='64' type='xmlParserOption' info='suppress warning reports'/>
     <enum name='XML_PARSE_NOXINCNODE' file='parser' value='32768' type='xmlParserOption' info='do not generate XINCLUDE START/END nodes'/>
-    <enum name='XML_PARSE_NO_XXE' file='parser' value='8388608' type='xmlParserOption' info=' disable loading of external content'/>
+    <enum name='XML_PARSE_NO_SYS_CATALOG' file='parser' value='33554432' type='xmlParserOption' info='disable global system catalog'/>
+    <enum name='XML_PARSE_NO_XXE' file='parser' value='8388608' type='xmlParserOption' info='disable loading of external content since 2.14.0'/>
     <enum name='XML_PARSE_NSCLEAN' file='parser' value='8192' type='xmlParserOption' info='remove redundant namespaces declarations'/>
     <enum name='XML_PARSE_OLD10' file='parser' value='131072' type='xmlParserOption' info='parse using XML-1.0 before update 5'/>
     <enum name='XML_PARSE_OLDSAX' file='parser' value='1048576' type='xmlParserOption' info='parse using SAX2 interface before 2.7.0'/>
@@ -5089,6 +4822,7 @@
     <enum name='XML_PARSE_SAX' file='parser' value='2' type='xmlParserMode'/>
     <enum name='XML_PARSE_SAX1' file='parser' value='512' type='xmlParserOption' info='use the SAX1 interface internally'/>
     <enum name='XML_PARSE_UNKNOWN' file='parser' value='0' type='xmlParserMode'/>
+    <enum name='XML_PARSE_UNZIP' file='parser' value='16777216' type='xmlParserOption' info='allow compressed content'/>
     <enum name='XML_PARSE_XINCLUDE' file='parser' value='1024' type='xmlParserOption' info='Implement XInclude substitution'/>
     <enum name='XML_PATTERN_DEFAULT' file='pattern' value='0' type='xmlPatternFlags' info='simple pattern match'/>
     <enum name='XML_PATTERN_XPATH' file='pattern' value='1' type='xmlPatternFlags' info='standard XPath pattern'/>
@@ -5157,6 +4891,13 @@
     <enum name='XML_RELAXNG_ERR_VALELEM' file='relaxng' value='29' type='xmlRelaxNGValidErr'/>
     <enum name='XML_RELAXNG_ERR_VALUE' file='relaxng' value='32' type='xmlRelaxNGValidErr'/>
     <enum name='XML_RELAXNG_OK' file='relaxng' value='0' type='xmlRelaxNGValidErr'/>
+    <enum name='XML_RESOURCE_DTD' file='parser' value='2' type='xmlResourceType'/>
+    <enum name='XML_RESOURCE_GENERAL_ENTITY' file='parser' value='3' type='xmlResourceType'/>
+    <enum name='XML_RESOURCE_MAIN_DOCUMENT' file='parser' value='1' type='xmlResourceType'/>
+    <enum name='XML_RESOURCE_PARAMETER_ENTITY' file='parser' value='4' type='xmlResourceType'/>
+    <enum name='XML_RESOURCE_UNKNOWN' file='parser' value='0' type='xmlResourceType'/>
+    <enum name='XML_RESOURCE_XINCLUDE' file='parser' value='5' type='xmlResourceType'/>
+    <enum name='XML_RESOURCE_XINCLUDE_TEXT' file='parser' value='6' type='xmlResourceType'/>
     <enum name='XML_RNGP_ANYNAME_ATTR_ANCESTOR' file='xmlerror' value='1000' type='xmlParserErrors'/>
     <enum name='XML_RNGP_ATTRIBUTE_CHILDREN' file='xmlerror' value='1002' type='xmlParserErrors' info='1002'/>
     <enum name='XML_RNGP_ATTRIBUTE_CONTENT' file='xmlerror' value='1003' type='xmlParserErrors' info='1003'/>
@@ -5283,14 +5024,17 @@
     <enum name='XML_SAVE_AS_HTML' file='xmlsave' value='64' type='xmlSaveOption' info='force HTML serialization on XML doc'/>
     <enum name='XML_SAVE_AS_XML' file='xmlsave' value='32' type='xmlSaveOption' info='force XML serialization on HTML doc'/>
     <enum name='XML_SAVE_CHAR_INVALID' file='xmlerror' value='1401' type='xmlParserErrors' info='1401'/>
+    <enum name='XML_SAVE_EMPTY' file='xmlsave' value='256' type='xmlSaveOption' info='force empty tags, overriding global'/>
     <enum name='XML_SAVE_FORMAT' file='xmlsave' value='1' type='xmlSaveOption' info='format save output'/>
+    <enum name='XML_SAVE_INDENT' file='xmlsave' value='1024' type='xmlSaveOption' info=' force indenting, overriding global'/>
     <enum name='XML_SAVE_NOT_UTF8' file='xmlerror' value='1400' type='xmlParserErrors'/>
     <enum name='XML_SAVE_NO_DECL' file='xmlsave' value='2' type='xmlSaveOption' info='drop the xml declaration'/>
     <enum name='XML_SAVE_NO_DOCTYPE' file='xmlerror' value='1402' type='xmlParserErrors' info='1402'/>
     <enum name='XML_SAVE_NO_EMPTY' file='xmlsave' value='4' type='xmlSaveOption' info='no empty tags'/>
+    <enum name='XML_SAVE_NO_INDENT' file='xmlsave' value='512' type='xmlSaveOption' info='disable indenting'/>
     <enum name='XML_SAVE_NO_XHTML' file='xmlsave' value='8' type='xmlSaveOption' info='disable XHTML1 specific rules'/>
     <enum name='XML_SAVE_UNKNOWN_ENCODING' file='xmlerror' value='1403' type='xmlParserErrors' info='1403'/>
-    <enum name='XML_SAVE_WSNONSIG' file='xmlsave' value='128' type='xmlSaveOption' info=' format with non-significant whitespace'/>
+    <enum name='XML_SAVE_WSNONSIG' file='xmlsave' value='128' type='xmlSaveOption' info='format with non-significant whitespace Available since 2.14.0'/>
     <enum name='XML_SAVE_XHTML' file='xmlsave' value='16' type='xmlSaveOption' info='force XHTML1 specific rules'/>
     <enum name='XML_SCHEMAP_AG_PROPS_CORRECT' file='xmlerror' value='3087' type='xmlParserErrors' info='3086'/>
     <enum name='XML_SCHEMAP_ATTRFORMDEFAULT_VALUE' file='xmlerror' value='1701' type='xmlParserErrors' info='1701'/>
@@ -5701,6 +5445,10 @@
     <enum name='XML_SCHEMA_WHITESPACE_PRESERVE' file='xmlschemastypes' value='1' type='xmlSchemaWhitespaceValueType'/>
     <enum name='XML_SCHEMA_WHITESPACE_REPLACE' file='xmlschemastypes' value='2' type='xmlSchemaWhitespaceValueType'/>
     <enum name='XML_SCHEMA_WHITESPACE_UNKNOWN' file='xmlschemastypes' value='0' type='xmlSchemaWhitespaceValueType'/>
+    <enum name='XML_STATUS_CATASTROPHIC_ERROR' file='parser' value='8' type='xmlParserStatus'/>
+    <enum name='XML_STATUS_DTD_VALIDATION_FAILED' file='parser' value='4' type='xmlParserStatus'/>
+    <enum name='XML_STATUS_NOT_NS_WELL_FORMED' file='parser' value='2' type='xmlParserStatus'/>
+    <enum name='XML_STATUS_NOT_WELL_FORMED' file='parser' value='1' type='xmlParserStatus'/>
     <enum name='XML_TEXTREADER_MODE_CLOSED' file='xmlreader' value='4' type='xmlTextReaderMode'/>
     <enum name='XML_TEXTREADER_MODE_EOF' file='xmlreader' value='3' type='xmlTextReaderMode'/>
     <enum name='XML_TEXTREADER_MODE_ERROR' file='xmlreader' value='2' type='xmlTextReaderMode'/>
@@ -5744,6 +5492,7 @@
     <enum name='XML_WITH_PUSH' file='parser' value='4' type='xmlFeature'/>
     <enum name='XML_WITH_READER' file='parser' value='5' type='xmlFeature'/>
     <enum name='XML_WITH_REGEXP' file='parser' value='22' type='xmlFeature'/>
+    <enum name='XML_WITH_RELAXNG' file='parser' value='34' type='xmlFeature' info='since 2.14.0'/>
     <enum name='XML_WITH_SAX1' file='parser' value='8' type='xmlFeature'/>
     <enum name='XML_WITH_SCHEMAS' file='parser' value='25' type='xmlFeature'/>
     <enum name='XML_WITH_SCHEMATRON' file='parser' value='26' type='xmlFeature'/>
@@ -5816,14 +5565,11 @@
     <enum name='XPATH_INVALID_OPERAND' file='xpath' value='10' type='xmlXPathError'/>
     <enum name='XPATH_INVALID_PREDICATE_ERROR' file='xpath' value='6' type='xmlXPathError'/>
     <enum name='XPATH_INVALID_TYPE' file='xpath' value='11' type='xmlXPathError'/>
-    <enum name='XPATH_LOCATIONSET' file='xpath' value='7' type='xmlXPathObjectType'/>
     <enum name='XPATH_MEMORY_ERROR' file='xpath' value='15' type='xmlXPathError'/>
     <enum name='XPATH_NODESET' file='xpath' value='1' type='xmlXPathObjectType'/>
     <enum name='XPATH_NUMBER' file='xpath' value='3' type='xmlXPathObjectType'/>
     <enum name='XPATH_NUMBER_ERROR' file='xpath' value='1' type='xmlXPathError'/>
     <enum name='XPATH_OP_LIMIT_EXCEEDED' file='xpath' value='25' type='xmlXPathError'/>
-    <enum name='XPATH_POINT' file='xpath' value='5' type='xmlXPathObjectType'/>
-    <enum name='XPATH_RANGE' file='xpath' value='6' type='xmlXPathObjectType'/>
     <enum name='XPATH_RECURSION_LIMIT_EXCEEDED' file='xpath' value='26' type='xmlXPathError'/>
     <enum name='XPATH_STACK_ERROR' file='xpath' value='23' type='xmlXPathError'/>
     <enum name='XPATH_START_LITERAL_ERROR' file='xpath' value='3' type='xmlXPathError'/>
@@ -5842,36 +5588,27 @@
     <enum name='XPTR_SYNTAX_ERROR' file='xpath' value='16' type='xmlXPathError'/>
     <typedef name='htmlDocPtr' file='HTMLparser' type='xmlDocPtr'/>
     <struct name='htmlElemDesc' file='HTMLparser' type='struct _htmlElemDesc'>
-      <field name='name' type='const char *' info=' The tag name'/>
-      <field name='startTag' type='char' info=' Whether the start tag can be implied'/>
-      <field name='endTag' type='char' info=' Whether the end tag can be implied'/>
-      <field name='saveEndTag' type='char' info=' Whether the end tag should be saved'/>
-      <field name='empty' type='char' info=' Is this an empty element ?'/>
-      <field name='depr' type='char' info=' Is this a deprecated element ?'/>
-      <field name='dtd' type='char' info=' 1: only in Loose DTD, 2: only Frameset one'/>
-      <field name='isinline' type='char' info=' is this a block 0 or inline 1 element'/>
-      <field name='desc' type='const char *' info=' the description NRK Jan.2003
-* New fields encapsulating HTML structure
-*
-* Bugs:
-*	This is a very limited representation.  It fails to tell us when
-*	an element *requires* subelements (we only have whether they&apos;re
-*	allowed or not), and it doesn&apos;t tell us where CDATA and PCDATA
-*	are allowed.  Some element relationships are not fully represented:
-*	these are flagged with the word MODIFIER
-*'/>
-      <field name='subelts' type='const char **' info=' allowed sub-elements of this element'/>
-      <field name='defaultsubelt' type='const char *' info=' subelement for suggested auto-repair
-if necessary or NULL'/>
-      <field name='attrs_opt' type='const char **' info=' Optional Attributes'/>
-      <field name='attrs_depr' type='const char **' info=' Additional deprecated attributes'/>
-      <field name='attrs_req' type='const char **' info=' Required attributes'/>
+      <field name='name' type='const char *'/>
+      <field name='startTag' type='char'/>
+      <field name='endTag' type='char'/>
+      <field name='saveEndTag' type='char'/>
+      <field name='empty' type='char'/>
+      <field name='depr' type='char'/>
+      <field name='dtd' type='char'/>
+      <field name='isinline' type='char'/>
+      <field name='desc' type='const char *'/>
+      <field name='subelts' type='const char **'/>
+      <field name='defaultsubelt' type='const char *'/>
+      <field name='attrs_opt' type='const char **'/>
+      <field name='attrs_depr' type='const char **'/>
+      <field name='attrs_req' type='const char **'/>
+      <field name='dataMode' type='int'/>
     </struct>
     <typedef name='htmlElemDescPtr' file='HTMLparser' type='htmlElemDesc *'/>
     <struct name='htmlEntityDesc' file='HTMLparser' type='struct _htmlEntityDesc'>
-      <field name='value' type='unsigned int' info=' the UNICODE value for the character'/>
-      <field name='name' type='const char *' info=' The entity name'/>
-      <field name='desc' type='const char *' info=' the description'/>
+      <field name='value' type='unsigned int'/>
+      <field name='name' type='const char *'/>
+      <field name='desc' type='const char *'/>
     </struct>
     <typedef name='htmlEntityDescPtr' file='HTMLparser' type='htmlEntityDesc *'/>
     <typedef name='htmlNodePtr' file='HTMLparser' type='xmlNodePtr'/>
@@ -5887,9 +5624,9 @@
     <typedef name='xlinkActuate' file='xlink' type='enum'/>
     <typedef name='xlinkHRef' file='xlink' type='xmlChar *'/>
     <struct name='xlinkHandler' file='xlink' type='struct _xlinkHandler'>
-      <field name='simple' type='xlinkSimpleLinkFunk' info=''/>
-      <field name='extended' type='xlinkExtendedLinkFunk' info=''/>
-      <field name='set' type='xlinkExtendedLinkSetFunk' info=''/>
+      <field name='simple' type='xlinkSimpleLinkFunk'/>
+      <field name='extended' type='xlinkExtendedLinkFunk'/>
+      <field name='set' type='xlinkExtendedLinkSetFunk'/>
     </struct>
     <typedef name='xlinkHandlerPtr' file='xlink' type='xlinkHandler *'/>
     <typedef name='xlinkRole' file='xlink' type='xmlChar *'/>
@@ -5897,39 +5634,39 @@
     <typedef name='xlinkTitle' file='xlink' type='xmlChar *'/>
     <typedef name='xlinkType' file='xlink' type='enum'/>
     <struct name='xmlAttr' file='tree' type='struct _xmlAttr'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' XML_ATTRIBUTE_NODE, must be second !'/>
-      <field name='name' type='const xmlChar *' info=' the name of the property'/>
-      <field name='children' type='struct _xmlNode *' info=' the value of the property'/>
-      <field name='last' type='struct _xmlNode *' info=' NULL'/>
-      <field name='parent' type='struct _xmlNode *' info=' child-&gt;parent link'/>
-      <field name='next' type='struct _xmlAttr *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlAttr *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' the containing document'/>
-      <field name='ns' type='xmlNs *' info=' pointer to the associated namespace'/>
-      <field name='atype' type='xmlAttributeType' info=' the attribute type if validating'/>
-      <field name='psvi' type='void *' info=' for type/PSVI information'/>
-      <field name='id' type='struct _xmlID *' info=' the ID struct'/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlNode *'/>
+      <field name='next' type='struct _xmlAttr *'/>
+      <field name='prev' type='struct _xmlAttr *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='ns' type='xmlNs *'/>
+      <field name='atype' type='xmlAttributeType'/>
+      <field name='psvi' type='void *'/>
+      <field name='id' type='struct _xmlID *'/>
     </struct>
     <struct name='xmlAttrHashBucket' file='parser' type='struct _xmlAttrHashBucket'/>
     <typedef name='xmlAttrPtr' file='tree' type='xmlAttr *'/>
     <struct name='xmlAttribute' file='tree' type='struct _xmlAttribute'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' XML_ATTRIBUTE_DECL, must be second !'/>
-      <field name='name' type='const xmlChar *' info=' Attribute name'/>
-      <field name='children' type='struct _xmlNode *' info=' NULL'/>
-      <field name='last' type='struct _xmlNode *' info=' NULL'/>
-      <field name='parent' type='struct _xmlDtd *' info=' -&gt; DTD'/>
-      <field name='next' type='struct _xmlNode *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlNode *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' the containing document'/>
-      <field name='nexth' type='struct _xmlAttribute *' info=' next in hash table'/>
-      <field name='atype' type='xmlAttributeType' info=' The attribute type'/>
-      <field name='def' type='xmlAttributeDefault' info=' the default'/>
-      <field name='defaultValue' type='const xmlChar *' info=' or the default value'/>
-      <field name='tree' type='xmlEnumerationPtr' info=' or the enumeration tree if any'/>
-      <field name='prefix' type='const xmlChar *' info=' the namespace prefix if any'/>
-      <field name='elem' type='const xmlChar *' info=' Element holding the attribute'/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlDtd *'/>
+      <field name='next' type='struct _xmlNode *'/>
+      <field name='prev' type='struct _xmlNode *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='nexth' type='struct _xmlAttribute *'/>
+      <field name='atype' type='xmlAttributeType'/>
+      <field name='def' type='xmlAttributeDefault'/>
+      <field name='defaultValue' type='const xmlChar *'/>
+      <field name='tree' type='xmlEnumerationPtr'/>
+      <field name='prefix' type='const xmlChar *'/>
+      <field name='elem' type='const xmlChar *'/>
     </struct>
     <typedef name='xmlAttributeDefault' file='tree' type='enum'/>
     <typedef name='xmlAttributePtr' file='tree' type='xmlAttribute *'/>
@@ -5949,11 +5686,11 @@
       <info>A pointer to a buffer structure, the actual structure internals are not public</info>
     </typedef>
     <struct name='xmlBuffer' file='tree' type='struct _xmlBuffer'>
-      <field name='content' type='xmlChar *' info=' The buffer content UTF8'/>
-      <field name='use' type='unsigned int' info=' The buffer size used'/>
-      <field name='size' type='unsigned int' info=' The buffer size'/>
-      <field name='alloc' type='xmlBufferAllocationScheme' info=' The realloc method'/>
-      <field name='contentIO' type='xmlChar *' info=' in IO mode we may have a different base'/>
+      <field name='content' type='xmlChar *'/>
+      <field name='use' type='unsigned int'/>
+      <field name='size' type='unsigned int'/>
+      <field name='alloc' type='xmlBufferAllocationScheme'/>
+      <field name='contentIO' type='xmlChar *'/>
     </struct>
     <typedef name='xmlBufferAllocationScheme' file='tree' type='enum'/>
     <typedef name='xmlBufferPtr' file='tree' type='xmlBuffer *'/>
@@ -5963,130 +5700,117 @@
     <typedef name='xmlCatalogPrefer' file='catalog' type='enum'/>
     <typedef name='xmlCatalogPtr' file='catalog' type='xmlCatalog *'/>
     <struct name='xmlChLRange' file='chvalid' type='struct _xmlChLRange'>
-      <field name='low' type='unsigned int' info=''/>
-      <field name='high' type='unsigned int' info=''/>
+      <field name='low' type='unsigned int'/>
+      <field name='high' type='unsigned int'/>
     </struct>
     <typedef name='xmlChLRangePtr' file='chvalid' type='xmlChLRange *'/>
     <struct name='xmlChRangeGroup' file='chvalid' type='struct _xmlChRangeGroup'>
-      <field name='nbShortRange' type='int' info=''/>
-      <field name='nbLongRange' type='int' info=''/>
-      <field name='shortRange' type='const xmlChSRange *' info=' points to an array of ranges'/>
-      <field name='longRange' type='const xmlChLRange *' info=''/>
+      <field name='nbShortRange' type='int'/>
+      <field name='nbLongRange' type='int'/>
+      <field name='shortRange' type='const xmlChSRange *'/>
+      <field name='longRange' type='const xmlChLRange *'/>
     </struct>
     <typedef name='xmlChRangeGroupPtr' file='chvalid' type='xmlChRangeGroup *'/>
     <struct name='xmlChSRange' file='chvalid' type='struct _xmlChSRange'>
-      <field name='low' type='unsigned short' info=''/>
-      <field name='high' type='unsigned short' info=''/>
+      <field name='low' type='unsigned short'/>
+      <field name='high' type='unsigned short'/>
     </struct>
     <typedef name='xmlChSRangePtr' file='chvalid' type='xmlChSRange *'/>
     <typedef name='xmlChar' file='xmlstring' type='unsigned char'>
       <info>This is a basic byte in an UTF-8 encoded string. It&apos;s unsigned allowing to pinpoint case where char * are assigned to xmlChar * (possibly making serialization back impossible).</info>
     </typedef>
     <typedef name='xmlCharEncError' file='encoding' type='enum'/>
+    <typedef name='xmlCharEncFlags' file='encoding' type='enum'/>
     <typedef name='xmlCharEncoding' file='encoding' type='enum'/>
     <struct name='xmlCharEncodingHandler' file='encoding' type='struct _xmlCharEncodingHandler'>
-      <field name='name' type='char *' info=''/>
-      <field name='input' type='xmlCharEncodingInputFunc' info=''/>
-      <field name='output' type='xmlCharEncodingOutputFunc' info=''/>
-      <field name='iconv_in' type='iconv_t' info=''/>
-      <field name='iconv_out' type='iconv_t' info=''/>
-      <field name='uconv_in' type='struct _uconv_t *' info=''/>
-      <field name='uconv_out' type='struct _uconv_t *' info=''/>
+      <field name='name' type='char *'/>
+      <field name='inputCtxt' type='void *'/>
+      <field name='outputCtxt' type='void *'/>
+      <field name='ctxtDtor' type='xmlCharEncConvCtxtDtor'/>
+      <field name='flags' type='int'/>
     </struct>
     <typedef name='xmlCharEncodingHandlerPtr' file='encoding' type='xmlCharEncodingHandler *'/>
     <struct name='xmlDOMWrapCtxt' file='tree' type='struct _xmlDOMWrapCtxt'>
-      <field name='_private' type='void *' info='* The type of this context, just in case we need specialized
-* contexts in the future.
-*'/>
-      <field name='type' type='int' info='* Internal namespace map used for various operations.
-*'/>
-      <field name='namespaceMap' type='void *' info='* Use this one to acquire an xmlNsPtr intended for node-&gt;ns.
-* (Note that this is not intended for elem-&gt;nsDef).
-*'/>
-      <field name='getNsForNodeFunc' type='xmlDOMWrapAcquireNsFunction' info=''/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='int'/>
+      <field name='namespaceMap' type='void *'/>
+      <field name='getNsForNodeFunc' type='xmlDOMWrapAcquireNsFunction'/>
     </struct>
     <typedef name='xmlDOMWrapCtxtPtr' file='tree' type='xmlDOMWrapCtxt *'/>
     <struct name='xmlDict' file='dict' type='struct _xmlDict'/>
     <typedef name='xmlDictPtr' file='dict' type='xmlDict *'/>
     <struct name='xmlDoc' file='tree' type='struct _xmlDoc'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' XML_DOCUMENT_NODE, must be second !'/>
-      <field name='name' type='char *' info=' name/filename/URI of the document'/>
-      <field name='children' type='struct _xmlNode *' info=' the document tree'/>
-      <field name='last' type='struct _xmlNode *' info=' last child link'/>
-      <field name='parent' type='struct _xmlNode *' info=' child-&gt;parent link'/>
-      <field name='next' type='struct _xmlNode *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlNode *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' autoreference to itself End of common part'/>
-      <field name='compression' type='int' info=' level of zlib compression'/>
-      <field name='standalone' type='int' info=' standalone document (no external refs)
-1 if standalone=&quot;yes&quot;
-0 if standalone=&quot;no&quot;
--1 if there is no XML declaration
--2 if there is an XML declaration, but no
-standalone attribute was specified'/>
-      <field name='intSubset' type='struct _xmlDtd *' info=' the document internal subset'/>
-      <field name='extSubset' type='struct _xmlDtd *' info=' the document external subset'/>
-      <field name='oldNs' type='struct _xmlNs *' info=' Global namespace, the old way'/>
-      <field name='version' type='const xmlChar *' info=' the XML version string'/>
-      <field name='encoding' type='const xmlChar *' info=' actual encoding, if any'/>
-      <field name='ids' type='void *' info=' Hash table for ID attributes if any'/>
-      <field name='refs' type='void *' info=' Hash table for IDREFs attributes if any'/>
-      <field name='URL' type='const xmlChar *' info=' The URI for that document'/>
-      <field name='charset' type='int' info=' unused'/>
-      <field name='dict' type='struct _xmlDict *' info=' dict used to allocate names or NULL'/>
-      <field name='psvi' type='void *' info=' for type/PSVI information'/>
-      <field name='parseFlags' type='int' info=' set of xmlParserOption used to parse the
-document'/>
-      <field name='properties' type='int' info=' set of xmlDocProperties for this document
-set at the end of parsing'/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='char *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlNode *'/>
+      <field name='next' type='struct _xmlNode *'/>
+      <field name='prev' type='struct _xmlNode *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='compression' type='int'/>
+      <field name='standalone' type='int'/>
+      <field name='intSubset' type='struct _xmlDtd *'/>
+      <field name='extSubset' type='struct _xmlDtd *'/>
+      <field name='oldNs' type='struct _xmlNs *'/>
+      <field name='version' type='const xmlChar *'/>
+      <field name='encoding' type='const xmlChar *'/>
+      <field name='ids' type='void *'/>
+      <field name='refs' type='void *'/>
+      <field name='URL' type='const xmlChar *'/>
+      <field name='charset' type='int'/>
+      <field name='dict' type='struct _xmlDict *'/>
+      <field name='psvi' type='void *'/>
+      <field name='parseFlags' type='int'/>
+      <field name='properties' type='int'/>
     </struct>
     <typedef name='xmlDocProperties' file='tree' type='enum'/>
     <typedef name='xmlDocPtr' file='tree' type='xmlDoc *'/>
     <struct name='xmlDtd' file='tree' type='struct _xmlDtd'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' XML_DTD_NODE, must be second !'/>
-      <field name='name' type='const xmlChar *' info=' Name of the DTD'/>
-      <field name='children' type='struct _xmlNode *' info=' the value of the property link'/>
-      <field name='last' type='struct _xmlNode *' info=' last child link'/>
-      <field name='parent' type='struct _xmlDoc *' info=' child-&gt;parent link'/>
-      <field name='next' type='struct _xmlNode *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlNode *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' the containing document End of common part'/>
-      <field name='notations' type='void *' info=' Hash table for notations if any'/>
-      <field name='elements' type='void *' info=' Hash table for elements if any'/>
-      <field name='attributes' type='void *' info=' Hash table for attributes if any'/>
-      <field name='entities' type='void *' info=' Hash table for entities if any'/>
-      <field name='ExternalID' type='const xmlChar *' info=' External identifier for PUBLIC DTD'/>
-      <field name='SystemID' type='const xmlChar *' info=' URI for a SYSTEM or PUBLIC DTD'/>
-      <field name='pentities' type='void *' info=' Hash table for param entities if any'/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlDoc *'/>
+      <field name='next' type='struct _xmlNode *'/>
+      <field name='prev' type='struct _xmlNode *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='notations' type='void *'/>
+      <field name='elements' type='void *'/>
+      <field name='attributes' type='void *'/>
+      <field name='entities' type='void *'/>
+      <field name='ExternalID' type='const xmlChar *'/>
+      <field name='SystemID' type='const xmlChar *'/>
+      <field name='pentities' type='void *'/>
     </struct>
     <typedef name='xmlDtdPtr' file='tree' type='xmlDtd *'/>
     <struct name='xmlElement' file='tree' type='struct _xmlElement'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' XML_ELEMENT_DECL, must be second !'/>
-      <field name='name' type='const xmlChar *' info=' Element name'/>
-      <field name='children' type='struct _xmlNode *' info=' NULL'/>
-      <field name='last' type='struct _xmlNode *' info=' NULL'/>
-      <field name='parent' type='struct _xmlDtd *' info=' -&gt; DTD'/>
-      <field name='next' type='struct _xmlNode *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlNode *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' the containing document'/>
-      <field name='etype' type='xmlElementTypeVal' info=' The type'/>
-      <field name='content' type='xmlElementContentPtr' info=' the allowed element content'/>
-      <field name='attributes' type='xmlAttributePtr' info=' List of the declared attributes'/>
-      <field name='prefix' type='const xmlChar *' info=' the namespace prefix if any'/>
-      <field name='contModel' type='xmlRegexpPtr' info=' the validating regexp'/>
-      <field name='contModel' type='void *' info=''/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlDtd *'/>
+      <field name='next' type='struct _xmlNode *'/>
+      <field name='prev' type='struct _xmlNode *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='etype' type='xmlElementTypeVal'/>
+      <field name='content' type='xmlElementContentPtr'/>
+      <field name='attributes' type='xmlAttributePtr'/>
+      <field name='prefix' type='const xmlChar *'/>
+      <field name='contModel' type='xmlRegexpPtr'/>
+      <field name='contModel' type='void *'/>
     </struct>
     <struct name='xmlElementContent' file='tree' type='struct _xmlElementContent'>
-      <field name='type' type='xmlElementContentType' info=' PCDATA, ELEMENT, SEQ or OR'/>
-      <field name='ocur' type='xmlElementContentOccur' info=' ONCE, OPT, MULT or PLUS'/>
-      <field name='name' type='const xmlChar *' info=' Element name'/>
-      <field name='c1' type='struct _xmlElementContent *' info=' first child'/>
-      <field name='c2' type='struct _xmlElementContent *' info=' second child'/>
-      <field name='parent' type='struct _xmlElementContent *' info=' parent'/>
-      <field name='prefix' type='const xmlChar *' info=' Namespace prefix'/>
+      <field name='type' type='xmlElementContentType'/>
+      <field name='ocur' type='xmlElementContentOccur'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='c1' type='struct _xmlElementContent *'/>
+      <field name='c2' type='struct _xmlElementContent *'/>
+      <field name='parent' type='struct _xmlElementContent *'/>
+      <field name='prefix' type='const xmlChar *'/>
     </struct>
     <typedef name='xmlElementContentOccur' file='tree' type='enum'/>
     <typedef name='xmlElementContentPtr' file='tree' type='xmlElementContent *'/>
@@ -6099,69 +5823,62 @@
     <struct name='xmlEntitiesTable' file='entities' type='struct _xmlHashTable'/>
     <typedef name='xmlEntitiesTablePtr' file='entities' type='xmlEntitiesTable *'/>
     <struct name='xmlEntity' file='tree' type='struct _xmlEntity'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' XML_ENTITY_DECL, must be second !'/>
-      <field name='name' type='const xmlChar *' info=' Entity name'/>
-      <field name='children' type='struct _xmlNode *' info=' First child link'/>
-      <field name='last' type='struct _xmlNode *' info=' Last child link'/>
-      <field name='parent' type='struct _xmlDtd *' info=' -&gt; DTD'/>
-      <field name='next' type='struct _xmlNode *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlNode *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' the containing document'/>
-      <field name='orig' type='xmlChar *' info=' content without ref substitution'/>
-      <field name='content' type='xmlChar *' info=' content or ndata if unparsed'/>
-      <field name='length' type='int' info=' the content length'/>
-      <field name='etype' type='xmlEntityType' info=' The entity type'/>
-      <field name='ExternalID' type='const xmlChar *' info=' External identifier for PUBLIC'/>
-      <field name='SystemID' type='const xmlChar *' info=' URI for a SYSTEM or PUBLIC Entity'/>
-      <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=' unused'/>
-      <field name='flags' type='int' info=' various flags'/>
-      <field name='expandedSize' type='unsigned long' info=' expanded size'/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlDtd *'/>
+      <field name='next' type='struct _xmlNode *'/>
+      <field name='prev' type='struct _xmlNode *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='orig' type='xmlChar *'/>
+      <field name='content' type='xmlChar *'/>
+      <field name='length' type='int'/>
+      <field name='etype' type='xmlEntityType'/>
+      <field name='ExternalID' type='const xmlChar *'/>
+      <field name='SystemID' type='const xmlChar *'/>
+      <field name='nexte' type='struct _xmlEntity *'/>
+      <field name='URI' type='const xmlChar *'/>
+      <field name='owner' type='int'/>
+      <field name='flags' type='int'/>
+      <field name='expandedSize' type='unsigned long'/>
     </struct>
     <typedef name='xmlEntityPtr' file='tree' type='xmlEntity *'/>
     <typedef name='xmlEntityType' file='entities' type='enum'/>
     <struct name='xmlEnumeration' file='tree' type='struct _xmlEnumeration'>
-      <field name='next' type='struct _xmlEnumeration *' info=' next one'/>
-      <field name='name' type='const xmlChar *' info=' Enumeration name'/>
+      <field name='next' type='struct _xmlEnumeration *'/>
+      <field name='name' type='const xmlChar *'/>
     </struct>
     <typedef name='xmlEnumerationPtr' file='tree' type='xmlEnumeration *'/>
     <struct name='xmlError' file='xmlerror' type='struct _xmlError'>
-      <field name='domain' type='int' info=' What part of the library raised this error'/>
-      <field name='code' type='int' info=' The error code, e.g. an xmlParserError'/>
-      <field name='message' type='char *' info=' human-readable informative error message'/>
-      <field name='level' type='xmlErrorLevel' info=' how consequent is the error'/>
-      <field name='file' type='char *' info=' the filename'/>
-      <field name='line' type='int' info=' the line number if available'/>
-      <field name='str1' type='char *' info=' extra string information'/>
-      <field name='str2' type='char *' info=' extra string information'/>
-      <field name='str3' type='char *' info=' extra string information'/>
-      <field name='int1' type='int' info=' extra number information'/>
-      <field name='int2' type='int' info=' error column # or 0 if N/A (todo: rename field when we would brk ABI)'/>
-      <field name='ctxt' type='void *' info=' the parser context if available'/>
-      <field name='node' type='void *' info=' the node in the tree'/>
+      <field name='domain' type='int'/>
+      <field name='code' type='int'/>
+      <field name='message' type='char *'/>
+      <field name='level' type='xmlErrorLevel'/>
+      <field name='file' type='char *'/>
+      <field name='line' type='int'/>
+      <field name='str1' type='char *'/>
+      <field name='str2' type='char *'/>
+      <field name='str3' type='char *'/>
+      <field name='int1' type='int'/>
+      <field name='int2' type='int'/>
+      <field name='ctxt' type='void *'/>
+      <field name='node' type='void *'/>
     </struct>
     <typedef name='xmlErrorDomain' file='xmlerror' type='enum'/>
     <typedef name='xmlErrorLevel' file='xmlerror' type='enum'/>
     <typedef name='xmlErrorPtr' file='xmlerror' type='xmlError *'/>
-    <struct name='xmlExpCtxt' file='xmlregexp' type='struct _xmlExpCtxt'/>
-    <typedef name='xmlExpCtxtPtr' file='xmlregexp' type='xmlExpCtxt *'/>
-    <struct name='xmlExpNode' file='xmlregexp' type='struct _xmlExpNode'/>
-    <typedef name='xmlExpNodePtr' file='xmlregexp' type='xmlExpNode *'/>
-    <typedef name='xmlExpNodeType' file='xmlregexp' type='enum'/>
     <typedef name='xmlFeature' file='parser' type='enum'/>
-    <struct name='xmlGlobalState' file='globals' type='struct _xmlGlobalState'/>
-    <typedef name='xmlGlobalStatePtr' file='globals' type='xmlGlobalState *'/>
     <struct name='xmlHashTable' file='hash' type='struct _xmlHashTable'/>
     <typedef name='xmlHashTablePtr' file='hash' type='xmlHashTable *'/>
     <struct name='xmlID' file='tree' type='struct _xmlID'>
-      <field name='next' type='struct _xmlID *' info=' next ID'/>
-      <field name='value' type='const xmlChar *' info=' The ID name'/>
-      <field name='attr' type='xmlAttrPtr' info=' The attribute holding it'/>
-      <field name='name' type='const xmlChar *' info=' The attribute if attr is not available'/>
-      <field name='lineno' type='int' info=' The line number if attr is not available'/>
-      <field name='doc' type='struct _xmlDoc *' info=' The document holding the ID'/>
+      <field name='next' type='struct _xmlID *'/>
+      <field name='value' type='const xmlChar *'/>
+      <field name='attr' type='xmlAttrPtr'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='lineno' type='int'/>
+      <field name='doc' type='struct _xmlDoc *'/>
     </struct>
     <typedef name='xmlIDPtr' file='tree' type='xmlID *'/>
     <struct name='xmlIDTable' file='valid' type='struct _xmlHashTable'/>
@@ -6170,12 +5887,6 @@
     <typedef name='xmlLinkPtr' file='list' type='xmlLink *'/>
     <struct name='xmlList' file='list' type='struct _xmlList'/>
     <typedef name='xmlListPtr' file='list' type='xmlList *'/>
-    <struct name='xmlLocationSet' file='xpointer' type='struct _xmlLocationSet'>
-      <field name='locNr' type='int' info=' number of locations in the set'/>
-      <field name='locMax' type='int' info=' size of the array as allocated'/>
-      <field name='locTab' type='xmlXPathObjectPtr *' info=' array of locations'/>
-    </struct>
-    <typedef name='xmlLocationSetPtr' file='xpointer' type='xmlLocationSet *'/>
     <struct name='xmlModule' file='xmlmodule' type='struct _xmlModule'/>
     <typedef name='xmlModuleOption' file='xmlmodule' type='enum'/>
     <typedef name='xmlModulePtr' file='xmlmodule' type='xmlModule *'>
@@ -6184,220 +5895,219 @@
     <struct name='xmlMutex' file='threads' type='struct _xmlMutex'/>
     <typedef name='xmlMutexPtr' file='threads' type='xmlMutex *'/>
     <struct name='xmlNode' file='tree' type='struct _xmlNode'>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='type' type='xmlElementType' info=' type number, must be second !'/>
-      <field name='name' type='const xmlChar *' info=' the name of the node, or the entity'/>
-      <field name='children' type='struct _xmlNode *' info=' parent-&gt;childs link'/>
-      <field name='last' type='struct _xmlNode *' info=' last child link'/>
-      <field name='parent' type='struct _xmlNode *' info=' child-&gt;parent link'/>
-      <field name='next' type='struct _xmlNode *' info=' next sibling link '/>
-      <field name='prev' type='struct _xmlNode *' info=' previous sibling link '/>
-      <field name='doc' type='struct _xmlDoc *' info=' the containing document End of common part'/>
-      <field name='ns' type='xmlNs *' info=' pointer to the associated namespace'/>
-      <field name='content' type='xmlChar *' info=' the content'/>
-      <field name='properties' type='struct _xmlAttr *' info=' properties list'/>
-      <field name='nsDef' type='xmlNs *' info=' namespace definitions on this node'/>
-      <field name='psvi' type='void *' info=' for type/PSVI information'/>
-      <field name='line' type='unsigned short' info=' line number'/>
-      <field name='extra' type='unsigned short' info=' extra data for XPath/XSLT'/>
+      <field name='_private' type='void *'/>
+      <field name='type' type='xmlElementType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='children' type='struct _xmlNode *'/>
+      <field name='last' type='struct _xmlNode *'/>
+      <field name='parent' type='struct _xmlNode *'/>
+      <field name='next' type='struct _xmlNode *'/>
+      <field name='prev' type='struct _xmlNode *'/>
+      <field name='doc' type='struct _xmlDoc *'/>
+      <field name='ns' type='xmlNs *'/>
+      <field name='content' type='xmlChar *'/>
+      <field name='properties' type='struct _xmlAttr *'/>
+      <field name='nsDef' type='xmlNs *'/>
+      <field name='psvi' type='void *'/>
+      <field name='line' type='unsigned short'/>
+      <field name='extra' type='unsigned short'/>
     </struct>
     <typedef name='xmlNodePtr' file='tree' type='xmlNode *'/>
     <struct name='xmlNodeSet' file='xpath' type='struct _xmlNodeSet'>
-      <field name='nodeNr' type='int' info=' number of nodes in the set'/>
-      <field name='nodeMax' type='int' info=' size of the array as allocated'/>
-      <field name='nodeTab' type='xmlNodePtr *' info=' array of nodes in no particular order @@ with_ns to check whether namespace nodes should be looked at @@'/>
+      <field name='nodeNr' type='int'/>
+      <field name='nodeMax' type='int'/>
+      <field name='nodeTab' type='xmlNodePtr *'/>
     </struct>
     <typedef name='xmlNodeSetPtr' file='xpath' type='xmlNodeSet *'/>
     <struct name='xmlNotation' file='tree' type='struct _xmlNotation'>
-      <field name='name' type='const xmlChar *' info=' Notation name'/>
-      <field name='PublicID' type='const xmlChar *' info=' Public identifier, if any'/>
-      <field name='SystemID' type='const xmlChar *' info=' System identifier, if any'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='PublicID' type='const xmlChar *'/>
+      <field name='SystemID' type='const xmlChar *'/>
     </struct>
     <typedef name='xmlNotationPtr' file='tree' type='xmlNotation *'/>
     <struct name='xmlNotationTable' file='valid' type='struct _xmlHashTable'/>
     <typedef name='xmlNotationTablePtr' file='valid' type='xmlNotationTable *'/>
     <struct name='xmlNs' file='tree' type='struct _xmlNs'>
-      <field name='next' type='struct _xmlNs *' info=' next Ns link for this node '/>
-      <field name='type' type='xmlNsType' info=' global or local'/>
-      <field name='href' type='const xmlChar *' info=' URL for the namespace'/>
-      <field name='prefix' type='const xmlChar *' info=' prefix for the namespace'/>
-      <field name='_private' type='void *' info=' application data'/>
-      <field name='context' type='struct _xmlDoc *' info=' normally an xmlDoc'/>
+      <field name='next' type='struct _xmlNs *'/>
+      <field name='type' type='xmlNsType'/>
+      <field name='href' type='const xmlChar *'/>
+      <field name='prefix' type='const xmlChar *'/>
+      <field name='_private' type='void *'/>
+      <field name='context' type='struct _xmlDoc *'/>
     </struct>
     <typedef name='xmlNsPtr' file='tree' type='xmlNs *'/>
     <typedef name='xmlNsType' file='tree' type='xmlElementType'/>
     <struct name='xmlOutputBuffer' file='tree' type='struct _xmlOutputBuffer'>
-      <field name='context' type='void *' info=''/>
-      <field name='writecallback' type='xmlOutputWriteCallback' info=''/>
-      <field name='closecallback' type='xmlOutputCloseCallback' info=''/>
-      <field name='encoder' type='xmlCharEncodingHandlerPtr' info=' I18N conversions to UTF-8'/>
-      <field name='buffer' type='xmlBufPtr' info=' Local buffer encoded in UTF-8 or ISOLatin'/>
-      <field name='conv' type='xmlBufPtr' info=' if encoder != NULL buffer for output'/>
-      <field name='written' type='int' info=' total number of byte written'/>
-      <field name='error' type='int' info=''/>
+      <field name='context' type='void *'/>
+      <field name='writecallback' type='xmlOutputWriteCallback'/>
+      <field name='closecallback' type='xmlOutputCloseCallback'/>
+      <field name='encoder' type='xmlCharEncodingHandlerPtr'/>
+      <field name='buffer' type='xmlBufPtr'/>
+      <field name='conv' type='xmlBufPtr'/>
+      <field name='written' type='int'/>
+      <field name='error' type='int'/>
     </struct>
     <typedef name='xmlOutputBufferPtr' file='tree' type='xmlOutputBuffer *'/>
     <struct name='xmlParserCtxt' file='tree' type='struct _xmlParserCtxt'>
-      <field name='sax' type='struct _xmlSAXHandler *' info=' The SAX handler'/>
-      <field name='userData' type='void *' info=' For SAX interface only, used by DOM build'/>
-      <field name='myDoc' type='xmlDocPtr' info=' the document being built'/>
-      <field name='wellFormed' type='int' info=' is the document well formed'/>
-      <field name='replaceEntities' type='int' info=' shall we replace entities ?'/>
-      <field name='version' type='const xmlChar *' info=' the XML version string'/>
-      <field name='encoding' type='const xmlChar *' info=' the declared encoding, if any'/>
-      <field name='standalone' type='int' info=' standalone document'/>
-      <field name='html' type='int' info=' an HTML(1) document
-* 3 is HTML after &lt;head&gt;
-* 10 is HTML after &lt;body&gt;
-* Input stream stack'/>
-      <field name='input' type='xmlParserInputPtr' info=' Current input stream'/>
-      <field name='inputNr' type='int' info=' Number of current input streams'/>
-      <field name='inputMax' type='int' info=' Max number of input streams'/>
-      <field name='inputTab' type='xmlParserInputPtr *' info=' stack of inputs Node analysis stack only used for DOM building'/>
-      <field name='node' type='xmlNodePtr' info=' Current parsed Node'/>
-      <field name='nodeNr' type='int' info=' Depth of the parsing stack'/>
-      <field name='nodeMax' type='int' info=' Max depth of the parsing stack'/>
-      <field name='nodeTab' type='xmlNodePtr *' info=' array of nodes'/>
-      <field name='record_info' type='int' info=' Whether node info should be kept'/>
-      <field name='node_seq' type='xmlParserNodeInfoSeq' info=' info about each node parsed'/>
-      <field name='errNo' type='int' info=' error code'/>
-      <field name='hasExternalSubset' type='int' info=' reference and external subset'/>
-      <field name='hasPErefs' type='int' info=' the internal subset has PE refs'/>
-      <field name='external' type='int' info=' unused'/>
-      <field name='valid' type='int' info=' is the document valid'/>
-      <field name='validate' type='int' info=' shall we try to validate ?'/>
-      <field name='vctxt' type='xmlValidCtxt' info=' The validity context'/>
-      <field name='instate' type='xmlParserInputState' info=' push parser state'/>
-      <field name='token' type='int' info=' unused'/>
-      <field name='directory' type='char *' info=' unused Node name stack'/>
-      <field name='name' type='const xmlChar *' info=' Current parsed Node'/>
-      <field name='nameNr' type='int' info=' Depth of the parsing stack'/>
-      <field name='nameMax' type='int' info=' Max depth of the parsing stack'/>
-      <field name='nameTab' type='const xmlChar * *' info=' array of nodes'/>
-      <field name='nbChars' type='long' info=' unused'/>
-      <field name='checkIndex' type='long' info=' used by progressive parsing lookup'/>
-      <field name='keepBlanks' type='int' info=' ugly but ...'/>
-      <field name='disableSAX' type='int' info=' SAX callbacks are disabled'/>
-      <field name='inSubset' type='int' info=' Parsing is in int 1/ext 2 subset'/>
-      <field name='intSubName' type='const xmlChar *' info=' name of subset'/>
-      <field name='extSubURI' type='xmlChar *' info=' URI of external subset'/>
-      <field name='extSubSystem' type='xmlChar *' info=' SYSTEM ID of external subset xml:space values'/>
-      <field name='space' type='int *' info=' Should the parser preserve spaces'/>
-      <field name='spaceNr' type='int' info=' Depth of the parsing stack'/>
-      <field name='spaceMax' type='int' info=' Max depth of the parsing stack'/>
-      <field name='spaceTab' type='int *' info=' array of space infos'/>
-      <field name='depth' type='int' info=' to prevent entity substitution loops'/>
-      <field name='entity' type='xmlParserInputPtr' info=' unused'/>
-      <field name='charset' type='int' info=' unused'/>
-      <field name='nodelen' type='int' info=' Those two fields are there to'/>
-      <field name='nodemem' type='int' info=' Speed up large node parsing'/>
-      <field name='pedantic' type='int' info=' signal pedantic warnings'/>
-      <field name='_private' type='void *' info=' For user data, libxml won&apos;t touch it'/>
-      <field name='loadsubset' type='int' info=' should the external subset be loaded'/>
-      <field name='linenumbers' type='int' info=' set line number in element content'/>
-      <field name='catalogs' type='void *' info=' document&apos;s own catalog'/>
-      <field name='recovery' type='int' info=' run in recovery mode'/>
-      <field name='progressive' type='int' info=' unused'/>
-      <field name='dict' type='xmlDictPtr' info=' dictionary for the parser'/>
-      <field name='atts' type='const xmlChar * *' info=' array for the attributes callbacks'/>
-      <field name='maxatts' type='int' info=' the size of the array'/>
-      <field name='docdict' type='int' info='* pre-interned strings
-*'/>
-      <field name='str_xml' type='const xmlChar *' info=''/>
-      <field name='str_xmlns' type='const xmlChar *' info=''/>
-      <field name='str_xml_ns' type='const xmlChar *' info='* Everything below is used only by the new SAX mode
-*'/>
-      <field name='sax2' type='int' info=' operating in the new SAX mode'/>
-      <field name='nsNr' type='int' info=' the number of inherited namespaces'/>
-      <field name='nsMax' type='int' info=' the size of the arrays'/>
-      <field name='nsTab' type='const xmlChar * *' info=' the array of prefix/namespace name'/>
-      <field name='attallocs' type='unsigned *' info=' which attribute were allocated'/>
-      <field name='pushTab' type='xmlStartTag *' info=' array of data for push'/>
-      <field name='attsDefault' type='xmlHashTablePtr' info=' defaulted attributes if any'/>
-      <field name='attsSpecial' type='xmlHashTablePtr' info=' non-CDATA attributes if any'/>
-      <field name='nsWellFormed' type='int' info=' is the document XML Namespace okay'/>
-      <field name='options' type='int' info='* Those fields are needed only for streaming parsing so far
-*'/>
-      <field name='dictNames' type='int' info=' Use dictionary names for the tree'/>
-      <field name='freeElemsNr' type='int' info=' number of freed element nodes'/>
-      <field name='freeElems' type='xmlNodePtr' info=' List of freed element nodes'/>
-      <field name='freeAttrsNr' type='int' info=' number of freed attributes nodes'/>
-      <field name='freeAttrs' type='xmlAttrPtr' info='* the complete error information for the last error.
-*'/>
-      <field name='lastError' type='xmlError' info=''/>
-      <field name='parseMode' type='xmlParserMode' info=' the parser mode'/>
-      <field name='nbentities' type='unsigned long' info=' unused'/>
-      <field name='sizeentities' type='unsigned long' info=' size of external 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'/>
-      <field name='nodeInfoMax' type='int' info=' Max depth of the parsing stack'/>
-      <field name='nodeInfoTab' type='xmlParserNodeInfo *' info=' array of nodeInfos'/>
-      <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'/>
-      <field name='maxAmpl' type='unsigned' info=' maximum amplification factor'/>
-      <field name='nsdb' type='xmlParserNsData *' info=' namespace database'/>
-      <field name='attrHashMax' type='unsigned' info=' allocated size'/>
-      <field name='attrHash' type='xmlAttrHashBucket *' info=' atttribute hash table'/>
-      <field name='errorHandler' type='xmlStructuredErrorFunc' info=''/>
-      <field name='errorCtxt' type='void *' info=''/>
+      <field name='sax' type='struct _xmlSAXHandler *'/>
+      <field name='userData' type='void *'/>
+      <field name='myDoc' type='xmlDocPtr'/>
+      <field name='wellFormed' type='int'/>
+      <field name='replaceEntities' type='int'/>
+      <field name='version' type='const xmlChar *'/>
+      <field name='encoding' type='const xmlChar *'/>
+      <field name='standalone' type='int'/>
+      <field name='html' type='int'/>
+      <field name='input' type='xmlParserInputPtr'/>
+      <field name='inputNr' type='int'/>
+      <field name='inputMax' type='int'/>
+      <field name='inputTab' type='xmlParserInputPtr *'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='nodeNr' type='int'/>
+      <field name='nodeMax' type='int'/>
+      <field name='nodeTab' type='xmlNodePtr *'/>
+      <field name='record_info' type='int'/>
+      <field name='node_seq' type='xmlParserNodeInfoSeq'/>
+      <field name='errNo' type='int'/>
+      <field name='hasExternalSubset' type='int'/>
+      <field name='hasPErefs' type='int'/>
+      <field name='external' type='int'/>
+      <field name='valid' type='int'/>
+      <field name='validate' type='int'/>
+      <field name='vctxt' type='xmlValidCtxt'/>
+      <field name='instate' type='xmlParserInputState'/>
+      <field name='token' type='int'/>
+      <field name='directory' type='char *'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='nameNr' type='int'/>
+      <field name='nameMax' type='int'/>
+      <field name='nameTab' type='const xmlChar **'/>
+      <field name='nbChars' type='long'/>
+      <field name='checkIndex' type='long'/>
+      <field name='keepBlanks' type='int'/>
+      <field name='disableSAX' type='int'/>
+      <field name='inSubset' type='int'/>
+      <field name='intSubName' type='const xmlChar *'/>
+      <field name='extSubURI' type='xmlChar *'/>
+      <field name='extSubSystem' type='xmlChar *'/>
+      <field name='space' type='int *'/>
+      <field name='spaceNr' type='int'/>
+      <field name='spaceMax' type='int'/>
+      <field name='spaceTab' type='int *'/>
+      <field name='depth' type='int'/>
+      <field name='entity' type='xmlParserInputPtr'/>
+      <field name='charset' type='int'/>
+      <field name='nodelen' type='int'/>
+      <field name='nodemem' type='int'/>
+      <field name='pedantic' type='int'/>
+      <field name='_private' type='void *'/>
+      <field name='loadsubset' type='int'/>
+      <field name='linenumbers' type='int'/>
+      <field name='catalogs' type='void *'/>
+      <field name='recovery' type='int'/>
+      <field name='progressive' type='int'/>
+      <field name='dict' type='xmlDictPtr'/>
+      <field name='atts' type='const xmlChar **'/>
+      <field name='maxatts' type='int'/>
+      <field name='docdict' type='int'/>
+      <field name='str_xml' type='const xmlChar *'/>
+      <field name='str_xmlns' type='const xmlChar *'/>
+      <field name='str_xml_ns' type='const xmlChar *'/>
+      <field name='sax2' type='int'/>
+      <field name='nsNr' type='int'/>
+      <field name='nsMax' type='int'/>
+      <field name='nsTab' type='const xmlChar **'/>
+      <field name='attallocs' type='unsigned *'/>
+      <field name='pushTab' type='xmlStartTag *'/>
+      <field name='attsDefault' type='xmlHashTablePtr'/>
+      <field name='attsSpecial' type='xmlHashTablePtr'/>
+      <field name='nsWellFormed' type='int'/>
+      <field name='options' type='int'/>
+      <field name='dictNames' type='int'/>
+      <field name='freeElemsNr' type='int'/>
+      <field name='freeElems' type='xmlNodePtr'/>
+      <field name='freeAttrsNr' type='int'/>
+      <field name='freeAttrs' type='xmlAttrPtr'/>
+      <field name='lastError' type='xmlError'/>
+      <field name='parseMode' type='xmlParserMode'/>
+      <field name='nbentities' type='unsigned long'/>
+      <field name='sizeentities' type='unsigned long'/>
+      <field name='nodeInfo' type='xmlParserNodeInfo *'/>
+      <field name='nodeInfoNr' type='int'/>
+      <field name='nodeInfoMax' type='int'/>
+      <field name='nodeInfoTab' type='xmlParserNodeInfo *'/>
+      <field name='input_id' type='int'/>
+      <field name='sizeentcopy' type='unsigned long'/>
+      <field name='endCheckState' type='int'/>
+      <field name='nbErrors' type='unsigned short'/>
+      <field name='nbWarnings' type='unsigned short'/>
+      <field name='maxAmpl' type='unsigned'/>
+      <field name='nsdb' type='xmlParserNsData *'/>
+      <field name='attrHashMax' type='unsigned'/>
+      <field name='attrHash' type='xmlAttrHashBucket *'/>
+      <field name='errorHandler' type='xmlStructuredErrorFunc'/>
+      <field name='errorCtxt' type='void *'/>
+      <field name='resourceLoader' type='xmlResourceLoader'/>
+      <field name='resourceCtxt' type='void *'/>
+      <field name='convImpl' type='xmlCharEncConvImpl'/>
+      <field name='convCtxt' type='void *'/>
     </struct>
     <typedef name='xmlParserCtxtPtr' file='tree' type='xmlParserCtxt *'/>
     <typedef name='xmlParserErrors' file='xmlerror' type='enum'/>
     <struct name='xmlParserInput' file='tree' type='struct _xmlParserInput'>
-      <field name='buf' type='xmlParserInputBufferPtr' info=' UTF-8 encoded buffer'/>
-      <field name='filename' type='const char *' info=' The file analyzed, if any'/>
-      <field name='directory' type='const char *' info=' unused'/>
-      <field name='base' type='const xmlChar *' info=' Base of the array to parse'/>
-      <field name='cur' type='const xmlChar *' info=' Current char being parsed'/>
-      <field name='end' type='const xmlChar *' info=' end of the array to parse'/>
-      <field name='length' type='int' info=' unused'/>
-      <field name='line' type='int' info=' Current line'/>
-      <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=' unused'/>
-      <field name='version' type='const xmlChar *' info=' the version string for entity'/>
-      <field name='flags' type='int' info=' Flags'/>
-      <field name='id' type='int' info=' an unique identifier for the entity'/>
-      <field name='parentConsumed' type='unsigned long' info=' unused'/>
-      <field name='entity' type='xmlEntityPtr' info=' entity, if any'/>
+      <field name='buf' type='xmlParserInputBufferPtr'/>
+      <field name='filename' type='const char *'/>
+      <field name='directory' type='const char *'/>
+      <field name='base' type='const xmlChar *'/>
+      <field name='cur' type='const xmlChar *'/>
+      <field name='end' type='const xmlChar *'/>
+      <field name='length' type='int'/>
+      <field name='line' type='int'/>
+      <field name='col' type='int'/>
+      <field name='consumed' type='unsigned long'/>
+      <field name='free' type='xmlParserInputDeallocate'/>
+      <field name='encoding' type='const xmlChar *'/>
+      <field name='version' type='const xmlChar *'/>
+      <field name='flags' type='int'/>
+      <field name='id' type='int'/>
+      <field name='parentConsumed' type='unsigned long'/>
+      <field name='entity' type='xmlEntityPtr'/>
     </struct>
     <struct name='xmlParserInputBuffer' file='tree' type='struct _xmlParserInputBuffer'>
-      <field name='context' type='void *' info=''/>
-      <field name='readcallback' type='xmlInputReadCallback' info=''/>
-      <field name='closecallback' type='xmlInputCloseCallback' info=''/>
-      <field name='encoder' type='xmlCharEncodingHandlerPtr' info=' I18N conversions to UTF-8'/>
-      <field name='buffer' type='xmlBufPtr' info=' Local buffer encoded in UTF-8'/>
-      <field name='raw' type='xmlBufPtr' info=' if encoder != NULL buffer for raw input'/>
-      <field name='compressed' type='int' info=' -1=unknown, 0=not compressed, 1=compressed'/>
-      <field name='error' type='int' info=''/>
-      <field name='rawconsumed' type='unsigned long' info=' amount consumed from raw'/>
+      <field name='context' type='void *'/>
+      <field name='readcallback' type='xmlInputReadCallback'/>
+      <field name='closecallback' type='xmlInputCloseCallback'/>
+      <field name='encoder' type='xmlCharEncodingHandlerPtr'/>
+      <field name='buffer' type='xmlBufPtr'/>
+      <field name='raw' type='xmlBufPtr'/>
+      <field name='compressed' type='int'/>
+      <field name='error' type='int'/>
+      <field name='rawconsumed' type='unsigned long'/>
     </struct>
     <typedef name='xmlParserInputBufferPtr' file='tree' type='xmlParserInputBuffer *'/>
+    <typedef name='xmlParserInputFlags' file='parser' type='enum'/>
     <typedef name='xmlParserInputPtr' file='tree' type='xmlParserInput *'/>
     <typedef name='xmlParserInputState' file='parser' type='enum'/>
     <typedef name='xmlParserMode' file='parser' type='enum'/>
     <struct name='xmlParserNodeInfo' file='parser' type='struct _xmlParserNodeInfo'>
-      <field name='node' type='const struct _xmlNode *' info=' Position &amp; line # that text that created the node begins &amp; ends on'/>
-      <field name='begin_pos' type='unsigned long' info=''/>
-      <field name='begin_line' type='unsigned long' info=''/>
-      <field name='end_pos' type='unsigned long' info=''/>
-      <field name='end_line' type='unsigned long' info=''/>
+      <field name='node' type='const struct _xmlNode *'/>
+      <field name='begin_pos' type='unsigned long'/>
+      <field name='begin_line' type='unsigned long'/>
+      <field name='end_pos' type='unsigned long'/>
+      <field name='end_line' type='unsigned long'/>
     </struct>
     <typedef name='xmlParserNodeInfoPtr' file='parser' type='xmlParserNodeInfo *'/>
     <struct name='xmlParserNodeInfoSeq' file='parser' type='struct _xmlParserNodeInfoSeq'>
-      <field name='maximum' type='unsigned long' info=''/>
-      <field name='length' type='unsigned long' info=''/>
-      <field name='buffer' type='xmlParserNodeInfo *' info=''/>
+      <field name='maximum' type='unsigned long'/>
+      <field name='length' type='unsigned long'/>
+      <field name='buffer' type='xmlParserNodeInfo *'/>
     </struct>
     <typedef name='xmlParserNodeInfoSeqPtr' file='parser' type='xmlParserNodeInfoSeq *'/>
     <struct name='xmlParserNsData' file='parser' type='struct _xmlParserNsData'/>
     <typedef name='xmlParserOption' file='parser' type='enum'/>
     <typedef name='xmlParserProperties' file='xmlreader' type='enum'/>
     <typedef name='xmlParserSeverities' file='xmlreader' type='enum'/>
+    <typedef name='xmlParserStatus' file='parser' type='enum'/>
     <struct name='xmlPattern' file='pattern' type='struct _xmlPattern'/>
     <typedef name='xmlPatternFlags' file='pattern' type='enum'/>
     <typedef name='xmlPatternPtr' file='pattern' type='xmlPattern *'/>
@@ -6405,11 +6115,11 @@
     <typedef name='xmlRMutexPtr' file='threads' type='xmlRMutex *'/>
     <typedef name='xmlReaderTypes' file='xmlreader' type='enum'/>
     <struct name='xmlRef' file='tree' type='struct _xmlRef'>
-      <field name='next' type='struct _xmlRef *' info=' next Ref'/>
-      <field name='value' type='const xmlChar *' info=' The Ref name'/>
-      <field name='attr' type='xmlAttrPtr' info=' The attribute holding it'/>
-      <field name='name' type='const xmlChar *' info=' The attribute if attr is not available'/>
-      <field name='lineno' type='int' info=' The line number if attr is not available'/>
+      <field name='next' type='struct _xmlRef *'/>
+      <field name='value' type='const xmlChar *'/>
+      <field name='attr' type='xmlAttrPtr'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='lineno' type='int'/>
     </struct>
     <typedef name='xmlRefPtr' file='tree' type='xmlRef *'/>
     <struct name='xmlRefTable' file='valid' type='struct _xmlHashTable'/>
@@ -6430,224 +6140,210 @@
     <struct name='xmlRelaxNGValidCtxt' file='relaxng' type='struct _xmlRelaxNGValidCtxt'/>
     <typedef name='xmlRelaxNGValidCtxtPtr' file='relaxng' type='xmlRelaxNGValidCtxt *'/>
     <typedef name='xmlRelaxNGValidErr' file='relaxng' type='enum'/>
+    <typedef name='xmlResourceType' file='parser' type='enum'/>
     <struct name='xmlSAXHandler' file='tree' type='struct _xmlSAXHandler'>
-      <field name='internalSubset' type='internalSubsetSAXFunc' info=''/>
-      <field name='isStandalone' type='isStandaloneSAXFunc' info=''/>
-      <field name='hasInternalSubset' type='hasInternalSubsetSAXFunc' info=''/>
-      <field name='hasExternalSubset' type='hasExternalSubsetSAXFunc' info=''/>
-      <field name='resolveEntity' type='resolveEntitySAXFunc' info=''/>
-      <field name='getEntity' type='getEntitySAXFunc' info=''/>
-      <field name='entityDecl' type='entityDeclSAXFunc' info=''/>
-      <field name='notationDecl' type='notationDeclSAXFunc' info=''/>
-      <field name='attributeDecl' type='attributeDeclSAXFunc' info=''/>
-      <field name='elementDecl' type='elementDeclSAXFunc' info=''/>
-      <field name='unparsedEntityDecl' type='unparsedEntityDeclSAXFunc' info=''/>
-      <field name='setDocumentLocator' type='setDocumentLocatorSAXFunc' info=''/>
-      <field name='startDocument' type='startDocumentSAXFunc' info=''/>
-      <field name='endDocument' type='endDocumentSAXFunc' info='* `startElement` and `endElement` are only used by the legacy SAX1
-* interface and should not be used in new software. If you really
-* have to enable SAX1, the preferred way is set the `initialized`
-* member to 1 instead of XML_SAX2_MAGIC.
-*
-* For backward compatibility, it&apos;s also possible to set the
-* `startElementNs` and `endElementNs` handlers to NULL.
-*
-* You can also set the XML_PARSE_SAX1 parser option, but versions
-* older than 2.12.0 will probably crash if this option is provided
-* together with custom SAX callbacks.
-*'/>
-      <field name='startElement' type='startElementSAXFunc' info=''/>
-      <field name='endElement' type='endElementSAXFunc' info=''/>
-      <field name='reference' type='referenceSAXFunc' info=''/>
-      <field name='characters' type='charactersSAXFunc' info=''/>
-      <field name='ignorableWhitespace' type='ignorableWhitespaceSAXFunc' info=''/>
-      <field name='processingInstruction' type='processingInstructionSAXFunc' info=''/>
-      <field name='comment' type='commentSAXFunc' info=''/>
-      <field name='warning' type='warningSAXFunc' info=''/>
-      <field name='error' type='errorSAXFunc' info=''/>
-      <field name='fatalError' type='fatalErrorSAXFunc' info=' unused error() get all the errors'/>
-      <field name='getParameterEntity' type='getParameterEntitySAXFunc' info=''/>
-      <field name='cdataBlock' type='cdataBlockSAXFunc' info=''/>
-      <field name='externalSubset' type='externalSubsetSAXFunc' info='* `initialized` should always be set to XML_SAX2_MAGIC to enable the
-* modern SAX2 interface.
-*'/>
-      <field name='initialized' type='unsigned int' info='* The following members are only used by the SAX2 interface.
-*'/>
-      <field name='_private' type='void *' info=''/>
-      <field name='startElementNs' type='startElementNsSAX2Func' info=''/>
-      <field name='endElementNs' type='endElementNsSAX2Func' info=''/>
-      <field name='serror' type='xmlStructuredErrorFunc' info=''/>
+      <field name='internalSubset' type='internalSubsetSAXFunc'/>
+      <field name='isStandalone' type='isStandaloneSAXFunc'/>
+      <field name='hasInternalSubset' type='hasInternalSubsetSAXFunc'/>
+      <field name='hasExternalSubset' type='hasExternalSubsetSAXFunc'/>
+      <field name='resolveEntity' type='resolveEntitySAXFunc'/>
+      <field name='getEntity' type='getEntitySAXFunc'/>
+      <field name='entityDecl' type='entityDeclSAXFunc'/>
+      <field name='notationDecl' type='notationDeclSAXFunc'/>
+      <field name='attributeDecl' type='attributeDeclSAXFunc'/>
+      <field name='elementDecl' type='elementDeclSAXFunc'/>
+      <field name='unparsedEntityDecl' type='unparsedEntityDeclSAXFunc'/>
+      <field name='setDocumentLocator' type='setDocumentLocatorSAXFunc'/>
+      <field name='startDocument' type='startDocumentSAXFunc'/>
+      <field name='endDocument' type='endDocumentSAXFunc'/>
+      <field name='startElement' type='startElementSAXFunc'/>
+      <field name='endElement' type='endElementSAXFunc'/>
+      <field name='reference' type='referenceSAXFunc'/>
+      <field name='characters' type='charactersSAXFunc'/>
+      <field name='ignorableWhitespace' type='ignorableWhitespaceSAXFunc'/>
+      <field name='processingInstruction' type='processingInstructionSAXFunc'/>
+      <field name='comment' type='commentSAXFunc'/>
+      <field name='warning' type='warningSAXFunc'/>
+      <field name='error' type='errorSAXFunc'/>
+      <field name='fatalError' type='fatalErrorSAXFunc'/>
+      <field name='getParameterEntity' type='getParameterEntitySAXFunc'/>
+      <field name='cdataBlock' type='cdataBlockSAXFunc'/>
+      <field name='externalSubset' type='externalSubsetSAXFunc'/>
+      <field name='initialized' type='unsigned int'/>
+      <field name='_private' type='void *'/>
+      <field name='startElementNs' type='startElementNsSAX2Func'/>
+      <field name='endElementNs' type='endElementNsSAX2Func'/>
+      <field name='serror' type='xmlStructuredErrorFunc'/>
     </struct>
     <typedef name='xmlSAXHandlerPtr' file='tree' type='xmlSAXHandler *'/>
     <struct name='xmlSAXHandlerV1' file='parser' type='struct _xmlSAXHandlerV1'>
-      <field name='internalSubset' type='internalSubsetSAXFunc' info=''/>
-      <field name='isStandalone' type='isStandaloneSAXFunc' info=''/>
-      <field name='hasInternalSubset' type='hasInternalSubsetSAXFunc' info=''/>
-      <field name='hasExternalSubset' type='hasExternalSubsetSAXFunc' info=''/>
-      <field name='resolveEntity' type='resolveEntitySAXFunc' info=''/>
-      <field name='getEntity' type='getEntitySAXFunc' info=''/>
-      <field name='entityDecl' type='entityDeclSAXFunc' info=''/>
-      <field name='notationDecl' type='notationDeclSAXFunc' info=''/>
-      <field name='attributeDecl' type='attributeDeclSAXFunc' info=''/>
-      <field name='elementDecl' type='elementDeclSAXFunc' info=''/>
-      <field name='unparsedEntityDecl' type='unparsedEntityDeclSAXFunc' info=''/>
-      <field name='setDocumentLocator' type='setDocumentLocatorSAXFunc' info=''/>
-      <field name='startDocument' type='startDocumentSAXFunc' info=''/>
-      <field name='endDocument' type='endDocumentSAXFunc' info=''/>
-      <field name='startElement' type='startElementSAXFunc' info=''/>
-      <field name='endElement' type='endElementSAXFunc' info=''/>
-      <field name='reference' type='referenceSAXFunc' info=''/>
-      <field name='characters' type='charactersSAXFunc' info=''/>
-      <field name='ignorableWhitespace' type='ignorableWhitespaceSAXFunc' info=''/>
-      <field name='processingInstruction' type='processingInstructionSAXFunc' info=''/>
-      <field name='comment' type='commentSAXFunc' info=''/>
-      <field name='warning' type='warningSAXFunc' info=''/>
-      <field name='error' type='errorSAXFunc' info=''/>
-      <field name='fatalError' type='fatalErrorSAXFunc' info=' unused error() get all the errors'/>
-      <field name='getParameterEntity' type='getParameterEntitySAXFunc' info=''/>
-      <field name='cdataBlock' type='cdataBlockSAXFunc' info=''/>
-      <field name='externalSubset' type='externalSubsetSAXFunc' info=''/>
-      <field name='initialized' type='unsigned int' info=''/>
+      <field name='internalSubset' type='internalSubsetSAXFunc'/>
+      <field name='isStandalone' type='isStandaloneSAXFunc'/>
+      <field name='hasInternalSubset' type='hasInternalSubsetSAXFunc'/>
+      <field name='hasExternalSubset' type='hasExternalSubsetSAXFunc'/>
+      <field name='resolveEntity' type='resolveEntitySAXFunc'/>
+      <field name='getEntity' type='getEntitySAXFunc'/>
+      <field name='entityDecl' type='entityDeclSAXFunc'/>
+      <field name='notationDecl' type='notationDeclSAXFunc'/>
+      <field name='attributeDecl' type='attributeDeclSAXFunc'/>
+      <field name='elementDecl' type='elementDeclSAXFunc'/>
+      <field name='unparsedEntityDecl' type='unparsedEntityDeclSAXFunc'/>
+      <field name='setDocumentLocator' type='setDocumentLocatorSAXFunc'/>
+      <field name='startDocument' type='startDocumentSAXFunc'/>
+      <field name='endDocument' type='endDocumentSAXFunc'/>
+      <field name='startElement' type='startElementSAXFunc'/>
+      <field name='endElement' type='endElementSAXFunc'/>
+      <field name='reference' type='referenceSAXFunc'/>
+      <field name='characters' type='charactersSAXFunc'/>
+      <field name='ignorableWhitespace' type='ignorableWhitespaceSAXFunc'/>
+      <field name='processingInstruction' type='processingInstructionSAXFunc'/>
+      <field name='comment' type='commentSAXFunc'/>
+      <field name='warning' type='warningSAXFunc'/>
+      <field name='error' type='errorSAXFunc'/>
+      <field name='fatalError' type='fatalErrorSAXFunc'/>
+      <field name='getParameterEntity' type='getParameterEntitySAXFunc'/>
+      <field name='cdataBlock' type='cdataBlockSAXFunc'/>
+      <field name='externalSubset' type='externalSubsetSAXFunc'/>
+      <field name='initialized' type='unsigned int'/>
     </struct>
     <typedef name='xmlSAXHandlerV1Ptr' file='parser' type='xmlSAXHandlerV1 *'/>
     <struct name='xmlSAXLocator' file='tree' type='struct _xmlSAXLocator'>
-      <field name='getPublicId' type='const xmlChar *(*getPublicId)' info=''/>
-      <field name='getSystemId' type='const xmlChar *(*getSystemId)' info=''/>
-      <field name='getLineNumber' type='int(*getLineNumber)' info=''/>
-      <field name='getColumnNumber' type='int(*getColumnNumber)' info=''/>
+      <field name='getPublicId' type='const xmlChar *(*getPublicId)'/>
+      <field name='getSystemId' type='const xmlChar *(*getSystemId)'/>
+      <field name='getLineNumber' type='int(*getLineNumber)'/>
+      <field name='getColumnNumber' type='int(*getColumnNumber)'/>
     </struct>
     <typedef name='xmlSAXLocatorPtr' file='tree' type='xmlSAXLocator *'/>
     <struct name='xmlSaveCtxt' file='xmlsave' type='struct _xmlSaveCtxt'/>
     <typedef name='xmlSaveCtxtPtr' file='xmlsave' type='xmlSaveCtxt *'/>
     <typedef name='xmlSaveOption' file='xmlsave' type='enum'/>
     <struct name='xmlSchema' file='xmlschemas' type='struct _xmlSchema'>
-      <field name='name' type='const xmlChar *' info=' schema name'/>
-      <field name='targetNamespace' type='const xmlChar *' info=' the target namespace'/>
-      <field name='version' type='const xmlChar *' info=''/>
-      <field name='id' type='const xmlChar *' info=' Obsolete'/>
-      <field name='doc' type='xmlDocPtr' info=''/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='flags' type='int' info=''/>
-      <field name='typeDecl' type='xmlHashTablePtr' info=''/>
-      <field name='attrDecl' type='xmlHashTablePtr' info=''/>
-      <field name='attrgrpDecl' type='xmlHashTablePtr' info=''/>
-      <field name='elemDecl' type='xmlHashTablePtr' info=''/>
-      <field name='notaDecl' type='xmlHashTablePtr' info=''/>
-      <field name='schemasImports' type='xmlHashTablePtr' info=''/>
-      <field name='_private' type='void *' info=' unused by the library for users or bindings'/>
-      <field name='groupDecl' type='xmlHashTablePtr' info=''/>
-      <field name='dict' type='xmlDictPtr' info=''/>
-      <field name='includes' type='void *' info=' the includes, this is opaque for now'/>
-      <field name='preserve' type='int' info=' whether to free the document'/>
-      <field name='counter' type='int' info=' used to give anonymous components unique names'/>
-      <field name='idcDef' type='xmlHashTablePtr' info=' All identity-constraint defs.'/>
-      <field name='volatiles' type='void *' info=' Obsolete'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='targetNamespace' type='const xmlChar *'/>
+      <field name='version' type='const xmlChar *'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='doc' type='xmlDocPtr'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='flags' type='int'/>
+      <field name='typeDecl' type='xmlHashTablePtr'/>
+      <field name='attrDecl' type='xmlHashTablePtr'/>
+      <field name='attrgrpDecl' type='xmlHashTablePtr'/>
+      <field name='elemDecl' type='xmlHashTablePtr'/>
+      <field name='notaDecl' type='xmlHashTablePtr'/>
+      <field name='schemasImports' type='xmlHashTablePtr'/>
+      <field name='_private' type='void *'/>
+      <field name='groupDecl' type='xmlHashTablePtr'/>
+      <field name='dict' type='xmlDictPtr'/>
+      <field name='includes' type='void *'/>
+      <field name='preserve' type='int'/>
+      <field name='counter' type='int'/>
+      <field name='idcDef' type='xmlHashTablePtr'/>
+      <field name='volatiles' type='void *'/>
     </struct>
     <struct name='xmlSchemaAnnot' file='schemasInternals' type='struct _xmlSchemaAnnot'>
-      <field name='next' type='struct _xmlSchemaAnnot *' info=''/>
-      <field name='content' type='xmlNodePtr' info=' the annotation'/>
+      <field name='next' type='struct _xmlSchemaAnnot *'/>
+      <field name='content' type='xmlNodePtr'/>
     </struct>
     <typedef name='xmlSchemaAnnotPtr' file='schemasInternals' type='xmlSchemaAnnot *'/>
     <struct name='xmlSchemaAttribute' file='schemasInternals' type='struct _xmlSchemaAttribute'>
-      <field name='type' type='xmlSchemaTypeType' info=''/>
-      <field name='next' type='struct _xmlSchemaAttribute *' info=' the next attribute (not used?)'/>
-      <field name='name' type='const xmlChar *' info=' the name of the declaration'/>
-      <field name='id' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='ref' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='refNs' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='typeName' type='const xmlChar *' info=' the local name of the type definition'/>
-      <field name='typeNs' type='const xmlChar *' info=' the ns URI of the type definition'/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='base' type='xmlSchemaTypePtr' info=' Deprecated; not used'/>
-      <field name='occurs' type='int' info=' Deprecated; not used'/>
-      <field name='defValue' type='const xmlChar *' info=' The initial value of the value constraint'/>
-      <field name='subtypes' type='xmlSchemaTypePtr' info=' the type definition'/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='targetNamespace' type='const xmlChar *' info=''/>
-      <field name='flags' type='int' info=''/>
-      <field name='refPrefix' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='defVal' type='xmlSchemaValPtr' info=' The compiled value constraint'/>
-      <field name='refDecl' type='xmlSchemaAttributePtr' info=' Deprecated; not used'/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='next' type='struct _xmlSchemaAttribute *'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='ref' type='const xmlChar *'/>
+      <field name='refNs' type='const xmlChar *'/>
+      <field name='typeName' type='const xmlChar *'/>
+      <field name='typeNs' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='base' type='xmlSchemaTypePtr'/>
+      <field name='occurs' type='int'/>
+      <field name='defValue' type='const xmlChar *'/>
+      <field name='subtypes' type='xmlSchemaTypePtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='targetNamespace' type='const xmlChar *'/>
+      <field name='flags' type='int'/>
+      <field name='refPrefix' type='const xmlChar *'/>
+      <field name='defVal' type='xmlSchemaValPtr'/>
+      <field name='refDecl' type='xmlSchemaAttributePtr'/>
     </struct>
     <struct name='xmlSchemaAttributeGroup' file='schemasInternals' type='struct _xmlSchemaAttributeGroup'>
-      <field name='type' type='xmlSchemaTypeType' info=' The kind of type'/>
-      <field name='next' type='struct _xmlSchemaAttribute *' info=' the next attribute if in a group ...'/>
-      <field name='name' type='const xmlChar *' info=''/>
-      <field name='id' type='const xmlChar *' info=''/>
-      <field name='ref' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='refNs' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='attributes' type='xmlSchemaAttributePtr' info=' Deprecated; not used'/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='flags' type='int' info=''/>
-      <field name='attributeWildcard' type='xmlSchemaWildcardPtr' info=''/>
-      <field name='refPrefix' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='refItem' type='xmlSchemaAttributeGroupPtr' info=' Deprecated; not used'/>
-      <field name='targetNamespace' type='const xmlChar *' info=''/>
-      <field name='attrUses' type='void *' info=''/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='next' type='struct _xmlSchemaAttribute *'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='ref' type='const xmlChar *'/>
+      <field name='refNs' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='attributes' type='xmlSchemaAttributePtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='flags' type='int'/>
+      <field name='attributeWildcard' type='xmlSchemaWildcardPtr'/>
+      <field name='refPrefix' type='const xmlChar *'/>
+      <field name='refItem' type='xmlSchemaAttributeGroupPtr'/>
+      <field name='targetNamespace' type='const xmlChar *'/>
+      <field name='attrUses' type='void *'/>
     </struct>
     <typedef name='xmlSchemaAttributeGroupPtr' file='schemasInternals' type='xmlSchemaAttributeGroup *'/>
     <struct name='xmlSchemaAttributeLink' file='schemasInternals' type='struct _xmlSchemaAttributeLink'>
-      <field name='next' type='struct _xmlSchemaAttributeLink *' info=' the next attribute link ...'/>
-      <field name='attr' type='struct _xmlSchemaAttribute *' info=' the linked attribute'/>
+      <field name='next' type='struct _xmlSchemaAttributeLink *'/>
+      <field name='attr' type='struct _xmlSchemaAttribute *'/>
     </struct>
     <typedef name='xmlSchemaAttributeLinkPtr' file='schemasInternals' type='xmlSchemaAttributeLink *'/>
     <typedef name='xmlSchemaAttributePtr' file='schemasInternals' type='xmlSchemaAttribute *'/>
     <typedef name='xmlSchemaContentType' file='schemasInternals' type='enum'/>
     <struct name='xmlSchemaElement' file='schemasInternals' type='struct _xmlSchemaElement'>
-      <field name='type' type='xmlSchemaTypeType' info=' The kind of type'/>
-      <field name='next' type='struct _xmlSchemaType *' info=' Not used?'/>
-      <field name='name' type='const xmlChar *' info=''/>
-      <field name='id' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='ref' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='refNs' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='subtypes' type='xmlSchemaTypePtr' info=' the type definition'/>
-      <field name='attributes' type='xmlSchemaAttributePtr' info=''/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='minOccurs' type='int' info=' Deprecated; not used'/>
-      <field name='maxOccurs' type='int' info=' Deprecated; not used'/>
-      <field name='flags' type='int' info=''/>
-      <field name='targetNamespace' type='const xmlChar *' info=''/>
-      <field name='namedType' type='const xmlChar *' info=''/>
-      <field name='namedTypeNs' type='const xmlChar *' info=''/>
-      <field name='substGroup' type='const xmlChar *' info=''/>
-      <field name='substGroupNs' type='const xmlChar *' info=''/>
-      <field name='scope' type='const xmlChar *' info=''/>
-      <field name='value' type='const xmlChar *' info=' The original value of the value constraint.'/>
-      <field name='refDecl' type='struct _xmlSchemaElement *' info=' This will now be used for the
-substitution group affiliation'/>
-      <field name='contModel' type='xmlRegexpPtr' info=' Obsolete for WXS, maybe used for RelaxNG'/>
-      <field name='contentType' type='xmlSchemaContentType' info=''/>
-      <field name='refPrefix' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='defVal' type='xmlSchemaValPtr' info=' The compiled value constraint.'/>
-      <field name='idcs' type='void *' info=' The identity-constraint defs'/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='next' type='struct _xmlSchemaType *'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='ref' type='const xmlChar *'/>
+      <field name='refNs' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='subtypes' type='xmlSchemaTypePtr'/>
+      <field name='attributes' type='xmlSchemaAttributePtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='minOccurs' type='int'/>
+      <field name='maxOccurs' type='int'/>
+      <field name='flags' type='int'/>
+      <field name='targetNamespace' type='const xmlChar *'/>
+      <field name='namedType' type='const xmlChar *'/>
+      <field name='namedTypeNs' type='const xmlChar *'/>
+      <field name='substGroup' type='const xmlChar *'/>
+      <field name='substGroupNs' type='const xmlChar *'/>
+      <field name='scope' type='const xmlChar *'/>
+      <field name='value' type='const xmlChar *'/>
+      <field name='refDecl' type='struct _xmlSchemaElement *'/>
+      <field name='contModel' type='xmlRegexpPtr'/>
+      <field name='contentType' type='xmlSchemaContentType'/>
+      <field name='refPrefix' type='const xmlChar *'/>
+      <field name='defVal' type='xmlSchemaValPtr'/>
+      <field name='idcs' type='void *'/>
     </struct>
     <typedef name='xmlSchemaElementPtr' file='schemasInternals' type='xmlSchemaElement *'/>
     <struct name='xmlSchemaFacet' file='schemasInternals' type='struct _xmlSchemaFacet'>
-      <field name='type' type='xmlSchemaTypeType' info=' The kind of type'/>
-      <field name='next' type='struct _xmlSchemaFacet *' info=' the next type if in a sequence ...'/>
-      <field name='value' type='const xmlChar *' info=' The original value'/>
-      <field name='id' type='const xmlChar *' info=' Obsolete'/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='fixed' type='int' info=' XML_SCHEMAS_FACET_PRESERVE, etc.'/>
-      <field name='whitespace' type='int' info=''/>
-      <field name='val' type='xmlSchemaValPtr' info=' The compiled value'/>
-      <field name='regexp' type='xmlRegexpPtr' info=' The regex for patterns'/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='next' type='struct _xmlSchemaFacet *'/>
+      <field name='value' type='const xmlChar *'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='fixed' type='int'/>
+      <field name='whitespace' type='int'/>
+      <field name='val' type='xmlSchemaValPtr'/>
+      <field name='regexp' type='xmlRegexpPtr'/>
     </struct>
     <struct name='xmlSchemaFacetLink' file='schemasInternals' type='struct _xmlSchemaFacetLink'>
-      <field name='next' type='struct _xmlSchemaFacetLink *' info=' the next facet link ...'/>
-      <field name='facet' type='xmlSchemaFacetPtr' info=' the linked facet'/>
+      <field name='next' type='struct _xmlSchemaFacetLink *'/>
+      <field name='facet' type='xmlSchemaFacetPtr'/>
     </struct>
     <typedef name='xmlSchemaFacetLinkPtr' file='schemasInternals' type='xmlSchemaFacetLink *'/>
     <typedef name='xmlSchemaFacetPtr' file='schemasInternals' type='xmlSchemaFacet *'/>
     <struct name='xmlSchemaNotation' file='schemasInternals' type='struct _xmlSchemaNotation'>
-      <field name='type' type='xmlSchemaTypeType' info=' The kind of type'/>
-      <field name='name' type='const xmlChar *' info=''/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='identifier' type='const xmlChar *' info=''/>
-      <field name='targetNamespace' type='const xmlChar *' info=''/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='identifier' type='const xmlChar *'/>
+      <field name='targetNamespace' type='const xmlChar *'/>
     </struct>
     <typedef name='xmlSchemaNotationPtr' file='schemasInternals' type='xmlSchemaNotation *'/>
     <struct name='xmlSchemaParserCtxt' file='xmlschemas' type='struct _xmlSchemaParserCtxt'/>
@@ -6656,41 +6352,40 @@
     <typedef name='xmlSchemaSAXPlugPtr' file='xmlschemas' type='xmlSchemaSAXPlugStruct *'/>
     <struct name='xmlSchemaSAXPlugStruct' file='xmlschemas' type='struct _xmlSchemaSAXPlug'/>
     <struct name='xmlSchemaType' file='schemasInternals' type='struct _xmlSchemaType'>
-      <field name='type' type='xmlSchemaTypeType' info=' The kind of type'/>
-      <field name='next' type='struct _xmlSchemaType *' info=' the next type if in a sequence ...'/>
-      <field name='name' type='const xmlChar *' info=''/>
-      <field name='id' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='ref' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='refNs' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='subtypes' type='xmlSchemaTypePtr' info=''/>
-      <field name='attributes' type='xmlSchemaAttributePtr' info=' Deprecated; not used'/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='minOccurs' type='int' info=' Deprecated; not used'/>
-      <field name='maxOccurs' type='int' info=' Deprecated; not used'/>
-      <field name='flags' type='int' info=''/>
-      <field name='contentType' type='xmlSchemaContentType' info=''/>
-      <field name='base' type='const xmlChar *' info=' Base type&apos;s local name'/>
-      <field name='baseNs' type='const xmlChar *' info=' Base type&apos;s target namespace'/>
-      <field name='baseType' type='xmlSchemaTypePtr' info=' The base type component'/>
-      <field name='facets' type='xmlSchemaFacetPtr' info=' Local facets'/>
-      <field name='redef' type='struct _xmlSchemaType *' info=' Deprecated; not used'/>
-      <field name='recurse' type='int' info=' Obsolete'/>
-      <field name='attributeUses' type='xmlSchemaAttributeLinkPtr *' info=' Deprecated; not used'/>
-      <field name='attributeWildcard' type='xmlSchemaWildcardPtr' info=''/>
-      <field name='builtInType' type='int' info=' Type of built-in types.'/>
-      <field name='memberTypes' type='xmlSchemaTypeLinkPtr' info=' member-types if a union type.'/>
-      <field name='facetSet' type='xmlSchemaFacetLinkPtr' info=' All facets (incl. inherited)'/>
-      <field name='refPrefix' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='contentTypeDef' type='xmlSchemaTypePtr' info=' Used for the simple content of complex types.
-Could we use @subtypes for this?'/>
-      <field name='contModel' type='xmlRegexpPtr' info=' Holds the automaton of the content model'/>
-      <field name='targetNamespace' type='const xmlChar *' info=''/>
-      <field name='attrUses' type='void *' info=''/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='next' type='struct _xmlSchemaType *'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='ref' type='const xmlChar *'/>
+      <field name='refNs' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='subtypes' type='xmlSchemaTypePtr'/>
+      <field name='attributes' type='xmlSchemaAttributePtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='minOccurs' type='int'/>
+      <field name='maxOccurs' type='int'/>
+      <field name='flags' type='int'/>
+      <field name='contentType' type='xmlSchemaContentType'/>
+      <field name='base' type='const xmlChar *'/>
+      <field name='baseNs' type='const xmlChar *'/>
+      <field name='baseType' type='xmlSchemaTypePtr'/>
+      <field name='facets' type='xmlSchemaFacetPtr'/>
+      <field name='redef' type='struct _xmlSchemaType *'/>
+      <field name='recurse' type='int'/>
+      <field name='attributeUses' type='xmlSchemaAttributeLinkPtr *'/>
+      <field name='attributeWildcard' type='xmlSchemaWildcardPtr'/>
+      <field name='builtInType' type='int'/>
+      <field name='memberTypes' type='xmlSchemaTypeLinkPtr'/>
+      <field name='facetSet' type='xmlSchemaFacetLinkPtr'/>
+      <field name='refPrefix' type='const xmlChar *'/>
+      <field name='contentTypeDef' type='xmlSchemaTypePtr'/>
+      <field name='contModel' type='xmlRegexpPtr'/>
+      <field name='targetNamespace' type='const xmlChar *'/>
+      <field name='attrUses' type='void *'/>
     </struct>
     <struct name='xmlSchemaTypeLink' file='schemasInternals' type='struct _xmlSchemaTypeLink'>
-      <field name='next' type='struct _xmlSchemaTypeLink *' info=' the next type link ...'/>
-      <field name='type' type='xmlSchemaTypePtr' info=' the linked type'/>
+      <field name='next' type='struct _xmlSchemaTypeLink *'/>
+      <field name='type' type='xmlSchemaTypePtr'/>
     </struct>
     <typedef name='xmlSchemaTypeLinkPtr' file='schemasInternals' type='xmlSchemaTypeLink *'/>
     <typedef name='xmlSchemaTypePtr' file='schemasInternals' type='xmlSchemaType *'/>
@@ -6704,21 +6399,21 @@
     <typedef name='xmlSchemaValidOption' file='xmlschemas' type='enum'/>
     <typedef name='xmlSchemaWhitespaceValueType' file='xmlschemastypes' type='enum'/>
     <struct name='xmlSchemaWildcard' file='schemasInternals' type='struct _xmlSchemaWildcard'>
-      <field name='type' type='xmlSchemaTypeType' info=' The kind of type'/>
-      <field name='id' type='const xmlChar *' info=' Deprecated; not used'/>
-      <field name='annot' type='xmlSchemaAnnotPtr' info=''/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='minOccurs' type='int' info=' Deprecated; not used'/>
-      <field name='maxOccurs' type='int' info=' Deprecated; not used'/>
-      <field name='processContents' type='int' info=''/>
-      <field name='any' type='int' info=' Indicates if the ns constraint is of ##any'/>
-      <field name='nsSet' type='xmlSchemaWildcardNsPtr' info=' The list of allowed namespaces'/>
-      <field name='negNsSet' type='xmlSchemaWildcardNsPtr' info=' The negated namespace'/>
-      <field name='flags' type='int' info=''/>
+      <field name='type' type='xmlSchemaTypeType'/>
+      <field name='id' type='const xmlChar *'/>
+      <field name='annot' type='xmlSchemaAnnotPtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='minOccurs' type='int'/>
+      <field name='maxOccurs' type='int'/>
+      <field name='processContents' type='int'/>
+      <field name='any' type='int'/>
+      <field name='nsSet' type='xmlSchemaWildcardNsPtr'/>
+      <field name='negNsSet' type='xmlSchemaWildcardNsPtr'/>
+      <field name='flags' type='int'/>
     </struct>
     <struct name='xmlSchemaWildcardNs' file='schemasInternals' type='struct _xmlSchemaWildcardNs'>
-      <field name='next' type='struct _xmlSchemaWildcardNs *' info=' the next constraint link ...'/>
-      <field name='value' type='const xmlChar *' info=' the value'/>
+      <field name='next' type='struct _xmlSchemaWildcardNs *'/>
+      <field name='value' type='const xmlChar *'/>
     </struct>
     <typedef name='xmlSchemaWildcardNsPtr' file='schemasInternals' type='xmlSchemaWildcardNs *'/>
     <typedef name='xmlSchemaWildcardPtr' file='schemasInternals' type='xmlSchemaWildcard *'/>
@@ -6729,16 +6424,6 @@
     <struct name='xmlSchematronValidCtxt' file='schematron' type='struct _xmlSchematronValidCtxt'/>
     <typedef name='xmlSchematronValidCtxtPtr' file='schematron' type='xmlSchematronValidCtxt *'/>
     <typedef name='xmlSchematronValidOptions' file='schematron' type='enum'/>
-    <struct name='xmlShellCtxt' file='debugXML' type='struct _xmlShellCtxt'>
-      <field name='filename' type='char *' info=''/>
-      <field name='doc' type='xmlDocPtr' info=''/>
-      <field name='node' type='xmlNodePtr' info=''/>
-      <field name='pctxt' type='xmlXPathContextPtr' info=''/>
-      <field name='loaded' type='int' info=''/>
-      <field name='output' type='FILE *' info=''/>
-      <field name='input' type='xmlShellReadlineFunc' info=''/>
-    </struct>
-    <typedef name='xmlShellCtxtPtr' file='debugXML' type='xmlShellCtxt *'/>
     <struct name='xmlStartTag' file='parser' type='struct _xmlStartTag'/>
     <struct name='xmlStreamCtxt' file='pattern' type='struct _xmlStreamCtxt'/>
     <typedef name='xmlStreamCtxtPtr' file='pattern' type='xmlStreamCtxt *'/>
@@ -6751,38 +6436,38 @@
     <struct name='xmlTextWriter' file='xmlwriter' type='struct _xmlTextWriter'/>
     <typedef name='xmlTextWriterPtr' file='xmlwriter' type='xmlTextWriter *'/>
     <struct name='xmlURI' file='uri' type='struct _xmlURI'>
-      <field name='scheme' type='char *' info=' the URI scheme'/>
-      <field name='opaque' type='char *' info=' opaque part'/>
-      <field name='authority' type='char *' info=' the authority part'/>
-      <field name='server' type='char *' info=' the server part'/>
-      <field name='user' type='char *' info=' the user part'/>
-      <field name='port' type='int' info=' the port number'/>
-      <field name='path' type='char *' info=' the path string'/>
-      <field name='query' type='char *' info=' the query string (deprecated - use with caution)'/>
-      <field name='fragment' type='char *' info=' the fragment identifier'/>
-      <field name='cleanup' type='int' info=' parsing potentially unclean URI'/>
-      <field name='query_raw' type='char *' info=' the query string (as it appears in the URI)'/>
+      <field name='scheme' type='char *'/>
+      <field name='opaque' type='char *'/>
+      <field name='authority' type='char *'/>
+      <field name='server' type='char *'/>
+      <field name='user' type='char *'/>
+      <field name='port' type='int'/>
+      <field name='path' type='char *'/>
+      <field name='query' type='char *'/>
+      <field name='fragment' type='char *'/>
+      <field name='cleanup' type='int'/>
+      <field name='query_raw' type='char *'/>
     </struct>
     <typedef name='xmlURIPtr' file='uri' type='xmlURI *'/>
     <struct name='xmlValidCtxt' file='valid' type='struct _xmlValidCtxt'>
-      <field name='userData' type='void *' info=' user specific data block'/>
-      <field name='error' type='xmlValidityErrorFunc' info=' the callback in case of errors'/>
-      <field name='warning' type='xmlValidityWarningFunc' info=' the callback in case of warning Node analysis stack used when validating within entities'/>
-      <field name='node' type='xmlNodePtr' info=' Current parsed Node'/>
-      <field name='nodeNr' type='int' info=' Depth of the parsing stack'/>
-      <field name='nodeMax' type='int' info=' Max depth of the parsing stack'/>
-      <field name='nodeTab' type='xmlNodePtr *' info=' array of nodes'/>
-      <field name='flags' type='unsigned int' info=' internal flags'/>
-      <field name='doc' type='xmlDocPtr' info=' the document'/>
-      <field name='valid' type='int' info=' temporary validity check result state state used for non-determinist content validation'/>
-      <field name='vstate' type='xmlValidState *' info=' current state'/>
-      <field name='vstateNr' type='int' info=' Depth of the validation stack'/>
-      <field name='vstateMax' type='int' info=' Max depth of the validation stack'/>
-      <field name='vstateTab' type='xmlValidState *' info=' array of validation states'/>
-      <field name='am' type='xmlAutomataPtr' info=' the automata'/>
-      <field name='state' type='xmlAutomataStatePtr' info=' used to build the automata'/>
-      <field name='am' type='void *' info=''/>
-      <field name='state' type='void *' info=''/>
+      <field name='userData' type='void *'/>
+      <field name='error' type='xmlValidityErrorFunc'/>
+      <field name='warning' type='xmlValidityWarningFunc'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='nodeNr' type='int'/>
+      <field name='nodeMax' type='int'/>
+      <field name='nodeTab' type='xmlNodePtr *'/>
+      <field name='flags' type='unsigned int'/>
+      <field name='doc' type='xmlDocPtr'/>
+      <field name='valid' type='int'/>
+      <field name='vstate' type='xmlValidState *'/>
+      <field name='vstateNr' type='int'/>
+      <field name='vstateMax' type='int'/>
+      <field name='vstateTab' type='xmlValidState *'/>
+      <field name='am' type='xmlAutomataPtr'/>
+      <field name='state' type='xmlAutomataStatePtr'/>
+      <field name='am' type='void *'/>
+      <field name='state' type='void *'/>
     </struct>
     <typedef name='xmlValidCtxtPtr' file='valid' type='xmlValidCtxt *'/>
     <struct name='xmlValidState' file='valid' type='struct _xmlValidState'/>
@@ -6790,115 +6475,104 @@
     <struct name='xmlXIncludeCtxt' file='xinclude' type='struct _xmlXIncludeCtxt'/>
     <typedef name='xmlXIncludeCtxtPtr' file='xinclude' type='xmlXIncludeCtxt *'/>
     <struct name='xmlXPathAxis' file='xpath' type='struct _xmlXPathAxis'>
-      <field name='name' type='const xmlChar *' info=' the axis name'/>
-      <field name='func' type='xmlXPathAxisFunc' info=' the search function'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='func' type='xmlXPathAxisFunc'/>
     </struct>
     <typedef name='xmlXPathAxisPtr' file='xpath' type='xmlXPathAxis *'/>
     <struct name='xmlXPathCompExpr' file='xpath' type='struct _xmlXPathCompExpr'/>
     <typedef name='xmlXPathCompExprPtr' file='xpath' type='xmlXPathCompExpr *'/>
     <struct name='xmlXPathContext' file='xpath' type='struct _xmlXPathContext'>
-      <field name='doc' type='xmlDocPtr' info=' The current document'/>
-      <field name='node' type='xmlNodePtr' info=' The current node'/>
-      <field name='nb_variables_unused' type='int' info=' unused (hash table)'/>
-      <field name='max_variables_unused' type='int' info=' unused (hash table)'/>
-      <field name='varHash' type='xmlHashTablePtr' info=' Hash table of defined variables'/>
-      <field name='nb_types' type='int' info=' number of defined types'/>
-      <field name='max_types' type='int' info=' max number of types'/>
-      <field name='types' type='xmlXPathTypePtr' info=' Array of defined types'/>
-      <field name='nb_funcs_unused' type='int' info=' unused (hash table)'/>
-      <field name='max_funcs_unused' type='int' info=' unused (hash table)'/>
-      <field name='funcHash' type='xmlHashTablePtr' info=' Hash table of defined funcs'/>
-      <field name='nb_axis' type='int' info=' number of defined axis'/>
-      <field name='max_axis' type='int' info=' max number of axis'/>
-      <field name='axis' type='xmlXPathAxisPtr' info=' Array of defined axis the namespace nodes of the context node'/>
-      <field name='namespaces' type='xmlNsPtr *' info=' Array of namespaces'/>
-      <field name='nsNr' type='int' info=' number of namespace in scope'/>
-      <field name='user' type='void *' info=' function to free extra variables'/>
-      <field name='contextSize' type='int' info=' the context size'/>
-      <field name='proximityPosition' type='int' info=' the proximity position extra stuff for XPointer'/>
-      <field name='xptr' type='int' info=' is this an XPointer context?'/>
-      <field name='here' type='xmlNodePtr' info=' for here()'/>
-      <field name='origin' type='xmlNodePtr' info=' for origin() the set of namespace declarations in scope for the expression'/>
-      <field name='nsHash' type='xmlHashTablePtr' info=' The namespaces hash table'/>
-      <field name='varLookupFunc' type='xmlXPathVariableLookupFunc' info=' variable lookup func'/>
-      <field name='varLookupData' type='void *' info=' variable lookup data Possibility to link in an extra item'/>
-      <field name='extra' type='void *' info=' needed for XSLT The function name and URI when calling a function'/>
-      <field name='function' type='const xmlChar *' info=''/>
-      <field name='functionURI' type='const xmlChar *' info=' function lookup function and data'/>
-      <field name='funcLookupFunc' type='xmlXPathFuncLookupFunc' info=' function lookup func'/>
-      <field name='funcLookupData' type='void *' info=' function lookup data temporary namespace lists kept for walking the namespace axis'/>
-      <field name='tmpNsList' type='xmlNsPtr *' info=' Array of namespaces'/>
-      <field name='tmpNsNr' type='int' info=' number of namespaces in scope error reporting mechanism'/>
-      <field name='userData' type='void *' info=' user specific data block'/>
-      <field name='error' type='xmlStructuredErrorFunc' info=' the callback in case of errors'/>
-      <field name='lastError' type='xmlError' info=' the last error'/>
-      <field name='debugNode' type='xmlNodePtr' info=' the source node XSLT dictionary'/>
-      <field name='dict' type='xmlDictPtr' info=' dictionary if any'/>
-      <field name='flags' type='int' info=' flags to control compilation Cache for reusal of XPath objects'/>
-      <field name='cache' type='void *' info=' Resource limits'/>
-      <field name='opLimit' type='unsigned long' info=''/>
-      <field name='opCount' type='unsigned long' info=''/>
-      <field name='depth' type='int' info=''/>
+      <field name='doc' type='xmlDocPtr'/>
+      <field name='node' type='xmlNodePtr'/>
+      <field name='nb_variables_unused' type='int'/>
+      <field name='max_variables_unused' type='int'/>
+      <field name='varHash' type='xmlHashTablePtr'/>
+      <field name='nb_types' type='int'/>
+      <field name='max_types' type='int'/>
+      <field name='types' type='xmlXPathTypePtr'/>
+      <field name='nb_funcs_unused' type='int'/>
+      <field name='max_funcs_unused' type='int'/>
+      <field name='funcHash' type='xmlHashTablePtr'/>
+      <field name='nb_axis' type='int'/>
+      <field name='max_axis' type='int'/>
+      <field name='axis' type='xmlXPathAxisPtr'/>
+      <field name='namespaces' type='xmlNsPtr *'/>
+      <field name='nsNr' type='int'/>
+      <field name='user' type='void *'/>
+      <field name='contextSize' type='int'/>
+      <field name='proximityPosition' type='int'/>
+      <field name='xptr' type='int'/>
+      <field name='here' type='xmlNodePtr'/>
+      <field name='origin' type='xmlNodePtr'/>
+      <field name='nsHash' type='xmlHashTablePtr'/>
+      <field name='varLookupFunc' type='xmlXPathVariableLookupFunc'/>
+      <field name='varLookupData' type='void *'/>
+      <field name='extra' type='void *'/>
+      <field name='function' type='const xmlChar *'/>
+      <field name='functionURI' type='const xmlChar *'/>
+      <field name='funcLookupFunc' type='xmlXPathFuncLookupFunc'/>
+      <field name='funcLookupData' type='void *'/>
+      <field name='tmpNsList' type='xmlNsPtr *'/>
+      <field name='tmpNsNr' type='int'/>
+      <field name='userData' type='void *'/>
+      <field name='error' type='xmlStructuredErrorFunc'/>
+      <field name='lastError' type='xmlError'/>
+      <field name='debugNode' type='xmlNodePtr'/>
+      <field name='dict' type='xmlDictPtr'/>
+      <field name='flags' type='int'/>
+      <field name='cache' type='void *'/>
+      <field name='opLimit' type='unsigned long'/>
+      <field name='opCount' type='unsigned long'/>
+      <field name='depth' type='int'/>
     </struct>
     <typedef name='xmlXPathContextPtr' file='xpath' type='xmlXPathContext *'/>
     <typedef name='xmlXPathError' file='xpath' type='enum'/>
     <typedef name='xmlXPathFuncPtr' file='xpath' type='xmlXPathFunct *'/>
     <struct name='xmlXPathFunct' file='xpath' type='struct _xmlXPathFunct'>
-      <field name='name' type='const xmlChar *' info=' the function name'/>
-      <field name='func' type='xmlXPathEvalFunc' info=' the evaluation function'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='func' type='xmlXPathEvalFunc'/>
     </struct>
     <struct name='xmlXPathObject' file='xpath' type='struct _xmlXPathObject'>
-      <field name='type' type='xmlXPathObjectType' info=''/>
-      <field name='nodesetval' type='xmlNodeSetPtr' info=''/>
-      <field name='boolval' type='int' info=''/>
-      <field name='floatval' type='double' info=''/>
-      <field name='stringval' type='xmlChar *' info=''/>
-      <field name='user' type='void *' info=''/>
-      <field name='index' type='int' info=''/>
-      <field name='user2' type='void *' info=''/>
-      <field name='index2' type='int' info=''/>
+      <field name='type' type='xmlXPathObjectType'/>
+      <field name='nodesetval' type='xmlNodeSetPtr'/>
+      <field name='boolval' type='int'/>
+      <field name='floatval' type='double'/>
+      <field name='stringval' type='xmlChar *'/>
+      <field name='user' type='void *'/>
+      <field name='index' type='int'/>
+      <field name='user2' type='void *'/>
+      <field name='index2' type='int'/>
     </struct>
     <typedef name='xmlXPathObjectPtr' file='xpath' type='xmlXPathObject *'/>
     <typedef name='xmlXPathObjectType' file='xpath' type='enum'/>
     <struct name='xmlXPathParserContext' file='xpath' type='struct _xmlXPathParserContext'>
-      <field name='cur' type='const xmlChar *' info=' the current char being parsed'/>
-      <field name='base' type='const xmlChar *' info=' the full expression'/>
-      <field name='error' type='int' info=' error code'/>
-      <field name='context' type='xmlXPathContextPtr' info=' the evaluation context'/>
-      <field name='value' type='xmlXPathObjectPtr' info=' the current value'/>
-      <field name='valueNr' type='int' info=' number of values stacked'/>
-      <field name='valueMax' type='int' info=' max number of values stacked'/>
-      <field name='valueTab' type='xmlXPathObjectPtr *' info=' stack of values'/>
-      <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=' always zero for compatibility'/>
+      <field name='cur' type='const xmlChar *'/>
+      <field name='base' type='const xmlChar *'/>
+      <field name='error' type='int'/>
+      <field name='context' type='xmlXPathContextPtr'/>
+      <field name='value' type='xmlXPathObjectPtr'/>
+      <field name='valueNr' type='int'/>
+      <field name='valueMax' type='int'/>
+      <field name='valueTab' type='xmlXPathObjectPtr *'/>
+      <field name='comp' type='xmlXPathCompExprPtr'/>
+      <field name='xptr' type='int'/>
+      <field name='ancestor' type='xmlNodePtr'/>
+      <field name='valueFrame' type='int'/>
     </struct>
     <typedef name='xmlXPathParserContextPtr' file='xpath' type='xmlXPathParserContext *'/>
     <struct name='xmlXPathType' file='xpath' type='struct _xmlXPathType'>
-      <field name='name' type='const xmlChar *' info=' the type name'/>
-      <field name='func' type='xmlXPathConvertFunc' info=' the conversion function'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='func' type='xmlXPathConvertFunc'/>
     </struct>
     <typedef name='xmlXPathTypePtr' file='xpath' type='xmlXPathType *'/>
     <struct name='xmlXPathVariable' file='xpath' type='struct _xmlXPathVariable'>
-      <field name='name' type='const xmlChar *' info=' the variable name'/>
-      <field name='value' type='xmlXPathObjectPtr' info=' the value'/>
+      <field name='name' type='const xmlChar *'/>
+      <field name='value' type='xmlXPathObjectPtr'/>
     </struct>
     <typedef name='xmlXPathVariablePtr' file='xpath' type='xmlXPathVariable *'/>
-    <variable name='emptyExp' file='xmlregexp' type='xmlExpNodePtr'/>
-    <variable name='forbiddenExp' file='xmlregexp' type='xmlExpNodePtr'/>
     <variable name='htmlDefaultSAXHandler' file='HTMLparser' type='const xmlSAXHandlerV1'>
       <info>DEPRECATED: This handler is unused and will be removed from future versions.  Default old SAX v1 handler for HTML, builds the DOM tree</info>
     </variable>
-    <variable name='oldXMLWDcompatibility' file='parser' type='const int'>
-      <info>Global setting, DEPRECATED.</info>
-    </variable>
-    <variable name='xmlDefaultSAXHandler' file='parser' type='const xmlSAXHandlerV1'>
-      <info>DEPRECATED: This handler is unused and will be removed from future versions.  Default SAX version1 handler for XML, builds the DOM tree</info>
-    </variable>
-    <variable name='xmlDefaultSAXLocator' file='parser' type='const xmlSAXLocator'>
-      <info>DEPRECATED: Don&apos;t use  The default SAX Locator { getPublicId, getSystemId, getLineNumber, getColumnNumber}</info>
-    </variable>
     <variable name='xmlFree' file='xmlmemory' type='xmlFreeFunc'>
       <info>@mem: an already allocated block of memory  The variable holding the libxml free() implementation</info>
     </variable>
@@ -6918,12 +6592,6 @@
     <variable name='xmlMemStrdup' file='xmlmemory' type='xmlStrdupFunc'>
       <info>@str: a zero terminated string  The variable holding the libxml strdup() implementation  Returns the copy of the string or NULL in case of error</info>
     </variable>
-    <variable name='xmlParserDebugEntities' file='parser' type='const int'>
-      <info>DEPRECATED: Don&apos;t use  Global setting, asking the parser to print out debugging information. while handling entities. Disabled by default</info>
-    </variable>
-    <variable name='xmlParserMaxDepth' file='parserInternals' type='const unsigned int'>
-      <info>arbitrary depth limit for the XML documents that we allow to process. This is not a limitation of the parser but a safety boundary feature. It can be disabled with the XML_PARSE_HUGE parser option.</info>
-    </variable>
     <variable name='xmlParserVersion' file='parser' type='const char * const'>
       <info>Constant string describing the internal version of the library</info>
     </variable>
@@ -6936,44 +6604,6 @@
     <variable name='xmlXPathNAN' file='xpath' type='double'/>
     <variable name='xmlXPathNINF' file='xpath' type='double'/>
     <variable name='xmlXPathPINF' file='xpath' type='double'/>
-    <function name='UTF8ToHtml' file='HTMLparser' module='HTMLparser'>
-      <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Take a block of UTF-8 chars in and try to convert it to an ASCII plus HTML entities block of chars out.</info>
-      <return type='int' info='0 if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed as the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.'/>
-      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
-      <arg name='outlen' type='int *' info='the length of @out'/>
-      <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
-      <arg name='inlen' type='int *' info='the length of @in'/>
-    </function>
-    <function name='UTF8Toisolat1' file='encoding' module='encoding'>
-      <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</info>
-      <return type='int' info='the number of bytes written 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.'/>
-      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
-      <arg name='outlen' type='int *' info='the length of @out'/>
-      <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
-      <arg name='inlen' type='int *' info='the length of @in'/>
-    </function>
-    <function name='attribute' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Handle an attribute that has been read by the parser. The default handling is to convert the attribute into an DOM subtree and past it in a new xmlAttr element added to the element. DEPRECATED: use xmlSAX2Attribute()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='fullname' type='const xmlChar *' info='The attribute name, including namespace prefix'/>
-      <arg name='value' type='const xmlChar *' info='The attribute value'/>
-    </function>
-    <function name='attributeDecl' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>An attribute definition has been parsed DEPRECATED: use xmlSAX2AttributeDecl()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='elem' type='const xmlChar *' info='the name of the element'/>
-      <arg name='fullname' type='const xmlChar *' info='the attribute name'/>
-      <arg name='type' type='int' info='the attribute type'/>
-      <arg name='def' type='int' info='the type of default value'/>
-      <arg name='defaultValue' type='const xmlChar *' info='the attribute default value'/>
-      <arg name='tree' type='xmlEnumerationPtr' info='the tree of enumerated value set'/>
-    </function>
     <functype name='attributeDeclSAXFunc' file='parser' module='parser'>
       <info>An attribute definition has been parsed.</info>
       <return type='void'/>
@@ -6992,14 +6622,6 @@
       <arg name='name' type='const xmlChar *' info='The attribute name, including namespace prefix'/>
       <arg name='value' type='const xmlChar *' info='The attribute value'/>
     </functype>
-    <function name='cdataBlock' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when a pcdata block has been parsed DEPRECATED: use xmlSAX2CDataBlock()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='value' type='const xmlChar *' info='The pcdata content'/>
-      <arg name='len' type='int' info='the block length'/>
-    </function>
     <functype name='cdataBlockSAXFunc' file='parser' module='parser'>
       <info>Called when a pcdata block has been parsed.</info>
       <return type='void'/>
@@ -7007,14 +6629,6 @@
       <arg name='value' type='const xmlChar *' info='The pcdata content'/>
       <arg name='len' type='int' info='the block length'/>
     </functype>
-    <function name='characters' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>receiving some chars from the parser. DEPRECATED: use xmlSAX2Characters()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='ch' type='const xmlChar *' info='a xmlChar string'/>
-      <arg name='len' type='int' info='the number of xmlChar'/>
-    </function>
     <functype name='charactersSAXFunc' file='parser' module='parser'>
       <info>Receiving some chars from the parser.</info>
       <return type='void'/>
@@ -7022,35 +6636,12 @@
       <arg name='ch' type='const xmlChar *' info='a xmlChar string'/>
       <arg name='len' type='int' info='the number of xmlChar'/>
     </functype>
-    <function name='checkNamespace' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Check that the current element namespace is the same as the one read upon parsing. DEPRECATED</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='namespace' type='xmlChar *' info='the namespace to check against'/>
-    </function>
-    <function name='comment' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>A comment has been parsed. DEPRECATED: use xmlSAX2Comment()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='value' type='const xmlChar *' info='the comment content'/>
-    </function>
     <functype name='commentSAXFunc' file='parser' module='parser'>
       <info>A comment has been parsed.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='value' type='const xmlChar *' info='the comment content'/>
     </functype>
-    <function name='elementDecl' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>An element definition has been parsed DEPRECATED: use xmlSAX2ElementDecl()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='the element name'/>
-      <arg name='type' type='int' info='the element type'/>
-      <arg name='content' type='xmlElementContentPtr' info='the element value tree'/>
-    </function>
     <functype name='elementDeclSAXFunc' file='parser' module='parser'>
       <info>An element definition has been parsed.</info>
       <return type='void'/>
@@ -7059,24 +6650,11 @@
       <arg name='type' type='int' info='the element type'/>
       <arg name='content' type='xmlElementContentPtr' info='the element value tree'/>
     </functype>
-    <function name='endDocument' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when the document end has been detected. DEPRECATED: use xmlSAX2EndDocument()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
     <functype name='endDocumentSAXFunc' file='parser' module='parser'>
       <info>Called when the document end has been detected.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
     </functype>
-    <function name='endElement' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when the end of an element has been detected. DEPRECATED: use xmlSAX2EndElement()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='The element name'/>
-    </function>
     <functype name='endElementNsSAX2Func' file='parser' module='parser'>
       <info>SAX2 callback when an element end has been detected by the parser. It provides the namespace information for the element.</info>
       <return type='void'/>
@@ -7091,17 +6669,6 @@
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='name' type='const xmlChar *' info='The element name'/>
     </functype>
-    <function name='entityDecl' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>An entity definition has been parsed DEPRECATED: use xmlSAX2EntityDecl()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='the entity name'/>
-      <arg name='type' type='int' info='the entity type'/>
-      <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
-      <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
-      <arg name='content' type='xmlChar *' info='the entity value (without processing).'/>
-    </function>
     <functype name='entityDeclSAXFunc' file='parser' module='parser'>
       <info>An entity definition has been parsed.</info>
       <return type='void'/>
@@ -7119,15 +6686,6 @@
       <arg name='msg' type='const char *' info='the message to display/transmit'/>
       <arg name='...' type='...' info='extra parameters for the message display'/>
     </functype>
-    <function name='externalSubset' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Callback on external subset declaration. DEPRECATED: use xmlSAX2ExternalSubset()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='the root element name'/>
-      <arg name='ExternalID' type='const xmlChar *' info='the external ID'/>
-      <arg name='SystemID' type='const xmlChar *' info='the SYSTEM ID (e.g. filename or URL)'/>
-    </function>
     <functype name='externalSubsetSAXFunc' file='parser' module='parser'>
       <info>Callback on external subset declaration.</info>
       <return type='void'/>
@@ -7143,112 +6701,23 @@
       <arg name='msg' type='const char *' info='the message to display/transmit'/>
       <arg name='...' type='...' info='extra parameters for the message display'/>
     </functype>
-    <functype name='ftpDataCallback' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>A callback for the xmlNanoFTPGet command.</info>
-      <return type='void'/>
-      <arg name='userData' type='void *' info='the user provided context'/>
-      <arg name='data' type='const char *' info='the data received'/>
-      <arg name='len' type='int' info='its size in bytes'/>
-    </functype>
-    <functype name='ftpListCallback' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>A callback for the xmlNanoFTPList command. Note that only one of year and day:minute are specified.</info>
-      <return type='void'/>
-      <arg name='userData' type='void *' info='user provided data for the callback'/>
-      <arg name='filename' type='const char *' info='the file name (including &quot;-&gt;&quot; when links are shown)'/>
-      <arg name='attrib' type='const char *' info='the attribute string'/>
-      <arg name='owner' type='const char *' info='the owner string'/>
-      <arg name='group' type='const char *' info='the group string'/>
-      <arg name='size' type='unsigned long' info='the file size'/>
-      <arg name='links' type='int' info='the link count'/>
-      <arg name='year' type='int' info='the year'/>
-      <arg name='month' type='const char *' info='the month'/>
-      <arg name='day' type='int' info='the day'/>
-      <arg name='hour' type='int' info='the hour'/>
-      <arg name='minute' type='int' info='the minute'/>
-    </functype>
-    <function name='getColumnNumber' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Provide the column number of the current parsing point. DEPRECATED: use xmlSAX2GetColumnNumber()</info>
-      <return type='int' info='an int'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
-    <function name='getEntity' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Get an entity by name DEPRECATED: use xmlSAX2GetEntity()</info>
-      <return type='xmlEntityPtr' info='the xmlEntityPtr if found.'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='The entity name'/>
-    </function>
     <functype name='getEntitySAXFunc' file='parser' module='parser'>
       <info>Get an entity by name.</info>
       <return type='xmlEntityPtr' info='the xmlEntityPtr if found.'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='name' type='const xmlChar *' info='The entity name'/>
     </functype>
-    <function name='getLineNumber' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Provide the line number of the current parsing point. DEPRECATED: use xmlSAX2GetLineNumber()</info>
-      <return type='int' info='an int'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
-    <function name='getNamespace' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Get the current element namespace. DEPRECATED</info>
-      <return type='xmlNsPtr' info='the xmlNsPtr or NULL if none'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
-    <function name='getParameterEntity' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Get a parameter entity by name DEPRECATED: use xmlSAX2GetParameterEntity()</info>
-      <return type='xmlEntityPtr' info='the xmlEntityPtr if found.'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='The entity name'/>
-    </function>
     <functype name='getParameterEntitySAXFunc' file='parser' module='parser'>
       <info>Get a parameter entity by name.</info>
       <return type='xmlEntityPtr' info='the xmlEntityPtr if found.'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='name' type='const xmlChar *' info='The entity name'/>
     </functype>
-    <function name='getPublicId' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Provides the public ID e.g. &quot;-//SGMLSOURCE//DTD DEMO//EN&quot; DEPRECATED: use xmlSAX2GetPublicId()</info>
-      <return type='const xmlChar *' info='a xmlChar *'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
-    <function name='getSystemId' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Provides the system ID, basically URL or filename e.g. http://www.sgmlsource.com/dtds/memo.dtd DEPRECATED: use xmlSAX2GetSystemId()</info>
-      <return type='const xmlChar *' info='a xmlChar *'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
-    <function name='globalNamespace' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>An old global namespace has been parsed. DEPRECATED</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='href' type='const xmlChar *' info='the namespace associated URN'/>
-      <arg name='prefix' type='const xmlChar *' info='the namespace prefix'/>
-    </function>
-    <function name='hasExternalSubset' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Does this document has an external subset DEPRECATED: use xmlSAX2HasExternalSubset()</info>
-      <return type='int' info='1 if true'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
     <functype name='hasExternalSubsetSAXFunc' file='parser' module='parser'>
       <info>Does this document has an external subset?</info>
       <return type='int' info='1 if true'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
     </functype>
-    <function name='hasInternalSubset' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Does this document has an internal subset DEPRECATED: use xmlSAX2HasInternalSubset()</info>
-      <return type='int' info='1 if true'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
     <functype name='hasInternalSubsetSAXFunc' file='parser' module='parser'>
       <info>Does this document has an internal subset.</info>
       <return type='int' info='1 if true'/>
@@ -7256,15 +6725,15 @@
     </functype>
     <function name='htmlAttrAllowed' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Checks whether an attribute is valid for an element Has full knowledge of Required and Deprecated attributes</info>
-      <return type='htmlStatus' info='one of HTML_REQUIRED, HTML_VALID, HTML_DEPRECATED, HTML_INVALID'/>
+      <info>DEPRECATED: Don&apos;t use.</info>
+      <return type='htmlStatus' info='HTML_VALID'/>
       <arg name='elt' type='const htmlElemDesc *' info='HTML element'/>
       <arg name='attr' type='const xmlChar *' info='HTML attribute'/>
       <arg name='legacy' type='int' info='whether to allow deprecated attributes'/>
     </function>
     <function name='htmlAutoCloseTag' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if the element or one of it&apos;s children would autoclose the given tag.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if the element or one of it&apos;s children would autoclose the given tag.</info>
       <return type='int' info='1 if autoclose, 0 otherwise'/>
       <arg name='doc' type='htmlDocPtr' info='the HTML document'/>
       <arg name='name' type='const xmlChar *' info='The tag name'/>
@@ -7324,7 +6793,7 @@
     </function>
     <function name='htmlCtxtReadFile' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Parse an HTML file from the filesystem, the network or a user-defined resource loader.  See xmlNewInputURL and htmlCtxtUseOptions for details.</info>
+      <info>Parse an HTML file from the filesystem, the network or a user-defined resource loader.  See htmlCtxtUseOptions for details.</info>
       <return type='htmlDocPtr' info='the resulting document tree'/>
       <arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
       <arg name='filename' type='const char *' info='a file or URL'/>
@@ -7333,7 +6802,7 @@
     </function>
     <function name='htmlCtxtReadIO' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Parse an HTML document from I/O functions and source and build a tree.  See xmlNewInputIO and htmlCtxtUseOptions for details.</info>
+      <info>Parse an HTML document from I/O functions and source and build a tree.  See htmlCtxtUseOptions for details.</info>
       <return type='htmlDocPtr' info='the resulting document tree'/>
       <arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
       <arg name='ioread' type='xmlInputReadCallback' info='an I/O read function'/>
@@ -7360,9 +6829,16 @@
       <return type='void'/>
       <arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
     </function>
+    <function name='htmlCtxtSetOptions' file='HTMLparser' module='HTMLparser'>
+      <cond>defined(LIBXML_HTML_ENABLED)</cond>
+      <info>Applies the options to the parser context. Unset options are cleared.  Available since 2.14.0. With older versions, you can use htmlCtxtUseOptions.  HTML_PARSE_RECOVER  No effect as of 2.14.0.  HTML_PARSE_HTML5  Make the tokenizer emit a SAX callback for each token. This results in unbalanced invocations of startElement and endElement.  For now, this is only usable with custom SAX callbacks.  HTML_PARSE_NODEFDTD  Do not default to a doctype if none was found.  HTML_PARSE_NOERROR  Disable error and warning reports to the error handlers. Errors are still accessible with xmlCtxtGetLastError.  HTML_PARSE_NOWARNING  Disable warning reports.  HTML_PARSE_PEDANTIC  No effect.  HTML_PARSE_NOBLANKS  Remove some text nodes containing only whitespace from the result document. Which nodes are removed depends on a conservative heuristic. The reindenting feature of the serialization code relies on this option to be set when parsing. Use of this option is DISCOURAGED.  HTML_PARSE_NONET  No effect.  HTML_PARSE_NOIMPLIED  Do not add implied html, head or body elements.  HTML_PARSE_COMPACT  Store small strings directly in the node struct to save memory.  HTML_PARSE_HUGE  Relax some internal limits.  Available since 2.14.0. Use XML_PARSE_HUGE works with older versions.  Maximum size of text nodes, tags, comments, CDATA sections  normal: 10M huge:    1B  Maximum size of names, system literals, pubid literals  normal: 50K huge:   10M  Maximum nesting depth of elements  normal:  256 huge:   2048  HTML_PARSE_IGNORE_ENC  Ignore the encoding in the HTML declaration. This option is mostly unneeded these days. The only effect is to enforce UTF-8 decoding of ASCII-like data.  HTML_PARSE_BIG_LINES  Enable reporting of line numbers larger than 65535.  Available since 2.14.0.</info>
+      <return type='int' info='0 in case of success, the set of unknown or unimplemented options in case of error.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='an HTML parser context'/>
+      <arg name='options' type='int' info='a bitmask of xmlParserOption values'/>
+    </function>
     <function name='htmlCtxtUseOptions' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Applies the options to the parser context</info>
+      <info>DEPRECATED: Use htmlCtxtSetOptions.  Applies the options to the parser context. The following options are never cleared and can only be enabled:  HTML_PARSE_NODEFDTD HTML_PARSE_NOERROR HTML_PARSE_NOWARNING HTML_PARSE_NOIMPLIED HTML_PARSE_COMPACT HTML_PARSE_HUGE HTML_PARSE_IGNORE_ENC HTML_PARSE_BIG_LINES</info>
       <return type='int' info='0 in case of success, the set of unknown or unimplemented options in case of error.'/>
       <arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
       <arg name='options' type='int' info='a combination of htmlParserOption(s)'/>
@@ -7415,15 +6891,15 @@
     </function>
     <function name='htmlElementAllowedHere' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Checks whether an HTML element may be a direct child of a parent element. Note - doesn&apos;t check for deprecated elements</info>
-      <return type='int' info='1 if allowed; 0 otherwise.'/>
+      <info>DEPRECATED: Don&apos;t use.</info>
+      <return type='int' info='1'/>
       <arg name='parent' type='const htmlElemDesc *' info='HTML parent element'/>
       <arg name='elt' type='const xmlChar *' info='HTML element'/>
     </function>
     <function name='htmlElementStatusHere' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Checks whether an HTML element may be a direct child of a parent element. and if so whether it is valid or deprecated.</info>
-      <return type='htmlStatus' info='one of HTML_VALID, HTML_DEPRECATED, HTML_INVALID'/>
+      <info>DEPRECATED: Don&apos;t use.</info>
+      <return type='htmlStatus' info='HTML_VALID'/>
       <arg name='parent' type='const htmlElemDesc *' info='HTML parent element'/>
       <arg name='elt' type='const htmlElemDesc *' info='HTML element'/>
     </function>
@@ -7474,14 +6950,14 @@
     </function>
     <function name='htmlIsAutoClosed' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it&apos;s child</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  The HTML DTD allows a tag to implicitly close other tags. The list is kept in htmlStartClose array. This function checks if a tag is autoclosed by one of it&apos;s child</info>
       <return type='int' info='1 if autoclosed, 0 otherwise'/>
       <arg name='doc' type='htmlDocPtr' info='the HTML document'/>
       <arg name='elem' type='htmlNodePtr' info='the HTML element'/>
     </function>
     <function name='htmlIsBooleanAttr' file='HTMLtree' module='HTMLtree'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Determine if a given attribute is a boolean attribute.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Determine if a given attribute is a boolean attribute.</info>
       <return type='int' info='false if the attribute is not boolean, true otherwise.'/>
       <arg name='name' type='const xmlChar *' info='the name of the attribute to check'/>
     </function>
@@ -7507,7 +6983,7 @@
     </function>
     <function name='htmlNewParserCtxt' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Allocate and initialize a new HTML parser context.  This can be used to parse HTML documents into DOM trees with functions like xmlCtxtReadFile or xmlCtxtReadMemory.  See htmlCtxtUseOptions for parser options.  See xmlCtxtSetErrorHandler for advanced error handling.  See xmlNewInputURL, xmlNewInputMemory, xmlNewInputIO and similar functions for advanced input control.  See htmlNewSAXParserCtxt for custom SAX parsers.</info>
+      <info>Allocate and initialize a new HTML parser context.  This can be used to parse HTML documents into DOM trees with functions like xmlCtxtReadFile or xmlCtxtReadMemory.  See htmlCtxtUseOptions for parser options.  See xmlCtxtSetErrorHandler for advanced error handling.  See htmlNewSAXParserCtxt for custom SAX parsers.</info>
       <return type='htmlParserCtxtPtr' info='the htmlParserCtxtPtr or NULL in case of allocation error'/>
     </function>
     <function name='htmlNewSAXParserCtxt' file='HTMLparser' module='HTMLparser'>
@@ -7564,15 +7040,15 @@
     </function>
     <function name='htmlNodeStatus' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Checks whether the tree node is valid.  Experimental (the author only uses the HTML enhancements in a SAX parser)</info>
-      <return type='htmlStatus' info='for Element nodes, a return from htmlElementAllowedHere (if legacy allowed) or htmlElementStatusHere (otherwise). for Attribute nodes, a return from htmlAttrAllowed for other nodes, HTML_NA (no checks performed)'/>
+      <info>DEPRECATED: Don&apos;t use.</info>
+      <return type='htmlStatus' info='HTML_VALID'/>
       <arg name='node' type='htmlNodePtr' info='an htmlNodePtr in a tree'/>
       <arg name='legacy' type='int' info='whether to allow deprecated elements (YES is faster here for Element nodes)'/>
     </function>
     <function name='htmlParseCharRef' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>DEPRECATED: Internal function, don&apos;t use.  parse Reference declarations  [66] CharRef ::= &apos;&amp;#&apos; [0-9]+ &apos;;&apos; | &apos;&amp;#x&apos; [0-9a-fA-F]+ &apos;;&apos;</info>
-      <return type='int' info='the value parsed (as an int)'/>
+      <info>DEPRECATED: Internal function, don&apos;t use.</info>
+      <return type='int' info='0'/>
       <arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
     </function>
     <function name='htmlParseChunk' file='HTMLparser' module='HTMLparser'>
@@ -7605,14 +7081,14 @@
     </function>
     <function name='htmlParseEntityRef' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>DEPRECATED: Internal function, don&apos;t use.  parse an HTML ENTITY references  [68] EntityRef ::= &apos;&amp;&apos; Name &apos;;&apos;</info>
-      <return type='const htmlEntityDesc *' info='the associated htmlEntityDescPtr if found, or NULL otherwise, if non-NULL *str will have to be freed by the caller.'/>
+      <info>DEPRECATED: Internal function, don&apos;t use.</info>
+      <return type='const htmlEntityDesc *' info='NULL.'/>
       <arg name='ctxt' type='htmlParserCtxtPtr' info='an HTML parser context'/>
       <arg name='str' type='const xmlChar **' info='location to store the entity name'/>
     </function>
     <function name='htmlParseFile' file='HTMLparser' module='HTMLparser'>
       <cond>defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Parse an HTML file and build a tree.  See xmlNewInputURL for details.</info>
+      <info>Parse an HTML file and build a tree.</info>
       <return type='htmlDocPtr' info='the resulting document tree'/>
       <arg name='filename' type='const char *' info='the filename'/>
       <arg name='encoding' type='const char *' info='encoding (optional)'/>
@@ -7719,13 +7195,14 @@
       <return type='const htmlElemDesc *' info='the related htmlElemDescPtr or NULL if not found.'/>
       <arg name='tag' type='const xmlChar *' info='The tag name in lowercase'/>
     </function>
-    <function name='ignorableWhitespace' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters DEPRECATED: use xmlSAX2IgnorableWhitespace()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='ch' type='const xmlChar *' info='a xmlChar string'/>
-      <arg name='len' type='int' info='the number of xmlChar'/>
+    <function name='htmlUTF8ToHtml' file='HTMLparser' module='HTMLparser'>
+      <cond>defined(LIBXML_HTML_ENABLED)</cond>
+      <info>Take a block of UTF-8 chars in and try to convert it to an ASCII plus HTML entities block of chars out.</info>
+      <return type='int' info='0 if success, -2 if the transcoding fails, or -1 otherwise The value of @inlen after return is the number of octets consumed as the return value is positive, else unpredictable. The value of @outlen after return is the number of octets consumed.'/>
+      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
+      <arg name='outlen' type='int *' info='the length of @out'/>
+      <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
+      <arg name='inlen' type='int *' info='the length of @in'/>
     </function>
     <functype name='ignorableWhitespaceSAXFunc' file='parser' module='parser'>
       <info>Receiving some ignorable whitespaces from the parser. UNUSED: by default the DOM building will use characters.</info>
@@ -7734,44 +7211,6 @@
       <arg name='ch' type='const xmlChar *' info='a xmlChar string'/>
       <arg name='len' type='int' info='the number of xmlChar'/>
     </functype>
-    <function name='initGenericErrorDefaultFunc' file='xmlerror' module='error'>
-      <info>DEPRECATED: Use xmlSetGenericErrorFunc.  Set or reset (if NULL) the default handler for generic errors to the builtin error function.</info>
-      <return type='void'/>
-      <arg name='handler' type='xmlGenericErrorFunc *' info='the handler'/>
-    </function>
-    <function name='inithtmlDefaultSAXHandler' file='SAX' module='SAX'>
-      <cond>defined(LIBXML_LEGACY_ENABLED) &amp;&amp; defined(LIBXML_SAX1_ENABLED) &amp;&amp; defined(LIBXML_HTML_ENABLED)</cond>
-      <info>Initialize the default HTML SAX version 1 handler DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks</info>
-      <return type='void'/>
-      <arg name='hdlr' type='xmlSAXHandlerV1 *' info='the SAX handler'/>
-    </function>
-    <function name='initxmlDefaultSAXHandler' file='SAX' module='SAX'>
-      <cond>defined(LIBXML_LEGACY_ENABLED) &amp;&amp; defined(LIBXML_SAX1_ENABLED)</cond>
-      <info>Initialize the default XML SAX version 1 handler DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks</info>
-      <return type='void'/>
-      <arg name='hdlr' type='xmlSAXHandlerV1 *' info='the SAX handler'/>
-      <arg name='warning' type='int' info='flag if non-zero sets the handler warning procedure'/>
-    </function>
-    <function name='inputPop' file='parserInternals' module='parser'>
-      <info>Pops the top parser input from the input stack</info>
-      <return type='xmlParserInputPtr' info='the input just removed'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-    </function>
-    <function name='inputPush' file='parserInternals' module='parser'>
-      <info>Pushes a new parser input on top of the input stack</info>
-      <return type='int' info='-1 in case of error, the index in the stack otherwise'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-      <arg name='value' type='xmlParserInputPtr' info='the parser input'/>
-    </function>
-    <function name='internalSubset' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Callback on internal subset declaration. DEPRECATED: use xmlSAX2InternalSubset()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='the root element name'/>
-      <arg name='ExternalID' type='const xmlChar *' info='the external ID'/>
-      <arg name='SystemID' type='const xmlChar *' info='the SYSTEM ID (e.g. filename or URL)'/>
-    </function>
     <functype name='internalSubsetSAXFunc' file='parser' module='parser'>
       <info>Callback on internal subset declaration.</info>
       <return type='void'/>
@@ -7780,64 +7219,11 @@
       <arg name='ExternalID' type='const xmlChar *' info='the external ID'/>
       <arg name='SystemID' type='const xmlChar *' info='the SYSTEM ID (e.g. filename or URL)'/>
     </functype>
-    <function name='isStandalone' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Is this document tagged standalone ? DEPRECATED: use xmlSAX2IsStandalone()</info>
-      <return type='int' info='1 if true'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
     <functype name='isStandaloneSAXFunc' file='parser' module='parser'>
       <info>Is this document tagged standalone?</info>
       <return type='int' info='1 if true'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
     </functype>
-    <function name='isolat1ToUTF8' file='encoding' module='encoding'>
-      <info>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</info>
-      <return type='int' info='the number of bytes written 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.'/>
-      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
-      <arg name='outlen' type='int *' info='the length of @out'/>
-      <arg name='in' type='const unsigned char *' info='a pointer to an array of ISO Latin 1 chars'/>
-      <arg name='inlen' type='int *' info='the length of @in'/>
-    </function>
-    <function name='namePop' file='parserInternals' module='parser'>
-      <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>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'/>
-    </function>
-    <function name='namespaceDecl' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>A namespace has been parsed. DEPRECATED</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='href' type='const xmlChar *' info='the namespace associated URN'/>
-      <arg name='prefix' type='const xmlChar *' info='the namespace prefix'/>
-    </function>
-    <function name='nodePop' file='parserInternals' module='parser'>
-      <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>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'/>
-    </function>
-    <function name='notationDecl' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>What to do when a notation declaration has been parsed. DEPRECATED: use xmlSAX2NotationDecl()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='The name of the notation'/>
-      <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
-      <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
-    </function>
     <functype name='notationDeclSAXFunc' file='parser' module='parser'>
       <info>What to do when a notation declaration has been parsed.</info>
       <return type='void'/>
@@ -7846,14 +7232,6 @@
       <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
       <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
     </functype>
-    <function name='processingInstruction' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>A processing instruction has been parsed. DEPRECATED: use xmlSAX2ProcessingInstruction()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='target' type='const xmlChar *' info='the target name'/>
-      <arg name='data' type='const xmlChar *' info='the PI data&apos;s'/>
-    </function>
     <functype name='processingInstructionSAXFunc' file='parser' module='parser'>
       <info>A processing instruction has been parsed.</info>
       <return type='void'/>
@@ -7861,27 +7239,12 @@
       <arg name='target' type='const xmlChar *' info='the target name'/>
       <arg name='data' type='const xmlChar *' info='the PI data&apos;s'/>
     </functype>
-    <function name='reference' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when an entity reference is detected. DEPRECATED: use xmlSAX2Reference()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='The entity name'/>
-    </function>
     <functype name='referenceSAXFunc' file='parser' module='parser'>
       <info>Called when an entity reference is detected.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='name' type='const xmlChar *' info='The entity name'/>
     </functype>
-    <function name='resolveEntity' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it&apos;s own entity resolution routine DEPRECATED: use xmlSAX2ResolveEntity()</info>
-      <return type='xmlParserInputPtr' info='the xmlParserInputPtr if inlined or NULL for DOM behaviour.'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
-      <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
-    </function>
     <functype name='resolveEntitySAXFunc' file='parser' module='parser'>
       <info>Callback: The entity loader, to control the loading of external entities, the application can either: - override this resolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it&apos;s own entity resolution routine</info>
       <return type='xmlParserInputPtr' info='the xmlParserInputPtr if inlined or NULL for DOM behaviour.'/>
@@ -7889,45 +7252,17 @@
       <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
       <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
     </functype>
-    <function name='setDocumentLocator' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Receive the document locator at startup, actually xmlDefaultSAXLocator Everything is available on the context, so this is useless in our case. DEPRECATED</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='loc' type='xmlSAXLocatorPtr' info='A SAX Locator'/>
-    </function>
     <functype name='setDocumentLocatorSAXFunc' file='parser' module='parser'>
       <info>Receive the document locator at startup, actually xmlDefaultSAXLocator. Everything is available on the context, so this is useless in our case.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='loc' type='xmlSAXLocatorPtr' info='A SAX Locator'/>
     </functype>
-    <function name='setNamespace' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Set the current element namespace. DEPRECATED</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='the namespace prefix'/>
-    </function>
-    <function name='startDocument' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when the document start being processed. DEPRECATED: use xmlSAX2StartDocument()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-    </function>
     <functype name='startDocumentSAXFunc' file='parser' module='parser'>
       <info>Called when the document start being processed.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
     </functype>
-    <function name='startElement' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when an opening tag has been processed. DEPRECATED: use xmlSAX2StartElement()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='fullname' type='const xmlChar *' info='The element name, including namespace prefix'/>
-      <arg name='atts' type='const xmlChar **' info='An array of name/value attributes pairs, NULL terminated'/>
-    </function>
     <functype name='startElementNsSAX2Func' file='parser' module='parser'>
       <info>SAX2 callback when an element start has been detected by the parser. It provides the namespace information for the element, as well as the new namespace declarations on the element.</info>
       <return type='void'/>
@@ -7948,16 +7283,6 @@
       <arg name='name' type='const xmlChar *' info='The element name, including namespace prefix'/>
       <arg name='atts' type='const xmlChar **' info='An array of name/value attributes pairs, NULL terminated'/>
     </functype>
-    <function name='unparsedEntityDecl' file='SAX' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>What to do when an unparsed entity declaration is parsed DEPRECATED: use xmlSAX2UnparsedEntityDecl()</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
-      <arg name='name' type='const xmlChar *' info='The name of the entity'/>
-      <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
-      <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
-      <arg name='notationName' type='const xmlChar *' info='the name of the notation'/>
-    </function>
     <functype name='unparsedEntityDeclSAXFunc' file='parser' module='parser'>
       <info>What to do when an unparsed entity declaration is parsed.</info>
       <return type='void'/>
@@ -7967,19 +7292,6 @@
       <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
       <arg name='notationName' type='const xmlChar *' info='the name of the notation'/>
     </functype>
-    <function name='valuePop' file='xpathInternals' module='xpath'>
-      <cond>defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Pops the top XPath object from the value stack</info>
-      <return type='xmlXPathObjectPtr' info='the XPath object just removed'/>
-      <arg name='ctxt' type='xmlXPathParserContextPtr' info='an XPath evaluation context'/>
-    </function>
-    <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.  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>
     <functype name='warningSAXFunc' file='parser' module='parser'>
       <info>Display and format a warning messages, callback.</info>
       <return type='void'/>
@@ -8020,12 +7332,12 @@
     </functype>
     <function name='xlinkGetDefaultDetect' file='xlink' module='xlink'>
       <cond>defined(LIBXML_XPTR_ENABLED)</cond>
-      <info>Get the default xlink detection routine</info>
+      <info>DEPRECATED: Don&apos;t use.  Get the default xlink detection routine</info>
       <return type='xlinkNodeDetectFunc' info='the current function or NULL;'/>
     </function>
     <function name='xlinkGetDefaultHandler' file='xlink' module='xlink'>
       <cond>defined(LIBXML_XPTR_ENABLED)</cond>
-      <info>Get the default xlink handler.</info>
+      <info>DEPRECATED: Don&apos;t use.  Get the default xlink handler.</info>
       <return type='xlinkHandlerPtr' info='the current xlinkHandlerPtr value.'/>
     </function>
     <function name='xlinkIsLink' file='xlink' module='xlink'>
@@ -8044,13 +7356,13 @@
     </functype>
     <function name='xlinkSetDefaultDetect' file='xlink' module='xlink'>
       <cond>defined(LIBXML_XPTR_ENABLED)</cond>
-      <info>Set the default xlink detection routine</info>
+      <info>DEPRECATED: Don&apos;t use.  Set the default xlink detection routine</info>
       <return type='void'/>
       <arg name='func' type='xlinkNodeDetectFunc' info='pointer to the new detection routine.'/>
     </function>
     <function name='xlinkSetDefaultHandler' file='xlink' module='xlink'>
       <cond>defined(LIBXML_XPTR_ENABLED)</cond>
-      <info>Set the default xlink handlers</info>
+      <info>DEPRECATED: Don&apos;t use.  Set the default xlink handlers</info>
       <return type='void'/>
       <arg name='handler' type='xlinkHandlerPtr' info='the new value for the xlink handler block'/>
     </function>
@@ -8117,7 +7429,7 @@
       <arg name='URI' type='const xmlChar *' info='the URI'/>
     </function>
     <function name='xmlAddAttributeDecl' file='valid' module='valid'>
-      <info>Register a new attribute declaration Note that @tree becomes the ownership of the DTD</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Register a new attribute declaration Note that @tree becomes the ownership of the DTD</info>
       <return type='xmlAttributePtr' info='NULL if not new, otherwise the attribute decl'/>
       <arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
       <arg name='dtd' type='xmlDtdPtr' info='pointer to the DTD'/>
@@ -8130,8 +7442,8 @@
       <arg name='tree' type='xmlEnumerationPtr' info='if it&apos;s an enumeration, the associated list'/>
     </function>
     <function name='xmlAddChild' file='tree' module='tree'>
-      <info>Unlink @cur and append it to the children of @parent.  If @cur is a text node, it may be merged with an adjacent text node and freed. In this case the text node containing the merged content is returned.  If @cur is an attribute node, it is appended to the attributes of @parent. If the attribute list contains an attribute with a name matching @elem, the old attribute is destroyed.  General notes:  Move operations like xmlAddChild can cause element or attribute nodes to reference namespaces that aren&apos;t declared in one of their ancestors. This can lead to use-after-free errors if the elements containing the declarations are freed later, especially when moving nodes from one document to another. You should consider calling xmlReconciliateNs after a move operation to normalize namespaces. Another option is to call xmlDOMWrapAdoptNode with the target parent before moving a node.  For the most part, move operations don&apos;t check whether the resulting tree structure is valid. Users must make sure that parent nodes only receive children of valid types. Inserted child nodes must never be an ancestor of the parent node to avoid cycles in the tree structure. In general, only document, document fragments, elements and attributes should be used as parent nodes.  When moving a node between documents and a memory allocation fails, the node&apos;s content will be corrupted and it will be unlinked. In this case, the node must be freed manually.  Moving DTDs between documents isn&apos;t supported.</info>
-      <return type='xmlNodePtr' info='@elem or a sibling if @elem was merged. Returns NULL if arguments are invalid or a memory allocation failed.'/>
+      <info>Unlink @cur and append it to the children of @parent.  If @cur is a text node, it may be merged with an adjacent text node and freed. In this case the text node containing the merged content is returned.  If @cur is an attribute node, it is appended to the attributes of @parent. If the attribute list contains an attribute with a name matching @cur, the old attribute is destroyed.  General notes:  Move operations like xmlAddChild can cause element or attribute nodes to reference namespaces that aren&apos;t declared in one of their ancestors. This can lead to use-after-free errors if the elements containing the declarations are freed later, especially when moving nodes from one document to another. You should consider calling xmlReconciliateNs after a move operation to normalize namespaces. Another option is to call xmlDOMWrapAdoptNode with the target parent before moving a node.  For the most part, move operations don&apos;t check whether the resulting tree structure is valid. Users must make sure that parent nodes only receive children of valid types. Inserted child nodes must never be an ancestor of the parent node to avoid cycles in the tree structure. In general, only document, document fragments, elements and attributes should be used as parent nodes.  When moving a node between documents and a memory allocation fails, the node&apos;s content will be corrupted and it will be unlinked. In this case, the node must be freed manually.  Moving DTDs between documents isn&apos;t supported.</info>
+      <return type='xmlNodePtr' info='@cur or a sibling if @cur was merged. Returns NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
       <arg name='cur' type='xmlNodePtr' info='the child node'/>
     </function>
@@ -8162,7 +7474,7 @@
       <arg name='content' type='const xmlChar *' info='the entity content'/>
     </function>
     <function name='xmlAddElementDecl' file='valid' module='valid'>
-      <info>Register a new element declaration</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Register a new element declaration</info>
       <return type='xmlElementPtr' info='NULL if not, otherwise the entity'/>
       <arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
       <arg name='dtd' type='xmlDtdPtr' info='pointer to the DTD'/>
@@ -8171,7 +7483,7 @@
       <arg name='content' type='xmlElementContentPtr' info='the element content tree or NULL'/>
     </function>
     <function name='xmlAddEncodingAlias' file='encoding' module='encoding'>
-      <info>Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</info>
+      <info>DEPRECATED: This function modifies global state and is not thread-safe.  Registers an alias @alias for an encoding named @name. Existing alias will be overwritten.</info>
       <return type='int' info='0 in case of success, -1 in case of error'/>
       <arg name='name' type='const char *' info='the encoding name as parsed, in UTF-8 format (ASCII actually)'/>
       <arg name='alias' type='const char *' info='the alias name as parsed, in UTF-8 format (ASCII actually)'/>
@@ -8209,7 +7521,7 @@
       <arg name='cur' type='xmlNodePtr' info='the new node'/>
     </function>
     <function name='xmlAddNotationDecl' file='valid' module='valid'>
-      <info>Register a new notation declaration</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Register a new notation declaration</info>
       <return type='xmlNotationPtr' info='NULL if not, otherwise the entity'/>
       <arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
       <arg name='dtd' type='xmlDtdPtr' info='pointer to the DTD'/>
@@ -8218,7 +7530,6 @@
       <arg name='SystemID' type='const xmlChar *' info='the system identifier or NULL'/>
     </function>
     <function name='xmlAddPrevSibling' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)</cond>
       <info>Unlinks @cur and inserts it as previous sibling before @next.  Unlike xmlAddChild this function does not merge text nodes.  If @cur is an attribute node, it is inserted before attribute @next. If the attribute list contains an attribute with a name matching @cur, the old attribute is destroyed.  See the notes in xmlAddChild.</info>
       <return type='xmlNodePtr' info='@cur or a sibling if @cur was merged. Returns NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='next' type='xmlNodePtr' info='the target node'/>
@@ -8240,12 +7551,12 @@
     </function>
     <function name='xmlAllocOutputBuffer' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Create a buffered parser output</info>
+      <info>Create a buffered parser output  Consumes @encoder even in error case.</info>
       <return type='xmlOutputBufferPtr' info='the new parser output or NULL'/>
       <arg name='encoder' type='xmlCharEncodingHandlerPtr' info='the encoding converter or NULL'/>
     </function>
     <function name='xmlAllocParserInputBuffer' file='xmlIO' module='xmlIO'>
-      <info>Create a buffered parser input for progressive parsing.  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
+      <info>DEPRECATED: Use xmlNewInputFrom*.  Create a buffered parser input for progressive parsing.  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known (deprecated)'/>
     </function>
@@ -8259,25 +7570,25 @@
       <arg name='string' type='const xmlChar *' info='the text content'/>
     </function>
     <function name='xmlAutomataCompile' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Compile the automata into a Reg Exp ready for being executed. The automata should be free after this point.</info>
       <return type='xmlRegexpPtr' info='the compiled regexp or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
     </function>
     <function name='xmlAutomataGetInitState' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Initial state lookup</info>
       <return type='xmlAutomataStatePtr' info='the initial state of the automata'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
     </function>
     <function name='xmlAutomataIsDeterminist' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Checks if an automata is determinist.</info>
       <return type='int' info='1 if true, 0 if not, and -1 in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
     </function>
     <function name='xmlAutomataNewAllTrans' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a an ALL transition from the @from state to the target state. That transition is an epsilon transition allowed only when all transitions from the @from node have been activated.</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8286,7 +7597,7 @@
       <arg name='lax' type='int' info='allow to transition if not all all transitions have been activated'/>
     </function>
     <function name='xmlAutomataNewCountTrans' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and whose number is between @min and @max</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8298,7 +7609,7 @@
       <arg name='data' type='void *' info='data associated to the transition'/>
     </function>
     <function name='xmlAutomataNewCountTrans2' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and @token2 and whose number is between @min and @max</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8311,7 +7622,7 @@
       <arg name='data' type='void *' info='data associated to the transition'/>
     </function>
     <function name='xmlAutomataNewCountedTrans' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the @from state to the target state which will increment the counter provided</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8320,7 +7631,7 @@
       <arg name='counter' type='int' info='the counter associated to that transition'/>
     </function>
     <function name='xmlAutomataNewCounter' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Create a new counter</info>
       <return type='int' info='the counter number or -1 in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8328,7 +7639,7 @@
       <arg name='max' type='int' info='the maximal value on the counter'/>
     </function>
     <function name='xmlAutomataNewCounterTrans' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the @from state to the target state which will be allowed only if the counter is within the right range.</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8337,7 +7648,7 @@
       <arg name='counter' type='int' info='the counter associated to that transition'/>
     </function>
     <function name='xmlAutomataNewEpsilon' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds an epsilon transition from the @from state to the target state</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8345,7 +7656,7 @@
       <arg name='to' type='xmlAutomataStatePtr' info='the target point of the transition or NULL'/>
     </function>
     <function name='xmlAutomataNewNegTrans' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by any value except (@token,@token2) Note that if @token2 is not NULL, then (X, NULL) won&apos;t match to follow # the semantic of XSD ##other</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8356,7 +7667,7 @@
       <arg name='data' type='void *' info='data passed to the callback function if the transition is activated'/>
     </function>
     <function name='xmlAutomataNewOnceTrans' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and whose number is between @min and @max, moreover that transition can only be crossed once.</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8368,7 +7679,7 @@
       <arg name='data' type='void *' info='data associated to the transition'/>
     </function>
     <function name='xmlAutomataNewOnceTrans2' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by a succession of input of value @token and @token2 and whose number is between @min and @max, moreover that transition can only be crossed once.</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8381,13 +7692,13 @@
       <arg name='data' type='void *' info='data associated to the transition'/>
     </function>
     <function name='xmlAutomataNewState' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Create a new disconnected state in the automata</info>
       <return type='xmlAutomataStatePtr' info='the new state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
     </function>
     <function name='xmlAutomataNewTransition' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by the value of @token</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8397,7 +7708,7 @@
       <arg name='data' type='void *' info='data passed to the callback function if the transition is activated'/>
     </function>
     <function name='xmlAutomataNewTransition2' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>If @to is NULL, this creates first a new target state in the automata and then adds a transition from the @from state to the target state activated by the value of @token</info>
       <return type='xmlAutomataStatePtr' info='the target state or NULL in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -8408,18 +7719,12 @@
       <arg name='data' type='void *' info='data passed to the callback function if the transition is activated'/>
     </function>
     <function name='xmlAutomataSetFinalState' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Makes that state a final state</info>
       <return type='int' info='0 or -1 in case of error'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
       <arg name='state' type='xmlAutomataStatePtr' info='a state in this automata'/>
     </function>
-    <function name='xmlBoolToText' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED)</cond>
-      <info>Convenient way to turn bool into text</info>
-      <return type='const char *' info='a pointer to either &quot;True&quot; or &quot;False&quot;'/>
-      <arg name='boolval' type='int' info='a bool to turn into text'/>
-    </function>
     <function name='xmlBufContent' file='tree' module='buf'>
       <info>Function to extract the content of a buffer</info>
       <return type='xmlChar *' info='the internal content'/>
@@ -8447,7 +7752,7 @@
       <arg name='format' type='int' info='is formatting allowed'/>
     </function>
     <function name='xmlBufShrink' file='tree' module='buf'>
-      <info>Remove the beginning of an XML buffer. NOTE that this routine behaviour differs from xmlBufferShrink() as it will return 0 on error instead of -1 due to size_t being used as the return type.</info>
+      <info>DEPRECATED: Don&apos;t use.  Remove the beginning of an XML buffer. NOTE that this routine behaviour differs from xmlBufferShrink() as it will return 0 on error instead of -1 due to size_t being used as the return type.</info>
       <return type='size_t' info='the number of byte removed or 0 in case of failure'/>
       <arg name='buf' type='xmlBufPtr' info='the buffer to dump'/>
       <arg name='len' type='size_t' info='the number of xmlChar to remove'/>
@@ -8457,115 +7762,115 @@
       <return type='size_t' info='the length of data in the internal content'/>
       <arg name='buf' type='const xmlBufPtr' info='the buffer'/>
     </function>
-    <function name='xmlBufferAdd' file='tree' module='tree'>
+    <function name='xmlBufferAdd' file='tree' module='buf'>
       <info>Add a string range to an XML buffer. if len == -1, the length of str is recomputed.</info>
-      <return type='int' info='0 successful, a positive error code number otherwise and -1 in case of internal or API error.'/>
+      <return type='int' info='a xmlParserErrors code.'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to dump'/>
       <arg name='str' type='const xmlChar *' info='the #xmlChar string'/>
       <arg name='len' type='int' info='the number of #xmlChar to add'/>
     </function>
-    <function name='xmlBufferAddHead' file='tree' module='tree'>
+    <function name='xmlBufferAddHead' file='tree' module='buf'>
       <info>Add a string range to the beginning of an XML buffer. if len == -1, the length of @str is recomputed.</info>
-      <return type='int' info='0 successful, a positive error code number otherwise and -1 in case of internal or API error.'/>
+      <return type='int' info='a xmlParserErrors code.'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer'/>
       <arg name='str' type='const xmlChar *' info='the #xmlChar string'/>
       <arg name='len' type='int' info='the number of #xmlChar to add'/>
     </function>
-    <function name='xmlBufferCCat' file='tree' module='tree'>
+    <function name='xmlBufferCCat' file='tree' module='buf'>
       <info>Append a zero terminated C string to an XML buffer.</info>
       <return type='int' info='0 successful, a positive error code number otherwise and -1 in case of internal or API error.'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to dump'/>
       <arg name='str' type='const char *' info='the C char string'/>
     </function>
-    <function name='xmlBufferCat' file='tree' module='tree'>
+    <function name='xmlBufferCat' file='tree' module='buf'>
       <info>Append a zero terminated string to an XML buffer.</info>
       <return type='int' info='0 successful, a positive error code number otherwise and -1 in case of internal or API error.'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to add to'/>
       <arg name='str' type='const xmlChar *' info='the #xmlChar string'/>
     </function>
-    <function name='xmlBufferContent' file='tree' module='tree'>
+    <function name='xmlBufferContent' file='tree' module='buf'>
       <info>Function to extract the content of a buffer</info>
       <return type='const xmlChar *' info='the internal content'/>
       <arg name='buf' type='const xmlBuffer *' info='the buffer'/>
     </function>
-    <function name='xmlBufferCreate' file='tree' module='tree'>
+    <function name='xmlBufferCreate' file='tree' module='buf'>
       <info>routine to create an XML buffer.</info>
       <return type='xmlBufferPtr' info='the new structure.'/>
     </function>
-    <function name='xmlBufferCreateSize' file='tree' module='tree'>
+    <function name='xmlBufferCreateSize' file='tree' module='buf'>
       <info>routine to create an XML buffer.</info>
       <return type='xmlBufferPtr' info='the new structure.'/>
       <arg name='size' type='size_t' info='initial size of buffer'/>
     </function>
-    <function name='xmlBufferCreateStatic' file='tree' module='tree'>
+    <function name='xmlBufferCreateStatic' file='tree' module='buf'>
       <info></info>
       <return type='xmlBufferPtr' info='an XML buffer initialized with bytes.'/>
       <arg name='mem' type='void *' info='the memory area'/>
       <arg name='size' type='size_t' info='the size in byte'/>
     </function>
-    <function name='xmlBufferDetach' file='tree' module='tree'>
+    <function name='xmlBufferDetach' file='tree' module='buf'>
       <info>Remove the string contained in a buffer and gie it back to the caller. The buffer is reset to an empty content. This doesn&apos;t work with immutable buffers as they can&apos;t be reset.</info>
       <return type='xmlChar *' info='the previous string contained by the buffer.'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer'/>
     </function>
-    <function name='xmlBufferDump' file='tree' module='tree'>
+    <function name='xmlBufferDump' file='tree' module='buf'>
       <info>Dumps an XML buffer to  a FILE *.</info>
       <return type='int' info='the number of #xmlChar written'/>
       <arg name='file' type='FILE *' info='the file output'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to dump'/>
     </function>
-    <function name='xmlBufferEmpty' file='tree' module='tree'>
+    <function name='xmlBufferEmpty' file='tree' module='buf'>
       <info>empty a buffer.</info>
       <return type='void'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer'/>
     </function>
-    <function name='xmlBufferFree' file='tree' module='tree'>
+    <function name='xmlBufferFree' file='tree' module='buf'>
       <info>Frees an XML buffer. It frees both the content and the structure which encapsulate it.</info>
       <return type='void'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to free'/>
     </function>
-    <function name='xmlBufferGrow' file='tree' module='tree'>
-      <info>Grow the available space of an XML buffer.</info>
+    <function name='xmlBufferGrow' file='tree' module='buf'>
+      <info>DEPRECATED: Don&apos;t use.  Grow the available space of an XML buffer.</info>
       <return type='int' info='the new available space or -1 in case of error'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer'/>
       <arg name='len' type='unsigned int' info='the minimum free size to allocate'/>
     </function>
-    <function name='xmlBufferLength' file='tree' module='tree'>
+    <function name='xmlBufferLength' file='tree' module='buf'>
       <info>Function to get the length of a buffer</info>
       <return type='int' info='the length of data in the internal content'/>
       <arg name='buf' type='const xmlBuffer *' info='the buffer'/>
     </function>
-    <function name='xmlBufferResize' file='tree' module='tree'>
-      <info>Resize a buffer to accommodate minimum size of @size.</info>
+    <function name='xmlBufferResize' file='tree' module='buf'>
+      <info>DEPRECATED: Don&apos;t use. Resize a buffer to accommodate minimum size of @size.</info>
       <return type='int' info='0 in case of problems, 1 otherwise'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to resize'/>
       <arg name='size' type='unsigned int' info='the desired size'/>
     </function>
-    <function name='xmlBufferSetAllocationScheme' file='tree' module='tree'>
-      <info>Sets the allocation scheme for this buffer</info>
+    <function name='xmlBufferSetAllocationScheme' file='tree' module='buf'>
+      <info>Sets the allocation scheme for this buffer.  For libxml2 before 2.14, it is recommended to set this to XML_BUFFER_ALLOC_DOUBLE_IT. Has no effect on 2.14 or later.</info>
       <return type='void'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to tune'/>
       <arg name='scheme' type='xmlBufferAllocationScheme' info='allocation scheme to use'/>
     </function>
-    <function name='xmlBufferShrink' file='tree' module='tree'>
-      <info>Remove the beginning of an XML buffer.</info>
+    <function name='xmlBufferShrink' file='tree' module='buf'>
+      <info>DEPRECATED: Don&apos;t use.  Remove the beginning of an XML buffer.</info>
       <return type='int' info='the number of #xmlChar removed, or -1 in case of failure.'/>
       <arg name='buf' type='xmlBufferPtr' info='the buffer to dump'/>
       <arg name='len' type='unsigned int' info='the number of xmlChar to remove'/>
     </function>
-    <function name='xmlBufferWriteCHAR' file='tree' module='tree'>
+    <function name='xmlBufferWriteCHAR' file='tree' module='buf'>
       <info>routine which manages and grows an output buffer. This one adds xmlChars at the end of the buffer.</info>
       <return type='void'/>
       <arg name='buf' type='xmlBufferPtr' info='the XML buffer'/>
       <arg name='string' type='const xmlChar *' info='the string to add'/>
     </function>
-    <function name='xmlBufferWriteChar' file='tree' module='tree'>
+    <function name='xmlBufferWriteChar' file='tree' module='buf'>
       <info>routine which manage and grows an output buffer. This one add C chars at the end of the array.</info>
       <return type='void'/>
       <arg name='buf' type='xmlBufferPtr' info='the XML buffer output'/>
       <arg name='string' type='const char *' info='the string to add'/>
     </function>
-    <function name='xmlBufferWriteQuotedString' file='tree' module='tree'>
+    <function name='xmlBufferWriteQuotedString' file='tree' module='buf'>
       <info>routine which manage and grows an output buffer. This one writes a quoted or double quoted #xmlChar string, checking first if it holds quote or double-quotes internally</info>
       <return type='void'/>
       <arg name='buf' type='xmlBufferPtr' info='the XML buffer output'/>
@@ -8586,7 +7891,7 @@
       <arg name='base' type='const xmlChar *' info='the base value'/>
     </function>
     <function name='xmlBuildRelativeURISafe' file='uri' module='uri'>
-      <info>Expresses the URI of the reference in terms relative to the base.  Some examples of this operation include: base = &quot;http://site1.com/docs/book1.html&quot; URI input                        URI returned docs/pic1.gif                    pic1.gif docs/img/pic1.gif                img/pic1.gif img/pic1.gif                     ../img/pic1.gif http://site1.com/docs/pic1.gif   pic1.gif http://site2.com/docs/pic1.gif   http://site2.com/docs/pic1.gif  base = &quot;docs/book1.html&quot; URI input                        URI returned docs/pic1.gif                    pic1.gif docs/img/pic1.gif                img/pic1.gif img/pic1.gif                     ../img/pic1.gif http://site1.com/docs/pic1.gif   http://site1.com/docs/pic1.gif   Note: if the URI reference is really weird or complicated, it may be worthwhile to first convert it into a &quot;nice&quot; one by calling xmlBuildURI (using &apos;base&apos;) before calling this routine, since this routine (for reasonable efficiency) assumes URI has already been through some validation.  Available since 2.13.0.</info>
+      <info>Expresses the URI of the reference in terms relative to the base. Some examples of this operation include:  base = &quot;http://site1.com/docs/book1.html&quot; URI input                        URI returned http://site1.com/docs/pic1.gif   pic1.gif http://site2.com/docs/pic1.gif   http://site2.com/docs/pic1.gif  base = &quot;docs/book1.html&quot; URI input                        URI returned docs/pic1.gif                    pic1.gif docs/img/pic1.gif                img/pic1.gif img/pic1.gif                     ../img/pic1.gif http://site1.com/docs/pic1.gif   http://site1.com/docs/pic1.gif  Available since 2.13.0.</info>
       <return type='int' info='0 on success, -1 if a memory allocation failed or an error code if URI or base are invalid.'/>
       <arg name='URI' type='const xmlChar *' info='the URI reference under consideration'/>
       <arg name='base' type='const xmlChar *' info='the base value'/>
@@ -8606,7 +7911,7 @@
       <arg name='valPtr' type='xmlChar **' info='pointer to result URI'/>
     </function>
     <function name='xmlByteConsumed' file='parser' module='encoding'>
-      <info>This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.</info>
+      <info>DEPRECATED: Don&apos;t use.  This function provides the current index of the parser relative to the start of the current entity. This function is computed in bytes from the beginning starting at zero and finishing at the size in byte of the file if parsing a file. The function is of constant cost if the input is UTF-8 but can be costly if run on non-UTF-8 input.</info>
       <return type='long' info='the index in bytes from the beginning of the entity or -1 in case the index could not be computed.'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
@@ -8708,7 +8013,7 @@
     </function>
     <function name='xmlCatalogGetDefaults' file='catalog' module='catalog'>
       <cond>defined(LIBXML_CATALOG_ENABLED)</cond>
-      <info>Used to get the user preference w.r.t. to what catalogs should be accepted</info>
+      <info>DEPRECATED: Use XML_PARSE_NO_SYS_CATALOG and XML_PARSE_CATALOG_PI.  Used to get the user preference w.r.t. to what catalogs should be accepted</info>
       <return type='xmlCatalogAllow' info='the current xmlCatalogAllow value'/>
     </function>
     <function name='xmlCatalogGetPublic' file='catalog' module='catalog'>
@@ -8783,21 +8088,44 @@
     </function>
     <function name='xmlCatalogSetDefaultPrefer' file='catalog' module='catalog'>
       <cond>defined(LIBXML_CATALOG_ENABLED)</cond>
-      <info>Allows to set the preference between public and system for deletion in XML Catalog resolution. C.f. section 4.1.1 of the spec Values accepted are XML_CATA_PREFER_PUBLIC or XML_CATA_PREFER_SYSTEM</info>
+      <info>DEPRECATED: This setting is global and not thread-safe.  Allows to set the preference between public and system for deletion in XML Catalog resolution. C.f. section 4.1.1 of the spec Values accepted are XML_CATA_PREFER_PUBLIC or XML_CATA_PREFER_SYSTEM</info>
       <return type='xmlCatalogPrefer' info='the previous value of the default preference for delegation'/>
       <arg name='prefer' type='xmlCatalogPrefer' info='the default preference for delegation'/>
     </function>
     <function name='xmlCatalogSetDefaults' file='catalog' module='catalog'>
       <cond>defined(LIBXML_CATALOG_ENABLED)</cond>
-      <info>Used to set the user preference w.r.t. to what catalogs should be accepted</info>
+      <info>DEPRECATED: Use XML_PARSE_NO_SYS_CATALOG and XML_PARSE_CATALOG_PI.  Used to set the user preference w.r.t. to what catalogs should be accepted</info>
       <return type='void'/>
       <arg name='allow' type='xmlCatalogAllow' info='what catalogs should be accepted'/>
     </function>
     <function name='xmlCharEncCloseFunc' file='encoding' module='encoding'>
-      <info>Generic front-end for encoding handler close function</info>
-      <return type='int' info='0 if success, or -1 in case of error'/>
+      <info>Releases an xmlCharEncodingHandler. Must be called after a handler is no longer in use.</info>
+      <return type='int' info='0.'/>
       <arg name='handler' type='xmlCharEncodingHandler *' info='char encoding transformation data structure'/>
     </function>
+    <functype name='xmlCharEncConvCtxtDtor' file='encoding' module='encoding'>
+      <info>Free a conversion context.</info>
+      <return type='void'/>
+      <arg name='vctxt' type='void *' info='conversion context'/>
+    </functype>
+    <functype name='xmlCharEncConvFunc' file='encoding' module='encoding'>
+      <info>Convert between character encodings.  The value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced.  If the converter can consume partial multi-byte sequences, the @flush flag can be used to detect truncated sequences at EOF. Otherwise, the flag can be ignored.</info>
+      <return type='xmlCharEncError' info='an XML_ENC_ERR code.'/>
+      <arg name='vctxt' type='void *' info='conversion context'/>
+      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
+      <arg name='outlen' type='int *' info='the length of @out'/>
+      <arg name='in' type='const unsigned char *' info='a pointer to an array of input bytes'/>
+      <arg name='inlen' type='int *' info='the length of @in'/>
+      <arg name='flush' type='int' info='end of input'/>
+    </functype>
+    <functype name='xmlCharEncConvImpl' file='encoding' module='encoding'>
+      <info>If this function returns XML_ERR_OK, it must fill the @out pointer with an encoding handler. The handler can be obtained from xmlCharEncNewCustomHandler.  @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.</info>
+      <return type='xmlParserErrors' info='an xmlParserErrors code.'/>
+      <arg name='vctxt' type='void *' info='user data'/>
+      <arg name='name' type='const char *' info='encoding name'/>
+      <arg name='flags' type='xmlCharEncFlags' info='bit mask of flags'/>
+      <arg name='out' type='xmlCharEncodingHandler **' info='pointer to resulting handler'/>
+    </functype>
     <function name='xmlCharEncFirstLine' file='encoding' module='encoding'>
       <info>DEPERECATED: Don&apos;t use.</info>
       <return type='int' info='the number of bytes written or an XML_ENC_ERR code.'/>
@@ -8812,6 +8140,17 @@
       <arg name='out' type='xmlBufferPtr' info='an xmlBuffer for the output.'/>
       <arg name='in' type='xmlBufferPtr' info='an xmlBuffer for the input'/>
     </function>
+    <function name='xmlCharEncNewCustomHandler' file='encoding' module='encoding'>
+      <info>Create a custom xmlCharEncodingHandler.</info>
+      <return type='xmlParserErrors' info='an xmlParserErrors code.'/>
+      <arg name='name' type='const char *' info='the encoding name'/>
+      <arg name='input' type='xmlCharEncConvFunc' info='input callback which converts to UTF-8'/>
+      <arg name='output' type='xmlCharEncConvFunc' info='output callback which converts from UTF-8'/>
+      <arg name='ctxtDtor' type='xmlCharEncConvCtxtDtor' info='context destructor'/>
+      <arg name='inputCtxt' type='void *' info='context for input callback'/>
+      <arg name='outputCtxt' type='void *' info='context for output callback'/>
+      <arg name='out' type='xmlCharEncodingHandler **' info='pointer to resulting handler'/>
+    </function>
     <function name='xmlCharEncOutFunc' file='encoding' module='encoding'>
       <info>Generic front-end for the encoding handler output function a first call with @in == NULL has to be made firs to initiate the output in case of non-stateless encoding needing to initiate their state or the output (like the BOM in UTF16). In case of UTF8 sequence conversion errors for the given encoder, the content will be automatically remapped to a CharRef sequence.</info>
       <return type='int' info='the number of bytes written or an XML_ENC_ERR code.'/>
@@ -8820,16 +8159,16 @@
       <arg name='in' type='xmlBufferPtr' info='an xmlBuffer for the input'/>
     </function>
     <functype name='xmlCharEncodingInputFunc' file='encoding' module='encoding'>
-      <info>Take a block of chars in the original encoding and try to convert it to an UTF-8 block of chars out.</info>
-      <return type='int' info='the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets consumed.'/>
+      <info>Convert characters to UTF-8.  On success, the value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced.</info>
+      <return type='int' info='the number of bytes written or an XML_ENC_ERR code.'/>
       <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the UTF-8 result'/>
       <arg name='outlen' type='int *' info='the length of @out'/>
       <arg name='in' type='const unsigned char *' info='a pointer to an array of chars in the original encoding'/>
       <arg name='inlen' type='int *' info='the length of @in'/>
     </functype>
     <functype name='xmlCharEncodingOutputFunc' file='encoding' module='encoding'>
-      <info>Take a block of UTF-8 chars in and try to convert it to another encoding. Note: a first call designed to produce heading info is called with in = NULL. If stateful this should also initialize the encoder state.</info>
-      <return type='int' info='the number of bytes written, -1 if lack of space, or -2 if the transcoding failed. The value of @inlen after return is the number of octets consumed if the return value is positive, else unpredictiable. The value of @outlen after return is the number of octets produced.'/>
+      <info>Convert characters from UTF-8.  On success, the value of @inlen after return is the number of bytes consumed and @outlen is the number of bytes produced.</info>
+      <return type='int' info='the number of bytes written or an XML_ENC_ERR code.'/>
       <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
       <arg name='outlen' type='int *' info='the length of @out'/>
       <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
@@ -8870,7 +8209,7 @@
     </function>
     <function name='xmlCheckThreadLocalStorage' file='threads' module='globals'>
       <info>Check whether thread-local storage could be allocated.  In cross-platform code running in multithreaded environments, this function should be called once in each thread before calling other library functions to make sure that thread-local storage was allocated properly.</info>
-      <return type='int' info='0 on success or -1 if a memory allocation failed. A failed allocation signals a typically fatal and irrecoverable out-of-memory situation. Don&apos;t call any library functions in this case.  This function never fails if the library is compiled with support for thread-local storage.  This function never fails for the &quot;main&quot; thread which is the first thread calling xmlInitParser.  Available since v2.12.0.'/>
+      <return type='int' info='0 on success or -1 if a memory allocation failed. A failed allocation signals a typically fatal and irrecoverable out-of-memory situation. Don&apos;t call any library functions in this case.  Available since 2.12.0.'/>
     </function>
     <function name='xmlCheckUTF8' file='xmlstring' module='xmlstring'>
       <info>Checks @utf for being valid UTF-8. @utf is assumed to be null-terminated. This function is not super-strict, as it will allow longer UTF-8 sequences than necessary. Note that Java is capable of producing these sequences if provoked. Also note, this routine checks for the 4-byte maximum size, but does not check for 0x10ffff maximum value.</info>
@@ -8878,7 +8217,6 @@
       <arg name='utf' type='const unsigned char *' info='Pointer to putative UTF-8 encoded string.'/>
     </function>
     <function name='xmlChildElementCount' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Count the number of child nodes which are elements.  Note that entity references are not expanded.</info>
       <return type='unsigned long' info='the number of element children or 0 if arguments are invalid.'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
@@ -8888,7 +8226,7 @@
       <return type='void'/>
     </function>
     <function name='xmlCleanupEncodingAliases' file='encoding' module='encoding'>
-      <info>Unregisters all aliases</info>
+      <info>DEPRECATED: This function modifies global state and is not thread-safe.  Unregisters all aliases</info>
       <return type='void'/>
     </function>
     <function name='xmlCleanupGlobals' file='parser' module='globals'>
@@ -8909,12 +8247,7 @@
       <return type='void'/>
     </function>
     <function name='xmlCleanupParser' file='parser' module='threads'>
-      <info>This function name is somewhat misleading. It does not clean up parser state, it cleans up memory allocated by the library itself. It is a cleanup function for the XML library. It tries to reclaim all related global memory allocated for the library processing. It doesn&apos;t deallocate any document related memory. One should call xmlCleanupParser() only when the process has finished using the library and all XML/HTML documents built with it. See also xmlInitParser() which has the opposite function of preparing the library for operations.  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&apos;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 !</info>
-      <return type='void'/>
-    </function>
-    <function name='xmlCleanupPredefinedEntities' file='entities' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Cleanup up the predefined entities table. Deprecated call</info>
+      <info>This function is named somewhat misleadingly. It does not clean up parser state but global memory allocated by the library itself.  Since 2.9.11, cleanup is performed automatically if a shared or dynamic libxml2 library is unloaded. This function should only be used to avoid false positives from memory leak checkers in static builds.  WARNING: xmlCleanupParser assumes that all other threads that called libxml2 functions have terminated. No library calls must be made after calling this function. In general, THIS FUNCTION SHOULD ONLY BE CALLED RIGHT BEFORE THE WHOLE PROCESS EXITS.</info>
       <return type='void'/>
     </function>
     <function name='xmlCleanupThreads' file='threads' module='threads'>
@@ -8938,63 +8271,57 @@
       <arg name='catal' type='xmlCatalogPtr' info='the catalog'/>
     </function>
     <function name='xmlCopyAttributeTable' file='valid' module='valid'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
-      <info>Build a copy of an attribute table.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Build a copy of an attribute table.</info>
       <return type='xmlAttributeTablePtr' info='the new xmlAttributeTablePtr or NULL in case of error.'/>
       <arg name='table' type='xmlAttributeTablePtr' info='An attribute table'/>
     </function>
     <function name='xmlCopyChar' file='parserInternals' module='parserInternals'>
-      <info>append the char value in the array</info>
+      <info>DEPRECATED: Don&apos;t use.  append the char value in the array</info>
       <return type='int' info='the number of xmlChar written'/>
       <arg name='len' type='int' info='Ignored, compatibility'/>
       <arg name='out' type='xmlChar *' info='pointer to an array of xmlChar'/>
       <arg name='val' type='int' info='the char value'/>
     </function>
     <function name='xmlCopyCharMultiByte' file='parserInternals' module='parserInternals'>
-      <info>append the char value in the array</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  append the char value in the array</info>
       <return type='int' info='the number of xmlChar written'/>
       <arg name='out' type='xmlChar *' info='pointer to an array of xmlChar'/>
       <arg name='val' type='int' info='the char value'/>
     </function>
     <function name='xmlCopyDoc' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Copy a document. If recursive, the content tree will be copied too as well as DTD, namespaces and entities.</info>
       <return type='xmlDocPtr' info='the copied document or NULL if a memory allocation failed.'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='recursive' type='int' info='if not zero do a recursive copy.'/>
     </function>
     <function name='xmlCopyDocElementContent' file='valid' module='valid'>
-      <info>Build a copy of an element content description.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Build a copy of an element content description.</info>
       <return type='xmlElementContentPtr' info='the new xmlElementContentPtr or NULL in case of error.'/>
       <arg name='doc' type='xmlDocPtr' info='the document owning the element declaration'/>
       <arg name='cur' type='xmlElementContentPtr' info='An element content pointer.'/>
     </function>
     <function name='xmlCopyDtd' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Copy a DTD.</info>
       <return type='xmlDtdPtr' info='the copied DTD or NULL if a memory allocation failed.'/>
       <arg name='dtd' type='xmlDtdPtr' info='the DTD'/>
     </function>
     <function name='xmlCopyElementContent' file='valid' module='valid'>
-      <info>Build a copy of an element content description. Deprecated, use xmlCopyDocElementContent instead</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Build a copy of an element content description. Deprecated, use xmlCopyDocElementContent instead</info>
       <return type='xmlElementContentPtr' info='the new xmlElementContentPtr or NULL in case of error.'/>
       <arg name='cur' type='xmlElementContentPtr' info='An element content pointer.'/>
     </function>
     <function name='xmlCopyElementTable' file='valid' module='valid'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
-      <info>Build a copy of an element table.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Build a copy of an element table.</info>
       <return type='xmlElementTablePtr' info='the new xmlElementTablePtr or NULL in case of error.'/>
       <arg name='table' type='xmlElementTablePtr' info='An element table'/>
     </function>
     <function name='xmlCopyEntitiesTable' file='entities' module='entities'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Build a copy of an entity table.</info>
       <return type='xmlEntitiesTablePtr' info='the new xmlEntitiesTablePtr or NULL in case of error.'/>
       <arg name='table' type='xmlEntitiesTablePtr' info='An entity table'/>
     </function>
     <function name='xmlCopyEnumeration' file='valid' module='valid'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
-      <info>Copy an enumeration attribute node (recursive).</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Copy an enumeration attribute node (recursive).</info>
       <return type='xmlEnumerationPtr' info='the xmlEnumerationPtr just created or NULL in case of error.'/>
       <arg name='cur' type='xmlEnumerationPtr' info='the tree to copy.'/>
     </function>
@@ -9026,8 +8353,7 @@
       <arg name='node' type='xmlNodePtr' info='the first node in the list.'/>
     </function>
     <function name='xmlCopyNotationTable' file='valid' module='valid'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
-      <info>Build a copy of a notation table.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Build a copy of a notation table.</info>
       <return type='xmlNotationTablePtr' info='the new xmlNotationTablePtr or NULL in case of error.'/>
       <arg name='table' type='xmlNotationTablePtr' info='A notation table'/>
     </function>
@@ -9043,6 +8369,15 @@
       <arg name='target' type='xmlNodePtr' info='the element where the attributes will be grafted'/>
       <arg name='cur' type='xmlAttrPtr' info='the first attribute'/>
     </function>
+    <function name='xmlCreateCharEncodingHandler' file='encoding' module='encoding'>
+      <info>Find or create a handler matching the encoding. The following converters are looked up in order:  - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - Custom implementation if provided - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled  The handler must be closed with xmlCharEncCloseFunc.  If the encoding is UTF-8, a NULL handler and no error code will be returned.  @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.  Available since 2.14.0.</info>
+      <return type='xmlParserErrors' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
+      <arg name='name' type='const char *' info='a string describing the char encoding.'/>
+      <arg name='flags' type='xmlCharEncFlags' info='bit mask of flags'/>
+      <arg name='impl' type='xmlCharEncConvImpl' info='a conversion implementation (optional)'/>
+      <arg name='implCtxt' type='void *' info='user data for conversion implementation (optional)'/>
+      <arg name='out' type='xmlCharEncodingHandler **' info='pointer to result'/>
+    </function>
     <function name='xmlCreateDocParserCtxt' file='parser' module='parser'>
       <info>Creates a parser context for an XML in-memory document.</info>
       <return type='xmlParserCtxtPtr' info='the new parser context or NULL'/>
@@ -9060,7 +8395,7 @@
       <arg name='base' type='const xmlChar *' info='a possible base for the target URI'/>
     </function>
     <function name='xmlCreateEnumeration' file='valid' module='valid'>
-      <info>create and initialize an enumeration attribute node.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  create and initialize an enumeration attribute node.</info>
       <return type='xmlEnumerationPtr' info='the xmlEnumerationPtr just created or NULL in case of error.'/>
       <arg name='name' type='const xmlChar *' info='the enumeration name or NULL'/>
     </function>
@@ -9095,8 +8430,8 @@
     </function>
     <function name='xmlCreatePushParserCtxt' file='parser' module='parser'>
       <cond>defined(LIBXML_PUSH_ENABLED)</cond>
-      <info>Create a parser context for using the XML parser in push mode. See xmlParseChunk.  Passing an initial chunk is useless and deprecated.  @filename is used as base URI to fetch external entities and for error reports.</info>
-      <return type='xmlParserCtxtPtr' info='the new parser context or NULL in case of error.'/>
+      <info>Create a parser context for using the XML parser in push mode. See xmlParseChunk.  Passing an initial chunk is useless and deprecated.  The push parser doesn&apos;t support recovery mode or the XML_PARSE_NOBLANKS option.  @filename is used as base URI to fetch external entities and for error reports.</info>
+      <return type='xmlParserCtxtPtr' info='the new parser context or NULL if a memory allocation failed.'/>
       <arg name='sax' type='xmlSAXHandlerPtr' info='a SAX handler (optional)'/>
       <arg name='user_data' type='void *' info='user data for SAX callbacks (optional)'/>
       <arg name='chunk' type='const char *' info='initial chunk (optional, deprecated)'/>
@@ -9118,17 +8453,110 @@
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
-    <function name='xmlCtxtGetLastError' file='xmlerror' module='error'>
+    <function name='xmlCtxtGetCatalogs' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='void *' info='the local catalogs.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetDeclaredEncoding' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='const xmlChar *' info='the encoding from the encoding declaration. This can differ from the actual encoding.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetDict' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='xmlDictPtr' info='the dictionary.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetDocument' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='xmlDocPtr' info='the parsed document or NULL if a fatal error occurred when parsing. The document must be freed by the caller. Resets the context&apos;s document to NULL.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetLastError' file='xmlerror' module='parserInternals'>
       <info>Get the last parsing error registered.</info>
       <return type='const xmlError *' info='NULL if no error occurred or a pointer to the error'/>
       <arg name='ctx' type='void *' info='an XML parser context'/>
     </function>
+    <function name='xmlCtxtGetOptions' file='parser' module='parser'>
+      <info>Get the current options of the parser context.  Available since 2.14.0.</info>
+      <return type='int' info='the current options set in the parser context, or -1 if ctxt is NULL.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
+    </function>
+    <function name='xmlCtxtGetPrivate' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='void *' info='the private application data.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetSaxHandler' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='xmlSAXHandler *' info='the SAX handler struct. This is not a copy and must not be freed. Handlers can be updated.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetStandalone' file='parser' module='parser'>
+      <info>Available since 2.14.0.</info>
+      <return type='int' info='the value from the standalone document declaration.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetStatus' file='parser' module='parserInternals'>
+      <info>Get well-formedness and validation status after parsing. Also reports catastrophic errors which are not related to parsing like out-of-memory, I/O or other errors.  Available since 2.14.0.</info>
+      <return type='xmlParserStatus' info='a bitmask of XML_STATUS_* flags ORed together.'/>
+      <arg name='ctxt' type='xmlParserCtxt *' info='an XML parser context'/>
+    </function>
+    <function name='xmlCtxtGetValidCtxt' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='xmlValidCtxtPtr' info='the validation context.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtGetVersion' file='parser' module='parser'>
+      <info>Available since 2.14.0.</info>
+      <return type='const xmlChar *' info='the version from the XML declaration.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtIsHtml' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='int' info='1 if this is a HTML parser context, 0 otherwise.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtIsStopped' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.</info>
+      <return type='int' info='1 if the parser is stopped, 0 otherwise.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+    </function>
+    <function name='xmlCtxtParseContent' file='parser' module='parser'>
+      <info>Parse a well-balanced chunk of XML matching the &apos;content&apos; production.  Namespaces in scope of @node and entities of @node&apos;s document are recognized. When validating, the DTD of @node&apos;s document is used.  Always consumes @input even in error case.  Available since 2.14.0.</info>
+      <return type='xmlNodePtr' info='a node list or NULL in case of error.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='input' type='xmlParserInputPtr' info='parser input'/>
+      <arg name='node' type='xmlNodePtr' info='target node or document'/>
+      <arg name='hasTextDecl' type='int' info='whether to parse text declaration'/>
+    </function>
     <function name='xmlCtxtParseDocument' file='parser' module='parser'>
       <info>Parse an XML document and return the resulting document tree. Takes ownership of the input object.  Available since 2.13.0.</info>
       <return type='xmlDocPtr' info='the resulting document tree or NULL'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='input' type='xmlParserInputPtr' info='parser input'/>
     </function>
+    <function name='xmlCtxtParseDtd' file='parser' module='parser'>
+      <cond>defined(LIBXML_VALID_ENABLED)</cond>
+      <info>Parse a DTD.  Option XML_PARSE_DTDLOAD should be enabled in the parser context to make external entities work.  Availabe since 2.14.0.</info>
+      <return type='xmlDtdPtr' info='the resulting xmlDtdPtr or NULL in case of error. @input will be freed by the function in any case.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='a parser context'/>
+      <arg name='input' type='xmlParserInputPtr' info='a parser input'/>
+      <arg name='publicId' type='const xmlChar *' info='public ID of the DTD (optional)'/>
+      <arg name='systemId' type='const xmlChar *' info='system ID of the DTD (optional)'/>
+    </function>
+    <function name='xmlCtxtPopInput' file='parserInternals' module='parser'>
+      <info>Pops the top parser input from the input stack</info>
+      <return type='xmlParserInputPtr' info='the input just removed'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
+    </function>
+    <function name='xmlCtxtPushInput' file='parserInternals' module='parser'>
+      <info>Pushes a new parser input on top of the input 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='xmlParserInputPtr' info='the parser input'/>
+    </function>
     <function name='xmlCtxtReadDoc' file='parser' module='parser'>
       <info>Parse an XML in-memory document and build a tree.  @URL is used as base to resolve external entities and for error reporting.  See xmlCtxtUseOptions for details.</info>
       <return type='xmlDocPtr' info='the resulting document tree'/>
@@ -9148,7 +8576,7 @@
       <arg name='options' type='int' info='a combination of xmlParserOption'/>
     </function>
     <function name='xmlCtxtReadFile' file='parser' module='parser'>
-      <info>Parse an XML file from the filesystem, the network or a user-defined resource loader.</info>
+      <info>Parse an XML file from the filesystem, the network or a user-defined resource loader.  This function always enables the XML_PARSE_UNZIP option for backward compatibility. This feature is potentially insecure and might be removed from later versions.</info>
       <return type='xmlDocPtr' info='the resulting document tree'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='filename' type='const char *' info='a file or URL'/>
@@ -9181,7 +8609,7 @@
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
-    <function name='xmlCtxtResetLastError' file='xmlerror' module='error'>
+    <function name='xmlCtxtResetLastError' file='xmlerror' module='parserInternals'>
       <info>Cleanup the last global error registered. For parsing error this does not change the well-formedness result.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='an XML parser context'/>
@@ -9195,6 +8623,25 @@
       <arg name='filename' type='const char *' info='an optional file name or URI'/>
       <arg name='encoding' type='const char *' info='the document encoding, or NULL'/>
     </function>
+    <function name='xmlCtxtSetCatalogs' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.  Set the local catalogs.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='catalogs' type='void *' info='catalogs pointer'/>
+    </function>
+    <function name='xmlCtxtSetCharEncConvImpl' file='parser' module='parserInternals'>
+      <info>Installs a custom implementation to convert between character encodings.  This bypasses legacy feature like global encoding handlers or encoding aliases.  Available since 2.14.0.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='impl' type='xmlCharEncConvImpl' info='callback'/>
+      <arg name='vctxt' type='void *' info='user data'/>
+    </function>
+    <function name='xmlCtxtSetDict' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.  Set the dictionary. This should only be done immediately after creating a parser context.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='dict' type='xmlDictPtr' info='dictionary'/>
+    </function>
     <function name='xmlCtxtSetErrorHandler' file='parser' module='parserInternals'>
       <info>Register a callback function that will be called on errors and warnings. If handler is NULL, the error handler will be deactivated.  This is the recommended way to collect errors from the parser and takes precedence over all other error reporting mechanisms. These are (in order of precedence):  - per-context structured handler (xmlCtxtSetErrorHandler) - per-context structured &quot;serror&quot; SAX handler - global structured handler (xmlSetStructuredErrorFunc) - per-context generic &quot;error&quot; and &quot;warning&quot; SAX handlers - global generic handler (xmlSetGenericErrorFunc) - print to stderr  Available since 2.13.0.</info>
       <return type='void'/>
@@ -9209,17 +8656,51 @@
       <arg name='maxAmpl' type='unsigned' info='maximum amplification factor'/>
     </function>
     <function name='xmlCtxtSetOptions' file='parser' module='parser'>
-      <info>Applies the options to the parser context. Unset options are cleared.  Available since 2.13.0. With older versions, you can use xmlCtxtUseOptions.  XML_PARSE_RECOVER  Enable &quot;recovery&quot; mode which allows non-wellformed documents. How this mode behaves exactly is unspecified and may change without further notice. Use of this feature is DISCOURAGED.  XML_PARSE_NOENT  Despite the confusing name, this option enables substitution of entities. The resulting tree won&apos;t contain any entity reference nodes.  This option also enables loading of external entities (both general and parameter entities) which is dangerous. If you process untrusted data, it&apos;s recommended to set the XML_PARSE_NO_XXE option to disable loading of external entities.  XML_PARSE_DTDLOAD  Enables loading of an external DTD and the loading and substitution of external parameter entities. Has no effect if XML_PARSE_NO_XXE is set.  XML_PARSE_DTDATTR  Adds default attributes from the DTD to the result document.  Implies XML_PARSE_DTDLOAD, but loading of external content can be disabled with XML_PARSE_NO_XXE.  XML_PARSE_DTDVALID  This option enables DTD validation which requires to load external DTDs and external entities (both general and parameter entities) unless XML_PARSE_NO_XXE was set.  XML_PARSE_NO_XXE  Disables loading of external DTDs or entities.  XML_PARSE_NOERROR  Disable error and warning reports to the error handlers. Errors are still accessible with xmlCtxtGetLastError.  XML_PARSE_NOWARNING  Disable warning reports.  XML_PARSE_PEDANTIC  Enable some pedantic warnings.  XML_PARSE_NOBLANKS  Remove some text nodes containing only whitespace from the result document. Which nodes are removed depends on DTD element declarations or a conservative heuristic. The reindenting feature of the serialization code relies on this option to be set when parsing. Use of this option is DISCOURAGED.  XML_PARSE_SAX1  Always invoke the deprecated SAX1 startElement and endElement handlers. This option is DEPRECATED.  XML_PARSE_NONET  Disable network access with the builtin HTTP and FTP clients.  XML_PARSE_NODICT  Create a document without interned strings, making all strings separate memory allocations.  XML_PARSE_NSCLEAN  Remove redundant namespace declarations from the result document.  XML_PARSE_NOCDATA  Output normal text nodes instead of CDATA nodes.  XML_PARSE_COMPACT  Store small strings directly in the node struct to save memory.  XML_PARSE_OLD10  Use old Name productions from before XML 1.0 Fifth Edition. This options is DEPRECATED.  XML_PARSE_HUGE  Relax some internal limits.  Maximum size of text nodes, tags, comments, processing instructions, CDATA sections, entity values  normal: 10M huge:    1B  Maximum size of names, system literals, pubid literals  normal: 50K huge:   10M  Maximum nesting depth of elements  normal:  256 huge:   2048  Maximum nesting depth of entities  normal: 20 huge:   40  XML_PARSE_OLDSAX  Enable an unspecified legacy mode for SAX parsers. This option is DEPRECATED.  XML_PARSE_IGNORE_ENC  Ignore the encoding in the XML declaration. This option is mostly unneeded these days. The only effect is to enforce UTF-8 decoding of ASCII-like data.  XML_PARSE_BIG_LINES  Enable reporting of line numbers larger than 65535.</info>
+      <info>Applies the options to the parser context. Unset options are cleared.  Available since 2.13.0. With older versions, you can use xmlCtxtUseOptions.  XML_PARSE_RECOVER  Enable &quot;recovery&quot; mode which allows non-wellformed documents. How this mode behaves exactly is unspecified and may change without further notice. Use of this feature is DISCOURAGED.  Not supported by the push parser.  XML_PARSE_NOENT  Despite the confusing name, this option enables substitution of entities. The resulting tree won&apos;t contain any entity reference nodes.  This option also enables loading of external entities (both general and parameter entities) which is dangerous. If you process untrusted data, it&apos;s recommended to set the XML_PARSE_NO_XXE option to disable loading of external entities.  XML_PARSE_DTDLOAD  Enables loading of an external DTD and the loading and substitution of external parameter entities. Has no effect if XML_PARSE_NO_XXE is set.  XML_PARSE_DTDATTR  Adds default attributes from the DTD to the result document.  Implies XML_PARSE_DTDLOAD, but loading of external content can be disabled with XML_PARSE_NO_XXE.  XML_PARSE_DTDVALID  This option enables DTD validation which requires to load external DTDs and external entities (both general and parameter entities) unless XML_PARSE_NO_XXE was set.  XML_PARSE_NO_XXE  Disables loading of external DTDs or entities.  Available since 2.13.0.  XML_PARSE_NOERROR  Disable error and warning reports to the error handlers. Errors are still accessible with xmlCtxtGetLastError.  XML_PARSE_NOWARNING  Disable warning reports.  XML_PARSE_PEDANTIC  Enable some pedantic warnings.  XML_PARSE_NOBLANKS  Remove some whitespace from the result document. Where to remove whitespace depends on DTD element declarations or a broken heuristic with unfixable bugs. Use of this option is DISCOURAGED.  Not supported by the push parser.  XML_PARSE_SAX1  Always invoke the deprecated SAX1 startElement and endElement handlers. This option is DEPRECATED.  XML_PARSE_NONET  Disable network access with the builtin HTTP client.  XML_PARSE_NODICT  Create a document without interned strings, making all strings separate memory allocations.  XML_PARSE_NSCLEAN  Remove redundant namespace declarations from the result document.  XML_PARSE_NOCDATA  Output normal text nodes instead of CDATA nodes.  XML_PARSE_COMPACT  Store small strings directly in the node struct to save memory.  XML_PARSE_OLD10  Use old Name productions from before XML 1.0 Fifth Edition. This options is DEPRECATED.  XML_PARSE_HUGE  Relax some internal limits.  Maximum size of text nodes, tags, comments, processing instructions, CDATA sections, entity values  normal: 10M huge:    1B  Maximum size of names, system literals, pubid literals  normal: 50K huge:   10M  Maximum nesting depth of elements  normal:  256 huge:   2048  Maximum nesting depth of entities  normal: 20 huge:   40  XML_PARSE_OLDSAX  Enable an unspecified legacy mode for SAX parsers. This option is DEPRECATED.  XML_PARSE_IGNORE_ENC  Ignore the encoding in the XML declaration. This option is mostly unneeded these days. The only effect is to enforce UTF-8 decoding of ASCII-like data.  XML_PARSE_BIG_LINES  Enable reporting of line numbers larger than 65535.  XML_PARSE_UNZIP  Enable input decompression. Setting this option is discouraged to avoid zip bombs.  Available since 2.14.0.  XML_PARSE_NO_SYS_CATALOG  Disables the global system XML catalog.  Available since 2.14.0.  XML_PARSE_CATALOG_PI  Enable XML catalog processing instructions.  Available since 2.14.0.</info>
       <return type='int' info='0 in case of success, the set of unknown or unimplemented options in case of error.'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='options' type='int' info='a bitmask of xmlParserOption values'/>
     </function>
+    <function name='xmlCtxtSetPrivate' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.  Set the private application data.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='priv' type='void *' info='private application data'/>
+    </function>
+    <function name='xmlCtxtSetResourceLoader' file='parser' module='parserInternals'>
+      <info>Installs a custom callback to load documents, DTDs or external entities.  Available since 2.14.0.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='loader' type='xmlResourceLoader' info='callback'/>
+      <arg name='vctxt' type='void *' info='user data'/>
+    </function>
+    <function name='xmlCtxtSetSaxHandler' file='parser' module='parserInternals'>
+      <info>Available since 2.14.0.  Set the SAX handler struct to a copy of @sax.</info>
+      <return type='int' info='0 on success or -1 if arguments are invalid or a memory allocation failed.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='parser context'/>
+      <arg name='sax' type='const xmlSAXHandler *' info='SAX handler'/>
+    </function>
     <function name='xmlCtxtUseOptions' file='parser' module='parser'>
       <info>DEPRECATED: Use xmlCtxtSetOptions.  Applies the options to the parser context. The following options are never cleared and can only be enabled:  XML_PARSE_NOERROR XML_PARSE_NOWARNING XML_PARSE_NONET XML_PARSE_NSCLEAN XML_PARSE_NOCDATA XML_PARSE_COMPACT XML_PARSE_OLD10 XML_PARSE_HUGE XML_PARSE_OLDSAX XML_PARSE_IGNORE_ENC XML_PARSE_BIG_LINES</info>
       <return type='int' info='0 in case of success, the set of unknown or unimplemented options in case of error.'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='options' type='int' info='a combination of xmlParserOption'/>
     </function>
+    <function name='xmlCtxtValidateDocument' file='parser' module='valid'>
+      <cond>defined(LIBXML_VALID_ENABLED)</cond>
+      <info>Validate a document.  Like xmlValidateDocument but uses the parser context&apos;s error handler.  Option XML_PARSE_DTDLOAD should be enabled in the parser context to make external entities work.  Availabe since 2.14.0.</info>
+      <return type='int' info='1 if valid or 0 otherwise.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='a parser context'/>
+      <arg name='doc' type='xmlDocPtr' info='a document instance'/>
+    </function>
+    <function name='xmlCtxtValidateDtd' file='parser' module='valid'>
+      <cond>defined(LIBXML_VALID_ENABLED)</cond>
+      <info>Validate a document against a DTD.  Like xmlValidateDtd but uses the parser context&apos;s error handler.  Availabe since 2.14.0.</info>
+      <return type='int' info='1 if valid or 0 otherwise.'/>
+      <arg name='ctxt' type='xmlParserCtxtPtr' info='a parser context'/>
+      <arg name='doc' type='xmlDocPtr' info='a document instance'/>
+      <arg name='dtd' type='xmlDtdPtr' info='a dtd instance'/>
+    </function>
     <function name='xmlCurrentChar' file='parserInternals' module='parserInternals'>
       <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'/>
@@ -9362,23 +8843,12 @@
       <arg name='output' type='FILE *' info='the FILE * for the output'/>
       <arg name='str' type='const xmlChar *' info='the string'/>
     </function>
-    <function name='xmlDecodeEntities' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>This function is deprecated, we now always process entities content through xmlStringDecodeEntities  TODO: remove it in next major release.  [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='len' type='int' info='the len to decode (in bytes !), -1 for no size limit'/>
-      <arg name='what' type='int' info='combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF'/>
-      <arg name='end' type='xmlChar' info='an end marker xmlChar, 0 if none'/>
-      <arg name='end2' type='xmlChar' info='an end marker xmlChar, 0 if none'/>
-      <arg name='end3' type='xmlChar' info='an end marker xmlChar, 0 if none'/>
-    </function>
     <function name='xmlDefaultSAXHandlerInit' file='SAX2' module='SAX2'>
       <info>DEPRECATED: This function is a no-op. Call xmlInitParser to initialize the library.  Initialize the default SAX2 handler</info>
       <return type='void'/>
     </function>
     <function name='xmlDelEncodingAlias' file='encoding' module='encoding'>
-      <info>Unregisters an encoding alias @alias</info>
+      <info>DEPRECATED: This function modifies global state and is not thread-safe.  Unregisters an encoding alias @alias</info>
       <return type='int' info='0 in case of success, -1 in case of error'/>
       <arg name='alias' type='const char *' info='the alias name as parsed, in UTF-8 format (ASCII actually)'/>
     </function>
@@ -9534,7 +9004,6 @@
       <arg name='doc' type='const xmlDoc *' info='the document'/>
     </function>
     <function name='xmlDocSetRootElement' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)</cond>
       <info>Set the root element of the document (doc-&gt;children is a list containing possibly comments, PIs, etc ...).  @root must be an element node. It is unlinked before insertion.</info>
       <return type='xmlNodePtr' info='the unlinked old root element or NULL if the document didn&apos;t have a root element or a memory allocation failed.'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
@@ -9604,173 +9073,18 @@
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='cur' type='xmlNodePtr' info='the current node'/>
     </function>
-    <function name='xmlEncodeEntities' file='entities' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary compatibility  People must migrate their code to xmlEncodeEntitiesReentrant ! This routine will issue a warning when encountered.</info>
-      <return type='const xmlChar *' info='NULL'/>
-      <arg name='doc' type='xmlDocPtr' info='the document containing the string'/>
-      <arg name='input' type='const xmlChar *' info='A string to convert to XML.'/>
-    </function>
     <function name='xmlEncodeEntitiesReentrant' file='entities' module='entities'>
-      <info>Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated.</info>
+      <info>Do a global encoding of a string, replacing the predefined entities and non ASCII values with their entities and CharRef counterparts. Contrary to xmlEncodeEntities, this routine is reentrant, and result must be deallocated.  This escapes &apos;&lt;&apos;, &apos;&gt;&apos;, &apos;&amp;&apos; and &apos;\r&apos;. If the document has no encoding, non-ASCII codepoints are escaped. There is some special handling for HTML documents.</info>
       <return type='xmlChar *' info='A newly allocated string with the substitution done.'/>
       <arg name='doc' type='xmlDocPtr' info='the document containing the string'/>
       <arg name='input' type='const xmlChar *' info='A string to convert to XML.'/>
     </function>
     <function name='xmlEncodeSpecialChars' file='entities' module='entities'>
-      <info>Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated.</info>
+      <info>Do a global encoding of a string, replacing the predefined entities this routine is reentrant, and result must be deallocated.  This escapes &apos;&lt;&apos;, &apos;&gt;&apos;, &apos;&amp;&apos;, &apos;&quot;&apos; and &apos;\r&apos; chars.</info>
       <return type='xmlChar *' info='A newly allocated string with the substitution done.'/>
-      <arg name='doc' type='const xmlDoc *' info='the document containing the string'/>
+      <arg name='doc' type='const xmlDoc *' info='unused'/>
       <arg name='input' type='const xmlChar *' info='A string to convert to XML.'/>
     </function>
-    <functype name='xmlEntityReferenceFunc' file='parserInternals' module='parserInternals'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Callback function used when one needs to be able to track back the provenance of a chunk of nodes inherited from an entity replacement.</info>
-      <return type='void'/>
-      <arg name='ent' type='xmlEntityPtr' info='the entity'/>
-      <arg name='firstNode' type='xmlNodePtr' info='the fist node in the chunk'/>
-      <arg name='lastNode' type='xmlNodePtr' info='the last nod in the chunk'/>
-    </functype>
-    <function name='xmlExpCtxtNbCons' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Debugging facility provides the number of allocated nodes over lifetime</info>
-      <return type='int' info='the number of nodes ever allocated or -1 in case of error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='an expression context'/>
-    </function>
-    <function name='xmlExpCtxtNbNodes' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Debugging facility provides the number of allocated nodes at a that point</info>
-      <return type='int' info='the number of nodes in use or -1 in case of error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='an expression context'/>
-    </function>
-    <function name='xmlExpDump' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Serialize the expression as compiled to the buffer</info>
-      <return type='void'/>
-      <arg name='buf' type='xmlBufferPtr' info='a buffer to receive the output'/>
-      <arg name='expr' type='xmlExpNodePtr' info='the compiled expression'/>
-    </function>
-    <function name='xmlExpExpDerive' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Evaluates the expression resulting from @exp consuming a sub expression @sub Based on algebraic derivation and sometimes direct Brzozowski derivation it usually takes less than linear time and can handle expressions generating infinite languages.</info>
-      <return type='xmlExpNodePtr' info='the resulting expression or NULL in case of internal error, the result must be freed'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expressions context'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the englobing expression'/>
-      <arg name='sub' type='xmlExpNodePtr' info='the subexpression'/>
-    </function>
-    <function name='xmlExpFree' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Dereference the expression</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the expression'/>
-    </function>
-    <function name='xmlExpFreeCtxt' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Free an expression context</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='an expression context'/>
-    </function>
-    <function name='xmlExpGetLanguage' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Find all the strings used in @exp and store them in @list</info>
-      <return type='int' info='the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the expression'/>
-      <arg name='langList' type='const xmlChar **' info='where to store the tokens'/>
-      <arg name='len' type='int' info='the allocated length of @list'/>
-    </function>
-    <function name='xmlExpGetStart' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Find all the strings that appears at the start of the languages accepted by @exp and store them in @list. E.g. for (a, b) | c it will return the list [a, c]</info>
-      <return type='int' info='the number of unique strings found, -1 in case of errors and -2 if there is more than @len strings'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the expression'/>
-      <arg name='tokList' type='const xmlChar **' info='where to store the tokens'/>
-      <arg name='len' type='int' info='the allocated length of @list'/>
-    </function>
-    <function name='xmlExpIsNillable' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Finds if the expression is nillable, i.e. if it accepts the empty sequence</info>
-      <return type='int' info='1 if nillable, 0 if not and -1 in case of error'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the expression'/>
-    </function>
-    <function name='xmlExpMaxToken' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Indicate the maximum number of input a expression can accept</info>
-      <return type='int' info='the maximum length or -1 in case of error'/>
-      <arg name='expr' type='xmlExpNodePtr' info='a compiled expression'/>
-    </function>
-    <function name='xmlExpNewAtom' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Get the atom associated to this name from that context</info>
-      <return type='xmlExpNodePtr' info='the node or NULL in case of error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='name' type='const xmlChar *' info='the atom name'/>
-      <arg name='len' type='int' info='the atom name length in byte (or -1);'/>
-    </function>
-    <function name='xmlExpNewCtxt' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Creates a new context for manipulating expressions</info>
-      <return type='xmlExpCtxtPtr' info='the context or NULL in case of error'/>
-      <arg name='maxNodes' type='int' info='the maximum number of nodes'/>
-      <arg name='dict' type='xmlDictPtr' info='optional dictionary to use internally'/>
-    </function>
-    <function name='xmlExpNewOr' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Get the atom associated to the choice @left | @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).</info>
-      <return type='xmlExpNodePtr' info='the node or NULL in case of error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='left' type='xmlExpNodePtr' info='left expression'/>
-      <arg name='right' type='xmlExpNodePtr' info='right expression'/>
-    </function>
-    <function name='xmlExpNewRange' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Get the atom associated to the range (@subset){@min, @max} Note that @subset is consumed in the operation, to keep an handle on it use xmlExpRef() and use xmlExpFree() to release it, this is true even in case of failure (unless ctxt == NULL).</info>
-      <return type='xmlExpNodePtr' info='the node or NULL in case of error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='subset' type='xmlExpNodePtr' info='the expression to be repeated'/>
-      <arg name='min' type='int' info='the lower bound for the repetition'/>
-      <arg name='max' type='int' info='the upper bound for the repetition, -1 means infinite'/>
-    </function>
-    <function name='xmlExpNewSeq' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Get the atom associated to the sequence @left , @right Note that @left and @right are consumed in the operation, to keep an handle on them use xmlExpRef() and use xmlExpFree() to release them, this is true even in case of failure (unless ctxt == NULL).</info>
-      <return type='xmlExpNodePtr' info='the node or NULL in case of error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='left' type='xmlExpNodePtr' info='left expression'/>
-      <arg name='right' type='xmlExpNodePtr' info='right expression'/>
-    </function>
-    <function name='xmlExpParse' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Minimal parser for regexps, it understand the following constructs - string terminals - choice operator | - sequence operator , - subexpressions (...) - usual cardinality operators + * and ? - finite sequences  { min, max } - infinite sequences { min, * } There is minimal checkings made especially no checking on strings values</info>
-      <return type='xmlExpNodePtr' info='a new expression or NULL in case of failure'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expressions context'/>
-      <arg name='expr' type='const char *' info='the 0 terminated string'/>
-    </function>
-    <function name='xmlExpRef' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Increase the reference count of the expression</info>
-      <return type='void'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the expression'/>
-    </function>
-    <function name='xmlExpStringDerive' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Do one step of Brzozowski derivation of the expression @exp with respect to the input string</info>
-      <return type='xmlExpNodePtr' info='the resulting expression or NULL in case of internal error'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expression context'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the expression'/>
-      <arg name='str' type='const xmlChar *' info='the string'/>
-      <arg name='len' type='int' info='the string len in bytes if available'/>
-    </function>
-    <function name='xmlExpSubsume' file='xmlregexp' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_EXPR_ENABLED)</cond>
-      <info>Check whether @exp accepts all the languages accepted by @sub the input being a subexpression.</info>
-      <return type='int' info='1 if true 0 if false and -1 in case of failure.'/>
-      <arg name='ctxt' type='xmlExpCtxtPtr' info='the expressions context'/>
-      <arg name='exp' type='xmlExpNodePtr' info='the englobing expression'/>
-      <arg name='sub' type='xmlExpNodePtr' info='the subexpression'/>
-    </function>
     <functype name='xmlExternalEntityLoader' file='parser' module='parser'>
       <info>External entity loaders types.</info>
       <return type='xmlParserInputPtr' info='the entity input parser.'/>
@@ -9801,12 +9115,11 @@
       <arg name='len' type='int' info='number of bytes to write'/>
     </function>
     <function name='xmlFindCharEncodingHandler' file='encoding' module='encoding'>
-      <info>DEPRECATED: Use xmlOpenCharEncodingHandler which has better error reporting.</info>
+      <info>DEPRECATED: Use xmlOpenCharEncodingHandler which has better error reporting.  If the encoding is UTF-8, this will return a no-op handler that shouldn&apos;t be used.</info>
       <return type='xmlCharEncodingHandlerPtr' info='the handler or NULL if no handler was found or an error occurred.'/>
       <arg name='name' type='const char *' info='a string describing the char encoding.'/>
     </function>
     <function name='xmlFirstElementChild' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Find the first child node which is an element.  Note that entity references are not expanded.</info>
       <return type='xmlNodePtr' info='the first element or NULL if parent has no children.'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
@@ -9819,12 +9132,12 @@
       <arg name='data' type='void *' info='user data for callback'/>
     </function>
     <function name='xmlFreeAttributeTable' file='valid' module='valid'>
-      <info>Deallocate the memory used by an entities hash table.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Deallocate the memory used by an entities hash table.</info>
       <return type='void'/>
       <arg name='table' type='xmlAttributeTablePtr' info='An attribute table'/>
     </function>
     <function name='xmlFreeAutomata' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Free an automata</info>
       <return type='void'/>
       <arg name='am' type='xmlAutomataPtr' info='an automata'/>
@@ -9841,7 +9154,7 @@
       <arg name='cur' type='xmlDocPtr' info='pointer to the document'/>
     </function>
     <function name='xmlFreeDocElementContent' file='valid' module='valid'>
-      <info>Free an element content structure. The whole subtree is removed.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Free an element content structure. The whole subtree is removed.</info>
       <return type='void'/>
       <arg name='doc' type='xmlDocPtr' info='the document owning the element declaration'/>
       <arg name='cur' type='xmlElementContentPtr' info='the element content tree to free'/>
@@ -9852,12 +9165,12 @@
       <arg name='cur' type='xmlDtdPtr' info='the DTD structure to free up'/>
     </function>
     <function name='xmlFreeElementContent' file='valid' module='valid'>
-      <info>Free an element content structure. The whole subtree is removed. Deprecated, use xmlFreeDocElementContent instead</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Free an element content structure. The whole subtree is removed. Deprecated, use xmlFreeDocElementContent instead</info>
       <return type='void'/>
       <arg name='cur' type='xmlElementContentPtr' info='the element content tree to free'/>
     </function>
     <function name='xmlFreeElementTable' file='valid' module='valid'>
-      <info>Deallocate the memory used by an element hash table.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Deallocate the memory used by an element hash table.</info>
       <return type='void'/>
       <arg name='table' type='xmlElementTablePtr' info='An element table'/>
     </function>
@@ -9907,7 +9220,7 @@
       <arg name='cur' type='xmlNodePtr' info='the first node in the list'/>
     </function>
     <function name='xmlFreeNotationTable' file='valid' module='valid'>
-      <info>Deallocate the memory used by an entities hash table.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Deallocate the memory used by an entities hash table.</info>
       <return type='void'/>
       <arg name='table' type='xmlNotationTablePtr' info='An notation table'/>
     </function>
@@ -9993,7 +9306,7 @@
       <arg name='cur' type='xmlValidCtxtPtr' info='the validation context to free'/>
     </function>
     <function name='xmlGcMemGet' file='xmlmemory' module='xmlmemory'>
-      <info>Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas  useful for garbage collected memory allocators</info>
+      <info>DEPRECATED: xmlMemGet.  Provides the memory access functions set currently in use The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas  useful for garbage collected memory allocators</info>
       <return type='int' info='0 on success'/>
       <arg name='freeFunc' type='xmlFreeFunc *' info='place to save the free() function in use'/>
       <arg name='mallocFunc' type='xmlMallocFunc *' info='place to save the malloc() function in use'/>
@@ -10002,7 +9315,7 @@
       <arg name='strdupFunc' type='xmlStrdupFunc *' info='place to save the strdup() function in use'/>
     </function>
     <function name='xmlGcMemSetup' file='xmlmemory' module='xmlmemory'>
-      <info>Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas  useful for garbage collected memory allocators  Should this be blocked if there was already some allocations done ?</info>
+      <info>DEPRECATED: Use xmlMemSetup.  Override the default memory access functions with a new set This has to be called before any other libxml routines ! The mallocAtomicFunc is specialized for atomic block allocations (i.e. of areas  useful for garbage collected memory allocators  Should this be blocked if there was already some allocations done ?</info>
       <return type='int' info='0 on success'/>
       <arg name='freeFunc' type='xmlFreeFunc' info='the free() function to use'/>
       <arg name='mallocFunc' type='xmlMallocFunc' info='the malloc() function to use'/>
@@ -10017,8 +9330,8 @@
       <arg name='msg' type='const char *' info='the message'/>
       <arg name='...' type='...' info='the extra arguments of the varargs to format the message'/>
     </functype>
-    <function name='xmlGetBufferAllocationScheme' file='tree' module='tree'>
-      <info>Types are XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, improves performance XML_BUFFER_ALLOC_HYBRID - use exact sizes on small strings to keep memory usage tight in normal usage, and doubleit on large strings to avoid pathological performance.</info>
+    <function name='xmlGetBufferAllocationScheme' file='tree' module='buf'>
+      <info>DEPRECATED: Use xmlBufferSetAllocationScheme.  Types are XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, improves performance XML_BUFFER_ALLOC_HYBRID - use exact sizes on small strings to keep memory usage tight in normal usage, and doubleit on large strings to avoid pathological performance.</info>
       <return type='xmlBufferAllocationScheme' info='the current allocation scheme'/>
     </function>
     <function name='xmlGetCharEncodingHandler' file='encoding' module='encoding'>
@@ -10087,33 +9400,14 @@
       <arg name='prefix' type='const xmlChar *' info='the element namespace prefix'/>
     </function>
     <function name='xmlGetEncodingAlias' file='encoding' module='encoding'>
-      <info>Lookup an encoding name for the given alias.</info>
+      <info>DEPRECATED: This function is not thread-safe.  Lookup an encoding name for the given alias.</info>
       <return type='const char *' info='NULL if not found, otherwise the original name'/>
       <arg name='alias' type='const char *' info='the alias name as parsed, in UTF-8 format (ASCII actually)'/>
     </function>
     <function name='xmlGetExternalEntityLoader' file='parser' module='parserInternals'>
-      <info>Get the default external entity resolver function for the application</info>
+      <info>DEPRECATED: See xmlSetExternalEntityLoader.  Get the default external entity resolver function for the application</info>
       <return type='xmlExternalEntityLoader' info='the xmlExternalEntityLoader function pointer'/>
     </function>
-    <function name='xmlGetFeature' file='parser' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Read the current value of one feature of this parser instance</info>
-      <return type='int' info='-1 in case or error, 0 otherwise'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML/HTML parser context'/>
-      <arg name='name' type='const char *' info='the feature name'/>
-      <arg name='result' type='void *' info='location to store the result'/>
-    </function>
-    <function name='xmlGetFeaturesList' file='parser' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Copy at most *@len feature names into the @result array</info>
-      <return type='int' info='-1 in case or error, or the total number of features, len is updated with the number of strings copied, strings must not be deallocated'/>
-      <arg name='len' type='int *' info='the length of the features name array (input/output)'/>
-      <arg name='result' type='const char **' info='an array of string to be filled with the features name.'/>
-    </function>
-    <function name='xmlGetGlobalState' file='globals' module='globals'>
-      <info>DEPRECATED</info>
-      <return type='xmlGlobalStatePtr' info='NULL.'/>
-    </function>
     <function name='xmlGetID' file='valid' module='valid'>
       <info>Search the attribute declaring the given ID</info>
       <return type='xmlAttrPtr' info='NULL if not found, otherwise the xmlAttrPtr defining the ID'/>
@@ -10146,20 +9440,17 @@
       <arg name='name' type='const xmlChar *' info='the attribute name'/>
     </function>
     <function name='xmlGetNodePath' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)</cond>
       <info>Build a structure based Path for the given node</info>
       <return type='xmlChar *' info='the new path or NULL in case of error. The caller must free the returned string'/>
       <arg name='node' type='const xmlNode *' info='a node'/>
     </function>
     <function name='xmlGetNsList' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Find all in-scope namespaces of a node.  Use xmlGetNsListSafe for better error reporting.</info>
       <return type='xmlNsPtr *' info='a NULL terminated array of namespace pointers that must be freed by the caller or NULL if no namespaces were found or a memory allocation failed.'/>
       <arg name='doc' type='const xmlDoc *' info='the document'/>
       <arg name='node' type='const xmlNode *' info='the current node'/>
     </function>
     <function name='xmlGetNsListSafe' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Find all in-scope namespaces of a node. @out returns a NULL terminated array of namespace pointers that must be freed by the caller.  Available since 2.13.0.</info>
       <return type='int' info='0 on success, 1 if no namespaces were found, -1 if a memory allocation failed.'/>
       <arg name='doc' type='const xmlDoc *' info='the document'/>
@@ -10196,23 +9487,12 @@
       <arg name='doc' type='xmlDocPtr' info='pointer to the document'/>
       <arg name='ID' type='const xmlChar *' info='the ID value'/>
     </function>
-    <function name='xmlGetThreadId' file='threads' module='threads'>
-      <info>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&apos;t mandate pthread_t to be an integer type</info>
-      <return type='int' info='the current thread ID number'/>
-    </function>
     <function name='xmlGetUTF8Char' file='xmlstring' module='xmlstring'>
       <info>Read the first UTF8 character from @utf</info>
       <return type='int' info='the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error)'/>
       <arg name='utf' type='const unsigned char *' info='a sequence of UTF-8 encoded bytes'/>
       <arg name='len' type='int *' info='a pointer to the minimum number of bytes present in the sequence.  This is used to assure the next character is completely contained within the sequence.'/>
     </function>
-    <function name='xmlHandleEntity' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Default handling of defined entities, when should we define a new input stream ? When do we just handle that as a set of chars ?  OBSOLETE: to be removed at some point.</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-      <arg name='entity' type='xmlEntityPtr' info='an XML entity pointer.'/>
-    </function>
     <function name='xmlHasFeature' file='parser' module='parser'>
       <info>Examines if the library has been compiled with a given feature.</info>
       <return type='int' info='a non-zero value if the feature exist, otherwise zero. Returns zero (0) if the feature does not exist or an unknown unknown feature is requested, non-zero otherwise.'/>
@@ -10481,32 +9761,6 @@
       <arg name='payload' type='void *' info='pointer to the payload'/>
       <arg name='dealloc' type='xmlHashDeallocator' info='deallocator function for replaced item or NULL'/>
     </function>
-    <function name='xmlIOFTPClose' file='xmlIO' module='xmlIO'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>DEPRECATED: Internal function, don&apos;t use.  Close an FTP I/O channel</info>
-      <return type='int' info='0'/>
-      <arg name='context' type='void *' info='the I/O context'/>
-    </function>
-    <function name='xmlIOFTPMatch' file='xmlIO' module='xmlIO'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>DEPRECATED: Internal function, don&apos;t use.  check if the URI matches an FTP one</info>
-      <return type='int' info='1 if matches, 0 otherwise'/>
-      <arg name='filename' type='const char *' info='the URI for matching'/>
-    </function>
-    <function name='xmlIOFTPOpen' file='xmlIO' module='xmlIO'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>DEPRECATED: Internal function, don&apos;t use.  open an FTP I/O channel</info>
-      <return type='void *' info='an I/O context or NULL in case of error'/>
-      <arg name='filename' type='const char *' info='the URI for matching'/>
-    </function>
-    <function name='xmlIOFTPRead' file='xmlIO' module='xmlIO'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>DEPRECATED: Internal function, don&apos;t use.  Read @len bytes to @buffer from the I/O channel.</info>
-      <return type='int' info='the number of bytes written'/>
-      <arg name='context' type='void *' info='the I/O context'/>
-      <arg name='buffer' type='char *' info='where to drop data'/>
-      <arg name='len' type='int' info='number of bytes to write'/>
-    </function>
     <function name='xmlIOHTTPClose' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_HTTP_ENABLED)</cond>
       <info>DEPRECATED: Internal function, don&apos;t use.  Close an HTTP I/O channel</info>
@@ -10542,7 +9796,7 @@
     </function>
     <function name='xmlIOParseDTD' file='parser' module='parser'>
       <cond>defined(LIBXML_VALID_ENABLED)</cond>
-      <info>Load and parse a DTD</info>
+      <info>DEPRECATED: Use xmlCtxtParseDtd.  Load and parse a DTD</info>
       <return type='xmlDtdPtr' info='the resulting xmlDtdPtr or NULL in case of error. @input will be freed by the function in any case.'/>
       <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block or NULL'/>
       <arg name='input' type='xmlParserInputBufferPtr' info='an Input Buffer'/>
@@ -10566,7 +9820,7 @@
       <arg name='seq' type='xmlParserNodeInfoSeqPtr' info='a node info sequence pointer'/>
     </function>
     <function name='xmlInitParser' file='parser' module='threads'>
-      <info>Initialization function for the XML parser.  Call once from the main thread before using the library in multithreaded programs.</info>
+      <info>Initialization function for the XML parser.  For older versions, it&apos;s recommended to call this function once from the main thread before using the library in multithreaded programs.  Since 2.14.0, there&apos;s no distinction between threads. It should be unnecessary to call this function.</info>
       <return type='void'/>
     </function>
     <function name='xmlInitParserCtxt' file='parser' module='parserInternals'>
@@ -10580,23 +9834,13 @@
     </function>
     <function name='xmlInitializeCatalog' file='catalog' module='catalog'>
       <cond>defined(LIBXML_CATALOG_ENABLED)</cond>
-      <info>Do the catalog initialization. this function is not thread safe, catalog initialization should preferably be done once at startup</info>
+      <info>Load the default system catalog.</info>
       <return type='void'/>
     </function>
     <function name='xmlInitializeDict' file='dict' module='dict'>
       <info>DEPRECATED: Alias for xmlInitParser.</info>
       <return type='int' info='0.'/>
     </function>
-    <function name='xmlInitializeGlobalState' file='globals' module='globals'>
-      <info>DEPRECATED: No-op.</info>
-      <return type='void'/>
-      <arg name='gs' type='xmlGlobalStatePtr' info='a pointer to a newly allocated global state'/>
-    </function>
-    <function name='xmlInitializePredefinedEntities' file='entities' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Set up the predefined entities. Deprecated call</info>
-      <return type='void'/>
-    </function>
     <functype name='xmlInputCloseCallback' file='xmlIO' module='xmlIO'>
       <info>Callback used in the I/O Input API to close the resource</info>
       <return type='int' info='0 or -1 in case of error'/>
@@ -10619,6 +9863,12 @@
       <arg name='buffer' type='char *' info='the buffer to store data read'/>
       <arg name='len' type='int' info='the length of the buffer in bytes'/>
     </functype>
+    <function name='xmlInputSetEncodingHandler' file='parser' module='parserInternals'>
+      <info>Use encoding handler to decode input data.  Closes the handler on error.</info>
+      <return type='xmlParserErrors' info='an xmlParserErrors code.'/>
+      <arg name='input' type='xmlParserInputPtr' info='the input stream'/>
+      <arg name='handler' type='xmlCharEncodingHandlerPtr' info='the encoding handler'/>
+    </function>
     <function name='xmlIsBaseChar' file='chvalid' module='chvalid'>
       <info>This function is DEPRECATED. Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead</info>
       <return type='int' info='true if argument valid, false otherwise'/>
@@ -10667,14 +9917,10 @@
       <arg name='ch' type='unsigned int' info='character to validate'/>
     </function>
     <function name='xmlIsLetter' file='parserInternals' module='parserInternals'>
-      <info>Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Check whether the character is allowed by the production [84] Letter ::= BaseChar | Ideographic</info>
       <return type='int' info='0 if not, non-zero otherwise'/>
       <arg name='c' type='int' info='an unicode character (int)'/>
     </function>
-    <function name='xmlIsMainThread' file='threads' module='globals'>
-      <info>DEPRECATED: Internal function, do not use.  Check whether the current thread is the main thread.</info>
-      <return type='int' info='1 if the current thread is the main thread, 0 otherwise'/>
-    </function>
     <function name='xmlIsMixedElement' file='valid' module='valid'>
       <info>Search in the DtDs whether an element accept Mixed content (or ANY) basically if it is supposed to accept text childs</info>
       <return type='int' info='0 if no, 1 if yes, and -1 if no element description is available'/>
@@ -10699,13 +9945,20 @@
       <arg name='systemID' type='const xmlChar *' info='the system identifier'/>
       <arg name='publicID' type='const xmlChar *' info='the public identifier'/>
     </function>
+    <function name='xmlIsolat1ToUTF8' file='encoding' module='encoding'>
+      <info>Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 block of chars out.</info>
+      <return type='int' info='the number of bytes written 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.'/>
+      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
+      <arg name='outlen' type='int *' info='the length of @out'/>
+      <arg name='in' type='const unsigned char *' info='a pointer to an array of ISO Latin 1 chars'/>
+      <arg name='inlen' type='int *' info='the length of @in'/>
+    </function>
     <function name='xmlKeepBlanksDefault' file='parser' module='parserInternals'>
       <info>DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.  Set and return the previous value for default blanks text nodes support. The 1.x version of the parser used an heuristic to try to detect ignorable white spaces. As a result the SAX callback was generating xmlSAX2IgnorableWhitespace() callbacks instead of characters() one, and when using the DOM output text nodes containing those blanks were not generated. The 2.x and later version will switch to the XML standard way and ignorableWhitespace() are only generated when running the parser in validating mode and when the current element doesn&apos;t allow CDATA or mixed content. This function is provided as a way to force the standard behavior on 1.X libs and to switch back to the old mode for compatibility when running 1.X client code on 2.X . Upgrade of 1.X code should be done by using xmlIsBlankNode() commodity function to detect the &quot;empty&quot; nodes generated. This value also affect autogeneration of indentation when saving code if blanks sections are kept, indentation is not generated.</info>
       <return type='int' info='the last value for 0 for no substitution, 1 for substitution.'/>
       <arg name='val' type='int' info='int 0 or 1'/>
     </function>
     <function name='xmlLastElementChild' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Find the last child node which is an element.  Note that entity references are not expanded.</info>
       <return type='xmlNodePtr' info='the last element or NULL if parent has no children.'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
@@ -10897,7 +10150,7 @@
       <arg name='pathss' type='const char *' info='a list of directories separated by a colon or a space.'/>
     </function>
     <function name='xmlLoadExternalEntity' file='parser' module='parserInternals'>
-      <info>@URL is a filename or URL. If if contains the substring &quot;://&quot;, it is assumed to be a Legacy Extended IRI. Otherwise, it is treated as a filesystem path.  @ID is an optional XML public ID, typically from a doctype declaration. It is used for catalog lookups.  The following resource loaders will be called if they were registered (in order of precedence):  - the global external entity loader set with xmlSetExternalEntityLoader - the per-thread xmlParserInputBufferCreateFilenameFunc set with xmlParserInputBufferCreateFilenameDefault - the default loader which will return - the result from a matching global input callback set with xmlRegisterInputCallbacks - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.</info>
+      <info>@URL is a filename or URL. If if contains the substring &quot;://&quot;, it is assumed to be a Legacy Extended IRI. Otherwise, it is treated as a filesystem path.  @ID is an optional XML public ID, typically from a doctype declaration. It is used for catalog lookups.  If catalog lookup is enabled (default is yes) and URL or ID are found in system or local XML catalogs, URL is replaced with the result. Then the following resource loaders will be called if they were registered (in order of precedence):  - the resource loader set with xmlCtxtSetResourceLoader - the global external entity loader set with xmlSetExternalEntityLoader (without catalog resolution, deprecated) - the per-thread xmlParserInputBufferCreateFilenameFunc set with xmlParserInputBufferCreateFilenameDefault (deprecated) - the default loader which will return - the result from a matching global input callback set with xmlRegisterInputCallbacks (deprecated) - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.</info>
       <return type='xmlParserInputPtr' info='the xmlParserInputPtr or NULL'/>
       <arg name='URL' type='const char *' info='the URL for the entity to load'/>
       <arg name='ID' type='const char *' info='the Public ID for the entity to load'/>
@@ -10914,24 +10167,11 @@
       <return type='void'/>
     </function>
     <function name='xmlLookupCharEncodingHandler' file='encoding' module='encoding'>
-      <info>Find or create a handler matching the encoding. If no default or registered handler could be found, try to create a handler using iconv or ICU if supported.  The handler must be closed with xmlCharEncCloseFunc.  Available since 2.13.0.</info>
-      <return type='int' info='an xmlParserErrors error code.'/>
+      <info>Find or create a handler matching the encoding. The following converters are looked up in order:  - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled  The handler must be closed with xmlCharEncCloseFunc.  If the encoding is UTF-8, a NULL handler and no error code will be returned.  Available since 2.13.0.</info>
+      <return type='xmlParserErrors' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
       <arg name='enc' type='xmlCharEncoding' info='an xmlCharEncoding value.'/>
       <arg name='out' type='xmlCharEncodingHandler **' info='pointer to result'/>
     </function>
-    <function name='xmlLsCountNode' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED)</cond>
-      <info>Count the children of @node.</info>
-      <return type='int' info='the number of children of @node.'/>
-      <arg name='node' type='xmlNodePtr' info='the node to count'/>
-    </function>
-    <function name='xmlLsOneNode' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED)</cond>
-      <info>Dump to @output the type and name of @node.</info>
-      <return type='void'/>
-      <arg name='output' type='FILE *' info='the FILE * for the output'/>
-      <arg name='node' type='xmlNodePtr' info='the node to dump'/>
-    </function>
     <function name='xmlMallocAtomicLoc' file='xmlmemory' module='xmlmemory'>
       <info>DEPRECATED: don&apos;t use</info>
       <return type='void *' info='a pointer to the allocated area or NULL in case of lack of memory.'/>
@@ -11066,172 +10306,6 @@
       <return type='void'/>
       <arg name='tok' type='xmlMutexPtr' info='the simple mutex'/>
     </function>
-    <function name='xmlNamespaceParseNCName' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>parse an XML namespace name.  TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input.  [NS 3] NCName ::= (Letter | &apos;_&apos;) (NCNameChar)*  [NS 4] NCNameChar ::= Letter | Digit | &apos;.&apos; | &apos;-&apos; | &apos;_&apos; | CombiningChar | Extender</info>
-      <return type='xmlChar *' info='the namespace name or NULL'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-    </function>
-    <function name='xmlNamespaceParseNSDef' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>parse a namespace prefix declaration  TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input.  [NS 1] NSDef ::= PrefixDef Eq SystemLiteral  [NS 2] PrefixDef ::= &apos;xmlns&apos; (&apos;:&apos; NCName)?</info>
-      <return type='xmlChar *' info='the namespace name'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-    </function>
-    <function name='xmlNamespaceParseQName' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>TODO: this seems not in use anymore, the namespace handling is done on top of the SAX interfaces, i.e. not on raw input.  parse an XML qualified name  [NS 5] QName ::= (Prefix &apos;:&apos;)? LocalPart  [NS 6] Prefix ::= NCName  [NS 7] LocalPart ::= NCName</info>
-      <return type='xmlChar *' info='the local part, and prefix is updated to get the Prefix if any.'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-      <arg name='prefix' type='xmlChar **' info='a xmlChar **'/>
-    </function>
-    <function name='xmlNanoFTPCheckResponse' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Check if there is a response from the FTP server after a command.</info>
-      <return type='int' info='the code number, or 0'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPCleanup' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Cleanup the FTP protocol layer. This cleanup proxy information.</info>
-      <return type='void'/>
-    </function>
-    <function name='xmlNanoFTPClose' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Close the connection and both control and transport</info>
-      <return type='int' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPCloseConnection' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Close the data connection from the server</info>
-      <return type='int' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPConnect' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Tries to open a control connection</info>
-      <return type='int' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPConnectTo' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Tries to open a control connection to the given server/port</info>
-      <return type='void *' info='an fTP context or NULL if it failed'/>
-      <arg name='server' type='const char *' info='an FTP server name'/>
-      <arg name='port' type='int' info='the port (use 21 if 0)'/>
-    </function>
-    <function name='xmlNanoFTPCwd' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Tries to change the remote directory</info>
-      <return type='int' info='-1 in case of error, 1 if CWD worked, 0 if it failed'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-      <arg name='directory' type='const char *' info='a directory on the server'/>
-    </function>
-    <function name='xmlNanoFTPDele' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Tries to delete an item (file or directory) from server</info>
-      <return type='int' info='-1 in case of error, 1 if DELE worked, 0 if it failed'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-      <arg name='file' type='const char *' info='a file or directory on the server'/>
-    </function>
-    <function name='xmlNanoFTPFreeCtxt' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Frees the context after closing the connection.</info>
-      <return type='void'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPGet' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Fetch the given file from the server. All data are passed back in the callbacks. The last callback has a size of 0 block.</info>
-      <return type='int' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-      <arg name='callback' type='ftpDataCallback' info='the user callback'/>
-      <arg name='userData' type='void *' info='the user callback data'/>
-      <arg name='filename' type='const char *' info='the file to retrieve'/>
-    </function>
-    <function name='xmlNanoFTPGetConnection' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Try to open a data connection to the server. Currently only passive mode is supported.</info>
-      <return type='SOCKET' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPGetResponse' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Get the response from the FTP server after a command.</info>
-      <return type='int' info='the code number'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPGetSocket' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Initiate fetch of the given file from the server.</info>
-      <return type='SOCKET' info='the socket for the data connection, or &lt;0 in case of error'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-      <arg name='filename' type='const char *' info='the file to retrieve (or NULL if path is in context).'/>
-    </function>
-    <function name='xmlNanoFTPInit' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Initialize the FTP protocol layer. Currently it just checks for proxy information, and get the hostname</info>
-      <return type='void'/>
-    </function>
-    <function name='xmlNanoFTPList' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Do a listing on the server. All files info are passed back in the callbacks.</info>
-      <return type='int' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-      <arg name='callback' type='ftpListCallback' info='the user callback'/>
-      <arg name='userData' type='void *' info='the user callback data'/>
-      <arg name='filename' type='const char *' info='optional files to list'/>
-    </function>
-    <function name='xmlNanoFTPNewCtxt' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Allocate and initialize a new FTP context.</info>
-      <return type='void *' info='an FTP context or NULL in case of error.'/>
-      <arg name='URL' type='const char *' info='The URL used to initialize the context'/>
-    </function>
-    <function name='xmlNanoFTPOpen' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Start to fetch the given ftp:// resource</info>
-      <return type='void *' info='an FTP context, or NULL'/>
-      <arg name='URL' type='const char *' info='the URL to the resource'/>
-    </function>
-    <function name='xmlNanoFTPProxy' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Setup the FTP proxy information. This can also be done by using ftp_proxy ftp_proxy_user and ftp_proxy_password environment variables.</info>
-      <return type='void'/>
-      <arg name='host' type='const char *' info='the proxy host name'/>
-      <arg name='port' type='int' info='the proxy port'/>
-      <arg name='user' type='const char *' info='the proxy user name'/>
-      <arg name='passwd' type='const char *' info='the proxy password'/>
-      <arg name='type' type='int' info='the type of proxy 1 for using SITE, 2 for USER a@b'/>
-    </function>
-    <function name='xmlNanoFTPQuit' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Send a QUIT command to the server</info>
-      <return type='int' info='-1 in case of error, 0 otherwise'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-    </function>
-    <function name='xmlNanoFTPRead' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>This function tries to read @len bytes from the existing FTP connection and saves them in @dest. This is a blocking call.</info>
-      <return type='int' info='the number of byte read. 0 is an indication of an end of connection. -1 indicates a parameter error.'/>
-      <arg name='ctx' type='void *' info='the FTP context'/>
-      <arg name='dest' type='void *' info='a buffer'/>
-      <arg name='len' type='int' info='the buffer length'/>
-    </function>
-    <function name='xmlNanoFTPScanProxy' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>(Re)Initialize the FTP Proxy context by parsing the URL and finding the protocol host port it indicates. Should be like ftp://myproxy/ or ftp://myproxy:3128/ A NULL URL cleans up proxy information.</info>
-      <return type='void'/>
-      <arg name='URL' type='const char *' info='The proxy URL used to initialize the proxy context'/>
-    </function>
-    <function name='xmlNanoFTPUpdateURL' file='nanoftp' module='nanoftp'>
-      <cond>defined(LIBXML_FTP_ENABLED)</cond>
-      <info>Update an FTP context by parsing the URL and finding new path it indicates. If there is an error in the protocol, hostname, port or other information, the error is raised. It indicates a new connection has to be established.</info>
-      <return type='int' info='0 if Ok, -1 in case of error (other host).'/>
-      <arg name='ctx' type='void *' info='an FTP context'/>
-      <arg name='URL' type='const char *' info='The URL used to update the context'/>
-    </function>
     <function name='xmlNanoHTTPAuthHeader' file='nanohttp' module='nanohttp'>
       <cond>defined(LIBXML_HTTP_ENABLED)</cond>
       <info>Get the authentication header of an HTTP context</info>
@@ -11352,7 +10426,7 @@
       <arg name='URL' type='const char *' info='The proxy URL used to initialize the proxy context'/>
     </function>
     <function name='xmlNewAutomata' file='xmlautomata' module='xmlregexp'>
-      <cond>defined(LIBXML_REGEXP_ENABLED) &amp;&amp; defined(LIBXML_AUTOMATA_ENABLED)</cond>
+      <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
       <info>Create a new automata</info>
       <return type='xmlAutomataPtr' info='the new object or NULL in case of failure'/>
     </function>
@@ -11370,7 +10444,7 @@
       <arg name='sgml' type='int' info='should this create an SGML catalog'/>
     </function>
     <function name='xmlNewCharEncodingHandler' file='encoding' module='encoding'>
-      <info>Create and registers an xmlCharEncodingHandler.</info>
+      <info>DEPRECATED: This function modifies global state and is not thread-safe.  Create and registers an xmlCharEncodingHandler.</info>
       <return type='xmlCharEncodingHandlerPtr' info='the xmlCharEncodingHandlerPtr created (or NULL in case of error).'/>
       <arg name='name' type='const char *' info='the encoding name, in UTF-8 format (ASCII actually)'/>
       <arg name='input' type='xmlCharEncodingInputFunc' info='the xmlCharEncodingInputFunc to read that encoding'/>
@@ -11383,7 +10457,6 @@
       <arg name='name' type='const xmlChar *' info='the entity name'/>
     </function>
     <function name='xmlNewChild' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Create a new child element and append it to a parent element.  If @ns is NULL, the newly created element inherits the namespace of the parent.  If provided, @content is expected to be a valid XML attribute value possibly containing character and entity references. Text and entity reference node will be added to the child element, see xmlNewDocNode.</info>
       <return type='xmlNodePtr' info='a pointer to the new node object or NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
@@ -11408,14 +10481,13 @@
       <arg name='content' type='const xmlChar *' info='the comment content'/>
     </function>
     <function name='xmlNewDocElementContent' file='valid' module='valid'>
-      <info>Allocate an element content structure for the document.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Allocate an element content structure for the document.</info>
       <return type='xmlElementContentPtr' info='NULL if not, otherwise the new element content structure'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='name' type='const xmlChar *' info='the subelement name or NULL'/>
       <arg name='type' type='xmlElementContentType' info='the type of element content decl'/>
     </function>
     <function name='xmlNewDocFragment' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Create a document fragment node.</info>
       <return type='xmlNodePtr' info='a pointer to the new node object or NULL if a memory allocation failed.'/>
       <arg name='doc' type='xmlDocPtr' info='the target document (optional)'/>
@@ -11451,7 +10523,6 @@
       <arg name='value' type='const xmlChar *' info='attribute value with XML references (optional)'/>
     </function>
     <function name='xmlNewDocRawNode' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Create an element node.  If provided, @value should be a raw, unescaped string.</info>
       <return type='xmlNodePtr' info='a pointer to the new node object or NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='doc' type='xmlDocPtr' info='the target document'/>
@@ -11481,7 +10552,7 @@
       <arg name='SystemID' type='const xmlChar *' info='the system ID (optional)'/>
     </function>
     <function name='xmlNewElementContent' file='valid' module='valid'>
-      <info>Allocate an element content structure. Deprecated in favor of xmlNewDocElementContent</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Allocate an element content structure. Deprecated in favor of xmlNewDocElementContent</info>
       <return type='xmlElementContentPtr' info='NULL if not, otherwise the new element content structure'/>
       <arg name='name' type='const xmlChar *' info='the subelement name or NULL'/>
       <arg name='type' type='xmlElementContentType' info='the type of element content decl'/>
@@ -11502,14 +10573,6 @@
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='ent' type='xmlEntityPtr' info='an Entity pointer'/>
     </function>
-    <function name='xmlNewGlobalNs' file='tree' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Creation of a Namespace, the old way using PI and without scoping DEPRECATED !!!</info>
-      <return type='xmlNsPtr' info='NULL this functionality had been removed'/>
-      <arg name='doc' type='xmlDocPtr' info='the document carrying the namespace'/>
-      <arg name='href' type='const xmlChar *' info='the URI associated'/>
-      <arg name='prefix' type='const xmlChar *' info='the prefix for the namespace'/>
-    </function>
     <function name='xmlNewIOInputStream' file='parser' module='parserInternals'>
       <info>Create a new input stream structure encapsulating the @input into a stream suitable for the parser.</info>
       <return type='xmlParserInputPtr' info='the new input stream or NULL'/>
@@ -11517,14 +10580,52 @@
       <arg name='buf' type='xmlParserInputBufferPtr' info='an input buffer'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known'/>
     </function>
+    <function name='xmlNewInputFromFd' file='parser' module='parserInternals'>
+      <info>Creates a new parser input to read from a zero-terminated string.  @url is used as base to resolve external entities and for error reporting.  @fd is closed after parsing has finished.  Supported @flags are XML_INPUT_UNZIP to decompress data automatically. This feature is deprecated and will be removed in a future release.  Available since 2.14.0.</info>
+      <return type='xmlParserInputPtr' info='a new parser input or NULL if a memory allocation failed.'/>
+      <arg name='url' type='const char *' info='base URL (optional)'/>
+      <arg name='fd' type='int' info='file descriptor'/>
+      <arg name='flags' type='xmlParserInputFlags' info='input flags'/>
+    </function>
     <function name='xmlNewInputFromFile' file='parserInternals' module='parserInternals'>
-      <info>Create a new input stream based on a file or an URL.</info>
+      <info>DEPRECATED: Use xmlNewInputFromUrl.  Create a new input stream based on a file or an URL.</info>
       <return type='xmlParserInputPtr' info='the new input stream or NULL in case of error'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='filename' type='const char *' info='the filename to use as entity'/>
     </function>
+    <function name='xmlNewInputFromIO' file='parser' module='parserInternals'>
+      <info>Creates a new parser input to read from input callbacks and cintext.  @url is used as base to resolve external entities and for error reporting.  @ioRead is called to read new data into a provided buffer. It must return the number of bytes written into the buffer ot a negative xmlParserErrors code on failure.  @ioClose is called after parsing has finished.  @ioCtxt is an opaque pointer passed to the callbacks.  Available since 2.14.0.</info>
+      <return type='xmlParserInputPtr' info='a new parser input or NULL if a memory allocation failed.'/>
+      <arg name='url' type='const char *' info='base URL (optional)'/>
+      <arg name='ioRead' type='xmlInputReadCallback' info='read callback'/>
+      <arg name='ioClose' type='xmlInputCloseCallback' info='close callback (optional)'/>
+      <arg name='ioCtxt' type='void *' info='IO context'/>
+      <arg name='flags' type='xmlParserInputFlags' info='unused, pass 0'/>
+    </function>
+    <function name='xmlNewInputFromMemory' file='parser' module='parserInternals'>
+      <info>Creates a new parser input to read from a memory area.  @url is used as base to resolve external entities and for error reporting.  If the XML_INPUT_BUF_STATIC flag is set, the memory area must stay unchanged until parsing has finished. This can avoid temporary copies.  If the XML_INPUT_BUF_ZERO_TERMINATED flag is set, the memory area must contain a zero byte after the buffer at position @size. This can avoid temporary copies.  Available since 2.14.0.</info>
+      <return type='xmlParserInputPtr' info='a new parser input or NULL if a memory allocation failed.'/>
+      <arg name='url' type='const char *' info='base URL (optional)'/>
+      <arg name='mem' type='const void *' info='pointer to char array'/>
+      <arg name='size' type='size_t' info='size of array'/>
+      <arg name='flags' type='xmlParserInputFlags' info='optimization hints'/>
+    </function>
+    <function name='xmlNewInputFromString' file='parser' module='parserInternals'>
+      <info>Creates a new parser input to read from a zero-terminated string.  @url is used as base to resolve external entities and for error reporting.  If the XML_INPUT_BUF_STATIC flag is set, the string must stay unchanged until parsing has finished. This can avoid temporary copies.  Available since 2.14.0.</info>
+      <return type='xmlParserInputPtr' info='a new parser input or NULL if a memory allocation failed.'/>
+      <arg name='url' type='const char *' info='base URL (optional)'/>
+      <arg name='str' type='const char *' info='zero-terminated string'/>
+      <arg name='flags' type='xmlParserInputFlags' info='optimization hints'/>
+    </function>
+    <function name='xmlNewInputFromUrl' file='parser' module='parserInternals'>
+      <info>Create a new input stream based on a file or a URL.  The flag XML_INPUT_UNZIP allows decompression.  The flag XML_INPUT_NETWORK allows network access.  The following resource loaders will be called if they were registered (in order of precedence):  - the per-thread xmlParserInputBufferCreateFilenameFunc set with xmlParserInputBufferCreateFilenameDefault (deprecated) - the default loader which will return - the result from a matching global input callback set with xmlRegisterInputCallbacks (deprecated) - a HTTP resource if support is compiled in. - a file opened from the filesystem, with automatic detection of compressed files if support is compiled in.  Available since 2.14.0.</info>
+      <return type='xmlParserErrors' info='an xmlParserErrors code.'/>
+      <arg name='filename' type='const char *' info='the filename to use as entity'/>
+      <arg name='flags' type='xmlParserInputFlags' info='XML_INPUT flags'/>
+      <arg name='out' type='xmlParserInputPtr *' info='pointer to new parser input'/>
+    </function>
     <function name='xmlNewInputStream' file='parserInternals' module='parserInternals'>
-      <info>Create a new input stream structure.</info>
+      <info>DEPRECATED: Use xmlNewInputFromUrl or similar functions.  Create a new input stream structure.</info>
       <return type='xmlParserInputPtr' info='the new input stream or NULL'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
@@ -11578,7 +10679,6 @@
       <return type='xmlParserCtxtPtr' info='the xmlParserCtxtPtr or NULL'/>
     </function>
     <function name='xmlNewProp' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Create an attribute node.  If provided, @value should be a raw, unescaped string.  If @node is provided, the created attribute will be appended without checking for duplicate names. It is an error if @node is not an element.</info>
       <return type='xmlAttrPtr' info='a pointer to the attribute or NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='node' type='xmlNodePtr' info='the parent node (optional)'/>
@@ -11602,7 +10702,7 @@
       <arg name='userData' type='void *' info='user data'/>
     </function>
     <function name='xmlNewStringInputStream' file='parserInternals' module='parserInternals'>
-      <info>Create a new input stream based on a memory buffer.</info>
+      <info>DEPRECATED: Use xmlNewInputFromString.  Create a new input stream based on a memory buffer.</info>
       <return type='xmlParserInputPtr' info='the new input stream'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='buffer' type='const xmlChar *' info='an memory buffer'/>
@@ -11613,7 +10713,6 @@
       <arg name='content' type='const xmlChar *' info='raw text content (optional)'/>
     </function>
     <function name='xmlNewTextChild' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Create a new child element and append it to a parent element.  If @ns is NULL, the newly created element inherits the namespace of the parent.  If @content is provided, a text node will be added to the child element, see xmlNewDocRawNode.</info>
       <return type='xmlNodePtr' info='a pointer to the new node object or NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='parent' type='xmlNodePtr' info='the parent node'/>
@@ -11693,13 +10792,12 @@
       <arg name='ctxt' type='xmlParserCtxtPtr' info='the XML parser context'/>
     </function>
     <function name='xmlNextElementSibling' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Find the closest following sibling which is a element.  Note that entity references are not expanded.</info>
       <return type='xmlNodePtr' info='the sibling or NULL if no sibling was found.'/>
       <arg name='node' type='xmlNodePtr' info='the current node'/>
     </function>
     <function name='xmlNoNetExternalEntityLoader' file='xmlIO' module='parserInternals'>
-      <info>A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.</info>
+      <info>DEPRECATED: Use XML_PARSE_NONET.  A specific entity loader disabling network accesses, though still allowing local catalog accesses for resolution.</info>
       <return type='xmlParserInputPtr' info='a new allocated xmlParserInputPtr, or NULL.'/>
       <arg name='URL' type='const char *' info='the URL for the entity to load'/>
       <arg name='ID' type='const char *' info='the System ID for the entity to load'/>
@@ -11787,22 +10885,20 @@
       <arg name='node' type='const xmlNode *' info='the node'/>
     </function>
     <function name='xmlNodeListGetRawString' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
-      <info>Serializes attribute children (text and entity reference nodes) into a string. An empty list produces an empty string.  If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special characters like &apos;&amp;&apos; will be escaped.</info>
+      <info>Serializes attribute children (text and entity reference nodes) into a string.  If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special characters like &apos;&amp;&apos; will be escaped.</info>
       <return type='xmlChar *' info='a string or NULL if a memory allocation failed.'/>
       <arg name='doc' type='const xmlDoc *' info='a document (optional)'/>
-      <arg name='list' type='const xmlNode *' info='a node list of attribute children (optional)'/>
+      <arg name='list' type='const xmlNode *' info='a node list of attribute children'/>
       <arg name='inLine' type='int' info='whether entity references are substituted'/>
     </function>
     <function name='xmlNodeListGetString' file='tree' module='tree'>
-      <info>Serializes attribute children (text and entity reference nodes) into a string. An empty list produces an empty string.  If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special characters like &apos;&amp;&apos; as well as non-ASCII chars will be escaped. See xmlNodeListGetRawString for an alternative option.</info>
+      <info>Serializes attribute children (text and entity reference nodes) into a string.  If @inLine is true, entity references will be substituted. Otherwise, entity references will be kept and special characters like &apos;&amp;&apos; as well as non-ASCII chars will be escaped. See xmlNodeListGetRawString for an alternative option.</info>
       <return type='xmlChar *' info='a string or NULL if a memory allocation failed.'/>
       <arg name='doc' type='xmlDocPtr' info='a document (optional)'/>
-      <arg name='list' type='const xmlNode *' info='a node list of attribute children (optional)'/>
+      <arg name='list' type='const xmlNode *' info='a node list of attribute children'/>
       <arg name='inLine' type='int' info='whether entity references are substituted'/>
     </function>
     <function name='xmlNodeSetBase' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)</cond>
       <info>Set (or reset) the base URI of a node, i.e. the value of the xml:base attribute.</info>
       <return type='int' info='0 on success, -1 on error.'/>
       <arg name='cur' type='xmlNodePtr' info='the node being changed'/>
@@ -11815,7 +10911,6 @@
       <arg name='content' type='const xmlChar *' info='the new value of the content'/>
     </function>
     <function name='xmlNodeSetContentLen' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>See xmlNodeSetContent.</info>
       <return type='int' info='0 on success, 1 on error, -1 if a memory allocation failed.'/>
       <arg name='cur' type='xmlNodePtr' info='the node being modified'/>
@@ -11823,21 +10918,18 @@
       <arg name='len' type='int' info='the size of @content'/>
     </function>
     <function name='xmlNodeSetLang' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Set the language of a node, i.e. the values of the xml:lang attribute.</info>
       <return type='int' info='0 on success, 1 if arguments are invalid, -1 if a memory allocation failed.'/>
       <arg name='cur' type='xmlNodePtr' info='the node being changed'/>
       <arg name='lang' type='const xmlChar *' info='the language description'/>
     </function>
     <function name='xmlNodeSetName' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Set (or reset) the name of a node.</info>
       <return type='void'/>
       <arg name='cur' type='xmlNodePtr' info='the node being changed'/>
       <arg name='name' type='const xmlChar *' info='the new tag name'/>
     </function>
     <function name='xmlNodeSetSpacePreserve' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Set (or reset) the space preserving behaviour of a node, i.e. the value of the xml:space attribute.</info>
       <return type='int' info='0 on success, 1 if arguments are invalid, -1 if a memory allocation failed.'/>
       <arg name='cur' type='xmlNodePtr' info='the node being changed'/>
@@ -11854,8 +10946,8 @@
       <arg name='path' type='const xmlChar *' info='the input file path'/>
     </function>
     <function name='xmlOpenCharEncodingHandler' file='encoding' module='encoding'>
-      <info>Find or create a handler matching the encoding. If no default or registered handler could be found, try to create a handler using iconv or ICU if supported.  The handler must be closed with xmlCharEncCloseFunc.  Available since 2.13.0.</info>
-      <return type='int' info='an xmlParserErrors error code.'/>
+      <info>Find or create a handler matching the encoding. The following converters are looked up in order:  - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII) - User-registered global handler (deprecated) - iconv if enabled - ICU if enabled  The handler must be closed with xmlCharEncCloseFunc.  If the encoding is UTF-8, a NULL handler and no error code will be returned.  Available since 2.13.0.</info>
+      <return type='xmlParserErrors' info='XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another xmlParserErrors error code.'/>
       <arg name='name' type='const char *' info='a string describing the char encoding.'/>
       <arg name='output' type='int' info='boolean, use handler for output'/>
       <arg name='out' type='xmlCharEncodingHandler **' info='pointer to result'/>
@@ -11868,28 +10960,28 @@
     </function>
     <function name='xmlOutputBufferCreateBuffer' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Create a buffered output for the progressive saving to a xmlBuffer</info>
+      <info>Create a buffered output for the progressive saving to a xmlBuffer  Consumes @encoder even in error case.</info>
       <return type='xmlOutputBufferPtr' info='the new parser output or NULL'/>
       <arg name='buffer' type='xmlBufferPtr' info='a xmlBufferPtr'/>
       <arg name='encoder' type='xmlCharEncodingHandlerPtr' info='the encoding converter or NULL'/>
     </function>
     <function name='xmlOutputBufferCreateFd' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Create a buffered output for the progressive saving to a file descriptor</info>
+      <info>Create a buffered output for the progressive saving to a file descriptor  Consumes @encoder even in error case.</info>
       <return type='xmlOutputBufferPtr' info='the new parser output or NULL'/>
       <arg name='fd' type='int' info='a file descriptor number'/>
       <arg name='encoder' type='xmlCharEncodingHandlerPtr' info='the encoding converter or NULL'/>
     </function>
     <function name='xmlOutputBufferCreateFile' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Create a buffered output for the progressive saving to a FILE * buffered C I/O</info>
+      <info>Create a buffered output for the progressive saving to a FILE * buffered C I/O  Consumes @encoder even in error case.</info>
       <return type='xmlOutputBufferPtr' info='the new parser output or NULL'/>
       <arg name='file' type='FILE *' info='a FILE*'/>
       <arg name='encoder' type='xmlCharEncodingHandlerPtr' info='the encoding converter or NULL'/>
     </function>
     <function name='xmlOutputBufferCreateFilename' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Create a buffered  output for the progressive saving of a file If filename is &quot;-&apos; then we use stdout as the output. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. TODO: currently if compression is set, the library only support writing to a local file.</info>
+      <info>Create a buffered  output for the progressive saving of a file If filename is &quot;-&apos; then we use stdout as the output. Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. TODO: currently if compression is set, the library only support writing to a local file.  Consumes @encoder even in error case.</info>
       <return type='xmlOutputBufferPtr' info='the new output or NULL'/>
       <arg name='URI' type='const char *' info='a C string containing the URI or filename'/>
       <arg name='encoder' type='xmlCharEncodingHandlerPtr' info='the encoding converter or NULL'/>
@@ -11909,7 +11001,7 @@
     </functype>
     <function name='xmlOutputBufferCreateIO' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Create a buffered output for the progressive saving to an I/O handler</info>
+      <info>Create a buffered output for the progressive saving to an I/O handler  Consumes @encoder even in error case.</info>
       <return type='xmlOutputBufferPtr' info='the new parser output or NULL'/>
       <arg name='iowrite' type='xmlOutputWriteCallback' info='an I/O write function'/>
       <arg name='ioclose' type='xmlOutputCloseCallback' info='an I/O close function'/>
@@ -11940,7 +11032,7 @@
       <return type='int' info='the number of chars immediately written, or -1 in case of error.'/>
       <arg name='out' type='xmlOutputBufferPtr' info='a buffered parser output'/>
       <arg name='len' type='int' info='the size in bytes of the array.'/>
-      <arg name='buf' type='const char *' info='an char array'/>
+      <arg name='data' type='const char *' info='an char array'/>
     </function>
     <function name='xmlOutputBufferWriteEscape' file='xmlIO' module='xmlIO'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
@@ -12058,7 +11150,7 @@
     </function>
     <function name='xmlParseChunk' file='parser' module='parser'>
       <cond>defined(LIBXML_PUSH_ENABLED)</cond>
-      <info>Parse a chunk of memory in push parser mode.  Assumes that the parser context was initialized with xmlCreatePushParserCtxt.  The last chunk, which will often be empty, must be marked with the @terminate flag. With the default SAX callbacks, the resulting document will be available in ctxt-&gt;myDoc. This pointer will not be freed by the library.  If the document isn&apos;t well-formed, ctxt-&gt;myDoc is set to NULL. The push parser doesn&apos;t support recovery mode.</info>
+      <info>Parse a chunk of memory in push parser mode.  Assumes that the parser context was initialized with xmlCreatePushParserCtxt.  The last chunk, which will often be empty, must be marked with the @terminate flag. With the default SAX callbacks, the resulting document will be available in ctxt-&gt;myDoc. This pointer will not be freed when calling xmlFreeParserCtxt and must be freed by the caller. If the document isn&apos;t well-formed, it will still be returned in ctxt-&gt;myDoc.  As an exception, xmlCtxtResetPush will free the document in ctxt-&gt;myDoc. So ctxt-&gt;myDoc should be set to NULL after extracting the document.</info>
       <return type='int' info='an xmlParserErrors code (0 on success).'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='chunk' type='const char *' info='chunk of memory'/>
@@ -12071,7 +11163,7 @@
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
     <function name='xmlParseContent' file='parserInternals' module='parser'>
-      <info>Parse XML element content. This is useful if you&apos;re only interested in custom SAX callbacks. If you want a node list, use xmlParseInNodeContext.</info>
+      <info>Parse XML element content. This is useful if you&apos;re only interested in custom SAX callbacks. If you want a node list, use xmlCtxtParseContent.</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
@@ -12191,7 +11283,7 @@
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
     <function name='xmlParseExtParsedEnt' file='parser' module='parser'>
-      <info>parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.  [78] extParsedEnt ::= TextDecl? content</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  parse a general parsed entity An external general parsed entity is well-formed if it matches the production labeled extParsedEnt.  [78] extParsedEnt ::= TextDecl? content</info>
       <return type='int' info='0, -1 in case of error. the parser context is augmented as a result of the parsing.'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
@@ -12215,7 +11307,7 @@
       <arg name='strict' type='int' info='indicate whether we should restrict parsing to only production [75], see NOTE below'/>
     </function>
     <function name='xmlParseExternalSubset' file='parserInternals' module='parser'>
-      <info>parse Markup declarations from an external subset  [30] extSubset ::= textDecl? extSubsetDecl  [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  parse Markup declarations from an external subset  [30] extSubset ::= textDecl? extSubsetDecl  [31] extSubsetDecl ::= (markupdecl | conditionalSect | PEReference | S) *</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='ExternalID' type='const xmlChar *' info='the external identifier'/>
@@ -12228,13 +11320,13 @@
       <arg name='filename' type='const char *' info='the filename'/>
     </function>
     <function name='xmlParseInNodeContext' file='parser' module='parser'>
-      <info>Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node.  The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar:  [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*</info>
+      <info>Parse a well-balanced chunk of an XML document within the context (DTD, namespaces, etc ...) of the given node.  The allowed sequence for the data is a Well Balanced Chunk defined by the content production in the XML grammar:  [43] content ::= (element | CharData | Reference | CDSect | PI | Comment)*  This function assumes the encoding of @node&apos;s document which is typically not what you want. A better alternative is xmlCtxtParseContent.</info>
       <return type='xmlParserErrors' info='XML_ERR_OK if the chunk is well balanced, and the parser error code otherwise'/>
       <arg name='node' type='xmlNodePtr' info='the context node'/>
       <arg name='data' type='const char *' info='the input string'/>
       <arg name='datalen' type='int' info='the input string length in bytes'/>
       <arg name='options' type='int' info='a combination of xmlParserOption'/>
-      <arg name='lst' type='xmlNodePtr *' info='the return value for the set of parsed nodes'/>
+      <arg name='listOut' type='xmlNodePtr *' info='the return value for the set of parsed nodes'/>
     </function>
     <function name='xmlParseMarkupDecl' file='parserInternals' module='parser'>
       <info>DEPRECATED: Internal function, don&apos;t use.  Parse markup declarations. Always consumes &apos;&lt;!&apos; or &apos;&lt;?&apos;.  [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.)</info>
@@ -12258,12 +11350,6 @@
       <return type='const xmlChar *' info='the Name parsed or NULL'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
-    <function name='xmlParseNamespace' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>xmlParseNamespace: parse specific PI &apos;&lt;?namespace ...&apos; constructs.  This is what the older xml-name Working Draft specified, a bunch of other stuff may still rely on it, so support is still here as if it was declared on the root of the Tree:-(  TODO: remove from library  To be removed at next drop of binary compatibility</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-    </function>
     <function name='xmlParseNmtoken' file='parserInternals' module='parser'>
       <info>DEPRECATED: Internal function, don&apos;t use.  parse an XML Nmtoken.  [7] Nmtoken ::= (NameChar)+  [8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*</info>
       <return type='xmlChar *' info='the Nmtoken parsed or NULL'/>
@@ -12299,12 +11385,6 @@
       <return type='xmlChar *' info='the PubidLiteral parsed or NULL.'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
-    <function name='xmlParseQuotedString' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Parse and return a string between quotes or doublequotes  TODO: Deprecated, to  be removed at next drop of binary compatibility</info>
-      <return type='xmlChar *' info='the string parser or NULL.'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-    </function>
     <function name='xmlParseReference' file='parserInternals' module='parser'>
       <info>DEPRECATED: Internal function, don&apos;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 &apos;&amp;&apos;.  [67] Reference ::= EntityRef | CharRef</info>
       <return type='void'/>
@@ -12404,32 +11484,26 @@
       <return type='void'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='the parser context'/>
     </function>
-    <function name='xmlParserHandleReference' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>TODO: Remove, now deprecated ... the test is done directly in the content parsing routines.  [67] Reference ::= EntityRef | CharRef  [68] EntityRef ::= &apos;&amp;&apos; Name &apos;;&apos;  [ WFC: Entity Declared ] the Name given in the entity reference must match that in an entity declaration, except that well-formed documents need not declare any of the following entities: amp, lt, gt, apos, quot.  [ WFC: Parsed Entity ] An entity reference must not contain the name of an unparsed entity  [66] CharRef ::= &apos;&amp;#&apos; [0-9]+ &apos;;&apos; | &apos;&amp;#x&apos; [0-9a-fA-F]+ &apos;;&apos;  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</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='the parser context'/>
-    </function>
     <function name='xmlParserInputBufferCreateFd' file='xmlIO' module='xmlIO'>
-      <info>Create a buffered parser input for the progressive parsing for the input from a file descriptor  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
+      <info>DEPRECATED: Use xmlNewInputFromFd.  Create a buffered parser input for the progressive parsing for the input from a file descriptor  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL'/>
       <arg name='fd' type='int' info='a file descriptor number'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known (deprecated)'/>
     </function>
     <function name='xmlParserInputBufferCreateFile' file='xmlIO' module='xmlIO'>
-      <info>Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
+      <info>DEPRECATED: Don&apos;t use.  Create a buffered parser input for the progressive parsing of a FILE * buffered C I/O  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL'/>
       <arg name='file' type='FILE *' info='a FILE*'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known (deprecated)'/>
     </function>
     <function name='xmlParserInputBufferCreateFilename' file='xmlIO' module='xmlIO'>
-      <info>Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Do an encoding check if enc == XML_CHAR_ENCODING_NONE</info>
+      <info>DEPRECATED: Use xmlNewInputFromUrl.  Create a buffered parser input for the progressive parsing of a file Automatic support for ZLIB/Compress compressed document is provided by default if found at compile-time. Do an encoding check if enc == XML_CHAR_ENCODING_NONE</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL'/>
       <arg name='URI' type='const char *' info='a C string containing the URI or filename'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known'/>
     </function>
     <function name='xmlParserInputBufferCreateFilenameDefault' file='xmlIO' module='xmlIO'>
-      <info>Registers a callback for URI input file handling</info>
+      <info>DEPRECATED: Use xmlCtxtSetResourceLoader or similar functions.  Registers a callback for URI input file handling</info>
       <return type='xmlParserInputBufferCreateFilenameFunc' info='the old value of the registration function'/>
       <arg name='func' type='xmlParserInputBufferCreateFilenameFunc' info='function pointer to the new ParserInputBufferCreateFilenameFunc'/>
     </function>
@@ -12440,7 +11514,7 @@
       <arg name='enc' type='xmlCharEncoding' info='the requested source encoding'/>
     </functype>
     <function name='xmlParserInputBufferCreateIO' file='xmlIO' module='xmlIO'>
-      <info>Create a buffered parser input for the progressive parsing for the input from an I/O handler  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
+      <info>DEPRECATED: Use xmlNewInputFromIO.  Create a buffered parser input for the progressive parsing for the input from an I/O handler  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL'/>
       <arg name='ioread' type='xmlInputReadCallback' info='an I/O read function'/>
       <arg name='ioclose' type='xmlInputCloseCallback' info='an I/O close function'/>
@@ -12448,34 +11522,34 @@
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known (deprecated)'/>
     </function>
     <function name='xmlParserInputBufferCreateMem' file='xmlIO' module='xmlIO'>
-      <info>Create a parser input buffer for parsing from a memory area.  This function makes a copy of the whole input buffer. If you are sure that the contents of the buffer will remain valid until the document was parsed, you can avoid the copy by using xmlParserInputBufferCreateStatic.  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
+      <info>DEPRECATED: Use xmlNewInputFromMemory.  Create a parser input buffer for parsing from a memory area.  This function makes a copy of the whole input buffer. If you are sure that the contents of the buffer will remain valid until the document was parsed, you can avoid the copy by using xmlParserInputBufferCreateStatic.  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL in case of error.'/>
       <arg name='mem' type='const char *' info='the memory input'/>
       <arg name='size' type='int' info='the length of the memory block'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known (deprecated)'/>
     </function>
     <function name='xmlParserInputBufferCreateStatic' file='xmlIO' module='xmlIO'>
-      <info>Create a parser input buffer for parsing from a memory area.  This functions assumes that the contents of the input buffer remain valid until the document was parsed. Use xmlParserInputBufferCreateMem otherwise.  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
+      <info>DEPRECATED: Use xmlNewInputFromMemory.  Create a parser input buffer for parsing from a memory area.  This functions assumes that the contents of the input buffer remain valid until the document was parsed. Use xmlParserInputBufferCreateMem otherwise.  The encoding argument is deprecated and should be set to XML_CHAR_ENCODING_NONE. The encoding can be changed with xmlSwitchEncoding or xmlSwitchEncodingName later on.</info>
       <return type='xmlParserInputBufferPtr' info='the new parser input or NULL in case of error.'/>
       <arg name='mem' type='const char *' info='the memory input'/>
       <arg name='size' type='int' info='the length of the memory block'/>
       <arg name='enc' type='xmlCharEncoding' info='the charset encoding if known'/>
     </function>
     <function name='xmlParserInputBufferGrow' file='xmlIO' module='xmlIO'>
-      <info>Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode  TODO: one should be able to remove one extra copy by copying directly onto in-&gt;buffer or in-&gt;raw</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Grow up the content of the input buffer, the old data are preserved This routine handle the I18N transcoding to internal UTF-8 This routine is used when operating the parser in normal (pull) mode</info>
       <return type='int' info='the number of chars read and stored in the buffer, or -1 in case of error.'/>
       <arg name='in' type='xmlParserInputBufferPtr' info='a buffered parser input'/>
       <arg name='len' type='int' info='indicative value of the amount of chars to read'/>
     </function>
     <function name='xmlParserInputBufferPush' file='xmlIO' module='xmlIO'>
-      <info>Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Push the content of the arry in the input buffer This routine handle the I18N transcoding to internal UTF-8 This is used when operating the parser in progressive (push) mode.</info>
       <return type='int' info='the number of chars read and stored in the buffer, or -1 in case of error.'/>
       <arg name='in' type='xmlParserInputBufferPtr' info='a buffered parser input'/>
       <arg name='len' type='int' info='the size in bytes of the array.'/>
       <arg name='buf' type='const char *' info='an char array'/>
     </function>
     <function name='xmlParserInputBufferRead' file='xmlIO' module='xmlIO'>
-      <info>Refresh the content of the input buffer, the old data are considered consumed This routine handle the I18N transcoding to internal UTF-8</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Same as xmlParserInputBufferGrow.</info>
       <return type='int' info='the number of chars read and stored in the buffer, or -1 in case of error.'/>
       <arg name='in' type='xmlParserInputBufferPtr' info='a buffered parser input'/>
       <arg name='len' type='int' info='indicative value of the amount of chars to read'/>
@@ -12600,7 +11674,7 @@
       <arg name='val' type='int' info='int 0 or 1'/>
     </function>
     <function name='xmlPopInput' file='parserInternals' module='parser'>
-      <info>xmlPopInput: the current input pointed by ctxt-&gt;input came to an end pop it and return the next char.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.</info>
       <return type='xmlChar' info='the current xmlChar in the parser context'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
     </function>
@@ -12614,7 +11688,6 @@
       <return type='int' info='the number of output callback registered or -1 in case of error.'/>
     </function>
     <function name='xmlPreviousElementSibling' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>Find the closest preceding sibling which is a element.  Note that entity references are not expanded.</info>
       <return type='xmlNodePtr' info='the sibling or NULL if no sibling was found.'/>
       <arg name='node' type='xmlNodePtr' info='the current node'/>
@@ -12626,7 +11699,7 @@
       <arg name='uri' type='xmlURIPtr' info='pointer to an xmlURI'/>
     </function>
     <function name='xmlPushInput' file='parserInternals' module='parser'>
-      <info>Push an input stream onto the stack.</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Push an input stream onto the stack.</info>
       <return type='int' info='-1 in case of error or the index in the input stack'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='input' type='xmlParserInputPtr' info='an XML parser input fragment (entity, XML fragment ...).'/>
@@ -12658,7 +11731,7 @@
       <arg name='options' type='int' info='a combination of xmlParserOption'/>
     </function>
     <function name='xmlReadFile' file='parser' module='parser'>
-      <info>Convenience function to parse an XML file from the filesystem, the network or a global user-define resource loader.  See xmlCtxtReadFile for details.</info>
+      <info>Convenience function to parse an XML file from the filesystem, the network or a global user-define resource loader.  This function always enables the XML_PARSE_UNZIP option for backward compatibility. If a &quot;-&quot; filename is passed, it will read from stdin. Both of these features are potentially insecure and might be removed from later versions.  See xmlCtxtReadFile for details.</info>
       <return type='xmlDocPtr' info='the resulting document tree'/>
       <arg name='filename' type='const char *' info='a file or URL'/>
       <arg name='encoding' type='const char *' info='the document encoding (optional)'/>
@@ -12810,7 +11883,6 @@
       <arg name='line' type='int' info='the line number'/>
     </function>
     <function name='xmlReconciliateNs' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED)</cond>
       <info>This function checks that all the namespaces declared within the given tree are properly declared. This is needed for example after Copy or Cut and then paste operations. The subtree may still hold pointers to namespace declarations outside the subtree or invalid/masked. As much as possible the function try to reuse the existing namespaces found in the new environment. If not possible the new namespaces are redeclared on @tree at the top of the given subtree.</info>
       <return type='int' info='0 on success or -1 in case of error.'/>
       <arg name='doc' type='xmlDocPtr' info='the document'/>
@@ -12923,13 +11995,13 @@
     </function>
     <function name='xmlRegexpPrint' file='xmlregexp' module='xmlregexp'>
       <cond>defined(LIBXML_REGEXP_ENABLED)</cond>
-      <info>Print the content of the compiled regular expression</info>
+      <info>DEPRECATED: Don&apos;t use.  No-op since 2.14.0.</info>
       <return type='void'/>
       <arg name='output' type='FILE *' info='the file for the output debug'/>
       <arg name='regexp' type='xmlRegexpPtr' info='the compiled regexp'/>
     </function>
     <function name='xmlRegisterCharEncodingHandler' file='encoding' module='encoding'>
-      <info>Register the char encoding handler, surprising, isn&apos;t it ?</info>
+      <info>DEPRECATED: This function modifies global state and is not thread-safe.  Register the char encoding handler.</info>
       <return type='void'/>
       <arg name='handler' type='xmlCharEncodingHandlerPtr' info='the xmlCharEncodingHandlerPtr handler block'/>
     </function>
@@ -12948,7 +12020,7 @@
       <return type='void'/>
     </function>
     <function name='xmlRegisterInputCallbacks' file='xmlIO' module='xmlIO'>
-      <info>Register a new set of I/O callback for handling parser input.</info>
+      <info>DEPRECATED: Use xmlCtxtSetResourceLoader or similar functions.  Register a new set of I/O callback for handling parser input.</info>
       <return type='int' info='the registered handler number or -1 in case of error'/>
       <arg name='matchFunc' type='xmlInputMatchCallback' info='the xmlInputMatchCallback'/>
       <arg name='openFunc' type='xmlInputOpenCallback' info='the xmlInputOpenCallback'/>
@@ -12975,44 +12047,44 @@
       <arg name='closeFunc' type='xmlOutputCloseCallback' info='the xmlOutputCloseCallback'/>
     </function>
     <function name='xmlRelaxNGCleanupTypes' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_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 Schemas type library associated to RelaxNG</info>
       <return type='void'/>
     </function>
     <function name='xmlRelaxNGDump' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
       <info>Dump a RelaxNG structure back</info>
       <return type='void'/>
       <arg name='output' type='FILE *' info='the file output'/>
       <arg name='schema' type='xmlRelaxNGPtr' info='a schema structure'/>
     </function>
     <function name='xmlRelaxNGDumpTree' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
       <info>Dump the transformed RelaxNG tree.</info>
       <return type='void'/>
       <arg name='output' type='FILE *' info='the file output'/>
       <arg name='schema' type='xmlRelaxNGPtr' info='a schema structure'/>
     </function>
     <function name='xmlRelaxNGFree' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Deallocate a RelaxNG structure.</info>
       <return type='void'/>
       <arg name='schema' type='xmlRelaxNGPtr' info='a schema structure'/>
     </function>
     <function name='xmlRelaxNGFreeParserCtxt' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Free the resources associated to the schema parser context</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='the schema parser context'/>
     </function>
     <function name='xmlRelaxNGFreeValidCtxt' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Free the resources associated to the schema validation context</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='the schema validation context'/>
     </function>
     <function name='xmlRelaxNGGetParserErrors' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Get the callback information used to handle errors for a validation context</info>
       <return type='int' info='-1 in case of failure, 0 otherwise.'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a Relax-NG validation context'/>
@@ -13021,7 +12093,7 @@
       <arg name='ctx' type='void **' info='contextual data for the callbacks result'/>
     </function>
     <function name='xmlRelaxNGGetValidErrors' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Get the error and warning callback information</info>
       <return type='int' info='-1 in case of error and 0 otherwise'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
@@ -13030,43 +12102,43 @@
       <arg name='ctx' type='void **' info='the functions context result'/>
     </function>
     <function name='xmlRelaxNGInitTypes' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Initialize the default type libraries.</info>
       <return type='int' info='0 in case of success and -1 in case of error.'/>
     </function>
     <function name='xmlRelaxNGNewDocParserCtxt' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Create an XML RelaxNGs parser context for that document. Note: since the process of compiling a RelaxNG schemas modifies the document, the @doc parameter is duplicated internally.</info>
       <return type='xmlRelaxNGParserCtxtPtr' info='the parser context or NULL in case of error'/>
       <arg name='doc' type='xmlDocPtr' info='a preparsed document tree'/>
     </function>
     <function name='xmlRelaxNGNewMemParserCtxt' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Create an XML RelaxNGs parse context for that memory buffer expected to contain an XML RelaxNGs file.</info>
       <return type='xmlRelaxNGParserCtxtPtr' info='the parser context or NULL in case of error'/>
       <arg name='buffer' type='const char *' info='a pointer to a char array containing the schemas'/>
       <arg name='size' type='int' info='the size of the array'/>
     </function>
     <function name='xmlRelaxNGNewParserCtxt' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Create an XML RelaxNGs parse context for that file/resource expected to contain an XML RelaxNGs file.</info>
       <return type='xmlRelaxNGParserCtxtPtr' info='the parser context or NULL in case of error'/>
       <arg name='URL' type='const char *' info='the location of the schema'/>
     </function>
     <function name='xmlRelaxNGNewValidCtxt' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Create an XML RelaxNGs validation context based on the given schema</info>
       <return type='xmlRelaxNGValidCtxtPtr' info='the validation context or NULL in case of error'/>
       <arg name='schema' type='xmlRelaxNGPtr' info='a precompiled XML RelaxNGs'/>
     </function>
     <function name='xmlRelaxNGParse' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances.</info>
       <return type='xmlRelaxNGPtr' info='the internal XML RelaxNG structure built from the resource or NULL in case of error'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a Relax-NG parser context'/>
     </function>
     <function name='xmlRelaxNGSetParserErrors' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>DEPRECATED: Use xmlRelaxNGSetParserStructuredErrors.  Set the callback functions used to handle errors for a validation context</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a Relax-NG validation context'/>
@@ -13075,15 +12147,23 @@
       <arg name='ctx' type='void *' info='contextual data for the callbacks'/>
     </function>
     <function name='xmlRelaxNGSetParserStructuredErrors' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Set the callback functions used to handle errors for a parsing context</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a Relax-NG parser context'/>
       <arg name='serror' type='xmlStructuredErrorFunc' info='the error callback'/>
       <arg name='ctx' type='void *' info='contextual data for the callbacks'/>
     </function>
+    <function name='xmlRelaxNGSetResourceLoader' file='relaxng' module='relaxng'>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
+      <info>Set the callback function used to load external resources.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a Relax-NG parser context'/>
+      <arg name='loader' type='xmlResourceLoader' info='the callback'/>
+      <arg name='vctxt' type='void *' info='contextual data for the callbacks'/>
+    </function>
     <function name='xmlRelaxNGSetValidErrors' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>DEPRECATED: Use xmlRelaxNGSetValidStructuredErrors.  Set the error and warning callback information</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
@@ -13092,7 +12172,7 @@
       <arg name='ctx' type='void *' info='the functions context'/>
     </function>
     <function name='xmlRelaxNGSetValidStructuredErrors' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Set the structured error callback</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
@@ -13100,14 +12180,14 @@
       <arg name='ctx' type='void *' info='the functions context'/>
     </function>
     <function name='xmlRelaxNGValidateDoc' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Validate a document tree in memory.</info>
       <return type='int' info='0 if the document is valid, a positive error code number otherwise and -1 in case of internal or API error.'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='a Relax-NG validation context'/>
       <arg name='doc' type='xmlDocPtr' info='a parsed document tree'/>
     </function>
     <function name='xmlRelaxNGValidateFullElement' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Validate a full subtree when xmlRelaxNGValidatePushElement() returned 0 and the content of the node has been expanded.</info>
       <return type='int' info='1 if no validation problem was found or -1 in case of error.'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='the validation context'/>
@@ -13115,7 +12195,7 @@
       <arg name='elem' type='xmlNodePtr' info='an element instance'/>
     </function>
     <function name='xmlRelaxNGValidatePopElement' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Pop the element end from the RelaxNG validation stack.</info>
       <return type='int' info='1 if no validation problem was found or 0 otherwise'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='the RelaxNG validation context'/>
@@ -13123,7 +12203,7 @@
       <arg name='elem' type='xmlNodePtr' info='an element instance'/>
     </function>
     <function name='xmlRelaxNGValidatePushCData' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>check the CData parsed for validation in the current stack</info>
       <return type='int' info='1 if no validation problem was found or -1 otherwise'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='the RelaxNG validation context'/>
@@ -13131,7 +12211,7 @@
       <arg name='len' type='int' info='the length of the data'/>
     </function>
     <function name='xmlRelaxNGValidatePushElement' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Push a new element start on the RelaxNG validation stack.</info>
       <return type='int' info='1 if no validation problem was found or 0 if validating the element requires a full node, and -1 in case of error.'/>
       <arg name='ctxt' type='xmlRelaxNGValidCtxtPtr' info='the validation context'/>
@@ -13139,7 +12219,7 @@
       <arg name='elem' type='xmlNodePtr' info='an element instance'/>
     </function>
     <functype name='xmlRelaxNGValidityErrorFunc' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Signature of an error callback from a Relax-NG validation</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the validation context'/>
@@ -13147,7 +12227,7 @@
       <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <functype name='xmlRelaxNGValidityWarningFunc' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Signature of a warning callback from a Relax-NG validation</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the validation context'/>
@@ -13155,7 +12235,7 @@
       <arg name='...' type='...' info='extra arguments'/>
     </functype>
     <function name='xmlRelaxParserSetFlag' file='relaxng' module='relaxng'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Semi private function used to pass information to a parser context which are a combination of xmlRelaxNGParserFlag .</info>
       <return type='int' info='0 if success and -1 in case of error'/>
       <arg name='ctxt' type='xmlRelaxNGParserCtxtPtr' info='a RelaxNG parser context'/>
@@ -13179,7 +12259,6 @@
       <arg name='attr' type='xmlAttrPtr' info='the attribute'/>
     </function>
     <function name='xmlReplaceNode' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)</cond>
       <info>Unlink the old node. If @cur is provided, it is unlinked and inserted in place of @old.  It is an error if @old has no parent.  Unlike xmlAddChild, this function doesn&apos;t merge text nodes or delete duplicate attributes.  See the notes in xmlAddChild.</info>
       <return type='xmlNodePtr' info='@old or NULL if arguments are invalid or a memory allocation failed.'/>
       <arg name='old' type='xmlNodePtr' info='the old node'/>
@@ -13194,6 +12273,16 @@
       <info>Cleanup the last global error registered. For parsing error this does not change the well-formedness result.</info>
       <return type='void'/>
     </function>
+    <functype name='xmlResourceLoader' file='parser' module='parser'>
+      <info>Callback for custom resource loaders.  @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.  On success, @out should be set to a new parser input object and XML_ERR_OK should be returned.</info>
+      <return type='xmlParserErrors' info='an xmlParserErrors code.'/>
+      <arg name='ctxt' type='void *' info='parser context'/>
+      <arg name='url' type='const char *' info='URL to load'/>
+      <arg name='publicId' type='const char *' info='publid ID from DTD (optional)'/>
+      <arg name='type' type='xmlResourceType' info='resource type'/>
+      <arg name='flags' type='xmlParserInputFlags' info='flags'/>
+      <arg name='out' type='xmlParserInputPtr *' info='result pointer'/>
+    </functype>
     <function name='xmlSAX2AttributeDecl' file='SAX2' module='SAX2'>
       <info>An attribute definition has been parsed</info>
       <return type='void'/>
@@ -13239,8 +12328,7 @@
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
     </function>
     <function name='xmlSAX2EndElement' file='SAX2' module='SAX2'>
-      <cond>defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when the end of an element has been detected.</info>
+      <info>DEPRECATED: Don&apos;t call this function directly.  called when the end of an element has been detected.  Used for HTML and SAX1.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='name' type='const xmlChar *' info='The element name'/>
@@ -13367,8 +12455,8 @@
       <arg name='name' type='const xmlChar *' info='The entity name'/>
     </function>
     <function name='xmlSAX2ResolveEntity' file='SAX2' module='SAX2'>
-      <info>The entity loader, to control the loading of external entities, the application can either: - override this xmlSAX2ResolveEntity() callback in the SAX block - or better use the xmlSetExternalEntityLoader() function to set up it&apos;s own entity resolution routine</info>
-      <return type='xmlParserInputPtr' info='the xmlParserInputPtr if inlined or NULL for DOM behaviour.'/>
+      <info>This is only used to load DTDs. The preferred way to install custom resolvers is xmlCtxtSetResourceLoader.</info>
+      <return type='xmlParserInputPtr' info='a parser input.'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='publicId' type='const xmlChar *' info='The public ID of the entity'/>
       <arg name='systemId' type='const xmlChar *' info='The system ID of the entity'/>
@@ -13385,8 +12473,7 @@
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
     </function>
     <function name='xmlSAX2StartElement' file='SAX2' module='SAX2'>
-      <cond>defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>called when an opening tag has been processed.</info>
+      <info>DEPRECATED: Don&apos;t call this function directly.  Called when an opening tag has been processed.  Used for HTML and SAX1.</info>
       <return type='void'/>
       <arg name='ctx' type='void *' info='the user data (XML parser context)'/>
       <arg name='fullname' type='const xmlChar *' info='The element name, including namespace prefix'/>
@@ -13416,13 +12503,13 @@
     </function>
     <function name='xmlSAXDefaultVersion' file='SAX2' module='SAX2'>
       <cond>defined(LIBXML_SAX1_ENABLED)</cond>
-      <info>DEPRECATED: Use parser option XML_PARSE_SAX1.  Set the default version of SAX used globally by the library. By default, during initialization the default is set to 2. Note that it is generally a better coding style to use xmlSAXVersion() to set up the version explicitly for a given parsing context.</info>
-      <return type='int' info='the previous value in case of success and -1 in case of error.'/>
-      <arg name='version' type='int' info='the version, 1 or 2'/>
+      <info>DEPRECATED: Use parser option XML_PARSE_SAX1.  Has no effect.</info>
+      <return type='int' info='2 in case of success and -1 in case of error.'/>
+      <arg name='version' type='int' info='the version, must be 2'/>
     </function>
     <function name='xmlSAXParseDTD' file='parser' module='parser'>
       <cond>defined(LIBXML_VALID_ENABLED)</cond>
-      <info>DEPRECATED: Don&apos;t use.  Load and parse an external subset.</info>
+      <info>DEPRECATED: Use xmlCtxtParseDtd.  Load and parse an external subset.</info>
       <return type='xmlDtdPtr' info='the resulting xmlDtdPtr or NULL in case of error.'/>
       <arg name='sax' type='xmlSAXHandlerPtr' info='the SAX handler block'/>
       <arg name='ExternalID' type='const xmlChar *' info='a NAME* containing the External ID of the DTD'/>
@@ -13541,7 +12628,7 @@
     <function name='xmlSaveFinish' file='xmlsave' module='xmlsave'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
       <info>Close a document saving context, i.e. make sure that all bytes have been output and free the associated data.  Available since 2.13.0.</info>
-      <return type='int' info='an xmlParserErrors code.'/>
+      <return type='xmlParserErrors' info='an xmlParserErrors code.'/>
       <arg name='ctxt' type='xmlSaveCtxtPtr' info='a document saving context'/>
     </function>
     <function name='xmlSaveFlush' file='xmlsave' module='xmlsave'>
@@ -13578,18 +12665,25 @@
     </function>
     <function name='xmlSaveSetAttrEscape' file='xmlsave' module='xmlsave'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Set a custom escaping function to be used for text in attribute content</info>
+      <info>DEPRECATED: Don&apos;t use.  Has no effect.</info>
       <return type='int' info='0 if successful or -1 in case of error.'/>
       <arg name='ctxt' type='xmlSaveCtxtPtr' info='a document saving context'/>
       <arg name='escape' type='xmlCharEncodingOutputFunc' info='the escaping function'/>
     </function>
     <function name='xmlSaveSetEscape' file='xmlsave' module='xmlsave'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Set a custom escaping function to be used for text in element content</info>
+      <info>DEPRECATED: Don&apos;t use.  Set a custom escaping function to be used for text in element content</info>
       <return type='int' info='0 if successful or -1 in case of error.'/>
       <arg name='ctxt' type='xmlSaveCtxtPtr' info='a document saving context'/>
       <arg name='escape' type='xmlCharEncodingOutputFunc' info='the escaping function'/>
     </function>
+    <function name='xmlSaveSetIndentString' file='xmlsave' module='xmlsave'>
+      <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
+      <info>Sets the indent string.  Available since 2.14.0.</info>
+      <return type='int' info='0 on success, -1 if the string is NULL, empty or too long.'/>
+      <arg name='ctxt' type='xmlSaveCtxtPtr' info='save context'/>
+      <arg name='indent' type='const char *' info='indent string'/>
+    </function>
     <function name='xmlSaveToBuffer' file='xmlsave' module='xmlsave'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
       <info>Create a document saving context serializing to a buffer with the encoding and the options given</info>
@@ -13636,12 +12730,6 @@
       <return type='xmlChar *' info='a new string (to be deallocated by caller)'/>
       <arg name='uri' type='xmlURIPtr' info='pointer to an xmlURI'/>
     </function>
-    <function name='xmlScanName' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Trickery: parse an XML name but without consuming the input flow Needed for rollback cases. Used only when parsing entities references.  TODO: seems deprecated now, only used in the default part of xmlParserHandleReference  [4] NameChar ::= Letter | Digit | &apos;.&apos; | &apos;-&apos; | &apos;_&apos; | &apos;:&apos; | CombiningChar | Extender  [5] Name ::= (Letter | &apos;_&apos; | &apos;:&apos;) (NameChar)*  [6] Names ::= Name (S Name)*</info>
-      <return type='xmlChar *' info='the Name parsed or NULL'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
-    </function>
     <function name='xmlSchemaCheckFacet' file='xmlschemastypes' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Checks and computes the values of facets.</info>
@@ -13685,7 +12773,7 @@
       <arg name='val' type='xmlSchemaValPtr' info='the precomputed value to be copied'/>
     </function>
     <function name='xmlSchemaDump' file='xmlschemas' module='xmlschemas'>
-      <cond>defined(LIBXML_SCHEMAS_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
+      <cond>defined(LIBXML_SCHEMAS_ENABLED) &amp;&amp; defined(LIBXML_DEBUG_ENABLED)</cond>
       <info>Dump a Schema structure.</info>
       <return type='void'/>
       <arg name='output' type='FILE *' info='the file output'/>
@@ -13903,6 +12991,14 @@
       <arg name='serror' type='xmlStructuredErrorFunc' info='the structured error function'/>
       <arg name='ctx' type='void *' info='the functions context'/>
     </function>
+    <function name='xmlSchemaSetResourceLoader' file='xmlschemas' module='xmlschemas'>
+      <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <info>Register a callback function that will be called to load documents or external entities.  Available since 2.14.0.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlSchemaParserCtxtPtr' info='schema parser'/>
+      <arg name='loader' type='xmlResourceLoader' info='resource loader'/>
+      <arg name='data' type='void *' info='user data which will be passed to the loader'/>
+    </function>
     <function name='xmlSchemaSetValidErrors' file='xmlschemas' module='xmlschemas'>
       <cond>defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>DEPRECATED: Use xmlSchemaSetValidStructuredErrors.  Set the error and warning callback information</info>
@@ -14059,7 +13155,7 @@
       <arg name='ctxt' type='xmlSchemaValidCtxtPtr' info='a schema validation context'/>
       <arg name='input' type='xmlParserInputBufferPtr' info='the input to use for reading the data'/>
       <arg name='enc' type='xmlCharEncoding' info='an optional encoding information'/>
-      <arg name='sax' type='xmlSAXHandlerPtr' info='a SAX handler for the resulting events'/>
+      <arg name='sax' type='const xmlSAXHandler *' info='a SAX handler for the resulting events'/>
       <arg name='user_data' type='void *' info='the context to provide to the SAX handler.'/>
     </function>
     <functype name='xmlSchemaValidityErrorFunc' file='xmlschemas' module='xmlschemas'>
@@ -14212,8 +13308,8 @@
       <arg name='node' type='xmlNodePtr' info='the current node'/>
       <arg name='href' type='const xmlChar *' info='the namespace value'/>
     </function>
-    <function name='xmlSetBufferAllocationScheme' file='tree' module='tree'>
-      <info>Set the buffer allocation method.  Types are XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, improves performance</info>
+    <function name='xmlSetBufferAllocationScheme' file='tree' module='buf'>
+      <info>DEPRECATED: Use xmlBufferSetAllocationScheme.  Set the buffer allocation method.  Types are XML_BUFFER_ALLOC_EXACT - use exact sizes, keeps memory usage down XML_BUFFER_ALLOC_DOUBLEIT - double buffer when extra needed, improves performance</info>
       <return type='void'/>
       <arg name='scheme' type='xmlBufferAllocationScheme' info='allocation method to use'/>
     </function>
@@ -14228,25 +13324,11 @@
       <arg name='doc' type='xmlDocPtr' info='the document'/>
       <arg name='mode' type='int' info='the compression ratio'/>
     </function>
-    <function name='xmlSetEntityReferenceFunc' file='parserInternals' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Set the function to call call back when a xml reference has been made</info>
-      <return type='void'/>
-      <arg name='func' type='xmlEntityReferenceFunc' info='A valid function'/>
-    </function>
     <function name='xmlSetExternalEntityLoader' file='parser' module='parserInternals'>
-      <info>Changes the defaultexternal entity resolver function for the application</info>
+      <info>DEPRECATED: This is a global setting and not thread-safe. Use xmlCtxtSetResourceLoader or similar functions.  Changes the default external entity resolver function for the application.</info>
       <return type='void'/>
       <arg name='f' type='xmlExternalEntityLoader' info='the new entity resolver function'/>
     </function>
-    <function name='xmlSetFeature' file='parser' module='legacy'>
-      <cond>defined(LIBXML_LEGACY_ENABLED)</cond>
-      <info>Change the current value of one feature of this parser instance</info>
-      <return type='int' info='-1 in case or error, 0 otherwise'/>
-      <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML/HTML parser context'/>
-      <arg name='name' type='const char *' info='the feature name'/>
-      <arg name='value' type='void *' info='pointer to the location of the new value'/>
-    </function>
     <function name='xmlSetGenericErrorFunc' file='xmlerror' module='error'>
       <info>DEPRECATED: See xmlSetStructuredErrorFunc for alternatives.  Set the global &quot;generic&quot; handler and context for error messages. The generic error handler will only receive fragments of error messages which should be concatenated or printed to a stream.  If handler is NULL, use the built-in default handler which prints to stderr.  Since this is a global setting, it&apos;s a good idea to reset the error handler to its default value after collecting the errors you&apos;re interested in.  For multi-threaded applications, this must be set separately for each thread.</info>
       <return type='void'/>
@@ -14266,7 +13348,6 @@
       <arg name='ns' type='xmlNsPtr' info='a namespace pointer (optional)'/>
     </function>
     <function name='xmlSetNsProp' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)</cond>
       <info>Set (or reset) an attribute carried by a node. The ns structure must be in scope, this is not checked</info>
       <return type='xmlAttrPtr' info='the attribute pointer.'/>
       <arg name='node' type='xmlNodePtr' info='the node'/>
@@ -14275,7 +13356,6 @@
       <arg name='value' type='const xmlChar *' info='the attribute value'/>
     </function>
     <function name='xmlSetProp' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)</cond>
       <info>Set (or reset) an attribute carried by a node. If @name has a prefix, then the corresponding namespace-binding will be used, if in scope; it is an error it there&apos;s no such ns-binding for the prefix in scope.</info>
       <return type='xmlAttrPtr' info='the attribute pointer.'/>
       <arg name='node' type='xmlNodePtr' info='the node'/>
@@ -14302,146 +13382,13 @@
       <arg name='buffer' type='const xmlChar *' info='a xmlChar * buffer'/>
       <arg name='filename' type='const char *' info='a file name'/>
     </function>
-    <function name='xmlShell' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell This allow to load, validate, view, modify and save a document using a environment similar to a UNIX commandline.</info>
-      <return type='void'/>
-      <arg name='doc' type='xmlDocPtr' info='the initial document'/>
-      <arg name='filename' type='const char *' info='the output buffer'/>
-      <arg name='input' type='xmlShellReadlineFunc' info='the line reading function'/>
-      <arg name='output' type='FILE *' info='the output FILE*, defaults to stdout if NULL'/>
-    </function>
-    <function name='xmlShellBase' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;base&quot; dumps the current XML base of the node</info>
-      <return type='int' info='0'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='arg' type='char *' info='unused'/>
-      <arg name='node' type='xmlNodePtr' info='a node'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellCat' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;cat&quot; dumps the serialization node content (XML or HTML).</info>
-      <return type='int' info='0'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='arg' type='char *' info='unused'/>
-      <arg name='node' type='xmlNodePtr' info='a node'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <functype name='xmlShellCmd' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>This is a generic signature for the XML shell functions.</info>
-      <return type='int' info='an int, negative returns indicating errors.'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='a shell context'/>
-      <arg name='arg' type='char *' info='a string argument'/>
-      <arg name='node' type='xmlNodePtr' info='a first node'/>
-      <arg name='node2' type='xmlNodePtr' info='a second node'/>
-    </functype>
-    <function name='xmlShellDir' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;dir&quot; dumps information about the node (namespace, attributes, content).</info>
-      <return type='int' info='0'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='arg' type='char *' info='unused'/>
-      <arg name='node' type='xmlNodePtr' info='a node'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellDu' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;du&quot; show the structure of the subtree under node @tree If @tree is null, the command works on the current node.</info>
-      <return type='int' info='0 or -1 in case of error'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='arg' type='char *' info='unused'/>
-      <arg name='tree' type='xmlNodePtr' info='a node defining a subtree'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellList' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;ls&quot; Does an Unix like listing of the given node (like a directory)</info>
-      <return type='int' info='0'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='arg' type='char *' info='unused'/>
-      <arg name='node' type='xmlNodePtr' info='a node'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellLoad' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;load&quot; loads a new document specified by the filename</info>
-      <return type='int' info='0 or -1 if loading failed'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='filename' type='char *' info='the file name'/>
-      <arg name='node' type='xmlNodePtr' info='unused'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellPrintNode' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Print node to the output FILE</info>
-      <return type='void'/>
-      <arg name='node' type='xmlNodePtr' info='a non-null node to print to the output FILE'/>
-    </function>
-    <function name='xmlShellPrintXPathError' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Print the xpath error to libxml default error channel</info>
-      <return type='void'/>
-      <arg name='errorType' type='int' info='valid xpath error id'/>
-      <arg name='arg' type='const char *' info='the argument that cause xpath to fail'/>
-    </function>
-    <function name='xmlShellPrintXPathResult' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Prints result to the output FILE</info>
-      <return type='void'/>
-      <arg name='list' type='xmlXPathObjectPtr' info='a valid result generated by an xpath evaluation'/>
-    </function>
-    <function name='xmlShellPwd' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;pwd&quot; Show the full path from the root to the node, if needed building thumblers when similar elements exists at a given ancestor level. The output is compatible with XPath commands.</info>
-      <return type='int' info='0 or -1 in case of error'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='buffer' type='char *' info='the output buffer'/>
-      <arg name='node' type='xmlNodePtr' info='a node'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <functype name='xmlShellReadlineFunc' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>This is a generic signature for the XML shell input function.</info>
-      <return type='char *' info='a string which will be freed by the Shell.'/>
-      <arg name='prompt' type='char *' info='a string prompt'/>
-    </functype>
-    <function name='xmlShellSave' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;save&quot; Write the current document to the filename, or it&apos;s original name</info>
-      <return type='int' info='0 or -1 in case of error'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='filename' type='char *' info='the file name (optional)'/>
-      <arg name='node' type='xmlNodePtr' info='unused'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellValidate' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_VALID_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;validate&quot; Validate the document, if a DTD path is provided, then the validation is done against the given DTD.</info>
-      <return type='int' info='0 or -1 in case of error'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='dtd' type='char *' info='the DTD URI (optional)'/>
-      <arg name='node' type='xmlNodePtr' info='unused'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
-    <function name='xmlShellWrite' file='debugXML' module='debugXML'>
-      <cond>defined(LIBXML_DEBUG_ENABLED) &amp;&amp; defined(LIBXML_XPATH_ENABLED) &amp;&amp; defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Implements the XML shell function &quot;write&quot; Write the current node to the filename, it saves the serialization of the subtree under the @node specified</info>
-      <return type='int' info='0 or -1 in case of error'/>
-      <arg name='ctxt' type='xmlShellCtxtPtr' info='the shell context'/>
-      <arg name='filename' type='char *' info='the file name'/>
-      <arg name='node' type='xmlNodePtr' info='a node in the tree'/>
-      <arg name='node2' type='xmlNodePtr' info='unused'/>
-    </function>
     <function name='xmlSkipBlankChars' file='parserInternals' module='parser'>
       <info>DEPRECATED: Internal function, do not use.  Skip whitespace in the input stream.</info>
       <return type='int' info='the number of space chars skipped'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='the XML parser context'/>
     </function>
     <function name='xmlSnprintfElementContent' file='valid' module='valid'>
-      <info>This will dump the content of the element content definition Intended just for the debug routine</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  This will dump the content of the element content definition Intended just for the debug routine</info>
       <return type='void'/>
       <arg name='buf' type='char *' info='an output buffer'/>
       <arg name='size' type='int' info='the buffer size'/>
@@ -14449,7 +13396,7 @@
       <arg name='englob' type='int' info='1 if one must print the englobing parenthesis, 0 otherwise'/>
     </function>
     <function name='xmlSplitQName' file='parserInternals' module='parser'>
-      <info>parse an UTF8 encoded XML qualified name string  [NS 5] QName ::= (Prefix &apos;:&apos;)? LocalPart  [NS 6] Prefix ::= NCName  [NS 7] LocalPart ::= NCName</info>
+      <info>DEPRECATED: Don&apos;t use.  parse an UTF8 encoded XML qualified name string  [NS 5] QName ::= (Prefix &apos;:&apos;)? LocalPart  [NS 6] Prefix ::= NCName  [NS 7] LocalPart ::= NCName</info>
       <return type='xmlChar *' info='the local part, and prefix is updated to get the Prefix if any.'/>
       <arg name='ctxt' type='xmlParserCtxtPtr' info='an XML parser context'/>
       <arg name='name' type='const xmlChar *' info='an XML parser context'/>
@@ -14469,7 +13416,7 @@
     </function>
     <function name='xmlSprintfElementContent' file='valid' module='valid'>
       <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
-      <info>Deprecated, unsafe, use xmlSnprintfElementContent</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Deprecated, unsafe, use xmlSnprintfElementContent</info>
       <return type='void'/>
       <arg name='buf' type='char *' info='an output buffer'/>
       <arg name='content' type='xmlElementContentPtr' info='An element table'/>
@@ -14605,7 +13552,7 @@
     </function>
     <function name='xmlStringGetNodeList' file='tree' module='tree'>
       <info>DEPRECATED: Use xmlNodeSetContent.  Parse an attribute value and build a node list containing only text and entity reference nodes. The resulting nodes will be associated with the document if provided. The document is also used to look up entities.  The input is not validated. Syntax errors or references to undeclared entities will be ignored silently with unspecified results.</info>
-      <return type='xmlNodePtr' info='a pointer to the first child or NULL if a memory allocation failed.'/>
+      <return type='xmlNodePtr' info='a pointer to the first child or NULL if the value if empty or a memory allocation failed.'/>
       <arg name='doc' type='const xmlDoc *' info='a document (optional)'/>
       <arg name='value' type='const xmlChar *' info='an attribute value'/>
     </function>
@@ -14622,7 +13569,7 @@
     </function>
     <function name='xmlStringLenGetNodeList' file='tree' module='tree'>
       <info>DEPRECATED: Use xmlNodeSetContentLen.  See xmlStringGetNodeList.</info>
-      <return type='xmlNodePtr' info='a pointer to the first child or NULL if a memory allocation failed.'/>
+      <return type='xmlNodePtr' info='a pointer to the first child or NULL if the value if empty or a memory allocation failed.'/>
       <arg name='doc' type='const xmlDoc *' info='a document (optional)'/>
       <arg name='value' type='const xmlChar *' info='an attribute value'/>
       <arg name='len' type='int' info='maximum length of the attribute value'/>
@@ -14723,7 +13670,7 @@
       <arg name='len' type='int' info='@content length'/>
     </function>
     <function name='xmlTextMerge' file='tree' module='tree'>
-      <info>Merge the second text node into the first. The second node is unlinked and freed.</info>
+      <info>Merge the second text node into the first. If @first is NULL, @second is returned. Otherwise, the second node is unlinked and freed.</info>
       <return type='xmlNodePtr' info='the first text node augmented or NULL in case of error.'/>
       <arg name='first' type='xmlNodePtr' info='the first text node'/>
       <arg name='second' type='xmlNodePtr' info='the second text node being merged'/>
@@ -14742,7 +13689,7 @@
     </function>
     <function name='xmlTextReaderByteConsumed' file='xmlreader' module='xmlreader'>
       <cond>defined(LIBXML_READER_ENABLED)</cond>
-      <info>This function provides the current index of the parser used by the reader, relative to the start of the current entity. This function actually just wraps a call to xmlBytesConsumed() for the parser context associated with the reader. See xmlBytesConsumed() for more information.</info>
+      <info>DEPRECATED: The returned value is mostly random and useless. It reflects the parser reading ahead and is in no way related to the current node.  This function provides the current index of the parser used by the reader, relative to the start of the current entity. This function actually just wraps a call to xmlBytesConsumed() for the parser context associated with the reader. See xmlBytesConsumed() for more information.</info>
       <return type='long' info='the index in bytes from the beginning of the entity or -1 in case the index could not be computed.'/>
       <arg name='reader' type='xmlTextReaderPtr' info='an XML reader'/>
     </function>
@@ -15103,25 +14050,25 @@
     <function name='xmlTextReaderReadString' file='xmlreader' module='xmlreader'>
       <cond>defined(LIBXML_READER_ENABLED)</cond>
       <info>Reads the contents of an element or a text node as a string.</info>
-      <return type='xmlChar *' info='a string containing the contents of the Element or Text node, or NULL if the reader is positioned on any other type of node. The string must be deallocated by the caller.'/>
+      <return type='xmlChar *' info='a string containing the contents of the non-empty Element or Text node (including CDATA sections), or NULL if the reader is positioned on any other type of node. The string must be deallocated by the caller.'/>
       <arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
     </function>
     <function name='xmlTextReaderRelaxNGSetSchema' file='xmlreader' module='xmlreader'>
-      <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Use RelaxNG to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is NULL, then RelaxNG validation is deactivated. @ The @schema should not be freed until the reader is deallocated or its use has been deactivated.</info>
       <return type='int' info='0 in case the RelaxNG validation could be (de)activated and -1 in case of error.'/>
       <arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
       <arg name='schema' type='xmlRelaxNGPtr' info='a precompiled RelaxNG schema'/>
     </function>
     <function name='xmlTextReaderRelaxNGValidate' file='xmlreader' module='xmlreader'>
-      <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Use RelaxNG schema to validate the document as it is processed. Activation is only possible before the first Read(). If @rng is NULL, then RelaxNG schema validation is deactivated.</info>
       <return type='int' info='0 in case the schemas validation could be (de)activated and -1 in case of error.'/>
       <arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
       <arg name='rng' type='const char *' info='the path to a RelaxNG schema or NULL'/>
     </function>
     <function name='xmlTextReaderRelaxNGValidateCtxt' file='xmlreader' module='xmlreader'>
-      <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_RELAXNG_ENABLED)</cond>
       <info>Use RelaxNG schema context to validate the document as it is processed. Activation is only possible before the first Read(). If @ctxt is NULL, then RelaxNG schema validation is deactivated.</info>
       <return type='int' info='0 in case the schemas validation could be (de)activated and -1 in case of error.'/>
       <arg name='reader' type='xmlTextReaderPtr' info='the xmlTextReaderPtr used'/>
@@ -15166,6 +14113,14 @@
       <arg name='prop' type='int' info='the xmlParserProperties to set'/>
       <arg name='value' type='int' info='usually 0 or 1 to (de)activate it'/>
     </function>
+    <function name='xmlTextReaderSetResourceLoader' file='xmlreader' module='xmlreader'>
+      <cond>defined(LIBXML_READER_ENABLED)</cond>
+      <info>Register a callback function that will be called to load external resources like entities.  Available since 2.14.0.</info>
+      <return type='void'/>
+      <arg name='reader' type='xmlTextReaderPtr' info='thr reader'/>
+      <arg name='loader' type='xmlResourceLoader' info='resource loader'/>
+      <arg name='data' type='void *' info='user data which will be passed to the loader'/>
+    </function>
     <function name='xmlTextReaderSetSchema' file='xmlreader' module='xmlreader'>
       <cond>defined(LIBXML_READER_ENABLED) &amp;&amp; defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Use XSD Schema to validate the document as it is processed. Activation is only possible before the first Read(). if @schema is NULL, then Schema validation is deactivated. The @schema should not be freed until the reader is deallocated or its use has been deactivated.</info>
@@ -15813,16 +14768,6 @@
       <arg name='format' type='const char *' info='format string (see printf)'/>
       <arg name='argptr' type='va_list' info='pointer to the first member of the variable argument list.'/>
     </function>
-    <function name='xmlThrDefBufferAllocScheme' file='tree' module='tree'>
-      <info></info>
-      <return type='xmlBufferAllocationScheme' info=''/>
-      <arg name='v' type='xmlBufferAllocationScheme' info=''/>
-    </function>
-    <function name='xmlThrDefDefaultBufferSize' file='tree' module='tree'>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='v' type='int' info=''/>
-    </function>
     <function name='xmlThrDefDeregisterNodeDefault' file='tree' module='tree'>
       <info></info>
       <return type='xmlDeregisterNodeFunc' info=''/>
@@ -15864,11 +14809,6 @@
       <return type='xmlOutputBufferCreateFilenameFunc' info=''/>
       <arg name='func' type='xmlOutputBufferCreateFilenameFunc' info=''/>
     </function>
-    <function name='xmlThrDefParserDebugEntities' file='parser' module='parser'>
-      <info></info>
-      <return type='int' info=''/>
-      <arg name='v' type='int' info=''/>
-    </function>
     <function name='xmlThrDefParserInputBufferCreateFilenameDefault' file='xmlIO' module='xmlIO'>
       <info></info>
       <return type='xmlParserInputBufferCreateFilenameFunc' info=''/>
@@ -15913,1004 +14853,6 @@
       <return type='const char *' info=''/>
       <arg name='v' type='const char *' info=''/>
     </function>
-    <function name='xmlUCSIsAegeanNumbers' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of AegeanNumbers UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsAlphabeticPresentationForms' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of AlphabeticPresentationForms UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsArabic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Arabic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsArabicPresentationFormsA' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of ArabicPresentationForms-A UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsArabicPresentationFormsB' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of ArabicPresentationForms-B UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsArmenian' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Armenian UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsArrows' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Arrows UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBasicLatin' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of BasicLatin UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBengali' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Bengali UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBlock' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of the UCS Block</info>
-      <return type='int' info='1 if true, 0 if false and -1 on unknown block'/>
-      <arg name='code' type='int' info='UCS code point'/>
-      <arg name='block' type='const char *' info='UCS block name'/>
-    </function>
-    <function name='xmlUCSIsBlockElements' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of BlockElements UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBopomofo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Bopomofo UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBopomofoExtended' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of BopomofoExtended UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBoxDrawing' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of BoxDrawing UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBraillePatterns' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of BraillePatterns UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsBuhid' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Buhid UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsByzantineMusicalSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of ByzantineMusicalSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKCompatibility' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKCompatibility UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKCompatibilityForms' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKCompatibilityForms UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKCompatibilityIdeographs' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKCompatibilityIdeographs UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKCompatibilityIdeographsSupplement' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKCompatibilityIdeographsSupplement UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKRadicalsSupplement' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKRadicalsSupplement UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKSymbolsandPunctuation' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKSymbolsandPunctuation UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKUnifiedIdeographs' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKUnifiedIdeographs UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKUnifiedIdeographsExtensionA' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKUnifiedIdeographsExtensionA UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCJKUnifiedIdeographsExtensionB' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CJKUnifiedIdeographsExtensionB UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCat' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of the UCS Category</info>
-      <return type='int' info='1 if true, 0 if false and -1 on unknown category'/>
-      <arg name='code' type='int' info='UCS code point'/>
-      <arg name='cat' type='const char *' info='UCS Category name'/>
-    </function>
-    <function name='xmlUCSIsCatC' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of C UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatCc' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Cc UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatCf' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Cf UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatCo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Co UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatCs' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Cs UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatL' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of L UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatLl' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Ll UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatLm' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Lm UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatLo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Lo UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatLt' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Lt UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatLu' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Lu UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatM' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of M UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatMc' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Mc UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatMe' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Me UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatMn' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Mn UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatN' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of N UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatNd' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Nd UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatNl' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Nl UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatNo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of No UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatP' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of P UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPc' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Pc UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPd' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Pd UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPe' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Pe UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPf' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Pf UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPi' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Pi UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Po UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatPs' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Ps UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatS' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of S UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatSc' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Sc UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatSk' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Sk UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatSm' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Sm UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatSo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of So UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatZ' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Z UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatZl' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Zl UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatZp' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Zp UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCatZs' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Zs UCS Category</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCherokee' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Cherokee UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCombiningDiacriticalMarks' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CombiningDiacriticalMarks UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCombiningDiacriticalMarksforSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CombiningDiacriticalMarksforSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCombiningHalfMarks' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CombiningHalfMarks UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCombiningMarksforSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CombiningMarksforSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsControlPictures' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of ControlPictures UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCurrencySymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CurrencySymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCypriotSyllabary' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CypriotSyllabary UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCyrillic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Cyrillic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsCyrillicSupplement' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of CyrillicSupplement UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsDeseret' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Deseret UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsDevanagari' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Devanagari UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsDingbats' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Dingbats UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsEnclosedAlphanumerics' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of EnclosedAlphanumerics UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsEnclosedCJKLettersandMonths' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of EnclosedCJKLettersandMonths UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsEthiopic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Ethiopic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGeneralPunctuation' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of GeneralPunctuation UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGeometricShapes' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of GeometricShapes UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGeorgian' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Georgian UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGothic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Gothic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGreek' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Greek UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGreekExtended' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of GreekExtended UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGreekandCoptic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of GreekandCoptic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGujarati' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Gujarati UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsGurmukhi' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Gurmukhi UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHalfwidthandFullwidthForms' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of HalfwidthandFullwidthForms UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHangulCompatibilityJamo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of HangulCompatibilityJamo UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHangulJamo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of HangulJamo UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHangulSyllables' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of HangulSyllables UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHanunoo' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Hanunoo UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHebrew' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Hebrew UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHighPrivateUseSurrogates' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of HighPrivateUseSurrogates UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHighSurrogates' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of HighSurrogates UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsHiragana' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Hiragana UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsIPAExtensions' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of IPAExtensions UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsIdeographicDescriptionCharacters' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of IdeographicDescriptionCharacters UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKanbun' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Kanbun UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKangxiRadicals' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of KangxiRadicals UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKannada' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Kannada UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKatakana' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Katakana UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKatakanaPhoneticExtensions' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of KatakanaPhoneticExtensions UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKhmer' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Khmer UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsKhmerSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of KhmerSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLao' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Lao UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLatin1Supplement' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Latin-1Supplement UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLatinExtendedA' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LatinExtended-A UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLatinExtendedAdditional' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LatinExtendedAdditional UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLatinExtendedB' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LatinExtended-B UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLetterlikeSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LetterlikeSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLimbu' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Limbu UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLinearBIdeograms' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LinearBIdeograms UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLinearBSyllabary' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LinearBSyllabary UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsLowSurrogates' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of LowSurrogates UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMalayalam' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Malayalam UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMathematicalAlphanumericSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MathematicalAlphanumericSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMathematicalOperators' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MathematicalOperators UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMiscellaneousMathematicalSymbolsA' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MiscellaneousMathematicalSymbols-A UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMiscellaneousMathematicalSymbolsB' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MiscellaneousMathematicalSymbols-B UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMiscellaneousSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MiscellaneousSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMiscellaneousSymbolsandArrows' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MiscellaneousSymbolsandArrows UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMiscellaneousTechnical' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MiscellaneousTechnical UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMongolian' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Mongolian UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMusicalSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of MusicalSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsMyanmar' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Myanmar UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsNumberForms' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of NumberForms UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsOgham' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Ogham UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsOldItalic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of OldItalic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsOpticalCharacterRecognition' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of OpticalCharacterRecognition UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsOriya' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Oriya UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsOsmanya' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Osmanya UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsPhoneticExtensions' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of PhoneticExtensions UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsPrivateUse' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of PrivateUse UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsPrivateUseArea' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of PrivateUseArea UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsRunic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Runic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsShavian' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Shavian UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSinhala' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Sinhala UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSmallFormVariants' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SmallFormVariants UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSpacingModifierLetters' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SpacingModifierLetters UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSpecials' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Specials UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSuperscriptsandSubscripts' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SuperscriptsandSubscripts UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSupplementalArrowsA' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SupplementalArrows-A UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSupplementalArrowsB' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SupplementalArrows-B UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSupplementalMathematicalOperators' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SupplementalMathematicalOperators UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSupplementaryPrivateUseAreaA' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SupplementaryPrivateUseArea-A UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSupplementaryPrivateUseAreaB' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of SupplementaryPrivateUseArea-B UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsSyriac' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Syriac UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTagalog' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Tagalog UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTagbanwa' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Tagbanwa UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTags' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Tags UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTaiLe' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of TaiLe UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTaiXuanJingSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of TaiXuanJingSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTamil' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Tamil UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTelugu' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Telugu UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsThaana' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Thaana UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsThai' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Thai UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsTibetan' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Tibetan UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsUgaritic' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of Ugaritic UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsUnifiedCanadianAboriginalSyllabics' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of UnifiedCanadianAboriginalSyllabics UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsVariationSelectors' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of VariationSelectors UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsVariationSelectorsSupplement' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of VariationSelectorsSupplement UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsYiRadicals' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of YiRadicals UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsYiSyllables' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of YiSyllables UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
-    <function name='xmlUCSIsYijingHexagramSymbols' file='xmlunicode' module='xmlunicode'>
-      <cond>defined(LIBXML_UNICODE_ENABLED)</cond>
-      <info>Check whether the character is part of YijingHexagramSymbols UCS Block</info>
-      <return type='int' info='1 if true 0 otherwise'/>
-      <arg name='code' type='int' info='UCS code point'/>
-    </function>
     <function name='xmlURIEscape' file='uri' module='uri'>
       <info>Escaping routine, does not do validity checks ! It will try to escape the chars needing this, but this is heuristic based it&apos;s impossible to be sure.</info>
       <return type='xmlChar *' info='an copy of the string, but escaped  25 May 2001 Uses xmlParseURI and xmlURIEscapeStr to try to escape correctly according to RFC2396. - Carl Douglas'/>
@@ -16976,6 +14918,15 @@
       <arg name='start' type='int' info='relative pos of first char'/>
       <arg name='len' type='int' info='total number to copy'/>
     </function>
+    <function name='xmlUTF8ToIsolat1' file='encoding' module='encoding'>
+      <cond>defined(LIBXML_OUTPUT_ENABLED)</cond>
+      <info>Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1 block of chars out.</info>
+      <return type='int' info='the number of bytes written 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.'/>
+      <arg name='out' type='unsigned char *' info='a pointer to an array of bytes to store the result'/>
+      <arg name='outlen' type='int *' info='the length of @out'/>
+      <arg name='in' type='const unsigned char *' info='a pointer to an array of UTF-8 chars'/>
+      <arg name='inlen' type='int *' info='the length of @in'/>
+    </function>
     <function name='xmlUnlinkNode' file='tree' module='tree'>
       <info>Unlink a node from its tree.  The node is not freed. Unless it is reinserted, it must be managed manually and freed eventually by calling xmlFreeNode.</info>
       <return type='void'/>
@@ -16986,7 +14937,6 @@
       <return type='void'/>
     </function>
     <function name='xmlUnsetNsProp' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Remove an attribute carried by a node.</info>
       <return type='int' info='0 if successful, -1 if not found'/>
       <arg name='node' type='xmlNodePtr' info='the node'/>
@@ -16994,7 +14944,6 @@
       <arg name='name' type='const xmlChar *' info='the attribute name'/>
     </function>
     <function name='xmlUnsetProp' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Remove an attribute carried by a node. This handles only attributes in no namespace.</info>
       <return type='int' info='0 if successful, -1 if not found'/>
       <arg name='node' type='xmlNodePtr' info='the node'/>
@@ -17061,9 +15010,9 @@
     </function>
     <function name='xmlValidateDocument' file='valid' module='valid'>
       <cond>defined(LIBXML_VALID_ENABLED)</cond>
-      <info>Try to validate the document instance  basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</info>
+      <info>DEPRECATED: This function can&apos;t report malloc or other failures. Use xmlCtxtValidateDocument.  Try to validate the document instance  basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.</info>
       <return type='int' info='1 if valid or 0 otherwise'/>
-      <arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
+      <arg name='vctxt' type='xmlValidCtxtPtr' info='the validation context'/>
       <arg name='doc' type='xmlDocPtr' info='a document instance'/>
     </function>
     <function name='xmlValidateDocumentFinal' file='valid' module='valid'>
@@ -17111,14 +15060,12 @@
       <arg name='space' type='int' info='allow spaces in front and end of the string'/>
     </function>
     <function name='xmlValidateNMToken' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Check that a value conforms to the lexical space of NMToken</info>
       <return type='int' info='0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.'/>
       <arg name='value' type='const xmlChar *' info='the value to check'/>
       <arg name='space' type='int' info='allow spaces in front and end of the string'/>
     </function>
     <function name='xmlValidateName' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Check that a value conforms to the lexical space of Name</info>
       <return type='int' info='0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.'/>
       <arg name='value' type='const xmlChar *' info='the value to check'/>
@@ -17157,7 +15104,7 @@
       <arg name='nota' type='xmlNotationPtr' info='a notation definition'/>
     </function>
     <function name='xmlValidateNotationUse' file='valid' module='valid'>
-      <cond>defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_VALID_ENABLED)</cond>
       <info>DEPRECATED: Internal function, don&apos;t use.  Validate that the given name match a notation declaration. - [ VC: Notation Declared ]</info>
       <return type='int' info='1 if valid or 0 otherwise'/>
       <arg name='ctxt' type='xmlValidCtxtPtr' info='the validation context'/>
@@ -17220,7 +15167,6 @@
       <arg name='qname' type='const xmlChar *' info='the qualified name as appearing in the serialization'/>
     </function>
     <function name='xmlValidateQName' file='tree' module='tree'>
-      <cond>defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
       <info>Check that a value conforms to the lexical space of QName</info>
       <return type='int' info='0 if this validates, a positive error code number otherwise and -1 in case of internal or API error.'/>
       <arg name='value' type='const xmlChar *' info='the value to check'/>
@@ -17329,6 +15275,14 @@
       <arg name='ctxt' type='xmlXIncludeCtxtPtr' info='an XInclude processing context'/>
       <arg name='flags' type='int' info='a set of xmlParserOption used for parsing XML includes'/>
     </function>
+    <function name='xmlXIncludeSetResourceLoader' file='xinclude' module='xinclude'>
+      <cond>defined(LIBXML_XINCLUDE_ENABLED)</cond>
+      <info>Register a callback function that will be called to load included documents.  Available since 2.14.0.</info>
+      <return type='void'/>
+      <arg name='ctxt' type='xmlXIncludeCtxtPtr' info='an XInclude processing context'/>
+      <arg name='loader' type='xmlResourceLoader' info='resource loader'/>
+      <arg name='data' type='void *' info='user data which will be passed to the loader'/>
+    </function>
     <function name='xmlXPathAddValues' file='xpathInternals' module='xpath'>
       <cond>defined(LIBXML_XPATH_ENABLED)</cond>
       <info>Implement the add operation on XPath objects: The numeric operators convert their operands to numbers as if by calling the number function.</info>
@@ -17600,7 +15554,7 @@
     </function>
     <function name='xmlXPathEvalExpr' file='xpathInternals' module='xpath'>
       <cond>defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Parse and evaluate an XPath expression in the given context, then push the result on the context stack</info>
+      <info>DEPRECATED: Internal function, don&apos;t use.  Parse and evaluate an XPath expression in the given context, then push the result on the context stack</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlXPathParserContextPtr' info='the XPath Parser context'/>
     </function>
@@ -17727,7 +15681,7 @@
       <arg name='nargs' type='int' info='the number of arguments'/>
     </function>
     <function name='xmlXPathInit' file='xpath' module='xpath'>
-      <cond>defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_XPATH_ENABLED)</cond>
       <info>DEPRECATED: Alias for xmlInitParser.</info>
       <return type='void'/>
     </function>
@@ -17739,13 +15693,13 @@
       <arg name='nodes2' type='xmlNodeSetPtr' info='a node-set'/>
     </function>
     <function name='xmlXPathIsInf' file='xpath' module='xpath'>
-      <cond>defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_XPATH_ENABLED)</cond>
       <info>Checks whether a double is an infinity.</info>
       <return type='int' info='1 if the value is +Infinite, -1 if -Infinite, 0 otherwise'/>
       <arg name='val' type='double' info='a double value'/>
     </function>
     <function name='xmlXPathIsNaN' file='xpath' module='xpath'>
-      <cond>defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)</cond>
+      <cond>defined(LIBXML_XPATH_ENABLED)</cond>
       <info>Checks whether a double is a NaN.</info>
       <return type='int' info='1 if the value is a NaN, 0 otherwise'/>
       <arg name='val' type='double' info='a double value'/>
@@ -18157,7 +16111,7 @@
     </function>
     <function name='xmlXPathRegisterAllFunctions' file='xpathInternals' module='xpath'>
       <cond>defined(LIBXML_XPATH_ENABLED)</cond>
-      <info>Registers all default XPath functions in this context</info>
+      <info>DEPRECATED: No-op since 2.14.0.  Registers all default XPath functions in this context</info>
       <return type='void'/>
       <arg name='ctxt' type='xmlXPathContextPtr' info='the XPath context'/>
     </function>
@@ -18360,6 +16314,19 @@
       <return type='void'/>
       <arg name='ctxt' type='xmlXPathParserContextPtr' info='the XPath Parser context'/>
     </function>
+    <function name='xmlXPathValuePop' file='xpathInternals' module='xpath'>
+      <cond>defined(LIBXML_XPATH_ENABLED)</cond>
+      <info>Pops the top XPath object from the value stack</info>
+      <return type='xmlXPathObjectPtr' info='the XPath object just removed'/>
+      <arg name='ctxt' type='xmlXPathParserContextPtr' info='an XPath evaluation context'/>
+    </function>
+    <function name='xmlXPathValuePush' 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.  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>
     <function name='xmlXPathVariableLookup' file='xpathInternals' module='xpath'>
       <cond>defined(LIBXML_XPATH_ENABLED)</cond>
       <info>Search in the Variable array of the context for the given variable value.</info>
@@ -18416,12 +16383,6 @@
       <arg name='line' type='int' info='the line number'/>
       <arg name='no' type='int' info='the error number'/>
     </function>
-    <function name='xmlXPtrBuildNodeList' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Build a node list tree copy of the XPointer result. This will drop Attributes and Namespace declarations.</info>
-      <return type='xmlNodePtr' info='an xmlNodePtr list or NULL. the caller has to free the node tree.'/>
-      <arg name='obj' type='xmlXPathObjectPtr' info='the XPointer result from the evaluation.'/>
-    </function>
     <function name='xmlXPtrEval' file='xpointer' module='xpointer'>
       <cond>defined(LIBXML_XPTR_ENABLED)</cond>
       <info>Evaluate the XPath Location Path in the given context.</info>
@@ -18429,58 +16390,6 @@
       <arg name='str' type='const xmlChar *' info='the XPointer expression'/>
       <arg name='ctx' type='xmlXPathContextPtr' info='the XPointer context'/>
     </function>
-    <function name='xmlXPtrEvalRangePredicate' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>[8]   Predicate ::=   &apos;[&apos; PredicateExpr &apos;]&apos; [9]   PredicateExpr ::=   Expr  Evaluate a predicate as in xmlXPathEvalPredicate() but for a Location Set instead of a node set</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlXPathParserContextPtr' info='the XPointer Parser context'/>
-    </function>
-    <function name='xmlXPtrFreeLocationSet' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Free the LocationSet compound (not the actual ranges !).</info>
-      <return type='void'/>
-      <arg name='obj' type='xmlLocationSetPtr' info='the xmlLocationSetPtr to free'/>
-    </function>
-    <function name='xmlXPtrLocationSetAdd' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>add a new xmlXPathObjectPtr to an existing LocationSet If the location already exist in the set @val is freed.</info>
-      <return type='void'/>
-      <arg name='cur' type='xmlLocationSetPtr' info='the initial range set'/>
-      <arg name='val' type='xmlXPathObjectPtr' info='a new xmlXPathObjectPtr'/>
-    </function>
-    <function name='xmlXPtrLocationSetCreate' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlLocationSetPtr of type double and of value @val</info>
-      <return type='xmlLocationSetPtr' info='the newly created object.'/>
-      <arg name='val' type='xmlXPathObjectPtr' info='an initial xmlXPathObjectPtr, or NULL'/>
-    </function>
-    <function name='xmlXPtrLocationSetDel' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Removes an xmlXPathObjectPtr from an existing LocationSet</info>
-      <return type='void'/>
-      <arg name='cur' type='xmlLocationSetPtr' info='the initial range set'/>
-      <arg name='val' type='xmlXPathObjectPtr' info='an xmlXPathObjectPtr'/>
-    </function>
-    <function name='xmlXPtrLocationSetMerge' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Merges two rangesets, all ranges from @val2 are added to @val1</info>
-      <return type='xmlLocationSetPtr' info='val1 once extended or NULL in case of error.'/>
-      <arg name='val1' type='xmlLocationSetPtr' info='the first LocationSet'/>
-      <arg name='val2' type='xmlLocationSetPtr' info='the second LocationSet'/>
-    </function>
-    <function name='xmlXPtrLocationSetRemove' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Removes an entry from an existing LocationSet list.</info>
-      <return type='void'/>
-      <arg name='cur' type='xmlLocationSetPtr' info='the initial range set'/>
-      <arg name='val' type='int' info='the index to remove'/>
-    </function>
-    <function name='xmlXPtrNewCollapsedRange' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range using a single nodes</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlNodePtr' info='the starting and ending node'/>
-    </function>
     <function name='xmlXPtrNewContext' file='xpointer' module='xpointer'>
       <cond>defined(LIBXML_XPTR_ENABLED)</cond>
       <info>Create a new XPointer context</info>
@@ -18489,75 +16398,5 @@
       <arg name='here' type='xmlNodePtr' info='the node that directly contains the XPointer being evaluated or NULL'/>
       <arg name='origin' type='xmlNodePtr' info='the element from which a user or program initiated traversal of the link, or NULL.'/>
     </function>
-    <function name='xmlXPtrNewLocationSetNodeSet' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type LocationSet and initialize it with all the nodes from @set</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='set' type='xmlNodeSetPtr' info='a node set'/>
-    </function>
-    <function name='xmlXPtrNewLocationSetNodes' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type LocationSet and initialize it with the single range made of the two nodes @start and @end</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlNodePtr' info='the start NodePtr value'/>
-      <arg name='end' type='xmlNodePtr' info='the end NodePtr value or NULL'/>
-    </function>
-    <function name='xmlXPtrNewRange' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlNodePtr' info='the starting node'/>
-      <arg name='startindex' type='int' info='the start index'/>
-      <arg name='end' type='xmlNodePtr' info='the ending point'/>
-      <arg name='endindex' type='int' info='the ending index'/>
-    </function>
-    <function name='xmlXPtrNewRangeNodeObject' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range from a not to an object</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlNodePtr' info='the starting node'/>
-      <arg name='end' type='xmlXPathObjectPtr' info='the ending object'/>
-    </function>
-    <function name='xmlXPtrNewRangeNodePoint' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range from a node to a point</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlNodePtr' info='the starting node'/>
-      <arg name='end' type='xmlXPathObjectPtr' info='the ending point'/>
-    </function>
-    <function name='xmlXPtrNewRangeNodes' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range using 2 nodes</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlNodePtr' info='the starting node'/>
-      <arg name='end' type='xmlNodePtr' info='the ending node'/>
-    </function>
-    <function name='xmlXPtrNewRangePointNode' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range from a point to a node</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlXPathObjectPtr' info='the starting point'/>
-      <arg name='end' type='xmlNodePtr' info='the ending node'/>
-    </function>
-    <function name='xmlXPtrNewRangePoints' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Create a new xmlXPathObjectPtr of type range using 2 Points</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='start' type='xmlXPathObjectPtr' info='the starting point'/>
-      <arg name='end' type='xmlXPathObjectPtr' info='the ending point'/>
-    </function>
-    <function name='xmlXPtrRangeToFunction' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Implement the range-to() XPointer function  Obsolete. range-to is not a real function but a special type of location step which is handled in xpath.c.</info>
-      <return type='void'/>
-      <arg name='ctxt' type='xmlXPathParserContextPtr' info='the XPointer Parser context'/>
-      <arg name='nargs' type='int' info='the number of args'/>
-    </function>
-    <function name='xmlXPtrWrapLocationSet' file='xpointer' module='xpointer'>
-      <cond>defined(LIBXML_XPTR_ENABLED) &amp;&amp; defined(LIBXML_XPTR_LOCS_ENABLED)</cond>
-      <info>Wrap the LocationSet @val in a new xmlXPathObjectPtr</info>
-      <return type='xmlXPathObjectPtr' info='the newly created object.'/>
-      <arg name='val' type='xmlLocationSetPtr' info='the LocationSet value'/>
-    </function>
   </symbols>
 </api>
diff --git a/doc/xmllint.1 b/doc/xmllint.1
index 855fef3..267ff15 100644
--- a/doc/xmllint.1
+++ b/doc/xmllint.1
@@ -2,12 +2,12 @@
 .\"     Title: xmllint
 .\"    Author: John Fleck <jfleck@inkstain.net>
 .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
-.\"      Date: 06/12/2024
+.\"      Date: 03/27/2025
 .\"    Manual: xmllint Manual
 .\"    Source: libxml2
 .\"  Language: English
 .\"
-.TH "XMLLINT" "1" "06/12/2024" "libxml2" "xmllint Manual"
+.TH "XMLLINT" "1" "03/27/2025" "libxml2" "xmllint Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -31,9 +31,7 @@
 xmllint \- command line XML tool
 .SH "SYNOPSIS"
 .HP \w'\fBxmllint\fR\ 'u
-\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\-\-max\-ampl\ \fR\fB\fIINTEGER\fR\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\-\-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
+\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\-\-huge\fR | \fB\-\-nocompact\fR | \fB\-\-nodefdtd\fR | \fB\-\-nodict\fR | \fB\-\-noenc\fR | \fB\-\-noent\fR | \fB\-\-nofixup\-base\-uris\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\-\-max\-ampl\ \fR\fB\fIINTEGER\fR\fR | \fB\-\-maxmem\ \fR\fB\fINBBYTES\fR\fR | \fB\-\-nowarning\fR | \fB\-\-noblanks\fR | \fB\-\-nocdata\fR | \fB\-\-format\fR | \fB\-\-pretty\ \fR\fB\fIINTEGER\fR\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\-\-relaxng\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schema\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-schematron\ \fR\fB\fISCHEMA\fR\fR | \fB\-\-c14n\fR | \fB\-\-c14n11\fR | \fB\-\-exc\-c14n\fR | \fB\-\-pedantic\fR | \fB\-\-sax\fR | \fB\-\-sax1\fR | \fB\-\-oldxml10\fR] {\fIXML\-FILE(S)\fR... | \-}
 .SH "DESCRIPTION"
 .PP
 The
@@ -89,7 +87,7 @@
 Test the internal copy implementation\&.
 .RE
 .PP
-\fB\-\-c14n\fR
+\fB\-\-c14n\fR, \fB\-\-c14n11\fR, \fB\-\-exc\-c14n\fR
 .RS 4
 Use the W3C
 XML
@@ -149,12 +147,8 @@
 Reformat and reindent the output\&. The
 \fBXMLLINT_INDENT\fR
 environment variable controls the indentation\&. The default value is two spaces " ")\&.
-.RE
-.PP
-\fB\-\-help\fR
-.RS 4
-Print out a short usage summary for
-\fBxmllint\fR\&.
+.sp
+Especially in the absence of a DTD, this feature has never worked reliably and is fundamentally broken\&.
 .RE
 .PP
 \fB\-\-html\fR
@@ -175,6 +169,11 @@
 tags surrounding the result tree output so the results can be displayed/viewed in a browser\&.
 .RE
 .PP
+\fB\-\-huge\fR
+.RS 4
+Ignore some hardcoded parser limits\&.
+.RE
+.PP
 \fB\-\-insert\fR
 .RS 4
 Test for valid insertions\&.
@@ -226,11 +225,26 @@
 Substitute CDATA section by equivalent text nodes\&.
 .RE
 .PP
+\fB\-\-nocompact\fR
+.RS 4
+Do not generate compact text nodes (parser option XML_PARSE_COMPACT)\&. Only for debugging\&.
+.RE
+.PP
+\fB\-\-nodefdtd\fR
+.RS 4
+Do not set default HTML doctype (parser option HTML_PARSE_NODEFDTD)\&.
+.RE
+.PP
 \fB\-\-nodict\fR
 .RS 4
 Don\*(Aqt use dictionaries (parser option XML_PARSE_NODICT)\&. Only for debugging\&.
 .RE
 .PP
+\fB\-\-noenc\fR
+.RS 4
+Ignore encoding declaration (parser option XML_PARSE_IGNORE_ENC)\&.
+.RE
+.PP
 \fB\-\-noent\fR
 .RS 4
 Substitute entity values for entity references\&. By default,
@@ -238,6 +252,11 @@
 leaves entity references in place\&.
 .RE
 .PP
+\fB\-\-nofixup\-base\-uris\fR
+.RS 4
+Don\*(Aqt fix xml:base URIs when processing XIncludes (parser option XML_PARSE_NOBASEFIX)\&.
+.RE
+.PP
 \fB\-\-nonet\fR
 .RS 4
 Do not use the Internet to fetch
@@ -273,6 +292,11 @@
 Remove redundant namespace declarations\&.
 .RE
 .PP
+\fB\-\-oldxml10\fR
+.RS 4
+Use deprecated parsing rules before XML 1\&.0, 5th edition\&.
+.RE
+.PP
 \fB\-\-output \fR\fB\fIFILE\fR\fR
 .RS 4
 Define a file path where
@@ -306,6 +330,11 @@
 Validate after parsing has completed\&.
 .RE
 .PP
+\fB\-\-pretty \fR\fB\fIINTEGER\fR\fR
+.RS 4
+Value 0 means no formatting, 1 means XML_SAVE_FORMAT (same as \-\-format), 2 means XML_SAVE_WSNONSIG\&.
+.RE
+.PP
 \fB\-\-push\fR
 .RS 4
 Use the push mode of the parser\&.
@@ -333,6 +362,16 @@
 Repeat 100 times, for timing or profiling\&.
 .RE
 .PP
+\fB\-\-sax\fR
+.RS 4
+Print SAX callbacks (only for debugging)\&.
+.RE
+.PP
+\fB\-\-sax1\fR
+.RS 4
+Use deprecated SAX1 interface (only for debugging)\&.
+.RE
+.PP
 \fB\-\-schema \fR\fB\fISCHEMA\fR\fR
 .RS 4
 Use a W3C
@@ -342,6 +381,13 @@
 for validation\&.
 .RE
 .PP
+\fB\-\-schematron \fR\fB\fISCHEMA\fR\fR
+.RS 4
+Use a Schematron file named
+\fISCHEMA\fR
+for validation\&.
+.RE
+.PP
 \fB\-\-shell\fR
 .RS 4
 Run a navigating shell\&. Details on available commands in shell mode are below (see
diff --git a/doc/xmllint.html b/doc/xmllint.html
index dddbb82..d15528a 100644
--- a/doc/xmllint.html
+++ b/doc/xmllint.html
@@ -1,4 +1,4 @@
-<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">--max-ampl <em class="replaceable"><code>INTEGER</code></em></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">--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>
+<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="id1337"></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">--huge</code>  |   <code class="option">--nocompact</code>  |   <code class="option">--nodefdtd</code>  |   <code class="option">--nodict</code>  |   <code class="option">--noenc</code>  |   <code class="option">--noent</code>  |   <code class="option">--nofixup-base-uris</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">--max-ampl <em class="replaceable"><code>INTEGER</code></em></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">--pretty <em class="replaceable"><code>INTEGER</code></em></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">--relaxng <em class="replaceable"><code>SCHEMA</code></em></code>  |   <code class="option">--schema <em class="replaceable"><code>SCHEMA</code></em></code>  |   <code class="option">--schematron <em class="replaceable"><code>SCHEMA</code></em></code>  |   <code class="option">--c14n</code>  |   <code class="option">--c14n11</code>  |   <code class="option">--exc-c14n</code>  |   <code class="option">--pedantic</code>  |   <code class="option">--sax</code>  |   <code class="option">--sax1</code>  |   <code class="option">--oldxml10</code> ] { <em class="replaceable"><code>XML-FILE(S)</code></em>...  |   - }</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
@@ -15,7 +15,7 @@
                     <code class="filename">${sysconfdir}/xml/catalog</code> are used by default.
                 </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>
+                </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><span class="term"><code class="option">--c14n11</code>, </span><span class="term"><code class="option">--exc-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.
@@ -36,12 +36,15 @@
                     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>
+                </p><p>
+                    Especially in the absence of a DTD, this feature has never worked reliably
+                    and is fundamentally broken.
+                </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>
+                </p></dd><dt><span class="term"><code class="option">--huge</code></span></dt><dd><p>Ignore some hardcoded parser limits.</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">--max-ampl <em class="replaceable"><code>INTEGER</code></em></code></span></dt><dd><p>
@@ -55,19 +58,34 @@
                     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>
+                </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">--nocompact</code></span></dt><dd><p>
+                    Do not generate compact text nodes (parser option
+                    XML_PARSE_COMPACT). Only for debugging.
+                </p></dd><dt><span class="term"><code class="option">--nodefdtd</code></span></dt><dd><p>
+                    Do not set default HTML doctype (parser option
+                    HTML_PARSE_NODEFDTD).
+                </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">--noenc</code></span></dt><dd><p>
+                    Ignore encoding declaration (parser option
+                    XML_PARSE_IGNORE_ENC).
                 </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">--nofixup-base-uris</code></span></dt><dd><p>
+                    Don't fix xml:base URIs when processing XIncludes
+                    (parser option XML_PARSE_NOBASEFIX).
                 </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>
+                </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">--oldxml10</code></span></dt><dd><p>
+                    Use deprecated parsing rules before XML 1.0,
+                    5th edition.
+                </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
@@ -81,12 +99,18 @@
                     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>
+                </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">--pretty <em class="replaceable"><code>INTEGER</code></em></code></span></dt><dd><p>
+                    Value 0 means no formatting, 1 means XML_SAVE_FORMAT
+                    (same as --format), 2 means XML_SAVE_WSNONSIG.
+                </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>
+                </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">--sax</code></span></dt><dd><p>Print SAX callbacks (only for debugging).</p></dd><dt><span class="term"><code class="option">--sax1</code></span></dt><dd><p>Use deprecated SAX1 interface (only for debugging).</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">--schematron <em class="replaceable"><code>SCHEMA</code></em></code></span></dt><dd><p>
+                    Use a Schematron 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>).
diff --git a/doc/xmllint.xml b/doc/xmllint.xml
index 97c8820..3de2b87 100644
--- a/doc/xmllint.xml
+++ b/doc/xmllint.xml
@@ -72,8 +72,13 @@
             <arg choice="plain"><option>--debugent</option></arg>
             <arg choice="plain"><option>--copy</option></arg>
             <arg choice="plain"><option>--recover</option></arg>
+            <arg choice="plain"><option>--huge</option></arg>
+            <arg choice="plain"><option>--nocompact</option></arg>
+            <arg choice="plain"><option>--nodefdtd</option></arg>
             <arg choice="plain"><option>--nodict</option></arg>
+            <arg choice="plain"><option>--noenc</option></arg>
             <arg choice="plain"><option>--noent</option></arg>
+            <arg choice="plain"><option>--nofixup-base-uris</option></arg>
             <arg choice="plain"><option>--noout</option></arg>
             <arg choice="plain"><option>--nonet</option></arg>
             <arg choice="plain"><option>--path "<replaceable class="option">PATH(S)</replaceable>"</option></arg>
@@ -99,6 +104,7 @@
             <arg choice="plain"><option>--noblanks</option></arg>
             <arg choice="plain"><option>--nocdata</option></arg>
             <arg choice="plain"><option>--format</option></arg>
+            <arg choice="plain"><option>--pretty <replaceable class="option">INTEGER</replaceable></option></arg>
             <arg choice="plain"><option>--encode <replaceable class="option">ENCODING</replaceable></option></arg>
             <arg choice="plain"><option>--dropdtd</option></arg>
             <arg choice="plain"><option>--nsclean</option></arg>
@@ -115,18 +121,20 @@
             <arg choice="plain"><option>--pattern <replaceable class="option">PATTERNVALUE</replaceable></option></arg>
             <arg choice="plain"><option>--relaxng <replaceable class="option">SCHEMA</replaceable></option></arg>
             <arg choice="plain"><option>--schema <replaceable class="option">SCHEMA</replaceable></option></arg>
+            <arg choice="plain"><option>--schematron <replaceable class="option">SCHEMA</replaceable></option></arg>
             <arg choice="plain"><option>--c14n</option></arg>
+            <arg choice="plain"><option>--c14n11</option></arg>
+            <arg choice="plain"><option>--exc-c14n</option></arg>
             <arg choice="plain"><option>--pedantic</option></arg>
+            <arg choice="plain"><option>--sax</option></arg>
+            <arg choice="plain"><option>--sax1</option></arg>
+            <arg choice="plain"><option>--oldxml10</option></arg>
         </group>
         <group choice="req">
             <arg choice="plain" rep="repeat"><replaceable>XML-FILE(S)</replaceable></arg>
             <arg choice="plain" rep="norepeat">-</arg>
         </group>
     </cmdsynopsis>
-    <cmdsynopsis>
-        <command>xmllint</command>
-        <arg choice="plain"><option>--help</option></arg>
-    </cmdsynopsis>
 </refsynopsisdiv>
 
 <refsect1 id="description">
@@ -194,6 +202,8 @@
 
         <varlistentry>
             <term><option>--c14n</option></term>
+            <term><option>--c14n11</option></term>
+            <term><option>--exc-c14n</option></term>
             <listitem>
                 <para>
                     Use the W3C <acronym>XML</acronym> Canonicalisation (<acronym>C14N</acronym>) to
@@ -273,13 +283,10 @@
                     environment variable controls the indentation. The default value is two
                     spaces &quot;  &quot;).
                 </para>
-            </listitem>
-        </varlistentry>
-
-        <varlistentry>
-            <term><option>--help</option></term>
-            <listitem>
-                <para>Print out a short usage summary for &xmllint;.</para>
+                <para>
+                    Especially in the absence of a DTD, this feature has never worked reliably
+                    and is fundamentally broken.
+                </para>
             </listitem>
         </varlistentry>
 
@@ -303,6 +310,13 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--huge</option></term>
+            <listitem>
+                <para>Ignore some hardcoded parser limits.</para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--insert</option></term>
             <listitem>
                 <para>Test for valid insertions.</para>
@@ -380,6 +394,26 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--nocompact</option></term>
+            <listitem>
+                <para>
+                    Do not generate compact text nodes (parser option
+                    XML_PARSE_COMPACT). Only for debugging.
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
+            <term><option>--nodefdtd</option></term>
+            <listitem>
+                <para>
+                    Do not set default HTML doctype (parser option
+                    HTML_PARSE_NODEFDTD).
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--nodict</option></term>
             <listitem>
                 <para>
@@ -390,6 +424,16 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--noenc</option></term>
+            <listitem>
+                <para>
+                    Ignore encoding declaration (parser option
+                    XML_PARSE_IGNORE_ENC).
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--noent</option></term>
             <listitem>
                 <para>
@@ -400,6 +444,16 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--nofixup-base-uris</option></term>
+            <listitem>
+                <para>
+                    Don't fix xml:base URIs when processing XIncludes
+                    (parser option XML_PARSE_NOBASEFIX).
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--nonet</option></term>
             <listitem>
                 <para>
@@ -448,6 +502,16 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--oldxml10</option></term>
+            <listitem>
+                <para>
+                    Use deprecated parsing rules before XML 1.0,
+                    5th edition.
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--output <replaceable class="option">FILE</replaceable></option></term>
             <listitem>
                 <para>
@@ -497,6 +561,16 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--pretty <replaceable class="option">INTEGER</replaceable></option></term>
+            <listitem>
+                <para>
+                    Value 0 means no formatting, 1 means XML_SAVE_FORMAT
+                    (same as --format), 2 means XML_SAVE_WSNONSIG.
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--push</option></term>
             <listitem>
                 <para>Use the push mode of the parser.</para>
@@ -535,6 +609,20 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--sax</option></term>
+            <listitem>
+                <para>Print SAX callbacks (only for debugging).</para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
+            <term><option>--sax1</option></term>
+            <listitem>
+                <para>Use deprecated SAX1 interface (only for debugging).</para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--schema <replaceable>SCHEMA</replaceable></option></term>
             <listitem>
                 <para>
@@ -545,6 +633,16 @@
         </varlistentry>
 
         <varlistentry>
+            <term><option>--schematron <replaceable>SCHEMA</replaceable></option></term>
+            <listitem>
+                <para>
+                    Use a Schematron file
+                    named <replaceable>SCHEMA</replaceable> for validation.
+                </para>
+            </listitem>
+        </varlistentry>
+
+        <varlistentry>
             <term><option>--shell</option></term>
             <listitem>
                 <para>
diff --git a/encoding.c b/encoding.c
index 0ce8d47..a90694f 100644
--- a/encoding.c
+++ b/encoding.c
@@ -29,6 +29,7 @@
 #include <stdlib.h>
 
 #ifdef LIBXML_ICONV_ENABLED
+#include <iconv.h>
 #include <errno.h>
 #endif
 
@@ -42,22 +43,17 @@
 
 #include "private/buf.h"
 #include "private/enc.h"
+#include "private/entities.h"
 #include "private/error.h"
+#include "private/memory.h"
 
 #ifdef LIBXML_ICU_ENABLED
 #include <unicode/ucnv.h>
-/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */
-#define ICU_PIVOT_BUF_SIZE 1024
-typedef struct _uconv_t uconv_t;
-struct _uconv_t {
-  UConverter *uconv; /* for conversion between an encoding and UTF-16 */
-  UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
-  UChar      pivot_buf[ICU_PIVOT_BUF_SIZE];
-  UChar      *pivot_source;
-  UChar      *pivot_target;
-};
 #endif
 
+#define XML_HANDLER_STATIC (1 << 0)
+#define XML_HANDLER_LEGACY (1 << 1)
+
 typedef struct _xmlCharEncodingAlias xmlCharEncodingAlias;
 typedef xmlCharEncodingAlias *xmlCharEncodingAliasPtr;
 struct _xmlCharEncodingAlias {
@@ -71,778 +67,187 @@
 
 static int xmlLittleEndian = 1;
 
-/************************************************************************
- *									*
- *		Conversions To/From UTF8 encoding			*
- *									*
- ************************************************************************/
+typedef struct {
+    const char *name;
+    xmlCharEncoding enc;
+} xmlEncTableEntry;
 
-/**
- * asciiToUTF8:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of ASCII chars
- * @inlen:  the length of @in
- *
- * Take a block of ASCII chars in and try to convert it to an UTF-8
- * block of chars out.
- *
- * 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.
- */
-static int
-asciiToUTF8(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen) {
-    unsigned char* outstart = out;
-    const unsigned char* base = in;
-    const unsigned char* processed = in;
-    unsigned char* outend = out + *outlen;
-    const unsigned char* inend;
-    unsigned int c;
+static const xmlEncTableEntry xmlEncTable[] = {
+    { "ASCII", XML_CHAR_ENCODING_ASCII },
+    { "EUC-JP", XML_CHAR_ENCODING_EUC_JP },
+    { "HTML", XML_CHAR_ENCODING_HTML },
+    { "ISO LATIN 1", XML_CHAR_ENCODING_8859_1 },
+    { "ISO LATIN 2", XML_CHAR_ENCODING_8859_2 },
+    { "ISO-10646-UCS-2", XML_CHAR_ENCODING_UCS2 },
+    { "ISO-10646-UCS-4", XML_CHAR_ENCODING_UCS4LE },
+    { "ISO-2022-JP", XML_CHAR_ENCODING_2022_JP },
+    { "ISO-8859-1", XML_CHAR_ENCODING_8859_1 },
+    { "ISO-8859-10", XML_CHAR_ENCODING_8859_10 },
+    { "ISO-8859-11", XML_CHAR_ENCODING_8859_11 },
+    { "ISO-8859-13", XML_CHAR_ENCODING_8859_13 },
+    { "ISO-8859-14", XML_CHAR_ENCODING_8859_14 },
+    { "ISO-8859-15", XML_CHAR_ENCODING_8859_15 },
+    { "ISO-8859-16", XML_CHAR_ENCODING_8859_16 },
+    { "ISO-8859-2", XML_CHAR_ENCODING_8859_2 },
+    { "ISO-8859-3", XML_CHAR_ENCODING_8859_3 },
+    { "ISO-8859-4", XML_CHAR_ENCODING_8859_4 },
+    { "ISO-8859-5", XML_CHAR_ENCODING_8859_5 },
+    { "ISO-8859-6", XML_CHAR_ENCODING_8859_6 },
+    { "ISO-8859-7", XML_CHAR_ENCODING_8859_7 },
+    { "ISO-8859-8", XML_CHAR_ENCODING_8859_8 },
+    { "ISO-8859-9", XML_CHAR_ENCODING_8859_9 },
+    { "ISO-LATIN-1", XML_CHAR_ENCODING_8859_1 },
+    { "ISO-LATIN-2", XML_CHAR_ENCODING_8859_2 },
+    { "SHIFT_JIS", XML_CHAR_ENCODING_SHIFT_JIS },
+    { "UCS-2", XML_CHAR_ENCODING_UCS2 },
+    { "UCS-4", XML_CHAR_ENCODING_UCS4LE },
+    { "UCS2", XML_CHAR_ENCODING_UCS2 },
+    { "UCS4", XML_CHAR_ENCODING_UCS4LE },
+    { "US-ASCII", XML_CHAR_ENCODING_ASCII },
+    { "UTF-16", XML_CHAR_ENCODING_UTF16 },
+    { "UTF-16BE", XML_CHAR_ENCODING_UTF16BE },
+    { "UTF-16LE", XML_CHAR_ENCODING_UTF16LE },
+    { "UTF-8", XML_CHAR_ENCODING_UTF8 },
+    { "UTF16", XML_CHAR_ENCODING_UTF16 },
+    { "UTF8", XML_CHAR_ENCODING_UTF8 }
+};
 
-    inend = in + (*inlen);
-    while ((in < inend) && (out - outstart + 5 < *outlen)) {
-	c= *in++;
-
-        if (out >= outend)
-	    break;
-        if (c < 0x80) {
-	    *out++ = c;
-	} else {
-	    *outlen = out - outstart;
-	    *inlen = processed - base;
-	    return(XML_ENC_ERR_INPUT);
-	}
-
-	processed = (const unsigned char*) in;
-    }
-    *outlen = out - outstart;
-    *inlen = processed - base;
-    return(*outlen);
-}
+static xmlCharEncError
+asciiToAscii(void *vctxt, unsigned char* out, int *outlen,
+             const unsigned char* in, int *inlen, int flush);
+static xmlCharEncError
+UTF8ToUTF8(void *vctxt, unsigned char* out, int *outlen,
+           const unsigned char* inb, int *inlenb, int flush);
+static xmlCharEncError
+latin1ToUTF8(void *vctxt, unsigned char* out, int *outlen,
+             const unsigned char* in, int *inlen, int flush);
+static xmlCharEncError
+UTF16LEToUTF8(void *vctxt, unsigned char* out, int *outlen,
+              const unsigned char* inb, int *inlenb, int flush);
+static xmlCharEncError
+UTF16BEToUTF8(void *vctxt, unsigned char* out, int *outlen,
+              const unsigned char* inb, int *inlenb, int flush);
 
 #ifdef LIBXML_OUTPUT_ENABLED
-/**
- * UTF8Toascii:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of UTF-8 chars
- * @inlen:  the length of @in
- *
- * Take a block of UTF-8 chars in and try to convert it to an ASCII
- * block of chars out.
- *
- * 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.
- */
-static int
-UTF8Toascii(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen) {
-    const unsigned char* processed = in;
-    const unsigned char* outend;
-    const unsigned char* outstart = out;
-    const unsigned char* instart = in;
-    const unsigned char* inend;
-    unsigned int c, d;
-    int trailing;
 
-    if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
-        return(XML_ENC_ERR_INTERNAL);
-    if (in == NULL) {
-        /*
-	 * initialization nothing to do
-	 */
-	*outlen = 0;
-	*inlen = 0;
-	return(0);
-    }
-    inend = in + (*inlen);
-    outend = out + (*outlen);
-    while (in < inend) {
-	d = *in++;
-	if      (d < 0x80)  { c= d; trailing= 0; }
-	else if (d < 0xC0) {
-	    /* trailing byte in leading position */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    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; }
-	else {
-	    /* no chance for this in Ascii */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    return(XML_ENC_ERR_INPUT);
-	}
+static xmlCharEncError
+UTF8ToLatin1(void *vctxt, unsigned char* outb, int *outlen,
+             const unsigned char* in, int *inlen, int flush);
+static xmlCharEncError
+UTF8ToUTF16(void *vctxt, unsigned char* outb, int *outlen,
+            const unsigned char* in, int *inlen, int flush);
+static xmlCharEncError
+UTF8ToUTF16LE(void *vctxt, unsigned char* outb, int *outlen,
+              const unsigned char* in, int *inlen, int flush);
+static xmlCharEncError
+UTF8ToUTF16BE(void *vctxt, unsigned char* outb, int *outlen,
+              const unsigned char* in, int *inlen, int flush);
 
-	if (inend - in < trailing) {
-	    break;
-	}
+#else /* LIBXML_OUTPUT_ENABLED */
 
-	for ( ; trailing; trailing--) {
-	    if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
-		break;
-	    c <<= 6;
-	    c |= d & 0x3F;
-	}
+#define UTF8ToLatin1 NULL
+#define UTF8ToUTF16 NULL
+#define UTF8ToUTF16LE NULL
+#define UTF8ToUTF16BE NULL
 
-	/* assertion: c is a single UTF-4 value */
-	if (c < 0x80) {
-	    if (out >= outend)
-		break;
-	    *out++ = c;
-	} else {
-	    /* no chance for this in Ascii */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    return(XML_ENC_ERR_INPUT);
-	}
-	processed = in;
-    }
-    *outlen = out - outstart;
-    *inlen = processed - instart;
-    return(*outlen);
-}
 #endif /* LIBXML_OUTPUT_ENABLED */
 
-/**
- * isolat1ToUTF8:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of ISO Latin 1 chars
- * @inlen:  the length of @in
+#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTML_ENABLED)
+static xmlCharEncError
+UTF8ToHtmlWrapper(void *vctxt, unsigned char *out, int *outlen,
+                  const unsigned char *in, int *inlen, int flush);
+#else
+#define UTF8ToHtmlWrapper NULL
+#endif
+
+#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) && \
+    defined(LIBXML_ISO8859X_ENABLED)
+
+#include "iso8859x.inc"
+
+static xmlCharEncError
+ISO8859xToUTF8(void *vctxt, unsigned char* out, int *outlen,
+               const unsigned char* in, int *inlen, int flush);
+static xmlCharEncError
+UTF8ToISO8859x(void *vctxt, unsigned char *out, int *outlen,
+               const unsigned char *in, int *inlen, int flush);
+
+#define MAKE_ISO_HANDLER(name, n) \
+    { (char *) name, { ISO8859xToUTF8 }, { UTF8ToISO8859x }, \
+      (void *) xmlunicodetable_ISO8859_##n, \
+      (void *) xmltranscodetable_ISO8859_##n, \
+      NULL, XML_HANDLER_STATIC }
+
+#else /* LIBXML_ISO8859X_ENABLED */
+
+#define MAKE_ISO_HANDLER(name, n) \
+    { (char *) name, { NULL }, { NULL }, NULL, NULL, NULL, \
+      XML_HANDLER_STATIC }
+
+#endif /* LIBXML_ISO8859X_ENABLED */
+
+#define MAKE_HANDLER(name, in, out) \
+    { (char *) name, { in }, { out }, NULL, NULL, NULL, XML_HANDLER_STATIC }
+
+/*
+ * The layout must match enum xmlCharEncoding.
  *
- * 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 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.
+ * Names should match the IANA registry if possible:
+ * https://www.iana.org/assignments/character-sets/character-sets.xhtml
  */
-int
-isolat1ToUTF8(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen) {
-    unsigned char* outstart = out;
-    const unsigned char* base = in;
-    unsigned char* outend;
-    const unsigned char* inend;
-    const unsigned char* instop;
+static const xmlCharEncodingHandler defaultHandlers[31] = {
+    MAKE_HANDLER(NULL, NULL, NULL), /* NONE */
+    MAKE_HANDLER("UTF-8", UTF8ToUTF8, UTF8ToUTF8),
+    MAKE_HANDLER("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE),
+    MAKE_HANDLER("UTF-16BE", UTF16BEToUTF8, UTF8ToUTF16BE),
+    MAKE_HANDLER("UCS-4LE", NULL, NULL),
+    MAKE_HANDLER("UCS-4BE", NULL, NULL),
+    MAKE_HANDLER("IBM037", NULL, NULL),
+    MAKE_HANDLER(NULL, NULL, NULL), /* UCS4_2143 */
+    MAKE_HANDLER(NULL, NULL, NULL), /* UCS4_3412 */
+    MAKE_HANDLER("UCS-2", NULL, NULL),
+    MAKE_HANDLER("ISO-8859-1", latin1ToUTF8, UTF8ToLatin1),
+    MAKE_ISO_HANDLER("ISO-8859-2", 2),
+    MAKE_ISO_HANDLER("ISO-8859-3", 3),
+    MAKE_ISO_HANDLER("ISO-8859-4", 4),
+    MAKE_ISO_HANDLER("ISO-8859-5", 5),
+    MAKE_ISO_HANDLER("ISO-8859-6", 6),
+    MAKE_ISO_HANDLER("ISO-8859-7", 7),
+    MAKE_ISO_HANDLER("ISO-8859-8", 8),
+    MAKE_ISO_HANDLER("ISO-8859-9", 9),
+    MAKE_HANDLER("ISO-2022-JP", NULL, NULL),
+    MAKE_HANDLER("Shift_JIS", NULL, NULL),
+    MAKE_HANDLER("EUC-JP", NULL, NULL),
+    MAKE_HANDLER("US-ASCII", asciiToAscii, asciiToAscii),
+    MAKE_HANDLER("UTF-16", UTF16LEToUTF8, UTF8ToUTF16),
+    MAKE_HANDLER("HTML", NULL, UTF8ToHtmlWrapper),
+    MAKE_ISO_HANDLER("ISO-8859-10", 10),
+    MAKE_ISO_HANDLER("ISO-8859-11", 11),
+    MAKE_ISO_HANDLER("ISO-8859-13", 13),
+    MAKE_ISO_HANDLER("ISO-8859-14", 14),
+    MAKE_ISO_HANDLER("ISO-8859-15", 15),
+    MAKE_ISO_HANDLER("ISO-8859-16", 16),
+};
 
-    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
-	return(XML_ENC_ERR_INTERNAL);
+#define NUM_DEFAULT_HANDLERS \
+    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
 
-    outend = out + *outlen;
-    inend = in + (*inlen);
-    instop = inend;
+/* the size should be growable, but it's not a big deal ... */
+#define MAX_ENCODING_HANDLERS 50
+static xmlCharEncodingHandlerPtr *globalHandlers = NULL;
+static int nbCharEncodingHandler = 0;
 
-    while ((in < inend) && (out < outend - 1)) {
-	if (*in >= 0x80) {
-	    *out++ = (((*in) >>  6) & 0x1F) | 0xC0;
-            *out++ = ((*in) & 0x3F) | 0x80;
-	    ++in;
-	}
-	if ((instop - in) > (outend - out)) instop = in + (outend - out);
-	while ((in < instop) && (*in < 0x80)) {
-	    *out++ = *in++;
-	}
-    }
-    if ((in < inend) && (out < outend) && (*in < 0x80)) {
-        *out++ = *in++;
-    }
-    *outlen = out - outstart;
-    *inlen = in - base;
-    return(*outlen);
-}
+#ifdef LIBXML_ICONV_ENABLED
+static xmlParserErrors
+xmlCharEncIconv(const char *name, xmlCharEncFlags flags,
+                xmlCharEncodingHandler **out);
+#endif
 
-/**
- * UTF8ToUTF8:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @inb:  a pointer to an array of UTF-8 chars
- * @inlenb:  the length of @in in UTF-8 chars
- *
- * No op copy operation for UTF8 handling.
- *
- * 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
-UTF8ToUTF8(unsigned char* out, int *outlen,
-           const unsigned char* inb, int *inlenb)
-{
-    int len;
-
-    if ((out == NULL) || (outlen == NULL) || (inlenb == NULL))
-	return(XML_ENC_ERR_INTERNAL);
-    if (inb == NULL) {
-        /* inb == NULL means output is initialized. */
-        *outlen = 0;
-        *inlenb = 0;
-        return(0);
-    }
-    if (*outlen > *inlenb) {
-	len = *inlenb;
-    } else {
-	len = *outlen;
-    }
-    if (len < 0)
-	return(XML_ENC_ERR_INTERNAL);
-
-    /*
-     * FIXME: Conversion functions must assure valid UTF-8, so we have
-     * to check for UTF-8 validity. Preferably, this converter shouldn't
-     * be used at all.
-     */
-    memcpy(out, inb, len);
-
-    *outlen = len;
-    *inlenb = len;
-    return(*outlen);
-}
-
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/**
- * UTF8Toisolat1:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of UTF-8 chars
- * @inlen:  the length of @in
- *
- * 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 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.
- */
-int
-UTF8Toisolat1(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen) {
-    const unsigned char* processed = in;
-    const unsigned char* outend;
-    const unsigned char* outstart = out;
-    const unsigned char* instart = in;
-    const unsigned char* inend;
-    unsigned int c, d;
-    int trailing;
-
-    if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
-        return(XML_ENC_ERR_INTERNAL);
-    if (in == NULL) {
-        /*
-	 * initialization nothing to do
-	 */
-	*outlen = 0;
-	*inlen = 0;
-	return(0);
-    }
-    inend = in + (*inlen);
-    outend = out + (*outlen);
-    while (in < inend) {
-	d = *in++;
-	if      (d < 0x80)  { c= d; trailing= 0; }
-	else if (d < 0xC0) {
-	    /* trailing byte in leading position */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    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; }
-	else {
-	    /* no chance for this in IsoLat1 */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    return(XML_ENC_ERR_INPUT);
-	}
-
-	if (inend - in < trailing) {
-	    break;
-	}
-
-	for ( ; trailing; trailing--) {
-	    if (in >= inend)
-		break;
-	    if (((d= *in++) & 0xC0) != 0x80) {
-		*outlen = out - outstart;
-		*inlen = processed - instart;
-		return(XML_ENC_ERR_INPUT);
-	    }
-	    c <<= 6;
-	    c |= d & 0x3F;
-	}
-
-	/* assertion: c is a single UTF-4 value */
-	if (c <= 0xFF) {
-	    if (out >= outend)
-		break;
-	    *out++ = c;
-	} else {
-	    /* no chance for this in IsoLat1 */
-	    *outlen = out - outstart;
-	    *inlen = processed - instart;
-	    return(XML_ENC_ERR_INPUT);
-	}
-	processed = in;
-    }
-    *outlen = out - outstart;
-    *inlen = processed - instart;
-    return(*outlen);
-}
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/**
- * UTF16LEToUTF8:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @inb:  a pointer to an array of UTF-16LE passwd as a byte array
- * @inlenb:  the length of @in in UTF-16LE chars
- *
- * Take a block of UTF-16LE ushorts in and try to convert it to an UTF-8
- * block of chars out. This function assumes the endian property
- * is the same between the native type of this machine and the
- * inputed one.
- *
- * 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,
-            const unsigned char* inb, int *inlenb)
-{
-    unsigned char* outstart = out;
-    const unsigned char* processed = inb;
-    unsigned char* outend;
-    unsigned short* in = (unsigned short *) (void *) inb;
-    unsigned short* inend;
-    unsigned int c, d, inlen;
-    unsigned char *tmp;
-    int bits;
-
-    if (*outlen == 0) {
-        *inlenb = 0;
-        return(0);
-    }
-    outend = out + *outlen;
-    if ((*inlenb % 2) == 1)
-        (*inlenb)--;
-    inlen = *inlenb / 2;
-    inend = in + inlen;
-    while ((in < inend) && (out - outstart + 5 < *outlen)) {
-        if (xmlLittleEndian) {
-	    c= *in++;
-	} else {
-	    tmp = (unsigned char *) in;
-	    c = *tmp++;
-	    c = c | (*tmp << 8);
-	    in++;
-	}
-        if ((c & 0xFC00) == 0xD800) {    /* surrogates */
-	    if (in >= inend) {           /* handle split mutli-byte characters */
-		break;
-	    }
-	    if (xmlLittleEndian) {
-		d = *in++;
-	    } else {
-		tmp = (unsigned char *) in;
-		d = *tmp++;
-		d = d | (*tmp << 8);
-		in++;
-	    }
-            if ((d & 0xFC00) == 0xDC00) {
-                c &= 0x03FF;
-                c <<= 10;
-                c |= d & 0x03FF;
-                c += 0x10000;
-            }
-            else {
-		*outlen = out - outstart;
-		*inlenb = processed - inb;
-	        return(XML_ENC_ERR_INPUT);
-	    }
-        }
-
-	/* assertion: c is a single UTF-4 value */
-        if (out >= outend)
-	    break;
-        if      (c <    0x80) {  *out++=  c;                bits= -6; }
-        else if (c <   0x800) {  *out++= ((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-        else if (c < 0x10000) {  *out++= ((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-        else                  {  *out++= ((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-        for ( ; bits >= 0; bits-= 6) {
-            if (out >= outend)
-	        break;
-            *out++= ((c >> bits) & 0x3F) | 0x80;
-        }
-	processed = (const unsigned char*) in;
-    }
-    *outlen = out - outstart;
-    *inlenb = processed - inb;
-    return(*outlen);
-}
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/**
- * UTF8ToUTF16LE:
- * @outb:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @outb
- * @in:  a pointer to an array of UTF-8 chars
- * @inlen:  the length of @in
- *
- * 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 an XML_ENC_ERR code.
- */
-static int
-UTF8ToUTF16LE(unsigned char* outb, int *outlen,
-            const unsigned char* in, int *inlen)
-{
-    unsigned short* out = (unsigned short *) (void *) outb;
-    const unsigned char* processed = in;
-    const unsigned char *const instart = in;
-    unsigned short* outstart= out;
-    unsigned short* outend;
-    const unsigned char* inend;
-    unsigned int c, d;
-    int trailing;
-    unsigned char *tmp;
-    unsigned short tmp1, tmp2;
-
-    /* UTF16LE encoding has no BOM */
-    if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
-        return(XML_ENC_ERR_INTERNAL);
-    if (in == NULL) {
-	*outlen = 0;
-	*inlen = 0;
-	return(0);
-    }
-    inend= in + *inlen;
-    outend = out + (*outlen / 2);
-    while (in < inend) {
-      d= *in++;
-      if      (d < 0x80)  { c= d; trailing= 0; }
-      else if (d < 0xC0) {
-          /* trailing byte in leading position */
-	  *outlen = (out - outstart) * 2;
-	  *inlen = processed - instart;
-	  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; }
-      else {
-	/* no chance for this in UTF-16 */
-	*outlen = (out - outstart) * 2;
-	*inlen = processed - instart;
-	return(XML_ENC_ERR_INPUT);
-      }
-
-      if (inend - in < trailing) {
-          break;
-      }
-
-      for ( ; trailing; trailing--) {
-          if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
-	      break;
-          c <<= 6;
-          c |= d & 0x3F;
-      }
-
-      /* assertion: c is a single UTF-4 value */
-        if (c < 0x10000) {
-            if (out >= outend)
-	        break;
-	    if (xmlLittleEndian) {
-		*out++ = c;
-	    } else {
-		tmp = (unsigned char *) out;
-		*tmp = (unsigned char) c; /* Explicit truncation */
-		*(tmp + 1) = c >> 8 ;
-		out++;
-	    }
-        }
-        else if (c < 0x110000) {
-            if (out+1 >= outend)
-	        break;
-            c -= 0x10000;
-	    if (xmlLittleEndian) {
-		*out++ = 0xD800 | (c >> 10);
-		*out++ = 0xDC00 | (c & 0x03FF);
-	    } else {
-		tmp1 = 0xD800 | (c >> 10);
-		tmp = (unsigned char *) out;
-		*tmp = (unsigned char) tmp1; /* Explicit truncation */
-		*(tmp + 1) = tmp1 >> 8;
-		out++;
-
-		tmp2 = 0xDC00 | (c & 0x03FF);
-		tmp = (unsigned char *) out;
-		*tmp  = (unsigned char) tmp2; /* Explicit truncation */
-		*(tmp + 1) = tmp2 >> 8;
-		out++;
-	    }
-        }
-        else
-	    break;
-	processed = in;
-    }
-    *outlen = (out - outstart) * 2;
-    *inlen = processed - instart;
-    return(*outlen);
-}
-
-/**
- * UTF8ToUTF16:
- * @outb:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @outb
- * @in:  a pointer to an array of UTF-8 chars
- * @inlen:  the length of @in
- *
- * 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 an XML_ENC_ERR code.
- */
-static int
-UTF8ToUTF16(unsigned char* outb, int *outlen,
-            const unsigned char* in, int *inlen)
-{
-    if (in == NULL) {
-	/*
-	 * initialization, add the Byte Order Mark for UTF-16LE
-	 */
-        if (*outlen >= 2) {
-	    outb[0] = 0xFF;
-	    outb[1] = 0xFE;
-	    *outlen = 2;
-	    *inlen = 0;
-	    return(2);
-	}
-	*outlen = 0;
-	*inlen = 0;
-	return(0);
-    }
-    return (UTF8ToUTF16LE(outb, outlen, in, inlen));
-}
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-/**
- * UTF16BEToUTF8:
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @inb:  a pointer to an array of UTF-16 passed as a byte array
- * @inlenb:  the length of @in in UTF-16 chars
- *
- * Take a block of UTF-16 ushorts in and try to convert it to an UTF-8
- * block of chars out. This function assumes the endian property
- * is the same between the native type of this machine and the
- * inputed one.
- *
- * 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
-UTF16BEToUTF8(unsigned char* out, int *outlen,
-            const unsigned char* inb, int *inlenb)
-{
-    unsigned char* outstart = out;
-    const unsigned char* processed = inb;
-    unsigned char* outend;
-    unsigned short* in = (unsigned short *) (void *) inb;
-    unsigned short* inend;
-    unsigned int c, d, inlen;
-    unsigned char *tmp;
-    int bits;
-
-    if (*outlen == 0) {
-        *inlenb = 0;
-        return(0);
-    }
-    outend = out + *outlen;
-    if ((*inlenb % 2) == 1)
-        (*inlenb)--;
-    inlen = *inlenb / 2;
-    inend= in + inlen;
-    while ((in < inend) && (out - outstart + 5 < *outlen)) {
-	if (xmlLittleEndian) {
-	    tmp = (unsigned char *) in;
-	    c = *tmp++;
-	    c = (c << 8) | *tmp;
-	    in++;
-	} else {
-	    c= *in++;
-	}
-        if ((c & 0xFC00) == 0xD800) {    /* surrogates */
-	    if (in >= inend) {           /* handle split mutli-byte characters */
-                break;
-	    }
-	    if (xmlLittleEndian) {
-		tmp = (unsigned char *) in;
-		d = *tmp++;
-		d = (d << 8) | *tmp;
-		in++;
-	    } else {
-		d= *in++;
-	    }
-            if ((d & 0xFC00) == 0xDC00) {
-                c &= 0x03FF;
-                c <<= 10;
-                c |= d & 0x03FF;
-                c += 0x10000;
-            }
-            else {
-		*outlen = out - outstart;
-		*inlenb = processed - inb;
-	        return(XML_ENC_ERR_INPUT);
-	    }
-        }
-
-	/* assertion: c is a single UTF-4 value */
-        if (out >= outend)
-	    break;
-        if      (c <    0x80) {  *out++=  c;                bits= -6; }
-        else if (c <   0x800) {  *out++= ((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
-        else if (c < 0x10000) {  *out++= ((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
-        else                  {  *out++= ((c >> 18) & 0x07) | 0xF0;  bits= 12; }
-
-        for ( ; bits >= 0; bits-= 6) {
-            if (out >= outend)
-	        break;
-            *out++= ((c >> bits) & 0x3F) | 0x80;
-        }
-	processed = (const unsigned char*) in;
-    }
-    *outlen = out - outstart;
-    *inlenb = processed - inb;
-    return(*outlen);
-}
-
-#ifdef LIBXML_OUTPUT_ENABLED
-/**
- * UTF8ToUTF16BE:
- * @outb:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @outb
- * @in:  a pointer to an array of UTF-8 chars
- * @inlen:  the length of @in
- *
- * 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 bytes written or an XML_ENC_ERR code.
- */
-static int
-UTF8ToUTF16BE(unsigned char* outb, int *outlen,
-            const unsigned char* in, int *inlen)
-{
-    unsigned short* out = (unsigned short *) (void *) outb;
-    const unsigned char* processed = in;
-    const unsigned char *const instart = in;
-    unsigned short* outstart= out;
-    unsigned short* outend;
-    const unsigned char* inend;
-    unsigned int c, d;
-    int trailing;
-    unsigned char *tmp;
-    unsigned short tmp1, tmp2;
-
-    /* UTF-16BE has no BOM */
-    if ((outb == NULL) || (outlen == NULL) || (inlen == NULL))
-        return(XML_ENC_ERR_INTERNAL);
-    if (in == NULL) {
-	*outlen = 0;
-	*inlen = 0;
-	return(0);
-    }
-    inend= in + *inlen;
-    outend = out + (*outlen / 2);
-    while (in < inend) {
-      d= *in++;
-      if      (d < 0x80)  { c= d; trailing= 0; }
-      else if (d < 0xC0)  {
-          /* trailing byte in leading position */
-	  *outlen = out - outstart;
-	  *inlen = processed - instart;
-	  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; }
-      else {
-          /* no chance for this in UTF-16 */
-	  *outlen = out - outstart;
-	  *inlen = processed - instart;
-	  return(XML_ENC_ERR_INPUT);
-      }
-
-      if (inend - in < trailing) {
-          break;
-      }
-
-      for ( ; trailing; trailing--) {
-          if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))  break;
-          c <<= 6;
-          c |= d & 0x3F;
-      }
-
-      /* assertion: c is a single UTF-4 value */
-        if (c < 0x10000) {
-            if (out >= outend)  break;
-	    if (xmlLittleEndian) {
-		tmp = (unsigned char *) out;
-		*tmp = c >> 8;
-		*(tmp + 1) = (unsigned char) c; /* Explicit truncation */
-		out++;
-	    } else {
-		*out++ = c;
-	    }
-        }
-        else if (c < 0x110000) {
-            if (out+1 >= outend)  break;
-            c -= 0x10000;
-	    if (xmlLittleEndian) {
-		tmp1 = 0xD800 | (c >> 10);
-		tmp = (unsigned char *) out;
-		*tmp = tmp1 >> 8;
-		*(tmp + 1) = (unsigned char) tmp1; /* Explicit truncation */
-		out++;
-
-		tmp2 = 0xDC00 | (c & 0x03FF);
-		tmp = (unsigned char *) out;
-		*tmp = tmp2 >> 8;
-		*(tmp + 1) = (unsigned char) tmp2; /* Explicit truncation */
-		out++;
-	    } else {
-		*out++ = 0xD800 | (c >> 10);
-		*out++ = 0xDC00 | (c & 0x03FF);
-	    }
-        }
-        else
-	    break;
-	processed = in;
-    }
-    *outlen = (out - outstart) * 2;
-    *inlen = processed - instart;
-    return(*outlen);
-}
-#endif /* LIBXML_OUTPUT_ENABLED */
+#ifdef LIBXML_ICU_ENABLED
+static xmlParserErrors
+xmlCharEncUconv(const char *name, xmlCharEncFlags flags,
+                xmlCharEncodingHandler **out);
+#endif
 
 /************************************************************************
  *									*
@@ -873,12 +278,6 @@
 	if ((in[0] == 0x3C) && (in[1] == 0x00) &&
 	    (in[2] == 0x00) && (in[3] == 0x00))
 	    return(XML_CHAR_ENCODING_UCS4LE);
-	if ((in[0] == 0x00) && (in[1] == 0x00) &&
-	    (in[2] == 0x3C) && (in[3] == 0x00))
-	    return(XML_CHAR_ENCODING_UCS4_2143);
-	if ((in[0] == 0x00) && (in[1] == 0x3C) &&
-	    (in[2] == 0x00) && (in[3] == 0x00))
-	    return(XML_CHAR_ENCODING_UCS4_3412);
 	if ((in[0] == 0x4C) && (in[1] == 0x6F) &&
 	    (in[2] == 0xA7) && (in[3] == 0x94))
 	    return(XML_CHAR_ENCODING_EBCDIC);
@@ -919,6 +318,9 @@
 /**
  * xmlCleanupEncodingAliases:
  *
+ * DEPRECATED: This function modifies global state and is not
+ * thread-safe.
+ *
  * Unregisters all aliases
  */
 void
@@ -944,6 +346,8 @@
  * xmlGetEncodingAlias:
  * @alias:  the alias name as parsed, in UTF-8 format (ASCII actually)
  *
+ * DEPRECATED: This function is not thread-safe.
+ *
  * Lookup an encoding name for the given alias.
  *
  * Returns NULL if not found, otherwise the original name
@@ -981,6 +385,9 @@
  * @name:  the encoding name as parsed, in UTF-8 format (ASCII actually)
  * @alias:  the alias name as parsed, in UTF-8 format (ASCII actually)
  *
+ * DEPRECATED: This function modifies global state and is not
+ * thread-safe.
+ *
  * Registers an alias @alias for an encoding named @name. Existing alias
  * will be overwritten.
  *
@@ -1003,13 +410,13 @@
 
     if (xmlCharEncodingAliasesNb >= xmlCharEncodingAliasesMax) {
         xmlCharEncodingAliasPtr tmp;
-        size_t newSize = xmlCharEncodingAliasesMax ?
-                         xmlCharEncodingAliasesMax * 2 :
-                         20;
+        int newSize;
 
-        tmp = (xmlCharEncodingAliasPtr)
-              xmlRealloc(xmlCharEncodingAliases,
-                         newSize * sizeof(xmlCharEncodingAlias));
+        newSize = xmlGrowCapacity(xmlCharEncodingAliasesMax, sizeof(tmp[0]),
+                                  20, XML_MAX_ITEMS);
+        if (newSize < 0)
+            return(-1);
+        tmp = xmlRealloc(xmlCharEncodingAliases, newSize * sizeof(tmp[0]));
         if (tmp == NULL)
             return(-1);
         xmlCharEncodingAliases = tmp;
@@ -1053,6 +460,9 @@
  * xmlDelEncodingAlias:
  * @alias:  the alias name as parsed, in UTF-8 format (ASCII actually)
  *
+ * DEPRECATED: This function modifies global state and is not
+ * thread-safe.
+ *
  * Unregisters an encoding alias @alias
  *
  * Returns 0 in case of success, -1 in case of error
@@ -1082,6 +492,31 @@
     return(-1);
 }
 
+static int
+xmlCompareEncTableEntries(const void *vkey, const void *ventry) {
+    const char *key = vkey;
+    const xmlEncTableEntry *entry = ventry;
+
+    return(xmlStrcasecmp(BAD_CAST key, BAD_CAST entry->name));
+}
+
+static xmlCharEncoding
+xmlParseCharEncodingInternal(const char *name)
+{
+    const xmlEncTableEntry *entry;
+
+    if (name == NULL)
+       return(XML_CHAR_ENCODING_NONE);
+
+    entry = bsearch(name, xmlEncTable,
+                    sizeof(xmlEncTable) / sizeof(xmlEncTable[0]),
+                    sizeof(xmlEncTable[0]), xmlCompareEncTableEntries);
+    if (entry != NULL)
+        return(entry->enc);
+
+    return(XML_CHAR_ENCODING_ERROR);
+}
+
 /**
  * xmlParseCharEncoding:
  * @name:  the encoding name as parsed, in UTF-8 format (ASCII actually)
@@ -1094,73 +529,15 @@
  * if not recognized.
  */
 xmlCharEncoding
-xmlParseCharEncoding(const char* name)
+xmlParseCharEncoding(const char *name)
 {
-    const char *alias;
-    char upper[500];
-    int i;
+    xmlCharEncoding enc = xmlParseCharEncodingInternal(name);
 
-    if (name == NULL)
-	return(XML_CHAR_ENCODING_NONE);
+    /* Backward compatibility */
+    if (enc == XML_CHAR_ENCODING_UTF16)
+        enc = XML_CHAR_ENCODING_UTF16LE;
 
-    /*
-     * Do the alias resolution
-     */
-    alias = xmlGetEncodingAlias(name);
-    if (alias != NULL)
-	name = alias;
-
-    for (i = 0;i < 499;i++) {
-        upper[i] = (char) toupper((unsigned char) name[i]);
-	if (upper[i] == 0) break;
-    }
-    upper[i] = 0;
-
-    if (!strcmp(upper, "")) return(XML_CHAR_ENCODING_NONE);
-    if (!strcmp(upper, "UTF-8")) return(XML_CHAR_ENCODING_UTF8);
-    if (!strcmp(upper, "UTF8")) return(XML_CHAR_ENCODING_UTF8);
-
-    /*
-     * NOTE: if we were able to parse this, the endianness of UTF16 is
-     *       already found and in use
-     */
-    if (!strcmp(upper, "UTF-16")) return(XML_CHAR_ENCODING_UTF16LE);
-    if (!strcmp(upper, "UTF16")) return(XML_CHAR_ENCODING_UTF16LE);
-
-    if (!strcmp(upper, "ISO-10646-UCS-2")) return(XML_CHAR_ENCODING_UCS2);
-    if (!strcmp(upper, "UCS-2")) return(XML_CHAR_ENCODING_UCS2);
-    if (!strcmp(upper, "UCS2")) return(XML_CHAR_ENCODING_UCS2);
-
-    /*
-     * NOTE: if we were able to parse this, the endianness of UCS4 is
-     *       already found and in use
-     */
-    if (!strcmp(upper, "ISO-10646-UCS-4")) return(XML_CHAR_ENCODING_UCS4LE);
-    if (!strcmp(upper, "UCS-4")) return(XML_CHAR_ENCODING_UCS4LE);
-    if (!strcmp(upper, "UCS4")) return(XML_CHAR_ENCODING_UCS4LE);
-
-
-    if (!strcmp(upper,  "ISO-8859-1")) return(XML_CHAR_ENCODING_8859_1);
-    if (!strcmp(upper,  "ISO-LATIN-1")) return(XML_CHAR_ENCODING_8859_1);
-    if (!strcmp(upper,  "ISO LATIN 1")) return(XML_CHAR_ENCODING_8859_1);
-
-    if (!strcmp(upper,  "ISO-8859-2")) return(XML_CHAR_ENCODING_8859_2);
-    if (!strcmp(upper,  "ISO-LATIN-2")) return(XML_CHAR_ENCODING_8859_2);
-    if (!strcmp(upper,  "ISO LATIN 2")) return(XML_CHAR_ENCODING_8859_2);
-
-    if (!strcmp(upper,  "ISO-8859-3")) return(XML_CHAR_ENCODING_8859_3);
-    if (!strcmp(upper,  "ISO-8859-4")) return(XML_CHAR_ENCODING_8859_4);
-    if (!strcmp(upper,  "ISO-8859-5")) return(XML_CHAR_ENCODING_8859_5);
-    if (!strcmp(upper,  "ISO-8859-6")) return(XML_CHAR_ENCODING_8859_6);
-    if (!strcmp(upper,  "ISO-8859-7")) return(XML_CHAR_ENCODING_8859_7);
-    if (!strcmp(upper,  "ISO-8859-8")) return(XML_CHAR_ENCODING_8859_8);
-    if (!strcmp(upper,  "ISO-8859-9")) return(XML_CHAR_ENCODING_8859_9);
-
-    if (!strcmp(upper, "ISO-2022-JP")) return(XML_CHAR_ENCODING_2022_JP);
-    if (!strcmp(upper, "SHIFT_JIS")) return(XML_CHAR_ENCODING_SHIFT_JIS);
-    if (!strcmp(upper, "EUC-JP")) return(XML_CHAR_ENCODING_EUC_JP);
-
-    return(XML_CHAR_ENCODING_ERROR);
+    return(enc);
 }
 
 /**
@@ -1173,60 +550,25 @@
  *
  * Returns the canonical name for the given encoding
  */
-
 const char*
 xmlGetCharEncodingName(xmlCharEncoding enc) {
     switch (enc) {
-        case XML_CHAR_ENCODING_ERROR:
-	    return(NULL);
-        case XML_CHAR_ENCODING_NONE:
-	    return(NULL);
-        case XML_CHAR_ENCODING_UTF8:
-	    return("UTF-8");
         case XML_CHAR_ENCODING_UTF16LE:
 	    return("UTF-16");
         case XML_CHAR_ENCODING_UTF16BE:
 	    return("UTF-16");
-        case XML_CHAR_ENCODING_EBCDIC:
-            return("EBCDIC");
         case XML_CHAR_ENCODING_UCS4LE:
-            return("ISO-10646-UCS-4");
+            return("UCS-4");
         case XML_CHAR_ENCODING_UCS4BE:
-            return("ISO-10646-UCS-4");
-        case XML_CHAR_ENCODING_UCS4_2143:
-            return("ISO-10646-UCS-4");
-        case XML_CHAR_ENCODING_UCS4_3412:
-            return("ISO-10646-UCS-4");
-        case XML_CHAR_ENCODING_UCS2:
-            return("ISO-10646-UCS-2");
-        case XML_CHAR_ENCODING_8859_1:
-	    return("ISO-8859-1");
-        case XML_CHAR_ENCODING_8859_2:
-	    return("ISO-8859-2");
-        case XML_CHAR_ENCODING_8859_3:
-	    return("ISO-8859-3");
-        case XML_CHAR_ENCODING_8859_4:
-	    return("ISO-8859-4");
-        case XML_CHAR_ENCODING_8859_5:
-	    return("ISO-8859-5");
-        case XML_CHAR_ENCODING_8859_6:
-	    return("ISO-8859-6");
-        case XML_CHAR_ENCODING_8859_7:
-	    return("ISO-8859-7");
-        case XML_CHAR_ENCODING_8859_8:
-	    return("ISO-8859-8");
-        case XML_CHAR_ENCODING_8859_9:
-	    return("ISO-8859-9");
-        case XML_CHAR_ENCODING_2022_JP:
-            return("ISO-2022-JP");
-        case XML_CHAR_ENCODING_SHIFT_JIS:
-            return("Shift-JIS");
-        case XML_CHAR_ENCODING_EUC_JP:
-            return("EUC-JP");
-	case XML_CHAR_ENCODING_ASCII:
-	    return(NULL);
+            return("UCS-4");
+        default:
+            break;
     }
-    return(NULL);
+
+    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
+        return(NULL);
+
+    return(defaultHandlers[enc].name);
 }
 
 /************************************************************************
@@ -1235,110 +577,15 @@
  *									*
  ************************************************************************/
 
-#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) && \
-    defined(LIBXML_ISO8859X_ENABLED)
-
-#define DECLARE_ISO_FUNCS(n) \
-    static int ISO8859_##n##ToUTF8(unsigned char* out, int *outlen, \
-                                   const unsigned char* in, int *inlen); \
-    static int UTF8ToISO8859_##n(unsigned char* out, int *outlen, \
-                                 const unsigned char* in, int *inlen);
-
-/** DOC_DISABLE */
-DECLARE_ISO_FUNCS(2)
-DECLARE_ISO_FUNCS(3)
-DECLARE_ISO_FUNCS(4)
-DECLARE_ISO_FUNCS(5)
-DECLARE_ISO_FUNCS(6)
-DECLARE_ISO_FUNCS(7)
-DECLARE_ISO_FUNCS(8)
-DECLARE_ISO_FUNCS(9)
-DECLARE_ISO_FUNCS(10)
-DECLARE_ISO_FUNCS(11)
-DECLARE_ISO_FUNCS(13)
-DECLARE_ISO_FUNCS(14)
-DECLARE_ISO_FUNCS(15)
-DECLARE_ISO_FUNCS(16)
-/** DOC_ENABLE */
-
-#endif /* LIBXML_ISO8859X_ENABLED */
-
-#ifdef LIBXML_ICONV_ENABLED
-  #define EMPTY_ICONV , (iconv_t) -1, (iconv_t) -1
-#else
-  #define EMPTY_ICONV
-#endif
-
-#ifdef LIBXML_ICU_ENABLED
-  #define EMPTY_UCONV , NULL, NULL
-#else
-  #define EMPTY_UCONV
-#endif
-
-#define MAKE_HANDLER(name, in, out) \
-    { (char *) name, in, out EMPTY_ICONV EMPTY_UCONV }
-
-static const xmlCharEncodingHandler defaultHandlers[] = {
-#ifdef LIBXML_OUTPUT_ENABLED
-    MAKE_HANDLER("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE)
-    ,MAKE_HANDLER("UTF-16BE", UTF16BEToUTF8, UTF8ToUTF16BE)
-    ,MAKE_HANDLER("UTF-16", UTF16LEToUTF8, UTF8ToUTF16)
-    ,MAKE_HANDLER("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1)
-    ,MAKE_HANDLER("ASCII", asciiToUTF8, UTF8Toascii)
-    ,MAKE_HANDLER("US-ASCII", asciiToUTF8, UTF8Toascii)
-#ifdef LIBXML_HTML_ENABLED
-    ,MAKE_HANDLER("HTML", NULL, UTF8ToHtml)
-#endif
-#else
-    MAKE_HANDLER("UTF-16LE", UTF16LEToUTF8, NULL)
-    ,MAKE_HANDLER("UTF-16BE", UTF16BEToUTF8, NULL)
-    ,MAKE_HANDLER("UTF-16", UTF16LEToUTF8, NULL)
-    ,MAKE_HANDLER("ISO-8859-1", isolat1ToUTF8, NULL)
-    ,MAKE_HANDLER("ASCII", asciiToUTF8, NULL)
-    ,MAKE_HANDLER("US-ASCII", asciiToUTF8, NULL)
-#endif /* LIBXML_OUTPUT_ENABLED */
-
-#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) && \
-    defined(LIBXML_ISO8859X_ENABLED)
-    ,MAKE_HANDLER("ISO-8859-2", ISO8859_2ToUTF8, UTF8ToISO8859_2)
-    ,MAKE_HANDLER("ISO-8859-3", ISO8859_3ToUTF8, UTF8ToISO8859_3)
-    ,MAKE_HANDLER("ISO-8859-4", ISO8859_4ToUTF8, UTF8ToISO8859_4)
-    ,MAKE_HANDLER("ISO-8859-5", ISO8859_5ToUTF8, UTF8ToISO8859_5)
-    ,MAKE_HANDLER("ISO-8859-6", ISO8859_6ToUTF8, UTF8ToISO8859_6)
-    ,MAKE_HANDLER("ISO-8859-7", ISO8859_7ToUTF8, UTF8ToISO8859_7)
-    ,MAKE_HANDLER("ISO-8859-8", ISO8859_8ToUTF8, UTF8ToISO8859_8)
-    ,MAKE_HANDLER("ISO-8859-9", ISO8859_9ToUTF8, UTF8ToISO8859_9)
-    ,MAKE_HANDLER("ISO-8859-10", ISO8859_10ToUTF8, UTF8ToISO8859_10)
-    ,MAKE_HANDLER("ISO-8859-11", ISO8859_11ToUTF8, UTF8ToISO8859_11)
-    ,MAKE_HANDLER("ISO-8859-13", ISO8859_13ToUTF8, UTF8ToISO8859_13)
-    ,MAKE_HANDLER("ISO-8859-14", ISO8859_14ToUTF8, UTF8ToISO8859_14)
-    ,MAKE_HANDLER("ISO-8859-15", ISO8859_15ToUTF8, UTF8ToISO8859_15)
-    ,MAKE_HANDLER("ISO-8859-16", ISO8859_16ToUTF8, UTF8ToISO8859_16)
-#endif
-};
-
-#define NUM_DEFAULT_HANDLERS \
-    (sizeof(defaultHandlers) / sizeof(defaultHandlers[0]))
-
-static const xmlCharEncodingHandler xmlUTF8Handler =
-    MAKE_HANDLER("UTF-8", UTF8ToUTF8, UTF8ToUTF8);
-
-static const xmlCharEncodingHandler *xmlUTF16LEHandler = &defaultHandlers[0];
-static const xmlCharEncodingHandler *xmlUTF16BEHandler = &defaultHandlers[1];
-static const xmlCharEncodingHandler *xmlLatin1Handler = &defaultHandlers[3];
-static const xmlCharEncodingHandler *xmlAsciiHandler = &defaultHandlers[4];
-
-/* the size should be growable, but it's not a big deal ... */
-#define MAX_ENCODING_HANDLERS 50
-static xmlCharEncodingHandlerPtr *handlers = NULL;
-static int nbCharEncodingHandler = 0;
-
 /**
  * xmlNewCharEncodingHandler:
  * @name:  the encoding name, in UTF-8 format (ASCII actually)
  * @input:  the xmlCharEncodingInputFunc to read that encoding
  * @output:  the xmlCharEncodingOutputFunc to write that encoding
  *
+ * DEPRECATED: This function modifies global state and is not
+ * thread-safe.
+ *
  * Create and registers an xmlCharEncodingHandler.
  *
  * Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
@@ -1384,18 +631,10 @@
 	return(NULL);
     }
     memset(handler, 0, sizeof(xmlCharEncodingHandler));
-    handler->input = input;
-    handler->output = output;
+    handler->input.legacyFunc = input;
+    handler->output.legacyFunc = output;
     handler->name = up;
-
-#ifdef LIBXML_ICONV_ENABLED
-    handler->iconv_in = (iconv_t) -1;
-    handler->iconv_out = (iconv_t) -1;
-#endif
-#ifdef LIBXML_ICU_ENABLED
-    handler->uconv_in = NULL;
-    handler->uconv_out = NULL;
-#endif
+    handler->flags = XML_HANDLER_STATIC | XML_HANDLER_LEGACY;
 
     /*
      * registers and returns the handler.
@@ -1405,6 +644,64 @@
 }
 
 /**
+ * xmlCharEncNewCustomHandler:
+ * @name:  the encoding name
+ * @input:  input callback which converts to UTF-8
+ * @output:  output callback which converts from UTF-8
+ * @ctxtDtor:  context destructor
+ * @inputCtxt:  context for input callback
+ * @outputCtxt:  context for output callback
+ * @out:  pointer to resulting handler
+ *
+ * Create a custom xmlCharEncodingHandler.
+ *
+ * Returns an xmlParserErrors code.
+ */
+xmlParserErrors
+xmlCharEncNewCustomHandler(const char *name,
+                           xmlCharEncConvFunc input, xmlCharEncConvFunc output,
+                           xmlCharEncConvCtxtDtor ctxtDtor,
+                           void *inputCtxt, void *outputCtxt,
+                           xmlCharEncodingHandler **out) {
+    xmlCharEncodingHandler *handler;
+
+    if (out == NULL)
+        return(XML_ERR_ARGUMENT);
+
+    handler = xmlMalloc(sizeof(*handler));
+    if (handler == NULL)
+        goto error;
+    memset(handler, 0, sizeof(*handler));
+
+    if (name != NULL) {
+        handler->name = xmlMemStrdup(name);
+        if (handler->name == NULL)
+            goto error;
+    }
+
+    handler->input.func = input;
+    handler->output.func = output;
+    handler->ctxtDtor = ctxtDtor;
+    handler->inputCtxt = inputCtxt;
+    handler->outputCtxt = outputCtxt;
+
+    *out = handler;
+    return(XML_ERR_OK);
+
+error:
+    xmlFree(handler);
+
+    if (ctxtDtor != NULL) {
+        if (inputCtxt != NULL)
+            ctxtDtor(inputCtxt);
+        if (outputCtxt != NULL)
+            ctxtDtor(outputCtxt);
+    }
+
+    return(XML_ERR_NO_MEMORY);
+}
+
+/**
  * xmlInitCharEncodingHandlers:
  *
  * DEPRECATED: Alias for xmlInitParser.
@@ -1443,18 +740,21 @@
 xmlCleanupCharEncodingHandlers(void) {
     xmlCleanupEncodingAliases();
 
-    if (handlers == NULL) return;
+    if (globalHandlers == NULL) return;
 
     for (;nbCharEncodingHandler > 0;) {
+        xmlCharEncodingHandler *handler;
+
         nbCharEncodingHandler--;
-	if (handlers[nbCharEncodingHandler] != NULL) {
-	    if (handlers[nbCharEncodingHandler]->name != NULL)
-		xmlFree(handlers[nbCharEncodingHandler]->name);
-	    xmlFree(handlers[nbCharEncodingHandler]);
+        handler = globalHandlers[nbCharEncodingHandler];
+	if (handler != NULL) {
+	    if (handler->name != NULL)
+		xmlFree(handler->name);
+	    xmlFree(handler);
 	}
     }
-    xmlFree(handlers);
-    handlers = NULL;
+    xmlFree(globalHandlers);
+    globalHandlers = NULL;
     nbCharEncodingHandler = 0;
 }
 
@@ -1462,21 +762,25 @@
  * xmlRegisterCharEncodingHandler:
  * @handler:  the xmlCharEncodingHandlerPtr handler block
  *
- * Register the char encoding handler, surprising, isn't it ?
+ * DEPRECATED: This function modifies global state and is not
+ * thread-safe.
+ *
+ * Register the char encoding handler.
  */
 void
 xmlRegisterCharEncodingHandler(xmlCharEncodingHandlerPtr handler) {
     if (handler == NULL)
         return;
-    if (handlers == NULL) {
-        handlers = xmlMalloc(MAX_ENCODING_HANDLERS * sizeof(handlers[0]));
-        if (handlers == NULL)
+    if (globalHandlers == NULL) {
+        globalHandlers = xmlMalloc(
+                MAX_ENCODING_HANDLERS * sizeof(globalHandlers[0]));
+        if (globalHandlers == NULL)
             goto free_handler;
     }
 
     if (nbCharEncodingHandler >= MAX_ENCODING_HANDLERS)
         goto free_handler;
-    handlers[nbCharEncodingHandler++] = handler;
+    globalHandlers[nbCharEncodingHandler++] = handler;
     return;
 
 free_handler:
@@ -1488,411 +792,131 @@
     }
 }
 
-#ifdef LIBXML_ICONV_ENABLED
-static int
-xmlCreateIconvHandler(const char *name, xmlCharEncodingHandler **out) {
-    xmlCharEncodingHandlerPtr enc = NULL;
-    iconv_t icv_in = (iconv_t) -1;
-    iconv_t icv_out = (iconv_t) -1;
-    int ret;
-
-    *out = NULL;
-
-    icv_in = iconv_open("UTF-8", name);
-    if (icv_in == (iconv_t) -1) {
-        if (errno == EINVAL)
-            ret = XML_ERR_UNSUPPORTED_ENCODING;
-        else if (errno == ENOMEM)
-            ret = XML_ERR_NO_MEMORY;
-        else
-            ret = XML_ERR_SYSTEM;
-        goto error;
-    }
-
-    icv_out = iconv_open(name, "UTF-8");
-    if (icv_out == (iconv_t) -1) {
-        if (errno == EINVAL)
-            ret = XML_ERR_UNSUPPORTED_ENCODING;
-        else if (errno == ENOMEM)
-            ret = XML_ERR_NO_MEMORY;
-        else
-            ret = XML_ERR_SYSTEM;
-        goto error;
-    }
-
-    enc = xmlMalloc(sizeof(*enc));
-    if (enc == NULL) {
-        ret = XML_ERR_NO_MEMORY;
-        goto error;
-    }
-    memset(enc, 0, sizeof(*enc));
-
-    enc->name = xmlMemStrdup(name);
-    if (enc->name == NULL) {
-        ret = XML_ERR_NO_MEMORY;
-        goto error;
-    }
-    enc->iconv_in = icv_in;
-    enc->iconv_out = icv_out;
-
-    *out = enc;
-    return(0);
-
-error:
-    if (enc != NULL)
-        xmlFree(enc);
-    if (icv_in != (iconv_t) -1)
-        iconv_close(icv_in);
-    if (icv_out != (iconv_t) -1)
-        iconv_close(icv_out);
-    return(ret);
-}
-#endif /* LIBXML_ICONV_ENABLED */
-
-#ifdef LIBXML_ICU_ENABLED
-static int
-openIcuConverter(const char* name, int toUnicode, uconv_t **out)
-{
-    UErrorCode status;
-    uconv_t *conv;
-
-    *out = NULL;
-
-    conv = (uconv_t *) xmlMalloc(sizeof(uconv_t));
-    if (conv == NULL)
-        return(XML_ERR_NO_MEMORY);
-
-    conv->pivot_source = conv->pivot_buf;
-    conv->pivot_target = conv->pivot_buf;
-
-    status = U_ZERO_ERROR;
-    conv->uconv = ucnv_open(name, &status);
-    if (U_FAILURE(status))
-        goto error;
-
-    status = U_ZERO_ERROR;
-    if (toUnicode) {
-        ucnv_setToUCallBack(conv->uconv, UCNV_TO_U_CALLBACK_STOP,
-                                                NULL, NULL, NULL, &status);
-    }
-    else {
-        ucnv_setFromUCallBack(conv->uconv, UCNV_FROM_U_CALLBACK_STOP,
-                                                NULL, NULL, NULL, &status);
-    }
-    if (U_FAILURE(status))
-        goto error;
-
-    status = U_ZERO_ERROR;
-    conv->utf8 = ucnv_open("UTF-8", &status);
-    if (U_FAILURE(status))
-        goto error;
-
-    *out = conv;
-    return(0);
-
-error:
-    if (conv->uconv)
-        ucnv_close(conv->uconv);
-    xmlFree(conv);
-
-    if (status == U_FILE_ACCESS_ERROR)
-        return(XML_ERR_UNSUPPORTED_ENCODING);
-    if (status == U_MEMORY_ALLOCATION_ERROR)
-        return(XML_ERR_NO_MEMORY);
-    return(XML_ERR_SYSTEM);
-}
-
-static void
-closeIcuConverter(uconv_t *conv)
-{
-    if (conv == NULL)
-        return;
-    ucnv_close(conv->uconv);
-    ucnv_close(conv->utf8);
-    xmlFree(conv);
-}
-
-static int
-xmlCreateUconvHandler(const char *name, xmlCharEncodingHandler **out) {
-    xmlCharEncodingHandlerPtr enc = NULL;
-    uconv_t *ucv_in = NULL;
-    uconv_t *ucv_out = NULL;
-    int ret;
-
-    ret = openIcuConverter(name, 1, &ucv_in);
-    if (ret != 0)
-        goto error;
-    ret = openIcuConverter(name, 0, &ucv_out);
-    if (ret != 0)
-        goto error;
-
-    enc = (xmlCharEncodingHandlerPtr)
-           xmlMalloc(sizeof(xmlCharEncodingHandler));
-    if (enc == NULL) {
-        ret = XML_ERR_NO_MEMORY;
-        goto error;
-    }
-    memset(enc, 0, sizeof(xmlCharEncodingHandler));
-
-    enc->name = xmlMemStrdup(name);
-    if (enc->name == NULL) {
-        ret = XML_ERR_NO_MEMORY;
-        goto error;
-    }
-    enc->input = NULL;
-    enc->output = NULL;
-#ifdef LIBXML_ICONV_ENABLED
-    enc->iconv_in = (iconv_t) -1;
-    enc->iconv_out = (iconv_t) -1;
-#endif
-    enc->uconv_in = ucv_in;
-    enc->uconv_out = ucv_out;
-
-    *out = enc;
-    return(0);
-
-error:
-    if (enc != NULL)
-        xmlFree(enc);
-    if (ucv_in != NULL)
-        closeIcuConverter(ucv_in);
-    if (ucv_out != NULL)
-        closeIcuConverter(ucv_out);
-    return(ret);
-}
-#endif /* LIBXML_ICU_ENABLED */
-
 /**
  * xmlFindExtraHandler:
- * @name:  a string describing the char encoding.
- * @output:  boolean, use handler for output
+ * @norig:  name of the char encoding
+ * @name:  potentially aliased name of the encoding
+ * @flags:  bit mask of flags
+ * @impl:  a conversion implementation (optional)
+ * @implCtxt:  user data for conversion implementation (optional)
  * @out:  pointer to resulting handler
  *
  * Search the non-default handlers for an exact match.
  *
- * Returns 0 on success, 1 if no handler was found, -1 if a memory
- * allocation failed.
+ * Returns an xmlParserErrors error code.
  */
-static int
-xmlFindExtraHandler(const char *name, int output,
+static xmlParserErrors
+xmlFindExtraHandler(const char *norig, const char *name, xmlCharEncFlags flags,
+                    xmlCharEncConvImpl impl, void *implCtxt,
                     xmlCharEncodingHandler **out) {
-    int ret;
-    int i;
+    /*
+     * Try custom implementation before deprecated global handlers.
+     *
+     * Note that we pass the original name without deprecated
+     * alias resolution.
+     */
+    if (impl != NULL)
+        return(impl(implCtxt, norig, flags, out));
 
-    (void) ret;
+    /*
+     * Deprecated
+     */
+    if (globalHandlers != NULL) {
+        int i;
 
-    if (handlers != NULL) {
         for (i = 0; i < nbCharEncodingHandler; i++) {
-            xmlCharEncodingHandler *handler = handlers[i];
+            xmlCharEncodingHandler *h = globalHandlers[i];
 
             if (!xmlStrcasecmp((const xmlChar *) name,
-                               (const xmlChar *) handler->name)) {
-                if (output) {
-                    if (handler->output != NULL) {
-                        *out = handler;
-                        return(0);
-                    }
-                } else {
-                    if (handler->input != NULL) {
-                        *out = handler;
-                        return(0);
-                    }
+                               (const xmlChar *) h->name)) {
+                if ((((flags & XML_ENC_INPUT) == 0) || (h->input.func)) &&
+                    (((flags & XML_ENC_OUTPUT) == 0) || (h->output.func))) {
+                    *out = h;
+                    return(XML_ERR_OK);
                 }
             }
         }
     }
 
 #ifdef LIBXML_ICONV_ENABLED
-    ret = xmlCreateIconvHandler(name, out);
-    if (*out != NULL)
-        return(0);
-    if (ret != XML_ERR_UNSUPPORTED_ENCODING)
-        return(ret);
+    {
+        int ret = xmlCharEncIconv(name, flags, out);
+
+        if (ret == XML_ERR_OK)
+            return(XML_ERR_OK);
+        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
+            return(ret);
+    }
 #endif /* LIBXML_ICONV_ENABLED */
 
 #ifdef LIBXML_ICU_ENABLED
-    ret = xmlCreateUconvHandler(name, out);
-    if (*out != NULL)
-        return(0);
-    if (ret != XML_ERR_UNSUPPORTED_ENCODING)
-        return(ret);
+    {
+        int ret = xmlCharEncUconv(name, flags, out);
+
+        if (ret == XML_ERR_OK)
+            return(XML_ERR_OK);
+        if (ret != XML_ERR_UNSUPPORTED_ENCODING)
+            return(ret);
+    }
 #endif /* LIBXML_ICU_ENABLED */
 
     return(XML_ERR_UNSUPPORTED_ENCODING);
 }
 
 /**
- * xmlFindHandler:
- * @name:  a string describing the char encoding.
- * @output:  boolean, use handler for output
- * @out:  pointer to resulting handler
- *
- * Search all handlers for an exact match.
- *
- * Returns 0 on success, 1 if no handler was found, -1 if a memory
- * allocation failed.
- */
-static int
-xmlFindHandler(const char *name, int output, xmlCharEncodingHandler **out) {
-    int i;
-
-    /*
-     * Check for default handlers
-     */
-    for (i = 0; i < (int) NUM_DEFAULT_HANDLERS; i++) {
-        xmlCharEncodingHandler *handler;
-
-        handler = (xmlCharEncodingHandler *) &defaultHandlers[i];
-
-        if (xmlStrcasecmp((const xmlChar *) name,
-                          (const xmlChar *) handler->name) == 0) {
-            if (output) {
-                if (handler->output != NULL) {
-                    *out = handler;
-                    return(0);
-                }
-            } else {
-                if (handler->input != NULL) {
-                    *out = handler;
-                    return(0);
-                }
-            }
-        }
-    }
-
-    /*
-     * Check for other handlers
-     */
-    return(xmlFindExtraHandler(name, output, out));
-}
-
-/**
  * xmlLookupCharEncodingHandler:
  * @enc:  an xmlCharEncoding value.
  * @out:  pointer to result
  *
- * Find or create a handler matching the encoding. If no default or
- * registered handler could be found, try to create a handler using
- * iconv or ICU if supported.
+ * Find or create a handler matching the encoding. The following
+ * converters are looked up in order:
+ *
+ * - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII)
+ * - User-registered global handler (deprecated)
+ * - iconv if enabled
+ * - ICU if enabled
  *
  * The handler must be closed with xmlCharEncCloseFunc.
  *
+ * If the encoding is UTF-8, a NULL handler and no error code will
+ * be returned.
+ *
  * Available since 2.13.0.
  *
- * Returns an xmlParserErrors error code.
+ * Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
+ * xmlParserErrors error code.
  */
-int
+xmlParserErrors
 xmlLookupCharEncodingHandler(xmlCharEncoding enc,
                              xmlCharEncodingHandler **out) {
-    const char *name = NULL;
-    static const char *const ebcdicNames[] = {
-        "EBCDIC", "ebcdic", "EBCDIC-US", "IBM-037"
-    };
-    static const char *const ucs4Names[] = {
-        "ISO-10646-UCS-4", "UCS-4", "UCS4"
-    };
-    static const char *const ucs2Names[] = {
-        "ISO-10646-UCS-2", "UCS-2", "UCS2"
-    };
-    static const char *const shiftJisNames[] = {
-        "SHIFT-JIS", "SHIFT_JIS", "Shift_JIS",
-    };
-    const char *const *names = NULL;
-    int numNames = 0;
-    int ret;
-    int i;
+    const xmlCharEncodingHandler *handler;
 
     if (out == NULL)
         return(XML_ERR_ARGUMENT);
     *out = NULL;
 
-    switch (enc) {
-        case XML_CHAR_ENCODING_ERROR:
-	    return(XML_ERR_UNSUPPORTED_ENCODING);
-        case XML_CHAR_ENCODING_NONE:
-	    return(0);
-        case XML_CHAR_ENCODING_UTF8:
-	    return(0);
-        case XML_CHAR_ENCODING_UTF16LE:
-	    *out = (xmlCharEncodingHandler *) xmlUTF16LEHandler;
-            return(0);
-        case XML_CHAR_ENCODING_UTF16BE:
-	    *out = (xmlCharEncodingHandler *) xmlUTF16BEHandler;
-            return(0);
-        case XML_CHAR_ENCODING_EBCDIC:
-            names = ebcdicNames;
-            numNames = sizeof(ebcdicNames) / sizeof(ebcdicNames[0]);
-	    break;
-        case XML_CHAR_ENCODING_UCS4BE:
-        case XML_CHAR_ENCODING_UCS4LE:
-            names = ucs4Names;
-            numNames = sizeof(ucs4Names) / sizeof(ucs4Names[0]);
-	    break;
-        case XML_CHAR_ENCODING_UCS4_2143:
-	    break;
-        case XML_CHAR_ENCODING_UCS4_3412:
-	    break;
-        case XML_CHAR_ENCODING_UCS2:
-            names = ucs2Names;
-            numNames = sizeof(ucs2Names) / sizeof(ucs2Names[0]);
-	    break;
+    if ((enc <= 0) || ((size_t) enc >= NUM_DEFAULT_HANDLERS))
+        return(XML_ERR_UNSUPPORTED_ENCODING);
 
-        case XML_CHAR_ENCODING_ASCII:
-	    *out = (xmlCharEncodingHandler *) xmlAsciiHandler;
-            return(0);
-        case XML_CHAR_ENCODING_8859_1:
-	    *out = (xmlCharEncodingHandler *) xmlLatin1Handler;
-            return(0);
-        case XML_CHAR_ENCODING_8859_2:
-	    name = "ISO-8859-2";
-	    break;
-        case XML_CHAR_ENCODING_8859_3:
-	    name = "ISO-8859-3";
-	    break;
-        case XML_CHAR_ENCODING_8859_4:
-	    name = "ISO-8859-4";
-	    break;
-        case XML_CHAR_ENCODING_8859_5:
-	    name = "ISO-8859-5";
-	    break;
-        case XML_CHAR_ENCODING_8859_6:
-	    name = "ISO-8859-6";
-	    break;
-        case XML_CHAR_ENCODING_8859_7:
-	    name = "ISO-8859-7";
-	    break;
-        case XML_CHAR_ENCODING_8859_8:
-	    name = "ISO-8859-8";
-	    break;
-        case XML_CHAR_ENCODING_8859_9:
-	    name = "ISO-8859-9";
-	    break;
+    /* Return NULL handler for UTF-8 */
+    if ((enc == XML_CHAR_ENCODING_UTF8) ||
+        (enc == XML_CHAR_ENCODING_NONE))
+        return(XML_ERR_OK);
 
-        case XML_CHAR_ENCODING_2022_JP:
-            name = "ISO-2022-JP";
-	    break;
-        case XML_CHAR_ENCODING_SHIFT_JIS:
-            names = shiftJisNames;
-            numNames = sizeof(shiftJisNames) / sizeof(shiftJisNames[0]);
-	    break;
-        case XML_CHAR_ENCODING_EUC_JP:
-            name = "EUC-JP";
-	    break;
-	default:
-	    break;
+    handler = &defaultHandlers[enc];
+    if ((handler->input.func != NULL) || (handler->output.func != NULL)) {
+        *out = (xmlCharEncodingHandler *) handler;
+        return(XML_ERR_OK);
     }
 
-    if (name != NULL)
-        return(xmlFindExtraHandler(name, 0, out));
+    if (handler->name != NULL) {
+        xmlCharEncFlags flags = XML_ENC_INPUT;
 
-    if (names != NULL) {
-        for (i = 0; i < numNames; i++) {
-            ret = xmlFindExtraHandler(names[i], 0, out);
-            if (*out != NULL)
-                return(0);
-            if (ret != XML_ERR_UNSUPPORTED_ENCODING)
-                return(ret);
-        }
+#ifdef LIBXML_OUTPUT_ENABLED
+        flags |= XML_ENC_OUTPUT;
+#endif
+        return(xmlFindExtraHandler(handler->name, handler->name, flags,
+                                   NULL, NULL, out));
     }
 
     return(XML_ERR_UNSUPPORTED_ENCODING);
@@ -1917,14 +941,85 @@
 }
 
 /**
+ * xmlCreateCharEncodingHandler:
+ * @name:  a string describing the char encoding.
+ * @flags:  bit mask of flags
+ * @impl:  a conversion implementation (optional)
+ * @implCtxt:  user data for conversion implementation (optional)
+ * @out:  pointer to result
+ *
+ * Find or create a handler matching the encoding. The following
+ * converters are looked up in order:
+ *
+ * - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII)
+ * - Custom implementation if provided
+ * - User-registered global handler (deprecated)
+ * - iconv if enabled
+ * - ICU if enabled
+ *
+ * The handler must be closed with xmlCharEncCloseFunc.
+ *
+ * If the encoding is UTF-8, a NULL handler and no error code will
+ * be returned.
+ *
+ * @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
+ *
+ * Available since 2.14.0.
+ *
+ * Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
+ * xmlParserErrors error code.
+ */
+xmlParserErrors
+xmlCreateCharEncodingHandler(const char *name, xmlCharEncFlags flags,
+                             xmlCharEncConvImpl impl, void *implCtxt,
+                             xmlCharEncodingHandler **out) {
+    const xmlCharEncodingHandler *handler;
+    const char *norig, *nalias;
+    xmlCharEncoding enc;
+
+    if (out == NULL)
+        return(XML_ERR_ARGUMENT);
+    *out = NULL;
+
+    if ((name == NULL) || (flags == 0))
+        return(XML_ERR_ARGUMENT);
+
+    norig = name;
+    nalias = xmlGetEncodingAlias(name);
+    if (nalias != NULL)
+	name = nalias;
+
+    enc = xmlParseCharEncodingInternal(name);
+
+    /* Return NULL handler for UTF-8 */
+    if (enc == XML_CHAR_ENCODING_UTF8)
+        return(XML_ERR_OK);
+
+    if ((enc > 0) && ((size_t) enc < NUM_DEFAULT_HANDLERS)) {
+        handler = &defaultHandlers[enc];
+        if ((((flags & XML_ENC_INPUT) == 0) || (handler->input.func)) &&
+            (((flags & XML_ENC_OUTPUT) == 0) || (handler->output.func))) {
+            *out = (xmlCharEncodingHandler *) handler;
+            return(XML_ERR_OK);
+        }
+    }
+
+    return(xmlFindExtraHandler(norig, name, flags, impl, implCtxt, out));
+}
+
+/**
  * xmlOpenCharEncodingHandler:
  * @name:  a string describing the char encoding.
  * @output:  boolean, use handler for output
  * @out:  pointer to result
  *
- * Find or create a handler matching the encoding. If no default or
- * registered handler could be found, try to create a handler using
- * iconv or ICU if supported.
+ * Find or create a handler matching the encoding. The following
+ * converters are looked up in order:
+ *
+ * - Built-in handler (UTF-8, UTF-16, ISO-8859-1, ASCII)
+ * - User-registered global handler (deprecated)
+ * - iconv if enabled
+ * - ICU if enabled
  *
  * The handler must be closed with xmlCharEncCloseFunc.
  *
@@ -1933,49 +1028,15 @@
  *
  * Available since 2.13.0.
  *
- * Returns an xmlParserErrors error code.
+ * Returns XML_ERR_OK, XML_ERR_UNSUPPORTED_ENCODING or another
+ * xmlParserErrors error code.
  */
-int
+xmlParserErrors
 xmlOpenCharEncodingHandler(const char *name, int output,
                            xmlCharEncodingHandler **out) {
-    const char *nalias;
-    const char *norig;
-    xmlCharEncoding enc;
-    int ret;
+    xmlCharEncFlags flags = output ? XML_ENC_OUTPUT : XML_ENC_INPUT;
 
-    if (out == NULL)
-        return(XML_ERR_ARGUMENT);
-    *out = NULL;
-
-    if (name == NULL)
-        return(XML_ERR_ARGUMENT);
-
-    if ((xmlStrcasecmp(BAD_CAST name, BAD_CAST "UTF-8") == 0) ||
-        (xmlStrcasecmp(BAD_CAST name, BAD_CAST "UTF8") == 0))
-        return(XML_ERR_OK);
-
-    /*
-     * Do the alias resolution
-     */
-    norig = name;
-    nalias = xmlGetEncodingAlias(name);
-    if (nalias != NULL)
-	name = nalias;
-
-    ret = xmlFindHandler(name, output, out);
-    if (*out != NULL)
-        return(0);
-    if (ret != XML_ERR_UNSUPPORTED_ENCODING)
-        return(ret);
-
-    /*
-     * Fallback using the canonical names
-     *
-     * TODO: We should make sure that the name of the returned
-     * handler equals norig.
-     */
-    enc = xmlParseCharEncoding(norig);
-    return(xmlLookupCharEncodingHandler(enc, out));
+    return(xmlCreateCharEncodingHandler(name, flags, NULL, NULL, out));
 }
 
 /**
@@ -1985,12 +1046,16 @@
  * DEPRECATED: Use xmlOpenCharEncodingHandler which has better error
  * reporting.
  *
+ * If the encoding is UTF-8, this will return a no-op handler that
+ * shouldn't be used.
+ *
  * Returns the handler or NULL if no handler was found or an error
  * occurred.
  */
 xmlCharEncodingHandlerPtr
 xmlFindCharEncodingHandler(const char *name) {
     xmlCharEncodingHandler *ret;
+    xmlCharEncFlags flags;
 
     /*
      * This handler shouldn't be used, but we must return a non-NULL
@@ -1998,9 +1063,14 @@
      */
     if ((xmlStrcasecmp(BAD_CAST name, BAD_CAST "UTF-8") == 0) ||
         (xmlStrcasecmp(BAD_CAST name, BAD_CAST "UTF8") == 0))
-        return((xmlCharEncodingHandlerPtr) &xmlUTF8Handler);
+        return((xmlCharEncodingHandlerPtr)
+                &defaultHandlers[XML_CHAR_ENCODING_UTF8]);
 
-    xmlOpenCharEncodingHandler(name, 0, &ret);
+    flags = XML_ENC_INPUT;
+#ifdef LIBXML_OUTPUT_ENABLED
+    flags |= XML_ENC_OUTPUT;
+#endif
+    xmlCreateCharEncodingHandler(name, flags, NULL, NULL, &ret);
     return(ret);
 }
 
@@ -2011,23 +1081,30 @@
  ************************************************************************/
 
 #ifdef LIBXML_ICONV_ENABLED
+typedef struct {
+    iconv_t cd;
+} xmlIconvCtxt;
+
 /**
- * xmlIconvWrapper:
- * @cd:		iconv converter data structure
+ * xmlIconvConvert:
+ * @vctxt:  conversion context
  * @out:  a pointer to an array of bytes to store the result
  * @outlen:  the length of @out
  * @in:  a pointer to an array of input bytes
  * @inlen:  the length of @in
- *
- * Returns an XML_ENC_ERR code.
+ * @flush:  end of input
  *
  * The value of @inlen after return is the number of octets consumed
  *     as the return value is positive, else unpredictable.
  * The value of @outlen after return is the number of octets produced.
+ *
+ * Returns an XML_ENC_ERR code.
  */
-static int
-xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
-                const unsigned char *in, int *inlen) {
+static xmlCharEncError
+xmlIconvConvert(void *vctxt, unsigned char *out, int *outlen,
+                const unsigned char *in, int *inlen,
+                int flush ATTRIBUTE_UNUSED) {
+    xmlIconvCtxt *ctxt = vctxt;
     size_t icv_inlen, icv_outlen;
     const char *icv_in = (const char *) in;
     char *icv_out = (char *) out;
@@ -2042,7 +1119,7 @@
     /*
      * Some versions take const, other versions take non-const input.
      */
-    ret = iconv(cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
+    ret = iconv(ctxt->cd, (void *) &icv_in, &icv_inlen, &icv_out, &icv_outlen);
     *inlen -= icv_inlen;
     *outlen -= icv_outlen;
     if (ret == (size_t) -1) {
@@ -2050,12 +1127,176 @@
             return(XML_ENC_ERR_INPUT);
         if (errno == E2BIG)
             return(XML_ENC_ERR_SPACE);
+        /*
+         * EINVAL means a truncated multi-byte sequence at the end
+         * of the input buffer. We treat this as success.
+         */
         if (errno == EINVAL)
-            return(XML_ENC_ERR_PARTIAL);
+            return(XML_ENC_ERR_SUCCESS);
+#ifdef __APPLE__
+        /*
+         * Apple's new libiconv can return EOPNOTSUPP under
+         * unknown circumstances (detected when fuzzing).
+         */
+        if (errno == EOPNOTSUPP)
+            return(XML_ENC_ERR_INPUT);
+#endif
         return(XML_ENC_ERR_INTERNAL);
     }
     return(XML_ENC_ERR_SUCCESS);
 }
+
+static void
+xmlIconvFree(void *vctxt) {
+    xmlIconvCtxt *ctxt = vctxt;
+
+    if (ctxt == NULL)
+        return;
+
+    if (ctxt->cd != (iconv_t) -1)
+        iconv_close(ctxt->cd);
+
+    xmlFree(ctxt);
+}
+
+#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
+    defined(__GLIBC__)
+#include <libxml/parserInternals.h>
+
+static int
+xmlEncodingMatch(const char *name1, const char *name2) {
+    /*
+     * Fuzzy match for encoding names
+     */
+    while (1) {
+        while ((*name1 != 0) && (!IS_ASCII_LETTER(*name1)))
+            name1 += 1;
+        while ((*name2 != 0) && (!IS_ASCII_LETTER(*name2)))
+            name2 += 1;
+        if ((*name1 == 0) || (*name2 == 0))
+            break;
+        if ((*name1 | 0x20) != (*name2 | 0x20))
+            return(0);
+        name1 += 1;
+        name2 += 1;
+    }
+
+    return((*name1 == 0) && (*name2 == 0));
+}
+#endif /* FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION */
+
+static xmlParserErrors
+xmlCharEncIconv(const char *name, xmlCharEncFlags flags,
+                xmlCharEncodingHandler **out) {
+    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
+    xmlIconvCtxt *inputCtxt = NULL, *outputCtxt = NULL;
+    iconv_t icv_in;
+    iconv_t icv_out;
+    xmlParserErrors ret;
+
+    /*
+     * POSIX allows "indicator suffixes" like "//IGNORE" to be
+     * passed to iconv_open. This can change the behavior in
+     * unexpected ways.
+     *
+     * Many iconv implementations also support non-standard
+     * codesets like "wchar_t", "char" or the empty string "".
+     * It would make sense to disallow them, but codeset names
+     * are matched fuzzily, so a string like "w-C.hA_rt" could
+     * be interpreted as "wchar_t".
+     *
+     * When escaping characters that aren't supported in the
+     * target encoding, we also rely on GNU libiconv behavior to
+     * stop conversion without trying any kind of fallback.
+     * This violates the POSIX spec which says:
+     *
+     * > If iconv() encounters a character in the input buffer
+     * > that is valid, but for which an identical character does
+     * > not exist in the output codeset [...] iconv() shall
+     * > perform an implementation-defined conversion on the
+     * > character.
+     *
+     * See: https://sourceware.org/bugzilla/show_bug.cgi?id=29913
+     *
+     * Unfortunately, strict POSIX compliance makes it impossible
+     * to detect untranslatable characters.
+     */
+    if (strstr(name, "//") != NULL) {
+        ret = XML_ERR_UNSUPPORTED_ENCODING;
+        goto error;
+    }
+
+#if defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) && \
+    defined(__GLIBC__)
+    /*
+     * This glibc bug can lead to unpredictable results with the
+     * push parser.
+     *
+     * https://sourceware.org/bugzilla/show_bug.cgi?id=32633
+     */
+    if ((xmlEncodingMatch(name, "TSCII")) ||
+        (xmlEncodingMatch(name, "BIG5-HKSCS"))) {
+        ret = XML_ERR_UNSUPPORTED_ENCODING;
+        goto error;
+    }
+#endif
+
+    if (flags & XML_ENC_INPUT) {
+        inputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
+        if (inputCtxt == NULL) {
+            ret = XML_ERR_NO_MEMORY;
+            goto error;
+        }
+        inputCtxt->cd = (iconv_t) -1;
+
+        icv_in = iconv_open("UTF-8", name);
+        if (icv_in == (iconv_t) -1) {
+            if (errno == EINVAL)
+                ret = XML_ERR_UNSUPPORTED_ENCODING;
+            else if (errno == ENOMEM)
+                ret = XML_ERR_NO_MEMORY;
+            else
+                ret = XML_ERR_SYSTEM;
+            goto error;
+        }
+        inputCtxt->cd = icv_in;
+
+        inFunc = xmlIconvConvert;
+    }
+
+    if (flags & XML_ENC_OUTPUT) {
+        outputCtxt = xmlMalloc(sizeof(xmlIconvCtxt));
+        if (outputCtxt == NULL) {
+            ret = XML_ERR_NO_MEMORY;
+            goto error;
+        }
+        outputCtxt->cd = (iconv_t) -1;
+
+        icv_out = iconv_open(name, "UTF-8");
+        if (icv_out == (iconv_t) -1) {
+            if (errno == EINVAL)
+                ret = XML_ERR_UNSUPPORTED_ENCODING;
+            else if (errno == ENOMEM)
+                ret = XML_ERR_NO_MEMORY;
+            else
+                ret = XML_ERR_SYSTEM;
+            goto error;
+        }
+        outputCtxt->cd = icv_out;
+
+        outFunc = xmlIconvConvert;
+    }
+
+    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlIconvFree,
+                                      inputCtxt, outputCtxt, out));
+
+error:
+    if (inputCtxt != NULL)
+        xmlIconvFree(inputCtxt);
+    if (outputCtxt != NULL)
+        xmlIconvFree(outputCtxt);
+    return(ret);
+}
 #endif /* LIBXML_ICONV_ENABLED */
 
 /************************************************************************
@@ -2065,14 +1306,27 @@
  ************************************************************************/
 
 #ifdef LIBXML_ICU_ENABLED
+/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */
+#define ICU_PIVOT_BUF_SIZE 1024
+
+typedef struct _uconv_t xmlUconvCtxt;
+struct _uconv_t {
+  UConverter *uconv; /* for conversion between an encoding and UTF-16 */
+  UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
+  UChar      *pivot_source;
+  UChar      *pivot_target;
+  int        isInput;
+  UChar      pivot_buf[ICU_PIVOT_BUF_SIZE];
+};
+
 /**
- * xmlUconvWrapper:
- * @cd: ICU uconverter data structure
- * @toUnicode : non-zero if toUnicode. 0 otherwise.
+ * xmlUconvConvert:
+ * @vctxt:  conversion context
  * @out:  a pointer to an array of bytes to store the result
  * @outlen:  the length of @out
  * @in:  a pointer to an array of input bytes
  * @inlen:  the length of @in
+ * @flush:  end of input
  *
  * Returns an XML_ENC_ERR code.
  *
@@ -2080,55 +1334,177 @@
  *     as the return value is positive, else unpredictable.
  * The value of @outlen after return is the number of octets produced.
  */
-static int
-xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
-                const unsigned char *in, int *inlen) {
+static xmlCharEncError
+xmlUconvConvert(void *vctxt, unsigned char *out, int *outlen,
+                const unsigned char *in, int *inlen, int flush) {
+    xmlUconvCtxt *cd = vctxt;
     const char *ucv_in = (const char *) in;
     char *ucv_out = (char *) out;
+    UConverter *target, *source;
     UErrorCode err = U_ZERO_ERROR;
+    int ret;
 
     if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
-        if (outlen != NULL) *outlen = 0;
+        if (outlen != NULL)
+            *outlen = 0;
         return(XML_ENC_ERR_INTERNAL);
     }
 
     /*
-     * Note that the ICU API is stateful. It can always consume a certain
-     * amount of input even if the output buffer would overflow. The
-     * remaining input must be processed by calling ucnv_convertEx with a
-     * possibly empty input buffer.
-     *
-     * ucnv_convertEx is always called with reset and flush set to 0,
-     * so we don't mess up the state. This should never generate
-     * U_TRUNCATED_CHAR_FOUND errors.
-     *
-     * This also means that ICU xmlCharEncodingHandlers should never be
-     * reused. It would be a lot nicer if there was a way to emulate the
-     * stateless iconv API.
+     * The ICU API can consume input, including partial sequences,
+     * even if the output buffer would overflow. The remaining input
+     * must be processed by calling ucnv_convertEx with a possibly
+     * empty input buffer.
      */
-    if (toUnicode) {
-        /* encoding => UTF-16 => UTF-8 */
-        ucnv_convertEx(cd->utf8, cd->uconv, &ucv_out, ucv_out + *outlen,
-                       &ucv_in, ucv_in + *inlen, cd->pivot_buf,
-                       &cd->pivot_source, &cd->pivot_target,
-                       cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, 0, &err);
+    if (cd->isInput) {
+        source = cd->uconv;
+        target = cd->utf8;
     } else {
-        /* UTF-8 => UTF-16 => encoding */
-        ucnv_convertEx(cd->uconv, cd->utf8, &ucv_out, ucv_out + *outlen,
-                       &ucv_in, ucv_in + *inlen, cd->pivot_buf,
-                       &cd->pivot_source, &cd->pivot_target,
-                       cd->pivot_buf + ICU_PIVOT_BUF_SIZE, 0, 0, &err);
+        source = cd->utf8;
+        target = cd->uconv;
     }
+
+    ucnv_convertEx(target, source, &ucv_out, ucv_out + *outlen,
+                   &ucv_in, ucv_in + *inlen, cd->pivot_buf,
+                   &cd->pivot_source, &cd->pivot_target,
+                   cd->pivot_buf + ICU_PIVOT_BUF_SIZE,
+                   /* reset */ 0, flush, &err);
+
     *inlen = ucv_in - (const char*) in;
     *outlen = ucv_out - (char *) out;
+
     if (U_SUCCESS(err)) {
-        return(XML_ENC_ERR_SUCCESS);
+        ret = XML_ENC_ERR_SUCCESS;
+    } else {
+        switch (err) {
+            case U_TRUNCATED_CHAR_FOUND:
+                /* Should only happen with flush */
+                ret = XML_ENC_ERR_INPUT;
+                break;
+
+            case U_BUFFER_OVERFLOW_ERROR:
+                ret = XML_ENC_ERR_SPACE;
+                break;
+
+            case U_INVALID_CHAR_FOUND:
+            case U_ILLEGAL_CHAR_FOUND:
+            case U_ILLEGAL_ESCAPE_SEQUENCE:
+            case U_UNSUPPORTED_ESCAPE_SEQUENCE:
+                ret = XML_ENC_ERR_INPUT;
+                break;
+
+            case U_MEMORY_ALLOCATION_ERROR:
+                ret = XML_ENC_ERR_MEMORY;
+                break;
+
+            default:
+                ret = XML_ENC_ERR_INTERNAL;
+                break;
+        }
     }
-    if (err == U_BUFFER_OVERFLOW_ERROR)
-        return(XML_ENC_ERR_SPACE);
-    if (err == U_INVALID_CHAR_FOUND || err == U_ILLEGAL_CHAR_FOUND)
-        return(XML_ENC_ERR_INPUT);
-    return(XML_ENC_ERR_PARTIAL);
+
+    return(ret);
+}
+
+static xmlParserErrors
+openIcuConverter(const char* name, int isInput, xmlUconvCtxt **out)
+{
+    UErrorCode status;
+    xmlUconvCtxt *conv;
+
+    *out = NULL;
+
+    conv = (xmlUconvCtxt *) xmlMalloc(sizeof(xmlUconvCtxt));
+    if (conv == NULL)
+        return(XML_ERR_NO_MEMORY);
+
+    conv->isInput = isInput;
+    conv->pivot_source = conv->pivot_buf;
+    conv->pivot_target = conv->pivot_buf;
+
+    status = U_ZERO_ERROR;
+    conv->uconv = ucnv_open(name, &status);
+    if (U_FAILURE(status))
+        goto error;
+
+    status = U_ZERO_ERROR;
+    if (isInput) {
+        ucnv_setToUCallBack(conv->uconv, UCNV_TO_U_CALLBACK_STOP,
+                                                NULL, NULL, NULL, &status);
+    }
+    else {
+        ucnv_setFromUCallBack(conv->uconv, UCNV_FROM_U_CALLBACK_STOP,
+                                                NULL, NULL, NULL, &status);
+    }
+    if (U_FAILURE(status))
+        goto error;
+
+    status = U_ZERO_ERROR;
+    conv->utf8 = ucnv_open("UTF-8", &status);
+    if (U_FAILURE(status))
+        goto error;
+
+    *out = conv;
+    return(XML_ERR_OK);
+
+error:
+    if (conv->uconv)
+        ucnv_close(conv->uconv);
+    xmlFree(conv);
+
+    if (status == U_FILE_ACCESS_ERROR)
+        return(XML_ERR_UNSUPPORTED_ENCODING);
+    if (status == U_MEMORY_ALLOCATION_ERROR)
+        return(XML_ERR_NO_MEMORY);
+    return(XML_ERR_SYSTEM);
+}
+
+static void
+closeIcuConverter(xmlUconvCtxt *conv)
+{
+    if (conv == NULL)
+        return;
+    ucnv_close(conv->uconv);
+    ucnv_close(conv->utf8);
+    xmlFree(conv);
+}
+
+static void
+xmlUconvFree(void *vctxt) {
+    closeIcuConverter(vctxt);
+}
+
+static xmlParserErrors
+xmlCharEncUconv(const char *name, xmlCharEncFlags flags,
+                xmlCharEncodingHandler **out) {
+    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
+    xmlUconvCtxt *ucv_in = NULL;
+    xmlUconvCtxt *ucv_out = NULL;
+    int ret;
+
+    if (flags & XML_ENC_INPUT) {
+        ret = openIcuConverter(name, 1, &ucv_in);
+        if (ret != 0)
+            goto error;
+        inFunc = xmlUconvConvert;
+    }
+
+    if (flags & XML_ENC_OUTPUT) {
+        ret = openIcuConverter(name, 0, &ucv_out);
+        if (ret != 0)
+            goto error;
+        outFunc = xmlUconvConvert;
+    }
+
+    return(xmlCharEncNewCustomHandler(name, inFunc, outFunc, xmlUconvFree,
+                                      ucv_in, ucv_out, out));
+
+error:
+    if (ucv_in != NULL)
+        closeIcuConverter(ucv_in);
+    if (ucv_out != NULL)
+        closeIcuConverter(ucv_out);
+    return(ret);
 }
 #endif /* LIBXML_ICU_ENABLED */
 
@@ -2144,9 +1520,9 @@
  *
  * Convert XML_ENC_ERR to libxml2 error codes.
  */
-static int
-xmlEncConvertError(int code) {
-    int ret;
+static xmlParserErrors
+xmlEncConvertError(xmlCharEncError code) {
+    xmlParserErrors ret;
 
     switch (code) {
         case XML_ENC_ERR_SUCCESS:
@@ -2173,6 +1549,7 @@
  * @outlen:  the length of @out
  * @in:  a pointer to an array of input bytes
  * @inlen:  the length of @in
+ * @flush:  end of input
  *
  * The value of @inlen after return is the number of octets consumed
  *     as the return value is 0, else unpredictable.
@@ -2180,47 +1557,43 @@
  *
  * Returns an XML_ENC_ERR code.
  */
-int
+xmlCharEncError
 xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
-                 int *outlen, const unsigned char *in, int *inlen) {
-    int ret;
+                 int *outlen, const unsigned char *in, int *inlen,
+                 int flush) {
+    xmlCharEncError ret;
 
-    if (handler->input != NULL) {
-        int oldinlen = *inlen;
+    if (handler->flags & XML_HANDLER_LEGACY) {
+        xmlCharEncodingInputFunc func = handler->input.legacyFunc;
 
-        ret = handler->input(out, outlen, in, inlen);
-        if (ret >= 0) {
-            /*
-             * The built-in converters don't signal XML_ENC_ERR_SPACE.
-             */
-            if (*inlen < oldinlen) {
-                if (*outlen > 0)
-                    ret = XML_ENC_ERR_SPACE;
-                else
-                    ret = XML_ENC_ERR_PARTIAL;
-            } else {
-                ret = XML_ENC_ERR_SUCCESS;
-            }
+        if (func == NULL) {
+            *outlen = 0;
+            *inlen = 0;
+            return(XML_ENC_ERR_INTERNAL);
         }
-    }
-#ifdef LIBXML_ICONV_ENABLED
-    else if (handler->iconv_in != (iconv_t) -1) {
-        ret = xmlIconvWrapper(handler->iconv_in, out, outlen, in, inlen);
-    }
-#endif /* LIBXML_ICONV_ENABLED */
-#ifdef LIBXML_ICU_ENABLED
-    else if (handler->uconv_in != NULL) {
-        ret = xmlUconvWrapper(handler->uconv_in, 1, out, outlen, in, inlen);
-    }
-#endif /* LIBXML_ICU_ENABLED */
-    else {
-        *outlen = 0;
-        *inlen = 0;
-        ret = XML_ENC_ERR_INTERNAL;
+
+        ret = func(out, outlen, in, inlen);
+    } else {
+        xmlCharEncConvFunc func = handler->input.func;
+        int oldInlen;
+
+        if (func == NULL) {
+            *outlen = 0;
+            *inlen = 0;
+            return(XML_ENC_ERR_INTERNAL);
+        }
+
+        oldInlen = *inlen;
+        ret = func(handler->inputCtxt, out, outlen, in, inlen, flush);
+
+        /*
+         * Check for truncated multi-byte sequence.
+         */
+        if ((flush) && (ret == XML_ENC_ERR_SUCCESS) && (*inlen != oldInlen))
+            ret = XML_ENC_ERR_INPUT;
     }
 
-    /* Ignore partial errors when reading. */
-    if (ret == XML_ENC_ERR_PARTIAL)
+    if (ret > 0)
         ret = XML_ENC_ERR_SUCCESS;
 
     return(ret);
@@ -2240,48 +1613,35 @@
  *     as the return value is 0, else unpredictable.
  * The value of @outlen after return is the number of octets produced.
  */
-static int
+static xmlCharEncError
 xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
                   int *outlen, const unsigned char *in, int *inlen) {
-    int ret;
+    xmlCharEncError ret;
 
-    if (handler->output != NULL) {
-        int oldinlen = *inlen;
+    if (handler->flags & XML_HANDLER_LEGACY) {
+        xmlCharEncodingOutputFunc func = handler->output.legacyFunc;
 
-        ret = handler->output(out, outlen, in, inlen);
-        if (ret >= 0) {
-            /*
-             * The built-in converters don't signal XML_ENC_ERR_SPACE.
-             */
-            if (*inlen < oldinlen) {
-                if (*outlen > 0)
-                    ret = XML_ENC_ERR_SPACE;
-                else
-                    ret = XML_ENC_ERR_PARTIAL;
-            } else {
-                ret = XML_ENC_ERR_SUCCESS;
-            }
+        if (func == NULL) {
+            *outlen = 0;
+            *inlen = 0;
+            return(XML_ENC_ERR_INTERNAL);
         }
-    }
-#ifdef LIBXML_ICONV_ENABLED
-    else if (handler->iconv_out != (iconv_t) -1) {
-        ret = xmlIconvWrapper(handler->iconv_out, out, outlen, in, inlen);
-    }
-#endif /* LIBXML_ICONV_ENABLED */
-#ifdef LIBXML_ICU_ENABLED
-    else if (handler->uconv_out != NULL) {
-        ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen);
-    }
-#endif /* LIBXML_ICU_ENABLED */
-    else {
-        *outlen = 0;
-        *inlen = 0;
-        ret = XML_ENC_ERR_INTERNAL;
+
+        ret = func(out, outlen, in, inlen);
+    } else {
+        xmlCharEncConvFunc func = handler->output.func;
+
+        if (func == NULL) {
+            *outlen = 0;
+            *inlen = 0;
+            return(XML_ENC_ERR_INTERNAL);
+        }
+
+        ret = func(handler->outputCtxt, out, outlen, in, inlen, /* flush */ 0);
     }
 
-    /* We shouldn't generate partial sequences when writing. */
-    if (ret == XML_ENC_ERR_PARTIAL)
-        ret = XML_ENC_ERR_INTERNAL;
+    if (ret > 0)
+        ret = XML_ENC_ERR_SUCCESS;
 
     return(ret);
 }
@@ -2305,75 +1665,105 @@
 /**
  * xmlCharEncInput:
  * @input: a parser input buffer
+ * @sizeOut:  pointer to output size
+ * @flush:  end of input
+ *
+ * @sizeOut should be set to the maximum output size (or SIZE_MAX).
+ * After return, it is set to the number of bytes written.
  *
  * Generic front-end for the encoding handler on parser input
  *
- * Returns the number of bytes written or an XML_ENC_ERR code.
+ * Returns an XML_ENC_ERR code.
  */
-int
-xmlCharEncInput(xmlParserInputBufferPtr input)
+xmlCharEncError
+xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut, int flush)
 {
-    int ret;
-    size_t avail;
-    size_t toconv;
-    int c_in;
-    int c_out;
-    xmlBufPtr in;
-    xmlBufPtr out;
-    const xmlChar *inData;
-    size_t inTotal = 0;
+    xmlBufPtr out, in;
+    const xmlChar *dataIn;
+    size_t availIn;
+    size_t maxOut;
+    size_t totalIn, totalOut;
+    xmlCharEncError ret;
 
-    if ((input == NULL) || (input->encoder == NULL) ||
-        (input->buffer == NULL) || (input->raw == NULL))
-        return(XML_ENC_ERR_INTERNAL);
     out = input->buffer;
     in = input->raw;
 
-    toconv = xmlBufUse(in);
-    if (toconv == 0)
-        return (0);
-    inData = xmlBufContent(in);
-    inTotal = 0;
+    maxOut = *sizeOut;
+    totalOut = 0;
 
-    do {
-        c_in = toconv > INT_MAX / 2 ? INT_MAX / 2 : toconv;
+    *sizeOut = 0;
 
-        avail = xmlBufAvail(out);
-        if (avail > INT_MAX)
-            avail = INT_MAX;
-        if (avail < 4096) {
+    availIn = xmlBufUse(in);
+    if ((availIn == 0) && (!flush))
+        return(0);
+    dataIn = xmlBufContent(in);
+    totalIn = 0;
+
+    while (1) {
+        size_t availOut;
+        int completeOut, completeIn;
+        int c_out, c_in;
+
+        availOut = xmlBufAvail(out);
+        if (availOut > INT_MAX / 2)
+            availOut = INT_MAX / 2;
+
+        if (availOut < maxOut) {
+            c_out = availOut;
+            completeOut = 0;
+        } else {
+            c_out = maxOut;
+            completeOut = 1;
+        }
+
+        if (availIn > INT_MAX / 2) {
+            c_in = INT_MAX / 2;
+            completeIn = 0;
+        } else {
+            c_in = availIn;
+            completeIn = 1;
+        }
+
+        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
+                               dataIn, &c_in, flush && completeIn);
+
+        totalIn += c_in;
+        dataIn += c_in;
+        availIn -= c_in;
+
+        totalOut += c_out;
+        maxOut -= c_out;
+        xmlBufAddLen(out, c_out);
+
+        if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE)) {
+            input->error = xmlEncConvertError(ret);
+            return(ret);
+        }
+
+        if ((completeOut) && (completeIn))
+            break;
+        if ((completeOut) && (ret == XML_ENC_ERR_SPACE))
+            break;
+        if ((completeIn) && (ret == XML_ENC_ERR_SUCCESS))
+            break;
+
+        if (ret == XML_ENC_ERR_SPACE) {
             if (xmlBufGrow(out, 4096) < 0) {
                 input->error = XML_ERR_NO_MEMORY;
                 return(XML_ENC_ERR_MEMORY);
             }
-            avail = xmlBufAvail(out);
         }
-
-        c_in = toconv;
-        c_out = avail;
-        ret = xmlEncInputChunk(input->encoder, xmlBufEnd(out), &c_out,
-                               inData, &c_in);
-        inTotal += c_in;
-        inData += c_in;
-        toconv -= c_in;
-        xmlBufAddLen(out, c_out);
-    } while (ret == XML_ENC_ERR_SPACE);
-
-    xmlBufShrink(in, inTotal);
-
-    if (input->rawconsumed > ULONG_MAX - (unsigned long)c_in)
-        input->rawconsumed = ULONG_MAX;
-    else
-        input->rawconsumed += c_in;
-
-    if (((ret != 0) && (c_out == 0)) ||
-        (ret == XML_ENC_ERR_MEMORY)) {
-        if (input->error == 0)
-            input->error = xmlEncConvertError(ret);
-        return(ret);
     }
 
-    return (c_out);
+    xmlBufShrink(in, totalIn);
+
+    if (input->rawconsumed > ULONG_MAX - (unsigned long) totalIn)
+        input->rawconsumed = ULONG_MAX;
+    else
+        input->rawconsumed += totalIn;
+
+    *sizeOut = totalOut;
+    return(XML_ENC_ERR_SUCCESS);
 }
 
 /**
@@ -2410,7 +1800,7 @@
         written = out->size - out->use - 1;
     }
     ret = xmlEncInputChunk(handler, &out->content[out->use], &written,
-                           in->content, &toconv);
+                           in->content, &toconv, /* flush */ 0);
     xmlBufferShrink(in, toconv);
     out->use += written;
     out->content[out->use] = 0;
@@ -2513,8 +1903,7 @@
          * and continue the transcoding phase, hoping the error
          * did not mangle the encoder state.
          */
-        charrefLen = snprintf((char *) &charref[0], sizeof(charref),
-                         "&#%d;", cur);
+        charrefLen = xmlSerializeDecCharRef((char *) charref, cur);
         xmlBufGrow(out, charrefLen * 4);
         c_out = xmlBufAvail(out);
         c_in = charrefLen;
@@ -2625,8 +2014,7 @@
          * and continue the transcoding phase, hoping the error
          * did not mangle the encoder state.
          */
-        charrefLen = snprintf((char *) &charref[0], sizeof(charref),
-                         "&#%d;", cur);
+        charrefLen = xmlSerializeDecCharRef((char *) charref, cur);
         xmlBufferShrink(in, len);
         xmlBufferGrow(out, charrefLen * 4);
         written = out->size - out->use - 1;
@@ -2648,76 +2036,34 @@
  * xmlCharEncCloseFunc:
  * @handler:	char encoding transformation data structure
  *
- * Generic front-end for encoding handler close function
+ * Releases an xmlCharEncodingHandler. Must be called after
+ * a handler is no longer in use.
  *
- * Returns 0 if success, or -1 in case of error
+ * Returns 0.
  */
 int
 xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
-    int ret = 0;
-    int tofree = 0;
-    int i = 0;
+    if (handler == NULL)
+        return(0);
 
-    if (handler == NULL) return(-1);
+    if (handler->flags & XML_HANDLER_STATIC)
+        return(0);
 
-    for (i = 0; i < (int) NUM_DEFAULT_HANDLERS; i++) {
-        if (handler == &defaultHandlers[i])
-            return(0);
+    xmlFree(handler->name);
+    if (handler->ctxtDtor != NULL) {
+        handler->ctxtDtor(handler->inputCtxt);
+        handler->ctxtDtor(handler->outputCtxt);
     }
-
-    if (handlers != NULL) {
-        for (i = 0;i < nbCharEncodingHandler; i++) {
-            if (handler == handlers[i])
-                return(0);
-	}
-    }
-#ifdef LIBXML_ICONV_ENABLED
-    /*
-     * Iconv handlers can be used only once, free the whole block.
-     * and the associated icon resources.
-     */
-    if ((handler->iconv_out != (iconv_t) -1) || (handler->iconv_in != (iconv_t) -1)) {
-        tofree = 1;
-	if (handler->iconv_out != (iconv_t) -1) {
-	    if (iconv_close(handler->iconv_out))
-		ret = -1;
-	    handler->iconv_out = (iconv_t) -1;
-	}
-	if (handler->iconv_in != (iconv_t) -1) {
-	    if (iconv_close(handler->iconv_in))
-		ret = -1;
-	    handler->iconv_in = (iconv_t) -1;
-	}
-    }
-#endif /* LIBXML_ICONV_ENABLED */
-#ifdef LIBXML_ICU_ENABLED
-    if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) {
-        tofree = 1;
-	if (handler->uconv_out != NULL) {
-	    closeIcuConverter(handler->uconv_out);
-	    handler->uconv_out = NULL;
-	}
-	if (handler->uconv_in != NULL) {
-	    closeIcuConverter(handler->uconv_in);
-	    handler->uconv_in = NULL;
-	}
-    }
-#endif
-    if (tofree) {
-        /* free up only dynamic handlers iconv/uconv */
-        if (handler->name != NULL)
-            xmlFree(handler->name);
-        handler->name = NULL;
-        xmlFree(handler);
-    }
-
-    return(ret);
+    xmlFree(handler);
+    return(0);
 }
 
 /**
  * xmlByteConsumed:
  * @ctxt: an XML parser context
  *
+ * DEPRECATED: Don't use.
+ *
  * This function provides the current index of the parser relative
  * to the start of the current entity. This function is computed in
  * bytes from the beginning starting at zero and finishing at the
@@ -2732,1095 +2078,792 @@
 xmlByteConsumed(xmlParserCtxtPtr ctxt) {
     xmlParserInputPtr in;
 
-    if (ctxt == NULL) return(-1);
+    if (ctxt == NULL)
+        return(-1);
     in = ctxt->input;
-    if (in == NULL)  return(-1);
+    if (in == NULL)
+        return(-1);
+
     if ((in->buf != NULL) && (in->buf->encoder != NULL)) {
-        unsigned int unused = 0;
+        int unused = 0;
 	xmlCharEncodingHandler * handler = in->buf->encoder;
+
         /*
 	 * Encoding conversion, compute the number of unused original
 	 * bytes from the input not consumed and subtract that from
 	 * the raw consumed value, this is not a cheap operation
 	 */
         if (in->end - in->cur > 0) {
-	    unsigned char convbuf[32000];
+	    unsigned char *convbuf;
 	    const unsigned char *cur = (const unsigned char *)in->cur;
-	    int toconv = in->end - in->cur, written = 32000;
+	    int toconv, ret;
 
-	    int ret;
+            convbuf = xmlMalloc(32000);
+            if (convbuf == NULL)
+                return(-1);
 
-            do {
-                toconv = in->end - cur;
-                written = 32000;
-                ret = xmlEncOutputChunk(handler, &convbuf[0], &written,
-                                        cur, &toconv);
-                if ((ret != XML_ENC_ERR_SUCCESS) && (ret != XML_ENC_ERR_SPACE))
-                    return(-1);
-                unused += written;
-                cur += toconv;
-            } while (ret == XML_ENC_ERR_SPACE);
+            toconv = in->end - cur;
+            unused = 32000;
+            ret = xmlEncOutputChunk(handler, convbuf, &unused, cur, &toconv);
+
+            xmlFree(convbuf);
+
+            if (ret != XML_ENC_ERR_SUCCESS)
+                return(-1);
 	}
-	if (in->buf->rawconsumed < unused)
+
+	if (in->buf->rawconsumed < (unsigned long) unused)
 	    return(-1);
 	return(in->buf->rawconsumed - unused);
     }
+
     return(in->consumed + (in->cur - in->base));
 }
 
-#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED)
-#ifdef LIBXML_ISO8859X_ENABLED
+/************************************************************************
+ *									*
+ *		Conversions To/From UTF8 encoding			*
+ *									*
+ ************************************************************************/
+
+static xmlCharEncError
+asciiToAscii(void *vctxt ATTRIBUTE_UNUSED,
+             unsigned char* out, int *poutlen,
+             const unsigned char* in, int *pinlen,
+             int flush ATTRIBUTE_UNUSED) {
+    const unsigned char *inend;
+    const unsigned char *instart = in;
+    int inlen, outlen, ret;
+
+    if (in == NULL) {
+        *pinlen = 0;
+        *poutlen = 0;
+        return(XML_ENC_ERR_SUCCESS);
+    }
+
+    inlen = *pinlen;
+    outlen = *poutlen;
+
+    if (outlen < inlen) {
+        inlen = outlen;
+        ret = XML_ENC_ERR_SPACE;
+    } else {
+        ret = inlen;
+    }
+
+    inend = in + inlen;
+    *poutlen = inlen;
+    *pinlen = inlen;
+
+    while (in < inend) {
+	unsigned c = *in;
+
+        if (c >= 0x80) {
+	    *poutlen = in - instart;
+	    *pinlen = in - instart;
+	    return(XML_ENC_ERR_INPUT);
+	}
+
+        in++;
+	*out++ = c;
+    }
+
+    return(ret);
+}
+
+static xmlCharEncError
+latin1ToUTF8(void *vctxt ATTRIBUTE_UNUSED,
+             unsigned char* out, int *outlen,
+             const unsigned char* in, int *inlen,
+             int flush ATTRIBUTE_UNUSED) {
+    unsigned char* outstart = out;
+    const unsigned char* instart = in;
+    unsigned char* outend;
+    const unsigned char* inend;
+    int ret = XML_ENC_ERR_SPACE;
+
+    if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
+	return(XML_ENC_ERR_INTERNAL);
+
+    outend = out + *outlen;
+    inend = in + *inlen;
+
+    while (in < inend) {
+        unsigned c = *in;
+
+	if (c < 0x80) {
+            if (out >= outend)
+                goto done;
+            *out++ = c;
+	} else {
+            if (outend - out < 2)
+                goto done;
+	    *out++ = (c >> 6) | 0xC0;
+            *out++ = (c & 0x3F) | 0x80;
+        }
+
+        in++;
+    }
+
+    ret = out - outstart;
+
+done:
+    *outlen = out - outstart;
+    *inlen = in - instart;
+    return(ret);
+}
 
 /**
- * UTF8ToISO8859x:
+ * xmlIsolat1ToUTF8:
  * @out:  a pointer to an array of bytes to store the result
  * @outlen:  the length of @out
- * @in:  a pointer to an array of UTF-8 chars
+ * @in:  a pointer to an array of ISO Latin 1 chars
  * @inlen:  the length of @in
- * @xlattable: the 2-level transcoding table
  *
- * Take a block of UTF-8 chars in and try to convert it to an ISO 8859-*
+ * 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 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.
- * The value of @outlen 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.
  */
-static int
-UTF8ToISO8859x(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen,
-              const unsigned char* const xlattable) {
-    const unsigned char* outstart = out;
-    const unsigned char* inend;
-    const unsigned char* instart = in;
-    const unsigned char* processed = in;
+int
+xmlIsolat1ToUTF8(unsigned char* out, int *outlen,
+                 const unsigned char* in, int *inlen) {
+    return(latin1ToUTF8(/* ctxt */ NULL, out, outlen, in, inlen,
+                        /* flush */ 0));
+}
 
-    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
-        (xlattable == NULL))
-	return(XML_ENC_ERR_INTERNAL);
+static xmlCharEncError
+UTF8ToUTF8(void *vctxt ATTRIBUTE_UNUSED,
+           unsigned char* out, int *outlen,
+           const unsigned char* in, int *inlen,
+           int flush ATTRIBUTE_UNUSED) {
+    int len;
+    int ret;
+
+    if (in == NULL) {
+        *inlen = 0;
+        *outlen = 0;
+        return(XML_ENC_ERR_SUCCESS);
+    }
+
+    if (*outlen < *inlen) {
+	len = *outlen;
+        ret = XML_ENC_ERR_SPACE;
+    } else {
+	len = *inlen;
+        ret = len;
+    }
+
+    memcpy(out, in, len);
+
+    *outlen = len;
+    *inlen = len;
+    return(ret);
+}
+
+
+#ifdef LIBXML_OUTPUT_ENABLED
+static xmlCharEncError
+UTF8ToLatin1(void *vctxt ATTRIBUTE_UNUSED,
+             unsigned char* out, int *outlen,
+             const unsigned char* in, int *inlen,
+             int flush ATTRIBUTE_UNUSED) {
+    const unsigned char* outend;
+    const unsigned char* outstart = out;
+    const unsigned char* instart = in;
+    const unsigned char* inend;
+    unsigned c;
+    int ret = XML_ENC_ERR_SPACE;
+
+    if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
+        return(XML_ENC_ERR_INTERNAL);
+
+    if (in == NULL) {
+        *inlen = 0;
+        *outlen = 0;
+        return(XML_ENC_ERR_SUCCESS);
+    }
+
+    inend = in + *inlen;
+    outend = out + *outlen;
+    while (in < inend) {
+        if (out >= outend)
+            goto done;
+
+	c = *in;
+
+        if (c < 0x80) {
+            *out++ = c;
+        } else if ((c >= 0xC2) && (c <= 0xC3)) {
+            if (inend - in < 2)
+                break;
+            in++;
+            *out++ = (unsigned char) ((c << 6) | (*in & 0x3F));
+        } else {
+            ret = XML_ENC_ERR_INPUT;
+            goto done;
+	}
+
+        in++;
+    }
+
+    ret = out - outstart;
+
+done:
+    *outlen = out - outstart;
+    *inlen = in - instart;
+    return(ret);
+}
+
+/**
+ * xmlUTF8ToIsolat1:
+ * @out:  a pointer to an array of bytes to store the result
+ * @outlen:  the length of @out
+ * @in:  a pointer to an array of UTF-8 chars
+ * @inlen:  the length of @in
+ *
+ * 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 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.
+ */
+int
+xmlUTF8ToIsolat1(unsigned char* out, int *outlen,
+              const unsigned char* in, int *inlen) {
+    if ((out == NULL) || (outlen == NULL) || (in == NULL) || (inlen == NULL))
+        return(XML_ENC_ERR_INTERNAL);
+
+    return(UTF8ToLatin1(/* ctxt */ NULL, out, outlen, in, inlen,
+                        /* flush */ 0));
+}
+#endif /* LIBXML_OUTPUT_ENABLED */
+
+static xmlCharEncError
+UTF16LEToUTF8(void *vctxt ATTRIBUTE_UNUSED,
+              unsigned char *out, int *outlen,
+              const unsigned char *in, int *inlen,
+              int flush ATTRIBUTE_UNUSED) {
+    const unsigned char *instart = in;
+    const unsigned char *inend = in + (*inlen & ~1);
+    unsigned char *outstart = out;
+    unsigned char *outend = out + *outlen;
+    unsigned c, d;
+    int ret = XML_ENC_ERR_SPACE;
+
+    while (in < inend) {
+        c = in[0] | (in[1] << 8);
+
+        if (c < 0x80) {
+            if (out >= outend)
+                goto done;
+            out[0] = c;
+            in += 2;
+            out += 1;
+        } else if (c < 0x800) {
+            if (outend - out < 2)
+                goto done;
+            out[0] = (c >> 6)   | 0xC0;
+            out[1] = (c & 0x3F) | 0x80;
+            in += 2;
+            out += 2;
+        } else if ((c & 0xF800) != 0xD800) {
+            if (outend - out < 3)
+                goto done;
+            out[0] =  (c >> 12)         | 0xE0;
+            out[1] = ((c >>  6) & 0x3F) | 0x80;
+            out[2] =  (c        & 0x3F) | 0x80;
+            in += 2;
+            out += 3;
+        } else {
+            /* Surrogate pair */
+            if ((c & 0xFC00) != 0xD800) {
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
+            }
+	    if (inend - in < 4)
+		break;
+            d = in[2] | (in[3] << 8);
+            if ((d & 0xFC00) != 0xDC00) {
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
+            }
+	    if (outend - out < 4)
+		goto done;
+            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
+            out[0] =  (c >> 18)         | 0xF0;
+            out[1] = ((c >> 12) & 0x3F) | 0x80;
+            out[2] = ((c >>  6) & 0x3F) | 0x80;
+            out[3] =  (c        & 0x3F) | 0x80;
+            in += 4;
+            out += 4;
+        }
+    }
+
+    ret = out - outstart;
+
+done:
+    *outlen = out - outstart;
+    *inlen = in - instart;
+    return(ret);
+}
+
+#ifdef LIBXML_OUTPUT_ENABLED
+static xmlCharEncError
+UTF8ToUTF16LE(void *vctxt ATTRIBUTE_UNUSED,
+              unsigned char *out, int *outlen,
+              const unsigned char *in, int *inlen,
+              int flush ATTRIBUTE_UNUSED) {
+    const unsigned char *instart = in;
+    const unsigned char *inend;
+    unsigned char *outstart = out;
+    unsigned char *outend;
+    unsigned c, d;
+    int ret = XML_ENC_ERR_SPACE;
+
+    /* UTF16LE encoding has no BOM */
+    if ((out == NULL) || (outlen == NULL) || (inlen == NULL))
+        return(XML_ENC_ERR_INTERNAL);
+    if (in == NULL) {
+	*outlen = 0;
+	*inlen = 0;
+	return(0);
+    }
+    inend = in + *inlen;
+    outend = out + (*outlen & ~1);
+    while (in < inend) {
+        c = in[0];
+
+        if (c < 0x80) {
+            if (out >= outend)
+                goto done;
+            out[0] = c;
+            out[1] = 0;
+            in += 1;
+            out += 2;
+        } else {
+            int i, len;
+            unsigned min;
+
+            if (c < 0xE0) {
+                if (c < 0xC2) {
+                    ret = XML_ENC_ERR_INPUT;
+                    goto done;
+                }
+                c &= 0x1F;
+                len = 2;
+                min = 0x80;
+            } else if (c < 0xF0) {
+                c &= 0x0F;
+                len = 3;
+                min = 0x800;
+            } else {
+                c &= 0x0F;
+                len = 4;
+                min = 0x10000;
+            }
+
+            if (inend - in < len)
+                break;
+
+            for (i = 1; i < len; i++) {
+                if ((in[i] & 0xC0) != 0x80) {
+                    ret = XML_ENC_ERR_INPUT;
+                    goto done;
+                }
+                c = (c << 6) | (in[i] & 0x3F);
+            }
+
+            if ((c < min) ||
+                ((c >= 0xD800) && (c <= 0xDFFF)) ||
+                (c > 0x10FFFF)) {
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
+            }
+
+            if (c < 0x10000) {
+                if (out >= outend)
+                    goto done;
+                out[0] = c & 0xFF;
+                out[1] = c >> 8;
+                out += 2;
+            } else {
+                if (outend - out < 4)
+                    goto done;
+                c -= 0x10000;
+                d = (c & 0x03FF) | 0xDC00;
+                c = (c >> 10)    | 0xD800;
+                out[0] = c & 0xFF;
+                out[1] = c >> 8;
+                out[2] = d & 0xFF;
+                out[3] = d >> 8;
+                out += 4;
+            }
+
+            in += len;
+        }
+    }
+
+    ret = out - outstart;
+
+done:
+    *outlen = out - outstart;
+    *inlen = in - instart;
+    return(ret);
+}
+
+static xmlCharEncError
+UTF8ToUTF16(void *vctxt,
+            unsigned char* outb, int *outlen,
+            const unsigned char* in, int *inlen,
+            int flush) {
+    if (in == NULL) {
+	/*
+	 * initialization, add the Byte Order Mark for UTF-16LE
+	 */
+        if (*outlen >= 2) {
+	    outb[0] = 0xFF;
+	    outb[1] = 0xFE;
+	    *outlen = 2;
+	    *inlen = 0;
+	    return(2);
+	}
+	*outlen = 0;
+	*inlen = 0;
+	return(0);
+    }
+    return (UTF8ToUTF16LE(vctxt, outb, outlen, in, inlen, flush));
+}
+#endif /* LIBXML_OUTPUT_ENABLED */
+
+static xmlCharEncError
+UTF16BEToUTF8(void *vctxt ATTRIBUTE_UNUSED,
+              unsigned char *out, int *outlen,
+              const unsigned char *in, int *inlen,
+              int flush ATTRIBUTE_UNUSED) {
+    const unsigned char *instart = in;
+    const unsigned char *inend = in + (*inlen & ~1);
+    unsigned char *outstart = out;
+    unsigned char *outend = out + *outlen;
+    unsigned c, d;
+    int ret = XML_ENC_ERR_SPACE;
+
+    while (in < inend) {
+        c = (in[0] << 8) | in[1];
+
+        if (c < 0x80) {
+            if (out >= outend)
+                goto done;
+            out[0] = c;
+            in += 2;
+            out += 1;
+        } else if (c < 0x800) {
+            if (outend - out < 2)
+                goto done;
+            out[0] = (c >> 6)   | 0xC0;
+            out[1] = (c & 0x3F) | 0x80;
+            in += 2;
+            out += 2;
+        } else if ((c & 0xF800) != 0xD800) {
+            if (outend - out < 3)
+                goto done;
+            out[0] =  (c >> 12)         | 0xE0;
+            out[1] = ((c >>  6) & 0x3F) | 0x80;
+            out[2] =  (c        & 0x3F) | 0x80;
+            in += 2;
+            out += 3;
+        } else {
+            /* Surrogate pair */
+            if ((c & 0xFC00) != 0xD800) {
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
+            }
+	    if (inend - in < 4)
+		break;
+            d = (in[2] << 8) | in[3];
+            if ((d & 0xFC00) != 0xDC00) {
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
+            }
+	    if (outend - out < 4)
+		goto done;
+            c = (c << 10) + d - ((0xD800 << 10) + 0xDC00 - 0x10000);
+            out[0] =  (c >> 18)         | 0xF0;
+            out[1] = ((c >> 12) & 0x3F) | 0x80;
+            out[2] = ((c >>  6) & 0x3F) | 0x80;
+            out[3] =  (c        & 0x3F) | 0x80;
+            in += 4;
+            out += 4;
+        }
+    }
+
+    ret = out - outstart;
+
+done:
+    *outlen = out - outstart;
+    *inlen = in - instart;
+    return(ret);
+}
+
+#ifdef LIBXML_OUTPUT_ENABLED
+static xmlCharEncError
+UTF8ToUTF16BE(void *vctxt ATTRIBUTE_UNUSED,
+              unsigned char *out, int *outlen,
+              const unsigned char *in, int *inlen,
+              int flush ATTRIBUTE_UNUSED) {
+    const unsigned char *instart = in;
+    const unsigned char *inend;
+    unsigned char *outstart = out;
+    unsigned char *outend;
+    unsigned c, d;
+    int ret = XML_ENC_ERR_SPACE;
+
+    /* UTF-16BE has no BOM */
+    if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
+    if (in == NULL) {
+	*outlen = 0;
+	*inlen = 0;
+	return(0);
+    }
+    inend = in + *inlen;
+    outend = out + (*outlen & ~1);
+    while (in < inend) {
+        c = in[0];
+
+        if (c < 0x80) {
+            if (out >= outend)
+                goto done;
+            out[0] = 0;
+            out[1] = c;
+            in += 1;
+            out += 2;
+        } else {
+            int i, len;
+            unsigned min;
+
+            if (c < 0xE0) {
+                if (c < 0xC2) {
+                    ret = XML_ENC_ERR_INPUT;
+                    goto done;
+                }
+                c &= 0x1F;
+                len = 2;
+                min = 0x80;
+            } else if (c < 0xF0) {
+                c &= 0x0F;
+                len = 3;
+                min = 0x800;
+            } else {
+                c &= 0x0F;
+                len = 4;
+                min = 0x10000;
+            }
+
+            if (inend - in < len)
+                break;
+
+            for (i = 1; i < len; i++) {
+                if ((in[i] & 0xC0) != 0x80) {
+                    ret = XML_ENC_ERR_INPUT;
+                    goto done;
+                }
+                c = (c << 6) | (in[i] & 0x3F);
+            }
+
+            if ((c < min) ||
+                ((c >= 0xD800) && (c <= 0xDFFF)) ||
+                (c > 0x10FFFF)) {
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
+            }
+
+            if (c < 0x10000) {
+                if (out >= outend)
+                    goto done;
+                out[0] = c >> 8;
+                out[1] = c & 0xFF;
+                out += 2;
+            } else {
+                if (outend - out < 4)
+                    goto done;
+                c -= 0x10000;
+                d = (c & 0x03FF) | 0xDC00;
+                c = (c >> 10)    | 0xD800;
+                out[0] = c >> 8;
+                out[1] = c & 0xFF;
+                out[2] = d >> 8;
+                out[3] = d & 0xFF;
+                out += 4;
+            }
+
+            in += len;
+        }
+    }
+
+    ret = out - outstart;
+
+done:
+    *outlen = out - outstart;
+    *inlen = in - instart;
+    return(ret);
+}
+#endif /* LIBXML_OUTPUT_ENABLED */
+
+#if defined(LIBXML_OUTPUT_ENABLED) && defined(LIBXML_HTML_ENABLED)
+static xmlCharEncError
+UTF8ToHtmlWrapper(void *vctxt ATTRIBUTE_UNUSED,
+                  unsigned char *out, int *outlen,
+                  const unsigned char *in, int *inlen,
+                  int flush ATTRIBUTE_UNUSED) {
+    return(htmlUTF8ToHtml(out, outlen, in, inlen));
+}
+#endif
+
+#if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) && \
+    defined(LIBXML_ISO8859X_ENABLED)
+
+static xmlCharEncError
+UTF8ToISO8859x(void *vctxt,
+               unsigned char *out, int *outlen,
+               const unsigned char *in, int *inlen,
+               int flush ATTRIBUTE_UNUSED) {
+    const unsigned char *xlattable = vctxt;
+    const unsigned char *instart = in;
+    const unsigned char *inend;
+    unsigned char *outstart = out;
+    unsigned char *outend;
+    int ret = XML_ENC_ERR_SPACE;
+
     if (in == NULL) {
         /*
         * initialization nothing to do
         */
         *outlen = 0;
         *inlen = 0;
-        return(0);
+        return(XML_ENC_ERR_SUCCESS);
     }
-    inend = in + (*inlen);
+
+    inend = in + *inlen;
+    outend = out + *outlen;
     while (in < inend) {
-        unsigned char d = *in++;
+        unsigned d = *in;
+
         if  (d < 0x80)  {
-            *out++ = d;
-        } else if (d < 0xC0) {
-            /* trailing byte in leading position */
-            *outlen = out - outstart;
-            *inlen = processed - instart;
-            return(XML_ENC_ERR_INPUT);
+            if (out >= outend)
+                goto done;
+            in += 1;
         } else if (d < 0xE0) {
-            unsigned char c;
-            if (!(in < inend)) {
-                /* trailing byte not in input buffer */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_PARTIAL);
-            }
-            c = *in++;
-            if ((c & 0xC0) != 0x80) {
-                /* not a trailing byte */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_INPUT);
-            }
-            c = c & 0x3F;
+            unsigned c;
+
+            if (inend - in < 2)
+                break;
+            c = in[1] & 0x3F;
             d = d & 0x1F;
             d = xlattable [48 + c + xlattable [d] * 64];
             if (d == 0) {
                 /* not in character set */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_INPUT);
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
             }
-            *out++ = d;
+            if (out >= outend)
+                goto done;
+            in += 2;
         } else if (d < 0xF0) {
-            unsigned char c1;
-            unsigned char c2;
-            if (!(in < inend - 1)) {
-                /* trailing bytes not in input buffer */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_PARTIAL);
-            }
-            c1 = *in++;
-            if ((c1 & 0xC0) != 0x80) {
-                /* not a trailing byte (c1) */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_INPUT);
-            }
-            c2 = *in++;
-            if ((c2 & 0xC0) != 0x80) {
-                /* not a trailing byte (c2) */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_INPUT);
-            }
-            c1 = c1 & 0x3F;
-            c2 = c2 & 0x3F;
+            unsigned c1;
+            unsigned c2;
+
+            if (inend - in < 3)
+                break;
+            c1 = in[1] & 0x3F;
+            c2 = in[2] & 0x3F;
 	    d = d & 0x0F;
 	    d = xlattable [48 + c2 + xlattable [48 + c1 +
 			xlattable [32 + d] * 64] * 64];
             if (d == 0) {
                 /* not in character set */
-                *outlen = out - outstart;
-                *inlen = processed - instart;
-                return(XML_ENC_ERR_INPUT);
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
             }
-            *out++ = d;
+            if (out >= outend)
+                goto done;
+            in += 3;
         } else {
             /* cannot transcode >= U+010000 */
-            *outlen = out - outstart;
-            *inlen = processed - instart;
-            return(XML_ENC_ERR_INPUT);
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
         }
-        processed = in;
+
+        *out++ = d;
     }
+
+    ret = out - outstart;
+
+done:
     *outlen = out - outstart;
-    *inlen = processed - instart;
-    return(*outlen);
+    *inlen = in - instart;
+    return(ret);
 }
 
-/**
- * ISO8859xToUTF8
- * @out:  a pointer to an array of bytes to store the result
- * @outlen:  the length of @out
- * @in:  a pointer to an array of ISO Latin 1 chars
- * @inlen:  the length of @in
- *
- * Take a block of ISO 8859-* chars in and try to convert it to an UTF-8
- * block of chars out.
- *
- * 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.
- */
-static int
-ISO8859xToUTF8(unsigned char* out, int *outlen,
-              const unsigned char* in, int *inlen,
-              unsigned short const *unicodetable) {
-    unsigned char* outstart = out;
-    unsigned char* outend;
+static xmlCharEncError
+ISO8859xToUTF8(void *vctxt,
+               unsigned char* out, int *outlen,
+               const unsigned char* in, int *inlen,
+               int flush ATTRIBUTE_UNUSED) {
+    unsigned short const *unicodetable = vctxt;
     const unsigned char* instart = in;
     const unsigned char* inend;
-    const unsigned char* instop;
-    unsigned int c;
+    unsigned char* outstart = out;
+    unsigned char* outend;
+    int ret = XML_ENC_ERR_SPACE;
 
-    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
-        (in == NULL) || (unicodetable == NULL))
-	return(XML_ENC_ERR_INTERNAL);
     outend = out + *outlen;
     inend = in + *inlen;
-    instop = inend;
 
-    while ((in < inend) && (out < outend - 2)) {
-        if (*in >= 0x80) {
-            c = unicodetable [*in - 0x80];
+    while (in < inend) {
+        unsigned c = *in;
+
+        if (c < 0x80) {
+            if (out >= outend)
+                goto done;
+            *out++ = c;
+        } else {
+            c = unicodetable[c - 0x80];
             if (c == 0) {
                 /* undefined code point */
-                *outlen = out - outstart;
-                *inlen = in - instart;
-                return(XML_ENC_ERR_INPUT);
+                ret = XML_ENC_ERR_INPUT;
+                goto done;
             }
             if (c < 0x800) {
+                if (outend - out < 2)
+                    goto done;
                 *out++ = ((c >>  6) & 0x1F) | 0xC0;
                 *out++ = (c & 0x3F) | 0x80;
             } else {
+                if (outend - out < 3)
+                    goto done;
                 *out++ = ((c >>  12) & 0x0F) | 0xE0;
                 *out++ = ((c >>  6) & 0x3F) | 0x80;
                 *out++ = (c & 0x3F) | 0x80;
             }
-            ++in;
         }
-        if (instop - in > outend - out) instop = in + (outend - out);
-        while ((*in < 0x80) && (in < instop)) {
-            *out++ = *in++;
-        }
+
+        in += 1;
     }
-    if ((in < inend) && (out < outend) && (*in < 0x80)) {
-        *out++ =  *in++;
-    }
-    if ((in < inend) && (out < outend) && (*in < 0x80)) {
-        *out++ =  *in++;
-    }
+
+    ret = out - outstart;
+
+done:
     *outlen = out - outstart;
     *inlen = in - instart;
-    return (*outlen);
+    return(ret);
 }
 
-
-/************************************************************************
- * Lookup tables for ISO-8859-2..ISO-8859-16 transcoding                *
- ************************************************************************/
-
-static const unsigned short xmlunicodetable_ISO8859_2 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7,
-    0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b,
-    0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7,
-    0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c,
-    0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7,
-    0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e,
-    0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7,
-    0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df,
-    0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7,
-    0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f,
-    0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7,
-    0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_2 [48 + 6 * 64] = {
-    "\x00\x00\x01\x05\x02\x04\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\xa4\x00\x00\xa7\xa8\x00\x00\x00\x00\xad\x00\x00"
-    "\xb0\x00\x00\x00\xb4\x00\x00\x00\xb8\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\xc3\xe3\xa1\xb1\xc6\xe6\x00\x00\x00\x00\xc8\xe8\xcf\xef"
-    "\xd0\xf0\x00\x00\x00\x00\x00\x00\xca\xea\xcc\xec\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc5\xe5\x00\x00\xa5\xb5\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xff\x00\xb2\x00\xbd\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\xa3\xb3\xd1\xf1\x00\x00\xd2\xf2\x00\x00\x00\x00\x00\x00\x00"
-    "\xd5\xf5\x00\x00\xc0\xe0\x00\x00\xd8\xf8\xa6\xb6\x00\x00\xaa\xba"
-    "\xa9\xb9\xde\xfe\xab\xbb\x00\x00\x00\x00\x00\x00\x00\x00\xd9\xf9"
-    "\xdb\xfb\x00\x00\x00\x00\x00\x00\x00\xac\xbc\xaf\xbf\xae\xbe\x00"
-    "\x00\xc1\xc2\x00\xc4\x00\x00\xc7\x00\xc9\x00\xcb\x00\xcd\xce\x00"
-    "\x00\x00\x00\xd3\xd4\x00\xd6\xd7\x00\x00\xda\x00\xdc\xdd\x00\xdf"
-    "\x00\xe1\xe2\x00\xe4\x00\x00\xe7\x00\xe9\x00\xeb\x00\xed\xee\x00"
-    "\x00\x00\x00\xf3\xf4\x00\xf6\xf7\x00\x00\xfa\x00\xfc\xfd\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_3 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7,
-    0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b,
-    0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7,
-    0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c,
-    0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7,
-    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
-    0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7,
-    0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df,
-    0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7,
-    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7,
-    0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_3 [48 + 7 * 64] = {
-    "\x04\x00\x01\x06\x02\x05\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\xa3\xa4\x00\x00\xa7\xa8\x00\x00\x00\x00\xad\x00\x00"
-    "\xb0\x00\xb2\xb3\xb4\xb5\x00\xb7\xb8\x00\x00\x00\x00\xbd\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\xc6\xe6\xc5\xe5\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xf8\xab\xbb"
-    "\xd5\xf5\x00\x00\xa6\xb6\xa1\xb1\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xa9\xb9\x00\x00\xac\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xff\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe\xaa\xba"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\xfd\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xaf\xbf\x00\x00\x00"
-    "\xc0\xc1\xc2\x00\xc4\x00\x00\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\x00\xd1\xd2\xd3\xd4\x00\xd6\xd7\x00\xd9\xda\xdb\xdc\x00\x00\xdf"
-    "\xe0\xe1\xe2\x00\xe4\x00\x00\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\x00\xf1\xf2\xf3\xf4\x00\xf6\xf7\x00\xf9\xfa\xfb\xfc\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_4 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7,
-    0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af,
-    0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7,
-    0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b,
-    0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e,
-    0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a,
-    0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
-    0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df,
-    0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f,
-    0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b,
-    0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
-    0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_4 [48 + 6 * 64] = {
-    "\x00\x00\x01\x05\x02\x03\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\xa4\x00\x00\xa7\xa8\x00\x00\x00\x00\xad\x00\xaf"
-    "\xb0\x00\x00\x00\xb4\x00\x00\x00\xb8\x00\x00\x00\x00\x00\x00\x00"
-    "\xc0\xe0\x00\x00\xa1\xb1\x00\x00\x00\x00\x00\x00\xc8\xe8\x00\x00"
-    "\xd0\xf0\xaa\xba\x00\x00\xcc\xec\xca\xea\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\xab\xbb\x00\x00\x00\x00\xa5\xb5\xcf\xef\x00\x00\xc7\xe7"
-    "\x00\x00\x00\x00\x00\x00\xd3\xf3\xa2\x00\x00\xa6\xb6\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\xd1\xf1\x00\x00\x00\xbd\xbf\xd2\xf2\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\xa3\xb3\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xa9\xb9\x00\x00\x00\x00\xac\xbc\xdd\xfd\xde\xfe\x00\x00\x00\x00"
-    "\x00\x00\xd9\xf9\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\xbe\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\xb2\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\x00"
-    "\x00\x00\x00\x00\xd4\xd5\xd6\xd7\xd8\x00\xda\xdb\xdc\x00\x00\xdf"
-    "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\x00"
-    "\x00\x00\x00\x00\xf4\xf5\xf6\xf7\xf8\x00\xfa\xfb\xfc\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_5 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
-    0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f,
-    0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
-    0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
-    0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
-    0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
-    0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
-    0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
-    0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
-    0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
-    0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
-    0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_5 [48 + 6 * 64] = {
-    "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\x00\x00\x00\xfd\x00\x00\x00\x00\x00\xad\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\x00\xae\xaf"
-    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\x00\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\x00\xfe\xff"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_6 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f,
-    0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
-    0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
-    0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
-    0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
-    0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
-    0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_6 [48 + 5 * 64] = {
-    "\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x04\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00\x00\xad\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x00\x00\xbf"
-    "\x00\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\x00\x00\x00\x00\x00"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\xf0\xf1\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_7 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x2018, 0x2019, 0x00a3, 0x0000, 0x0000, 0x00a6, 0x00a7,
-    0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015,
-    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7,
-    0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f,
-    0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
-    0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
-    0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
-    0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af,
-    0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
-    0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
-    0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
-    0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_7 [48 + 7 * 64] = {
-    "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x06"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\xa3\x00\x00\xa6\xa7\xa8\xa9\x00\xab\xac\xad\x00\x00"
-    "\xb0\xb1\xb2\xb3\x00\x00\x00\xb7\x00\x00\x00\xbb\x00\xbd\x00\x00"
-    "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\xaf\x00\x00\xa1\xa2\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\xb4\xb5\xb6\x00\xb8\xb9\xba\x00\xbc\x00\xbe\xbf"
-    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\xd0\xd1\x00\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_8 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
-    0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
-    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
-    0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
-    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017,
-    0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
-    0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
-    0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
-    0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_8 [48 + 7 * 64] = {
-    "\x02\x00\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\x00\xab\xac\xad\xae\xaf"
-    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\x00\xbb\xbc\xbd\xbe\x00"
-    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\xaa\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\xba\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xfe"
-    "\x00\x00\x00\x00\x00\x00\x00\xdf\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_9 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
-    0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
-    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
-    0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
-    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
-    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
-    0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
-    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df,
-    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
-    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
-    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_9 [48 + 5 * 64] = {
-    "\x00\x00\x01\x02\x03\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
-    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\x00\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\x00\x00\xdf"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\x00\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\x00\x00\xff"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xf0"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xdd\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_10 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7,
-    0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a,
-    0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7,
-    0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b,
-    0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e,
-    0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf,
-    0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168,
-    0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
-    0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f,
-    0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef,
-    0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169,
-    0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_10 [48 + 7 * 64] = {
-    "\x00\x00\x01\x06\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\x00\x00\x00\xa7\x00\x00\x00\x00\x00\xad\x00\x00"
-    "\xb0\x00\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xc0\xe0\x00\x00\xa1\xb1\x00\x00\x00\x00\x00\x00\xc8\xe8\x00\x00"
-    "\xa9\xb9\xa2\xb2\x00\x00\xcc\xec\xca\xea\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\xa3\xb3\x00\x00\x00\x00\xa5\xb5\xa4\xb4\x00\x00\xc7\xe7"
-    "\x00\x00\x00\x00\x00\x00\xa6\xb6\xff\x00\x00\xa8\xb8\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\xd1\xf1\x00\x00\x00\xaf\xbf\xd2\xf2\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xaa\xba\x00\x00\x00\x00\xab\xbb\xd7\xf7\xae\xbe\x00\x00\x00\x00"
-    "\x00\x00\xd9\xf9\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\xbc\x00"
-    "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\xcf"
-    "\xd0\x00\x00\xd3\xd4\xd5\xd6\x00\xd8\x00\xda\xdb\xdc\xdd\xde\xdf"
-    "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\xef"
-    "\xf0\x00\x00\xf3\xf4\xf5\xf6\x00\xf8\x00\xfa\xfb\xfc\xfd\xfe\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_11 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
-    0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
-    0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
-    0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
-    0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
-    0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
-    0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
-    0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f,
-    0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
-    0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
-    0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
-    0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_11 [48 + 6 * 64] = {
-    "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x05\x00\x00\x00\x00\x00\x00"
-    "\x00\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
-    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
-    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\x00\x00\x00\x00\xdf"
-    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_13 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7,
-    0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6,
-    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7,
-    0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6,
-    0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112,
-    0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b,
-    0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7,
-    0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df,
-    0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113,
-    0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c,
-    0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7,
-    0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_13 [48 + 7 * 64] = {
-    "\x00\x00\x01\x04\x06\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\xa2\xa3\xa4\x00\xa6\xa7\x00\xa9\x00\xab\xac\xad\xae\x00"
-    "\xb0\xb1\xb2\xb3\x00\xb5\xb6\xb7\x00\xb9\x00\xbb\xbc\xbd\xbe\x00"
-    "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\xb4\xa1\xa5\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\xc4\xc5\xaf\x00\x00\xc9\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\xd3\x00\xd5\xd6\xd7\xa8\x00\x00\x00\xdc\x00\x00\xdf"
-    "\x00\x00\x00\x00\xe4\xe5\xbf\x00\x00\xe9\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\xf3\x00\xf5\xf6\xf7\xb8\x00\x00\x00\xfc\x00\x00\x00"
-    "\x00\xd9\xf9\xd1\xf1\xd2\xf2\x00\x00\x00\x00\x00\xd4\xf4\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\xaa\xba\x00\x00\xda\xfa\x00\x00\x00\x00"
-    "\xd0\xf0\x00\x00\x00\x00\x00\x00\x00\x00\xdb\xfb\x00\x00\x00\x00"
-    "\x00\x00\xd8\xf8\x00\x00\x00\x00\x00\xca\xea\xdd\xfd\xde\xfe\x00"
-    "\xc2\xe2\x00\x00\xc0\xe0\xc3\xe3\x00\x00\x00\x00\xc8\xe8\x00\x00"
-    "\x00\x00\xc7\xe7\x00\x00\xcb\xeb\xc6\xe6\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\xcc\xec\x00\x00\x00\x00\x00\x00\xce\xee\x00\x00\xc1\xe1"
-    "\x00\x00\x00\x00\x00\x00\xcd\xed\x00\x00\x00\xcf\xef\x00\x00\x00"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_14 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7,
-    0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178,
-    0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56,
-    0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61,
-    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
-    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
-    0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a,
-    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df,
-    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
-    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b,
-    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_14 [48 + 10 * 64] = {
-    "\x00\x00\x01\x09\x04\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\xa3\x00\x00\x00\xa7\x00\xa9\x00\x00\x00\xad\xae\x00"
-    "\x00\x00\x00\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x08\x05\x06\x00\x00\x00\x00"
-    "\x00\x00\xa1\xa2\x00\x00\x00\x00\x00\x00\xa6\xab\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0\xb1"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\xa5\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xb2\xb3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xa8\xb8\xaa\xba\xbd\xbe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\xac\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\xd0\xf0\xde\xfe\xaf\x00\x00\x00\x00\x00\x00\x00"
-    "\xb4\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\xb7\xb9\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xbb\xbf\x00\x00\x00\x00\x00\x00\x00\x00\xd7\xf7\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\x00\xd1\xd2\xd3\xd4\xd5\xd6\x00\xd8\xd9\xda\xdb\xdc\xdd\x00\xdf"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\x00\xf1\xf2\xf3\xf4\xf5\xf6\x00\xf8\xf9\xfa\xfb\xfc\xfd\x00\xff"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_15 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7,
-    0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
-    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7,
-    0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf,
-    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
-    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
-    0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
-    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
-    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
-    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
-    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_15 [48 + 6 * 64] = {
-    "\x00\x00\x01\x05\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\xa1\xa2\xa3\x00\xa5\x00\xa7\x00\xa9\xaa\xab\xac\xad\xae\xaf"
-    "\xb0\xb1\xb2\xb3\x00\xb5\xb6\xb7\x00\xb9\xba\xbb\x00\x00\x00\xbf"
-    "\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\xbc\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xa6\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x00\x00\x00\x00\xb4\xb8\x00"
-    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
-    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
-};
-
-static const unsigned short xmlunicodetable_ISO8859_16 [128] = {
-    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
-    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
-    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
-    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
-    0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7,
-    0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b,
-    0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7,
-    0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c,
-    0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7,
-    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
-    0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a,
-    0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df,
-    0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7,
-    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
-    0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b,
-    0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff,
-};
-
-static const unsigned char xmltranscodetable_ISO8859_16 [48 + 9 * 64] = {
-    "\x00\x00\x01\x08\x02\x03\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
-    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
-    "\xa0\x00\x00\x00\x00\x00\x00\xa7\x00\xa9\x00\xab\x00\xad\x00\x00"
-    "\xb0\xb1\x00\x00\x00\x00\xb6\xb7\x00\x00\x00\xbb\x00\x00\x00\x00"
-    "\x00\x00\xc3\xe3\xa1\xa2\xc5\xe5\x00\x00\x00\x00\xb2\xb9\x00\x00"
-    "\xd0\xf0\x00\x00\x00\x00\x00\x00\xdd\xfd\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\xa3\xb3\xd1\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xd5\xf5\xbc\xbd\x00\x00\x00\x00\x00\x00\xd7\xf7\x00\x00\x00\x00"
-    "\xa6\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xd8\xf8\x00\x00\x00\x00\x00\x00\xbe\xac\xae\xaf\xbf\xb4\xb8\x00"
-    "\x06\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb5\xa5\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\xaa\xba\xde\xfe\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
-    "\xc0\xc1\xc2\x00\xc4\x00\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
-    "\x00\x00\xd2\xd3\xd4\x00\xd6\x00\x00\xd9\xda\xdb\xdc\x00\x00\xdf"
-    "\xe0\xe1\xe2\x00\xe4\x00\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
-    "\x00\x00\xf2\xf3\xf4\x00\xf6\x00\x00\xf9\xfa\xfb\xfc\x00\x00\xff"
-};
-
-
-/*
- * auto-generated functions for ISO-8859-2 .. ISO-8859-16
- */
-
-static int ISO8859_2ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_2);
-}
-static int UTF8ToISO8859_2 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_2);
-}
-
-static int ISO8859_3ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_3);
-}
-static int UTF8ToISO8859_3 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_3);
-}
-
-static int ISO8859_4ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_4);
-}
-static int UTF8ToISO8859_4 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_4);
-}
-
-static int ISO8859_5ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_5);
-}
-static int UTF8ToISO8859_5 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_5);
-}
-
-static int ISO8859_6ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_6);
-}
-static int UTF8ToISO8859_6 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_6);
-}
-
-static int ISO8859_7ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_7);
-}
-static int UTF8ToISO8859_7 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_7);
-}
-
-static int ISO8859_8ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_8);
-}
-static int UTF8ToISO8859_8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_8);
-}
-
-static int ISO8859_9ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_9);
-}
-static int UTF8ToISO8859_9 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_9);
-}
-
-static int ISO8859_10ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_10);
-}
-static int UTF8ToISO8859_10 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_10);
-}
-
-static int ISO8859_11ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_11);
-}
-static int UTF8ToISO8859_11 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_11);
-}
-
-static int ISO8859_13ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_13);
-}
-static int UTF8ToISO8859_13 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_13);
-}
-
-static int ISO8859_14ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_14);
-}
-static int UTF8ToISO8859_14 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_14);
-}
-
-static int ISO8859_15ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_15);
-}
-static int UTF8ToISO8859_15 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_15);
-}
-
-static int ISO8859_16ToUTF8 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_16);
-}
-static int UTF8ToISO8859_16 (unsigned char* out, int *outlen,
-    const unsigned char* in, int *inlen) {
-    return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_16);
-}
-
-#endif
 #endif
 
diff --git a/entities.c b/entities.c
index f7792a8..0a32f0b 100644
--- a/entities.c
+++ b/entities.c
@@ -29,6 +29,10 @@
 #include "private/entities.h"
 #include "private/error.h"
 
+#ifndef SIZE_MAX
+  #define SIZE_MAX ((size_t) -1)
+#endif
+
 /*
  * The XML predefined entities.
  */
@@ -513,23 +517,277 @@
 }
 
 /*
- * Macro used to grow the current buffer.
+ * xmlSerializeHexCharRef:
+ * @buf:  a char buffer
+ * @val:  a codepoint
+ *
+ * Serializes a hex char ref like &#xA0;
+ *
+ * Writes at most 9 bytes. Does not include a terminating zero byte.
+ *
+ * Returns the number of bytes written.
  */
-#define growBufferReentrant() {						\
-    xmlChar *tmp;                                                       \
-    size_t new_size = buffer_size * 2;                                  \
-    if (new_size < buffer_size) goto mem_error;                         \
-    tmp = (xmlChar *) xmlRealloc(buffer, new_size);	                \
-    if (tmp == NULL) goto mem_error;                                    \
-    buffer = tmp;							\
-    buffer_size = new_size;						\
+int
+xmlSerializeHexCharRef(char *buf, int val) {
+    char *out = buf;
+    int shift = 0, bits;
+
+    *out++ = '&';
+    *out++ = '#';
+    *out++ = 'x';
+
+    bits = val;
+    if (bits & 0xFF0000) {
+        shift = 16;
+        bits &= 0xFF0000;
+    } else if (bits & 0x00FF00) {
+        shift = 8;
+        bits &= 0x00FF00;
+    }
+    if (bits & 0xF0F0F0) {
+        shift += 4;
+    }
+
+    do {
+        int d = (val >> shift) & 0x0F;
+
+        if (d < 10)
+            *out++ = '0' + d;
+        else
+            *out++ = 'A' + (d - 10);
+
+	shift -= 4;
+    } while (shift >= 0);
+
+    *out++ = ';';
+
+    return(out - buf);
+}
+
+/*
+ * xmlSerializeDecCharRef:
+ * @buf:  a char buffer
+ * @val:  a codepoint
+ *
+ * Serializes a decimal char ref like &#38;
+ *
+ * Writes at most 10 bytes. Does not include a terminating zero byte.
+ *
+ * Returns the number of bytes written.
+ */
+int
+xmlSerializeDecCharRef(char *buf, int val) {
+    char *out = buf;
+    int len, i;
+
+    *out++ = '&';
+    *out++ = '#';
+
+    if (val < 100) {
+        len = (val < 10) ? 1 : 2;
+    } else if (val < 10000) {
+        len = (val < 1000) ? 3 : 4;
+    } else if (val < 1000000) {
+        len = (val < 100000) ? 5 : 6;
+    } else {
+        len = 7;
+    }
+
+    for (i = len - 1; i >= 0; i--) {
+        out[i] = '0' + val % 10;
+        val /= 10;
+    }
+
+    out[len] = ';';
+
+    return(len + 3);
+}
+
+static const char xmlEscapeSafe[128] = {
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+    1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+};
+
+/*
+ * xmlEscapeText:
+ * @text:  input text
+ * @flags:  XML_ESCAPE flags
+ *
+ * Escapes certain characters with char refs.
+ *
+ * XML_ESCAPE_ATTR: for attribute content.
+ * XML_ESCAPE_NON_ASCII: escape non-ASCII chars.
+ * XML_ESCAPE_HTML: for HTML content.
+ * XML_ESCAPE_QUOT: escape double quotes.
+ * XML_ESCAPE_ALLOW_INVALID: allow invalid characters.
+ *
+ * Returns an escaped string or NULL if a memory allocation failed.
+ */
+xmlChar *
+xmlEscapeText(const xmlChar *text, int flags) {
+    const xmlChar *cur;
+    xmlChar *buffer;
+    xmlChar *out;
+    const xmlChar *unescaped;
+    size_t size = 50;
+
+    buffer = xmlMalloc(size + 1);
+    if (buffer == NULL)
+        return(NULL);
+    out = buffer;
+
+    cur = text;
+    unescaped = cur;
+
+    while (*cur != '\0') {
+        char buf[12];
+	const xmlChar *end;
+        const xmlChar *repl;
+        size_t used;
+        size_t replSize;
+        size_t unescapedSize;
+        size_t totalSize;
+        int chunkSize = 1;
+        int c;
+
+        /* accelerator */
+	while (1) {
+            c = *cur;
+
+            if (c < 0x80) {
+                if (!xmlEscapeSafe[*cur])
+                    break;
+            } else {
+               if (flags & XML_ESCAPE_NON_ASCII)
+                   break;
+            }
+            cur += 1;
+        }
+
+        if (c == 0) {
+            chunkSize = 0;
+            repl = BAD_CAST "";
+            replSize = 0;
+        } else if (c == '<') {
+	    /*
+	     * Special handling of server side include in HTML attributes
+	     */
+	    if ((flags & XML_ESCAPE_HTML) && (flags & XML_ESCAPE_ATTR) &&
+	        (cur[1] == '!') && (cur[2] == '-') && (cur[3] == '-') &&
+	        ((end = xmlStrstr(cur, BAD_CAST "-->")) != NULL)) {
+                chunkSize = (end - cur) + 3;
+                repl = cur;
+                replSize = chunkSize;
+	    } else {
+                repl = BAD_CAST "&lt;";
+                replSize = 4;
+            }
+	} else if (c == '>') {
+            repl = BAD_CAST "&gt;";
+            replSize = 4;
+	} else if (c == '&') {
+	    /*
+	     * Special handling of &{...} construct from HTML 4, see
+	     * http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
+	     */
+	    if ((flags & XML_ESCAPE_HTML) && (flags & XML_ESCAPE_ATTR) &&
+                (cur[1] == '{') && (end = xmlStrchr(cur, '}'))) {
+                chunkSize = (end - cur) + 1;
+                repl = cur;
+                replSize = chunkSize;
+	    } else {
+                repl = BAD_CAST "&amp;";
+                replSize = 5;
+            }
+	} else if ((flags & XML_ESCAPE_QUOT) && (c == '"')) {
+            repl = BAD_CAST "&quot;";
+            replSize = 6;
+	} else if (((flags & XML_ESCAPE_HTML) == 0) && (c == '\r')) {
+	    repl = BAD_CAST "&#13;";
+            replSize = 5;
+	} else if ((flags & XML_ESCAPE_NON_ASCII) && (c >= 0x80)) {
+            int val;
+
+            chunkSize = 4;
+            val = xmlGetUTF8Char(cur, &chunkSize);
+            if (val < 0) {
+                val = 0xFFFD;
+                chunkSize = 1;
+            } else if (((flags & XML_ESCAPE_ALLOW_INVALID) == 0) &&
+                       (!IS_CHAR(val))) {
+                val = 0xFFFD;
+            }
+
+            replSize = xmlSerializeHexCharRef(buf, val);
+            repl = BAD_CAST buf;
+	} else if ((flags & (XML_ESCAPE_ALLOW_INVALID | XML_ESCAPE_HTML)) ||
+                   (c >= 0x20) ||
+	           (c == '\n') || (c == '\t') || (c == '\r')) {
+	    /* default case, just copy */
+            cur += 1;
+            if (*cur != 0)
+                continue;
+
+            chunkSize = 0;
+            repl = BAD_CAST "";
+            replSize = 0;
+	} else {
+            /* ignore */
+            repl = BAD_CAST "";
+            replSize = 0;
+        }
+
+        used = out - buffer;
+        unescapedSize = cur - unescaped;
+        totalSize = unescapedSize + replSize;
+
+	cur += chunkSize;
+
+        if (totalSize > size - used) {
+            xmlChar *tmp;
+            int newSize;
+
+            if ((size > (SIZE_MAX - 1) / 2) ||
+                (totalSize > (SIZE_MAX - 1) / 2 - size)) {
+                xmlFree(buffer);
+                return(NULL);
+            }
+            newSize = size + totalSize;
+            if (*cur != 0)
+                newSize *= 2;
+            tmp = xmlRealloc(buffer, newSize + 1);
+            if (tmp == NULL) {
+                xmlFree(buffer);
+                return(NULL);
+            }
+            buffer = tmp;
+            size = newSize;
+            out = buffer + used;
+        }
+
+        memcpy(out, unescaped, unescapedSize);
+        out += unescapedSize;
+        memcpy(out, repl, replSize);
+        out += replSize;
+
+        unescaped = cur;
+    }
+
+    *out = 0;
+    return(buffer);
 }
 
 /**
  * xmlEncodeEntitiesInternal:
  * @doc:  the document containing the string
  * @input:  A string to convert to XML.
- * @attr: are we handling an attribute value
+ * @flags:  XML_ESCAPE flags
  *
  * Do a global encoding of a string, replacing the predefined entities
  * and non ASCII values with their entities and CharRef counterparts.
@@ -538,178 +796,18 @@
  *
  * Returns A newly allocated string with the substitution done.
  */
-static xmlChar *
-xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
-    const xmlChar *cur = input;
-    xmlChar *buffer = NULL;
-    xmlChar *out = NULL;
-    size_t buffer_size = 0;
-    int html = 0;
-
-    if (input == NULL) return(NULL);
-    if (doc != NULL)
-        html = (doc->type == XML_HTML_DOCUMENT_NODE);
-
-    /*
-     * allocate an translation buffer.
-     */
-    buffer_size = 1000;
-    buffer = (xmlChar *) xmlMalloc(buffer_size);
-    if (buffer == NULL)
-	return(NULL);
-    out = buffer;
-
-    while (*cur != '\0') {
-        size_t indx = out - buffer;
-        if (indx + 100 > buffer_size) {
-
-	    growBufferReentrant();
-	    out = &buffer[indx];
-	}
-
-	/*
-	 * By default one have to encode at least '<', '>', '"' and '&' !
-	 */
-	if (*cur == '<') {
-	    const xmlChar *end;
-
-	    /*
-	     * Special handling of server side include in HTML attributes
-	     */
-	    if (html && attr &&
-	        (cur[1] == '!') && (cur[2] == '-') && (cur[3] == '-') &&
-	        ((end = xmlStrstr(cur, BAD_CAST "-->")) != NULL)) {
-	        while (cur != end) {
-		    *out++ = *cur++;
-		    indx = out - buffer;
-		    if (indx + 100 > buffer_size) {
-			growBufferReentrant();
-			out = &buffer[indx];
-		    }
-		}
-		*out++ = *cur++;
-		*out++ = *cur++;
-		*out++ = *cur++;
-		continue;
-	    }
-	    *out++ = '&';
-	    *out++ = 'l';
-	    *out++ = 't';
-	    *out++ = ';';
-	} else if (*cur == '>') {
-	    *out++ = '&';
-	    *out++ = 'g';
-	    *out++ = 't';
-	    *out++ = ';';
-	} else if (*cur == '&') {
-	    /*
-	     * Special handling of &{...} construct from HTML 4, see
-	     * http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
-	     */
-	    if (html && attr && (cur[1] == '{') &&
-	        (strchr((const char *) cur, '}'))) {
-	        while (*cur != '}') {
-		    *out++ = *cur++;
-		    indx = out - buffer;
-		    if (indx + 100 > buffer_size) {
-			growBufferReentrant();
-			out = &buffer[indx];
-		    }
-		}
-		*out++ = *cur++;
-		continue;
-	    }
-	    *out++ = '&';
-	    *out++ = 'a';
-	    *out++ = 'm';
-	    *out++ = 'p';
-	    *out++ = ';';
-	} else if (((*cur >= 0x20) && (*cur < 0x80)) ||
-	    (*cur == '\n') || (*cur == '\t') || ((html) && (*cur == '\r'))) {
-	    /*
-	     * default case, just copy !
-	     */
-	    *out++ = *cur;
-	} else if (*cur >= 0x80) {
-	    if (((doc != NULL) && (doc->encoding != NULL)) || (html)) {
-		/*
-		 * Bjørn Reese <br@sseusa.com> provided the patch
-	        xmlChar xc;
-	        xc = (*cur & 0x3F) << 6;
-	        if (cur[1] != 0) {
-		    xc += *(++cur) & 0x3F;
-		    *out++ = xc;
-	        } else
-		 */
-		*out++ = *cur;
-	    } else {
-		/*
-		 * We assume we have UTF-8 input.
-		 * It must match either:
-		 *   110xxxxx 10xxxxxx
-		 *   1110xxxx 10xxxxxx 10xxxxxx
-		 *   11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-		 * That is:
-		 *   cur[0] is 11xxxxxx
-		 *   cur[1] is 10xxxxxx
-		 *   cur[2] is 10xxxxxx if cur[0] is 111xxxxx
-		 *   cur[3] is 10xxxxxx if cur[0] is 1111xxxx
-		 *   cur[0] is not 11111xxx
-		 */
-		char buf[13], *ptr;
-		int val, l;
-
-                l = 4;
-                val = xmlGetUTF8Char(cur, &l);
-                if (val < 0) {
-                    val = 0xFFFD;
-                    cur++;
-                } else {
-                    if (!IS_CHAR(val))
-                        val = 0xFFFD;
-                    cur += l;
-		}
-		/*
-		 * We could do multiple things here. Just save as a char ref
-		 */
-		snprintf(buf, sizeof(buf), "&#x%X;", val);
-		buf[sizeof(buf) - 1] = 0;
-		ptr = buf;
-		while (*ptr != 0) *out++ = *ptr++;
-		continue;
-	    }
-	} else if (IS_BYTE_CHAR(*cur)) {
-	    char buf[11], *ptr;
-
-	    snprintf(buf, sizeof(buf), "&#%d;", *cur);
-	    buf[sizeof(buf) - 1] = 0;
-            ptr = buf;
-	    while (*ptr != 0) *out++ = *ptr++;
-	}
-	cur++;
-    }
-    *out = 0;
-    return(buffer);
-
-mem_error:
-    xmlFree(buffer);
-    return(NULL);
-}
-
-/**
- * xmlEncodeAttributeEntities:
- * @doc:  the document containing the string
- * @input:  A string to convert to XML.
- *
- * Do a global encoding of a string, replacing the predefined entities
- * and non ASCII values with their entities and CharRef counterparts for
- * attribute values.
- *
- * Returns A newly allocated string with the substitution done.
- */
 xmlChar *
-xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input) {
-    return xmlEncodeEntitiesInternal(doc, input, 1);
+xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input,
+                          unsigned flags) {
+    if (input == NULL)
+        return(NULL);
+
+    if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE))
+        flags |= XML_ESCAPE_HTML;
+    else if ((doc == NULL) || (doc->encoding == NULL))
+        flags |= XML_ESCAPE_NON_ASCII;
+
+    return(xmlEscapeText(input, flags));
 }
 
 /**
@@ -722,6 +820,10 @@
  * Contrary to xmlEncodeEntities, this routine is reentrant, and result
  * must be deallocated.
  *
+ * This escapes '<', '>', '&' and '\r'. If the document has no encoding,
+ * non-ASCII codepoints are escaped. There is some special handling for
+ * HTML documents.
+ *
  * Returns A newly allocated string with the substitution done.
  */
 xmlChar *
@@ -731,86 +833,23 @@
 
 /**
  * xmlEncodeSpecialChars:
- * @doc:  the document containing the string
+ * @doc:  unused
  * @input:  A string to convert to XML.
  *
  * Do a global encoding of a string, replacing the predefined entities
  * this routine is reentrant, and result must be deallocated.
  *
+ * This escapes '<', '>', '&', '"' and '\r' chars.
+ *
  * Returns A newly allocated string with the substitution done.
  */
 xmlChar *
-xmlEncodeSpecialChars(const xmlDoc *doc ATTRIBUTE_UNUSED, const xmlChar *input) {
-    const xmlChar *cur = input;
-    xmlChar *buffer = NULL;
-    xmlChar *out = NULL;
-    size_t buffer_size = 0;
-    if (input == NULL) return(NULL);
+xmlEncodeSpecialChars(const xmlDoc *doc ATTRIBUTE_UNUSED,
+                      const xmlChar *input) {
+    if (input == NULL)
+        return(NULL);
 
-    /*
-     * allocate an translation buffer.
-     */
-    buffer_size = 1000;
-    buffer = (xmlChar *) xmlMalloc(buffer_size);
-    if (buffer == NULL)
-	return(NULL);
-    out = buffer;
-
-    while (*cur != '\0') {
-        size_t indx = out - buffer;
-        if (indx + 10 > buffer_size) {
-
-	    growBufferReentrant();
-	    out = &buffer[indx];
-	}
-
-	/*
-	 * By default one have to encode at least '<', '>', '"' and '&' !
-	 */
-	if (*cur == '<') {
-	    *out++ = '&';
-	    *out++ = 'l';
-	    *out++ = 't';
-	    *out++ = ';';
-	} else if (*cur == '>') {
-	    *out++ = '&';
-	    *out++ = 'g';
-	    *out++ = 't';
-	    *out++ = ';';
-	} else if (*cur == '&') {
-	    *out++ = '&';
-	    *out++ = 'a';
-	    *out++ = 'm';
-	    *out++ = 'p';
-	    *out++ = ';';
-	} else if (*cur == '"') {
-	    *out++ = '&';
-	    *out++ = 'q';
-	    *out++ = 'u';
-	    *out++ = 'o';
-	    *out++ = 't';
-	    *out++ = ';';
-	} else if (*cur == '\r') {
-	    *out++ = '&';
-	    *out++ = '#';
-	    *out++ = '1';
-	    *out++ = '3';
-	    *out++ = ';';
-	} else {
-	    /*
-	     * Works because on UTF-8, all extended sequences cannot
-	     * result in bytes in the ASCII range.
-	     */
-	    *out++ = *cur;
-	}
-	cur++;
-    }
-    *out = 0;
-    return(buffer);
-
-mem_error:
-    xmlFree(buffer);
-    return(NULL);
+    return(xmlEscapeText(input, XML_ESCAPE_QUOT | XML_ESCAPE_ALLOW_INVALID));
 }
 
 /**
@@ -850,7 +889,6 @@
     xmlHashFree(table, xmlFreeEntityWrapper);
 }
 
-#ifdef LIBXML_TREE_ENABLED
 /**
  * xmlCopyEntity:
  * @ent:  An entity
@@ -920,7 +958,6 @@
 xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
     return(xmlHashCopySafe(table, xmlCopyEntity, xmlFreeEntityWrapper));
 }
-#endif /* LIBXML_TREE_ENABLED */
 
 #ifdef LIBXML_OUTPUT_ENABLED
 
diff --git a/error.c b/error.c
index b678a0e..563f472 100644
--- a/error.c
+++ b/error.c
@@ -17,8 +17,40 @@
 #include <libxml/xmlmemory.h>
 
 #include "private/error.h"
+#include "private/globals.h"
 #include "private/string.h"
 
+/**
+ * xmlIsCatastrophicError:
+ * @level:  error level
+ * @code:  error code
+ *
+ * Returns true if an error is catastrophic.
+ */
+int
+xmlIsCatastrophicError(int level, int code) {
+    int fatal = 0;
+
+    if (level != XML_ERR_FATAL)
+        return(0);
+
+    switch (code) {
+        case XML_ERR_NO_MEMORY:
+        /* case XML_ERR_RESOURCE_LIMIT: */
+        case XML_ERR_SYSTEM:
+        case XML_ERR_ARGUMENT:
+        case XML_ERR_INTERNAL_ERROR:
+            fatal = 1;
+            break;
+        default:
+            if ((code >= 1500) && (code <= 1599))
+                fatal = 1;
+            break;
+    }
+
+    return(fatal);
+}
+
 /************************************************************************
  *									*
  *			Error struct					*
@@ -203,24 +235,6 @@
 }
 
 /**
- * initGenericErrorDefaultFunc:
- * @handler:  the handler
- *
- * DEPRECATED: Use xmlSetGenericErrorFunc.
- *
- * Set or reset (if NULL) the default handler for generic errors
- * to the builtin error function.
- */
-void
-initGenericErrorDefaultFunc(xmlGenericErrorFunc * handler)
-{
-    if (handler == NULL)
-        xmlGenericError = xmlGenericErrorDefaultFunc;
-    else
-        xmlGenericError = (*handler);
-}
-
-/**
  * xmlSetGenericErrorFunc:
  * @ctx:  the new error handling context
  * @handler:  the new handler function
@@ -635,7 +649,7 @@
 xmlRaiseMemoryError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel,
                     void *data, int domain, xmlError *error)
 {
-    xmlError *lastError = &xmlLastError;
+    xmlError *lastError = xmlGetLastErrorInternal();
 
     xmlResetLastError();
     lastError->domain = domain;
@@ -694,16 +708,14 @@
 {
     xmlParserCtxtPtr ctxt = NULL;
     /* xmlLastError is a macro retrieving the per-thread global. */
-    xmlErrorPtr lastError = &xmlLastError;
+    xmlErrorPtr lastError = xmlGetLastErrorInternal();
     xmlErrorPtr to = lastError;
 
     if (code == XML_ERR_OK)
         return(0);
 #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
-    if (code == XML_ERR_INTERNAL_ERROR) {
-        fprintf(stderr, "Unexpected error: %d\n", code);
-        abort();
-    }
+    if (code == XML_ERR_INTERNAL_ERROR)
+        xmlAbort("Unexpected error: %d\n", code);
 #endif
     if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
         return(0);
@@ -746,12 +758,12 @@
 }
 
 /**
- * __xmlRaiseError:
+ * xmlRaiseError:
  * @schannel: the structured callback channel
  * @channel: the old callback channel
  * @data: the callback data
  * @ctx: the parser context or NULL
- * @nod: the node or NULL
+ * @node: the node or NULL
  * @domain: the domain for the error
  * @code: the code for the error
  * @level: the xmlErrorLevel for the error
@@ -772,12 +784,12 @@
  * Returns 0 on success, -1 if a memory allocation failed.
  */
 int
-__xmlRaiseError(xmlStructuredErrorFunc schannel,
-                xmlGenericErrorFunc channel, void *data, void *ctx,
-                xmlNode *node, int domain, int code, xmlErrorLevel level,
-                const char *file, int line, const char *str1,
-                const char *str2, const char *str3, int int1, int col,
-                const char *msg, ...)
+xmlRaiseError(xmlStructuredErrorFunc schannel,
+              xmlGenericErrorFunc channel, void *data, void *ctx,
+              xmlNode *node, int domain, int code, xmlErrorLevel level,
+              const char *file, int line, const char *str1,
+              const char *str2, const char *str3, int int1, int col,
+              const char *msg, ...)
 {
     va_list ap;
     int res;
@@ -921,9 +933,11 @@
 const xmlError *
 xmlGetLastError(void)
 {
-    if (xmlLastError.code == XML_ERR_OK)
-        return (NULL);
-    return (&xmlLastError);
+    const xmlError *error = xmlGetLastErrorInternal();
+
+    if (error->code == XML_ERR_OK)
+        return(NULL);
+    return(error);
 }
 
 /**
@@ -962,49 +976,10 @@
 void
 xmlResetLastError(void)
 {
-    if (xmlLastError.code == XML_ERR_OK)
-        return;
-    xmlResetError(&xmlLastError);
-}
+    xmlError *error = xmlGetLastErrorInternal();
 
-/**
- * xmlCtxtGetLastError:
- * @ctx:  an XML parser context
- *
- * Get the last parsing error registered.
- *
- * Returns NULL if no error occurred or a pointer to the error
- */
-const xmlError *
-xmlCtxtGetLastError(void *ctx)
-{
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-
-    if (ctxt == NULL)
-        return (NULL);
-    if (ctxt->lastError.code == XML_ERR_OK)
-        return (NULL);
-    return (&ctxt->lastError);
-}
-
-/**
- * xmlCtxtResetLastError:
- * @ctx:  an XML parser context
- *
- * Cleanup the last global error registered. For parsing error
- * this does not change the well-formedness result.
- */
-void
-xmlCtxtResetLastError(void *ctx)
-{
-    xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
-
-    if (ctxt == NULL)
-        return;
-    ctxt->errNo = XML_ERR_OK;
-    if (ctxt->lastError.code == XML_ERR_OK)
-        return;
-    xmlResetError(&ctxt->lastError);
+    if (error->code != XML_ERR_OK)
+        xmlResetError(error);
 }
 
 /**
@@ -1366,3 +1341,49 @@
 
     return(errmsg);
 }
+
+/**
+ * xmlVPrintErrorMessage:
+ * @fmt:  printf format string
+ * @ap:  arguments
+ *
+ * Prints to stderr.
+ */
+void
+xmlVPrintErrorMessage(const char *fmt, va_list ap) {
+    vfprintf(stderr, fmt, ap);
+}
+
+/**
+ * xmlPrintErrorMessage:
+ * @fmt:  printf format string
+ * @...:  arguments
+ *
+ * Prints to stderr.
+ */
+void
+xmlPrintErrorMessage(const char *fmt, ...) {
+    va_list ap;
+
+    va_start(ap, fmt);
+    xmlVPrintErrorMessage(fmt, ap);
+    va_end(ap);
+}
+
+/**
+ * xmlAbort:
+ * @fmt:  printf format string
+ * @...:  arguments
+ *
+ * Print message to stderr and abort.
+ */
+void
+xmlAbort(const char *fmt, ...) {
+    va_list ap;
+
+    va_start(ap, fmt);
+    xmlVPrintErrorMessage(fmt, ap);
+    va_end(ap);
+
+    abort();
+}
diff --git a/example/gjobread.c b/example/gjobread.c
index 926cab0..f45a9b9 100644
--- a/example/gjobread.c
+++ b/example/gjobread.c
@@ -177,7 +177,7 @@
 
 
 static gJobPtr
-parseGjobFile(char *filename ATTRIBUTE_UNUSED) {
+parseGjobFile(char *filename) {
     xmlDocPtr doc;
     gJobPtr ret;
     jobPtr curjob;
diff --git a/example/icu.c b/example/icu.c
new file mode 100644
index 0000000..0562249
--- /dev/null
+++ b/example/icu.c
@@ -0,0 +1,241 @@
+/*
+ * icu.c: Example how to use ICU for character encoding conversion
+ *
+ * This example shows how to use ICU by installing a custom character
+ * encoding converter with xmlCtxtSetCharEncConvImpl, available
+ * since libxml2 2.14.
+ *
+ * This approach makes it possible to use ICU even if libxml2 is
+ * compiled without ICU support. It also makes sure that *only* ICU
+ * is used. Many Linux distros currently ship libxml2 with support
+ * for both ICU and iconv which makes the library's behavior hard to
+ * predict.
+ *
+ * The long-term plan is to make libxml2 only support a single
+ * conversion library internally (iconv on POSIX).
+ */
+
+#include <stdio.h>
+#include <libxml/parser.h>
+#include <unicode/ucnv.h>
+
+#define ICU_PIVOT_BUF_SIZE 1024
+
+typedef struct {
+    UConverter *uconv; /* for conversion between an encoding and UTF-16 */
+    UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */
+    UChar      *pivot_source;
+    UChar      *pivot_target;
+    int        isInput;
+    UChar      pivot_buf[ICU_PIVOT_BUF_SIZE];
+} myConvCtxt;
+
+static xmlCharEncError
+icuConvert(void *vctxt, unsigned char *out, int *outlen,
+           const unsigned char *in, int *inlen, int flush) {
+    myConvCtxt *cd = vctxt;
+    const char *ucv_in = (const char *) in;
+    char *ucv_out = (char *) out;
+    UConverter *target, *source;
+    UErrorCode err = U_ZERO_ERROR;
+    int ret;
+
+    if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
+        if (outlen != NULL)
+            *outlen = 0;
+        return XML_ENC_ERR_INTERNAL;
+    }
+
+    /*
+     * The ICU API can consume input, including partial sequences,
+     * even if the output buffer would overflow. The remaining input
+     * must be processed by calling ucnv_convertEx with a possibly
+     * empty input buffer.
+     */
+    if (cd->isInput) {
+        source = cd->uconv;
+        target = cd->utf8;
+    } else {
+        source = cd->utf8;
+        target = cd->uconv;
+    }
+
+    ucnv_convertEx(target, source, &ucv_out, ucv_out + *outlen,
+                   &ucv_in, ucv_in + *inlen, cd->pivot_buf,
+                   &cd->pivot_source, &cd->pivot_target,
+                   cd->pivot_buf + ICU_PIVOT_BUF_SIZE,
+                   /* reset */ 0, flush, &err);
+
+    *inlen = ucv_in - (const char*) in;
+    *outlen = ucv_out - (char *) out;
+
+    if (U_SUCCESS(err)) {
+        ret = XML_ENC_ERR_SUCCESS;
+    } else {
+        switch (err) {
+            case U_TRUNCATED_CHAR_FOUND:
+                /* Should only happen with flush */
+                ret = XML_ENC_ERR_INPUT;
+                break;
+
+            case U_BUFFER_OVERFLOW_ERROR:
+                ret = XML_ENC_ERR_SPACE;
+                break;
+
+            case U_INVALID_CHAR_FOUND:
+            case U_ILLEGAL_CHAR_FOUND:
+            case U_ILLEGAL_ESCAPE_SEQUENCE:
+            case U_UNSUPPORTED_ESCAPE_SEQUENCE:
+                ret = XML_ENC_ERR_INPUT;
+                break;
+
+            case U_MEMORY_ALLOCATION_ERROR:
+                ret = XML_ENC_ERR_MEMORY;
+                break;
+
+            default:
+                ret = XML_ENC_ERR_INTERNAL;
+                break;
+        }
+    }
+
+    return ret;
+}
+
+static xmlParserErrors
+icuOpen(const char* name, int isInput, myConvCtxt **out)
+{
+    UErrorCode status;
+    myConvCtxt *cd;
+
+    *out = NULL;
+
+    cd = xmlMalloc(sizeof(myConvCtxt));
+    if (cd == NULL)
+        return XML_ERR_NO_MEMORY;
+
+    cd->isInput = isInput;
+    cd->pivot_source = cd->pivot_buf;
+    cd->pivot_target = cd->pivot_buf;
+
+    status = U_ZERO_ERROR;
+    cd->uconv = ucnv_open(name, &status);
+    if (U_FAILURE(status))
+        goto error;
+
+    status = U_ZERO_ERROR;
+    if (isInput) {
+        ucnv_setToUCallBack(cd->uconv, UCNV_TO_U_CALLBACK_STOP,
+                            NULL, NULL, NULL, &status);
+    }
+    else {
+        ucnv_setFromUCallBack(cd->uconv, UCNV_FROM_U_CALLBACK_STOP,
+                              NULL, NULL, NULL, &status);
+    }
+    if (U_FAILURE(status))
+        goto error;
+
+    status = U_ZERO_ERROR;
+    cd->utf8 = ucnv_open("UTF-8", &status);
+    if (U_FAILURE(status))
+        goto error;
+
+    *out = cd;
+    return 0;
+
+error:
+    if (cd->uconv)
+        ucnv_close(cd->uconv);
+    xmlFree(cd);
+
+    if (status == U_FILE_ACCESS_ERROR)
+        return XML_ERR_UNSUPPORTED_ENCODING;
+    if (status == U_MEMORY_ALLOCATION_ERROR)
+        return XML_ERR_NO_MEMORY;
+    return XML_ERR_SYSTEM;
+}
+
+static void
+icuClose(myConvCtxt *cd)
+{
+    if (cd == NULL)
+        return;
+    ucnv_close(cd->uconv);
+    ucnv_close(cd->utf8);
+    xmlFree(cd);
+}
+
+static void
+icuConvCtxtDtor(void *vctxt) {
+    icuClose(vctxt);
+}
+
+static xmlParserErrors
+icuConvImpl(void *vctxt, const char *name, xmlCharEncFlags flags,
+            xmlCharEncodingHandler **result) {
+    xmlCharEncConvFunc inFunc = NULL, outFunc = NULL;
+    myConvCtxt *inputCtxt = NULL;
+    myConvCtxt *outputCtxt = NULL;
+    xmlParserErrors ret;
+
+    if (flags & XML_ENC_INPUT) {
+        ret = icuOpen(name, 1, &inputCtxt);
+        if (ret != 0)
+            goto error;
+        inFunc = icuConvert;
+    }
+
+    if (flags & XML_ENC_OUTPUT) {
+        ret = icuOpen(name, 0, &outputCtxt);
+        if (ret != 0)
+            goto error;
+        outFunc = icuConvert;
+    }
+
+    return xmlCharEncNewCustomHandler(name, inFunc, outFunc, icuConvCtxtDtor,
+                                      inputCtxt, outputCtxt, result);
+
+error:
+    if (inputCtxt != NULL)
+        icuClose(inputCtxt);
+    if (outputCtxt != NULL)
+        icuClose(outputCtxt);
+    return ret;
+}
+
+int
+main(void) {
+    xmlParserCtxtPtr ctxt;
+    xmlDocPtr doc;
+    const char *xml;
+    xmlChar *content;
+    int ret = 0;
+
+    /*
+     * We use IBM-1051, an alias for HP Roman, as a simple example that
+     * ICU supports, but iconv (typically) doesn't.
+     *
+     * Character code 0xDE is U+00DF Latin Small Letter Sharp S.
+     */
+    xml = "<doc>\xDE</doc>";
+
+    ctxt = xmlNewParserCtxt();
+    xmlCtxtSetCharEncConvImpl(ctxt, icuConvImpl, NULL);
+    doc = xmlCtxtReadDoc(ctxt, BAD_CAST xml, NULL, "IBM-1051", 0);
+    xmlFreeParserCtxt(ctxt);
+
+    content = xmlNodeGetContent((xmlNodePtr) doc);
+
+    printf("content: %s\n", content);
+
+    if (!xmlStrEqual(content, BAD_CAST "\xC3\x9F")) {
+        fprintf(stderr, "conversion failed\n");
+        ret = 1;
+    }
+
+    xmlFree(content);
+    xmlFreeDoc(doc);
+
+    return ret;
+}
+
diff --git a/example/io2.c b/example/io2.c
index 98e1a50..29149e1 100644
--- a/example/io2.c
+++ b/example/io2.c
@@ -11,7 +11,7 @@
 
 #include <libxml/parser.h>
 
-#if defined(LIBXML_TREE_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
+#if defined(LIBXML_OUTPUT_ENABLED)
 int
 main(void)
 {
@@ -52,7 +52,7 @@
 main(void)
 {
     fprintf(stderr,
-            "library not configured with tree and output support\n");
+            "library not configured with output support\n");
     return (0);
 }
 #endif
diff --git a/example/testWriter.c b/example/testWriter.c
index dafccfa..34f4da1 100644
--- a/example/testWriter.c
+++ b/example/testWriter.c
@@ -29,7 +29,6 @@
 void testXmlwriterMemory(void);
 void testXmlwriterDoc(void);
 void testXmlwriterTree(void);
-xmlChar *ConvertInput(const char *in, const char *encoding);
 
 int
 main(void)
@@ -68,7 +67,6 @@
 {
     int rc;
     xmlTextWriterPtr writer;
-    xmlChar *tmp;
 
     /* Create a new XmlWriter for uri, with no compression. */
     writer = xmlNewTextWriterFilename(uri, 0);
@@ -96,19 +94,12 @@
         return;
     }
 
-    /* Write a comment as child of EXAMPLE.
-     * Please observe, that the input to the xmlTextWriter functions
-     * HAS to be in UTF-8, even if the output XML is encoded
-     * in iso-8859-1 */
-    tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
-                       MY_ENCODING);
-    rc = xmlTextWriterWriteComment(writer, tmp);
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
     if (rc < 0) {
         printf
             ("testXmlwriterFilename: Error at xmlTextWriterWriteComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "ORDER" as child of EXAMPLE. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
@@ -137,16 +128,12 @@
     }
 
     /* Write a comment as child of ORDER */
-    tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
-    rc = xmlTextWriterWriteFormatComment(writer,
-		     "This is another comment with special chars: %s",
-		     tmp);
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
     if (rc < 0) {
         printf
             ("testXmlwriterFilename: Error at xmlTextWriterWriteFormatComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "HEADER" as child of ORDER. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
@@ -175,24 +162,22 @@
     }
 
     /* Write an element named "NAME_1" as child of HEADER. */
-    tmp = ConvertInput("M\xFCller", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
+                                   BAD_CAST "Mueller");
     if (rc < 0) {
         printf
             ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Write an element named "NAME_2" as child of HEADER. */
-    tmp = ConvertInput("J\xF6rg", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
+                                   BAD_CAST "Joerg");
     if (rc < 0) {
         printf
             ("testXmlwriterFilename: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Close the element named HEADER. */
     rc = xmlTextWriterEndElement(writer);
@@ -337,7 +322,6 @@
     int rc;
     xmlTextWriterPtr writer;
     xmlBufferPtr buf;
-    xmlChar *tmp;
 
     /* Create a new XML buffer, to which the XML document will be
      * written */
@@ -374,19 +358,13 @@
         return;
     }
 
-    /* Write a comment as child of EXAMPLE.
-     * Please observe, that the input to the xmlTextWriter functions
-     * HAS to be in UTF-8, even if the output XML is encoded
-     * in iso-8859-1 */
-    tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
-                       MY_ENCODING);
-    rc = xmlTextWriterWriteComment(writer, tmp);
+    /* Write a comment as child of EXAMPLE. */
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
     if (rc < 0) {
         printf
             ("testXmlwriterMemory: Error at xmlTextWriterWriteComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "ORDER" as child of EXAMPLE. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
@@ -415,16 +393,12 @@
     }
 
     /* Write a comment as child of ORDER */
-    tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
-    rc = xmlTextWriterWriteFormatComment(writer,
-		     "This is another comment with special chars: %s",
-                                         tmp);
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
     if (rc < 0) {
         printf
             ("testXmlwriterMemory: Error at xmlTextWriterWriteFormatComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "HEADER" as child of ORDER. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
@@ -453,25 +427,23 @@
     }
 
     /* Write an element named "NAME_1" as child of HEADER. */
-    tmp = ConvertInput("M\xFCller", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
+                                   BAD_CAST "Mueller");
     if (rc < 0) {
         printf
             ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Write an element named "NAME_2" as child of HEADER. */
-    tmp = ConvertInput("J\xF6rg", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
+                                   BAD_CAST "Joerg");
 
     if (rc < 0) {
         printf
             ("testXmlwriterMemory: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Close the element named HEADER. */
     rc = xmlTextWriterEndElement(writer);
@@ -611,7 +583,6 @@
 {
     int rc;
     xmlTextWriterPtr writer;
-    xmlChar *tmp;
     xmlDocPtr doc;
 
 
@@ -639,18 +610,12 @@
         return;
     }
 
-    /* Write a comment as child of EXAMPLE.
-     * Please observe, that the input to the xmlTextWriter functions
-     * HAS to be in UTF-8, even if the output XML is encoded
-     * in iso-8859-1 */
-    tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
-                       MY_ENCODING);
-    rc = xmlTextWriterWriteComment(writer, tmp);
+    /* Write a comment as child of EXAMPLE. */
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
     if (rc < 0) {
         printf("testXmlwriterDoc: Error at xmlTextWriterWriteComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "ORDER" as child of EXAMPLE. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
@@ -676,16 +641,12 @@
     }
 
     /* Write a comment as child of ORDER */
-    tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
-    rc = xmlTextWriterWriteFormatComment(writer,
-		 "This is another comment with special chars: %s",
-		                         tmp);
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
     if (rc < 0) {
         printf
             ("testXmlwriterDoc: Error at xmlTextWriterWriteFormatComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "HEADER" as child of ORDER. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
@@ -713,22 +674,20 @@
     }
 
     /* Write an element named "NAME_1" as child of HEADER. */
-    tmp = ConvertInput("M\xFCller", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
+                                   BAD_CAST "Mueller");
     if (rc < 0) {
         printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Write an element named "NAME_2" as child of HEADER. */
-    tmp = ConvertInput("J\xF6rg", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
+                                   BAD_CAST "Joerg");
     if (rc < 0) {
         printf("testXmlwriterDoc: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Close the element named HEADER. */
     rc = xmlTextWriterEndElement(writer);
@@ -863,7 +822,6 @@
     xmlTextWriterPtr writer;
     xmlDocPtr doc;
     xmlNodePtr node;
-    xmlChar *tmp;
 
     /* Create a new XML DOM tree, to which the XML document will be
      * written */
@@ -901,18 +859,12 @@
         return;
     }
 
-    /* Write a comment as child of EXAMPLE.
-     * Please observe, that the input to the xmlTextWriter functions
-     * HAS to be in UTF-8, even if the output XML is encoded
-     * in iso-8859-1 */
-    tmp = ConvertInput("This is a comment with special chars: <\xE4\xF6\xFC>",
-                       MY_ENCODING);
-    rc = xmlTextWriterWriteComment(writer, tmp);
+    /* Write a comment as child of EXAMPLE. */
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is a comment");
     if (rc < 0) {
         printf("testXmlwriterTree: Error at xmlTextWriterWriteComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "ORDER" as child of EXAMPLE. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "ORDER");
@@ -940,16 +892,12 @@
     }
 
     /* Write a comment as child of ORDER */
-    tmp = ConvertInput("<\xE4\xF6\xFC>", MY_ENCODING);
-    rc = xmlTextWriterWriteFormatComment(writer,
-			 "This is another comment with special chars: %s",
-					  tmp);
+    rc = xmlTextWriterWriteComment(writer, BAD_CAST "This is another comment");
     if (rc < 0) {
         printf
             ("testXmlwriterTree: Error at xmlTextWriterWriteFormatComment\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Start an element named "HEADER" as child of ORDER. */
     rc = xmlTextWriterStartElement(writer, BAD_CAST "HEADER");
@@ -977,22 +925,20 @@
     }
 
     /* Write an element named "NAME_1" as child of HEADER. */
-    tmp = ConvertInput("M\xFCller", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_1",
+                                   BAD_CAST "Mueller");
     if (rc < 0) {
         printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Write an element named "NAME_2" as child of HEADER. */
-    tmp = ConvertInput("J\xF6rg", MY_ENCODING);
-    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2", tmp);
+    rc = xmlTextWriterWriteElement(writer, BAD_CAST "NAME_2",
+                                   BAD_CAST "Joerg");
     if (rc < 0) {
         printf("testXmlwriterTree: Error at xmlTextWriterWriteElement\n");
         return;
     }
-    if (tmp != NULL) xmlFree(tmp);
 
     /* Close the element named HEADER. */
     rc = xmlTextWriterEndElement(writer);
@@ -1114,65 +1060,6 @@
     xmlFreeDoc(doc);
 }
 
-/**
- * ConvertInput:
- * @in: string in a given encoding
- * @encoding: the encoding used
- *
- * Converts @in into UTF-8 for processing with libxml2 APIs
- *
- * Returns the converted UTF-8 string, or NULL in case of error.
- */
-xmlChar *
-ConvertInput(const char *in, const char *encoding)
-{
-    xmlChar *out;
-    int ret;
-    int size;
-    int out_size;
-    int temp;
-    xmlCharEncodingHandlerPtr handler;
-
-    if (in == 0)
-        return 0;
-
-    handler = xmlFindCharEncodingHandler(encoding);
-
-    if (!handler) {
-        printf("ConvertInput: no encoding handler found for '%s'\n",
-               encoding ? encoding : "");
-        return 0;
-    }
-
-    size = (int) strlen(in) + 1;
-    out_size = size * 2 - 1;
-    out = (unsigned char *) xmlMalloc((size_t) out_size);
-
-    if (out != 0) {
-        temp = size - 1;
-        ret = handler->input(out, &out_size, (const xmlChar *) in, &temp);
-        if ((ret < 0) || (temp - size + 1)) {
-            if (ret < 0) {
-                printf("ConvertInput: conversion wasn't successful.\n");
-            } else {
-                printf
-                    ("ConvertInput: conversion wasn't successful. converted: %i octets.\n",
-                     temp);
-            }
-
-            xmlFree(out);
-            out = 0;
-        } else {
-            out = (unsigned char *) xmlRealloc(out, out_size + 1);
-            out[out_size] = 0;  /*null terminating out */
-        }
-    } else {
-        printf("ConvertInput: no mem\n");
-    }
-
-    return out;
-}
-
 #else
 int main(void) {
     fprintf(stderr, "Writer or output support not compiled in\n");
diff --git a/example/tree1.c b/example/tree1.c
index 28fc1b7..cbbb0ae 100644
--- a/example/tree1.c
+++ b/example/tree1.c
@@ -13,8 +13,6 @@
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
-#ifdef LIBXML_TREE_ENABLED
-
 /*
  *To compile this file using gcc you can type
  *gcc `xml2-config --cflags --libs` -o xmlexample libxml2-example.c
@@ -80,9 +78,3 @@
 
     return 0;
 }
-#else
-int main(void) {
-    fprintf(stderr, "Tree support not compiled in\n");
-    return 0;
-}
-#endif
diff --git a/example/tree2.c b/example/tree2.c
index ef137af..3f4810c 100644
--- a/example/tree2.c
+++ b/example/tree2.c
@@ -12,7 +12,7 @@
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 
-#if defined(LIBXML_TREE_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
+#if defined(LIBXML_OUTPUT_ENABLED)
 
 /*
  *To compile this file using gcc you can type
@@ -101,7 +101,7 @@
 }
 #else
 int main(void) {
-    fprintf(stderr, "tree support not compiled in\n");
+    fprintf(stderr, "output support not compiled in\n");
     return(0);
 }
 #endif
diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am
index e85452b..373aa26 100644
--- a/fuzz/Makefile.am
+++ b/fuzz/Makefile.am
@@ -143,7 +143,7 @@
 	./genSeed$(EXEEXT) lint $(XML_SEED_CORPUS_SRC)
 	@touch seed/lint.stamp
 
-lint_SOURCES = lint.c fuzz.c
+lint_SOURCES = lint.c fuzz.c ../xmllint.c ../shell.c
 lint_LDFLAGS = -fsanitize=fuzzer
 
 fuzz-lint: lint$(EXEEXT) seed/lint.stamp
diff --git a/fuzz/README.md b/fuzz/README.md
index e8167eb..0aa99e3 100644
--- a/fuzz/README.md
+++ b/fuzz/README.md
@@ -12,6 +12,12 @@
         -fno-sanitize-recover=all \
         -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
 
+Since llvm-symbolizer can use libxml2 itself, you may need the following
+wrapper to make sure that it doesn't use the instrumented version of
+libxml2:
+
+    export ASAN_SYMBOLIZER_PATH="$(pwd)/.gitlab-ci/llvm-symbolizer"
+
 Other options that can improve stack traces:
 
     -fno-omit-frame-pointer
diff --git a/fuzz/api.c b/fuzz/api.c
index 8d56328..ba738db 100644
--- a/fuzz/api.c
+++ b/fuzz/api.c
@@ -35,7 +35,9 @@
 #include <stdlib.h>
 #include <string.h>
 
-#define XML_DEPRECATED
+#ifndef XML_DEPRECATED
+  #define XML_DEPRECATED
+#endif
 
 #include <libxml/catalog.h>
 #include <libxml/HTMLtree.h>
@@ -964,14 +966,13 @@
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
     xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 
     return 0;
 }
 
 int
 LLVMFuzzerTestOneInput(const char *data, size_t size) {
-    size_t maxAlloc;
+    size_t failurePos;
     int i;
 
     if (size > 1000)
@@ -981,8 +982,8 @@
 
     xmlFuzzDataInit(data, size);
 
-    maxAlloc = xmlFuzzReadInt(4) % (size * 50 + 10);
-    xmlFuzzMemSetLimit(maxAlloc);
+    failurePos = xmlFuzzReadInt(4) % (size * 50 + 10);
+    xmlFuzzInjectFailure(failurePos);
 
     /*
      * Interpreter loop
@@ -1003,6 +1004,7 @@
         size_t readSize;
         int op = xmlFuzzReadInt(1);
         int oomReport = -1; /* -1 means unknown */
+        int ioReport = 0;
 
         vars->opName = "[unset]";
 
@@ -1805,7 +1807,7 @@
                     node,
                     BAD_CAST "lang",
                     XML_XML_NAMESPACE);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 removeChildren((xmlNodePtr) attr, 0);
                 res = xmlNodeSetLang(
                     node,
@@ -1839,7 +1841,7 @@
                     node,
                     BAD_CAST "space",
                     XML_XML_NAMESPACE);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 removeChildren((xmlNodePtr) attr, 0);
                 res = xmlNodeSetSpacePreserve(
                     node,
@@ -1891,7 +1893,7 @@
                     node,
                     BAD_CAST "base",
                     XML_XML_NAMESPACE);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 removeChildren((xmlNodePtr) attr, 0);
                 res = xmlNodeSetBase(
                     node,
@@ -2030,7 +2032,7 @@
                     oldAttr = xmlHasNsProp(node, name, NULL);
                 else
                     oldAttr = xmlHasNsProp(node, localName, ns->href);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 if (oldAttr != NULL)
                     removeChildren((xmlNodePtr) oldAttr, 0);
 
@@ -2057,7 +2059,7 @@
                 name = getStr(0);
                 value = getStr(1);
                 oldAttr = xmlHasNsProp(node, name, ns ? ns->href : NULL);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 if (oldAttr != NULL)
                     removeChildren((xmlNodePtr) oldAttr, 0);
                 attr = xmlSetNsProp(node, ns, name, value);
@@ -2106,7 +2108,7 @@
                 node = getNode(0);
                 name = getStr(0);
                 attr = xmlHasNsProp(node, name, NULL);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 if (attr != NULL)
                     removeChildren((xmlNodePtr) attr, 1);
                 setInt(0, xmlUnsetProp(node, name));
@@ -2128,7 +2130,7 @@
                 ns = nodeGetNs(getNode(1), getInt(1));
                 name = getStr(0);
                 attr = xmlHasNsProp(node, name, ns ? ns->href : NULL);
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 if (attr != NULL)
                     removeChildren((xmlNodePtr) attr, 1);
                 setInt(0, xmlUnsetNsProp(node, ns, name));
@@ -2288,7 +2290,7 @@
 
             case OP_XML_REPLACE_NODE: {
                 xmlNodePtr old, oldParent, node, oldNodeParent, result;
-                xmlDocPtr oldNodeDoc;
+                xmlDocPtr oldDoc, oldNodeDoc;
 
                 startOp("xmlReplaceNode");
                 old = getNode(0);
@@ -2297,8 +2299,18 @@
                 /*
                  * Unlinking DTD children can cause invalid references
                  * which would be expensive to fix.
+                 *
+                 * Don't unlink DTD if it is the internal or external
+                 * subset of the document.
                  */
-                if (isDtdChild(old))
+                old = old ? old->parent : NULL;
+                oldDoc = old ? old->doc : NULL;
+                if (old != NULL &&
+                    (isDtdChild(old) ||
+                     (old->type == XML_DTD_NODE &&
+                      oldDoc != NULL &&
+                      ((xmlDtdPtr) old == oldDoc->intSubset ||
+                       (xmlDtdPtr) old == oldDoc->extSubset))))
                     old = NULL;
                 if (old != NULL && !isValidChild(old->parent, node))
                     node = NULL;
@@ -2380,7 +2392,7 @@
                         xmlAttrPtr attr = xmlHasNsProp(parent, node->name,
                             node->ns ? node->ns->href : NULL);
 
-                        xmlFuzzResetMallocFailed();
+                        xmlFuzzResetFailure();
                         /* Attribute might be replaced */
                         if (attr != NULL && attr != (xmlAttrPtr) node)
                             removeChildren((xmlNodePtr) attr, 1);
@@ -2449,11 +2461,14 @@
                 first = getNode(0);
                 second = getNode(1);
                 argsOk =
-                    (first != NULL && first->type == XML_TEXT_NODE &&
-                     second != NULL && second->type == XML_TEXT_NODE &&
-                     first != second &&
-                     first->name == second->name);
-                if (argsOk) {
+                    first == NULL ?
+                        second != NULL :
+                        second == NULL ||
+                        (first->type == XML_TEXT_NODE &&
+                         second->type == XML_TEXT_NODE &&
+                         first != second &&
+                         first->name == second->name);
+                if (argsOk && second != NULL) {
                     if (second->parent != NULL)
                         parent = second->parent;
                     else
@@ -2462,7 +2477,7 @@
                 }
                 res = xmlTextMerge(first, second);
                 oomReport = (argsOk && res == NULL);
-                if (res != NULL) {
+                if (res != NULL && first != NULL) {
                     removeNode(second);
                     dropNode(parent);
                     checkContent(first);
@@ -2497,7 +2512,7 @@
                 list = xmlStringGetNodeList(
                     getDoc(0),
                     value = getStr(0));
-                oomReport = (value != NULL && list == NULL);
+                oomReport = (value != NULL && value[0] != 0 && list == NULL);
                 xmlFreeNodeList(list);
                 endOp();
                 break;
@@ -2515,7 +2530,7 @@
                     doc,
                     value,
                     xmlStrlen(value));
-                oomReport = (value != NULL && list == NULL);
+                oomReport = (value != NULL && value[0] != 0 && list == NULL);
                 xmlFreeNodeList(list);
                 endOp();
                 break;
@@ -3007,7 +3022,7 @@
                 node = getNode(0);
                 type = node ? node->type : 0;
                 xmlValidCtxtPtr vctxt = xmlNewValidCtxt();
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
 
                 switch (type) {
                     case XML_DOCUMENT_NODE:
@@ -3169,7 +3184,7 @@
 
                 incStrIdx();
                 buffer = xmlBufferCreate();
-                xmlFuzzResetMallocFailed();
+                xmlFuzzResetFailure();
                 node = getNode(0);
                 doc = node ? node->doc : NULL;
                 level = getInt(0);
@@ -3292,8 +3307,9 @@
                 }
 
                 incStrIdx();
-                output = xmlAllocOutputBuffer(NULL);
-                xmlFuzzResetMallocFailed();
+                output = xmlOutputBufferCreateIO(xmlFuzzOutputWrite,
+                                                 xmlFuzzOutputClose, NULL, NULL);
+                xmlFuzzResetFailure();
                 node = getNode(0);
                 doc = node ? node->doc : NULL;
                 encoding = (const char *) getStr(1);
@@ -3344,16 +3360,17 @@
                 if (closed) {
                     if (res >= 0)
                         oomReport = 0;
+                    else
+                        ioReport = -1;
                     moveStr(0, NULL);
                 } else {
-                    oomReport =
-                        (output != NULL &&
-                         output->error == XML_ERR_NO_MEMORY);
                     if (argsOk && !output->error)
                         copyStr(0, xmlBufContent(output->buffer));
                     else
                         moveStr(0, NULL);
-                    xmlOutputBufferClose(output);
+                    res = xmlOutputBufferClose(output);
+                    oomReport = (res == -XML_ERR_NO_MEMORY);
+                    ioReport  = (res == -XML_IO_EIO);
                 }
                 endOp();
                 break;
@@ -3561,7 +3578,7 @@
                 break;
         }
 
-        xmlFuzzCheckMallocFailure(vars->opName, oomReport);
+        xmlFuzzCheckFailureReport(vars->opName, oomReport, ioReport);
     }
 
     for (i = 0; i < REG_MAX; i++)
@@ -3574,9 +3591,21 @@
         dropNode(node);
     }
 
-    xmlFuzzMemSetLimit(0);
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/fuzz.c b/fuzz/fuzz.c
index 3d0dbe1..5bcd40d 100644
--- a/fuzz/fuzz.c
+++ b/fuzz/fuzz.c
@@ -40,11 +40,14 @@
     /* The first entity is the main entity. */
     const char *mainUrl;
     xmlFuzzEntityInfo *mainEntity;
+    const char *secondaryUrl;
+    xmlFuzzEntityInfo *secondaryEntity;
 } fuzzData;
 
-size_t fuzzNumAllocs;
-size_t fuzzMaxAllocs;
+size_t fuzzNumAttempts;
+size_t fuzzFailurePos;
 int fuzzAllocFailed;
+int fuzzIoFailed;
 
 /**
  * xmlFuzzErrorFunc:
@@ -56,30 +59,72 @@
                  ...) {
 }
 
-/*
- * Malloc failure injection.
+/**
+ * xmlFuzzSErrorFunc:
  *
- * To debug issues involving malloc failures, it's often helpful to set
- * MALLOC_ABORT to 1. This should provide a backtrace of the failed
- * allocation.
+ * A structured error function that simply discards all errors.
+ */
+void
+xmlFuzzSErrorFunc(void *ctx ATTRIBUTE_UNUSED,
+                  const xmlError *error ATTRIBUTE_UNUSED) {
+}
+
+/*
+ * Failure injection.
+ *
+ * To debug issues involving injected failures, it's often helpful to set
+ * FAILURE_ABORT to 1. This should provide a backtrace of the failed
+ * operation.
  */
 
-#define XML_FUZZ_MALLOC_ABORT   0
+#define XML_FUZZ_FAILURE_ABORT   0
+
+void
+xmlFuzzInjectFailure(size_t failurePos) {
+    fuzzNumAttempts = 0;
+    fuzzFailurePos = failurePos;
+    fuzzAllocFailed = 0;
+    fuzzIoFailed = 0;
+}
+
+static int
+xmlFuzzTryMalloc(void) {
+    if (fuzzFailurePos > 0) {
+        fuzzNumAttempts += 1;
+        if (fuzzNumAttempts == fuzzFailurePos) {
+#if XML_FUZZ_FAILURE_ABORT
+            abort();
+#endif
+            fuzzAllocFailed = 1;
+            return -1;
+        }
+    }
+
+    return 0;
+}
+
+static int
+xmlFuzzTryIo(void) {
+    if (fuzzFailurePos > 0) {
+        fuzzNumAttempts += 1;
+        if (fuzzNumAttempts == fuzzFailurePos) {
+#if XML_FUZZ_FAILURE_ABORT
+            abort();
+#endif
+            fuzzIoFailed = 1;
+            return -1;
+        }
+    }
+
+    return 0;
+}
 
 static void *
 xmlFuzzMalloc(size_t size) {
     void *ret;
 
-    if (fuzzMaxAllocs > 0) {
-        fuzzNumAllocs += 1;
-        if (fuzzNumAllocs == fuzzMaxAllocs) {
-#if XML_FUZZ_MALLOC_ABORT
-            abort();
-#endif
-            fuzzAllocFailed = 1;
-            return NULL;
-        }
-    }
+    if (xmlFuzzTryMalloc() < 0)
+        return NULL;
 
     ret = malloc(size);
     if (ret == NULL)
@@ -92,16 +137,8 @@
 xmlFuzzRealloc(void *ptr, size_t size) {
     void *ret;
 
-    if (fuzzMaxAllocs > 0) {
-        fuzzNumAllocs += 1;
-        if (fuzzNumAllocs == fuzzMaxAllocs) {
-#if XML_FUZZ_MALLOC_ABORT
-            abort();
-#endif
-            fuzzAllocFailed = 1;
-            return NULL;
-        }
-    }
+    if (xmlFuzzTryMalloc() < 0)
+        return NULL;
 
     ret = realloc(ptr, size);
     if (ret == NULL)
@@ -115,31 +152,31 @@
     xmlMemSetup(free, xmlFuzzMalloc, xmlFuzzRealloc, xmlMemStrdup);
 }
 
-void
-xmlFuzzMemSetLimit(size_t limit) {
-    fuzzNumAllocs = 0;
-    fuzzMaxAllocs = limit;
-    fuzzAllocFailed = 0;
-}
-
 int
 xmlFuzzMallocFailed(void) {
     return fuzzAllocFailed;
 }
 
 void
-xmlFuzzResetMallocFailed(void) {
+xmlFuzzResetFailure(void) {
     fuzzAllocFailed = 0;
+    fuzzIoFailed = 0;
 }
 
 void
-xmlFuzzCheckMallocFailure(const char *func, int error) {
-    if (error >= 0 && fuzzAllocFailed != error) {
+xmlFuzzCheckFailureReport(const char *func, int oomReport, int ioReport) {
+    if (oomReport >= 0 && fuzzAllocFailed != oomReport) {
         fprintf(stderr, "%s: malloc failure %s reported\n",
                 func, fuzzAllocFailed ? "not" : "erroneously");
         abort();
     }
+    if (ioReport >= 0 && fuzzIoFailed != ioReport) {
+        fprintf(stderr, "%s: IO failure %s reported\n",
+                func, fuzzIoFailed ? "not" : "erroneously");
+        abort();
+    }
     fuzzAllocFailed = 0;
+    fuzzIoFailed = 0;
 }
 
 /**
@@ -160,6 +197,8 @@
     fuzzData.entities = xmlHashCreate(8);
     fuzzData.mainUrl = NULL;
     fuzzData.mainEntity = NULL;
+    fuzzData.secondaryUrl = NULL;
+    fuzzData.secondaryEntity = NULL;
 }
 
 /**
@@ -355,6 +394,9 @@
             if (num == 0) {
                 fuzzData.mainUrl = url;
                 fuzzData.mainEntity = entityInfo;
+            } else if (num == 1) {
+                fuzzData.secondaryUrl = url;
+                fuzzData.secondaryEntity = entityInfo;
             }
 
             num++;
@@ -387,42 +429,59 @@
 }
 
 /**
- * xmlFuzzEntityLoader:
+ * xmlFuzzSecondaryUrl:
  *
- * The entity loader for fuzz data.
+ * Returns the secondary URL.
  */
-xmlParserInputPtr
-xmlFuzzEntityLoader(const char *URL, const char *ID ATTRIBUTE_UNUSED,
-                    xmlParserCtxtPtr ctxt) {
+const char *
+xmlFuzzSecondaryUrl(void) {
+    return(fuzzData.secondaryUrl);
+}
+
+/**
+ * xmlFuzzSecondaryEntity:
+ * @size:  size of the secondary entity in bytes
+ *
+ * Returns the secondary entity.
+ */
+const char *
+xmlFuzzSecondaryEntity(size_t *size) {
+    if (fuzzData.secondaryEntity == NULL)
+        return(NULL);
+    *size = fuzzData.secondaryEntity->size;
+    return(fuzzData.secondaryEntity->data);
+}
+
+/**
+ * xmlFuzzResourceLoader:
+ *
+ * The resource loader for fuzz data.
+ */
+xmlParserErrors
+xmlFuzzResourceLoader(void *data ATTRIBUTE_UNUSED, const char *URL,
+                      const char *ID ATTRIBUTE_UNUSED,
+                      xmlResourceType type ATTRIBUTE_UNUSED,
+                      xmlParserInputFlags flags ATTRIBUTE_UNUSED,
+                      xmlParserInputPtr *out) {
     xmlParserInputPtr input;
     xmlFuzzEntityInfo *entity;
 
-    if (URL == NULL)
-        return(NULL);
     entity = xmlHashLookup(fuzzData.entities, (xmlChar *) URL);
     if (entity == NULL)
-        return(NULL);
+        return(XML_IO_ENOENT);
 
-    input = xmlNewInputStream(ctxt);
+    /* IO failure injection */
+    if (xmlFuzzTryIo() < 0)
+        return(XML_IO_EIO);
+
+    input = xmlNewInputFromMemory(URL, entity->data, entity->size,
+                                  XML_INPUT_BUF_STATIC |
+                                  XML_INPUT_BUF_ZERO_TERMINATED);
     if (input == NULL)
-        return(NULL);
-    input->filename = (char *) xmlCharStrdup(URL);
-    if (input->filename == NULL) {
-        xmlCtxtErrMemory(ctxt);
-        xmlFreeInputStream(input);
-        return(NULL);
-    }
-    input->buf = xmlParserInputBufferCreateMem(entity->data, entity->size,
-                                               XML_CHAR_ENCODING_NONE);
-    if (input->buf == NULL) {
-        xmlCtxtErrMemory(ctxt);
-        xmlFreeInputStream(input);
-        return(NULL);
-    }
-    input->base = input->cur = xmlBufContent(input->buf->buffer);
-    input->end = input->base + xmlBufUse(input->buf->buffer);
+        return(XML_ERR_NO_MEMORY);
 
-    return input;
+    *out = input;
+    return(XML_ERR_OK);
 }
 
 char *
@@ -454,3 +513,91 @@
     return(data);
 }
 
+int
+xmlFuzzOutputWrite(void *ctxt ATTRIBUTE_UNUSED,
+                   const char *buffer ATTRIBUTE_UNUSED, int len) {
+    if (xmlFuzzTryIo() < 0)
+        return -XML_IO_EIO;
+
+    return len;
+}
+
+int
+xmlFuzzOutputClose(void *ctxt ATTRIBUTE_UNUSED) {
+    if (xmlFuzzTryIo() < 0)
+        return XML_IO_EIO;
+
+    return 0;
+}
+
+/**
+ * xmlFuzzMutateChunks:
+ * @chunks: array of chunk descriptions
+ * @data: fuzz data (from LLVMFuzzerCustomMutator)
+ * @size: data size (from LLVMFuzzerCustomMutator)
+ * @maxSize: max data size (from LLVMFuzzerCustomMutator)
+ * @seed: seed (from LLVMFuzzerCustomMutator)
+ * @mutator: mutator function, use LLVMFuzzerMutate
+ *
+ * Mutates one of several chunks with a given probability.
+ *
+ * Probability is a value between 0 and XML_FUZZ_PROB_ONE.
+ *
+ * The last chunk has flexible size and must have size and
+ * mutateProb set to 0.
+ *
+ * Returns the size of the mutated data like LLVMFuzzerCustomMutator.
+ */
+size_t
+xmlFuzzMutateChunks(const xmlFuzzChunkDesc *chunks,
+                    char *data, size_t size, size_t maxSize, unsigned seed,
+                    xmlFuzzMutator mutator) {
+    size_t off = 0;
+    size_t ret, chunkSize, maxChunkSize, mutSize;
+    unsigned prob = seed % XML_FUZZ_PROB_ONE;
+    unsigned descSize = 0;
+    int i = 0;
+
+    while (1) {
+        unsigned descProb;
+
+        descSize = chunks[i].size;
+        descProb = chunks[i].mutateProb;
+
+        if (descSize == 0 ||
+            off + descSize > size ||
+            off + descSize >= maxSize ||
+            prob < descProb)
+            break;
+
+        off += descSize;
+        prob -= descProb;
+        i += 1;
+    }
+
+    chunkSize = size - off;
+    maxChunkSize = maxSize - off;
+
+    if (descSize != 0) {
+        if (chunkSize > descSize)
+            chunkSize = descSize;
+        if (maxChunkSize > descSize)
+            maxChunkSize = descSize;
+    }
+
+    mutSize = mutator(data + off, chunkSize, maxChunkSize);
+
+    if (size > off + chunkSize) {
+        size_t j;
+
+        for (j = mutSize; j < chunkSize; j++)
+            data[off + j] = 0;
+
+        ret = size;
+    } else {
+        ret = off + mutSize;
+    }
+
+    return ret;
+}
+
diff --git a/fuzz/fuzz.h b/fuzz/fuzz.h
index d07925f..48e83c1 100644
--- a/fuzz/fuzz.h
+++ b/fuzz/fuzz.h
@@ -15,6 +15,12 @@
 extern "C" {
 #endif
 
+#if __GNUC__ * 100 + __GNUC_MINOR__ >= 207 || defined(__clang__)
+  #define ATTRIBUTE_UNUSED __attribute__((unused))
+#else
+  #define ATTRIBUTE_UNUSED
+#endif
+
 #if defined(LIBXML_HTML_ENABLED)
   #define HAVE_HTML_FUZZER
 #endif
@@ -46,30 +52,49 @@
   #define HAVE_XPATH_FUZZER
 #endif
 
+#define XML_FUZZ_PROB_ONE (1u << 16)
+
+typedef size_t
+(*xmlFuzzMutator)(char *data, size_t size, size_t maxSize);
+
+typedef struct {
+    unsigned size;
+    unsigned mutateProb;
+} xmlFuzzChunkDesc;
+
 int
 LLVMFuzzerInitialize(int *argc, char ***argv);
 
 int
 LLVMFuzzerTestOneInput(const char *data, size_t size);
 
+size_t
+LLVMFuzzerMutate(char *data, size_t size, size_t maxSize);
+
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed);
+
 void
-xmlFuzzErrorFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg ATTRIBUTE_UNUSED,
-                 ...);
+xmlFuzzErrorFunc(void *ctx, const char *msg, ...);
+
+void
+xmlFuzzSErrorFunc(void *ctx, const xmlError *error);
 
 void
 xmlFuzzMemSetup(void);
 
 void
-xmlFuzzMemSetLimit(size_t limit);
+xmlFuzzInjectFailure(size_t failurePos);
 
 int
 xmlFuzzMallocFailed(void);
 
 void
-xmlFuzzResetMallocFailed(void);
+xmlFuzzResetFailure(void);
 
 void
-xmlFuzzCheckMallocFailure(const char *func, int expect);
+xmlFuzzCheckFailureReport(const char *func, int oomReport, int ioReport);
 
 void
 xmlFuzzDataInit(const char *data, size_t size);
@@ -104,12 +129,31 @@
 const char *
 xmlFuzzMainEntity(size_t *size);
 
-xmlParserInputPtr
-xmlFuzzEntityLoader(const char *URL, const char *ID, xmlParserCtxtPtr ctxt);
+const char *
+xmlFuzzSecondaryUrl(void);
+
+const char *
+xmlFuzzSecondaryEntity(size_t *size);
+
+xmlParserErrors
+xmlFuzzResourceLoader(void *data, const char *URL, const char *ID,
+                      xmlResourceType type, xmlParserInputFlags flags,
+                      xmlParserInputPtr *out);
 
 char *
 xmlSlurpFile(const char *path, size_t *size);
 
+int
+xmlFuzzOutputWrite(void *ctxt, const char *buffer, int len);
+
+int
+xmlFuzzOutputClose(void *ctxt);
+
+size_t
+xmlFuzzMutateChunks(const xmlFuzzChunkDesc *chunks,
+                    char *data, size_t size, size_t maxSize, unsigned seed,
+                    xmlFuzzMutator mutator);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/fuzz/genSeed.c b/fuzz/genSeed.c
index 334527e..6a98dc7 100644
--- a/fuzz/genSeed.c
+++ b/fuzz/genSeed.c
@@ -27,8 +27,9 @@
 #define SEED_BUF_SIZE 16384
 #define EXPR_SIZE 4500
 
-#define FLAG_READER (1 << 0)
-#define FLAG_LINT   (1 << 1)
+#define FLAG_READER             (1 << 0)
+#define FLAG_LINT               (1 << 1)
+#define FLAG_PUSH_CHUNK_SIZE    (1 << 2)
 
 typedef int
 (*fileFunc)(const char *base, FILE *out);
@@ -50,46 +51,54 @@
 #if defined(HAVE_SCHEMA_FUZZER) || \
     defined(HAVE_XML_FUZZER)
 /*
- * A custom entity loader that writes all external DTDs or entities to a
- * single file in the format expected by xmlFuzzEntityLoader.
+ * A custom resource loader that writes all external DTDs or entities to a
+ * single file in the format expected by xmlFuzzResourceLoader.
  */
-static xmlParserInputPtr
-fuzzEntityRecorder(const char *URL, const char *ID,
-                      xmlParserCtxtPtr ctxt) {
+static xmlParserErrors
+fuzzResourceRecorder(void *data ATTRIBUTE_UNUSED, const char *URL,
+                     const char *ID ATTRIBUTE_UNUSED,
+                     xmlResourceType type ATTRIBUTE_UNUSED,
+                     xmlParserInputFlags flags,
+                     xmlParserInputPtr *out) {
     xmlParserInputPtr in;
     static const int chunkSize = 16384;
-    int len;
+    int code, len;
 
-    in = xmlNoNetExternalEntityLoader(URL, ID, ctxt);
-    if (in == NULL)
-        return(NULL);
+    *out = NULL;
+
+    code = xmlNewInputFromUrl(URL, flags, &in);
+    if (code != XML_ERR_OK)
+        return(code);
 
     if (globalData.entities == NULL) {
         globalData.entities = xmlHashCreate(4);
     } else if (xmlHashLookup(globalData.entities,
                              (const xmlChar *) URL) != NULL) {
-        return(in);
+        *out = in;
+        return(XML_ERR_OK);
     }
 
     do {
-        len = xmlParserInputBufferGrow(in->buf, chunkSize);
+        len = xmlParserInputGrow(in, chunkSize);
         if (len < 0) {
             fprintf(stderr, "Error reading %s\n", URL);
             xmlFreeInputStream(in);
-            return(NULL);
+            return(in->buf->error);
         }
     } while (len > 0);
 
-    xmlFuzzWriteString(globalData.out, URL);
-    xmlFuzzWriteString(globalData.out,
-                       (char *) xmlBufContent(in->buf->buffer));
+    data = xmlStrdup(xmlBufContent(in->buf->buffer));
+    if (data == NULL) {
+        fprintf(stderr, "Error allocating entity data\n");
+        xmlFreeInputStream(in);
+        return(XML_ERR_NO_MEMORY);
+    }
 
     xmlFreeInputStream(in);
 
-    xmlHashAddEntry(globalData.entities, (const xmlChar *) URL,
-                    globalData.entities);
+    xmlHashAddEntry(globalData.entities, (const xmlChar *) URL, data);
 
-    return(xmlNoNetExternalEntityLoader(URL, ID, ctxt));
+    return(xmlNewInputFromUrl(URL, flags, out));
 }
 
 static void
@@ -97,13 +106,26 @@
     globalData.out = out;
     globalData.entities = xmlHashCreate(8);
     globalData.oldLoader = xmlGetExternalEntityLoader();
-    xmlSetExternalEntityLoader(fuzzEntityRecorder);
+}
+
+static void
+fuzzRecorderWriteAndFree(void *entry, const xmlChar *file) {
+    char *data = entry;
+    xmlFuzzWriteString(globalData.out, (const char *) file);
+    xmlFuzzWriteString(globalData.out, data);
+    xmlFree(data);
+}
+
+static void
+fuzzRecorderWrite(const char *file) {
+    xmlHashRemoveEntry(globalData.entities, (const xmlChar *) file,
+                       fuzzRecorderWriteAndFree);
 }
 
 static void
 fuzzRecorderCleanup(void) {
-    xmlSetExternalEntityLoader(globalData.oldLoader);
-    xmlHashFree(globalData.entities, NULL);
+    /* Write remaining entities (in random order). */
+    xmlHashFree(globalData.entities, fuzzRecorderWriteAndFree);
     globalData.out = NULL;
     globalData.entities = NULL;
     globalData.oldLoader = NULL;
@@ -114,6 +136,7 @@
 static int
 processXml(const char *docFile, FILE *out) {
     int opts = XML_PARSE_NOENT | XML_PARSE_DTDLOAD;
+    xmlParserCtxtPtr ctxt;
     xmlDocPtr doc;
 
     if (globalData.flags & FLAG_LINT) {
@@ -138,6 +161,11 @@
         /* Max allocations. */
         xmlFuzzWriteInt(out, 0, 4);
 
+        if (globalData.flags & FLAG_PUSH_CHUNK_SIZE) {
+            /* Chunk size for push parser */
+            xmlFuzzWriteInt(out, 256, 4);
+        }
+
         if (globalData.flags & FLAG_READER) {
             /* Initial reader program with a couple of OP_READs */
             xmlFuzzWriteString(out, "\x01\x01\x01\x01\x01\x01\x01\x01");
@@ -146,12 +174,25 @@
 
     fuzzRecorderInit(out);
 
-    doc = xmlReadFile(docFile, NULL, opts);
+    ctxt = xmlNewParserCtxt();
+    xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+    xmlCtxtSetResourceLoader(ctxt, fuzzResourceRecorder, NULL);
+    doc = xmlCtxtReadFile(ctxt, docFile, NULL, opts);
 #ifdef LIBXML_XINCLUDE_ENABLED
-    xmlXIncludeProcessFlags(doc, opts);
+    {
+        xmlXIncludeCtxtPtr xinc = xmlXIncludeNewContext(doc);
+
+        xmlXIncludeSetErrorHandler(xinc, xmlFuzzSErrorFunc, NULL);
+        xmlXIncludeSetResourceLoader(xinc, fuzzResourceRecorder, NULL);
+        xmlXIncludeSetFlags(xinc, opts);
+        xmlXIncludeProcessNode(xinc, (xmlNodePtr) doc);
+        xmlXIncludeFreeContext(xinc);
+    }
 #endif
     xmlFreeDoc(doc);
+    xmlFreeParserCtxt(ctxt);
 
+    fuzzRecorderWrite(docFile);
     fuzzRecorderCleanup();
 
     return(0);
@@ -187,31 +228,7 @@
 }
 #endif
 
-#ifdef HAVE_SCHEMA_FUZZER
-static int
-processSchema(const char *docFile, FILE *out) {
-    xmlSchemaPtr schema;
-    xmlSchemaParserCtxtPtr pctxt;
-
-    /* Max allocations. */
-    xmlFuzzWriteInt(out, 0, 4);
-
-    fuzzRecorderInit(out);
-
-    pctxt = xmlSchemaNewParserCtxt(docFile);
-    xmlSchemaSetParserErrors(pctxt, xmlFuzzErrorFunc, xmlFuzzErrorFunc, NULL);
-    schema = xmlSchemaParse(pctxt);
-    xmlSchemaFreeParserCtxt(pctxt);
-    xmlSchemaFree(schema);
-
-    fuzzRecorderCleanup();
-
-    return(0);
-}
-#endif
-
 #if defined(HAVE_HTML_FUZZER) || \
-    defined(HAVE_SCHEMA_FUZZER) || \
     defined(HAVE_XML_FUZZER)
 static int
 processPattern(const char *pattern) {
@@ -292,6 +309,175 @@
 }
 #endif
 
+#if defined(HAVE_SCHEMA_FUZZER)
+static int
+processSchema(const char *xsdFile, const char *xmlFile, FILE *out) {
+    xmlSchemaPtr schema;
+    xmlSchemaParserCtxtPtr pctxt;
+
+    /* Max allocations. */
+    xmlFuzzWriteInt(out, 0, 4);
+
+    fuzzRecorderInit(out);
+
+    pctxt = xmlSchemaNewParserCtxt(xsdFile);
+    xmlSchemaSetParserStructuredErrors(pctxt, xmlFuzzSErrorFunc, NULL);
+    xmlSchemaSetResourceLoader(pctxt, fuzzResourceRecorder, NULL);
+    schema = xmlSchemaParse(pctxt);
+    xmlSchemaFreeParserCtxt(pctxt);
+
+    if (schema != NULL) {
+        xmlSchemaValidCtxtPtr vctxt;
+        xmlParserCtxtPtr ctxt;
+        xmlDocPtr doc;
+
+        ctxt = xmlNewParserCtxt();
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        xmlCtxtSetResourceLoader(ctxt, fuzzResourceRecorder, NULL);
+        doc = xmlCtxtReadFile(ctxt, xmlFile, NULL, XML_PARSE_NOENT);
+        xmlFreeParserCtxt(ctxt);
+
+        vctxt = xmlSchemaNewValidCtxt(schema);
+        xmlSchemaSetValidStructuredErrors(vctxt, xmlFuzzSErrorFunc, NULL);
+        xmlSchemaValidateDoc(vctxt, doc);
+        xmlSchemaFreeValidCtxt(vctxt);
+
+        xmlFreeDoc(doc);
+        xmlSchemaFree(schema);
+    }
+
+    fuzzRecorderWrite(xsdFile);
+    fuzzRecorderWrite(xmlFile);
+    fuzzRecorderCleanup();
+
+    return(0);
+}
+
+static int
+processSchemaPattern(const char *pattern) {
+    glob_t globbuf;
+    int ret = 0;
+    int res;
+    size_t i;
+
+    res = glob(pattern, 0, NULL, &globbuf);
+    if (res == GLOB_NOMATCH)
+        return(0);
+    if (res != 0) {
+        fprintf(stderr, "couldn't match pattern %s\n", pattern);
+        return(-1);
+    }
+
+    for (i = 0; i < globbuf.gl_pathc; i++) {
+        glob_t globbuf2;
+        struct stat statbuf;
+        char xmlPattern[PATH_SIZE];
+        char *dirBuf = NULL;
+        char *baseBuf = NULL;
+        const char *path, *dir, *base;
+        size_t size, dirLen, baseLen, len, j;
+
+        path = globbuf.gl_pathv[i];
+
+        if ((stat(path, &statbuf) != 0) || (!S_ISREG(statbuf.st_mode)))
+            continue;
+
+        dirBuf = (char *) xmlCharStrdup(path);
+        baseBuf = (char *) xmlCharStrdup(path);
+        if ((dirBuf == NULL) || (baseBuf == NULL)) {
+            fprintf(stderr, "memory allocation failed\n");
+            ret = -1;
+            goto error;
+        }
+        dir = dirname(dirBuf);
+        dirLen = strlen(dir);
+        base = basename(baseBuf);
+        baseLen = strlen(base);
+
+        len = strlen(path);
+        if (len <= 5)
+            continue;
+        /* Strip .xsl or _0.xsd suffix */
+        if (len > 6 && path[len - 6] == '_')
+            len -= 6;
+        else
+            len -= 4;
+        size = snprintf(xmlPattern, sizeof(xmlPattern), "%.*s_*.xml",
+                        (int) len, path);
+        if (size >= PATH_SIZE) {
+            fprintf(stderr, "creating path failed\n");
+            ret = -1;
+            goto error;
+        }
+
+        res = glob(xmlPattern, 0, NULL, &globbuf2);
+        if (res == GLOB_NOMATCH)
+            goto error;
+        if (res != 0) {
+            fprintf(stderr, "couldn't match pattern %s\n", xmlPattern);
+            ret = -1;
+            goto error;
+        }
+
+        for (j = 0; j < globbuf2.gl_pathc; j++) {
+            char outPath[PATH_SIZE];
+            const char *xmlFile;
+            FILE *out = NULL;
+
+            xmlFile = globbuf2.gl_pathv[j];
+
+            len = strlen(xmlFile);
+            if (len < dirLen + 7)
+                continue;
+            if (len >= 6 && xmlFile[len - 6] == '_')
+                size = snprintf(outPath, sizeof(outPath), "seed/%s/%.*s_%c",
+                                globalData.fuzzer, (int) baseLen - 4, base,
+                                xmlFile[len - 5]);
+            else
+                size = snprintf(outPath, sizeof(outPath), "seed/%s/%.*s",
+                                globalData.fuzzer, (int) baseLen - 4, base);
+
+            if (size >= PATH_SIZE) {
+                fprintf(stderr, "creating path failed\n");
+                ret = -1;
+                continue;
+            }
+            out = fopen(outPath, "wb");
+            if (out == NULL) {
+                fprintf(stderr, "couldn't open %s for writing\n", outPath);
+                ret = -1;
+                continue;
+            }
+
+            if (chdir(dir) != 0) {
+                fprintf(stderr, "couldn't chdir to %s\n", dir);
+                ret = -1;
+            } else {
+                if (processSchema(base, xmlFile + dirLen + 1, out) != 0)
+                    ret = -1;
+            }
+
+            fclose(out);
+
+            if (chdir(globalData.cwd) != 0) {
+                fprintf(stderr, "couldn't chdir to %s\n", globalData.cwd);
+                ret = -1;
+                break;
+            }
+        }
+
+        globfree(&globbuf2);
+
+error:
+        xmlFree(dirBuf);
+        xmlFree(baseBuf);
+    }
+
+    globfree(&globbuf);
+    return(ret);
+}
+#endif
+
 #ifdef HAVE_XPATH_FUZZER
 static int
 processXPath(const char *testDir, const char *prefix, const char *name,
@@ -435,12 +621,11 @@
         return(1);
     }
 
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-
     fuzzer = argv[1];
     if (strcmp(fuzzer, "html") == 0) {
 #ifdef HAVE_HTML_FUZZER
         processArg = processPattern;
+        globalData.flags |= FLAG_PUSH_CHUNK_SIZE;
         globalData.processFile = processHtml;
 #endif
     } else if (strcmp(fuzzer, "lint") == 0) {
@@ -457,8 +642,7 @@
 #endif
     } else if (strcmp(fuzzer, "schema") == 0) {
 #ifdef HAVE_SCHEMA_FUZZER
-        processArg = processPattern;
-        globalData.processFile = processSchema;
+        processArg = processSchemaPattern;
 #endif
     } else if (strcmp(fuzzer, "valid") == 0) {
 #ifdef HAVE_VALID_FUZZER
@@ -473,6 +657,7 @@
     } else if (strcmp(fuzzer, "xml") == 0) {
 #ifdef HAVE_XML_FUZZER
         processArg = processPattern;
+        globalData.flags |= FLAG_PUSH_CHUNK_SIZE;
         globalData.processFile = processXml;
 #endif
     } else if (strcmp(fuzzer, "xpath") == 0) {
diff --git a/fuzz/html.c b/fuzz/html.c
index 0173ed8..1c67819 100644
--- a/fuzz/html.c
+++ b/fuzz/html.c
@@ -4,6 +4,10 @@
  * See Copyright for the status of this software.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include <libxml/HTMLparser.h>
 #include <libxml/HTMLtree.h>
 #include <libxml/catalog.h>
@@ -18,7 +22,6 @@
     xmlInitializeCatalog();
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
 
     return 0;
 }
@@ -28,12 +31,19 @@
     xmlParserCtxtPtr ctxt;
     htmlDocPtr doc;
     const char *docBuffer;
-    size_t maxAlloc, docSize;
-    int opts;
+    size_t failurePos, docSize, maxChunkSize;
+    int opts, errorCode;
+#ifdef LIBXML_OUTPUT_ENABLED
+    xmlOutputBufferPtr out = NULL;
+#endif
 
     xmlFuzzDataInit(data, size);
     opts = (int) xmlFuzzReadInt(4);
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
+
+    maxChunkSize = xmlFuzzReadInt(4) % (size + size / 8 + 1);
+    if (maxChunkSize == 0)
+        maxChunkSize = 1;
 
     docBuffer = xmlFuzzReadRemaining(&docSize);
     if (docBuffer == NULL) {
@@ -43,18 +53,22 @@
 
     /* Pull parser */
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
     ctxt = htmlNewParserCtxt();
-    if (ctxt != NULL) {
+    if (ctxt == NULL) {
+        errorCode = XML_ERR_NO_MEMORY;
+    } else {
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
         doc = htmlCtxtReadMemory(ctxt, docBuffer, docSize, NULL, NULL, opts);
-        xmlFuzzCheckMallocFailure("htmlCtxtReadMemory",
-                                  ctxt->errNo == XML_ERR_NO_MEMORY);
+        errorCode = ctxt->errNo;
+        xmlFuzzCheckFailureReport("htmlCtxtReadMemory",
+                                  errorCode == XML_ERR_NO_MEMORY,
+                                  errorCode == XML_IO_EIO);
 
         if (doc != NULL) {
             xmlDocPtr copy;
 
 #ifdef LIBXML_OUTPUT_ENABLED
-            xmlOutputBufferPtr out;
             const xmlChar *content;
 
             /*
@@ -65,13 +79,16 @@
             out = xmlAllocOutputBuffer(NULL);
             htmlDocContentDumpOutput(out, doc, NULL);
             content = xmlOutputBufferGetContent(out);
-            xmlOutputBufferClose(out);
-            xmlFuzzCheckMallocFailure("htmlDocContentDumpOutput",
-                                      content == NULL);
+            xmlFuzzCheckFailureReport("htmlDocContentDumpOutput",
+                                      content == NULL, 0);
+            if (content == NULL) {
+                xmlOutputBufferClose(out);
+                out = NULL;
+            }
 #endif
 
             copy = xmlCopyDoc(doc, 1);
-            xmlFuzzCheckMallocFailure("xmlCopyNode", copy == NULL);
+            xmlFuzzCheckFailureReport("xmlCopyNode", copy == NULL, 0);
             xmlFreeDoc(copy);
 
             xmlFreeDoc(doc);
@@ -84,39 +101,136 @@
     /* Push parser */
 
 #ifdef LIBXML_PUSH_ENABLED
-    {
-        static const size_t maxChunkSize = 128;
-        size_t consumed, chunkSize;
+    xmlFuzzInjectFailure(failurePos);
+    ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL,
+                                    XML_CHAR_ENCODING_NONE);
 
-        xmlFuzzMemSetLimit(maxAlloc);
-        ctxt = htmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL,
-                                        XML_CHAR_ENCODING_NONE);
+    if (ctxt != NULL) {
+        size_t consumed;
+        int errorCodePush, numChunks, maxChunks;
 
-        if (ctxt != NULL) {
-            htmlCtxtUseOptions(ctxt, opts);
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        htmlCtxtUseOptions(ctxt, opts);
 
-            for (consumed = 0; consumed < docSize; consumed += chunkSize) {
-                chunkSize = docSize - consumed;
-                if (chunkSize > maxChunkSize)
-                    chunkSize = maxChunkSize;
-                htmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
+        consumed = 0;
+        numChunks = 0;
+        maxChunks = 50 + docSize / 100;
+        while (numChunks == 0 ||
+               (consumed < docSize && numChunks < maxChunks)) {
+            size_t chunkSize;
+            int terminate;
+
+            numChunks += 1;
+            chunkSize = docSize - consumed;
+
+            if (numChunks < maxChunks && chunkSize > maxChunkSize) {
+                chunkSize = maxChunkSize;
+                terminate = 0;
+            } else {
+                terminate = 1;
             }
 
-            htmlParseChunk(ctxt, NULL, 0, 1);
-            xmlFuzzCheckMallocFailure("htmlParseChunk",
-                                      ctxt->errNo == XML_ERR_NO_MEMORY);
-            xmlFreeDoc(ctxt->myDoc);
-            htmlFreeParserCtxt(ctxt);
+            htmlParseChunk(ctxt, docBuffer + consumed, chunkSize, terminate);
+            consumed += chunkSize;
         }
+
+        errorCodePush = ctxt->errNo;
+        xmlFuzzCheckFailureReport("htmlParseChunk",
+                                  errorCodePush == XML_ERR_NO_MEMORY,
+                                  errorCodePush == XML_IO_EIO);
+        doc = ctxt->myDoc;
+
+        /*
+         * Push and pull parser differ in when exactly they
+         * stop parsing, and the error code is the *last* error
+         * reported, so we can't check whether the codes match.
+         */
+        if (errorCode != XML_ERR_NO_MEMORY &&
+            errorCode != XML_IO_EIO &&
+            errorCodePush != XML_ERR_NO_MEMORY &&
+            errorCodePush != XML_IO_EIO &&
+            (errorCode == XML_ERR_OK) != (errorCodePush == XML_ERR_OK)) {
+            fprintf(stderr, "pull/push parser error mismatch: %d != %d\n",
+                    errorCode, errorCodePush);
+#if 0
+            FILE *f = fopen("c.html", "wb");
+            fwrite(docBuffer, docSize, 1, f);
+            fclose(f);
+            fprintf(stderr, "opts: %X\n", opts);
+#endif
+            abort();
+        }
+
+#ifdef LIBXML_OUTPUT_ENABLED
+        /*
+         * Verify that pull and push parser produce the same result.
+         *
+         * The NOBLANKS option doesn't work reliably in push mode.
+         */
+        if ((opts & XML_PARSE_NOBLANKS) == 0 &&
+            errorCode == XML_ERR_OK &&
+            errorCodePush == XML_ERR_OK &&
+            out != NULL) {
+            xmlOutputBufferPtr outPush;
+            const xmlChar *content, *contentPush;
+
+            outPush = xmlAllocOutputBuffer(NULL);
+            htmlDocContentDumpOutput(outPush, doc, NULL);
+            content = xmlOutputBufferGetContent(out);
+            contentPush = xmlOutputBufferGetContent(outPush);
+
+            if (content != NULL && contentPush != NULL) {
+                size_t outSize = xmlOutputBufferGetSize(out);
+
+                if (outSize != xmlOutputBufferGetSize(outPush) ||
+                    memcmp(content, contentPush, outSize) != 0) {
+                    fprintf(stderr, "pull/push parser roundtrip "
+                            "mismatch\n");
+#if 0
+                    FILE *f = fopen("c.html", "wb");
+                    fwrite(docBuffer, docSize, 1, f);
+                    fclose(f);
+                    fprintf(stderr, "opts: %X\n", opts);
+                    fprintf(stderr, "---\n%s\n---\n%s\n---\n",
+                            xmlOutputBufferGetContent(out),
+                            xmlOutputBufferGetContent(outPush));
+#endif
+                    abort();
+                }
+            }
+
+            xmlOutputBufferClose(outPush);
+        }
+#endif
+
+        xmlFreeDoc(doc);
+        htmlFreeParserCtxt(ctxt);
     }
 #endif
 
     /* Cleanup */
 
-    xmlFuzzMemSetLimit(0);
+#ifdef LIBXML_OUTPUT_ENABLED
+    xmlOutputBufferClose(out);
+#endif
+
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
 
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* opts */
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/lint.c b/fuzz/lint.c
index 5e71d0e..82de44b 100644
--- a/fuzz/lint.c
+++ b/fuzz/lint.c
@@ -1,5 +1,5 @@
 /*
- * xml.c: a libFuzzer target to test several XML parser interfaces.
+ * lint.c: a libFuzzer target to test the xmllint executable.
  *
  * See Copyright for the status of this software.
  */
@@ -14,10 +14,31 @@
 #include <libxml/xmlerror.h>
 #include <libxml/xmlmemory.h>
 
+#include "private/lint.h"
+
 #include "fuzz.h"
 
-#define XMLLINT_FUZZ
-#include "../xmllint.c"
+/*
+ * Untested options:
+ *
+ * --memory: Requires temp file
+ *
+ * --catalogs: Requires XML catalogs
+ *
+ * --dtdvalid:
+ * --dtdvalidfpi: Requires an external DTD
+ *
+ * --output: Writes to disk
+ *
+ * --path: Requires cooperation with resource loader
+ *
+ * --relaxng:
+ * --schema:
+ * --schematron: Requires schemas
+ *
+ * --shell: We could pipe fuzz data to stdin but this is probably
+ *          not worth it.
+ */
 
 static const char *const switches[] = {
     "--auto",
@@ -36,7 +57,7 @@
     "--insert",
     "--loaddtd",
     "--load-trace",
-    "--memory",
+    NULL,
     "--noblanks",
     "--nocdata",
     "--nocompact",
@@ -58,6 +79,7 @@
     "--pushsmall",
     "--quiet",
     "--recover",
+    "--repeat",
     "--sax1",
     "--testIO",
     "--timing",
@@ -109,6 +131,11 @@
     unsigned uval;
     int ival;
 
+    if (xmlMemUsed() != 0) {
+        fprintf(stderr, "Undetected leak in previous iteration\n");
+        abort();
+    }
+
     vars.argv = malloc((numSwitches + 5 + 6 * 2) * sizeof(vars.argv[0]));
     vars.argi = 0;
     pushArg("xmllint"),
@@ -198,12 +225,11 @@
     pushArg(NULL);
 
     xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 #ifdef LIBXML_CATALOG_ENABLED
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
 
-    xmllintMain(vars.argi - 1, vars.argv);
+    xmllintMain(vars.argi - 1, vars.argv, stdout, xmlFuzzResourceLoader);
 
     xmlMemSetup(free, malloc, realloc, xmlMemStrdup);
 
@@ -212,3 +238,19 @@
     free(vars.argv);
     return(0);
 }
+
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 8, XML_FUZZ_PROB_ONE / 10  }, /* switches */
+        { 4, XML_FUZZ_PROB_ONE / 10  }, /* maxmem */
+        { 1, XML_FUZZ_PROB_ONE / 100 }, /* maxAmpl */
+        { 1, XML_FUZZ_PROB_ONE / 100 }, /* pretty */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/lint.dict b/fuzz/lint.dict
new file mode 100644
index 0000000..fe20628
--- /dev/null
+++ b/fuzz/lint.dict
@@ -0,0 +1,192 @@
+xml_decl="<?xml version='1.0'?>"
+xml_decl_standalone="<?xml version='1.0' standalone='1'?>"
+xml_decl_latin1="<?xml version='1.0' encoding='ISO-8859-1'?>"
+
+elem_start_end="<a></a>"
+elem_empty="<a/>"
+elem_ns_start_end="<a:a xmlns:a='a'></a:a>"
+elem_ns_empty="<a:a xmlns:a='a'/>"
+
+attr=" a='a'"
+
+ns_decl=" xmlns:a='a'"
+ns_default=" xmlns='a'"
+ns_prefix="a:"
+
+cdata_section="<![CDATA[ ]]>"
+
+comment="<!-- -->"
+
+pi="<?a?>"
+
+doctype="<!DOCTYPE a []>"
+doctype_system="<!DOCTYPE a SYSTEM 'a' []>"
+doctype_system="<!DOCTYPE a PUBLIC 'a' 'a' []>"
+
+elem_decl_any="<!ELEMENT a ANY>"
+elem_decl_empty="<!ELEMENT a EMPTY>"
+elem_decl_children="<!ELEMENT a (a)>"
+elem_decl_mixed="<!ELEMENT a (#PCDATA|a)>"
+elem_children_choice="|a"
+elem_children_seq=",a"
+elem_children_sub_choice="|(a)"
+elem_children_sub_seq=",(a)"
+elem_quant_any="*"
+elem_quant_opt="?"
+elem_quant_some="+"
+
+attr_decl_cdata_req="<!ATTLIST a a CDATA #REQUIRED>"
+attr_decl_cdata_imp="<!ATTLIST a a CDATA #IMPLIED>"
+attr_decl_cdata_def="<!ATTLIST a a CDATA 'a'>"
+attr_decl_cdata_fix="<!ATTLIST a a CDATA #FIXED 'a'>"
+attr_decl_id_imp="<!ATTLIST a a ID #IMPLIED>"
+attr_decl_id_req="<!ATTLIST a a ID #REQUIRED>"
+attr_decl_id_def="<!ATTLIST a a ID 'a'>"
+attr_decl_id_fix="<!ATTLIST a a ID #FIXED 'a'>"
+attr_decl_idref_imp="<!ATTLIST a a IDREF #IMPLIED>"
+attr_decl_idref_req="<!ATTLIST a a IDREF #REQUIRED>"
+attr_decl_idref_def="<!ATTLIST a a IDREF 'a'>"
+attr_decl_idref_fix="<!ATTLIST a a IDREF #FIXED 'a'>"
+attr_decl_idrefs_imp="<!ATTLIST a a IDREFS #IMPLIED>"
+attr_decl_idrefs_req="<!ATTLIST a a IDREFS #REQUIRED>"
+attr_decl_idrefs_def="<!ATTLIST a a IDREFS 'a'>"
+attr_decl_idrefs_fix="<!ATTLIST a a IDREFS #FIXED 'a'>"
+attr_decl_entity_imp="<!ATTLIST a a ENTITY #IMPLIED>"
+attr_decl_entity_req="<!ATTLIST a a ENTITY #REQUIRED>"
+attr_decl_entity_def="<!ATTLIST a a ENTITY 'a'>"
+attr_decl_entity_fix="<!ATTLIST a a ENTITY #FIXED 'a'>"
+attr_decl_entities_imp="<!ATTLIST a a ENTITIES #IMPLIED>"
+attr_decl_entities_req="<!ATTLIST a a ENTITIES #REQUIRED>"
+attr_decl_entities_def="<!ATTLIST a a ENTITIES 'a'>"
+attr_decl_entities_fix="<!ATTLIST a a ENTITIES #FIXED 'a'>"
+attr_decl_nmtoken_imp="<!ATTLIST a a NMTOKEN #IMPLIED>"
+attr_decl_nmtoken_req="<!ATTLIST a a NMTOKEN #REQUIRED>"
+attr_decl_nmtoken_def="<!ATTLIST a a NMTOKEN 'a'>"
+attr_decl_nmtoken_fix="<!ATTLIST a a NMTOKEN #FIXED 'a'>"
+attr_decl_nmtokens_imp="<!ATTLIST a a NMTOKENS #IMPLIED>"
+attr_decl_nmtokens_req="<!ATTLIST a a NMTOKENS #REQUIRED>"
+attr_decl_nmtokens_def="<!ATTLIST a a NMTOKENS 'a'>"
+attr_decl_nmtokens_fix="<!ATTLIST a a NMTOKENS #FIXED 'a'>"
+attr_decl_enum_imp="<!ATTLIST a a (a) #IMPLIED>"
+attr_decl_enum_req="<!ATTLIST a a (a) #REQUIRED>"
+attr_decl_enum_def="<!ATTLIST a a (a) 'a'>"
+attr_decl_enum_fix="<!ATTLIST a a (a) #FIXED 'a'>"
+attr_decl_notation_imp="<!ATTLIST a a NOTATION (a) #IMPLIED>"
+attr_decl_notation_req="<!ATTLIST a a NOTATION (a) #REQUIRED>"
+attr_decl_notation_def="<!ATTLIST a a NOTATION (a) 'a'>"
+attr_decl_notation_fix="<!ATTLIST a a NOTATION (a) #FIXED 'a'>"
+
+include_sect="<![INCLUDE[ ]]>"
+ignore_sect="<![IGNORE[ ]]>"
+
+ge_decl="<!ENTITY a 'a'>"
+ge_decl_system="<!ENTITY a SYSTEM 'a'>"
+ge_decl_system_ndata="<!ENTITY a SYSTEM 'a' NDATA a>"
+ge_decl_public="<!ENTITY a PUBLIC 'a' 'a'>"
+ge_decl_public_ndata="<!ENTITY a PUBLIC 'a' 'a' NDATA a>"
+
+pe_decl="<!ENTITY % a 'a'>"
+pe_decl_system="<!ENTITY % a SYSTEM 'a'>"
+pe_decl_public="<!ENTITY % a PUBLIC 'a' 'a'>"
+
+char_ref_dec="&#60;"
+char_ref_hex="&#x3c;"
+char_ref_quoted="&#38;#60;"
+
+ge_ref_lt="&lt;"
+ge_ref_gt="&gt;"
+ge_ref_amp="&amp;"
+ge_ref_apos="&apos;"
+ge_ref_quot="&quot;"
+ge_ref="&a;"
+ge_ref_quoted="&#38;a;"
+
+pe_ref="%a;"
+pe_ref_quoted="&#37;a;"
+
+notation_decl_public="<!NOTATION a PUBLIC 'a'>"
+notation_decl_system="<!NOTATION a SYSTEM 'a'>"
+
+cs_utf8="UTF-8"
+cs_utf16="UTF-16"
+cs_utf16le="UTF-16LE"
+cs_utf16be="UTF-16BE"
+cs_ucs2="UCS-2"
+cs_ucs4="UCS-4"
+cs_latin1="ISO-8859-1"
+cs_ascii="ASCII"
+cs_ebcdic="EBCDIC"
+cs_iso2022jp="ISO-2022-JP"
+cs_shift_jis="SHIFT_JIS"
+cs_euc_jp="EUC-JP"
+
+# XPath
+
+axis_ancestor="ancestor::"
+axis_ancestor_or_self="ancestor-or-self::"
+axis_attribute="attribute::"
+axis_attribute_abbrev="@"
+axis_child="child::"
+axis_descendant="descendant::"
+axis_descendant_or_self="descendant-or-self::"
+axis_following="following::"
+axis_following_sibling="following-sibling::"
+axis_namespace="namespace::"
+axis_parent="parent::"
+axis_preceding="preceding::"
+axis_preceding_siblings="preceding-sibling::"
+axis_self="self::"
+
+node_test_ns="a:"
+
+val_num="=(1.0)"
+val_str_sq="=('a')"
+val_str_dq="=(\"a\")"
+val_node_set="=(*)"
+val_elem="=(b)"
+
+step_root="/"
+step_descendant="//"
+step_any="//*"
+step_any_l="*//"
+step_elem="//b"
+step_ns_elem="//a:a"
+step_comment="//comment()"
+step_node="//node()"
+step_node_l="node()//"
+step_pi="//processing-instruction()"
+step_text="//text()"
+step_parent="../"
+
+op_plus="+1"
+op_minus=" - 1"
+op_neg="-"
+op_mul="*1"
+op_div=" div 1"
+op_mod=" mod 1"
+op_and=" and 1"
+op_or=" or 1"
+op_ne="!=1"
+op_lt="<1"
+op_gt=">1"
+op_le="<=1"
+op_ge=">=1"
+op_predicate_num="[1]"
+op_predicate_last="[last()]"
+op_predicate_str="['a']"
+op_predicate="[1=1]"
+op_arg_num=",1"
+op_arg_str=",'a'"
+op_arg_node=",*"
+op_union="|//b"
+
+var_num="=$f"
+var_bool="=$b"
+var_str="=$s"
+var_node_set="=$n"
+
+# Unicode
+
+utf8_2="\xC3\x84"
+utf8_3="\xE2\x80\x9C"
+utf8_4="\xF0\x9F\x98\x80"
diff --git a/fuzz/oss-fuzz-build.sh b/fuzz/oss-fuzz-build.sh
index 3e8945f..07beeb1 100755
--- a/fuzz/oss-fuzz-build.sh
+++ b/fuzz/oss-fuzz-build.sh
@@ -41,10 +41,14 @@
 for fuzzer in \
     api html lint reader regexp schema uri valid xinclude xml xpath
 do
-    make $fuzzer.o
+    OBJS="$fuzzer.o"
+    if [ "$fuzzer" = lint ]; then
+        OBJS="$OBJS ../xmllint.o ../shell.o"
+    fi
+    make $OBJS
     # Link with $CXX
     $CXX $CXXFLAGS \
-        $fuzzer.o fuzz.o \
+        $OBJS fuzz.o \
         -o $OUT/$fuzzer \
         $LIB_FUZZING_ENGINE \
         ../.libs/libxml2.a -Wl,-Bstatic -lz -llzma -Wl,-Bdynamic
diff --git a/fuzz/reader.c b/fuzz/reader.c
index 5721d35..62c3db0 100644
--- a/fuzz/reader.c
+++ b/fuzz/reader.c
@@ -1,5 +1,5 @@
 /*
- * xml.c: a libFuzzer target to test several XML parser interfaces.
+ * reader.c: a libFuzzer target to test the XML Reader API.
  *
  * See Copyright for the status of this software.
  */
@@ -15,9 +15,7 @@
 #include <string.h>
 
 #if 0
-  #define DEBUG printf
-#else
-  #define DEBUG noop
+  #define DEBUG
 #endif
 
 typedef enum {
@@ -82,14 +80,11 @@
 } opType;
 
 static void
-noop(const char *fmt, ...) {
-    (void) fmt;
-}
-
-static void
 startOp(const char *name) {
     (void) name;
-    DEBUG("%s\n", name);
+#ifdef DEBUG
+    fprintf(stderr, "%s\n", name);
+#endif
 }
 
 int
@@ -101,8 +96,6 @@
     xmlInitializeCatalog();
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 
     return 0;
 }
@@ -114,14 +107,14 @@
     const xmlError *error;
     const char *docBuffer;
     const unsigned char *program;
-    size_t maxAlloc, docSize, programSize, i;
+    size_t failurePos, docSize, programSize, i;
     size_t totalStringSize = 0;
     int opts;
     int oomReport = 0;
 
     xmlFuzzDataInit(data, size);
     opts = (int) xmlFuzzReadInt(4);
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
 
     program = (const unsigned char *) xmlFuzzReadString(&programSize);
     if (programSize > 1000)
@@ -132,11 +125,27 @@
     if (docBuffer == NULL)
         goto exit;
 
-    xmlFuzzMemSetLimit(maxAlloc);
+#ifdef DEBUG
+    fprintf(stderr, "Input document (%d bytes):\n", (int) docSize);
+    for (i = 0; (size_t) i < docSize; i++) {
+        int c = (unsigned char) docBuffer[i];
+
+        if ((c == '\n' || (c >= 0x20 && c <= 0x7E)))
+            putc(c, stderr);
+        else
+            fprintf(stderr, "\\x%02X", c);
+    }
+    fprintf(stderr, "\nEOF\n");
+#endif
+
+    xmlFuzzInjectFailure(failurePos);
     reader = xmlReaderForMemory(docBuffer, docSize, NULL, NULL, opts);
     if (reader == NULL)
         goto exit;
 
+    xmlTextReaderSetStructuredErrorHandler(reader, xmlFuzzSErrorFunc, NULL);
+    xmlTextReaderSetResourceLoader(reader, xmlFuzzResourceLoader, NULL);
+
     i = 0;
     while (i < programSize) {
         int op = program[i++];
@@ -519,6 +528,7 @@
             case OP_BYTE_CONSUMED:
                 startOp("ByteConsumed");
                 xmlTextReaderByteConsumed(reader);
+                oomReport = -1;
                 break;
         }
 
@@ -529,7 +539,7 @@
     error = xmlTextReaderGetLastError(reader);
     if (error->code == XML_ERR_NO_MEMORY)
         oomReport = 1;
-    xmlFuzzCheckMallocFailure("reader", oomReport);
+    xmlFuzzCheckFailureReport("reader", oomReport, error->code == XML_IO_EIO);
 
     xmlFreeTextReader(reader);
 
@@ -537,9 +547,22 @@
         xmlFreeDoc(doc);
 
 exit:
-    xmlFuzzMemSetLimit(0);
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* opts */
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/regexp.c b/fuzz/regexp.c
index ee827c1..07f02cd 100644
--- a/fuzz/regexp.c
+++ b/fuzz/regexp.c
@@ -13,7 +13,6 @@
 LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
                      char ***argv ATTRIBUTE_UNUSED) {
     xmlFuzzMemSetup();
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
 
     return 0;
 }
@@ -21,17 +20,17 @@
 int
 LLVMFuzzerTestOneInput(const char *data, size_t size) {
     xmlRegexpPtr regexp;
-    size_t maxAlloc;
+    size_t failurePos;
     const char *str1;
 
     if (size > 200)
         return(0);
 
     xmlFuzzDataInit(data, size);
-    maxAlloc = xmlFuzzReadInt(4) % (size * 8 + 100);
+    failurePos = xmlFuzzReadInt(4) % (size * 8 + 100);
     str1 = xmlFuzzReadString(NULL);
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
     regexp = xmlRegexpCompile(BAD_CAST str1);
     if (xmlFuzzMallocFailed() && regexp != NULL) {
         fprintf(stderr, "malloc failure not reported\n");
@@ -43,10 +42,22 @@
 #endif
     xmlRegFreeRegexp(regexp);
 
-    xmlFuzzMemSetLimit(0);
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
 
     return 0;
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/schema.c b/fuzz/schema.c
index 611deec..014c617 100644
--- a/fuzz/schema.c
+++ b/fuzz/schema.c
@@ -4,8 +4,13 @@
  * See Copyright for the status of this software.
  */
 
+#ifndef XML_DEPRECATED
+  #define XML_DEPRECATED
+#endif
+
 #include <libxml/catalog.h>
 #include <libxml/xmlschemas.h>
+#include <libxml/xmlschemastypes.h>
 #include "fuzz.h"
 
 int
@@ -17,8 +22,6 @@
     xmlInitializeCatalog();
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 
     return 0;
 }
@@ -26,26 +29,63 @@
 int
 LLVMFuzzerTestOneInput(const char *data, size_t size) {
     xmlSchemaParserCtxtPtr pctxt;
-    size_t maxAlloc;
+    xmlSchemaPtr schema;
+    size_t failurePos;
 
-    if (size > 50000)
+    if (size > 200000)
         return(0);
 
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
-
     xmlFuzzDataInit(data, size);
+
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
+
     xmlFuzzReadEntities();
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
     pctxt = xmlSchemaNewParserCtxt(xmlFuzzMainUrl());
-    xmlSchemaSetParserErrors(pctxt, xmlFuzzErrorFunc, xmlFuzzErrorFunc, NULL);
-    xmlSchemaFree(xmlSchemaParse(pctxt));
+    xmlSchemaSetParserStructuredErrors(pctxt, xmlFuzzSErrorFunc, NULL);
+    xmlSchemaSetResourceLoader(pctxt, xmlFuzzResourceLoader, NULL);
+    schema = xmlSchemaParse(pctxt);
     xmlSchemaFreeParserCtxt(pctxt);
 
-    xmlFuzzMemSetLimit(0);
+    if (schema != NULL) {
+        xmlSchemaValidCtxtPtr vctxt;
+        xmlParserCtxtPtr ctxt;
+        xmlDocPtr doc;
+
+        ctxt = xmlNewParserCtxt();
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
+        doc = xmlCtxtReadFile(ctxt, xmlFuzzSecondaryUrl(), NULL,
+                              XML_PARSE_NOENT);
+        xmlFreeParserCtxt(ctxt);
+
+        vctxt = xmlSchemaNewValidCtxt(schema);
+        xmlSchemaSetValidStructuredErrors(vctxt, xmlFuzzSErrorFunc, NULL);
+        xmlSchemaValidateDoc(vctxt, doc);
+        xmlSchemaFreeValidCtxt(vctxt);
+
+        xmlFreeDoc(doc);
+        xmlSchemaFree(schema);
+    }
+
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
+    xmlSchemaCleanupTypes();
 
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/scripts/coverage_report.sh b/fuzz/scripts/coverage_report.sh
new file mode 100755
index 0000000..a619107
--- /dev/null
+++ b/fuzz/scripts/coverage_report.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+set -e
+
+fuzzer="$1"
+
+if [ -z "$fuzzer" ]; then
+    echo usage: $0 fuzzer
+    exit 1
+fi
+
+# Rebuild the project with coverage enabled
+
+make distclean
+export CC=clang
+export CXX=clang++
+export CFLAGS=" \
+    -O1 -gline-tables-only \
+    -fsanitize=fuzzer-no-link \
+    -fprofile-instr-generate -fcoverage-mapping \
+    -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
+sh autogen.sh --without-python
+make -j5
+rm default.profraw
+
+# Process corpus once
+
+cd fuzz
+make $fuzzer
+
+./$fuzzer -runs=1 corpus/$fuzzer
+
+# Generate HTML report
+
+llvm-profdata merge default.profraw -o default.profdata
+llvm-cov show -format=html -output-dir=report \
+    -instr-profile default.profdata \
+    ../.libs/libxml2.so
+rm default.profraw default.profdata
diff --git a/fuzz/scripts/minimize_corpus.sh b/fuzz/scripts/minimize_corpus.sh
new file mode 100755
index 0000000..c1b761d
--- /dev/null
+++ b/fuzz/scripts/minimize_corpus.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+fuzzer="$1"
+
+if [ -z "$fuzzer" ]; then
+    echo usage: $0 fuzzer
+    exit 1
+fi
+
+cd fuzz
+make $fuzzer
+
+if [ ! -e corpus/${fuzzer}_ ]; then
+    mv corpus/$fuzzer corpus/${fuzzer}_
+fi
+
+mkdir -p corpus/$fuzzer
+./$fuzzer -merge=1 -use_value_profile=1 corpus/$fuzzer corpus/${fuzzer}_
+rm -rf corpus/${fuzzer}_
diff --git a/fuzz/testFuzzer.c b/fuzz/testFuzzer.c
index 0b6aa1d..f80767d 100644
--- a/fuzz/testFuzzer.c
+++ b/fuzz/testFuzzer.c
@@ -5,6 +5,10 @@
  * See Copyright for the status of this software.
  */
 
+#ifndef XML_DEPRECATED
+  #define XML_DEPRECATED
+#endif
+
 #include <string.h>
 #include <glob.h>
 #include <libxml/parser.h>
@@ -12,109 +16,158 @@
 #include <libxml/xmlstring.h>
 #include "fuzz.h"
 
+size_t
+LLVMFuzzerMutate(char *data, size_t size, size_t maxSize) {
+    (void) data;
+    (void) maxSize;
+
+    return size;
+}
+
 #ifdef HAVE_HTML_FUZZER
 int fuzzHtmlInit(int *argc, char ***argv);
 int fuzzHtml(const char *data, size_t size);
+size_t fuzzHtmlMutate(char *data, size_t size, size_t maxSize,
+                      unsigned seed);
 #define LLVMFuzzerInitialize fuzzHtmlInit
 #define LLVMFuzzerTestOneInput fuzzHtml
+#define LLVMFuzzerCustomMutator fuzzHtmlMutate
 #include "html.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_READER_FUZZER
 int fuzzReaderInit(int *argc, char ***argv);
 int fuzzReader(const char *data, size_t size);
+size_t fuzzReaderMutate(char *data, size_t size, size_t maxSize,
+                        unsigned seed);
 #define LLVMFuzzerInitialize fuzzReaderInit
 #define LLVMFuzzerTestOneInput fuzzReader
+#define LLVMFuzzerCustomMutator fuzzReaderMutate
 #include "reader.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_REGEXP_FUZZER
 int fuzzRegexpInit(int *argc, char ***argv);
 int fuzzRegexp(const char *data, size_t size);
+size_t fuzzRegexpMutate(char *data, size_t size, size_t maxSize,
+                        unsigned seed);
 #define LLVMFuzzerInitialize fuzzRegexpInit
 #define LLVMFuzzerTestOneInput fuzzRegexp
+#define LLVMFuzzerCustomMutator fuzzRegexpMutate
 #include "regexp.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_SCHEMA_FUZZER
 int fuzzSchemaInit(int *argc, char ***argv);
 int fuzzSchema(const char *data, size_t size);
+size_t fuzzSchemaMutate(char *data, size_t size, size_t maxSize,
+                        unsigned seed);
 #define LLVMFuzzerInitialize fuzzSchemaInit
 #define LLVMFuzzerTestOneInput fuzzSchema
+#define LLVMFuzzerCustomMutator fuzzSchemaMutate
 #include "schema.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_URI_FUZZER
 int fuzzUriInit(int *argc, char ***argv);
 int fuzzUri(const char *data, size_t size);
+size_t fuzzUriMutate(char *data, size_t size, size_t maxSize,
+                     unsigned seed);
 #define LLVMFuzzerInitialize fuzzUriInit
 #define LLVMFuzzerTestOneInput fuzzUri
+#define LLVMFuzzerCustomMutator fuzzUriMutate
 #include "uri.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_VALID_FUZZER
 int fuzzValidInit(int *argc, char ***argv);
 int fuzzValid(const char *data, size_t size);
+size_t fuzzValidMutate(char *data, size_t size, size_t maxSize,
+                       unsigned seed);
 #define LLVMFuzzerInitialize fuzzValidInit
 #define LLVMFuzzerTestOneInput fuzzValid
+#define LLVMFuzzerCustomMutator fuzzValidMutate
 #include "valid.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_XINCLUDE_FUZZER
 int fuzzXIncludeInit(int *argc, char ***argv);
 int fuzzXInclude(const char *data, size_t size);
+size_t fuzzXIncludeMutate(char *data, size_t size, size_t maxSize,
+                          unsigned seed);
 #define LLVMFuzzerInitialize fuzzXIncludeInit
 #define LLVMFuzzerTestOneInput fuzzXInclude
+#define LLVMFuzzerCustomMutator fuzzXIncludeMutate
 #include "xinclude.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_XML_FUZZER
 int fuzzXmlInit(int *argc, char ***argv);
 int fuzzXml(const char *data, size_t size);
+size_t fuzzXmlMutate(char *data, size_t size, size_t maxSize,
+                     unsigned seed);
 #define LLVMFuzzerInitialize fuzzXmlInit
 #define LLVMFuzzerTestOneInput fuzzXml
+#define LLVMFuzzerCustomMutator fuzzXmlMutate
 #include "xml.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 #ifdef HAVE_XPATH_FUZZER
 int fuzzXPathInit(int *argc, char ***argv);
 int fuzzXPath(const char *data, size_t size);
+size_t fuzzXPathMutate(char *data, size_t size, size_t maxSize,
+                       unsigned seed);
 #define LLVMFuzzerInitialize fuzzXPathInit
 #define LLVMFuzzerTestOneInput fuzzXPath
+#define LLVMFuzzerCustomMutator fuzzXPathMutate
 #include "xpath.c"
 #undef LLVMFuzzerInitialize
 #undef LLVMFuzzerTestOneInput
+#undef LLVMFuzzerCustomMutator
 #endif
 
 typedef int
 (*initFunc)(int *argc, char ***argv);
 typedef int
 (*fuzzFunc)(const char *data, size_t size);
+typedef size_t
+(*mutateFunc)(char *data, size_t size, size_t maxSize, unsigned seed);
 
 int numInputs;
 
 static int
-testFuzzer(initFunc init, fuzzFunc fuzz, const char *pattern) {
+testFuzzer(initFunc init, fuzzFunc fuzz, mutateFunc mutate,
+           const char *pattern) {
     glob_t globbuf;
     int ret = -1;
     size_t i;
 
+    (void) mutate;
+
     if (glob(pattern, 0, NULL, &globbuf) != 0) {
         fprintf(stderr, "pattern %s matches no files\n", pattern);
         return(-1);
@@ -148,6 +201,7 @@
 #ifdef HAVE_XML_FUZZER
 static int
 testEntityLoader(void) {
+    xmlParserCtxtPtr ctxt;
     static const char data[] =
         "doc.xml\\\n"
         "<!DOCTYPE doc SYSTEM \"doc.dtd\">\n"
@@ -157,18 +211,32 @@
         "<!ENTITY ent SYSTEM \"ent.txt\">\\\n"
         "ent.txt\\\n"
         "Hello, world!\\\n";
-    const char *docBuffer;
+    const char *docBuffer, *url;
     size_t docSize;
     xmlDocPtr doc;
     int ret = 0;
 
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
-
     xmlFuzzDataInit(data, sizeof(data) - 1);
     xmlFuzzReadEntities();
+
+    url = xmlFuzzMainUrl();
+    if (strcmp(url, "doc.xml") != 0) {
+        fprintf(stderr, "unexpected main url: %s\n", url);
+        ret = 1;
+    }
+
+    url = xmlFuzzSecondaryUrl();
+    if (strcmp(url, "doc.dtd") != 0) {
+        fprintf(stderr, "unexpected secondary url: %s\n", url);
+        ret = 1;
+    }
+
     docBuffer = xmlFuzzMainEntity(&docSize);
-    doc = xmlReadMemory(docBuffer, docSize, NULL, NULL,
-                        XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+    ctxt = xmlNewParserCtxt();
+    xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
+    doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, NULL, NULL,
+                            XML_PARSE_NOENT | XML_PARSE_DTDLOAD);
+    xmlFreeParserCtxt(ctxt);
 
 #ifdef LIBXML_OUTPUT_ENABLED
     {
@@ -203,39 +271,48 @@
         ret = 1;
 #endif
 #ifdef HAVE_HTML_FUZZER
-    if (testFuzzer(fuzzHtmlInit, fuzzHtml, "seed/html/*") != 0)
+    if (testFuzzer(fuzzHtmlInit, fuzzHtml, fuzzHtmlMutate,
+                   "seed/html/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_READER_FUZZER
-    if (testFuzzer(fuzzReaderInit, fuzzReader, "seed/reader/*") != 0)
+    if (testFuzzer(fuzzReaderInit, fuzzReader, fuzzReaderMutate,
+                   "seed/reader/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_REGEXP_FUZZER
-    if (testFuzzer(fuzzRegexpInit, fuzzRegexp, "seed/regexp/*") != 0)
+    if (testFuzzer(fuzzRegexpInit, fuzzRegexp, fuzzRegexpMutate,
+                   "seed/regexp/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_SCHEMA_FUZZER
-    if (testFuzzer(fuzzSchemaInit, fuzzSchema, "seed/schema/*") != 0)
+    if (testFuzzer(fuzzSchemaInit, fuzzSchema, fuzzSchemaMutate,
+                   "seed/schema/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_URI_FUZZER
-    if (testFuzzer(fuzzUriInit, fuzzUri, "seed/uri/*") != 0)
+    if (testFuzzer(fuzzUriInit, fuzzUri, fuzzUriMutate,
+                   "seed/uri/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_VALID_FUZZER
-    if (testFuzzer(fuzzValidInit, fuzzValid, "seed/valid/*") != 0)
+    if (testFuzzer(fuzzValidInit, fuzzValid, fuzzValidMutate,
+                   "seed/valid/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_XINCLUDE_FUZZER
-    if (testFuzzer(fuzzXIncludeInit, fuzzXInclude, "seed/xinclude/*") != 0)
+    if (testFuzzer(fuzzXIncludeInit, fuzzXInclude, fuzzXIncludeMutate,
+                   "seed/xinclude/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_XML_FUZZER
-    if (testFuzzer(fuzzXmlInit, fuzzXml, "seed/xml/*") != 0)
+    if (testFuzzer(fuzzXmlInit, fuzzXml, fuzzXmlMutate,
+                   "seed/xml/*") != 0)
         ret = 1;
 #endif
 #ifdef HAVE_XPATH_FUZZER
-    if (testFuzzer(fuzzXPathInit, fuzzXPath, "seed/xpath/*") != 0)
+    if (testFuzzer(fuzzXPathInit, fuzzXPath, fuzzXPathMutate,
+                   "seed/xpath/*") != 0)
         ret = 1;
 #endif
 
diff --git a/fuzz/uri.c b/fuzz/uri.c
index efc5fcb..72e4201 100644
--- a/fuzz/uri.c
+++ b/fuzz/uri.c
@@ -11,7 +11,6 @@
 LLVMFuzzerInitialize(int *argc ATTRIBUTE_UNUSED,
                      char ***argv ATTRIBUTE_UNUSED) {
     xmlFuzzMemSetup();
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
 
     return 0;
 }
@@ -19,7 +18,7 @@
 int
 LLVMFuzzerTestOneInput(const char *data, size_t size) {
     xmlURIPtr uri;
-    size_t maxAlloc;
+    size_t failurePos;
     const char *str1, *str2;
     char *copy;
     xmlChar *strRes;
@@ -29,20 +28,20 @@
         return(0);
 
     xmlFuzzDataInit(data, size);
-    maxAlloc = xmlFuzzReadInt(4) % (size * 8 + 100);
+    failurePos = xmlFuzzReadInt(4) % (size * 8 + 100);
     str1 = xmlFuzzReadString(NULL);
     str2 = xmlFuzzReadString(NULL);
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     intRes = xmlParseURISafe(str1, &uri);
-    xmlFuzzCheckMallocFailure("xmlParseURISafe", intRes == -1);
+    xmlFuzzCheckFailureReport("xmlParseURISafe", intRes == -1, 0);
 
     if (uri != NULL) {
-        xmlFuzzResetMallocFailed();
+        xmlFuzzResetFailure();
         strRes = xmlSaveUri(uri);
-        xmlFuzzCheckMallocFailure("xmlSaveURI", strRes == NULL);
+        xmlFuzzCheckFailureReport("xmlSaveURI", strRes == NULL, 0);
         xmlFree(strRes);
         xmlFreeURI(uri);
     }
@@ -53,52 +52,65 @@
     xmlFree(xmlSaveUri(uri));
     xmlFreeURI(uri);
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     strRes = BAD_CAST xmlURIUnescapeString(str1, -1, NULL);
-    xmlFuzzCheckMallocFailure("xmlURIUnescapeString",
-                              str1 != NULL && strRes == NULL);
+    xmlFuzzCheckFailureReport("xmlURIUnescapeString",
+                              str1 != NULL && strRes == NULL, 0);
     xmlFree(strRes);
 
     xmlFree(xmlURIEscape(BAD_CAST str1));
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     strRes = xmlCanonicPath(BAD_CAST str1);
-    xmlFuzzCheckMallocFailure("xmlCanonicPath",
-                              str1 != NULL && strRes == NULL);
+    xmlFuzzCheckFailureReport("xmlCanonicPath",
+                              str1 != NULL && strRes == NULL, 0);
     xmlFree(strRes);
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     strRes = xmlPathToURI(BAD_CAST str1);
-    xmlFuzzCheckMallocFailure("xmlPathToURI", str1 != NULL && strRes == NULL);
+    xmlFuzzCheckFailureReport("xmlPathToURI",
+                              str1 != NULL && strRes == NULL, 0);
     xmlFree(strRes);
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     intRes = xmlBuildURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
-    xmlFuzzCheckMallocFailure("xmlBuildURISafe", intRes == -1);
+    xmlFuzzCheckFailureReport("xmlBuildURISafe", intRes == -1, 0);
     xmlFree(strRes);
 
     xmlFree(xmlBuildURI(BAD_CAST str2, BAD_CAST str1));
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     intRes = xmlBuildRelativeURISafe(BAD_CAST str2, BAD_CAST str1, &strRes);
-    xmlFuzzCheckMallocFailure("xmlBuildRelativeURISafe", intRes == -1);
+    xmlFuzzCheckFailureReport("xmlBuildRelativeURISafe", intRes == -1, 0);
     xmlFree(strRes);
 
     xmlFree(xmlBuildRelativeURI(BAD_CAST str2, BAD_CAST str1));
 
-    xmlFuzzResetMallocFailed();
+    xmlFuzzResetFailure();
     strRes = xmlURIEscapeStr(BAD_CAST str1, BAD_CAST str2);
-    xmlFuzzCheckMallocFailure("xmlURIEscapeStr",
-                              str1 != NULL && strRes == NULL);
+    xmlFuzzCheckFailureReport("xmlURIEscapeStr",
+                              str1 != NULL && strRes == NULL, 0);
     xmlFree(strRes);
 
     copy = (char *) xmlCharStrdup(str1);
     xmlNormalizeURIPath(copy);
     xmlFree(copy);
 
-    xmlFuzzMemSetLimit(0);
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
 
     return 0;
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/valid.c b/fuzz/valid.c
index 67b2fb2..c9429ad 100644
--- a/fuzz/valid.c
+++ b/fuzz/valid.c
@@ -19,8 +19,6 @@
     xmlInitializeCatalog();
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 
     return 0;
 }
@@ -29,16 +27,14 @@
 LLVMFuzzerTestOneInput(const char *data, size_t size) {
     xmlParserCtxtPtr ctxt;
     xmlDocPtr doc;
-    xmlValidCtxtPtr vctxt;
     const char *docBuffer, *docUrl;
-    size_t maxAlloc, docSize;
+    size_t failurePos, docSize;
     int opts;
 
     xmlFuzzDataInit(data, size);
     opts = (int) xmlFuzzReadInt(4);
-    opts &= ~XML_PARSE_XINCLUDE;
     opts |= XML_PARSE_DTDVALID;
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
 
     xmlFuzzReadEntities();
     docBuffer = xmlFuzzMainEntity(&docSize);
@@ -48,25 +44,41 @@
 
     /* Pull parser */
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
     ctxt = xmlNewParserCtxt();
     if (ctxt != NULL) {
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
         doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL, opts);
-        xmlFuzzCheckMallocFailure("xmlCtxtReadMemory",
-                                  ctxt->errNo == XML_ERR_NO_MEMORY);
+        xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
+                                  ctxt->errNo == XML_ERR_NO_MEMORY,
+                                  ctxt->errNo == XML_IO_EIO);
         xmlFreeDoc(doc);
         xmlFreeParserCtxt(ctxt);
     }
 
     /* Post validation */
 
-    xmlFuzzMemSetLimit(maxAlloc);
-    doc = xmlReadMemory(docBuffer, docSize, docUrl, NULL,
-                        opts & ~XML_PARSE_DTDVALID);
-    vctxt = xmlNewValidCtxt();
-    xmlValidateDocument(vctxt, doc);
-    xmlFreeValidCtxt(vctxt);
-    xmlFreeDoc(doc);
+    xmlFuzzInjectFailure(failurePos);
+    ctxt = xmlNewParserCtxt();
+    if (ctxt != NULL) {
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
+        doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL,
+                                opts & ~XML_PARSE_DTDVALID);
+        xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
+                doc == NULL && ctxt->errNo == XML_ERR_NO_MEMORY,
+                doc == NULL && ctxt->errNo == XML_IO_EIO);
+        if (doc != NULL) {
+            int valid = xmlCtxtValidateDocument(ctxt, doc);
+
+            xmlFuzzCheckFailureReport("xmlCtxtValidateDocument",
+                    !valid && ctxt->errNo == XML_ERR_NO_MEMORY,
+                    !valid && ctxt->errNo == XML_IO_EIO);
+        }
+        xmlFreeDoc(doc);
+        xmlFreeParserCtxt(ctxt);
+    }
 
     /* Push parser */
 
@@ -75,9 +87,17 @@
         static const size_t maxChunkSize = 128;
         size_t consumed, chunkSize;
 
-        xmlFuzzMemSetLimit(maxAlloc);
+        xmlFuzzInjectFailure(failurePos);
+        /*
+         * FIXME: xmlCreatePushParserCtxt can still report OOM errors
+         * to stderr.
+         */
+        xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
         ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
+        xmlSetGenericErrorFunc(NULL, NULL);
         if (ctxt != NULL) {
+            xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+            xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
             xmlCtxtUseOptions(ctxt, opts);
 
             for (consumed = 0; consumed < docSize; consumed += chunkSize) {
@@ -88,8 +108,9 @@
             }
 
             xmlParseChunk(ctxt, NULL, 0, 1);
-            xmlFuzzCheckMallocFailure("xmlParseChunk",
-                                      ctxt->errNo == XML_ERR_NO_MEMORY);
+            xmlFuzzCheckFailureReport("xmlParseChunk",
+                                      ctxt->errNo == XML_ERR_NO_MEMORY,
+                                      ctxt->errNo == XML_IO_EIO);
             xmlFreeDoc(ctxt->myDoc);
             xmlFreeParserCtxt(ctxt);
         }
@@ -97,9 +118,22 @@
 #endif
 
 exit:
-    xmlFuzzMemSetLimit(0);
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* opts */
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/xinclude.c b/fuzz/xinclude.c
index e38a69e..ff350ac 100644
--- a/fuzz/xinclude.c
+++ b/fuzz/xinclude.c
@@ -21,7 +21,6 @@
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
     xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 
     return 0;
 }
@@ -31,13 +30,14 @@
     xmlParserCtxtPtr ctxt;
     xmlDocPtr doc;
     const char *docBuffer, *docUrl;
-    size_t maxAlloc, docSize;
+    size_t failurePos, docSize;
     int opts;
 
     xmlFuzzDataInit(data, size);
     opts = (int) xmlFuzzReadInt(4);
-    opts |= XML_PARSE_XINCLUDE;
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
+    opts &= ~XML_PARSE_DTDVALID &
+            ~XML_PARSE_SAX1;
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
 
     xmlFuzzReadEntities();
     docBuffer = xmlFuzzMainEntity(&docSize);
@@ -47,30 +47,36 @@
 
     /* Pull parser */
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
     ctxt = xmlNewParserCtxt();
     if (ctxt != NULL) {
         xmlXIncludeCtxtPtr xinc;
         xmlDocPtr copy;
 
+        xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
+
         doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL, opts);
-        xmlFuzzCheckMallocFailure("xmlCtxtReadMemory",
-                                  ctxt->errNo == XML_ERR_NO_MEMORY);
+        xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
+                doc == NULL && ctxt->errNo == XML_ERR_NO_MEMORY,
+                doc == NULL && ctxt->errNo == XML_IO_EIO);
 
         xinc = xmlXIncludeNewContext(doc);
+        xmlXIncludeSetResourceLoader(xinc, xmlFuzzResourceLoader, NULL);
         xmlXIncludeSetFlags(xinc, opts);
         xmlXIncludeProcessNode(xinc, (xmlNodePtr) doc);
         if (doc != NULL) {
-            xmlFuzzCheckMallocFailure("xmlXIncludeProcessNode",
+            xmlFuzzCheckFailureReport("xmlXIncludeProcessNode",
                     xinc == NULL ||
-                    xmlXIncludeGetLastError(xinc) == XML_ERR_NO_MEMORY);
+                    xmlXIncludeGetLastError(xinc) == XML_ERR_NO_MEMORY,
+                    xinc != NULL &&
+                    xmlXIncludeGetLastError(xinc) == XML_IO_EIO);
         }
         xmlXIncludeFreeContext(xinc);
 
-        xmlFuzzResetMallocFailed();
+        xmlFuzzResetFailure();
         copy = xmlCopyDoc(doc, 1);
         if (doc != NULL)
-            xmlFuzzCheckMallocFailure("xmlCopyNode", copy == NULL);
+            xmlFuzzCheckFailureReport("xmlCopyNode", copy == NULL, 0);
         xmlFreeDoc(copy);
 
         xmlFreeDoc(doc);
@@ -78,9 +84,22 @@
     }
 
 exit:
-    xmlFuzzMemSetLimit(0);
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* opts */
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/xml.c b/fuzz/xml.c
index 31ab210..b6ea885 100644
--- a/fuzz/xml.c
+++ b/fuzz/xml.c
@@ -4,6 +4,10 @@
  * See Copyright for the status of this software.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include <libxml/catalog.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
@@ -20,8 +24,6 @@
     xmlInitializeCatalog();
     xmlCatalogSetDefaults(XML_CATA_ALLOW_NONE);
 #endif
-    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
-    xmlSetExternalEntityLoader(xmlFuzzEntityLoader);
 
     return 0;
 }
@@ -31,18 +33,33 @@
     xmlParserCtxtPtr ctxt;
     xmlDocPtr doc;
     const char *docBuffer, *docUrl;
-    size_t maxAlloc, docSize;
+    size_t failurePos, docSize, maxChunkSize;
     int opts;
+    int errorCode;
+#ifdef LIBXML_OUTPUT_ENABLED
+    xmlBufferPtr outbuf = NULL;
+    const char *saveEncoding;
+    int saveOpts;
+#endif
 
     xmlFuzzDataInit(data, size);
     opts = (int) xmlFuzzReadInt(4);
     /*
      * Disable options that are known to cause timeouts
      */
-    opts &= ~XML_PARSE_XINCLUDE &
-            ~XML_PARSE_DTDVALID &
+    opts &= ~XML_PARSE_DTDVALID &
             ~XML_PARSE_SAX1;
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
+
+    maxChunkSize = xmlFuzzReadInt(4) % (size + size / 8 + 1);
+    if (maxChunkSize == 0)
+        maxChunkSize = 1;
+
+#ifdef LIBXML_OUTPUT_ENABLED
+    /* TODO: Take from fuzz data */
+    saveOpts = 0;
+    saveEncoding = NULL;
+#endif
 
     xmlFuzzReadEntities();
     docBuffer = xmlFuzzMainEntity(&docSize);
@@ -52,31 +69,44 @@
 
     /* Pull parser */
 
-    xmlFuzzMemSetLimit(maxAlloc);
+    xmlFuzzInjectFailure(failurePos);
     ctxt = xmlNewParserCtxt();
-    if (ctxt != NULL) {
+    if (ctxt == NULL) {
+        errorCode = XML_ERR_NO_MEMORY;
+    } else {
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
         doc = xmlCtxtReadMemory(ctxt, docBuffer, docSize, docUrl, NULL, opts);
-        xmlFuzzCheckMallocFailure("xmlCtxtReadMemory",
-                                  doc == NULL &&
-                                  ctxt->errNo == XML_ERR_NO_MEMORY);
+        errorCode = ctxt->errNo;
+        xmlFuzzCheckFailureReport("xmlCtxtReadMemory",
+                doc == NULL && errorCode == XML_ERR_NO_MEMORY,
+                doc == NULL && errorCode == XML_IO_EIO);
 
         if (doc != NULL) {
 #ifdef LIBXML_OUTPUT_ENABLED
-            xmlBufferPtr buffer;
             xmlSaveCtxtPtr save;
 
+            outbuf = xmlBufferCreate();
+
             /* Also test the serializer. */
-            buffer = xmlBufferCreate();
-            save = xmlSaveToBuffer(buffer, NULL, 0);
-            if (save != NULL) {
-                int errNo;
+            save = xmlSaveToBuffer(outbuf, saveEncoding, saveOpts);
+
+            if (save == NULL) {
+                xmlBufferFree(outbuf);
+                outbuf = NULL;
+            } else {
+                int saveErr;
 
                 xmlSaveDoc(save, doc);
-                errNo = xmlSaveFinish(save);
-                xmlFuzzCheckMallocFailure("xmlSaveDoc",
-                                          errNo == XML_ERR_NO_MEMORY);
+                saveErr = xmlSaveFinish(save);
+                xmlFuzzCheckFailureReport("xmlSaveToBuffer",
+                                          saveErr == XML_ERR_NO_MEMORY,
+                                          saveErr == XML_IO_EIO);
+                if (saveErr != XML_ERR_OK) {
+                    xmlBufferFree(outbuf);
+                    outbuf = NULL;
+                }
             }
-            xmlBufferFree(buffer);
 #endif
             xmlFreeDoc(doc);
         }
@@ -87,35 +117,147 @@
     /* Push parser */
 
 #ifdef LIBXML_PUSH_ENABLED
-    {
-        static const size_t maxChunkSize = 128;
-        size_t consumed, chunkSize;
+    xmlFuzzInjectFailure(failurePos);
+    /*
+     * FIXME: xmlCreatePushParserCtxt can still report OOM errors
+     * to stderr.
+     */
+    xmlSetGenericErrorFunc(NULL, xmlFuzzErrorFunc);
+    ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
+    xmlSetGenericErrorFunc(NULL, NULL);
 
-        xmlFuzzMemSetLimit(maxAlloc);
-        ctxt = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, docUrl);
-        if (ctxt != NULL) {
-            xmlCtxtUseOptions(ctxt, opts);
+    if (ctxt != NULL) {
+        size_t consumed;
+        int errorCodePush, numChunks, maxChunks;
 
-            for (consumed = 0; consumed < docSize; consumed += chunkSize) {
-                chunkSize = docSize - consumed;
-                if (chunkSize > maxChunkSize)
-                    chunkSize = maxChunkSize;
-                xmlParseChunk(ctxt, docBuffer + consumed, chunkSize, 0);
+        xmlCtxtSetErrorHandler(ctxt, xmlFuzzSErrorFunc, NULL);
+        xmlCtxtSetResourceLoader(ctxt, xmlFuzzResourceLoader, NULL);
+        xmlCtxtUseOptions(ctxt, opts);
+
+        consumed = 0;
+        numChunks = 0;
+        maxChunks = 50 + docSize / 100;
+        while (numChunks == 0 ||
+               (consumed < docSize && numChunks < maxChunks)) {
+            size_t chunkSize;
+            int terminate;
+
+            numChunks += 1;
+            chunkSize = docSize - consumed;
+
+            if (numChunks < maxChunks && chunkSize > maxChunkSize) {
+                chunkSize = maxChunkSize;
+                terminate = 0;
+            } else {
+                terminate = 1;
             }
 
-            xmlParseChunk(ctxt, NULL, 0, 1);
-            xmlFuzzCheckMallocFailure("xmlParseChunk",
-                                      ctxt->errNo == XML_ERR_NO_MEMORY);
-            xmlFreeDoc(ctxt->myDoc);
-            xmlFreeParserCtxt(ctxt);
+            xmlParseChunk(ctxt, docBuffer + consumed, chunkSize, terminate);
+            consumed += chunkSize;
         }
+
+        errorCodePush = ctxt->errNo;
+        xmlFuzzCheckFailureReport("xmlParseChunk",
+                                  errorCodePush == XML_ERR_NO_MEMORY,
+                                  errorCodePush == XML_IO_EIO);
+        doc = ctxt->myDoc;
+
+        /*
+         * Push and pull parser differ in when exactly they
+         * stop parsing, and the error code is the *last* error
+         * reported, so we can't check whether the codes match.
+         */
+        if (errorCode != XML_ERR_NO_MEMORY &&
+            errorCode != XML_IO_EIO &&
+            errorCodePush != XML_ERR_NO_MEMORY &&
+            errorCodePush != XML_IO_EIO &&
+            (errorCode == XML_ERR_OK) != (errorCodePush == XML_ERR_OK)) {
+            fprintf(stderr, "pull/push parser error mismatch: %d != %d\n",
+                    errorCode, errorCodePush);
+#if 0
+            FILE *f = fopen("c.xml", "wb");
+            fwrite(docBuffer, docSize, 1, f);
+            fclose(f);
+#endif
+            abort();
+        }
+
+#ifdef LIBXML_OUTPUT_ENABLED
+        /*
+         * Verify that pull and push parser produce the same result.
+         *
+         * The NOBLANKS option doesn't work reliably in push mode.
+         */
+        if ((opts & XML_PARSE_NOBLANKS) == 0 &&
+            errorCode == XML_ERR_OK &&
+            errorCodePush == XML_ERR_OK &&
+            outbuf != NULL) {
+            xmlBufferPtr outbufPush;
+            xmlSaveCtxtPtr save;
+
+            outbufPush = xmlBufferCreate();
+
+            save = xmlSaveToBuffer(outbufPush, saveEncoding, saveOpts);
+
+            if (save != NULL) {
+                int saveErr;
+
+                xmlSaveDoc(save, doc);
+                saveErr = xmlSaveFinish(save);
+
+                if (saveErr == XML_ERR_OK) {
+                    int outbufSize = xmlBufferLength(outbuf);
+
+                    if (outbufSize != xmlBufferLength(outbufPush) ||
+                        memcmp(xmlBufferContent(outbuf),
+                               xmlBufferContent(outbufPush),
+                               outbufSize) != 0) {
+                        fprintf(stderr, "pull/push parser roundtrip "
+                                "mismatch\n");
+#if 0
+                        FILE *f = fopen("c.xml", "wb");
+                        fwrite(docBuffer, docSize, 1, f);
+                        fclose(f);
+                        fprintf(stderr, "opts: %X\n", opts);
+                        fprintf(stderr, "---\n%s\n---\n%s\n---\n",
+                                xmlBufferContent(outbuf),
+                                xmlBufferContent(outbufPush));
+#endif
+                        abort();
+                    }
+                }
+            }
+
+            xmlBufferFree(outbufPush);
+        }
+#endif
+
+        xmlFreeDoc(doc);
+        xmlFreeParserCtxt(ctxt);
     }
 #endif
 
 exit:
-    xmlFuzzMemSetLimit(0);
+#ifdef LIBXML_OUTPUT_ENABLED
+    xmlBufferFree(outbuf);
+#endif
+    xmlFuzzInjectFailure(0);
     xmlFuzzDataCleanup();
     xmlResetLastError();
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* opts */
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* maxChunkSize */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/fuzz/xpath.c b/fuzz/xpath.c
index 2c25acb..328a23e 100644
--- a/fuzz/xpath.c
+++ b/fuzz/xpath.c
@@ -27,14 +27,14 @@
 LLVMFuzzerTestOneInput(const char *data, size_t size) {
     xmlDocPtr doc;
     const char *expr, *xml;
-    size_t maxAlloc, exprSize, xmlSize;
+    size_t failurePos, exprSize, xmlSize;
 
     if (size > 10000)
         return(0);
 
     xmlFuzzDataInit(data, size);
 
-    maxAlloc = xmlFuzzReadInt(4) % (size + 100);
+    failurePos = xmlFuzzReadInt(4) % (size + 100);
     expr = xmlFuzzReadString(&exprSize);
     xml = xmlFuzzReadString(&xmlSize);
 
@@ -43,7 +43,7 @@
     if (doc != NULL) {
         xmlXPathContextPtr xpctxt;
 
-        xmlFuzzMemSetLimit(maxAlloc);
+        xmlFuzzInjectFailure(failurePos);
 
         xpctxt = xmlXPathNewContext(doc);
         if (xpctxt != NULL) {
@@ -53,17 +53,16 @@
             xpctxt->opLimit = 500000;
 
             res = xmlXPathContextSetCache(xpctxt, 1, 4, 0);
-            xmlFuzzCheckMallocFailure("xmlXPathContextSetCache", res == -1);
+            xmlFuzzCheckFailureReport("xmlXPathContextSetCache", res == -1, 0);
 
-            xmlFuzzResetMallocFailed();
+            xmlFuzzResetFailure();
             xmlXPathFreeObject(xmlXPtrEval(BAD_CAST expr, xpctxt));
-            xmlFuzzCheckMallocFailure("xmlXPtrEval",
-                                      xpctxt->lastError.code ==
-                                      XML_ERR_NO_MEMORY);
+            xmlFuzzCheckFailureReport("xmlXPtrEval",
+                    xpctxt->lastError.code == XML_ERR_NO_MEMORY, 0);
             xmlXPathFreeContext(xpctxt);
         }
 
-        xmlFuzzMemSetLimit(0);
+        xmlFuzzInjectFailure(0);
         xmlFreeDoc(doc);
     }
 
@@ -73,3 +72,15 @@
     return(0);
 }
 
+size_t
+LLVMFuzzerCustomMutator(char *data, size_t size, size_t maxSize,
+                        unsigned seed) {
+    static const xmlFuzzChunkDesc chunks[] = {
+        { 4, XML_FUZZ_PROB_ONE / 10 }, /* failurePos */
+        { 0, 0 }
+    };
+
+    return xmlFuzzMutateChunks(chunks, data, size, maxSize, seed,
+                               LLVMFuzzerMutate);
+}
+
diff --git a/globals.c b/globals.c
index d5ef206..e0b05a2 100644
--- a/globals.c
+++ b/globals.c
@@ -11,19 +11,17 @@
 #define IN_LIBXML
 #include "libxml.h"
 
-#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
 #define XML_GLOBALS_NO_REDEFINITION
-#include <libxml/globals.h>
 #include <libxml/xmlerror.h>
 #include <libxml/xmlmemory.h>
 #include <libxml/xmlIO.h>
 #include <libxml/parser.h>
 #include <libxml/threads.h>
 #include <libxml/tree.h>
-#include <libxml/SAX.h>
+#include <libxml/xmlsave.h>
 #include <libxml/SAX2.h>
 
 #include "private/dict.h"
@@ -33,6 +31,11 @@
 #include "private/tree.h"
 
 /*
+ * Mutex to protect "ForNewThreads" variables
+ */
+static xmlMutex xmlThrDefMutex;
+
+/*
  * Thread-local storage emulation.
  *
  * This works by replacing a global variable
@@ -46,58 +49,40 @@
  *     #define xmlError (*__xmlLastError());
  *
  * The code can operate in a multitude of ways depending on the environment.
- * First we support POSIX and Windows threads. Then we support both thread-local
- * storage provided by the compiler and older methods like thread-specific data
- * (pthreads) or TlsAlloc (Windows).
+ * First we support POSIX and Windows threads. Then we support both
+ * thread-local storage provided by the compiler and older methods like
+ * thread-specific data (pthreads) or TlsAlloc (Windows).
  *
  * To clean up thread-local storage, we use thread-specific data on POSIX.
- * On Windows, we either use DllMain when compiling a DLL or a registered wait
- * function for static builds.
+ * On Windows, we either use DllMain when compiling a DLL or a registered
+ * wait function for static builds.
+ *
+ * Compiler TLS isn't really useful for now. It can make allocation more
+ * robust on some platforms but it also increases the memory consumption
+ * of each thread by ~250 bytes whether it uses libxml2 or not. The main
+ * problem is that we have to deallocate strings in xmlLastError and C
+ * offers no simple way to deallocate dynamic data in _Thread_local
+ * variables. In C++, one could simply use a thread_local variable with a
+ * destructor.
+ *
+ * At some point, many of the deprecated globals can be removed,
+ * although things like global error handlers will take a while.
+ * Ultimately, the only crucial things seem to be xmlLastError and
+ * RNG state. xmlLastError already involves dynamic allocation, so it
+ * could be allocated dynamically as well, only storing a global
+ * pointer.
  */
 
-/*
- * Helpful Macro
- */
 #ifdef LIBXML_THREAD_ENABLED
-#define IS_MAIN_THREAD (xmlIsMainThreadInternal())
-#else
-#define IS_MAIN_THREAD 1
+
+#ifdef HAVE_WIN32_THREADS
+  #if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
+    #define USE_WAIT_DTOR
+  #else
+    #define USE_DLL_MAIN
+  #endif
 #endif
 
-#define XML_DECLARE_MEMBER(name, type, attrs) \
-  type gs_##name;
-
-struct _xmlGlobalState {
-    int initialized;
-
-#if defined(HAVE_WIN32_THREADS) && \
-    defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
-    void *threadHandle;
-    void *waitHandle;
-#endif
-
-#ifdef LIBXML_THREAD_ENABLED
-    unsigned localRngState[2];
-#endif
-
-#define XML_OP XML_DECLARE_MEMBER
-XML_GLOBALS_ALLOC
-XML_GLOBALS_ERROR
-XML_GLOBALS_IO
-XML_GLOBALS_PARSER
-XML_GLOBALS_TREE
-#undef XML_OP
-};
-
-static int parserInitialized;
-
-/*
- * Mutex to protect "ForNewThreads" variables
- */
-static xmlMutex xmlThrDefMutex;
-
-#ifdef LIBXML_THREAD_ENABLED
-
 /*
  * On Darwin, thread-local storage destructors seem to be run before
  * pthread thread-specific data destructors. This causes ASan to
@@ -108,51 +93,24 @@
  */
 #if defined(XML_THREAD_LOCAL) && \
     !defined(__APPLE__) && \
-    (!defined(HAVE_WIN32_THREADS) || \
-     !defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+    !defined(USE_WAIT_DTOR)
 #define USE_TLS
 #endif
 
-#ifdef USE_TLS
-static XML_THREAD_LOCAL xmlGlobalState globalState;
-#endif
-
 #ifdef HAVE_POSIX_THREADS
 
 /*
- * Weak symbol hack, see threads.c
- */
-#if defined(__GNUC__) && \
-    defined(__GLIBC__) && \
-    __GLIBC__ * 100 + __GLIBC_MINOR__ < 234
-
-#pragma weak pthread_getspecific
-#pragma weak pthread_setspecific
-#pragma weak pthread_key_create
-#pragma weak pthread_key_delete
-#pragma weak pthread_equal
-#pragma weak pthread_self
-
-#define XML_PTHREAD_WEAK
-
-static int libxml_is_threaded = -1;
-
-#endif
-
-/*
  * On POSIX, we need thread-specific data even with thread-local storage
  * to destroy indirect references from global state (xmlLastError) at
  * thread exit.
  */
 static pthread_key_t globalkey;
-static pthread_t mainthread;
 
 #elif defined HAVE_WIN32_THREADS
 
 #ifndef USE_TLS
 static DWORD globalkey = TLS_OUT_OF_INDEXES;
 #endif
-static DWORD mainthread;
 
 #endif /* HAVE_WIN32_THREADS */
 
@@ -161,16 +119,75 @@
 
 #endif /* LIBXML_THREAD_ENABLED */
 
+struct _xmlGlobalState {
+#ifdef USE_TLS
+    int initialized;
+#endif
+
+#ifdef USE_WAIT_DTOR
+    void *threadHandle;
+    void *waitHandle;
+#endif
+
+    unsigned localRngState[2];
+
+    xmlError lastError;
+
+#ifdef LIBXML_THREAD_ALLOC_ENABLED
+    xmlMallocFunc malloc;
+    xmlMallocFunc mallocAtomic;
+    xmlReallocFunc realloc;
+    xmlFreeFunc free;
+    xmlStrdupFunc memStrdup;
+#endif
+
+    int doValidityCheckingDefaultValue;
+    int getWarningsDefaultValue;
+    int keepBlanksDefaultValue;
+    int lineNumbersDefaultValue;
+    int loadExtDtdDefaultValue;
+    int pedanticParserDefaultValue;
+    int substituteEntitiesDefaultValue;
+
+#ifdef LIBXML_OUTPUT_ENABLED
+    int indentTreeOutput;
+    const char *treeIndentString;
+    int saveNoEmptyTags;
+#endif
+
+    xmlGenericErrorFunc genericError;
+    void *genericErrorContext;
+    xmlStructuredErrorFunc structuredError;
+    void *structuredErrorContext;
+
+    xmlRegisterNodeFunc registerNodeDefaultValue;
+    xmlDeregisterNodeFunc deregisterNodeDefaultValue;
+
+    xmlParserInputBufferCreateFilenameFunc parserInputBufferCreateFilenameValue;
+    xmlOutputBufferCreateFilenameFunc outputBufferCreateFilenameValue;
+};
+
+typedef struct _xmlGlobalState xmlGlobalState;
+typedef xmlGlobalState *xmlGlobalStatePtr;
+
+#ifdef LIBXML_THREAD_ENABLED
+
+#ifdef USE_TLS
+static XML_THREAD_LOCAL xmlGlobalState globalState;
+#endif
+
+#else /* LIBXML_THREAD_ENABLED */
+
+static xmlGlobalState globalState;
+
+#endif /* LIBXML_THREAD_ENABLED */
+
 /************************************************************************
  *									*
  *	All the user accessible global variables of the library		*
  *									*
  ************************************************************************/
 
-#ifdef LIBXML_THREAD_ENABLED
-static unsigned xmlMainThreadRngState[2];
-#endif
-
 /*
  * Memory allocation routines
  */
@@ -234,218 +251,34 @@
  */
 xmlStrdupFunc xmlMemStrdup = xmlPosixStrdup;
 
-/**
- * xmlBufferAllocScheme:
- *
- * DEPRECATED: Don't use.
- *
- * Global setting, default allocation policy for buffers, default is
- * XML_BUFFER_ALLOC_EXACT
- */
-xmlBufferAllocationScheme xmlBufferAllocScheme = XML_BUFFER_ALLOC_EXACT;
-static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_EXACT;
-/**
- * xmlDefaultBufferSize:
- *
- * DEPRECATED: Don't use.
- *
- * Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
- */
-int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
-static int xmlDefaultBufferSizeThrDef = BASE_BUFFER_SIZE;
-
 /*
  * Parser defaults
  */
 
-/**
- * oldXMLWDcompatibility:
- *
- * Global setting, DEPRECATED.
- */
-const int oldXMLWDcompatibility = 0; /* DEPRECATED */
-/**
- * xmlParserDebugEntities:
- *
- * DEPRECATED: Don't use
- *
- * Global setting, asking the parser to print out debugging information.
- * while handling entities.
- * Disabled by default
- */
-const int xmlParserDebugEntities = 0;
-/**
- * xmlDoValidityCheckingDefaultValue:
- *
- * DEPRECATED: Use the modern options API with XML_PARSE_DTDVALID.
- *
- * Global setting, indicate that the parser should work in validating mode.
- * Disabled by default.
- */
-int xmlDoValidityCheckingDefaultValue = 0;
 static int xmlDoValidityCheckingDefaultValueThrDef = 0;
-/**
- * xmlGetWarningsDefaultValue:
- *
- * DEPRECATED: Use the modern options API with XML_PARSE_NOWARNING.
- *
- * Global setting, indicate that the DTD validation should provide warnings.
- * Activated by default.
- */
-int xmlGetWarningsDefaultValue = 1;
 static int xmlGetWarningsDefaultValueThrDef = 1;
-/**
- * xmlLoadExtDtdDefaultValue:
- *
- * DEPRECATED: Use the modern options API with XML_PARSE_DTDLOAD.
- *
- * Global setting, indicate that the parser should load DTD while not
- * validating.
- * Disabled by default.
- */
-int xmlLoadExtDtdDefaultValue = 0;
 static int xmlLoadExtDtdDefaultValueThrDef = 0;
-/**
- * xmlPedanticParserDefaultValue:
- *
- * DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC.
- *
- * Global setting, indicate that the parser be pedantic
- * Disabled by default.
- */
-int xmlPedanticParserDefaultValue = 0;
 static int xmlPedanticParserDefaultValueThrDef = 0;
-/**
- * xmlLineNumbersDefaultValue:
- *
- * DEPRECATED: The modern options API always enables line numbers.
- *
- * Global setting, indicate that the parser should store the line number
- * in the content field of elements in the DOM tree.
- * Disabled by default since this may not be safe for old classes of
- * application.
- */
-int xmlLineNumbersDefaultValue = 0;
 static int xmlLineNumbersDefaultValueThrDef = 0;
-/**
- * xmlKeepBlanksDefaultValue:
- *
- * DEPRECATED: Use the modern options API with XML_PARSE_NOBLANKS.
- *
- * Global setting, indicate that the parser should keep all blanks
- * nodes found in the content
- * Activated by default, this is actually needed to have the parser
- * conformant to the XML Recommendation, however the option is kept
- * for some applications since this was libxml1 default behaviour.
- */
-int xmlKeepBlanksDefaultValue = 1;
 static int xmlKeepBlanksDefaultValueThrDef = 1;
-/**
- * xmlSubstituteEntitiesDefaultValue:
- *
- * DEPRECATED: Use the modern options API with XML_PARSE_NOENT.
- *
- * Global setting, indicate that the parser should not generate entity
- * references but replace them with the actual content of the entity
- * Disabled by default, this should be activated when using XPath since
- * the XPath data model requires entities replacement and the XPath
- * engine does not handle entities references transparently.
- */
-int xmlSubstituteEntitiesDefaultValue = 0;
 static int xmlSubstituteEntitiesDefaultValueThrDef = 0;
 
-/**
- * xmlRegisterNodeDefaultValue:
- *
- * DEPRECATED: Don't use
- */
-xmlRegisterNodeFunc xmlRegisterNodeDefaultValue = NULL;
 static xmlRegisterNodeFunc xmlRegisterNodeDefaultValueThrDef = NULL;
-
-/**
- * xmlDeregisterNodeDefaultValue:
- *
- * DEPRECATED: Don't use
- */
-xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue = NULL;
 static xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValueThrDef = NULL;
 
-/**
- * xmlParserInputBufferCreateFilenameValue:
- *
- * DEPRECATED: Don't use
- */
-xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue = NULL;
-static xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValueThrDef = NULL;
+static xmlParserInputBufferCreateFilenameFunc
+xmlParserInputBufferCreateFilenameValueThrDef = NULL;
+static xmlOutputBufferCreateFilenameFunc
+xmlOutputBufferCreateFilenameValueThrDef = NULL;
 
-/**
- * xmlOutputBufferCreateFilenameValue:
- *
- * DEPRECATED: Don't use
- */
-xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue = NULL;
-static xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValueThrDef = NULL;
-
-/**
- * xmlGenericError:
- *
- * Global setting: function used for generic error callbacks
- */
-xmlGenericErrorFunc xmlGenericError = xmlGenericErrorDefaultFunc;
 static xmlGenericErrorFunc xmlGenericErrorThrDef = xmlGenericErrorDefaultFunc;
-/**
- * xmlStructuredError:
- *
- * Global setting: function used for structured error callbacks
- */
-xmlStructuredErrorFunc xmlStructuredError = NULL;
 static xmlStructuredErrorFunc xmlStructuredErrorThrDef = NULL;
-/**
- * xmlGenericErrorContext:
- *
- * Global setting passed to generic error callbacks
- */
-void *xmlGenericErrorContext = NULL;
 static void *xmlGenericErrorContextThrDef = NULL;
-/**
- * xmlStructuredErrorContext:
- *
- * Global setting passed to structured error callbacks
- */
-void *xmlStructuredErrorContext = NULL;
 static void *xmlStructuredErrorContextThrDef = NULL;
-xmlError xmlLastError;
 
 #ifdef LIBXML_OUTPUT_ENABLED
-/*
- * output defaults
- */
-/**
- * xmlIndentTreeOutput:
- *
- * Global setting, asking the serializer to indent the output tree by default
- * Enabled by default
- */
-int xmlIndentTreeOutput = 1;
 static int xmlIndentTreeOutputThrDef = 1;
-
-/**
- * xmlTreeIndentString:
- *
- * The string used to do one-level indent. By default is equal to "  " (two spaces)
- */
-const char *xmlTreeIndentString = "  ";
 static const char *xmlTreeIndentStringThrDef = "  ";
-
-/**
- * xmlSaveNoEmptyTags:
- *
- * Global setting, asking the serializer to not output empty tags
- * as <empty/> but <empty></empty>. those two forms are indistinguishable
- * once parsed.
- * Disabled by default
- */
-int xmlSaveNoEmptyTags = 0;
 static int xmlSaveNoEmptyTagsThrDef = 0;
 #endif /* LIBXML_OUTPUT_ENABLED */
 
@@ -546,6 +379,9 @@
 };
 #endif /* LIBXML_HTML_ENABLED */
 
+static void
+xmlInitGlobalState(xmlGlobalStatePtr gs);
+
 /************************************************************************
  *									*
  *			Per thread global state handling		*
@@ -570,34 +406,14 @@
     xmlInitMutex(&xmlThrDefMutex);
 
 #ifdef HAVE_POSIX_THREADS
-#ifdef XML_PTHREAD_WEAK
-    if (libxml_is_threaded == -1)
-        libxml_is_threaded =
-            (pthread_getspecific != NULL) &&
-            (pthread_setspecific != NULL) &&
-            (pthread_key_create != NULL) &&
-            (pthread_key_delete != NULL) &&
-            /*
-             * pthread_equal can be inline, resuting in -Waddress warnings.
-             * Let's assume it's available if all the other functions are.
-             */
-            /* (pthread_equal != NULL) && */
-            (pthread_self != NULL);
-    if (libxml_is_threaded == 0)
-        return;
-#endif /* XML_PTHREAD_WEAK */
     pthread_key_create(&globalkey, xmlFreeGlobalState);
-    mainthread = pthread_self();
 #elif defined(HAVE_WIN32_THREADS)
 #ifndef USE_TLS
-    globalkey = TlsAlloc();
+    if (globalkey == TLS_OUT_OF_INDEXES)
+        globalkey = TlsAlloc();
 #endif
-    mainthread = GetCurrentThreadId();
-#endif
-
-#ifdef LIBXML_THREAD_ENABLED
-    xmlMainThreadRngState[0] = xmlGlobalRandom();
-    xmlMainThreadRngState[1] = xmlGlobalRandom();
+#else /* no thread support */
+    xmlInitGlobalState(&globalState);
 #endif
 }
 
@@ -618,84 +434,33 @@
  * Additional cleanup for multi-threading
  */
 void xmlCleanupGlobalsInternal(void) {
-    xmlResetError(&xmlLastError);
-
-    xmlCleanupMutex(&xmlThrDefMutex);
+    /*
+     * We assume that all other threads using the library have
+     * terminated and the last remaining thread calls
+     * xmlCleanupParser.
+     */
 
 #ifdef HAVE_POSIX_THREADS
-#ifdef XML_PTHREAD_WEAK
-    if (libxml_is_threaded == 0)
-        return;
-#endif /* XML_PTHREAD_WEAK */
+    /*
+     * Free thread-specific data of last thread before calling
+     * pthread_key_delete.
+     */
+    xmlGlobalState *gs = pthread_getspecific(globalkey);
+    if (gs != NULL)
+        xmlFreeGlobalState(gs);
     pthread_key_delete(globalkey);
 #elif defined(HAVE_WIN32_THREADS)
-#ifndef USE_TLS
+#if defined(USE_WAIT_DTOR) && !defined(USE_TLS)
     if (globalkey != TLS_OUT_OF_INDEXES) {
         TlsFree(globalkey);
         globalkey = TLS_OUT_OF_INDEXES;
     }
 #endif
+#else /* no thread support */
+    xmlResetError(&globalState.lastError);
 #endif
 
-    parserInitialized = 0;
-}
-
-/**
- * xmlInitializeGlobalState:
- * @gs: a pointer to a newly allocated global state
- *
- * DEPRECATED: No-op.
- */
-void
-xmlInitializeGlobalState(xmlGlobalStatePtr gs ATTRIBUTE_UNUSED)
-{
-}
-
-/**
- * xmlGetGlobalState:
- *
- * DEPRECATED
- *
- * Returns NULL.
- */
-xmlGlobalStatePtr
-xmlGetGlobalState(void)
-{
-    return(NULL);
-}
-
-static int
-xmlIsMainThreadInternal(void) {
-    if (parserInitialized == 0) {
-        xmlInitParser();
-        parserInitialized = 1;
-    }
-
-#ifdef HAVE_POSIX_THREADS
-#ifdef XML_PTHREAD_WEAK
-    if (libxml_is_threaded == 0)
-        return (1);
-#endif
-    return (pthread_equal(mainthread, pthread_self()));
-#elif defined HAVE_WIN32_THREADS
-    return (mainthread == GetCurrentThreadId());
-#else
-    return (1);
-#endif
-}
-
-/**
- * xmlIsMainThread:
- *
- * DEPRECATED: Internal function, do not use.
- *
- * Check whether the current thread is the main thread.
- *
- * Returns 1 if the current thread is the main thread, 0 otherwise
- */
-int
-xmlIsMainThread(void) {
-    return(xmlIsMainThreadInternal());
+    xmlCleanupMutex(&xmlThrDefMutex);
 }
 
 #ifdef LIBXML_THREAD_ENABLED
@@ -706,23 +471,17 @@
     xmlGlobalState *gs = (xmlGlobalState *) state;
 
     /*
-     * Free any memory allocated in the thread's xmlLastError. If it
+     * Free any memory allocated in the thread's error struct. If it
      * weren't for this indirect allocation, we wouldn't need
      * a destructor with thread-local storage at all!
-     *
-     * It would be nice if we could make xmlLastError a special error
-     * type which uses statically allocated, fixed-size buffers.
-     * But the xmlError struct is fully public and widely used,
-     * so changes are dangerous.
      */
-    xmlResetError(&(gs->gs_xmlLastError));
+    xmlResetError(&gs->lastError);
 #ifndef USE_TLS
     free(state);
 #endif
 }
 
-#if defined(HAVE_WIN32_THREADS) && \
-    defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
+#if defined(USE_WAIT_DTOR)
 static void WINAPI
 xmlGlobalStateDtor(void *ctxt, unsigned char timedOut ATTRIBUTE_UNUSED) {
     xmlGlobalStatePtr gs = ctxt;
@@ -753,69 +512,7 @@
     gs->waitHandle = waitHandle;
     return(0);
 }
-#endif /* LIBXML_STATIC */
-
-static void
-xmlInitGlobalState(xmlGlobalStatePtr gs) {
-    xmlMutexLock(&xmlThrDefMutex);
-
-#ifdef LIBXML_THREAD_ENABLED
-    gs->localRngState[0] = xmlGlobalRandom();
-    gs->localRngState[1] = xmlGlobalRandom();
-#endif
-
-    gs->gs_xmlBufferAllocScheme = xmlBufferAllocSchemeThrDef;
-    gs->gs_xmlDefaultBufferSize = xmlDefaultBufferSizeThrDef;
-    gs->gs_xmlDoValidityCheckingDefaultValue =
-         xmlDoValidityCheckingDefaultValueThrDef;
-#ifdef LIBXML_THREAD_ALLOC_ENABLED
-    gs->gs_xmlFree = free;
-    gs->gs_xmlMalloc = malloc;
-    gs->gs_xmlMallocAtomic = malloc;
-    gs->gs_xmlRealloc = realloc;
-    gs->gs_xmlMemStrdup = xmlPosixStrdup;
-#endif
-    gs->gs_xmlGetWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
-#ifdef LIBXML_OUTPUT_ENABLED
-    gs->gs_xmlIndentTreeOutput = xmlIndentTreeOutputThrDef;
-    gs->gs_xmlTreeIndentString = xmlTreeIndentStringThrDef;
-    gs->gs_xmlSaveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
-#endif
-    gs->gs_xmlKeepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
-    gs->gs_xmlLineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef;
-    gs->gs_xmlLoadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
-    gs->gs_xmlPedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
-    gs->gs_xmlSubstituteEntitiesDefaultValue =
-        xmlSubstituteEntitiesDefaultValueThrDef;
-
-    gs->gs_xmlGenericError = xmlGenericErrorThrDef;
-    gs->gs_xmlStructuredError = xmlStructuredErrorThrDef;
-    gs->gs_xmlGenericErrorContext = xmlGenericErrorContextThrDef;
-    gs->gs_xmlStructuredErrorContext = xmlStructuredErrorContextThrDef;
-    gs->gs_xmlRegisterNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
-    gs->gs_xmlDeregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
-
-    gs->gs_xmlParserInputBufferCreateFilenameValue =
-        xmlParserInputBufferCreateFilenameValueThrDef;
-    gs->gs_xmlOutputBufferCreateFilenameValue =
-        xmlOutputBufferCreateFilenameValueThrDef;
-    memset(&gs->gs_xmlLastError, 0, sizeof(xmlError));
-
-    xmlMutexUnlock(&xmlThrDefMutex);
-
-#ifdef HAVE_POSIX_THREADS
-    pthread_setspecific(globalkey, gs);
-#elif defined HAVE_WIN32_THREADS
-#ifndef USE_TLS
-    TlsSetValue(globalkey, gs);
-#endif
-#if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
-    xmlRegisterGlobalStateDtor(gs);
-#endif
-#endif
-
-    gs->initialized = 1;
-}
+#endif /* USE_WAIT_DTOR */
 
 #ifndef USE_TLS
 /**
@@ -832,6 +529,10 @@
 {
     xmlGlobalState *gs;
 
+    /*
+     * We use malloc/free to allow accessing globals before setting
+     * custom memory allocators.
+     */
     gs = malloc(sizeof(xmlGlobalState));
     if (gs == NULL) {
         if (allowFailure)
@@ -842,9 +543,8 @@
          * sure that global state could be allocated, it's too late to
          * handle the error.
          */
-        fprintf(stderr, "libxml2: Failed to allocate globals for thread\n"
-                        "libxml2: See xmlCheckThreadLocalStorage\n");
-        abort();
+        xmlAbort("libxml2: Failed to allocate globals for thread\n"
+                 "libxml2: See xmlCheckThreadLocalStorage\n");
     }
 
     memset(gs, 0, sizeof(xmlGlobalState));
@@ -859,6 +559,8 @@
 
     (void) allowFailure;
 
+    xmlInitParser();
+
 #ifdef USE_TLS
     gs = &globalState;
     if (gs->initialized == 0)
@@ -878,25 +580,207 @@
     return(gs);
 }
 
-/* Define thread-local storage accessors with macro magic */
+#else /* LIBXML_THREAD_ENABLED */
 
-#define XML_DEFINE_GLOBAL_WRAPPER(name, type, attrs) \
-    type *__##name(void) { \
-        if (IS_MAIN_THREAD) \
-            return (&name); \
-        else \
-            return (&xmlGetThreadLocalStorage(0)->gs_##name); \
-    }
+static xmlGlobalStatePtr
+xmlGetThreadLocalStorage(int allowFailure ATTRIBUTE_UNUSED) {
+    return(&globalState);
+}
 
-#define XML_OP XML_DEFINE_GLOBAL_WRAPPER
-XML_GLOBALS_ALLOC
-XML_GLOBALS_ERROR
-XML_GLOBALS_IO
-XML_GLOBALS_PARSER
-XML_GLOBALS_TREE
-#undef XML_OP
+#endif /* LIBXML_THREAD_ENABLED */
 
-#ifdef LIBXML_THREAD_ENABLED
+static void
+xmlInitGlobalState(xmlGlobalStatePtr gs) {
+    gs->localRngState[0] = xmlGlobalRandom();
+    gs->localRngState[1] = xmlGlobalRandom();
+
+    memset(&gs->lastError, 0, sizeof(xmlError));
+
+#ifdef LIBXML_THREAD_ALLOC_ENABLED
+    /* XML_GLOBALS_ALLOC */
+    gs->free = free;
+    gs->malloc = malloc;
+    gs->mallocAtomic = malloc;
+    gs->realloc = realloc;
+    gs->memStrdup = xmlPosixStrdup;
+#endif
+
+    xmlMutexLock(&xmlThrDefMutex);
+
+    /* XML_GLOBALS_PARSER */
+    gs->doValidityCheckingDefaultValue =
+         xmlDoValidityCheckingDefaultValueThrDef;
+    gs->getWarningsDefaultValue = xmlGetWarningsDefaultValueThrDef;
+    gs->keepBlanksDefaultValue = xmlKeepBlanksDefaultValueThrDef;
+    gs->lineNumbersDefaultValue = xmlLineNumbersDefaultValueThrDef;
+    gs->loadExtDtdDefaultValue = xmlLoadExtDtdDefaultValueThrDef;
+    gs->pedanticParserDefaultValue = xmlPedanticParserDefaultValueThrDef;
+    gs->substituteEntitiesDefaultValue =
+        xmlSubstituteEntitiesDefaultValueThrDef;
+#ifdef LIBXML_OUTPUT_ENABLED
+    gs->indentTreeOutput = xmlIndentTreeOutputThrDef;
+    gs->treeIndentString = xmlTreeIndentStringThrDef;
+    gs->saveNoEmptyTags = xmlSaveNoEmptyTagsThrDef;
+#endif
+
+    /* XML_GLOBALS_ERROR */
+    gs->genericError = xmlGenericErrorThrDef;
+    gs->structuredError = xmlStructuredErrorThrDef;
+    gs->genericErrorContext = xmlGenericErrorContextThrDef;
+    gs->structuredErrorContext = xmlStructuredErrorContextThrDef;
+
+    /* XML_GLOBALS_TREE */
+    gs->registerNodeDefaultValue = xmlRegisterNodeDefaultValueThrDef;
+    gs->deregisterNodeDefaultValue = xmlDeregisterNodeDefaultValueThrDef;
+
+    /* XML_GLOBALS_IO */
+    gs->parserInputBufferCreateFilenameValue =
+        xmlParserInputBufferCreateFilenameValueThrDef;
+    gs->outputBufferCreateFilenameValue =
+        xmlOutputBufferCreateFilenameValueThrDef;
+
+    xmlMutexUnlock(&xmlThrDefMutex);
+
+#ifdef USE_TLS
+    gs->initialized = 1;
+#endif
+
+#ifdef HAVE_POSIX_THREADS
+    pthread_setspecific(globalkey, gs);
+#elif defined HAVE_WIN32_THREADS
+#ifndef USE_TLS
+    TlsSetValue(globalkey, gs);
+#endif
+#ifdef USE_WAIT_DTOR
+    xmlRegisterGlobalStateDtor(gs);
+#endif
+#endif
+}
+
+const xmlError *
+__xmlLastError(void) {
+    return(&xmlGetThreadLocalStorage(0)->lastError);
+}
+
+int *
+__xmlDoValidityCheckingDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->doValidityCheckingDefaultValue);
+}
+
+int *
+__xmlGetWarningsDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->getWarningsDefaultValue);
+}
+
+int *
+__xmlKeepBlanksDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->keepBlanksDefaultValue);
+}
+
+int *
+__xmlLineNumbersDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->lineNumbersDefaultValue);
+}
+
+int *
+__xmlLoadExtDtdDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->loadExtDtdDefaultValue);
+}
+
+int *
+__xmlPedanticParserDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->pedanticParserDefaultValue);
+}
+
+int *
+__xmlSubstituteEntitiesDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->substituteEntitiesDefaultValue);
+}
+
+#ifdef LIBXML_OUTPUT_ENABLED
+int *
+__xmlIndentTreeOutput(void) {
+    return(&xmlGetThreadLocalStorage(0)->indentTreeOutput);
+}
+
+const char **
+__xmlTreeIndentString(void) {
+    return(&xmlGetThreadLocalStorage(0)->treeIndentString);
+}
+
+int *
+__xmlSaveNoEmptyTags(void) {
+    return(&xmlGetThreadLocalStorage(0)->saveNoEmptyTags);
+}
+#endif
+
+xmlGenericErrorFunc *
+__xmlGenericError(void) {
+    return(&xmlGetThreadLocalStorage(0)->genericError);
+}
+
+void **
+__xmlGenericErrorContext(void) {
+    return(&xmlGetThreadLocalStorage(0)->genericErrorContext);
+}
+
+xmlStructuredErrorFunc *
+__xmlStructuredError(void) {
+    return(&xmlGetThreadLocalStorage(0)->structuredError);
+}
+
+void **
+__xmlStructuredErrorContext(void) {
+    return(&xmlGetThreadLocalStorage(0)->structuredErrorContext);
+}
+
+xmlRegisterNodeFunc *
+__xmlRegisterNodeDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->registerNodeDefaultValue);
+}
+
+xmlDeregisterNodeFunc *
+__xmlDeregisterNodeDefaultValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->deregisterNodeDefaultValue);
+}
+
+xmlParserInputBufferCreateFilenameFunc *
+__xmlParserInputBufferCreateFilenameValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->parserInputBufferCreateFilenameValue);
+}
+
+xmlOutputBufferCreateFilenameFunc *
+__xmlOutputBufferCreateFilenameValue(void) {
+    return(&xmlGetThreadLocalStorage(0)->outputBufferCreateFilenameValue);
+}
+
+#ifdef LIBXML_THREAD_ALLOC_ENABLED
+xmlMallocFunc *
+__xmlMalloc(void) {
+    return(&xmlGetThreadLocalStorage(0)->malloc);
+}
+
+xmlMallocFunc *
+__xmlMallocAtomic(void) {
+    return(&xmlGetThreadLocalStorage(0)->mallocAtomic);
+}
+
+xmlReallocFunc *
+__xmlRealloc(void) {
+    return(&xmlGetThreadLocalStorage(0)->realloc);
+}
+
+xmlFreeFunc *
+__xmlFree(void) {
+    return(&xmlGetThreadLocalStorage(0)->free);
+}
+
+xmlStrdupFunc *
+__xmlMemStrdup(void) {
+    return(&xmlGetThreadLocalStorage(0)->memStrdup);
+}
+#endif /* LIBXML_THREAD_ALLOC_ENABLED */
+
 /**
  * xmlGetLocalRngState:
  *
@@ -904,50 +788,8 @@
  */
 unsigned *
 xmlGetLocalRngState(void) {
-    if (IS_MAIN_THREAD)
-        return(xmlMainThreadRngState);
-    else
-        return(xmlGetThreadLocalStorage(0)->localRngState);
+    return(xmlGetThreadLocalStorage(0)->localRngState);
 }
-#endif
-
-/* For backward compatibility */
-
-const char *const *
-__xmlParserVersion(void) {
-    return &xmlParserVersion;
-}
-
-const int *
-__oldXMLWDcompatibility(void) {
-    return &oldXMLWDcompatibility;
-}
-
-const int *
-__xmlParserDebugEntities(void) {
-    return &xmlParserDebugEntities;
-}
-
-const xmlSAXLocator *
-__xmlDefaultSAXLocator(void) {
-    return &xmlDefaultSAXLocator;
-}
-
-#ifdef LIBXML_SAX1_ENABLED
-const xmlSAXHandlerV1 *
-__xmlDefaultSAXHandler(void) {
-    return &xmlDefaultSAXHandler;
-}
-
-#ifdef LIBXML_HTML_ENABLED
-const xmlSAXHandlerV1 *
-__htmlDefaultSAXHandler(void) {
-    return &htmlDefaultSAXHandler;
-}
-#endif /* LIBXML_HTML_ENABLED */
-#endif /* LIBXML_SAX1_ENABLED */
-
-#endif /* LIBXML_THREAD_ENABLED */
 
 /**
  * xmlCheckThreadLocalStorage:
@@ -963,23 +805,27 @@
  * allocation signals a typically fatal and irrecoverable out-of-memory
  * situation. Don't call any library functions in this case.
  *
- * This function never fails if the library is compiled with support
- * for thread-local storage.
- *
- * This function never fails for the "main" thread which is the first
- * thread calling xmlInitParser.
- *
- * Available since v2.12.0.
+ * Available since 2.12.0.
  */
 int
 xmlCheckThreadLocalStorage(void) {
 #if defined(LIBXML_THREAD_ENABLED) && !defined(USE_TLS)
-    if ((!xmlIsMainThreadInternal()) && (xmlGetThreadLocalStorage(1) == NULL))
+    if (xmlGetThreadLocalStorage(1) == NULL)
         return(-1);
 #endif
     return(0);
 }
 
+/**
+ * xmlGetLastErrorInternal:
+ *
+ * Returns a pointer to the global error struct.
+ */
+xmlError *
+xmlGetLastErrorInternal(void) {
+    return(&xmlGetThreadLocalStorage(0)->lastError);
+}
+
 /** DOC_DISABLE */
 
 /**
@@ -993,8 +839,7 @@
  *
  * Returns TRUE always
  */
-#if defined(HAVE_WIN32_THREADS) && \
-    (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+#ifdef USE_DLL_MAIN
 #if defined(LIBXML_STATIC_FOR_DLL)
 int
 xmlDllMain(ATTRIBUTE_UNUSED void *hinstDLL, unsigned long fdwReason,
@@ -1031,10 +876,21 @@
             }
 #endif
             break;
+
+#ifndef LIBXML_THREAD_ALLOC_ENABLED
+        case DLL_PROCESS_DETACH:
+            if (xmlFree == free)
+                xmlCleanupParser();
+            if (globalkey != TLS_OUT_OF_INDEXES) {
+                TlsFree(globalkey);
+                globalkey = TLS_OUT_OF_INDEXES;
+            }
+            break;
+#endif
     }
     return TRUE;
 }
-#endif
+#endif /* USE_DLL_MAIN */
 
 void
 xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
@@ -1055,24 +911,6 @@
     xmlMutexUnlock(&xmlThrDefMutex);
 }
 
-xmlBufferAllocationScheme xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v) {
-    xmlBufferAllocationScheme ret;
-    xmlMutexLock(&xmlThrDefMutex);
-    ret = xmlBufferAllocSchemeThrDef;
-    xmlBufferAllocSchemeThrDef = v;
-    xmlMutexUnlock(&xmlThrDefMutex);
-    return ret;
-}
-
-int xmlThrDefDefaultBufferSize(int v) {
-    int ret;
-    xmlMutexLock(&xmlThrDefMutex);
-    ret = xmlDefaultBufferSizeThrDef;
-    xmlDefaultBufferSizeThrDef = v;
-    xmlMutexUnlock(&xmlThrDefMutex);
-    return ret;
-}
-
 int xmlThrDefDoValidityCheckingDefaultValue(int v) {
     int ret;
     xmlMutexLock(&xmlThrDefMutex);
@@ -1147,10 +985,6 @@
     return ret;
 }
 
-int xmlThrDefParserDebugEntities(int v ATTRIBUTE_UNUSED) {
-    return(xmlParserDebugEntities);
-}
-
 int xmlThrDefPedanticParserDefaultValue(int v) {
     int ret;
     xmlMutexLock(&xmlThrDefMutex);
@@ -1177,7 +1011,7 @@
     xmlMutexLock(&xmlThrDefMutex);
     old = xmlRegisterNodeDefaultValueThrDef;
 
-    __xmlRegisterCallbacks = 1;
+    xmlRegisterCallbacks = 1;
     xmlRegisterNodeDefaultValueThrDef = func;
     xmlMutexUnlock(&xmlThrDefMutex);
 
@@ -1192,7 +1026,7 @@
     xmlMutexLock(&xmlThrDefMutex);
     old = xmlDeregisterNodeDefaultValueThrDef;
 
-    __xmlRegisterCallbacks = 1;
+    xmlRegisterCallbacks = 1;
     xmlDeregisterNodeDefaultValueThrDef = func;
     xmlMutexUnlock(&xmlThrDefMutex);
 
diff --git a/hash.c b/hash.c
index 6af8527..4646197 100644
--- a/hash.c
+++ b/hash.c
@@ -427,43 +427,50 @@
                       void *payload, xmlHashDeallocator dealloc, int update) {
     xmlChar *copy, *copy2, *copy3;
     xmlHashEntry *entry = NULL;
-    size_t lengths[3];
-    unsigned hashValue;
-    int found = 0;
+    size_t lengths[3] = {0, 0, 0};
+    unsigned hashValue, newSize;
 
     if ((hash == NULL) || (key == NULL))
         return(-1);
 
+    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
+
     /*
      * Check for an existing entry
      */
-    hashValue = xmlHashValue(hash->randomSeed, key, key2, key3, lengths);
-    if (hash->size > 0)
+    if (hash->size == 0) {
+        newSize = MIN_HASH_SIZE;
+    } else {
+        int found = 0;
+
         entry = xmlHashFindEntry(hash, key, key2, key3, hashValue, &found);
-    if (found) {
-        if (update) {
-            if (dealloc)
-                dealloc(entry->payload, entry->key);
-            entry->payload = payload;
+
+        if (found) {
+            if (update) {
+                if (dealloc)
+                    dealloc(entry->payload, entry->key);
+                entry->payload = payload;
+            }
+
+            return(0);
         }
 
-        return(0);
+        if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
+            /* This guarantees that nbElems < INT_MAX */
+            if (hash->size >= MAX_HASH_SIZE)
+                return(-1);
+            newSize = hash->size * 2;
+        } else {
+            newSize = 0;
+        }
     }
 
     /*
      * Grow the hash table if needed
      */
-    if (hash->nbElems + 1 > hash->size / MAX_FILL_DENOM * MAX_FILL_NUM) {
-        unsigned newSize, mask, displ, pos;
+    if (newSize > 0) {
+        unsigned mask, displ, pos;
 
-        if (hash->size == 0) {
-            newSize = MIN_HASH_SIZE;
-        } else {
-            /* This guarantees that nbElems < INT_MAX */
-            if (hash->size >= MAX_HASH_SIZE)
-                return(-1);
-            newSize = hash->size * 2;
-        }
         if (xmlHashGrow(hash, newSize) != 0)
             return(-1);
 
diff --git a/html5ent.inc b/html5ent.inc
new file mode 100644
index 0000000..3e3dfcc
--- /dev/null
+++ b/html5ent.inc
@@ -0,0 +1,1607 @@
+static const unsigned char htmlEntAlpha[177] = {
+      0,   0,   0,   0,   0,  19,  19,   0,  12,  31,   0,  31,  65,   0,  45,
+    119,   0,  24, 144,   0,   8, 152,   0,  19, 173,   0,  12, 185,   0,  20,
+    210,   0,   7, 217,   0,   8, 225,   0,  49,  28,   1,   9,  37,   1,  20,
+    108,   1,  23, 131,   1,  11, 150,   1,   4, 154,   1,  31, 198,   1,  22,
+    238,   1,  19,   4,   2,  30,  40,   2,  12,  57,   2,   5,  62,   2,   4,
+     66,   2,  10,  76,   2,  10,   0,   0,   0,   0,   0,   0,   0,   0,   0,
+      0,   0,   0,   0,   0,   0,   0,   0,   0,  86,   2,  25, 146,   2,  79,
+      5,   3,  52,  99,   3,  48, 163,   3,  46, 225,   3,  35,   5,   4,  25,
+     64,   4,  25,  92,   4,  28, 142,   4,   8, 150,   4,   9, 160,   4,  82,
+     56,   5,  24,  93,   5,  85,   2,   6,  41,  55,   6,  23, 121,   6,   9,
+    131,   6,  74, 233,   6,  58, 129,   7,  41, 185,   7,  42, 232,   7,  36,
+     18,   8,   9,  29,   8,  24,  53,   8,  11,  64,   8,  13
+};
+
+static const unsigned short htmlEntValues[2125] = {
+        0,     8,    13,    22,    31,    39,    45,    53,    62,    70,
+       78,    85,    93,   102,   119,   127,   136,   146,   155,   162,
+      175,   183,   193,   199,   210,   224,   231,   239,   248,   256,
+      264,   274,   281,   288,   297,   328,   339,   348,   357,   365,
+      376,   383,   393,   405,   412,   418,   431,   446,   460,   475,
+      503,   528,   547,   564,   577,   587,   606,   614,   627,   662,
+      671,   680,   306,   558,   689,   697,   716,   723,   730,   737,
+      747,   755,   764,   773,   779,   794,   802,   821,   838,   863,
+      881,   900,   911,   928,   937,   963,   988,  1000,  1019,  1038,
+     1062,  1079,  1102,  1130,  1154,  1174,  1192,  1209,  1230,  1251,
+     1286,  1298,  1321,  1342,  1370,  1392,  1421,  1444,  1457,  1466,
+      705,   788,   945,   953,  1266,  1274,  1362,  1413,  1434,  1475,
+     1481,  1487,  1496,  1505,  1513,  1519,  1526,  1534,  1543,  1554,
+     1562,  1582,  1606,  1614,  1623,  1633,  1654,  1669,  1677,  1685,
+     1691,  1698,  1708,  1644,  1724,  1730,  1738,  1759,  1784,  1793,
+     1803,  1817,  1825,  1832,  1836,  1851,  1860,  1869,  1877,  1883,
+     1890,  1898,  1904,  1913,  1940,  1960,  1978,  1993,  2014,  2030,
+     2039,  1846,  1931,  2045,  2054,  2062,  2067,  2075,  2082,  2098,
+     2106,  2124,  2132,  2141,  2157,  2170,  2177,  2185,  2192,  2201,
+     2209,  2215,  2222,  2229,  2238,  2276,  2309,  2327,  2345,  2353,
+     2362,  2369,  2377,  2386,  2394,  2246,  2253,  2266,  2285,  2295,
+     2401,  2409,  2415,  2423,  2432,  2441,  2450,  2458,  2465,  2472,
+     2480,  2489,  2495,  2503,  2512,  2521,  2528,  2532,  2541,  2550,
+     2558,  2572,  2580,  2589,  2598,  2604,  2624,  2662,  2677,  2698,
+     2719,  2747,  2760,  2778,  2797,  2831,  2867,  2887,  2906,  2932,
+     2956,  2969,  2987,  3007,  3024,  3039,  3051,  3069,  3082,  3090,
+     3111,  3120,  3137,  3159,  3177,  3194,  3216,  3234,  3243,  3261,
+     3280,  3288,  3295,  3304,  2639,  2647,  2739,  2810,  2820,  2849,
+     2857,  2924,  2948,  3098,  3310,  3317,  3323,  3338,  3351,  3359,
+     3372,  3381,  3389,  3394,  3401,  3410,  3419,  3428,  3434,  3457,
+     3479,  3500,  3525,  3549,  3567,  3576,  3584,  3595,  3614,  3622,
+     4343,  4352,  4361,  3631,  3645,  3656,  3678,  3690,  3714,  3725,
+     3815,  3834,  3850,  3889,  3960,  3987,  4008,  4050,  4069,  4109,
+     4140,  4173,  4199,  4253,  4281,  4327,  3702,  3739,  3749,  3765,
+     3779,  3788,  3805,  3869,  3879,  3900,  3910,  3922,  3933,  3950,
+     4023,  4035,  4089,  4099,  4130,  4163,  4189,  4214,  4226,  4241,
+     4271,  4293,  4303,  4317,  4366,  4374,  4383,  4391,  4397,  4406,
+     4414,  4423,  4431,  4439,  4449,  4458,  4482,  4500,  4506,  4515,
+     4524,  4533,  4543,  4550,  4561,  4574,  4589,  4608,  4620,  4626,
+     4634,  4640,  4645,  4657,  4674,  4682,  4778,  4787,  4690,  4738,
+     4746,  4756,  4703,  4713,  4728,  4771,  4793,  4799,  4807,  4815,
+     4824,  4833,  4839,  4848,  4856,  4873,  4882,  4891,  4897,  4966,
+     4973,  4979,  5000,  5038,  5054,  5076,  5098,  5127,  5141,  5176,
+     5213,  5234,  5254,  5281,  5306,  5320,  5328,  5344,  5359,  5367,
+     5374,  4866,  4905,  4922,  4943,  5016,  5024,  5119,  5155,  5165,
+     5195,  5203,  5273,  5298,  5389,  5398,  5405,  5414,  5423,  5459,
+     5467,  5485,  5503,  5522,  5538,  5546,  5561,  5570,  5578,  5665,
+     5674,  5682,  5711,  5760,  5772,  5779,  5431,  5439,  5447,  5454,
+     5590,  5607,  5630,  5655,  5620,  5645,  5691,  5701,  5725,  5735,
+     5750,  5788,  5810,  5800,  5818,  5826,  5835,  5843,  5850,  5855,
+     5861,  5870,  5879,  5885,  5893,  5906,  5914,  5931,  5944,  5989,
+     5998,  6011,  6020,  5955,  5965,  5979,  6029,  6038,  6057,  6065,
+     6074,  6082,  6088,  6097,  6105,  6114,  6122,  6132,  6146,  6162,
+     6182,  6202,  6210,  6219,  6254,  6269,  6286,  6307,  6318,  6333,
+     6351,  6370,  6386,  6394,  6403,  6412,  6048,  6193,  6232,  6240,
+     6297,  6379,  6419,  6428,  6436,  6442,  6459,  6466,  6476,  6541,
+     6558,  6566,  6575,  6584,  6453,  6486,  6498,  6509,  6527,  6594,
+     6602,  6611,  6619,  6628,  6637,  6645,  6650,  6659,  6668,  6675,
+     6682,  6689,  6698,  6706,  6712,  6720,  6729,  6738,  6745,  6752,
+     6761,  6770,  6776,  6783,  6801,  6808,  6815,  6823,  6832,  6841,
+     6850,  6891,  6899,  6914,  6923,  6934,  6943,  6951,  6959,  6968,
+     6973,  7012,  7147,  7155,  7164,  7223,  7231,  7240,  7245,  7263,
+     7272,  7279,  7291,  6858,  6866,  6872,  6879,  6886,  6907,  6982,
+     6990,  6996,  7006,  7021,  7027,  7034,  7100,  7124,  7132,  7138,
+     7044,  7051,  7058,  7065,  7072,  7079,  7086,  7093,  7109,  7118,
+     7172,  7178,  7187,  7193,  7200,  7205,  7216,  7256,  7300,  7308,
+     7320,  7334,  7347,  7367,  7377,  7396,  7415,  7424,  7430,  7439,
+     7457,  7468,  7476,  7486,  7493,  7501,  7512,  7520,  7530,  7541,
+     7551,  7562,  7574,  7587,  7599,  7610,  7629,  7646,  7658,  7668,
+     7680,  7690,  7706,  7721,  7768,  7777,  7786,  7795,  7804,  7813,
+     7835,  7843,  7852,  7869,  7879,  7888,  7897,  7906,  7915,  7949,
+     7958,  7967,  7976,  7985,  8031,  8041,  8050,  8059,  8068,  8077,
+     8111,  8123,  8134,  8146,  8155,  8164,  8173,  8182,  8228,  8238,
+     8246,  8255,  8264,  8273,  8289,  8312,  8329,  7360,  7389,  7406,
+     7451,  7740,  7749,  7758,  7823,  7861,  7925,  7931,  7937,  7943,
+     7995,  8001,  8007,  8013,  8019,  8025,  8087,  8093,  8099,  8105,
+     8192,  8198,  8204,  8210,  8216,  8222,  8283,  8297,  8303,  8322,
+     8339,  8345,  8353,  8359,  8368,  8428,  8437,  8445,  8454,  8463,
+     8472,  8480,  8498,  8505,  8513,  8524,  8542,  8550,  8557,  8577,
+     8583,  8730,  8749,  8772,  8785,  8823,  8841,  8851,  8860,  8870,
+     8886,  8895,  8904,  8913,  8929,  8945,  8954,  8965,  8976,  8985,
+     8994,  9012,  9071,  9089,  9104,  9119,  9131,  9145,  9154,  9172,
+     9191,  9200,  9209,  9221,  9230,  8377,  8385,  8395,  8403,  8411,
+     8419,  8491,  8533,  8568,  8592,  8598,  8697,  8703,  8713,  8721,
+     8605,  8612,  8628,  8645,  8653,  8662,  8673,  8685,  8741,  8758,
+     8766,  8781,  8795,  8802,  8813,  8833,  8879,  8923,  8939,  9006,
+     9021,  9031,  9039,  9047,  9055,  9062,  9083,  9240,  9248,  9256,
+     9266,  9276,  9284,  9300,  9311,  9319,  9328,  9334,  9370,  9376,
+     9384,  9395,  9405,  9413,  9422,  9431,  9466,  9472,  9482,  9491,
+     9528,  9535,  9545,  9555,  9563,  9572,  9627,  9645,  9658,  9676,
+     9695,  9715,  9727,  9737,  9747,  9756,  9763,  9771,  9780,  9789,
+     9805,  9814,  9823,  9834,  9841,  9294,  9342,  9352,  9360,  9441,
+     9460,  9451,  9499,  9520,  9508,  9580,  9597,  9607,  9616,  9589,
+     9799,  9853,  9862,  9870,  9879,  9889,  9898,  9913,  9923,  9929,
+     9936,  9942,  9951,  9959,  9991, 10032, 10040, 10065, 10089, 10095,
+    10103, 10111, 10120, 10137, 10146, 10167, 10177, 10188, 10197, 10211,
+    10226, 10234, 10244, 10262, 10274, 10283, 10292, 10300, 10309, 10317,
+    10323, 10329, 10336, 10344, 10350, 10359, 10374,  9908,  9967,  9975,
+     9983,  9999, 10010, 10016, 10024, 10051, 10059, 10075, 10082, 10130,
+    10155, 10162, 10255, 10390, 10407, 10413, 10423, 10433, 10442, 10452,
+    10460, 10469, 10477, 10485, 10494, 10503, 10510, 10519, 10529, 10545,
+    10557, 10566, 10576, 10585, 10595, 10605, 10615, 10625, 10635, 10644,
+    10654, 10664, 10674, 10684, 10694, 10704, 10713, 10722, 10539, 10731,
+    10745, 10754, 10769, 10776, 10785, 10793, 10799, 10806, 10901, 10909,
+    10923, 10932, 10939, 10965, 10972, 10991, 11014, 11023, 11032, 11039,
+    11047, 11069, 11191, 11207, 10739, 10764, 10814, 10820, 10844, 10828,
+    10834, 10852, 10859, 10883, 10869, 10877, 10894, 10917, 10947, 10953,
+    10959, 10982, 11000, 11008, 11057, 11063, 11075, 11082, 11090, 11098,
+    11107, 11117, 11129, 11138, 11147, 11159, 11172, 11182, 11218, 11226,
+    11236, 11243, 11253, 11262, 11286, 11294, 11302, 11322, 11332, 11342,
+    11350, 11362, 11374, 11383, 11393, 11410, 11428, 11437, 11447, 11456,
+    11466, 11475, 11485, 11272, 11280, 11314, 11495, 11504, 11524, 11531,
+    11539, 11546, 11554, 11563, 11605, 11613, 11621, 11630, 11642, 11654,
+    11662, 11670, 11678, 11776, 11783, 11791, 11800, 11807, 11816, 11825,
+    11834, 11878, 11894, 11902, 11512, 11519, 11571, 11580, 11588, 11597,
+    11686, 11695, 11713, 11721, 11705, 11729, 11737, 11747, 11757, 11767,
+    11844, 11850, 11858, 11872, 11866, 11886, 11909, 11917, 11923, 11931,
+    11939, 11948, 11957, 11966, 11974, 11989, 11998, 12004, 12012, 12021,
+    12028, 12035, 12044, 11984, 12053, 12062, 12070, 12080, 12089, 12103,
+    12111, 12120, 12132, 12142, 12151, 12174, 12181, 12189, 12257, 12291,
+    12300, 12309, 12317, 12325, 12334, 12345, 12356, 12365, 12374, 12383,
+    12389, 12395, 12403, 12420, 12431, 12443, 12451, 12766, 12776, 12786,
+    12794, 12808, 12817, 12834, 12843, 12850, 12894, 12903, 12924, 12931,
+    12950, 12973, 12982, 12991, 13000, 13009, 13026, 13048, 13062, 13080,
+    13097, 13115, 13124, 13133, 13143, 13154, 13164, 13172, 13196, 13211,
+    13220, 13232, 13249, 13256, 13265, 13275, 13284, 13291, 13313, 13319,
+    13336, 13345, 13441, 13453, 13464, 13480, 12097, 12161, 12167, 12199,
+    12214, 12221, 12228, 12235, 12242, 12250, 12207, 12266, 12274, 12282,
+    12414, 12459, 12482, 12500, 12516, 12533, 12558, 12578, 12600, 12617,
+    12623, 12647, 12473, 12552, 12631, 12637, 12655, 12662, 12686, 12704,
+    12716, 12725, 12736, 12748, 12757, 12672, 12680, 12697, 12802, 12828,
+    12858, 12866, 12877, 12886, 12915, 12941, 12959, 12967, 13181, 13190,
+    13204, 13243, 13301, 13307, 13330, 13351, 13358, 13366, 13374, 13383,
+    13392, 13401, 13411, 13420, 13429, 13435, 13491, 13500, 13507, 13515,
+    13533, 13577, 13587, 13597, 13603, 13612, 13629, 13637, 13644, 13652,
+    13682, 13713, 13721, 13729, 13739, 13749, 13758, 13764, 13773, 13783,
+    13525, 13542, 13552, 13561, 13570, 13661, 13667, 13675, 13693, 13699,
+    13707, 13790, 13801, 13809, 13818, 13838, 13852, 13871, 13880, 13900,
+    13915, 13925, 13935, 13944, 13953, 13964, 14005, 14031, 14038, 14059,
+    14067, 14076, 14085, 14106, 14114, 14120, 14129, 14226, 14234, 14243,
+    14288, 14297, 14312, 14321, 14330, 14339, 14367, 14374, 14383, 14392,
+    14401, 14409, 14491, 14500, 14524, 14532, 14541, 14627, 14665, 14676,
+    14720, 14729, 14756, 14771, 14788, 14820, 14833, 14851, 14875, 14884,
+    14893, 14904, 14915, 14969, 14989, 15043, 15051, 15060, 15068, 15094,
+    15121, 15149, 15159, 15169, 15180, 15190, 15201, 15210, 15221, 15231,
+    15242, 15264, 15274, 15288, 15300, 15309, 15319, 15337, 13830, 13892,
+    13973, 13981, 13990, 13996, 14016, 14025, 14051, 14096, 14137, 14145,
+    14154, 14171, 14181, 14190, 14199, 14209, 14164, 14220, 14252, 14280,
+    14260, 14268, 14306, 14347, 14361, 14355, 14418, 14430, 14447, 14475,
+    14455, 14463, 14485, 14509, 14518, 14549, 14597, 14558, 14566, 14576,
+    14583, 14590, 14606, 14613, 14620, 14637, 14647, 14657, 14685, 14693,
+    14703, 14711, 14740, 14748, 14782, 14797, 14805, 14813, 14861, 14869,
+    14925, 14933, 14939, 14952, 14961, 14980, 14999, 15007, 15013, 15026,
+    15035, 15087, 15114, 15128, 15134, 15142, 15253, 15330, 15347, 15353,
+    15362, 15370, 15385, 15391, 15400, 15409, 15417, 15425, 15435, 15443,
+    15452, 15460, 15467, 15476, 15483, 15492, 15498, 15506, 15515, 15524,
+    15535, 15544, 15551, 15559, 15567, 15577, 15585, 15595, 15604, 15612,
+    15621, 15630, 15712, 15720, 15729, 15737, 15746, 15765, 15772, 15380,
+    15638, 15646, 15680, 15689, 15696, 15706, 15654, 15670, 15675, 15663,
+    15758, 15781, 15827, 15833, 15841, 15849, 15859, 15867, 15878, 15886,
+    15899, 15909, 15918, 15942, 15960, 15970, 16043, 16048, 16060, 16069,
+    16077, 16303, 16312, 16318, 15790, 15806, 15814, 15821, 15797, 15894,
+    15925, 15937, 15954, 15978, 15987, 15993, 16001, 16008, 16015, 16021,
+    16027, 16035, 16085, 16091, 16098, 16106, 16190, 16206, 16213, 16221,
+    16230, 16237, 16248, 16259, 16270, 16286, 16294, 16114, 16122, 16133,
+    16145, 16152, 16164, 16173, 16182, 16200, 16279, 16328, 16336, 16344,
+    16353, 16363, 16372, 16387, 16398, 16414, 16407, 16420, 16429, 16437,
+    16447, 16456, 16464, 16474, 16483, 16492, 16504, 16533, 16541, 16628,
+    16638, 16658, 16667, 16676, 16684, 16692, 16701, 16712, 16723, 16732,
+    16741, 16750, 16756, 16762, 16770, 16781, 16798, 16806, 16839, 16847,
+    16853, 16863, 16873, 16881, 16890, 16907, 16920, 16945, 16965, 16983,
+    17002, 17023, 17043, 17062, 17081, 17088, 17104, 17113, 17122, 17129,
+    17150, 17159, 17168, 17177, 17186, 17195, 17204, 17214, 17225, 17240,
+    17252, 17261, 17271, 17280, 17287, 17293, 17310, 17320, 17330, 17361,
+    17372, 16514, 16520, 16526, 16551, 16558, 16573, 16579, 16586, 16593,
+    16600, 16607, 16615, 16622, 16566, 16649, 16792, 16816, 16824, 16833,
+    16901, 16915, 16936, 17141, 17233, 17304, 17340, 17346, 17352, 17378,
+    17387, 17396, 17503, 17525, 17534, 17544, 17562, 17569, 17575, 17585,
+    17597, 17606, 17614, 17632, 17641, 17650, 17657, 17669, 17686, 17692,
+    17712, 17796, 17805, 17822, 17832, 17844, 17852, 17861, 17887, 17896,
+    17918, 17927, 17947, 17955, 17975, 17995, 18029, 18063, 18094, 18103,
+    18112, 18122, 18132, 18142, 18158, 18176, 18190, 18198, 18343, 18421,
+    18428, 18436, 18623, 18632, 18642, 18660, 18670, 17404, 17410, 17417,
+    17425, 17433, 17448, 17455, 17462, 17470, 17479, 17490, 17498, 17441,
+    17513, 17519, 17555, 17624, 17702, 17707, 17721, 17729, 17743, 17757,
+    17771, 17778, 17787, 17737, 17751, 17765, 17870, 17878, 17903, 17911,
+    17939, 17966, 17986, 18006, 18012, 18022, 18040, 18046, 18056, 18072,
+    18080, 18088, 18152, 18207, 18213, 18221, 18237, 18246, 18253, 18260,
+    18269, 18278, 18319, 18327, 18335, 18229, 18288, 18303, 18297, 18313,
+    18353, 18364, 18376, 18383, 18395, 18404, 18413, 18445, 18450, 18455,
+    18460, 18466, 18474, 18483, 18499, 18508, 18517, 18526, 18535, 18542,
+    18549, 18558, 18599, 18607, 18615, 18491, 18568, 18583, 18577, 18593,
+    18653, 18678, 18688, 18694, 18702, 18711, 18720, 18726, 18734, 18744,
+    18752, 18762, 18775, 18797, 18812, 18824, 18834, 18843, 18853, 18861,
+    18869, 18900, 18908, 18916, 18958, 18966, 18976, 18985, 19051, 19061,
+    19069, 19081, 19092, 19101, 19112, 19124, 19133, 19140, 19148, 19157,
+    19166, 19186, 18785, 18792, 18879, 18894, 18887, 18925, 18933, 18941,
+    18950, 18999, 19008, 19026, 19032, 19019, 19044, 19207, 19215, 19223,
+    19232, 19240, 19248, 19257, 19265, 19271, 19280, 19289, 19298, 19308,
+    19316, 19325, 19334, 19343, 19352, 19371, 19381, 19390, 19398, 19404,
+    19412, 19421, 19432, 19447, 19464, 19482, 19491, 19512, 19526, 19545,
+    19555, 19563, 19572, 19581, 19590, 19599, 19615, 19624, 19631, 19364,
+    19500, 19505, 19538, 19609, 19642, 19650, 19666, 19675, 19685, 19698,
+    19709, 19723, 19732, 19740, 19753, 19769, 19780, 19810, 19840, 19851,
+    19870, 19890, 19896, 19905, 19929, 19939, 19947, 19953, 19961, 19970,
+    19982, 19994, 20003, 20012, 20021, 20030, 20043, 20056, 20069, 20082,
+    19660, 19763, 19801, 19831, 19914, 19922, 20093, 20101, 20111, 20128,
+    20138, 20146, 20155, 20161, 20178, 20122, 20169, 20187, 20195, 20204,
+    20212, 20221, 20229, 20238, 20247, 20252, 20261, 20270, 20278, 20286,
+    20295, 20304, 20314, 20324, 20333, 20342, 20351, 20361, 20371, 20380,
+    20388, 20398, 20407, 20414, 20422, 20428, 20434, 20442, 20449, 20458,
+    20467, 20474, 20481, 20490, 20499, 20505, 20512, 20522, 20529, 20537,
+    20544, 20555, 20564, 20573, 20580
+};
+
+static const unsigned char htmlEntStrings[20588] = {
+    132, 'E', 'l', 'i', 'g',   2, 195, 134, 130, 'M', 'P',   1, '&', 133, 'a',
+    'c', 'u', 't', 'e',   2, 195, 129,   5, 'b', 'r', 'e', 'v', 'e',   2, 196,
+    130, 132, 'c', 'i', 'r', 'c',   2, 195, 130,   2, 'c', 'y',   2, 208, 144,
+      2, 'f', 'r',   4, 240, 157, 148, 132, 133, 'g', 'r', 'a', 'v', 'e',   2,
+    195, 128,   4, 'l', 'p', 'h', 'a',   2, 206, 145,   4, 'm', 'a', 'c', 'r',
+      2, 196, 128,   2, 'n', 'd',   3, 226, 169, 147,   4, 'o', 'g', 'o', 'n',
+      2, 196, 132,   3, 'o', 'p', 'f',   4, 240, 157, 148, 184,  12, 'p', 'p',
+    'l', 'y', 'F', 'u', 'n', 'c', 't', 'i', 'o', 'n',   3, 226, 129, 161, 132,
+    'r', 'i', 'n', 'g',   2, 195, 133,   3, 's', 'c', 'r',   4, 240, 157, 146,
+    156,   5, 's', 's', 'i', 'g', 'n',   3, 226, 137, 148, 133, 't', 'i', 'l',
+    'd', 'e',   2, 195, 131, 131, 'u', 'm', 'l',   2, 195, 132,   8, 'a', 'c',
+    'k', 's', 'l', 'a', 's', 'h',   3, 226, 136, 150,   3, 'a', 'r', 'v',   3,
+    226, 171, 167,   5, 'a', 'r', 'w', 'e', 'd',   3, 226, 140, 134,   2, 'c',
+    'y',   2, 208, 145,   6, 'e', 'c', 'a', 'u', 's', 'e',   3, 226, 136, 181,
+      9, 'e', 'r', 'n', 'o', 'u', 'l', 'l', 'i', 's',   3, 226, 132, 172,   3,
+    'e', 't', 'a',   2, 206, 146,   2, 'f', 'r',   4, 240, 157, 148, 133,   3,
+    'o', 'p', 'f',   4, 240, 157, 148, 185,   4, 'r', 'e', 'v', 'e',   2, 203,
+    152,   3, 's', 'c', 'r',   3, 226, 132, 172,   5, 'u', 'm', 'p', 'e', 'q',
+      3, 226, 137, 142,   3, 'H', 'c', 'y',   2, 208, 167, 131, 'O', 'P', 'Y',
+      2, 194, 169,   5, 'a', 'c', 'u', 't', 'e',   2, 196, 134,  66, 'a', 'p',
+     28,   1,   3, 226, 139, 146,  17, 'i', 't', 'a', 'l', 'D', 'i', 'f', 'f',
+    'e', 'r', 'e', 'n', 't', 'i', 'a', 'l', 'D',   3, 226, 133, 133,   6, 'a',
+    'y', 'l', 'e', 'y', 's',   3, 226, 132, 173,   5, 'c', 'a', 'r', 'o', 'n',
+      2, 196, 140, 133, 'c', 'e', 'd', 'i', 'l',   2, 195, 135,   4, 'c', 'i',
+    'r', 'c',   2, 196, 136,   6, 'c', 'o', 'n', 'i', 'n', 't',   3, 226, 136,
+    176,   3, 'd', 'o', 't',   2, 196, 138,   6, 'e', 'd', 'i', 'l', 'l', 'a',
+      2, 194, 184,   8, 'e', 'n', 't', 'e', 'r', 'D', 'o', 't',   2, 194, 183,
+      2, 'f', 'r',   3, 226, 132, 173,   2, 'h', 'i',   2, 206, 167,   8, 'i',
+    'r', 'c', 'l', 'e', 'D', 'o', 't',   3, 226, 138, 153,  10, 'i', 'r', 'c',
+    'l', 'e', 'M', 'i', 'n', 'u', 's',   3, 226, 138, 150,   9, 'i', 'r', 'c',
+    'l', 'e', 'P', 'l', 'u', 's',   3, 226, 138, 149,  10, 'i', 'r', 'c', 'l',
+    'e', 'T', 'i', 'm', 'e', 's',   3, 226, 138, 151,  23, 'l', 'o', 'c', 'k',
+    'w', 'i', 's', 'e', 'C', 'o', 'n', 't', 'o', 'u', 'r', 'I', 'n', 't', 'e',
+    'g', 'r', 'a', 'l',   3, 226, 136, 178,  20, 'l', 'o', 's', 'e', 'C', 'u',
+    'r', 'l', 'y', 'D', 'o', 'u', 'b', 'l', 'e', 'Q', 'u', 'o', 't', 'e',   3,
+    226, 128, 157,  14, 'l', 'o', 's', 'e', 'C', 'u', 'r', 'l', 'y', 'Q', 'u',
+    'o', 't', 'e',   3, 226, 128, 153,  68, 'o', 'l', 'o', 'n',  11,   1,   3,
+    226, 136, 183,   1, 'e',   3, 226, 169, 180,   8, 'o', 'n', 'g', 'r', 'u',
+    'e', 'n', 't',   3, 226, 137, 161,   5, 'o', 'n', 'i', 'n', 't',   3, 226,
+    136, 175,  14, 'o', 'n', 't', 'o', 'u', 'r', 'I', 'n', 't', 'e', 'g', 'r',
+    'a', 'l',   3, 226, 136, 174,   3, 'o', 'p', 'f',   3, 226, 132, 130,   8,
+    'o', 'p', 'r', 'o', 'd', 'u', 'c', 't',   3, 226, 136, 144,  30, 'o', 'u',
+    'n', 't', 'e', 'r', 'C', 'l', 'o', 'c', 'k', 'w', 'i', 's', 'e', 'C', 'o',
+    'n', 't', 'o', 'u', 'r', 'I', 'n', 't', 'e', 'g', 'r', 'a', 'l',   3, 226,
+    136, 179,   4, 'r', 'o', 's', 's',   3, 226, 168, 175,   3, 's', 'c', 'r',
+      4, 240, 157, 146, 158,  66, 'u', 'p',   3,   1,   3, 226, 139, 147,   3,
+    'C', 'a', 'p',   3, 226, 137, 141,  65, 'D',  45,   1,   3, 226, 133, 133,
+      6, 'o', 't', 'r', 'a', 'h', 'd',   3, 226, 164, 145,   3, 'J', 'c', 'y',
+      2, 208, 130,   3, 'S', 'c', 'y',   2, 208, 133,   3, 'Z', 'c', 'y',   2,
+    208, 143,   5, 'a', 'g', 'g', 'e', 'r',   3, 226, 128, 161,   3, 'a', 'r',
+    'r',   3, 226, 134, 161,   4, 'a', 's', 'h', 'v',   3, 226, 171, 164,   5,
+    'c', 'a', 'r', 'o', 'n',   2, 196, 142,   2, 'c', 'y',   2, 208, 148,  66,
+    'e', 'l',  37,   1,   3, 226, 136, 135,   2, 't', 'a',   2, 206, 148,   2,
+    'f', 'r',   4, 240, 157, 148, 135,  15, 'i', 'a', 'c', 'r', 'i', 't', 'i',
+    'c', 'a', 'l', 'A', 'c', 'u', 't', 'e',   2, 194, 180,  13, 'i', 'a', 'c',
+    'r', 'i', 't', 'i', 'c', 'a', 'l', 'D', 'o', 't',   2, 203, 153,  21, 'i',
+    'a', 'c', 'r', 'i', 't', 'i', 'c', 'a', 'l', 'D', 'o', 'u', 'b', 'l', 'e',
+    'A', 'c', 'u', 't', 'e',   2, 203, 157,  15, 'i', 'a', 'c', 'r', 'i', 't',
+    'i', 'c', 'a', 'l', 'G', 'r', 'a', 'v', 'e',   1, '`',  15, 'i', 'a', 'c',
+    'r', 'i', 't', 'i', 'c', 'a', 'l', 'T', 'i', 'l', 'd', 'e',   2, 203, 156,
+      6, 'i', 'a', 'm', 'o', 'n', 'd',   3, 226, 139, 132,  12, 'i', 'f', 'f',
+    'e', 'r', 'e', 'n', 't', 'i', 'a', 'l', 'D',   3, 226, 133, 134,   3, 'o',
+    'p', 'f',   4, 240, 157, 148, 187,  66, 'o', 't',  28,   2,   2, 194, 168,
+      3, 'D', 'o', 't',   3, 226, 131, 156,   5, 'E', 'q', 'u', 'a', 'l',   3,
+    226, 137, 144,  20, 'o', 'u', 'b', 'l', 'e', 'C', 'o', 'n', 't', 'o', 'u',
+    'r', 'I', 'n', 't', 'e', 'g', 'r', 'a', 'l',   3, 226, 136, 175,   8, 'o',
+    'u', 'b', 'l', 'e', 'D', 'o', 't',   2, 194, 168,  14, 'o', 'u', 'b', 'l',
+    'e', 'D', 'o', 'w', 'n', 'A', 'r', 'r', 'o', 'w',   3, 226, 135, 147,  14,
+    'o', 'u', 'b', 'l', 'e', 'L', 'e', 'f', 't', 'A', 'r', 'r', 'o', 'w',   3,
+    226, 135, 144,  19, 'o', 'u', 'b', 'l', 'e', 'L', 'e', 'f', 't', 'R', 'i',
+    'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',   3, 226, 135, 148,  12, 'o', 'u',
+    'b', 'l', 'e', 'L', 'e', 'f', 't', 'T', 'e', 'e',   3, 226, 171, 164,  18,
+    'o', 'u', 'b', 'l', 'e', 'L', 'o', 'n', 'g', 'L', 'e', 'f', 't', 'A', 'r',
+    'r', 'o', 'w',   3, 226, 159, 184,  23, 'o', 'u', 'b', 'l', 'e', 'L', 'o',
+    'n', 'g', 'L', 'e', 'f', 't', 'R', 'i', 'g', 'h', 't', 'A', 'r', 'r', 'o',
+    'w',   3, 226, 159, 186,  19, 'o', 'u', 'b', 'l', 'e', 'L', 'o', 'n', 'g',
+    'R', 'i', 'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',   3, 226, 159, 185,  15,
+    'o', 'u', 'b', 'l', 'e', 'R', 'i', 'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',
+      3, 226, 135, 146,  13, 'o', 'u', 'b', 'l', 'e', 'R', 'i', 'g', 'h', 't',
+    'T', 'e', 'e',   3, 226, 138, 168,  12, 'o', 'u', 'b', 'l', 'e', 'U', 'p',
+    'A', 'r', 'r', 'o', 'w',   3, 226, 135, 145,  16, 'o', 'u', 'b', 'l', 'e',
+    'U', 'p', 'D', 'o', 'w', 'n', 'A', 'r', 'r', 'o', 'w',   3, 226, 135, 149,
+     16, 'o', 'u', 'b', 'l', 'e', 'V', 'e', 'r', 't', 'i', 'c', 'a', 'l', 'B',
+    'a', 'r',   3, 226, 136, 165,  72, 'o', 'w', 'n', 'A', 'r', 'r', 'o', 'w',
+     15,   2,   3, 226, 134, 147,   3, 'B', 'a', 'r',   3, 226, 164, 147,   7,
+    'U', 'p', 'A', 'r', 'r', 'o', 'w',   3, 226, 135, 181,   8, 'o', 'w', 'n',
+    'B', 'r', 'e', 'v', 'e',   2, 204, 145,  18, 'o', 'w', 'n', 'L', 'e', 'f',
+    't', 'R', 'i', 'g', 'h', 't', 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165,
+    144,  16, 'o', 'w', 'n', 'L', 'e', 'f', 't', 'T', 'e', 'e', 'V', 'e', 'c',
+    't', 'o', 'r',   3, 226, 165, 158,  77, 'o', 'w', 'n', 'L', 'e', 'f', 't',
+    'V', 'e', 'c', 't', 'o', 'r',  13,   1,   3, 226, 134, 189,   3, 'B', 'a',
+    'r',   3, 226, 165, 150,  17, 'o', 'w', 'n', 'R', 'i', 'g', 'h', 't', 'T',
+    'e', 'e', 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165, 159,  78, 'o', 'w',
+    'n', 'R', 'i', 'g', 'h', 't', 'V', 'e', 'c', 't', 'o', 'r',  12,   1,   3,
+    226, 135, 129,   3, 'B', 'a', 'r',   3, 226, 165, 151,  70, 'o', 'w', 'n',
+    'T', 'e', 'e',  12,   1,   3, 226, 138, 164,   5, 'A', 'r', 'r', 'o', 'w',
+      3, 226, 134, 167,   8, 'o', 'w', 'n', 'a', 'r', 'r', 'o', 'w',   3, 226,
+    135, 147,   3, 's', 'c', 'r',   4, 240, 157, 146, 159,   5, 's', 't', 'r',
+    'o', 'k',   2, 196, 144,   2, 'N', 'G',   2, 197, 138, 130, 'T', 'H',   2,
+    195, 144, 133, 'a', 'c', 'u', 't', 'e',   2, 195, 137,   5, 'c', 'a', 'r',
+    'o', 'n',   2, 196, 154, 132, 'c', 'i', 'r', 'c',   2, 195, 138,   2, 'c',
+    'y',   2, 208, 173,   3, 'd', 'o', 't',   2, 196, 150,   2, 'f', 'r',   4,
+    240, 157, 148, 136, 133, 'g', 'r', 'a', 'v', 'e',   2, 195, 136,   6, 'l',
+    'e', 'm', 'e', 'n', 't',   3, 226, 136, 136,   4, 'm', 'a', 'c', 'r',   2,
+    196, 146,  15, 'm', 'p', 't', 'y', 'S', 'm', 'a', 'l', 'l', 'S', 'q', 'u',
+    'a', 'r', 'e',   3, 226, 151, 187,  19, 'm', 'p', 't', 'y', 'V', 'e', 'r',
+    'y', 'S', 'm', 'a', 'l', 'l', 'S', 'q', 'u', 'a', 'r', 'e',   3, 226, 150,
+    171,   4, 'o', 'g', 'o', 'n',   2, 196, 152,   3, 'o', 'p', 'f',   4, 240,
+    157, 148, 188,   6, 'p', 's', 'i', 'l', 'o', 'n',   2, 206, 149,  68, 'q',
+    'u', 'a', 'l',   8,   1,   3, 226, 169, 181,   5, 'T', 'i', 'l', 'd', 'e',
+      3, 226, 137, 130,  10, 'q', 'u', 'i', 'l', 'i', 'b', 'r', 'i', 'u', 'm',
+      3, 226, 135, 140,   3, 's', 'c', 'r',   3, 226, 132, 176,   3, 's', 'i',
+    'm',   3, 226, 169, 179,   2, 't', 'a',   2, 206, 151, 131, 'u', 'm', 'l',
+      2, 195, 139,   5, 'x', 'i', 's', 't', 's',   3, 226, 136, 131,  11, 'x',
+    'p', 'o', 'n', 'e', 'n', 't', 'i', 'a', 'l', 'E',   3, 226, 133, 135,   2,
+    'c', 'y',   2, 208, 164,   2, 'f', 'r',   4, 240, 157, 148, 137,  16, 'i',
+    'l', 'l', 'e', 'd', 'S', 'm', 'a', 'l', 'l', 'S', 'q', 'u', 'a', 'r', 'e',
+      3, 226, 151, 188,  20, 'i', 'l', 'l', 'e', 'd', 'V', 'e', 'r', 'y', 'S',
+    'm', 'a', 'l', 'l', 'S', 'q', 'u', 'a', 'r', 'e',   3, 226, 150, 170,   3,
+    'o', 'p', 'f',   4, 240, 157, 148, 189,   5, 'o', 'r', 'A', 'l', 'l',   3,
+    226, 136, 128,   9, 'o', 'u', 'r', 'i', 'e', 'r', 't', 'r', 'f',   3, 226,
+    132, 177,   3, 's', 'c', 'r',   3, 226, 132, 177,   3, 'J', 'c', 'y',   2,
+    208, 131, 129, 'T',   1, '>',  68, 'a', 'm', 'm', 'a',  17,   1,   2, 206,
+    147,   1, 'd',   2, 207, 156,   5, 'b', 'r', 'e', 'v', 'e',   2, 196, 158,
+      5, 'c', 'e', 'd', 'i', 'l',   2, 196, 162,   4, 'c', 'i', 'r', 'c',   2,
+    196, 156,   2, 'c', 'y',   2, 208, 147,   3, 'd', 'o', 't',   2, 196, 160,
+      2, 'f', 'r',   4, 240, 157, 148, 138,   1, 'g',   3, 226, 139, 153,   3,
+    'o', 'p', 'f',   4, 240, 157, 148, 190,  75, 'r', 'e', 'a', 't', 'e', 'r',
+    'E', 'q', 'u', 'a', 'l',   9,   1,   3, 226, 137, 165,   4, 'L', 'e', 's',
+    's',   3, 226, 139, 155,  15, 'r', 'e', 'a', 't', 'e', 'r', 'F', 'u', 'l',
+    'l', 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 167,  13, 'r', 'e', 'a', 't',
+    'e', 'r', 'G', 'r', 'e', 'a', 't', 'e', 'r',   3, 226, 170, 162,  10, 'r',
+    'e', 'a', 't', 'e', 'r', 'L', 'e', 's', 's',   3, 226, 137, 183,  16, 'r',
+    'e', 'a', 't', 'e', 'r', 'S', 'l', 'a', 'n', 't', 'E', 'q', 'u', 'a', 'l',
+      3, 226, 169, 190,  11, 'r', 'e', 'a', 't', 'e', 'r', 'T', 'i', 'l', 'd',
+    'e',   3, 226, 137, 179,   3, 's', 'c', 'r',   4, 240, 157, 146, 162,   1,
+    't',   3, 226, 137, 171,   5, 'A', 'R', 'D', 'c', 'y',   2, 208, 170,   4,
+    'a', 'c', 'e', 'k',   2, 203, 135,   2, 'a', 't',   1, '^',   4, 'c', 'i',
+    'r', 'c',   2, 196, 164,   2, 'f', 'r',   3, 226, 132, 140,  11, 'i', 'l',
+    'b', 'e', 'r', 't', 'S', 'p', 'a', 'c', 'e',   3, 226, 132, 139,   3, 'o',
+    'p', 'f',   3, 226, 132, 141,  13, 'o', 'r', 'i', 'z', 'o', 'n', 't', 'a',
+    'l', 'L', 'i', 'n', 'e',   3, 226, 148, 128,   3, 's', 'c', 'r',   3, 226,
+    132, 139,   5, 's', 't', 'r', 'o', 'k',   2, 196, 166,  11, 'u', 'm', 'p',
+    'D', 'o', 'w', 'n', 'H', 'u', 'm', 'p',   3, 226, 137, 142,   8, 'u', 'm',
+    'p', 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 143,   3, 'E', 'c', 'y',   2,
+    208, 149,   4, 'J', 'l', 'i', 'g',   2, 196, 178,   3, 'O', 'c', 'y',   2,
+    208, 129, 133, 'a', 'c', 'u', 't', 'e',   2, 195, 141, 132, 'c', 'i', 'r',
+    'c',   2, 195, 142,   2, 'c', 'y',   2, 208, 152,   3, 'd', 'o', 't',   2,
+    196, 176,   2, 'f', 'r',   3, 226, 132, 145, 133, 'g', 'r', 'a', 'v', 'e',
+      2, 195, 140,  65, 'm',  11,   3,   3, 226, 132, 145,   3, 'a', 'c', 'r',
+      2, 196, 170,   8, 'a', 'g', 'i', 'n', 'a', 'r', 'y', 'I',   3, 226, 133,
+    136,   5, 'p', 'l', 'i', 'e', 's',   3, 226, 135, 146,  66, 'n', 't',  13,
+      2,   3, 226, 136, 172,   5, 'e', 'g', 'r', 'a', 'l',   3, 226, 136, 171,
+      9, 'e', 'r', 's', 'e', 'c', 't', 'i', 'o', 'n',   3, 226, 139, 130,  13,
+    'n', 'v', 'i', 's', 'i', 'b', 'l', 'e', 'C', 'o', 'm', 'm', 'a',   3, 226,
+    129, 163,  13, 'n', 'v', 'i', 's', 'i', 'b', 'l', 'e', 'T', 'i', 'm', 'e',
+    's',   3, 226, 129, 162,   4, 'o', 'g', 'o', 'n',   2, 196, 174,   3, 'o',
+    'p', 'f',   4, 240, 157, 149, 128,   3, 'o', 't', 'a',   2, 206, 153,   3,
+    's', 'c', 'r',   3, 226, 132, 144,   5, 't', 'i', 'l', 'd', 'e',   2, 196,
+    168,   4, 'u', 'k', 'c', 'y',   2, 208, 134, 131, 'u', 'm', 'l',   2, 195,
+    143,   4, 'c', 'i', 'r', 'c',   2, 196, 180,   2, 'c', 'y',   2, 208, 153,
+      2, 'f', 'r',   4, 240, 157, 148, 141,   3, 'o', 'p', 'f',   4, 240, 157,
+    149, 129,   3, 's', 'c', 'r',   4, 240, 157, 146, 165,   5, 's', 'e', 'r',
+    'c', 'y',   2, 208, 136,   4, 'u', 'k', 'c', 'y',   2, 208, 132,   3, 'H',
+    'c', 'y',   2, 208, 165,   3, 'J', 'c', 'y',   2, 208, 140,   4, 'a', 'p',
+    'p', 'a',   2, 206, 154,   5, 'c', 'e', 'd', 'i', 'l',   2, 196, 182,   2,
+    'c', 'y',   2, 208, 154,   2, 'f', 'r',   4, 240, 157, 148, 142,   3, 'o',
+    'p', 'f',   4, 240, 157, 149, 130,   3, 's', 'c', 'r',   4, 240, 157, 146,
+    166,   3, 'J', 'c', 'y',   2, 208, 137, 129, 'T',   1, '<',   5, 'a', 'c',
+    'u', 't', 'e',   2, 196, 185,   5, 'a', 'm', 'b', 'd', 'a',   2, 206, 155,
+      3, 'a', 'n', 'g',   3, 226, 159, 170,   9, 'a', 'p', 'l', 'a', 'c', 'e',
+    't', 'r', 'f',   3, 226, 132, 146,   3, 'a', 'r', 'r',   3, 226, 134, 158,
+      5, 'c', 'a', 'r', 'o', 'n',   2, 196, 189,   5, 'c', 'e', 'd', 'i', 'l',
+      2, 196, 187,   2, 'c', 'y',   2, 208, 155,  15, 'e', 'f', 't', 'A', 'n',
+    'g', 'l', 'e', 'B', 'r', 'a', 'c', 'k', 'e', 't',   3, 226, 159, 168,  72,
+    'e', 'f', 't', 'A', 'r', 'r', 'o', 'w',  38,   2,   3, 226, 134, 144,   3,
+    'B', 'a', 'r',   3, 226, 135, 164,  10, 'R', 'i', 'g', 'h', 't', 'A', 'r',
+    'r', 'o', 'w',   3, 226, 135, 134,  10, 'e', 'f', 't', 'C', 'e', 'i', 'l',
+    'i', 'n', 'g',   3, 226, 140, 136,  16, 'e', 'f', 't', 'D', 'o', 'u', 'b',
+    'l', 'e', 'B', 'r', 'a', 'c', 'k', 'e', 't',   3, 226, 159, 166,  16, 'e',
+    'f', 't', 'D', 'o', 'w', 'n', 'T', 'e', 'e', 'V', 'e', 'c', 't', 'o', 'r',
+      3, 226, 165, 161,  77, 'e', 'f', 't', 'D', 'o', 'w', 'n', 'V', 'e', 'c',
+    't', 'o', 'r',  36,   1,   3, 226, 135, 131,   3, 'B', 'a', 'r',   3, 226,
+    165, 153,   8, 'e', 'f', 't', 'F', 'l', 'o', 'o', 'r',   3, 226, 140, 138,
+     13, 'e', 'f', 't', 'R', 'i', 'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',   3,
+    226, 134, 148,  14, 'e', 'f', 't', 'R', 'i', 'g', 'h', 't', 'V', 'e', 'c',
+    't', 'o', 'r',   3, 226, 165, 142,  70, 'e', 'f', 't', 'T', 'e', 'e',  33,
+      2,   3, 226, 138, 163,   5, 'A', 'r', 'r', 'o', 'w',   3, 226, 134, 164,
+      6, 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165, 154,  75, 'e', 'f', 't',
+    'T', 'r', 'i', 'a', 'n', 'g', 'l', 'e',  34,   2,   3, 226, 138, 178,   3,
+    'B', 'a', 'r',   3, 226, 167, 143,   5, 'E', 'q', 'u', 'a', 'l',   3, 226,
+    138, 180,  15, 'e', 'f', 't', 'U', 'p', 'D', 'o', 'w', 'n', 'V', 'e', 'c',
+    't', 'o', 'r',   3, 226, 165, 145,  14, 'e', 'f', 't', 'U', 'p', 'T', 'e',
+    'e', 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165, 160,  75, 'e', 'f', 't',
+    'U', 'p', 'V', 'e', 'c', 't', 'o', 'r',  33,   1,   3, 226, 134, 191,   3,
+    'B', 'a', 'r',   3, 226, 165, 152,  73, 'e', 'f', 't', 'V', 'e', 'c', 't',
+    'o', 'r',  33,   1,   3, 226, 134, 188,   3, 'B', 'a', 'r',   3, 226, 165,
+    146,   8, 'e', 'f', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 135, 144,  13,
+    'e', 'f', 't', 'r', 'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226,
+    135, 148,  15, 'e', 's', 's', 'E', 'q', 'u', 'a', 'l', 'G', 'r', 'e', 'a',
+    't', 'e', 'r',   3, 226, 139, 154,  12, 'e', 's', 's', 'F', 'u', 'l', 'l',
+    'E', 'q', 'u', 'a', 'l',   3, 226, 137, 166,  10, 'e', 's', 's', 'G', 'r',
+    'e', 'a', 't', 'e', 'r',   3, 226, 137, 182,   7, 'e', 's', 's', 'L', 'e',
+    's', 's',   3, 226, 170, 161,  13, 'e', 's', 's', 'S', 'l', 'a', 'n', 't',
+    'E', 'q', 'u', 'a', 'l',   3, 226, 169, 189,   8, 'e', 's', 's', 'T', 'i',
+    'l', 'd', 'e',   3, 226, 137, 178,   2, 'f', 'r',   4, 240, 157, 148, 143,
+     65, 'l',  24,   1,   3, 226, 139, 152,   8, 'e', 'f', 't', 'a', 'r', 'r',
+    'o', 'w',   3, 226, 135, 154,   5, 'm', 'i', 'd', 'o', 't',   2, 196, 191,
+     12, 'o', 'n', 'g', 'L', 'e', 'f', 't', 'A', 'r', 'r', 'o', 'w',   3, 226,
+    159, 181,  17, 'o', 'n', 'g', 'L', 'e', 'f', 't', 'R', 'i', 'g', 'h', 't',
+    'A', 'r', 'r', 'o', 'w',   3, 226, 159, 183,  13, 'o', 'n', 'g', 'R', 'i',
+    'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',   3, 226, 159, 182,  12, 'o', 'n',
+    'g', 'l', 'e', 'f', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 159, 184,  17,
+    'o', 'n', 'g', 'l', 'e', 'f', 't', 'r', 'i', 'g', 'h', 't', 'a', 'r', 'r',
+    'o', 'w',   3, 226, 159, 186,  13, 'o', 'n', 'g', 'r', 'i', 'g', 'h', 't',
+    'a', 'r', 'r', 'o', 'w',   3, 226, 159, 185,   3, 'o', 'p', 'f',   4, 240,
+    157, 149, 131,  13, 'o', 'w', 'e', 'r', 'L', 'e', 'f', 't', 'A', 'r', 'r',
+    'o', 'w',   3, 226, 134, 153,  14, 'o', 'w', 'e', 'r', 'R', 'i', 'g', 'h',
+    't', 'A', 'r', 'r', 'o', 'w',   3, 226, 134, 152,   3, 's', 'c', 'r',   3,
+    226, 132, 146,   2, 's', 'h',   3, 226, 134, 176,   5, 's', 't', 'r', 'o',
+    'k',   2, 197, 129,   1, 't',   3, 226, 137, 170,   2, 'a', 'p',   3, 226,
+    164, 133,   2, 'c', 'y',   2, 208, 156,  10, 'e', 'd', 'i', 'u', 'm', 'S',
+    'p', 'a', 'c', 'e',   3, 226, 129, 159,   8, 'e', 'l', 'l', 'i', 'n', 't',
+    'r', 'f',   3, 226, 132, 179,   2, 'f', 'r',   4, 240, 157, 148, 144,   8,
+    'i', 'n', 'u', 's', 'P', 'l', 'u', 's',   3, 226, 136, 147,   3, 'o', 'p',
+    'f',   4, 240, 157, 149, 132,   3, 's', 'c', 'r',   3, 226, 132, 179,   1,
+    'u',   2, 206, 156,   3, 'J', 'c', 'y',   2, 208, 138,   5, 'a', 'c', 'u',
+    't', 'e',   2, 197, 131,   5, 'c', 'a', 'r', 'o', 'n',   2, 197, 135,   5,
+    'c', 'e', 'd', 'i', 'l',   2, 197, 133,   2, 'c', 'y',   2, 208, 157,  18,
+    'e', 'g', 'a', 't', 'i', 'v', 'e', 'M', 'e', 'd', 'i', 'u', 'm', 'S', 'p',
+    'a', 'c', 'e',   3, 226, 128, 139,  17, 'e', 'g', 'a', 't', 'i', 'v', 'e',
+    'T', 'h', 'i', 'c', 'k', 'S', 'p', 'a', 'c', 'e',   3, 226, 128, 139,  16,
+    'e', 'g', 'a', 't', 'i', 'v', 'e', 'T', 'h', 'i', 'n', 'S', 'p', 'a', 'c',
+    'e',   3, 226, 128, 139,  20, 'e', 'g', 'a', 't', 'i', 'v', 'e', 'V', 'e',
+    'r', 'y', 'T', 'h', 'i', 'n', 'S', 'p', 'a', 'c', 'e',   3, 226, 128, 139,
+     19, 'e', 's', 't', 'e', 'd', 'G', 'r', 'e', 'a', 't', 'e', 'r', 'G', 'r',
+    'e', 'a', 't', 'e', 'r',   3, 226, 137, 171,  13, 'e', 's', 't', 'e', 'd',
+    'L', 'e', 's', 's', 'L', 'e', 's', 's',   3, 226, 137, 170,   6, 'e', 'w',
+    'L', 'i', 'n', 'e',   1,  10,   2, 'f', 'r',   4, 240, 157, 148, 145,   6,
+    'o', 'B', 'r', 'e', 'a', 'k',   3, 226, 129, 160,  15, 'o', 'n', 'B', 'r',
+    'e', 'a', 'k', 'i', 'n', 'g', 'S', 'p', 'a', 'c', 'e',   2, 194, 160,   3,
+    'o', 'p', 'f',   3, 226, 132, 149,  66, 'o', 't',   4,  23,   3, 226, 171,
+    172,   9, 'C', 'o', 'n', 'g', 'r', 'u', 'e', 'n', 't',   3, 226, 137, 162,
+      6, 'C', 'u', 'p', 'C', 'a', 'p',   3, 226, 137, 173,  17, 'D', 'o', 'u',
+    'b', 'l', 'e', 'V', 'e', 'r', 't', 'i', 'c', 'a', 'l', 'B', 'a', 'r',   3,
+    226, 136, 166,   7, 'E', 'l', 'e', 'm', 'e', 'n', 't',   3, 226, 136, 137,
+     69, 'E', 'q', 'u', 'a', 'l',  19,   1,   3, 226, 137, 160,   5, 'T', 'i',
+    'l', 'd', 'e',   5, 226, 137, 130, 204, 184,   6, 'E', 'x', 'i', 's', 't',
+    's',   3, 226, 136, 132,  71, 'G', 'r', 'e', 'a', 't', 'e', 'r',  18,   6,
+      3, 226, 137, 175,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 177,   9,
+    'F', 'u', 'l', 'l', 'E', 'q', 'u', 'a', 'l',   5, 226, 137, 167, 204, 184,
+      7, 'G', 'r', 'e', 'a', 't', 'e', 'r',   5, 226, 137, 171, 204, 184,   4,
+    'L', 'e', 's', 's',   3, 226, 137, 185,  10, 'S', 'l', 'a', 'n', 't', 'E',
+    'q', 'u', 'a', 'l',   5, 226, 169, 190, 204, 184,   5, 'T', 'i', 'l', 'd',
+    'e',   3, 226, 137, 181,  12, 'H', 'u', 'm', 'p', 'D', 'o', 'w', 'n', 'H',
+    'u', 'm', 'p',   5, 226, 137, 142, 204, 184,   9, 'H', 'u', 'm', 'p', 'E',
+    'q', 'u', 'a', 'l',   5, 226, 137, 143, 204, 184,  76, 'L', 'e', 'f', 't',
+    'T', 'r', 'i', 'a', 'n', 'g', 'l', 'e',  21,   2,   3, 226, 139, 170,   3,
+    'B', 'a', 'r',   5, 226, 167, 143, 204, 184,   5, 'E', 'q', 'u', 'a', 'l',
+      3, 226, 139, 172,  68, 'L', 'e', 's', 's',  22,   5,   3, 226, 137, 174,
+      5, 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 176,   7, 'G', 'r', 'e', 'a',
+    't', 'e', 'r',   3, 226, 137, 184,   4, 'L', 'e', 's', 's',   5, 226, 137,
+    170, 204, 184,  10, 'S', 'l', 'a', 'n', 't', 'E', 'q', 'u', 'a', 'l',   5,
+    226, 169, 189, 204, 184,   5, 'T', 'i', 'l', 'd', 'e',   3, 226, 137, 180,
+     20, 'N', 'e', 's', 't', 'e', 'd', 'G', 'r', 'e', 'a', 't', 'e', 'r', 'G',
+    'r', 'e', 'a', 't', 'e', 'r',   5, 226, 170, 162, 204, 184,  14, 'N', 'e',
+    's', 't', 'e', 'd', 'L', 'e', 's', 's', 'L', 'e', 's', 's',   5, 226, 170,
+    161, 204, 184,  72, 'P', 'r', 'e', 'c', 'e', 'd', 'e', 's',  24,   2,   3,
+    226, 138, 128,   5, 'E', 'q', 'u', 'a', 'l',   5, 226, 170, 175, 204, 184,
+     10, 'S', 'l', 'a', 'n', 't', 'E', 'q', 'u', 'a', 'l',   3, 226, 139, 160,
+     14, 'R', 'e', 'v', 'e', 'r', 's', 'e', 'E', 'l', 'e', 'm', 'e', 'n', 't',
+      3, 226, 136, 140,  77, 'R', 'i', 'g', 'h', 't', 'T', 'r', 'i', 'a', 'n',
+    'g', 'l', 'e',  24,   2,   3, 226, 139, 171,   3, 'B', 'a', 'r',   5, 226,
+    167, 144, 204, 184,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 139, 173,  76,
+    'S', 'q', 'u', 'a', 'r', 'e', 'S', 'u', 'b', 's', 'e', 't',  25,   1,   5,
+    226, 138, 143, 204, 184,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 139, 162,
+     78, 'S', 'q', 'u', 'a', 'r', 'e', 'S', 'u', 'p', 'e', 'r', 's', 'e', 't',
+     25,   1,   5, 226, 138, 144, 204, 184,   5, 'E', 'q', 'u', 'a', 'l',   3,
+    226, 139, 163,  70, 'S', 'u', 'b', 's', 'e', 't',  25,   1,   6, 226, 138,
+    130, 226, 131, 146,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 138, 136,  72,
+    'S', 'u', 'c', 'c', 'e', 'e', 'd', 's',  25,   3,   3, 226, 138, 129,   5,
+    'E', 'q', 'u', 'a', 'l',   5, 226, 170, 176, 204, 184,  10, 'S', 'l', 'a',
+    'n', 't', 'E', 'q', 'u', 'a', 'l',   3, 226, 139, 161,   5, 'T', 'i', 'l',
+    'd', 'e',   5, 226, 137, 191, 204, 184,  72, 'S', 'u', 'p', 'e', 'r', 's',
+    'e', 't',  27,   1,   6, 226, 138, 131, 226, 131, 146,   5, 'E', 'q', 'u',
+    'a', 'l',   3, 226, 138, 137,  69, 'T', 'i', 'l', 'd', 'e',  27,   3,   3,
+    226, 137, 129,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 132,   9, 'F',
+    'u', 'l', 'l', 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 135,   5, 'T', 'i',
+    'l', 'd', 'e',   3, 226, 137, 137,  11, 'V', 'e', 'r', 't', 'i', 'c', 'a',
+    'l', 'B', 'a', 'r',   3, 226, 136, 164,   3, 's', 'c', 'r',   4, 240, 157,
+    146, 169, 133, 't', 'i', 'l', 'd', 'e',   2, 195, 145,   1, 'u',   2, 206,
+    157,   4, 'E', 'l', 'i', 'g',   2, 197, 146, 133, 'a', 'c', 'u', 't', 'e',
+      2, 195, 147, 132, 'c', 'i', 'r', 'c',   2, 195, 148,   2, 'c', 'y',   2,
+    208, 158,   5, 'd', 'b', 'l', 'a', 'c',   2, 197, 144,   2, 'f', 'r',   4,
+    240, 157, 148, 146, 133, 'g', 'r', 'a', 'v', 'e',   2, 195, 146,   4, 'm',
+    'a', 'c', 'r',   2, 197, 140,   4, 'm', 'e', 'g', 'a',   2, 206, 169,   6,
+    'm', 'i', 'c', 'r', 'o', 'n',   2, 206, 159,   3, 'o', 'p', 'f',   4, 240,
+    157, 149, 134,  19, 'p', 'e', 'n', 'C', 'u', 'r', 'l', 'y', 'D', 'o', 'u',
+    'b', 'l', 'e', 'Q', 'u', 'o', 't', 'e',   3, 226, 128, 156,  13, 'p', 'e',
+    'n', 'C', 'u', 'r', 'l', 'y', 'Q', 'u', 'o', 't', 'e',   3, 226, 128, 152,
+      1, 'r',   3, 226, 169, 148,   3, 's', 'c', 'r',   4, 240, 157, 146, 170,
+    133, 's', 'l', 'a', 's', 'h',   2, 195, 152, 133, 't', 'i', 'l', 'd', 'e',
+      2, 195, 149,   5, 't', 'i', 'm', 'e', 's',   3, 226, 168, 183, 131, 'u',
+    'm', 'l',   2, 195, 150,   6, 'v', 'e', 'r', 'B', 'a', 'r',   3, 226, 128,
+    190,   8, 'v', 'e', 'r', 'B', 'r', 'a', 'c', 'e',   3, 226, 143, 158,  10,
+    'v', 'e', 'r', 'B', 'r', 'a', 'c', 'k', 'e', 't',   3, 226, 142, 180,  14,
+    'v', 'e', 'r', 'P', 'a', 'r', 'e', 'n', 't', 'h', 'e', 's', 'i', 's',   3,
+    226, 143, 156,   7, 'a', 'r', 't', 'i', 'a', 'l', 'D',   3, 226, 136, 130,
+      2, 'c', 'y',   2, 208, 159,   2, 'f', 'r',   4, 240, 157, 148, 147,   2,
+    'h', 'i',   2, 206, 166,   1, 'i',   2, 206, 160,   8, 'l', 'u', 's', 'M',
+    'i', 'n', 'u', 's',   2, 194, 177,  12, 'o', 'i', 'n', 'c', 'a', 'r', 'e',
+    'p', 'l', 'a', 'n', 'e',   3, 226, 132, 140,   3, 'o', 'p', 'f',   3, 226,
+    132, 153,  65, 'r',   3,   4,   3, 226, 170, 187,  70, 'e', 'c', 'e', 'd',
+    'e', 's',   4,   3,   3, 226, 137, 186,   5, 'E', 'q', 'u', 'a', 'l',   3,
+    226, 170, 175,  10, 'S', 'l', 'a', 'n', 't', 'E', 'q', 'u', 'a', 'l',   3,
+    226, 137, 188,   5, 'T', 'i', 'l', 'd', 'e',   3, 226, 137, 190,   3, 'i',
+    'm', 'e',   3, 226, 128, 179,   5, 'o', 'd', 'u', 'c', 't',   3, 226, 136,
+    143,  72, 'o', 'p', 'o', 'r', 't', 'i', 'o', 'n',   4,   1,   3, 226, 136,
+    183,   2, 'a', 'l',   3, 226, 136, 157,   3, 's', 'c', 'r',   4, 240, 157,
+    146, 171,   2, 's', 'i',   2, 206, 168, 131, 'U', 'O', 'T',   1, '"',   2,
+    'f', 'r',   4, 240, 157, 148, 148,   3, 'o', 'p', 'f',   3, 226, 132, 154,
+      3, 's', 'c', 'r',   4, 240, 157, 146, 172,   4, 'B', 'a', 'r', 'r',   3,
+    226, 164, 144, 130, 'E', 'G',   2, 194, 174,   5, 'a', 'c', 'u', 't', 'e',
+      2, 197, 148,   3, 'a', 'n', 'g',   3, 226, 159, 171,  67, 'a', 'r', 'r',
+     27,   1,   3, 226, 134, 160,   2, 't', 'l',   3, 226, 164, 150,   5, 'c',
+    'a', 'r', 'o', 'n',   2, 197, 152,   5, 'c', 'e', 'd', 'i', 'l',   2, 197,
+    150,   2, 'c', 'y',   2, 208, 160,  65, 'e',  24,   3,   3, 226, 132, 156,
+     12, 'v', 'e', 'r', 's', 'e', 'E', 'l', 'e', 'm', 'e', 'n', 't',   3, 226,
+    136, 139,  16, 'v', 'e', 'r', 's', 'e', 'E', 'q', 'u', 'i', 'l', 'i', 'b',
+    'r', 'i', 'u', 'm',   3, 226, 135, 139,  18, 'v', 'e', 'r', 's', 'e', 'U',
+    'p', 'E', 'q', 'u', 'i', 'l', 'i', 'b', 'r', 'i', 'u', 'm',   3, 226, 165,
+    175,   2, 'f', 'r',   3, 226, 132, 156,   2, 'h', 'o',   2, 206, 161,  16,
+    'i', 'g', 'h', 't', 'A', 'n', 'g', 'l', 'e', 'B', 'r', 'a', 'c', 'k', 'e',
+    't',   3, 226, 159, 169,  73, 'i', 'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',
+     23,   2,   3, 226, 134, 146,   3, 'B', 'a', 'r',   3, 226, 135, 165,   9,
+    'L', 'e', 'f', 't', 'A', 'r', 'r', 'o', 'w',   3, 226, 135, 132,  11, 'i',
+    'g', 'h', 't', 'C', 'e', 'i', 'l', 'i', 'n', 'g',   3, 226, 140, 137,  17,
+    'i', 'g', 'h', 't', 'D', 'o', 'u', 'b', 'l', 'e', 'B', 'r', 'a', 'c', 'k',
+    'e', 't',   3, 226, 159, 167,  17, 'i', 'g', 'h', 't', 'D', 'o', 'w', 'n',
+    'T', 'e', 'e', 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165, 157,  78, 'i',
+    'g', 'h', 't', 'D', 'o', 'w', 'n', 'V', 'e', 'c', 't', 'o', 'r',  21,   1,
+      3, 226, 135, 130,   3, 'B', 'a', 'r',   3, 226, 165, 149,   9, 'i', 'g',
+    'h', 't', 'F', 'l', 'o', 'o', 'r',   3, 226, 140, 139,  71, 'i', 'g', 'h',
+    't', 'T', 'e', 'e',  20,   2,   3, 226, 138, 162,   5, 'A', 'r', 'r', 'o',
+    'w',   3, 226, 134, 166,   6, 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165,
+    155,  76, 'i', 'g', 'h', 't', 'T', 'r', 'i', 'a', 'n', 'g', 'l', 'e',  21,
+      2,   3, 226, 138, 179,   3, 'B', 'a', 'r',   3, 226, 167, 144,   5, 'E',
+    'q', 'u', 'a', 'l',   3, 226, 138, 181,  16, 'i', 'g', 'h', 't', 'U', 'p',
+    'D', 'o', 'w', 'n', 'V', 'e', 'c', 't', 'o', 'r',   3, 226, 165, 143,  15,
+    'i', 'g', 'h', 't', 'U', 'p', 'T', 'e', 'e', 'V', 'e', 'c', 't', 'o', 'r',
+      3, 226, 165, 156,  76, 'i', 'g', 'h', 't', 'U', 'p', 'V', 'e', 'c', 't',
+    'o', 'r',  20,   1,   3, 226, 134, 190,   3, 'B', 'a', 'r',   3, 226, 165,
+    148,  74, 'i', 'g', 'h', 't', 'V', 'e', 'c', 't', 'o', 'r',  20,   1,   3,
+    226, 135, 128,   3, 'B', 'a', 'r',   3, 226, 165, 147,   9, 'i', 'g', 'h',
+    't', 'a', 'r', 'r', 'o', 'w',   3, 226, 135, 146,   3, 'o', 'p', 'f',   3,
+    226, 132, 157,  11, 'o', 'u', 'n', 'd', 'I', 'm', 'p', 'l', 'i', 'e', 's',
+      3, 226, 165, 176,  10, 'r', 'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',
+      3, 226, 135, 155,   3, 's', 'c', 'r',   3, 226, 132, 155,   2, 's', 'h',
+      3, 226, 134, 177,  10, 'u', 'l', 'e', 'D', 'e', 'l', 'a', 'y', 'e', 'd',
+      3, 226, 167, 180,   5, 'H', 'C', 'H', 'c', 'y',   2, 208, 169,   3, 'H',
+    'c', 'y',   2, 208, 168,   5, 'O', 'F', 'T', 'c', 'y',   2, 208, 172,   5,
+    'a', 'c', 'u', 't', 'e',   2, 197, 154,  65, 'c',  18,   4,   3, 226, 170,
+    188,   4, 'a', 'r', 'o', 'n',   2, 197, 160,   4, 'e', 'd', 'i', 'l',   2,
+    197, 158,   3, 'i', 'r', 'c',   2, 197, 156,   1, 'y',   2, 208, 161,   2,
+    'f', 'r',   4, 240, 157, 148, 150,  13, 'h', 'o', 'r', 't', 'D', 'o', 'w',
+    'n', 'A', 'r', 'r', 'o', 'w',   3, 226, 134, 147,  13, 'h', 'o', 'r', 't',
+    'L', 'e', 'f', 't', 'A', 'r', 'r', 'o', 'w',   3, 226, 134, 144,  14, 'h',
+    'o', 'r', 't', 'R', 'i', 'g', 'h', 't', 'A', 'r', 'r', 'o', 'w',   3, 226,
+    134, 146,  11, 'h', 'o', 'r', 't', 'U', 'p', 'A', 'r', 'r', 'o', 'w',   3,
+    226, 134, 145,   4, 'i', 'g', 'm', 'a',   2, 206, 163,  10, 'm', 'a', 'l',
+    'l', 'C', 'i', 'r', 'c', 'l', 'e',   3, 226, 136, 152,   3, 'o', 'p', 'f',
+      4, 240, 157, 149, 138,   3, 'q', 'r', 't',   3, 226, 136, 154,  69, 'q',
+    'u', 'a', 'r', 'e',  12,   4,   3, 226, 150, 161,  12, 'I', 'n', 't', 'e',
+    'r', 's', 'e', 'c', 't', 'i', 'o', 'n',   3, 226, 138, 147,  70, 'S', 'u',
+    'b', 's', 'e', 't',   3,   1,   3, 226, 138, 143,   5, 'E', 'q', 'u', 'a',
+    'l',   3, 226, 138, 145,  72, 'S', 'u', 'p', 'e', 'r', 's', 'e', 't',   3,
+      1,   3, 226, 138, 144,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 138, 146,
+      5, 'U', 'n', 'i', 'o', 'n',   3, 226, 138, 148,   3, 's', 'c', 'r',   4,
+    240, 157, 146, 174,   3, 't', 'a', 'r',   3, 226, 139, 134,  66, 'u', 'b',
+     15,   1,   3, 226, 139, 144,  67, 's', 'e', 't',   1,   1,   3, 226, 139,
+    144,   5, 'E', 'q', 'u', 'a', 'l',   3, 226, 138, 134,  71, 'u', 'c', 'c',
+    'e', 'e', 'd', 's',  16,   3,   3, 226, 137, 187,   5, 'E', 'q', 'u', 'a',
+    'l',   3, 226, 170, 176,  10, 'S', 'l', 'a', 'n', 't', 'E', 'q', 'u', 'a',
+    'l',   3, 226, 137, 189,   5, 'T', 'i', 'l', 'd', 'e',   3, 226, 137, 191,
+      7, 'u', 'c', 'h', 'T', 'h', 'a', 't',   3, 226, 136, 139,   2, 'u', 'm',
+      3, 226, 136, 145,  66, 'u', 'p',  16,   2,   3, 226, 139, 145,  69, 'e',
+    'r', 's', 'e', 't',   2,   1,   3, 226, 138, 131,   5, 'E', 'q', 'u', 'a',
+    'l',   3, 226, 138, 135,   3, 's', 'e', 't',   3, 226, 139, 145, 132, 'H',
+    'O', 'R', 'N',   2, 195, 158,   4, 'R', 'A', 'D', 'E',   3, 226, 132, 162,
+      4, 'S', 'H', 'c', 'y',   2, 208, 139,   3, 'S', 'c', 'y',   2, 208, 166,
+      2, 'a', 'b',   1,   9,   2, 'a', 'u',   2, 206, 164,   5, 'c', 'a', 'r',
+    'o', 'n',   2, 197, 164,   5, 'c', 'e', 'd', 'i', 'l',   2, 197, 162,   2,
+    'c', 'y',   2, 208, 162,   2, 'f', 'r',   4, 240, 157, 148, 151,   8, 'h',
+    'e', 'r', 'e', 'f', 'o', 'r', 'e',   3, 226, 136, 180,   4, 'h', 'e', 't',
+    'a',   2, 206, 152,   9, 'h', 'i', 'c', 'k', 'S', 'p', 'a', 'c', 'e',   6,
+    226, 129, 159, 226, 128, 138,   8, 'h', 'i', 'n', 'S', 'p', 'a', 'c', 'e',
+      3, 226, 128, 137,  68, 'i', 'l', 'd', 'e',   5,   3,   3, 226, 136, 188,
+      5, 'E', 'q', 'u', 'a', 'l',   3, 226, 137, 131,   9, 'F', 'u', 'l', 'l',
+    'E', 'q', 'u', 'a', 'l',   3, 226, 137, 133,   5, 'T', 'i', 'l', 'd', 'e',
+      3, 226, 137, 136,   3, 'o', 'p', 'f',   4, 240, 157, 149, 139,   8, 'r',
+    'i', 'p', 'l', 'e', 'D', 'o', 't',   3, 226, 131, 155,   3, 's', 'c', 'r',
+      4, 240, 157, 146, 175,   5, 's', 't', 'r', 'o', 'k',   2, 197, 166, 133,
+    'a', 'c', 'u', 't', 'e',   2, 195, 154,  67, 'a', 'r', 'r',  29,   1,   3,
+    226, 134, 159,   4, 'o', 'c', 'i', 'r',   3, 226, 165, 137,   4, 'b', 'r',
+    'c', 'y',   2, 208, 142,   5, 'b', 'r', 'e', 'v', 'e',   2, 197, 172, 132,
+    'c', 'i', 'r', 'c',   2, 195, 155,   2, 'c', 'y',   2, 208, 163,   5, 'd',
+    'b', 'l', 'a', 'c',   2, 197, 176,   2, 'f', 'r',   4, 240, 157, 148, 152,
+    133, 'g', 'r', 'a', 'v', 'e',   2, 195, 153,   4, 'm', 'a', 'c', 'r',   2,
+    197, 170,   7, 'n', 'd', 'e', 'r', 'B', 'a', 'r',   1, '_',   9, 'n', 'd',
+    'e', 'r', 'B', 'r', 'a', 'c', 'e',   3, 226, 143, 159,  11, 'n', 'd', 'e',
+    'r', 'B', 'r', 'a', 'c', 'k', 'e', 't',   3, 226, 142, 181,  15, 'n', 'd',
+    'e', 'r', 'P', 'a', 'r', 'e', 'n', 't', 'h', 'e', 's', 'i', 's',   3, 226,
+    143, 157,  68, 'n', 'i', 'o', 'n',  17,   1,   3, 226, 139, 131,   4, 'P',
+    'l', 'u', 's',   3, 226, 138, 142,   4, 'o', 'g', 'o', 'n',   2, 197, 178,
+      3, 'o', 'p', 'f',   4, 240, 157, 149, 140,  70, 'p', 'A', 'r', 'r', 'o',
+    'w',  15,   2,   3, 226, 134, 145,   3, 'B', 'a', 'r',   3, 226, 164, 146,
+      9, 'D', 'o', 'w', 'n', 'A', 'r', 'r', 'o', 'w',   3, 226, 135, 133,  10,
+    'p', 'D', 'o', 'w', 'n', 'A', 'r', 'r', 'o', 'w',   3, 226, 134, 149,  12,
+    'p', 'E', 'q', 'u', 'i', 'l', 'i', 'b', 'r', 'i', 'u', 'm',   3, 226, 165,
+    174,  68, 'p', 'T', 'e', 'e',  14,   1,   3, 226, 138, 165,   5, 'A', 'r',
+    'r', 'o', 'w',   3, 226, 134, 165,   6, 'p', 'a', 'r', 'r', 'o', 'w',   3,
+    226, 135, 145,  10, 'p', 'd', 'o', 'w', 'n', 'a', 'r', 'r', 'o', 'w',   3,
+    226, 135, 149,  13, 'p', 'p', 'e', 'r', 'L', 'e', 'f', 't', 'A', 'r', 'r',
+    'o', 'w',   3, 226, 134, 150,  14, 'p', 'p', 'e', 'r', 'R', 'i', 'g', 'h',
+    't', 'A', 'r', 'r', 'o', 'w',   3, 226, 134, 151,  67, 'p', 's', 'i',  10,
+      1,   2, 207, 146,   3, 'l', 'o', 'n',   2, 206, 165,   4, 'r', 'i', 'n',
+    'g',   2, 197, 174,   3, 's', 'c', 'r',   4, 240, 157, 146, 176,   5, 't',
+    'i', 'l', 'd', 'e',   2, 197, 168, 131, 'u', 'm', 'l',   2, 195, 156,   4,
+    'D', 'a', 's', 'h',   3, 226, 138, 171,   3, 'b', 'a', 'r',   3, 226, 171,
+    171,   2, 'c', 'y',   2, 208, 146,  68, 'd', 'a', 's', 'h',   9,   1,   3,
+    226, 138, 169,   1, 'l',   3, 226, 171, 166,   2, 'e', 'e',   3, 226, 139,
+    129,   5, 'e', 'r', 'b', 'a', 'r',   3, 226, 128, 150,  67, 'e', 'r', 't',
+      7,   4,   3, 226, 128, 150,   7, 'i', 'c', 'a', 'l', 'B', 'a', 'r',   3,
+    226, 136, 163,   8, 'i', 'c', 'a', 'l', 'L', 'i', 'n', 'e',   1, '|',  13,
+    'i', 'c', 'a', 'l', 'S', 'e', 'p', 'a', 'r', 'a', 't', 'o', 'r',   3, 226,
+    157, 152,   9, 'i', 'c', 'a', 'l', 'T', 'i', 'l', 'd', 'e',   3, 226, 137,
+    128,  12, 'e', 'r', 'y', 'T', 'h', 'i', 'n', 'S', 'p', 'a', 'c', 'e',   3,
+    226, 128, 138,   2, 'f', 'r',   4, 240, 157, 148, 153,   3, 'o', 'p', 'f',
+      4, 240, 157, 149, 141,   3, 's', 'c', 'r',   4, 240, 157, 146, 177,   5,
+    'v', 'd', 'a', 's', 'h',   3, 226, 138, 170,   4, 'c', 'i', 'r', 'c',   2,
+    197, 180,   4, 'e', 'd', 'g', 'e',   3, 226, 139, 128,   2, 'f', 'r',   4,
+    240, 157, 148, 154,   3, 'o', 'p', 'f',   4, 240, 157, 149, 142,   3, 's',
+    'c', 'r',   4, 240, 157, 146, 178,   2, 'f', 'r',   4, 240, 157, 148, 155,
+      1, 'i',   2, 206, 158,   3, 'o', 'p', 'f',   4, 240, 157, 149, 143,   3,
+    's', 'c', 'r',   4, 240, 157, 146, 179,   3, 'A', 'c', 'y',   2, 208, 175,
+      3, 'I', 'c', 'y',   2, 208, 135,   3, 'U', 'c', 'y',   2, 208, 174, 133,
+    'a', 'c', 'u', 't', 'e',   2, 195, 157,   4, 'c', 'i', 'r', 'c',   2, 197,
+    182,   2, 'c', 'y',   2, 208, 171,   2, 'f', 'r',   4, 240, 157, 148, 156,
+      3, 'o', 'p', 'f',   4, 240, 157, 149, 144,   3, 's', 'c', 'r',   4, 240,
+    157, 146, 180,   3, 'u', 'm', 'l',   2, 197, 184,   3, 'H', 'c', 'y',   2,
+    208, 150,   5, 'a', 'c', 'u', 't', 'e',   2, 197, 185,   5, 'c', 'a', 'r',
+    'o', 'n',   2, 197, 189,   2, 'c', 'y',   2, 208, 151,   3, 'd', 'o', 't',
+      2, 197, 187,  13, 'e', 'r', 'o', 'W', 'i', 'd', 't', 'h', 'S', 'p', 'a',
+    'c', 'e',   3, 226, 128, 139,   3, 'e', 't', 'a',   2, 206, 150,   2, 'f',
+    'r',   3, 226, 132, 168,   3, 'o', 'p', 'f',   3, 226, 132, 164,   3, 's',
+    'c', 'r',   4, 240, 157, 146, 181, 133, 'a', 'c', 'u', 't', 'e',   2, 195,
+    161,   5, 'b', 'r', 'e', 'v', 'e',   2, 196, 131,  65, 'c',  23,   5,   3,
+    226, 136, 190,   1, 'E',   5, 226, 136, 190, 204, 179,   1, 'd',   3, 226,
+    136, 191, 131, 'i', 'r', 'c',   2, 195, 162, 131, 'u', 't', 'e',   2, 194,
+    180,   1, 'y',   2, 208, 176, 132, 'e', 'l', 'i', 'g',   2, 195, 166,  65,
+    'f',  26,   1,   3, 226, 129, 161,   1, 'r',   4, 240, 157, 148, 158, 133,
+    'g', 'r', 'a', 'v', 'e',   2, 195, 160,   6, 'l', 'e', 'f', 's', 'y', 'm',
+      3, 226, 132, 181,   4, 'l', 'e', 'p', 'h',   3, 226, 132, 181,   4, 'l',
+    'p', 'h', 'a',   2, 206, 177,   4, 'm', 'a', 'c', 'r',   2, 196, 129,   4,
+    'm', 'a', 'l', 'g',   3, 226, 168, 191, 130, 'm', 'p',   1, '&',  66, 'n',
+    'd',  19,   4,   3, 226, 136, 167,   3, 'a', 'n', 'd',   3, 226, 169, 149,
+      1, 'd',   3, 226, 169, 156,   5, 's', 'l', 'o', 'p', 'e',   3, 226, 169,
+    152,   1, 'v',   3, 226, 169, 154,  66, 'n', 'g',  22,   7,   3, 226, 136,
+    160,   1, 'e',   3, 226, 166, 164,   2, 'l', 'e',   3, 226, 136, 160,  67,
+    'm', 's', 'd',   5,   8,   3, 226, 136, 161,   2, 'a', 'a',   3, 226, 166,
+    168,   2, 'a', 'b',   3, 226, 166, 169,   2, 'a', 'c',   3, 226, 166, 170,
+      2, 'a', 'd',   3, 226, 166, 171,   2, 'a', 'e',   3, 226, 166, 172,   2,
+    'a', 'f',   3, 226, 166, 173,   2, 'a', 'g',   3, 226, 166, 174,   2, 'a',
+    'h',   3, 226, 166, 175,  66, 'r', 't',  12,   1,   3, 226, 136, 159,  66,
+    'v', 'b',   1,   1,   3, 226, 138, 190,   1, 'd',   3, 226, 166, 157,   3,
+    's', 'p', 'h',   3, 226, 136, 162,   2, 's', 't',   2, 195, 133,   4, 'z',
+    'a', 'r', 'r',   3, 226, 141, 188,   4, 'o', 'g', 'o', 'n',   2, 196, 133,
+      3, 'o', 'p', 'f',   4, 240, 157, 149, 146,  65, 'p',  36,   6,   3, 226,
+    137, 136,   1, 'E',   3, 226, 169, 176,   4, 'a', 'c', 'i', 'r',   3, 226,
+    169, 175,   1, 'e',   3, 226, 137, 138,   2, 'i', 'd',   3, 226, 137, 139,
+      2, 'o', 's',   1,  39,  68, 'p', 'r', 'o', 'x',   1,   1,   3, 226, 137,
+    136,   2, 'e', 'q',   3, 226, 137, 138, 132, 'r', 'i', 'n', 'g',   2, 195,
+    165,   3, 's', 'c', 'r',   4, 240, 157, 146, 182,   2, 's', 't',   1, '*',
+     68, 's', 'y', 'm', 'p',  39,   1,   3, 226, 137, 136,   2, 'e', 'q',   3,
+    226, 137, 141, 133, 't', 'i', 'l', 'd', 'e',   2, 195, 163, 131, 'u', 'm',
+    'l',   2, 195, 164,   7, 'w', 'c', 'o', 'n', 'i', 'n', 't',   3, 226, 136,
+    179,   4, 'w', 'i', 'n', 't',   3, 226, 168, 145,   3, 'N', 'o', 't',   3,
+    226, 171, 173,   7, 'a', 'c', 'k', 'c', 'o', 'n', 'g',   3, 226, 137, 140,
+     10, 'a', 'c', 'k', 'e', 'p', 's', 'i', 'l', 'o', 'n',   2, 207, 182,   8,
+    'a', 'c', 'k', 'p', 'r', 'i', 'm', 'e',   3, 226, 128, 181,  70, 'a', 'c',
+    'k', 's', 'i', 'm',  75,   1,   3, 226, 136, 189,   2, 'e', 'q',   3, 226,
+    139, 141,   5, 'a', 'r', 'v', 'e', 'e',   3, 226, 138, 189,  69, 'a', 'r',
+    'w', 'e', 'd',  74,   1,   3, 226, 140, 133,   2, 'g', 'e',   3, 226, 140,
+    133,  67, 'b', 'r', 'k',  74,   1,   3, 226, 142, 181,   4, 't', 'b', 'r',
+    'k',   3, 226, 142, 182,   4, 'c', 'o', 'n', 'g',   3, 226, 137, 140,   2,
+    'c', 'y',   2, 208, 177,   4, 'd', 'q', 'u', 'o',   3, 226, 128, 158,  69,
+    'e', 'c', 'a', 'u', 's',  71,   1,   3, 226, 136, 181,   1, 'e',   3, 226,
+    136, 181,   6, 'e', 'm', 'p', 't', 'y', 'v',   3, 226, 166, 176,   4, 'e',
+    'p', 's', 'i',   2, 207, 182,   5, 'e', 'r', 'n', 'o', 'u',   3, 226, 132,
+    172,   3, 'e', 't', 'a',   2, 206, 178,   3, 'e', 't', 'h',   3, 226, 132,
+    182,   6, 'e', 't', 'w', 'e', 'e', 'n',   3, 226, 137, 172,   2, 'f', 'r',
+      4, 240, 157, 148, 159,   5, 'i', 'g', 'c', 'a', 'p',   3, 226, 139, 130,
+      6, 'i', 'g', 'c', 'i', 'r', 'c',   3, 226, 151, 175,   5, 'i', 'g', 'c',
+    'u', 'p',   3, 226, 139, 131,   6, 'i', 'g', 'o', 'd', 'o', 't',   3, 226,
+    168, 128,   7, 'i', 'g', 'o', 'p', 'l', 'u', 's',   3, 226, 168, 129,   8,
+    'i', 'g', 'o', 't', 'i', 'm', 'e', 's',   3, 226, 168, 130,   7, 'i', 'g',
+    's', 'q', 'c', 'u', 'p',   3, 226, 168, 134,   6, 'i', 'g', 's', 't', 'a',
+    'r',   3, 226, 152, 133,  14, 'i', 'g', 't', 'r', 'i', 'a', 'n', 'g', 'l',
+    'e', 'd', 'o', 'w', 'n',   3, 226, 150, 189,  12, 'i', 'g', 't', 'r', 'i',
+    'a', 'n', 'g', 'l', 'e', 'u', 'p',   3, 226, 150, 179,   7, 'i', 'g', 'u',
+    'p', 'l', 'u', 's',   3, 226, 168, 132,   5, 'i', 'g', 'v', 'e', 'e',   3,
+    226, 139, 129,   7, 'i', 'g', 'w', 'e', 'd', 'g', 'e',   3, 226, 139, 128,
+      5, 'k', 'a', 'r', 'o', 'w',   3, 226, 164, 141,  11, 'l', 'a', 'c', 'k',
+    'l', 'o', 'z', 'e', 'n', 'g', 'e',   3, 226, 167, 171,  10, 'l', 'a', 'c',
+    'k', 's', 'q', 'u', 'a', 'r', 'e',   3, 226, 150, 170,  76, 'l', 'a', 'c',
+    'k', 't', 'r', 'i', 'a', 'n', 'g', 'l', 'e',  48,   3,   3, 226, 150, 180,
+      4, 'd', 'o', 'w', 'n',   3, 226, 150, 190,   4, 'l', 'e', 'f', 't',   3,
+    226, 151, 130,   5, 'r', 'i', 'g', 'h', 't',   3, 226, 150, 184,   4, 'l',
+    'a', 'n', 'k',   3, 226, 144, 163,   4, 'l', 'k', '1', '2',   3, 226, 150,
+    146,   4, 'l', 'k', '1', '4',   3, 226, 150, 145,   4, 'l', 'k', '3', '4',
+      3, 226, 150, 147,   4, 'l', 'o', 'c', 'k',   3, 226, 150, 136,  66, 'n',
+    'e',  45,   1,   4, '=', 226, 131, 165,   4, 'q', 'u', 'i', 'v',   6, 226,
+    137, 161, 226, 131, 165,   3, 'n', 'o', 't',   3, 226, 140, 144,   3, 'o',
+    'p', 'f',   4, 240, 157, 149, 147,  66, 'o', 't',  43,   1,   3, 226, 138,
+    165,   3, 't', 'o', 'm',   3, 226, 138, 165,   5, 'o', 'w', 't', 'i', 'e',
+      3, 226, 139, 136,   4, 'o', 'x', 'D', 'L',   3, 226, 149, 151,   4, 'o',
+    'x', 'D', 'R',   3, 226, 149, 148,   4, 'o', 'x', 'D', 'l',   3, 226, 149,
+    150,   4, 'o', 'x', 'D', 'r',   3, 226, 149, 147,  67, 'o', 'x', 'H',  38,
+      4,   3, 226, 149, 144,   1, 'D',   3, 226, 149, 166,   1, 'U',   3, 226,
+    149, 169,   1, 'd',   3, 226, 149, 164,   1, 'u',   3, 226, 149, 167,   4,
+    'o', 'x', 'U', 'L',   3, 226, 149, 157,   4, 'o', 'x', 'U', 'R',   3, 226,
+    149, 154,   4, 'o', 'x', 'U', 'l',   3, 226, 149, 156,   4, 'o', 'x', 'U',
+    'r',   3, 226, 149, 153,  67, 'o', 'x', 'V',  37,   6,   3, 226, 149, 145,
+      1, 'H',   3, 226, 149, 172,   1, 'L',   3, 226, 149, 163,   1, 'R',   3,
+    226, 149, 160,   1, 'h',   3, 226, 149, 171,   1, 'l',   3, 226, 149, 162,
+      1, 'r',   3, 226, 149, 159,   5, 'o', 'x', 'b', 'o', 'x',   3, 226, 167,
+    137,   4, 'o', 'x', 'd', 'L',   3, 226, 149, 149,   4, 'o', 'x', 'd', 'R',
+      3, 226, 149, 146,   4, 'o', 'x', 'd', 'l',   3, 226, 148, 144,   4, 'o',
+    'x', 'd', 'r',   3, 226, 148, 140,  67, 'o', 'x', 'h',  37,   4,   3, 226,
+    148, 128,   1, 'D',   3, 226, 149, 165,   1, 'U',   3, 226, 149, 168,   1,
+    'd',   3, 226, 148, 172,   1, 'u',   3, 226, 148, 180,   7, 'o', 'x', 'm',
+    'i', 'n', 'u', 's',   3, 226, 138, 159,   6, 'o', 'x', 'p', 'l', 'u', 's',
+      3, 226, 138, 158,   7, 'o', 'x', 't', 'i', 'm', 'e', 's',   3, 226, 138,
+    160,   4, 'o', 'x', 'u', 'L',   3, 226, 149, 155,   4, 'o', 'x', 'u', 'R',
+      3, 226, 149, 152,   4, 'o', 'x', 'u', 'l',   3, 226, 148, 152,   4, 'o',
+    'x', 'u', 'r',   3, 226, 148, 148,  67, 'o', 'x', 'v',  33,   6,   3, 226,
+    148, 130,   1, 'H',   3, 226, 149, 170,   1, 'L',   3, 226, 149, 161,   1,
+    'R',   3, 226, 149, 158,   1, 'h',   3, 226, 148, 188,   1, 'l',   3, 226,
+    148, 164,   1, 'r',   3, 226, 148, 156,   5, 'p', 'r', 'i', 'm', 'e',   3,
+    226, 128, 181,   4, 'r', 'e', 'v', 'e',   2, 203, 152, 133, 'r', 'v', 'b',
+    'a', 'r',   2, 194, 166,   3, 's', 'c', 'r',   4, 240, 157, 146, 183,   4,
+    's', 'e', 'm', 'i',   3, 226, 129, 143,  67, 's', 'i', 'm',  33,   1,   3,
+    226, 136, 189,   1, 'e',   3, 226, 139, 141,  67, 's', 'o', 'l',  33,   2,
+      1,  92,   1, 'b',   3, 226, 167, 133,   4, 'h', 's', 'u', 'b',   3, 226,
+    159, 136,  67, 'u', 'l', 'l',  34,   1,   3, 226, 128, 162,   2, 'e', 't',
+      3, 226, 128, 162,  67, 'u', 'm', 'p',  34,   2,   3, 226, 137, 142,   1,
+    'E',   3, 226, 170, 174,  65, 'e',   1,   1,   3, 226, 137, 143,   1, 'q',
+      3, 226, 137, 143,   5, 'a', 'c', 'u', 't', 'e',   2, 196, 135,  66, 'a',
+    'p',  51,   6,   3, 226, 136, 169,   3, 'a', 'n', 'd',   3, 226, 169, 132,
+      5, 'b', 'r', 'c', 'u', 'p',   3, 226, 169, 137,   3, 'c', 'a', 'p',   3,
+    226, 169, 139,   3, 'c', 'u', 'p',   3, 226, 169, 135,   3, 'd', 'o', 't',
+      3, 226, 169, 128,   1, 's',   6, 226, 136, 169, 239, 184, 128,   4, 'a',
+    'r', 'e', 't',   3, 226, 129, 129,   4, 'a', 'r', 'o', 'n',   2, 203, 135,
+      4, 'c', 'a', 'p', 's',   3, 226, 169, 141,   5, 'c', 'a', 'r', 'o', 'n',
+      2, 196, 141, 133, 'c', 'e', 'd', 'i', 'l',   2, 195, 167,   4, 'c', 'i',
+    'r', 'c',   2, 196, 137,  68, 'c', 'u', 'p', 's',  50,   1,   3, 226, 169,
+    140,   2, 's', 'm',   3, 226, 169, 144,   3, 'd', 'o', 't',   2, 196, 139,
+    132, 'e', 'd', 'i', 'l',   2, 194, 184,   6, 'e', 'm', 'p', 't', 'y', 'v',
+      3, 226, 166, 178, 195, 'e', 'n', 't',  47,   1,   2, 194, 162,   5, 'e',
+    'r', 'd', 'o', 't',   2, 194, 183,   2, 'f', 'r',   4, 240, 157, 148, 160,
+      3, 'h', 'c', 'y',   2, 209, 135,  68, 'h', 'e', 'c', 'k',  45,   1,   3,
+    226, 156, 147,   4, 'm', 'a', 'r', 'k',   3, 226, 156, 147,   2, 'h', 'i',
+      2, 207, 135,  66, 'i', 'r',  44,   6,   3, 226, 151, 139,   1, 'E',   3,
+    226, 167, 131,  65, 'c',   5,   8,   2, 203, 134,   2, 'e', 'q',   3, 226,
+    137, 151,  11, 'l', 'e', 'a', 'r', 'r', 'o', 'w', 'l', 'e', 'f', 't',   3,
+    226, 134, 186,  12, 'l', 'e', 'a', 'r', 'r', 'o', 'w', 'r', 'i', 'g', 'h',
+    't',   3, 226, 134, 187,   4, 'l', 'e', 'd', 'R',   2, 194, 174,   4, 'l',
+    'e', 'd', 'S',   3, 226, 147, 136,   6, 'l', 'e', 'd', 'a', 's', 't',   3,
+    226, 138, 155,   7, 'l', 'e', 'd', 'c', 'i', 'r', 'c',   3, 226, 138, 154,
+      7, 'l', 'e', 'd', 'd', 'a', 's', 'h',   3, 226, 138, 157,   1, 'e',   3,
+    226, 137, 151,   5, 'f', 'n', 'i', 'n', 't',   3, 226, 168, 144,   3, 'm',
+    'i', 'd',   3, 226, 171, 175,   4, 's', 'c', 'i', 'r',   3, 226, 167, 130,
+     68, 'l', 'u', 'b', 's',  57,   1,   3, 226, 153, 163,   3, 'u', 'i', 't',
+      3, 226, 153, 163,  68, 'o', 'l', 'o', 'n',  57,   1,   1, ':',  65, 'e',
+      1,   1,   3, 226, 137, 148,   1, 'q',   3, 226, 137, 148,  68, 'o', 'm',
+    'm', 'a',  58,   1,   1, ',',   1, 't',   1, '@',  67, 'o', 'm', 'p',  58,
+      3,   3, 226, 136, 129,   2, 'f', 'n',   3, 226, 136, 152,   6, 'l', 'e',
+    'm', 'e', 'n', 't',   3, 226, 136, 129,   5, 'l', 'e', 'x', 'e', 's',   3,
+    226, 132, 130,  67, 'o', 'n', 'g',  60,   1,   3, 226, 137, 133,   3, 'd',
+    'o', 't',   3, 226, 169, 173,   5, 'o', 'n', 'i', 'n', 't',   3, 226, 136,
+    174,   3, 'o', 'p', 'f',   4, 240, 157, 149, 148,   5, 'o', 'p', 'r', 'o',
+    'd',   3, 226, 136, 144, 195, 'o', 'p', 'y',  57,   1,   2, 194, 169,   2,
+    's', 'r',   3, 226, 132, 151,   4, 'r', 'a', 'r', 'r',   3, 226, 134, 181,
+      4, 'r', 'o', 's', 's',   3, 226, 156, 151,   3, 's', 'c', 'r',   4, 240,
+    157, 146, 184,  67, 's', 'u', 'b',  54,   1,   3, 226, 171, 143,   1, 'e',
+      3, 226, 171, 145,  67, 's', 'u', 'p',  54,   1,   3, 226, 171, 144,   1,
+    'e',   3, 226, 171, 146,   4, 't', 'd', 'o', 't',   3, 226, 139, 175,   6,
+    'u', 'd', 'a', 'r', 'r', 'l',   3, 226, 164, 184,   6, 'u', 'd', 'a', 'r',
+    'r', 'r',   3, 226, 164, 181,   4, 'u', 'e', 'p', 'r',   3, 226, 139, 158,
+      4, 'u', 'e', 's', 'c',   3, 226, 139, 159,  69, 'u', 'l', 'a', 'r', 'r',
+     49,   1,   3, 226, 134, 182,   1, 'p',   3, 226, 164, 189,  66, 'u', 'p',
+     49,   6,   3, 226, 136, 170,   5, 'b', 'r', 'c', 'a', 'p',   3, 226, 169,
+    136,   3, 'c', 'a', 'p',   3, 226, 169, 134,   3, 'c', 'u', 'p',   3, 226,
+    169, 138,   3, 'd', 'o', 't',   3, 226, 138, 141,   2, 'o', 'r',   3, 226,
+    169, 133,   1, 's',   6, 226, 136, 170, 239, 184, 128,  69, 'u', 'r', 'a',
+    'r', 'r',  54,   1,   3, 226, 134, 183,   1, 'm',   3, 226, 164, 188,  10,
+    'u', 'r', 'l', 'y', 'e', 'q', 'p', 'r', 'e', 'c',   3, 226, 139, 158,  10,
+    'u', 'r', 'l', 'y', 'e', 'q', 's', 'u', 'c', 'c',   3, 226, 139, 159,   7,
+    'u', 'r', 'l', 'y', 'v', 'e', 'e',   3, 226, 139, 142,   9, 'u', 'r', 'l',
+    'y', 'w', 'e', 'd', 'g', 'e',   3, 226, 139, 143, 133, 'u', 'r', 'r', 'e',
+    'n',   2, 194, 164,  13, 'u', 'r', 'v', 'e', 'a', 'r', 'r', 'o', 'w', 'l',
+    'e', 'f', 't',   3, 226, 134, 182,  14, 'u', 'r', 'v', 'e', 'a', 'r', 'r',
+    'o', 'w', 'r', 'i', 'g', 'h', 't',   3, 226, 134, 183,   4, 'u', 'v', 'e',
+    'e',   3, 226, 139, 142,   4, 'u', 'w', 'e', 'd',   3, 226, 139, 143,   7,
+    'w', 'c', 'o', 'n', 'i', 'n', 't',   3, 226, 136, 178,   4, 'w', 'i', 'n',
+    't',   3, 226, 136, 177,   5, 'y', 'l', 'c', 't', 'y',   3, 226, 140, 173,
+      3, 'A', 'r', 'r',   3, 226, 135, 147,   3, 'H', 'a', 'r',   3, 226, 165,
+    165,   5, 'a', 'g', 'g', 'e', 'r',   3, 226, 128, 160,   5, 'a', 'l', 'e',
+    't', 'h',   3, 226, 132, 184,   3, 'a', 'r', 'r',   3, 226, 134, 147,  67,
+    'a', 's', 'h',  43,   1,   3, 226, 128, 144,   1, 'v',   3, 226, 138, 163,
+      6, 'b', 'k', 'a', 'r', 'o', 'w',   3, 226, 164, 143,   4, 'b', 'l', 'a',
+    'c',   2, 203, 157,   5, 'c', 'a', 'r', 'o', 'n',   2, 196, 143,   2, 'c',
+    'y',   2, 208, 180,  65, 'd',  39,   3,   3, 226, 133, 134,   5, 'a', 'g',
+    'g', 'e', 'r',   3, 226, 128, 161,   3, 'a', 'r', 'r',   3, 226, 135, 138,
+      5, 'o', 't', 's', 'e', 'q',   3, 226, 169, 183, 130, 'e', 'g',   2, 194,
+    176,   4, 'e', 'l', 't', 'a',   2, 206, 180,   6, 'e', 'm', 'p', 't', 'y',
+    'v',   3, 226, 166, 177,   5, 'f', 'i', 's', 'h', 't',   3, 226, 165, 191,
+      2, 'f', 'r',   4, 240, 157, 148, 161,   4, 'h', 'a', 'r', 'l',   3, 226,
+    135, 131,   4, 'h', 'a', 'r', 'r',   3, 226, 135, 130,  67, 'i', 'a', 'm',
+     34,   2,   3, 226, 139, 132,  67, 'o', 'n', 'd',   2,   1,   3, 226, 139,
+    132,   4, 's', 'u', 'i', 't',   3, 226, 153, 166,   1, 's',   3, 226, 153,
+    166,   2, 'i', 'e',   2, 194, 168,   6, 'i', 'g', 'a', 'm', 'm', 'a',   2,
+    207, 157,   4, 'i', 's', 'i', 'n',   3, 226, 139, 178,  66, 'i', 'v',  33,
+      2,   2, 195, 183, 195, 'i', 'd', 'e',   2,   1,   2, 195, 183,   7, 'o',
+    'n', 't', 'i', 'm', 'e', 's',   3, 226, 139, 135,   3, 'o', 'n', 'x',   3,
+    226, 139, 135,   3, 'j', 'c', 'y',   2, 209, 146,   5, 'l', 'c', 'o', 'r',
+    'n',   3, 226, 140, 158,   5, 'l', 'c', 'r', 'o', 'p',   3, 226, 140, 141,
+      5, 'o', 'l', 'l', 'a', 'r',   1, '$',   3, 'o', 'p', 'f',   4, 240, 157,
+    149, 149,  66, 'o', 't',  30,   4,   2, 203, 153,  66, 'e', 'q',   4,   1,
+      3, 226, 137, 144,   3, 'd', 'o', 't',   3, 226, 137, 145,   5, 'm', 'i',
+    'n', 'u', 's',   3, 226, 136, 184,   4, 'p', 'l', 'u', 's',   3, 226, 136,
+    148,   6, 's', 'q', 'u', 'a', 'r', 'e',   3, 226, 138, 161,  13, 'o', 'u',
+    'b', 'l', 'e', 'b', 'a', 'r', 'w', 'e', 'd', 'g', 'e',   3, 226, 140, 134,
+      8, 'o', 'w', 'n', 'a', 'r', 'r', 'o', 'w',   3, 226, 134, 147,  13, 'o',
+    'w', 'n', 'd', 'o', 'w', 'n', 'a', 'r', 'r', 'o', 'w', 's',   3, 226, 135,
+    138,  14, 'o', 'w', 'n', 'h', 'a', 'r', 'p', 'o', 'o', 'n', 'l', 'e', 'f',
+    't',   3, 226, 135, 131,  15, 'o', 'w', 'n', 'h', 'a', 'r', 'p', 'o', 'o',
+    'n', 'r', 'i', 'g', 'h', 't',   3, 226, 135, 130,   7, 'r', 'b', 'k', 'a',
+    'r', 'o', 'w',   3, 226, 164, 144,   5, 'r', 'c', 'o', 'r', 'n',   3, 226,
+    140, 159,   5, 'r', 'c', 'r', 'o', 'p',   3, 226, 140, 140,   3, 's', 'c',
+    'r',   4, 240, 157, 146, 185,   3, 's', 'c', 'y',   2, 209, 149,   3, 's',
+    'o', 'l',   3, 226, 167, 182,   5, 's', 't', 'r', 'o', 'k',   2, 196, 145,
+      4, 't', 'd', 'o', 't',   3, 226, 139, 177,  67, 't', 'r', 'i',  21,   1,
+      3, 226, 150, 191,   1, 'f',   3, 226, 150, 190,   4, 'u', 'a', 'r', 'r',
+      3, 226, 135, 181,   4, 'u', 'h', 'a', 'r',   3, 226, 165, 175,   6, 'w',
+    'a', 'n', 'g', 'l', 'e',   3, 226, 166, 166,   3, 'z', 'c', 'y',   2, 209,
+    159,   7, 'z', 'i', 'g', 'r', 'a', 'r', 'r',   3, 226, 159, 191,   4, 'D',
+    'D', 'o', 't',   3, 226, 169, 183,   3, 'D', 'o', 't',   3, 226, 137, 145,
+    133, 'a', 'c', 'u', 't', 'e',   2, 195, 169,   5, 'a', 's', 't', 'e', 'r',
+      3, 226, 169, 174,   5, 'c', 'a', 'r', 'o', 'n',   2, 196, 155,  67, 'c',
+    'i', 'r',  41,   1,   3, 226, 137, 150, 129, 'c',   2, 195, 170,   5, 'c',
+    'o', 'l', 'o', 'n',   3, 226, 137, 149,   2, 'c', 'y',   2, 209, 141,   3,
+    'd', 'o', 't',   2, 196, 151,   1, 'e',   3, 226, 133, 135,   4, 'f', 'D',
+    'o', 't',   3, 226, 137, 146,   2, 'f', 'r',   4, 240, 157, 148, 162,  65,
+    'g',  35,   2,   3, 226, 170, 154, 132, 'r', 'a', 'v', 'e',   2, 195, 168,
+     65, 's',   1,   1,   3, 226, 170, 150,   3, 'd', 'o', 't',   3, 226, 170,
+    152,  65, 'l',  37,   3,   3, 226, 170, 153,   6, 'i', 'n', 't', 'e', 'r',
+    's',   3, 226, 143, 167,   1, 'l',   3, 226, 132, 147,  65, 's',   1,   1,
+      3, 226, 170, 149,   3, 'd', 'o', 't',   3, 226, 170, 151,   4, 'm', 'a',
+    'c', 'r',   2, 196, 147,  68, 'm', 'p', 't', 'y',  39,   2,   3, 226, 136,
+    133,   3, 's', 'e', 't',   3, 226, 136, 133,   1, 'v',   3, 226, 136, 133,
+     67, 'm', 's', 'p',  40,   2,   3, 226, 128, 131,   2, '1', '3',   3, 226,
+    128, 132,   2, '1', '4',   3, 226, 128, 133,   2, 'n', 'g',   2, 197, 139,
+      3, 'n', 's', 'p',   3, 226, 128, 130,   4, 'o', 'g', 'o', 'n',   2, 196,
+    153,   3, 'o', 'p', 'f',   4, 240, 157, 149, 150,  67, 'p', 'a', 'r',  37,
+      1,   3, 226, 139, 149,   2, 's', 'l',   3, 226, 167, 163,   4, 'p', 'l',
+    'u', 's',   3, 226, 169, 177,  67, 'p', 's', 'i',  36,   2,   2, 206, 181,
+      3, 'l', 'o', 'n',   2, 206, 181,   1, 'v',   2, 207, 181,   5, 'q', 'c',
+    'i', 'r', 'c',   3, 226, 137, 150,   6, 'q', 'c', 'o', 'l', 'o', 'n',   3,
+    226, 137, 149,   4, 'q', 's', 'i', 'm',   3, 226, 137, 130,   9, 'q', 's',
+    'l', 'a', 'n', 't', 'g', 't', 'r',   3, 226, 170, 150,  10, 'q', 's', 'l',
+    'a', 'n', 't', 'l', 'e', 's', 's',   3, 226, 170, 149,   5, 'q', 'u', 'a',
+    'l', 's',   1, '=',   5, 'q', 'u', 'e', 's', 't',   3, 226, 137, 159,  68,
+    'q', 'u', 'i', 'v',  30,   1,   3, 226, 137, 161,   2, 'D', 'D',   3, 226,
+    169, 184,   7, 'q', 'v', 'p', 'a', 'r', 's', 'l',   3, 226, 167, 165,   4,
+    'r', 'D', 'o', 't',   3, 226, 137, 147,   4, 'r', 'a', 'r', 'r',   3, 226,
+    165, 177,   3, 's', 'c', 'r',   3, 226, 132, 175,   4, 's', 'd', 'o', 't',
+      3, 226, 137, 144,   3, 's', 'i', 'm',   3, 226, 137, 130,   2, 't', 'a',
+      2, 206, 183, 130, 't', 'h',   2, 195, 176, 131, 'u', 'm', 'l',   2, 195,
+    171,   3, 'u', 'r', 'o',   3, 226, 130, 172,   3, 'x', 'c', 'l',   1, '!',
+      4, 'x', 'i', 's', 't',   3, 226, 136, 131,  10, 'x', 'p', 'e', 'c', 't',
+    'a', 't', 'i', 'o', 'n',   3, 226, 132, 176,  11, 'x', 'p', 'o', 'n', 'e',
+    'n', 't', 'i', 'a', 'l', 'e',   3, 226, 133, 135,  12, 'a', 'l', 'l', 'i',
+    'n', 'g', 'd', 'o', 't', 's', 'e', 'q',   3, 226, 137, 146,   2, 'c', 'y',
+      2, 209, 132,   5, 'e', 'm', 'a', 'l', 'e',   3, 226, 153, 128,   5, 'f',
+    'i', 'l', 'i', 'g',   3, 239, 172, 131,   4, 'f', 'l', 'i', 'g',   3, 239,
+    172, 128,   5, 'f', 'l', 'l', 'i', 'g',   3, 239, 172, 132,   2, 'f', 'r',
+      4, 240, 157, 148, 163,   4, 'i', 'l', 'i', 'g',   3, 239, 172, 129,   4,
+    'j', 'l', 'i', 'g',   2, 'f', 'j',   3, 'l', 'a', 't',   3, 226, 153, 173,
+      4, 'l', 'l', 'i', 'g',   3, 239, 172, 130,   4, 'l', 't', 'n', 's',   3,
+    226, 150, 177,   3, 'n', 'o', 'f',   2, 198, 146,   3, 'o', 'p', 'f',   4,
+    240, 157, 149, 151,   5, 'o', 'r', 'a', 'l', 'l',   3, 226, 136, 128,  67,
+    'o', 'r', 'k',  20,   1,   3, 226, 139, 148,   1, 'v',   3, 226, 171, 153,
+      7, 'p', 'a', 'r', 't', 'i', 'n', 't',   3, 226, 168, 141, 133, 'r', 'a',
+    'c', '1', '2',   2, 194, 189,   5, 'r', 'a', 'c', '1', '3',   3, 226, 133,
+    147, 133, 'r', 'a', 'c', '1', '4',   2, 194, 188,   5, 'r', 'a', 'c', '1',
+    '5',   3, 226, 133, 149,   5, 'r', 'a', 'c', '1', '6',   3, 226, 133, 153,
+      5, 'r', 'a', 'c', '1', '8',   3, 226, 133, 155,   5, 'r', 'a', 'c', '2',
+    '3',   3, 226, 133, 148,   5, 'r', 'a', 'c', '2', '5',   3, 226, 133, 150,
+    133, 'r', 'a', 'c', '3', '4',   2, 194, 190,   5, 'r', 'a', 'c', '3', '5',
+      3, 226, 133, 151,   5, 'r', 'a', 'c', '3', '8',   3, 226, 133, 156,   5,
+    'r', 'a', 'c', '4', '5',   3, 226, 133, 152,   5, 'r', 'a', 'c', '5', '6',
+      3, 226, 133, 154,   5, 'r', 'a', 'c', '5', '8',   3, 226, 133, 157,   5,
+    'r', 'a', 'c', '7', '8',   3, 226, 133, 158,   4, 'r', 'a', 's', 'l',   3,
+    226, 129, 132,   4, 'r', 'o', 'w', 'n',   3, 226, 140, 162,   3, 's', 'c',
+    'r',   4, 240, 157, 146, 187,  65, 'E',  25,   1,   3, 226, 137, 167,   1,
+    'l',   3, 226, 170, 140,   5, 'a', 'c', 'u', 't', 'e',   2, 199, 181,  68,
+    'a', 'm', 'm', 'a',  24,   1,   2, 206, 179,   1, 'd',   2, 207, 157,   2,
+    'a', 'p',   3, 226, 170, 134,   5, 'b', 'r', 'e', 'v', 'e',   2, 196, 159,
+      4, 'c', 'i', 'r', 'c',   2, 196, 157,   2, 'c', 'y',   2, 208, 179,   3,
+    'd', 'o', 't',   2, 196, 161,  65, 'e',  19,   3,   3, 226, 137, 165,   1,
+    'l',   3, 226, 139, 155,  65, 'q',   2,   2,   3, 226, 137, 165,   1, 'q',
+      3, 226, 137, 167,   5, 's', 'l', 'a', 'n', 't',   3, 226, 169, 190,  65,
+    's',   3,   3,   3, 226, 169, 190,   2, 'c', 'c',   3, 226, 170, 169,  67,
+    'd', 'o', 't',   2,   1,   3, 226, 170, 128,  65, 'o',   1,   1,   3, 226,
+    170, 130,   1, 'l',   3, 226, 170, 132,  65, 'l',   3,   1,   6, 226, 139,
+    155, 239, 184, 128,   2, 'e', 's',   3, 226, 170, 148,   2, 'f', 'r',   4,
+    240, 157, 148, 164,  65, 'g',  28,   1,   3, 226, 137, 171,   1, 'g',   3,
+    226, 139, 153,   4, 'i', 'm', 'e', 'l',   3, 226, 132, 183,   3, 'j', 'c',
+    'y',   2, 209, 147,  65, 'l',  26,   3,   3, 226, 137, 183,   1, 'E',   3,
+    226, 170, 146,   1, 'a',   3, 226, 170, 165,   1, 'j',   3, 226, 170, 164,
+      2, 'n', 'E',   3, 226, 137, 169,  67, 'n', 'a', 'p',  27,   1,   3, 226,
+    170, 138,   4, 'p', 'r', 'o', 'x',   3, 226, 170, 138,  66, 'n', 'e',  27,
+      1,   3, 226, 170, 136,  65, 'q',   1,   1,   3, 226, 170, 136,   1, 'q',
+      3, 226, 137, 169,   4, 'n', 's', 'i', 'm',   3, 226, 139, 167,   3, 'o',
+    'p', 'f',   4, 240, 157, 149, 152,   4, 'r', 'a', 'v', 'e',   1, '`',   3,
+    's', 'c', 'r',   3, 226, 132, 138,  67, 's', 'i', 'm',  24,   2,   3, 226,
+    137, 179,   1, 'e',   3, 226, 170, 142,   1, 'l',   3, 226, 170, 144, 193,
+    't',  25,  12,   1, '>',   2, 'c', 'c',   3, 226, 170, 167,   3, 'c', 'i',
+    'r',   3, 226, 169, 186,   3, 'd', 'o', 't',   3, 226, 139, 151,   4, 'l',
+    'P', 'a', 'r',   3, 226, 166, 149,   5, 'q', 'u', 'e', 's', 't',   3, 226,
+    169, 188,   7, 'r', 'a', 'p', 'p', 'r', 'o', 'x',   3, 226, 170, 134,   4,
+    'r', 'a', 'r', 'r',   3, 226, 165, 184,   4, 'r', 'd', 'o', 't',   3, 226,
+    139, 151,   7, 'r', 'e', 'q', 'l', 'e', 's', 's',   3, 226, 139, 155,   8,
+    'r', 'e', 'q', 'q', 'l', 'e', 's', 's',   3, 226, 170, 140,   5, 'r', 'l',
+    'e', 's', 's',   3, 226, 137, 183,   4, 'r', 's', 'i', 'm',   3, 226, 137,
+    179,   8, 'v', 'e', 'r', 't', 'n', 'e', 'q', 'q',   6, 226, 137, 169, 239,
+    184, 128,   3, 'v', 'n', 'E',   6, 226, 137, 169, 239, 184, 128,   3, 'A',
+    'r', 'r',   3, 226, 135, 148,   5, 'a', 'i', 'r', 's', 'p',   3, 226, 128,
+    138,   3, 'a', 'l', 'f',   2, 194, 189,   5, 'a', 'm', 'i', 'l', 't',   3,
+    226, 132, 139,   5, 'a', 'r', 'd', 'c', 'y',   2, 209, 138,  67, 'a', 'r',
+    'r',  20,   2,   3, 226, 134, 148,   3, 'c', 'i', 'r',   3, 226, 165, 136,
+      1, 'w',   3, 226, 134, 173,   3, 'b', 'a', 'r',   3, 226, 132, 143,   4,
+    'c', 'i', 'r', 'c',   2, 196, 165,  69, 'e', 'a', 'r', 't', 's',  19,   1,
+      3, 226, 153, 165,   3, 'u', 'i', 't',   3, 226, 153, 165,   5, 'e', 'l',
+    'l', 'i', 'p',   3, 226, 128, 166,   5, 'e', 'r', 'c', 'o', 'n',   3, 226,
+    138, 185,   2, 'f', 'r',   4, 240, 157, 148, 165,   7, 'k', 's', 'e', 'a',
+    'r', 'o', 'w',   3, 226, 164, 165,   7, 'k', 's', 'w', 'a', 'r', 'o', 'w',
+      3, 226, 164, 166,   4, 'o', 'a', 'r', 'r',   3, 226, 135, 191,   5, 'o',
+    'm', 't', 'h', 't',   3, 226, 136, 187,  12, 'o', 'o', 'k', 'l', 'e', 'f',
+    't', 'a', 'r', 'r', 'o', 'w',   3, 226, 134, 169,  13, 'o', 'o', 'k', 'r',
+    'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 134, 170,   3, 'o',
+    'p', 'f',   4, 240, 157, 149, 153,   5, 'o', 'r', 'b', 'a', 'r',   3, 226,
+    128, 149,   3, 's', 'c', 'r',   4, 240, 157, 146, 189,   5, 's', 'l', 'a',
+    's', 'h',   3, 226, 132, 143,   5, 's', 't', 'r', 'o', 'k',   2, 196, 167,
+      5, 'y', 'b', 'u', 'l', 'l',   3, 226, 129, 131,   5, 'y', 'p', 'h', 'e',
+    'n',   3, 226, 128, 144, 133, 'a', 'c', 'u', 't', 'e',   2, 195, 173,  65,
+    'c',  27,   2,   3, 226, 129, 163, 131, 'i', 'r', 'c',   2, 195, 174,   1,
+    'y',   2, 208, 184,   3, 'e', 'c', 'y',   2, 208, 181, 132, 'e', 'x', 'c',
+    'l',   2, 194, 161,   2, 'f', 'f',   3, 226, 135, 148,   2, 'f', 'r',   4,
+    240, 157, 148, 166, 133, 'g', 'r', 'a', 'v', 'e',   2, 195, 172,  65, 'i',
+     23,   4,   3, 226, 133, 136,   4, 'i', 'i', 'n', 't',   3, 226, 168, 140,
+      3, 'i', 'n', 't',   3, 226, 136, 173,   4, 'n', 'f', 'i', 'n',   3, 226,
+    167, 156,   3, 'o', 't', 'a',   3, 226, 132, 169,   4, 'j', 'l', 'i', 'g',
+      2, 196, 179,   4, 'm', 'a', 'c', 'r',   2, 196, 171,   4, 'm', 'a', 'g',
+    'e',   3, 226, 132, 145,   7, 'm', 'a', 'g', 'l', 'i', 'n', 'e',   3, 226,
+    132, 144,   7, 'm', 'a', 'g', 'p', 'a', 'r', 't',   3, 226, 132, 145,   4,
+    'm', 'a', 't', 'h',   2, 196, 177,   3, 'm', 'o', 'f',   3, 226, 138, 183,
+      4, 'm', 'p', 'e', 'd',   2, 198, 181,  65, 'n',  18,   4,   3, 226, 136,
+    136,   4, 'c', 'a', 'r', 'e',   3, 226, 132, 133,  67, 'f', 'i', 'n',   3,
+      1,   3, 226, 136, 158,   3, 't', 'i', 'e',   3, 226, 167, 157,   4, 'o',
+    'd', 'o', 't',   2, 196, 177,  65, 't',   2,   5,   3, 226, 136, 171,   3,
+    'c', 'a', 'l',   3, 226, 138, 186,   5, 'e', 'g', 'e', 'r', 's',   3, 226,
+    132, 164,   5, 'e', 'r', 'c', 'a', 'l',   3, 226, 138, 186,   5, 'l', 'a',
+    'r', 'h', 'k',   3, 226, 168, 151,   4, 'p', 'r', 'o', 'd',   3, 226, 168,
+    188,   3, 'o', 'c', 'y',   2, 209, 145,   4, 'o', 'g', 'o', 'n',   2, 196,
+    175,   3, 'o', 'p', 'f',   4, 240, 157, 149, 154,   3, 'o', 't', 'a',   2,
+    206, 185,   4, 'p', 'r', 'o', 'd',   3, 226, 168, 188, 133, 'q', 'u', 'e',
+    's', 't',   2, 194, 191,   3, 's', 'c', 'r',   4, 240, 157, 146, 190,  67,
+    's', 'i', 'n',  20,   4,   3, 226, 136, 136,   1, 'E',   3, 226, 139, 185,
+      3, 'd', 'o', 't',   3, 226, 139, 181,  65, 's',   2,   1,   3, 226, 139,
+    180,   1, 'v',   3, 226, 139, 179,   1, 'v',   3, 226, 136, 136,  65, 't',
+     24,   1,   3, 226, 129, 162,   4, 'i', 'l', 'd', 'e',   2, 196, 169,   4,
+    'u', 'k', 'c', 'y',   2, 209, 150, 131, 'u', 'm', 'l',   2, 195, 175,   4,
+    'c', 'i', 'r', 'c',   2, 196, 181,   2, 'c', 'y',   2, 208, 185,   2, 'f',
+    'r',   4, 240, 157, 148, 167,   4, 'm', 'a', 't', 'h',   2, 200, 183,   3,
+    'o', 'p', 'f',   4, 240, 157, 149, 155,   3, 's', 'c', 'r',   4, 240, 157,
+    146, 191,   5, 's', 'e', 'r', 'c', 'y',   2, 209, 152,   4, 'u', 'k', 'c',
+    'y',   2, 209, 148,  68, 'a', 'p', 'p', 'a',   9,   1,   2, 206, 186,   1,
+    'v',   2, 207, 176,   5, 'c', 'e', 'd', 'i', 'l',   2, 196, 183,   2, 'c',
+    'y',   2, 208, 186,   2, 'f', 'r',   4, 240, 157, 148, 168,   5, 'g', 'r',
+    'e', 'e', 'n',   2, 196, 184,   3, 'h', 'c', 'y',   2, 209, 133,   3, 'j',
+    'c', 'y',   2, 209, 156,   3, 'o', 'p', 'f',   4, 240, 157, 149, 156,   3,
+    's', 'c', 'r',   4, 240, 157, 147, 128,   4, 'A', 'a', 'r', 'r',   3, 226,
+    135, 154,   3, 'A', 'r', 'r',   3, 226, 135, 144,   5, 'A', 't', 'a', 'i',
+    'l',   3, 226, 164, 155,   4, 'B', 'a', 'r', 'r',   3, 226, 164, 142,  65,
+    'E',  78,   1,   3, 226, 137, 166,   1, 'g',   3, 226, 170, 139,   3, 'H',
+    'a', 'r',   3, 226, 165, 162,   5, 'a', 'c', 'u', 't', 'e',   2, 196, 186,
+      7, 'a', 'e', 'm', 'p', 't', 'y', 'v',   3, 226, 166, 180,   5, 'a', 'g',
+    'r', 'a', 'n',   3, 226, 132, 146,   5, 'a', 'm', 'b', 'd', 'a',   2, 206,
+    187,  67, 'a', 'n', 'g',  73,   2,   3, 226, 159, 168,   1, 'd',   3, 226,
+    166, 145,   2, 'l', 'e',   3, 226, 159, 168,   2, 'a', 'p',   3, 226, 170,
+    133, 132, 'a', 'q', 'u', 'o',   2, 194, 171,  67, 'a', 'r', 'r',  72,   7,
+      3, 226, 134, 144,  65, 'b',   7,   1,   3, 226, 135, 164,   2, 'f', 's',
+      3, 226, 164, 159,   2, 'f', 's',   3, 226, 164, 157,   2, 'h', 'k',   3,
+    226, 134, 169,   2, 'l', 'p',   3, 226, 134, 171,   2, 'p', 'l',   3, 226,
+    164, 185,   3, 's', 'i', 'm',   3, 226, 165, 179,   2, 't', 'l',   3, 226,
+    134, 162,  66, 'a', 't',  79,   2,   3, 226, 170, 171,   3, 'a', 'i', 'l',
+      3, 226, 164, 153,  65, 'e',   1,   1,   3, 226, 170, 173,   1, 's',   6,
+    226, 170, 173, 239, 184, 128,   4, 'b', 'a', 'r', 'r',   3, 226, 164, 140,
+      4, 'b', 'b', 'r', 'k',   3, 226, 157, 178,   5, 'b', 'r', 'a', 'c', 'e',
+      1, '{',   5, 'b', 'r', 'a', 'c', 'k',   1, '[',   4, 'b', 'r', 'k', 'e',
+      3, 226, 166, 139,   6, 'b', 'r', 'k', 's', 'l', 'd',   3, 226, 166, 143,
+      6, 'b', 'r', 'k', 's', 'l', 'u',   3, 226, 166, 141,   5, 'c', 'a', 'r',
+    'o', 'n',   2, 196, 190,   5, 'c', 'e', 'd', 'i', 'l',   2, 196, 188,   4,
+    'c', 'e', 'i', 'l',   3, 226, 140, 136,   3, 'c', 'u', 'b',   1, '{',   2,
+    'c', 'y',   2, 208, 187,   3, 'd', 'c', 'a',   3, 226, 164, 182,  68, 'd',
+    'q', 'u', 'o',  68,   1,   3, 226, 128, 156,   1, 'r',   3, 226, 128, 158,
+      6, 'd', 'r', 'd', 'h', 'a', 'r',   3, 226, 165, 167,   7, 'd', 'r', 'u',
+    's', 'h', 'a', 'r',   3, 226, 165, 139,   3, 'd', 's', 'h',   3, 226, 134,
+    178,  65, 'e',  65,  11,   3, 226, 137, 164,  71, 'f', 't', 'a', 'r', 'r',
+    'o', 'w',  11,   1,   3, 226, 134, 144,   4, 't', 'a', 'i', 'l',   3, 226,
+    134, 162,  13, 'f', 't', 'h', 'a', 'r', 'p', 'o', 'o', 'n', 'd', 'o', 'w',
+    'n',   3, 226, 134, 189,  11, 'f', 't', 'h', 'a', 'r', 'p', 'o', 'o', 'n',
+    'u', 'p',   3, 226, 134, 188,  12, 'f', 't', 'l', 'e', 'f', 't', 'a', 'r',
+    'r', 'o', 'w', 's',   3, 226, 135, 135,  76, 'f', 't', 'r', 'i', 'g', 'h',
+    't', 'a', 'r', 'r', 'o', 'w',   8,   1,   3, 226, 134, 148,   1, 's',   3,
+    226, 135, 134,  15, 'f', 't', 'r', 'i', 'g', 'h', 't', 'h', 'a', 'r', 'p',
+    'o', 'o', 'n', 's',   3, 226, 135, 139,  17, 'f', 't', 'r', 'i', 'g', 'h',
+    't', 's', 'q', 'u', 'i', 'g', 'a', 'r', 'r', 'o', 'w',   3, 226, 134, 173,
+     12, 'f', 't', 't', 'h', 'r', 'e', 'e', 't', 'i', 'm', 'e', 's',   3, 226,
+    139, 139,   1, 'g',   3, 226, 139, 154,  65, 'q',   4,   2,   3, 226, 137,
+    164,   1, 'q',   3, 226, 137, 166,   5, 's', 'l', 'a', 'n', 't',   3, 226,
+    169, 189,  65, 's',   5,   9,   3, 226, 169, 189,   2, 'c', 'c',   3, 226,
+    170, 168,  67, 'd', 'o', 't',   8,   1,   3, 226, 169, 191,  65, 'o',   1,
+      1,   3, 226, 170, 129,   1, 'r',   3, 226, 170, 131,  65, 'g',   9,   1,
+      6, 226, 139, 154, 239, 184, 128,   2, 'e', 's',   3, 226, 170, 147,   7,
+    's', 'a', 'p', 'p', 'r', 'o', 'x',   3, 226, 170, 133,   4, 's', 'd', 'o',
+    't',   3, 226, 139, 150,   6, 's', 'e', 'q', 'g', 't', 'r',   3, 226, 139,
+    154,   7, 's', 'e', 'q', 'q', 'g', 't', 'r',   3, 226, 170, 139,   4, 's',
+    'g', 't', 'r',   3, 226, 137, 182,   4, 's', 's', 'i', 'm',   3, 226, 137,
+    178,   5, 'f', 'i', 's', 'h', 't',   3, 226, 165, 188,   5, 'f', 'l', 'o',
+    'o', 'r',   3, 226, 140, 138,   2, 'f', 'r',   4, 240, 157, 148, 169,  65,
+    'g',  88,   1,   3, 226, 137, 182,   1, 'E',   3, 226, 170, 145,   4, 'h',
+    'a', 'r', 'd',   3, 226, 134, 189,  68, 'h', 'a', 'r', 'u',  87,   1,   3,
+    226, 134, 188,   1, 'l',   3, 226, 165, 170,   4, 'h', 'b', 'l', 'k',   3,
+    226, 150, 132,   3, 'j', 'c', 'y',   2, 209, 153,  65, 'l',  85,   4,   3,
+    226, 137, 170,   3, 'a', 'r', 'r',   3, 226, 135, 135,   6, 'c', 'o', 'r',
+    'n', 'e', 'r',   3, 226, 140, 158,   4, 'h', 'a', 'r', 'd',   3, 226, 165,
+    171,   3, 't', 'r', 'i',   3, 226, 151, 186,   5, 'm', 'i', 'd', 'o', 't',
+      2, 197, 128,  69, 'm', 'o', 'u', 's', 't',  87,   1,   3, 226, 142, 176,
+      4, 'a', 'c', 'h', 'e',   3, 226, 142, 176,   2, 'n', 'E',   3, 226, 137,
+    168,  67, 'n', 'a', 'p',  86,   1,   3, 226, 170, 137,   4, 'p', 'r', 'o',
+    'x',   3, 226, 170, 137,  66, 'n', 'e',  86,   1,   3, 226, 170, 135,  65,
+    'q',   1,   1,   3, 226, 170, 135,   1, 'q',   3, 226, 137, 168,   4, 'n',
+    's', 'i', 'm',   3, 226, 139, 166,   4, 'o', 'a', 'n', 'g',   3, 226, 159,
+    172,   4, 'o', 'a', 'r', 'r',   3, 226, 135, 189,   4, 'o', 'b', 'r', 'k',
+      3, 226, 159, 166,  12, 'o', 'n', 'g', 'l', 'e', 'f', 't', 'a', 'r', 'r',
+    'o', 'w',   3, 226, 159, 181,  17, 'o', 'n', 'g', 'l', 'e', 'f', 't', 'r',
+    'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 159, 183,   9, 'o',
+    'n', 'g', 'm', 'a', 'p', 's', 't', 'o',   3, 226, 159, 188,  13, 'o', 'n',
+    'g', 'r', 'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 159, 182,
+     12, 'o', 'o', 'p', 'a', 'r', 'r', 'o', 'w', 'l', 'e', 'f', 't',   3, 226,
+    134, 171,  13, 'o', 'o', 'p', 'a', 'r', 'r', 'o', 'w', 'r', 'i', 'g', 'h',
+    't',   3, 226, 134, 172,   4, 'o', 'p', 'a', 'r',   3, 226, 166, 133,   3,
+    'o', 'p', 'f',   4, 240, 157, 149, 157,   5, 'o', 'p', 'l', 'u', 's',   3,
+    226, 168, 173,   6, 'o', 't', 'i', 'm', 'e', 's',   3, 226, 168, 180,   5,
+    'o', 'w', 'a', 's', 't',   3, 226, 136, 151,   5, 'o', 'w', 'b', 'a', 'r',
+      1, '_',  66, 'o', 'z',  71,   2,   3, 226, 151, 138,   4, 'e', 'n', 'g',
+    'e',   3, 226, 151, 138,   1, 'f',   3, 226, 167, 171,  67, 'p', 'a', 'r',
+     72,   1,   1, '(',   2, 'l', 't',   3, 226, 166, 147,   4, 'r', 'a', 'r',
+    'r',   3, 226, 135, 134,   7, 'r', 'c', 'o', 'r', 'n', 'e', 'r',   3, 226,
+    140, 159,  68, 'r', 'h', 'a', 'r',  70,   1,   3, 226, 135, 139,   1, 'd',
+      3, 226, 165, 173,   2, 'r', 'm',   3, 226, 128, 142,   4, 'r', 't', 'r',
+    'i',   3, 226, 138, 191,   5, 's', 'a', 'q', 'u', 'o',   3, 226, 128, 185,
+      3, 's', 'c', 'r',   4, 240, 157, 147, 129,   2, 's', 'h',   3, 226, 134,
+    176,  67, 's', 'i', 'm',  65,   2,   3, 226, 137, 178,   1, 'e',   3, 226,
+    170, 141,   1, 'g',   3, 226, 170, 143,   3, 's', 'q', 'b',   1, '[',  68,
+    's', 'q', 'u', 'o',  65,   1,   3, 226, 128, 152,   1, 'r',   3, 226, 128,
+    154,   5, 's', 't', 'r', 'o', 'k',   2, 197, 130, 193, 't',  64,   9,   1,
+    '<',   2, 'c', 'c',   3, 226, 170, 166,   3, 'c', 'i', 'r',   3, 226, 169,
+    185,   3, 'd', 'o', 't',   3, 226, 139, 150,   4, 'h', 'r', 'e', 'e',   3,
+    226, 139, 139,   4, 'i', 'm', 'e', 's',   3, 226, 139, 137,   4, 'l', 'a',
+    'r', 'r',   3, 226, 165, 182,   5, 'q', 'u', 'e', 's', 't',   3, 226, 169,
+    187,   4, 'r', 'P', 'a', 'r',   3, 226, 166, 150,  66, 'r', 'i',   1,   2,
+      3, 226, 151, 131,   1, 'e',   3, 226, 138, 180,   1, 'f',   3, 226, 151,
+    130,   7, 'u', 'r', 'd', 's', 'h', 'a', 'r',   3, 226, 165, 138,   6, 'u',
+    'r', 'u', 'h', 'a', 'r',   3, 226, 165, 166,   8, 'v', 'e', 'r', 't', 'n',
+    'e', 'q', 'q',   6, 226, 137, 168, 239, 184, 128,   3, 'v', 'n', 'E',   6,
+    226, 137, 168, 239, 184, 128,   4, 'D', 'D', 'o', 't',   3, 226, 136, 186,
+    131, 'a', 'c', 'r',   2, 194, 175,   3, 'a', 'l', 'e',   3, 226, 153, 130,
+     67, 'a', 'l', 't',  21,   1,   3, 226, 156, 160,   3, 'e', 's', 'e',   3,
+    226, 156, 160,  66, 'a', 'p',  21,   1,   3, 226, 134, 166,  67, 's', 't',
+    'o',   1,   3,   3, 226, 134, 166,   4, 'd', 'o', 'w', 'n',   3, 226, 134,
+    167,   4, 'l', 'e', 'f', 't',   3, 226, 134, 164,   2, 'u', 'p',   3, 226,
+    134, 165,   5, 'a', 'r', 'k', 'e', 'r',   3, 226, 150, 174,   5, 'c', 'o',
+    'm', 'm', 'a',   3, 226, 168, 169,   2, 'c', 'y',   2, 208, 188,   4, 'd',
+    'a', 's', 'h',   3, 226, 128, 148,  12, 'e', 'a', 's', 'u', 'r', 'e', 'd',
+    'a', 'n', 'g', 'l', 'e',   3, 226, 136, 161,   2, 'f', 'r',   4, 240, 157,
+    148, 170,   2, 'h', 'o',   3, 226, 132, 167, 132, 'i', 'c', 'r', 'o',   2,
+    194, 181,  66, 'i', 'd',  16,   3,   3, 226, 136, 163,   3, 'a', 's', 't',
+      1, '*',   3, 'c', 'i', 'r',   3, 226, 171, 176, 131, 'd', 'o', 't',   2,
+    194, 183,  68, 'i', 'n', 'u', 's',  18,   2,   3, 226, 136, 146,   1, 'b',
+      3, 226, 138, 159,  65, 'd',   1,   1,   3, 226, 136, 184,   1, 'u',   3,
+    226, 168, 170,   3, 'l', 'c', 'p',   3, 226, 171, 155,   3, 'l', 'd', 'r',
+      3, 226, 128, 166,   5, 'n', 'p', 'l', 'u', 's',   3, 226, 136, 147,   5,
+    'o', 'd', 'e', 'l', 's',   3, 226, 138, 167,   3, 'o', 'p', 'f',   4, 240,
+    157, 149, 158,   1, 'p',   3, 226, 136, 147,   3, 's', 'c', 'r',   4, 240,
+    157, 147, 130,   5, 's', 't', 'p', 'o', 's',   3, 226, 136, 190,  65, 'u',
+     12,   2,   2, 206, 188,   6, 'l', 't', 'i', 'm', 'a', 'p',   3, 226, 138,
+    184,   3, 'm', 'a', 'p',   3, 226, 138, 184,   2, 'G', 'g',   5, 226, 139,
+    153, 204, 184,  66, 'G', 't',  84,   1,   6, 226, 137, 171, 226, 131, 146,
+      1, 'v',   5, 226, 137, 171, 204, 184,   9, 'L', 'e', 'f', 't', 'a', 'r',
+    'r', 'o', 'w',   3, 226, 135, 141,  14, 'L', 'e', 'f', 't', 'r', 'i', 'g',
+    'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 135, 142,   2, 'L', 'l',   5,
+    226, 139, 152, 204, 184,  66, 'L', 't',  81,   1,   6, 226, 137, 170, 226,
+    131, 146,   1, 'v',   5, 226, 137, 170, 204, 184,  10, 'R', 'i', 'g', 'h',
+    't', 'a', 'r', 'r', 'o', 'w',   3, 226, 135, 143,   5, 'V', 'D', 'a', 's',
+    'h',   3, 226, 138, 175,   5, 'V', 'd', 'a', 's', 'h',   3, 226, 138, 174,
+      4, 'a', 'b', 'l', 'a',   3, 226, 136, 135,   5, 'a', 'c', 'u', 't', 'e',
+      2, 197, 132,   3, 'a', 'n', 'g',   6, 226, 136, 160, 226, 131, 146,  66,
+    'a', 'p',  75,   4,   3, 226, 137, 137,   1, 'E',   5, 226, 169, 176, 204,
+    184,   2, 'i', 'd',   5, 226, 137, 139, 204, 184,   2, 'o', 's',   2, 197,
+    137,   4, 'p', 'r', 'o', 'x',   3, 226, 137, 137,  68, 'a', 't', 'u', 'r',
+     78,   1,   3, 226, 153, 174,  66, 'a', 'l',   1,   1,   3, 226, 153, 174,
+      1, 's',   3, 226, 132, 149, 131, 'b', 's', 'p',   2, 194, 160,  68, 'b',
+    'u', 'm', 'p',  78,   1,   5, 226, 137, 142, 204, 184,   1, 'e',   5, 226,
+    137, 143, 204, 184,   3, 'c', 'a', 'p',   3, 226, 169, 131,   5, 'c', 'a',
+    'r', 'o', 'n',   2, 197, 136,   5, 'c', 'e', 'd', 'i', 'l',   2, 197, 134,
+     68, 'c', 'o', 'n', 'g',  75,   1,   3, 226, 137, 135,   3, 'd', 'o', 't',
+      5, 226, 169, 173, 204, 184,   3, 'c', 'u', 'p',   3, 226, 169, 130,   2,
+    'c', 'y',   2, 208, 189,   4, 'd', 'a', 's', 'h',   3, 226, 128, 147,  65,
+    'e',  72,   8,   3, 226, 137, 160,   3, 'A', 'r', 'r',   3, 226, 135, 151,
+      4, 'a', 'r', 'h', 'k',   3, 226, 164, 164,  67, 'a', 'r', 'r',   6,   1,
+      3, 226, 134, 151,   2, 'o', 'w',   3, 226, 134, 151,   3, 'd', 'o', 't',
+      5, 226, 137, 144, 204, 184,   4, 'q', 'u', 'i', 'v',   3, 226, 137, 162,
+      4, 's', 'e', 'a', 'r',   3, 226, 164, 168,   3, 's', 'i', 'm',   5, 226,
+    137, 130, 204, 184,  68, 'x', 'i', 's', 't',   2,   1,   3, 226, 136, 132,
+      1, 's',   3, 226, 136, 132,   2, 'f', 'r',   4, 240, 157, 148, 171,   2,
+    'g', 'E',   5, 226, 137, 167, 204, 184,  66, 'g', 'e',  79,   2,   3, 226,
+    137, 177,  65, 'q',   2,   2,   3, 226, 137, 177,   1, 'q',   5, 226, 137,
+    167, 204, 184,   5, 's', 'l', 'a', 'n', 't',   5, 226, 169, 190, 204, 184,
+      1, 's',   5, 226, 169, 190, 204, 184,   4, 'g', 's', 'i', 'm',   3, 226,
+    137, 181,  66, 'g', 't',  81,   1,   3, 226, 137, 175,   1, 'r',   3, 226,
+    137, 175,   4, 'h', 'A', 'r', 'r',   3, 226, 135, 142,   4, 'h', 'a', 'r',
+    'r',   3, 226, 134, 174,   4, 'h', 'p', 'a', 'r',   3, 226, 171, 178,  65,
+    'i',  78,   2,   3, 226, 136, 139,  65, 's',   2,   1,   3, 226, 139, 188,
+      1, 'd',   3, 226, 139, 186,   1, 'v',   3, 226, 136, 139,   3, 'j', 'c',
+    'y',   2, 209, 154,   4, 'l', 'A', 'r', 'r',   3, 226, 135, 141,   2, 'l',
+    'E',   5, 226, 137, 166, 204, 184,   4, 'l', 'a', 'r', 'r',   3, 226, 134,
+    154,   3, 'l', 'd', 'r',   3, 226, 128, 165,  66, 'l', 'e',  75,   4,   3,
+    226, 137, 176,   7, 'f', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 134, 154,
+     12, 'f', 't', 'r', 'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226,
+    134, 174,  65, 'q',   2,   2,   3, 226, 137, 176,   1, 'q',   5, 226, 137,
+    166, 204, 184,   5, 's', 'l', 'a', 'n', 't',   5, 226, 169, 189, 204, 184,
+     65, 's',   3,   1,   5, 226, 169, 189, 204, 184,   1, 's',   3, 226, 137,
+    174,   4, 'l', 's', 'i', 'm',   3, 226, 137, 180,  66, 'l', 't',  80,   1,
+      3, 226, 137, 174,  66, 'r', 'i',   1,   1,   3, 226, 139, 170,   1, 'e',
+      3, 226, 139, 172,   3, 'm', 'i', 'd',   3, 226, 136, 164,   3, 'o', 'p',
+    'f',   4, 240, 157, 149, 159, 194, 'o', 't',  79,   2,   2, 194, 172,  66,
+    'i', 'n',   2,   5,   3, 226, 136, 137,   1, 'E',   5, 226, 139, 185, 204,
+    184,   3, 'd', 'o', 't',   5, 226, 139, 181, 204, 184,   2, 'v', 'a',   3,
+    226, 136, 137,   2, 'v', 'b',   3, 226, 139, 183,   2, 'v', 'c',   3, 226,
+    139, 182,  66, 'n', 'i',   6,   3,   3, 226, 136, 140,   2, 'v', 'a',   3,
+    226, 136, 140,   2, 'v', 'b',   3, 226, 139, 190,   2, 'v', 'c',   3, 226,
+    139, 189,  67, 'p', 'a', 'r',  88,   3,   3, 226, 136, 166,   5, 'a', 'l',
+    'l', 'e', 'l',   3, 226, 136, 166,   2, 's', 'l',   6, 226, 171, 189, 226,
+    131, 165,   1, 't',   5, 226, 136, 130, 204, 184,   6, 'p', 'o', 'l', 'i',
+    'n', 't',   3, 226, 168, 148,  66, 'p', 'r',  89,   2,   3, 226, 138, 128,
+      3, 'c', 'u', 'e',   3, 226, 139, 160,  65, 'e',   1,   1,   5, 226, 170,
+    175, 204, 184,  65, 'c',   1,   1,   3, 226, 138, 128,   2, 'e', 'q',   5,
+    226, 170, 175, 204, 184,   4, 'r', 'A', 'r', 'r',   3, 226, 135, 143,  68,
+    'r', 'a', 'r', 'r',  91,   2,   3, 226, 134, 155,   1, 'c',   5, 226, 164,
+    179, 204, 184,   1, 'w',   5, 226, 134, 157, 204, 184,  10, 'r', 'i', 'g',
+    'h', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 134, 155,  68, 'r', 't', 'r',
+    'i',  91,   1,   3, 226, 139, 171,   1, 'e',   3, 226, 139, 173,  66, 's',
+    'c',  91,   3,   3, 226, 138, 129,   3, 'c', 'u', 'e',   3, 226, 139, 161,
+      1, 'e',   5, 226, 170, 176, 204, 184,   1, 'r',   4, 240, 157, 147, 131,
+      8, 's', 'h', 'o', 'r', 't', 'm', 'i', 'd',   3, 226, 136, 164,  13, 's',
+    'h', 'o', 'r', 't', 'p', 'a', 'r', 'a', 'l', 'l', 'e', 'l',   3, 226, 136,
+    166,  67, 's', 'i', 'm',  91,   1,   3, 226, 137, 129,  65, 'e',   1,   1,
+      3, 226, 137, 132,   1, 'q',   3, 226, 137, 132,   4, 's', 'm', 'i', 'd',
+      3, 226, 136, 164,   4, 's', 'p', 'a', 'r',   3, 226, 136, 166,   6, 's',
+    'q', 's', 'u', 'b', 'e',   3, 226, 139, 162,   6, 's', 'q', 's', 'u', 'p',
+    'e',   3, 226, 139, 163,  67, 's', 'u', 'b',  88,   3,   3, 226, 138, 132,
+      1, 'E',   5, 226, 171, 133, 204, 184,   1, 'e',   3, 226, 138, 136,  67,
+    's', 'e', 't',   1,   1,   6, 226, 138, 130, 226, 131, 146,  66, 'e', 'q',
+      1,   1,   3, 226, 138, 136,   1, 'q',   5, 226, 171, 133, 204, 184,  68,
+    's', 'u', 'c', 'c',  92,   1,   3, 226, 138, 129,   2, 'e', 'q',   5, 226,
+    170, 176, 204, 184,  67, 's', 'u', 'p',  92,   3,   3, 226, 138, 133,   1,
+    'E',   5, 226, 171, 134, 204, 184,   1, 'e',   3, 226, 138, 137,  67, 's',
+    'e', 't',   1,   1,   6, 226, 138, 131, 226, 131, 146,  66, 'e', 'q',   1,
+      1,   3, 226, 138, 137,   1, 'q',   5, 226, 171, 134, 204, 184,   3, 't',
+    'g', 'l',   3, 226, 137, 185, 133, 't', 'i', 'l', 'd', 'e',   2, 195, 177,
+      3, 't', 'l', 'g',   3, 226, 137, 184,  76, 't', 'r', 'i', 'a', 'n', 'g',
+    'l', 'e', 'l', 'e', 'f', 't',  93,   1,   3, 226, 139, 170,   2, 'e', 'q',
+      3, 226, 139, 172,  77, 't', 'r', 'i', 'a', 'n', 'g', 'l', 'e', 'r', 'i',
+    'g', 'h', 't',  93,   1,   3, 226, 139, 171,   2, 'e', 'q',   3, 226, 139,
+    173,  65, 'u',  93,   1,   2, 206, 189,  65, 'm',   1,   2,   1, '#',   3,
+    'e', 'r', 'o',   3, 226, 132, 150,   2, 's', 'p',   3, 226, 128, 135,   5,
+    'v', 'D', 'a', 's', 'h',   3, 226, 138, 173,   5, 'v', 'H', 'a', 'r', 'r',
+      3, 226, 164, 132,   3, 'v', 'a', 'p',   6, 226, 137, 141, 226, 131, 146,
+      5, 'v', 'd', 'a', 's', 'h',   3, 226, 138, 172,   3, 'v', 'g', 'e',   6,
+    226, 137, 165, 226, 131, 146,   3, 'v', 'g', 't',   4, '>', 226, 131, 146,
+      6, 'v', 'i', 'n', 'f', 'i', 'n',   3, 226, 167, 158,   5, 'v', 'l', 'A',
+    'r', 'r',   3, 226, 164, 130,   3, 'v', 'l', 'e',   6, 226, 137, 164, 226,
+    131, 146,  67, 'v', 'l', 't',  86,   1,   4, '<', 226, 131, 146,   3, 'r',
+    'i', 'e',   6, 226, 138, 180, 226, 131, 146,   5, 'v', 'r', 'A', 'r', 'r',
+      3, 226, 164, 131,   6, 'v', 'r', 't', 'r', 'i', 'e',   6, 226, 138, 181,
+    226, 131, 146,   4, 'v', 's', 'i', 'm',   6, 226, 136, 188, 226, 131, 146,
+      4, 'w', 'A', 'r', 'r',   3, 226, 135, 150,   5, 'w', 'a', 'r', 'h', 'k',
+      3, 226, 164, 163,  68, 'w', 'a', 'r', 'r',  81,   1,   3, 226, 134, 150,
+      2, 'o', 'w',   3, 226, 134, 150,   5, 'w', 'n', 'e', 'a', 'r',   3, 226,
+    164, 167,   1, 'S',   3, 226, 147, 136, 133, 'a', 'c', 'u', 't', 'e',   2,
+    195, 179,   3, 'a', 's', 't',   3, 226, 138, 155,  67, 'c', 'i', 'r',  38,
+      1,   3, 226, 138, 154, 129, 'c',   2, 195, 180,   2, 'c', 'y',   2, 208,
+    190,   4, 'd', 'a', 's', 'h',   3, 226, 138, 157,   5, 'd', 'b', 'l', 'a',
+    'c',   2, 197, 145,   3, 'd', 'i', 'v',   3, 226, 168, 184,   3, 'd', 'o',
+    't',   3, 226, 138, 153,   5, 'd', 's', 'o', 'l', 'd',   3, 226, 166, 188,
+      4, 'e', 'l', 'i', 'g',   2, 197, 147,   4, 'f', 'c', 'i', 'r',   3, 226,
+    166, 191,   2, 'f', 'r',   4, 240, 157, 148, 172,   3, 'g', 'o', 'n',   2,
+    203, 155, 133, 'g', 'r', 'a', 'v', 'e',   2, 195, 178,   2, 'g', 't',   3,
+    226, 167, 129,   4, 'h', 'b', 'a', 'r',   3, 226, 166, 181,   2, 'h', 'm',
+      2, 206, 169,   3, 'i', 'n', 't',   3, 226, 136, 174,   4, 'l', 'a', 'r',
+    'r',   3, 226, 134, 186,   4, 'l', 'c', 'i', 'r',   3, 226, 166, 190,   6,
+    'l', 'c', 'r', 'o', 's', 's',   3, 226, 166, 187,   4, 'l', 'i', 'n', 'e',
+      3, 226, 128, 190,   2, 'l', 't',   3, 226, 167, 128,   4, 'm', 'a', 'c',
+    'r',   2, 197, 141,   4, 'm', 'e', 'g', 'a',   2, 207, 137,   6, 'm', 'i',
+    'c', 'r', 'o', 'n',   2, 206, 191,   3, 'm', 'i', 'd',   3, 226, 166, 182,
+      5, 'm', 'i', 'n', 'u', 's',   3, 226, 138, 150,   3, 'o', 'p', 'f',   4,
+    240, 157, 149, 160,   3, 'p', 'a', 'r',   3, 226, 166, 183,   4, 'p', 'e',
+    'r', 'p',   3, 226, 166, 185,   4, 'p', 'l', 'u', 's',   3, 226, 138, 149,
+     65, 'r',   9,   6,   3, 226, 136, 168,   3, 'a', 'r', 'r',   3, 226, 134,
+    187,  65, 'd',   5,   3,   3, 226, 169, 157,  66, 'e', 'r',   3,   1,   3,
+    226, 132, 180,   2, 'o', 'f',   3, 226, 132, 180, 129, 'f',   2, 194, 170,
+    129, 'm',   2, 194, 186,   4, 'i', 'g', 'o', 'f',   3, 226, 138, 182,   2,
+    'o', 'r',   3, 226, 169, 150,   5, 's', 'l', 'o', 'p', 'e',   3, 226, 169,
+    151,   1, 'v',   3, 226, 169, 155,   3, 's', 'c', 'r',   3, 226, 132, 180,
+    133, 's', 'l', 'a', 's', 'h',   2, 195, 184,   3, 's', 'o', 'l',   3, 226,
+    138, 152, 133, 't', 'i', 'l', 'd', 'e',   2, 195, 181,  69, 't', 'i', 'm',
+    'e', 's',  14,   1,   3, 226, 138, 151,   2, 'a', 's',   3, 226, 168, 182,
+    131, 'u', 'm', 'l',   2, 195, 182,   4, 'v', 'b', 'a', 'r',   3, 226, 140,
+    189,  66, 'a', 'r',  23,   4,   3, 226, 136, 165, 193, 'a',   4,   1,   2,
+    194, 182,   4, 'l', 'l', 'e', 'l',   3, 226, 136, 165,   3, 's', 'i', 'm',
+      3, 226, 171, 179,   2, 's', 'l',   3, 226, 171, 189,   1, 't',   3, 226,
+    136, 130,   2, 'c', 'y',   2, 208, 191,   5, 'e', 'r', 'c', 'n', 't',   1,
+    '%',   5, 'e', 'r', 'i', 'o', 'd',   1, '.',   5, 'e', 'r', 'm', 'i', 'l',
+      3, 226, 128, 176,   3, 'e', 'r', 'p',   3, 226, 138, 165,   6, 'e', 'r',
+    't', 'e', 'n', 'k',   3, 226, 128, 177,   2, 'f', 'r',   4, 240, 157, 148,
+    173,  66, 'h', 'i',  20,   1,   2, 207, 134,   1, 'v',   2, 207, 149,   5,
+    'h', 'm', 'm', 'a', 't',   3, 226, 132, 179,   4, 'h', 'o', 'n', 'e',   3,
+    226, 152, 142,  65, 'i',  18,   2,   2, 207, 128,   7, 't', 'c', 'h', 'f',
+    'o', 'r', 'k',   3, 226, 139, 148,   1, 'v',   2, 207, 150,  69, 'l', 'a',
+    'n', 'c', 'k',  19,   1,   3, 226, 132, 143,   1, 'h',   3, 226, 132, 142,
+      5, 'l', 'a', 'n', 'k', 'v',   3, 226, 132, 143,  67, 'l', 'u', 's',  18,
+      9,   1, '+',   4, 'a', 'c', 'i', 'r',   3, 226, 168, 163,   1, 'b',   3,
+    226, 138, 158,   3, 'c', 'i', 'r',   3, 226, 168, 162,   2, 'd', 'o',   3,
+    226, 136, 148,   2, 'd', 'u',   3, 226, 168, 165,   1, 'e',   3, 226, 169,
+    178, 130, 'm', 'n',   2, 194, 177,   3, 's', 'i', 'm',   3, 226, 168, 166,
+      3, 't', 'w', 'o',   3, 226, 168, 167,   1, 'm',   2, 194, 177,   7, 'o',
+    'i', 'n', 't', 'i', 'n', 't',   3, 226, 168, 149,   3, 'o', 'p', 'f',   4,
+    240, 157, 149, 161, 132, 'o', 'u', 'n', 'd',   2, 194, 163,  65, 'r',  22,
+     15,   3, 226, 137, 186,   1, 'E',   3, 226, 170, 179,   2, 'a', 'p',   3,
+    226, 170, 183,   3, 'c', 'u', 'e',   3, 226, 137, 188,  65, 'e',  12,   1,
+      3, 226, 170, 175,  65, 'c',   1,   7,   3, 226, 137, 186,   6, 'a', 'p',
+    'p', 'r', 'o', 'x',   3, 226, 170, 183,   7, 'c', 'u', 'r', 'l', 'y', 'e',
+    'q',   3, 226, 137, 188,   2, 'e', 'q',   3, 226, 170, 175,   7, 'n', 'a',
+    'p', 'p', 'r', 'o', 'x',   3, 226, 170, 185,   4, 'n', 'e', 'q', 'q',   3,
+    226, 170, 181,   4, 'n', 's', 'i', 'm',   3, 226, 139, 168,   3, 's', 'i',
+    'm',   3, 226, 137, 190,  67, 'i', 'm', 'e',  19,   1,   3, 226, 128, 178,
+      1, 's',   3, 226, 132, 153,   2, 'n', 'E',   3, 226, 170, 181,   3, 'n',
+    'a', 'p',   3, 226, 170, 185,   4, 'n', 's', 'i', 'm',   3, 226, 139, 168,
+      2, 'o', 'd',   3, 226, 136, 143,   6, 'o', 'f', 'a', 'l', 'a', 'r',   3,
+    226, 140, 174,   6, 'o', 'f', 'l', 'i', 'n', 'e',   3, 226, 140, 146,   6,
+    'o', 'f', 's', 'u', 'r', 'f',   3, 226, 140, 147,  66, 'o', 'p',  12,   1,
+      3, 226, 136, 157,   2, 't', 'o',   3, 226, 136, 157,   3, 's', 'i', 'm',
+      3, 226, 137, 190,   4, 'u', 'r', 'e', 'l',   3, 226, 138, 176,   3, 's',
+    'c', 'r',   4, 240, 157, 147, 133,   2, 's', 'i',   2, 207, 136,   5, 'u',
+    'n', 'c', 's', 'p',   3, 226, 128, 136,   2, 'f', 'r',   4, 240, 157, 148,
+    174,   3, 'i', 'n', 't',   3, 226, 168, 140,   3, 'o', 'p', 'f',   4, 240,
+    157, 149, 162,   5, 'p', 'r', 'i', 'm', 'e',   3, 226, 129, 151,   3, 's',
+    'c', 'r',   4, 240, 157, 147, 134,  10, 'u', 'a', 't', 'e', 'r', 'n', 'i',
+    'o', 'n', 's',   3, 226, 132, 141,   6, 'u', 'a', 't', 'i', 'n', 't',   3,
+    226, 168, 150,  68, 'u', 'e', 's', 't',   2,   1,   1, '?',   2, 'e', 'q',
+      3, 226, 137, 159, 131, 'u', 'o', 't',   1, '"',   4, 'A', 'a', 'r', 'r',
+      3, 226, 135, 155,   3, 'A', 'r', 'r',   3, 226, 135, 146,   5, 'A', 't',
+    'a', 'i', 'l',   3, 226, 164, 156,   4, 'B', 'a', 'r', 'r',   3, 226, 164,
+    143,   3, 'H', 'a', 'r',   3, 226, 165, 164,   3, 'a', 'c', 'e',   5, 226,
+    136, 189, 204, 177,   5, 'a', 'c', 'u', 't', 'e',   2, 197, 149,   4, 'a',
+    'd', 'i', 'c',   3, 226, 136, 154,   7, 'a', 'e', 'm', 'p', 't', 'y', 'v',
+      3, 226, 166, 179,  67, 'a', 'n', 'g',  65,   3,   3, 226, 159, 169,   1,
+    'd',   3, 226, 166, 146,   1, 'e',   3, 226, 166, 165,   2, 'l', 'e',   3,
+    226, 159, 169, 132, 'a', 'q', 'u', 'o',   2, 194, 187,  67, 'a', 'r', 'r',
+     66,  10,   3, 226, 134, 146,   2, 'a', 'p',   3, 226, 165, 181,  65, 'b',
+      9,   1,   3, 226, 135, 165,   2, 'f', 's',   3, 226, 164, 160,   1, 'c',
+      3, 226, 164, 179,   2, 'f', 's',   3, 226, 164, 158,   2, 'h', 'k',   3,
+    226, 134, 170,   2, 'l', 'p',   3, 226, 134, 172,   2, 'p', 'l',   3, 226,
+    165, 133,   3, 's', 'i', 'm',   3, 226, 165, 180,   2, 't', 'l',   3, 226,
+    134, 163,   1, 'w',   3, 226, 134, 157,   5, 'a', 't', 'a', 'i', 'l',   3,
+    226, 164, 154,  68, 'a', 't', 'i', 'o',  75,   1,   3, 226, 136, 182,   4,
+    'n', 'a', 'l', 's',   3, 226, 132, 154,   4, 'b', 'a', 'r', 'r',   3, 226,
+    164, 141,   4, 'b', 'b', 'r', 'k',   3, 226, 157, 179,   5, 'b', 'r', 'a',
+    'c', 'e',   1, '}',   5, 'b', 'r', 'a', 'c', 'k',   1, ']',   4, 'b', 'r',
+    'k', 'e',   3, 226, 166, 140,   6, 'b', 'r', 'k', 's', 'l', 'd',   3, 226,
+    166, 142,   6, 'b', 'r', 'k', 's', 'l', 'u',   3, 226, 166, 144,   5, 'c',
+    'a', 'r', 'o', 'n',   2, 197, 153,   5, 'c', 'e', 'd', 'i', 'l',   2, 197,
+    151,   4, 'c', 'e', 'i', 'l',   3, 226, 140, 137,   3, 'c', 'u', 'b',   1,
+    '}',   2, 'c', 'y',   2, 209, 128,   3, 'd', 'c', 'a',   3, 226, 164, 183,
+      6, 'd', 'l', 'd', 'h', 'a', 'r',   3, 226, 165, 169,  68, 'd', 'q', 'u',
+    'o',  61,   1,   3, 226, 128, 157,   1, 'r',   3, 226, 128, 157,   3, 'd',
+    's', 'h',   3, 226, 134, 179,  67, 'e', 'a', 'l',  60,   3,   3, 226, 132,
+    156,   3, 'i', 'n', 'e',   3, 226, 132, 155,   4, 'p', 'a', 'r', 't',   3,
+    226, 132, 156,   1, 's',   3, 226, 132, 157,   3, 'e', 'c', 't',   3, 226,
+    150, 173, 130, 'e', 'g',   2, 194, 174,   5, 'f', 'i', 's', 'h', 't',   3,
+    226, 165, 189,   5, 'f', 'l', 'o', 'o', 'r',   3, 226, 140, 139,   2, 'f',
+    'r',   4, 240, 157, 148, 175,   4, 'h', 'a', 'r', 'd',   3, 226, 135, 129,
+     68, 'h', 'a', 'r', 'u',  56,   1,   3, 226, 135, 128,   1, 'l',   3, 226,
+    165, 172,  66, 'h', 'o',  56,   1,   2, 207, 129,   1, 'v',   2, 207, 177,
+     73, 'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w',  56,   1,   3, 226, 134,
+    146,   4, 't', 'a', 'i', 'l',   3, 226, 134, 163,  15, 'i', 'g', 'h', 't',
+    'h', 'a', 'r', 'p', 'o', 'o', 'n', 'd', 'o', 'w', 'n',   3, 226, 135, 129,
+     13, 'i', 'g', 'h', 't', 'h', 'a', 'r', 'p', 'o', 'o', 'n', 'u', 'p',   3,
+    226, 135, 128,  14, 'i', 'g', 'h', 't', 'l', 'e', 'f', 't', 'a', 'r', 'r',
+    'o', 'w', 's',   3, 226, 135, 132,  16, 'i', 'g', 'h', 't', 'l', 'e', 'f',
+    't', 'h', 'a', 'r', 'p', 'o', 'o', 'n', 's',   3, 226, 135, 140,  15, 'i',
+    'g', 'h', 't', 'r', 'i', 'g', 'h', 't', 'a', 'r', 'r', 'o', 'w', 's',   3,
+    226, 135, 137,  14, 'i', 'g', 'h', 't', 's', 'q', 'u', 'i', 'g', 'a', 'r',
+    'r', 'o', 'w',   3, 226, 134, 157,  14, 'i', 'g', 'h', 't', 't', 'h', 'r',
+    'e', 'e', 't', 'i', 'm', 'e', 's',   3, 226, 139, 140,   3, 'i', 'n', 'g',
+      2, 203, 154,  11, 'i', 's', 'i', 'n', 'g', 'd', 'o', 't', 's', 'e', 'q',
+      3, 226, 137, 147,   4, 'l', 'a', 'r', 'r',   3, 226, 135, 132,   4, 'l',
+    'h', 'a', 'r',   3, 226, 135, 140,   2, 'l', 'm',   3, 226, 128, 143,  69,
+    'm', 'o', 'u', 's', 't',  44,   1,   3, 226, 142, 177,   4, 'a', 'c', 'h',
+    'e',   3, 226, 142, 177,   4, 'n', 'm', 'i', 'd',   3, 226, 171, 174,   4,
+    'o', 'a', 'n', 'g',   3, 226, 159, 173,   4, 'o', 'a', 'r', 'r',   3, 226,
+    135, 190,   4, 'o', 'b', 'r', 'k',   3, 226, 159, 167,   4, 'o', 'p', 'a',
+    'r',   3, 226, 166, 134,   3, 'o', 'p', 'f',   4, 240, 157, 149, 163,   5,
+    'o', 'p', 'l', 'u', 's',   3, 226, 168, 174,   6, 'o', 't', 'i', 'm', 'e',
+    's',   3, 226, 168, 181,  67, 'p', 'a', 'r',  36,   1,   1, ')',   2, 'g',
+    't',   3, 226, 166, 148,   7, 'p', 'p', 'o', 'l', 'i', 'n', 't',   3, 226,
+    168, 146,   4, 'r', 'a', 'r', 'r',   3, 226, 135, 137,   5, 's', 'a', 'q',
+    'u', 'o',   3, 226, 128, 186,   3, 's', 'c', 'r',   4, 240, 157, 147, 135,
+      2, 's', 'h',   3, 226, 134, 177,   3, 's', 'q', 'b',   1, ']',  68, 's',
+    'q', 'u', 'o',  30,   1,   3, 226, 128, 153,   1, 'r',   3, 226, 128, 153,
+      5, 't', 'h', 'r', 'e', 'e',   3, 226, 139, 140,   5, 't', 'i', 'm', 'e',
+    's',   3, 226, 139, 138,  67, 't', 'r', 'i',  28,   3,   3, 226, 150, 185,
+      1, 'e',   3, 226, 138, 181,   1, 'f',   3, 226, 150, 184,   4, 'l', 't',
+    'r', 'i',   3, 226, 167, 142,   6, 'u', 'l', 'u', 'h', 'a', 'r',   3, 226,
+    165, 168,   1, 'x',   3, 226, 132, 158,   5, 'a', 'c', 'u', 't', 'e',   2,
+    197, 155,   4, 'b', 'q', 'u', 'o',   3, 226, 128, 154,  65, 'c',  56,  12,
+      3, 226, 137, 187,   1, 'E',   3, 226, 170, 180,   2, 'a', 'p',   3, 226,
+    170, 184,   4, 'a', 'r', 'o', 'n',   2, 197, 161,   3, 'c', 'u', 'e',   3,
+    226, 137, 189,  65, 'e',   8,   1,   3, 226, 170, 176,   3, 'd', 'i', 'l',
+      2, 197, 159,   3, 'i', 'r', 'c',   2, 197, 157,   2, 'n', 'E',   3, 226,
+    170, 182,   3, 'n', 'a', 'p',   3, 226, 170, 186,   4, 'n', 's', 'i', 'm',
+      3, 226, 139, 169,   6, 'p', 'o', 'l', 'i', 'n', 't',   3, 226, 168, 147,
+      3, 's', 'i', 'm',   3, 226, 137, 191,   1, 'y',   2, 209, 129,  67, 'd',
+    'o', 't',  68,   2,   3, 226, 139, 133,   1, 'b',   3, 226, 138, 161,   1,
+    'e',   3, 226, 169, 166,   4, 'e', 'A', 'r', 'r',   3, 226, 135, 152,   5,
+    'e', 'a', 'r', 'h', 'k',   3, 226, 164, 165,  68, 'e', 'a', 'r', 'r',  67,
+      1,   3, 226, 134, 152,   2, 'o', 'w',   3, 226, 134, 152, 131, 'e', 'c',
+    't',   2, 194, 167,   3, 'e', 'm', 'i',   1, ';',   5, 'e', 's', 'w', 'a',
+    'r',   3, 226, 164, 169,   7, 'e', 't', 'm', 'i', 'n', 'u', 's',   3, 226,
+    136, 150,   4, 'e', 't', 'm', 'n',   3, 226, 136, 150,   3, 'e', 'x', 't',
+      3, 226, 156, 182,  66, 'f', 'r',  61,   1,   4, 240, 157, 148, 176,   3,
+    'o', 'w', 'n',   3, 226, 140, 162,   4, 'h', 'a', 'r', 'p',   3, 226, 153,
+    175,   5, 'h', 'c', 'h', 'c', 'y',   2, 209, 137,   3, 'h', 'c', 'y',   2,
+    209, 136,   7, 'h', 'o', 'r', 't', 'm', 'i', 'd',   3, 226, 136, 163,  12,
+    'h', 'o', 'r', 't', 'p', 'a', 'r', 'a', 'l', 'l', 'e', 'l',   3, 226, 136,
+    165, 130, 'h', 'y',   2, 194, 173,  68, 'i', 'g', 'm', 'a',  55,   2,   2,
+    207, 131,   1, 'f',   2, 207, 130,   1, 'v',   2, 207, 130,  66, 'i', 'm',
+     56,   7,   3, 226, 136, 188,   3, 'd', 'o', 't',   3, 226, 169, 170,  65,
+    'e',   6,   1,   3, 226, 137, 131,   1, 'q',   3, 226, 137, 131,  65, 'g',
+      6,   1,   3, 226, 170, 158,   1, 'E',   3, 226, 170, 160,  65, 'l',   6,
+      1,   3, 226, 170, 157,   1, 'E',   3, 226, 170, 159,   2, 'n', 'e',   3,
+    226, 137, 134,   4, 'p', 'l', 'u', 's',   3, 226, 168, 164,   4, 'r', 'a',
+    'r', 'r',   3, 226, 165, 178,   4, 'l', 'a', 'r', 'r',   3, 226, 134, 144,
+     12, 'm', 'a', 'l', 'l', 's', 'e', 't', 'm', 'i', 'n', 'u', 's',   3, 226,
+    136, 150,   5, 'm', 'a', 's', 'h', 'p',   3, 226, 168, 179,   7, 'm', 'e',
+    'p', 'a', 'r', 's', 'l',   3, 226, 167, 164,   3, 'm', 'i', 'd',   3, 226,
+    136, 163,   4, 'm', 'i', 'l', 'e',   3, 226, 140, 163,  66, 'm', 't',  59,
+      1,   3, 226, 170, 170,  65, 'e',   1,   1,   3, 226, 170, 172,   1, 's',
+      6, 226, 170, 172, 239, 184, 128,   5, 'o', 'f', 't', 'c', 'y',   2, 209,
+    140,  66, 'o', 'l',  59,   1,   1, '/',  65, 'b',   1,   1,   3, 226, 167,
+    132,   2, 'a', 'r',   3, 226, 140, 191,   3, 'o', 'p', 'f',   4, 240, 157,
+    149, 164,  69, 'p', 'a', 'd', 'e', 's',  59,   1,   3, 226, 153, 160,   3,
+    'u', 'i', 't',   3, 226, 153, 160,   3, 'p', 'a', 'r',   3, 226, 136, 165,
+     68, 'q', 'c', 'a', 'p',  58,   1,   3, 226, 138, 147,   1, 's',   6, 226,
+    138, 147, 239, 184, 128,  68, 'q', 'c', 'u', 'p',  58,   1,   3, 226, 138,
+    148,   1, 's',   6, 226, 138, 148, 239, 184, 128,  68, 'q', 's', 'u', 'b',
+     58,   2,   3, 226, 138, 143,   1, 'e',   3, 226, 138, 145,  67, 's', 'e',
+    't',   1,   1,   3, 226, 138, 143,   2, 'e', 'q',   3, 226, 138, 145,  68,
+    'q', 's', 'u', 'p',  60,   2,   3, 226, 138, 144,   1, 'e',   3, 226, 138,
+    146,  67, 's', 'e', 't',   1,   1,   3, 226, 138, 144,   2, 'e', 'q',   3,
+    226, 138, 146,  66, 'q', 'u',  62,   3,   3, 226, 150, 161,   3, 'a', 'r',
+    'e',   3, 226, 150, 161,   3, 'a', 'r', 'f',   3, 226, 150, 170,   1, 'f',
+      3, 226, 150, 170,   4, 'r', 'a', 'r', 'r',   3, 226, 134, 146,   3, 's',
+    'c', 'r',   4, 240, 157, 147, 136,   5, 's', 'e', 't', 'm', 'n',   3, 226,
+    136, 150,   5, 's', 'm', 'i', 'l', 'e',   3, 226, 140, 163,   5, 's', 't',
+    'a', 'r', 'f',   3, 226, 139, 134,  67, 't', 'a', 'r',  59,   1,   3, 226,
+    152, 134,   1, 'f',   3, 226, 152, 133,  14, 't', 'r', 'a', 'i', 'g', 'h',
+    't', 'e', 'p', 's', 'i', 'l', 'o', 'n',   2, 207, 181,  10, 't', 'r', 'a',
+    'i', 'g', 'h', 't', 'p', 'h', 'i',   2, 207, 149,   4, 't', 'r', 'n', 's',
+      2, 194, 175,  66, 'u', 'b',  56,  12,   3, 226, 138, 130,   1, 'E',   3,
+    226, 171, 133,   3, 'd', 'o', 't',   3, 226, 170, 189,  65, 'e',  10,   1,
+      3, 226, 138, 134,   3, 'd', 'o', 't',   3, 226, 171, 131,   4, 'm', 'u',
+    'l', 't',   3, 226, 171, 129,   2, 'n', 'E',   3, 226, 171, 139,   2, 'n',
+    'e',   3, 226, 138, 138,   4, 'p', 'l', 'u', 's',   3, 226, 170, 191,   4,
+    'r', 'a', 'r', 'r',   3, 226, 165, 185,  67, 's', 'e', 't',   5,   2,   3,
+    226, 138, 130,  66, 'e', 'q',   2,   1,   3, 226, 138, 134,   1, 'q',   3,
+    226, 171, 133,  67, 'n', 'e', 'q',   2,   1,   3, 226, 138, 138,   1, 'q',
+      3, 226, 171, 139,   3, 's', 'i', 'm',   3, 226, 171, 135,   3, 's', 'u',
+    'b',   3, 226, 171, 149,   3, 's', 'u', 'p',   3, 226, 171, 147,  67, 'u',
+    'c', 'c',  72,   7,   3, 226, 137, 187,   6, 'a', 'p', 'p', 'r', 'o', 'x',
+      3, 226, 170, 184,   7, 'c', 'u', 'r', 'l', 'y', 'e', 'q',   3, 226, 137,
+    189,   2, 'e', 'q',   3, 226, 170, 176,   7, 'n', 'a', 'p', 'p', 'r', 'o',
+    'x',   3, 226, 170, 186,   4, 'n', 'e', 'q', 'q',   3, 226, 170, 182,   4,
+    'n', 's', 'i', 'm',   3, 226, 139, 169,   3, 's', 'i', 'm',   3, 226, 137,
+    191,   2, 'u', 'm',   3, 226, 136, 145,   3, 'u', 'n', 'g',   3, 226, 153,
+    170,  66, 'u', 'p',  76,  18,   3, 226, 138, 131, 129, '1',   2, 194, 185,
+    129, '2',   2, 194, 178, 129, '3',   2, 194, 179,   1, 'E',   3, 226, 171,
+    134,   3, 'd', 'o', 't',   3, 226, 170, 190,   4, 'd', 's', 'u', 'b',   3,
+    226, 171, 152,  65, 'e',  12,   1,   3, 226, 138, 135,   3, 'd', 'o', 't',
+      3, 226, 171, 132,   4, 'h', 's', 'o', 'l',   3, 226, 159, 137,   4, 'h',
+    's', 'u', 'b',   3, 226, 171, 151,   4, 'l', 'a', 'r', 'r',   3, 226, 165,
+    187,   4, 'm', 'u', 'l', 't',   3, 226, 171, 130,   2, 'n', 'E',   3, 226,
+    171, 140,   2, 'n', 'e',   3, 226, 138, 139,   4, 'p', 'l', 'u', 's',   3,
+    226, 171, 128,  67, 's', 'e', 't',   5,   2,   3, 226, 138, 131,  66, 'e',
+    'q',   2,   1,   3, 226, 138, 135,   1, 'q',   3, 226, 171, 134,  67, 'n',
+    'e', 'q',   2,   1,   3, 226, 138, 139,   1, 'q',   3, 226, 171, 140,   3,
+    's', 'i', 'm',   3, 226, 171, 136,   3, 's', 'u', 'b',   3, 226, 171, 148,
+      3, 's', 'u', 'p',   3, 226, 171, 150,   4, 'w', 'A', 'r', 'r',   3, 226,
+    135, 153,   5, 'w', 'a', 'r', 'h', 'k',   3, 226, 164, 166,  68, 'w', 'a',
+    'r', 'r',  96,   1,   3, 226, 134, 153,   2, 'o', 'w',   3, 226, 134, 153,
+      5, 'w', 'n', 'w', 'a', 'r',   3, 226, 164, 170, 132, 'z', 'l', 'i', 'g',
+      2, 195, 159,   5, 'a', 'r', 'g', 'e', 't',   3, 226, 140, 150,   2, 'a',
+    'u',   2, 207, 132,   3, 'b', 'r', 'k',   3, 226, 142, 180,   5, 'c', 'a',
+    'r', 'o', 'n',   2, 197, 165,   5, 'c', 'e', 'd', 'i', 'l',   2, 197, 163,
+      2, 'c', 'y',   2, 209, 130,   3, 'd', 'o', 't',   3, 226, 131, 155,   5,
+    'e', 'l', 'r', 'e', 'c',   3, 226, 140, 149,   2, 'f', 'r',   4, 240, 157,
+    148, 177,   5, 'h', 'e', 'r', 'e', '4',   3, 226, 136, 180,   8, 'h', 'e',
+    'r', 'e', 'f', 'o', 'r', 'e',   3, 226, 136, 180,  68, 'h', 'e', 't', 'a',
+     30,   2,   2, 206, 184,   3, 's', 'y', 'm',   2, 207, 145,   1, 'v',   2,
+    207, 145,  10, 'h', 'i', 'c', 'k', 'a', 'p', 'p', 'r', 'o', 'x',   3, 226,
+    137, 136,   7, 'h', 'i', 'c', 'k', 's', 'i', 'm',   3, 226, 136, 188,   5,
+    'h', 'i', 'n', 's', 'p',   3, 226, 128, 137,   4, 'h', 'k', 'a', 'p',   3,
+    226, 137, 136,   5, 'h', 'k', 's', 'i', 'm',   3, 226, 136, 188, 132, 'h',
+    'o', 'r', 'n',   2, 195, 190,   4, 'i', 'l', 'd', 'e',   2, 203, 156, 196,
+    'i', 'm', 'e', 's',  24,   2,   2, 195, 151,  65, 'b',   2,   1,   3, 226,
+    138, 160,   2, 'a', 'r',   3, 226, 168, 177,   1, 'd',   3, 226, 168, 176,
+      3, 'i', 'n', 't',   3, 226, 136, 173,   3, 'o', 'e', 'a',   3, 226, 164,
+    168,  66, 'o', 'p',  24,   3,   3, 226, 138, 164,   3, 'b', 'o', 't',   3,
+    226, 140, 182,   3, 'c', 'i', 'r',   3, 226, 171, 177,  65, 'f',   1,   1,
+      4, 240, 157, 149, 165,   3, 'o', 'r', 'k',   3, 226, 171, 154,   3, 'o',
+    's', 'a',   3, 226, 164, 169,   5, 'p', 'r', 'i', 'm', 'e',   3, 226, 128,
+    180,   4, 'r', 'a', 'd', 'e',   3, 226, 132, 162,  71, 'r', 'i', 'a', 'n',
+    'g', 'l', 'e',  24,   4,   3, 226, 150, 181,   4, 'd', 'o', 'w', 'n',   3,
+    226, 150, 191,  68, 'l', 'e', 'f', 't',   3,   1,   3, 226, 151, 131,   2,
+    'e', 'q',   3, 226, 138, 180,   1, 'q',   3, 226, 137, 156,  69, 'r', 'i',
+    'g', 'h', 't',   2,   1,   3, 226, 150, 185,   2, 'e', 'q',   3, 226, 138,
+    181,   5, 'r', 'i', 'd', 'o', 't',   3, 226, 151, 172,   3, 'r', 'i', 'e',
+      3, 226, 137, 156,   7, 'r', 'i', 'm', 'i', 'n', 'u', 's',   3, 226, 168,
+    186,   6, 'r', 'i', 'p', 'l', 'u', 's',   3, 226, 168, 185,   4, 'r', 'i',
+    's', 'b',   3, 226, 167, 141,   6, 'r', 'i', 't', 'i', 'm', 'e',   3, 226,
+    168, 187,   7, 'r', 'p', 'e', 'z', 'i', 'u', 'm',   3, 226, 143, 162,   3,
+    's', 'c', 'r',   4, 240, 157, 147, 137,   3, 's', 'c', 'y',   2, 209, 134,
+      4, 's', 'h', 'c', 'y',   2, 209, 155,   5, 's', 't', 'r', 'o', 'k',   2,
+    197, 167,   4, 'w', 'i', 'x', 't',   3, 226, 137, 172,  15, 'w', 'o', 'h',
+    'e', 'a', 'd', 'l', 'e', 'f', 't', 'a', 'r', 'r', 'o', 'w',   3, 226, 134,
+    158,  16, 'w', 'o', 'h', 'e', 'a', 'd', 'r', 'i', 'g', 'h', 't', 'a', 'r',
+    'r', 'o', 'w',   3, 226, 134, 160,   3, 'A', 'r', 'r',   3, 226, 135, 145,
+      3, 'H', 'a', 'r',   3, 226, 165, 163, 133, 'a', 'c', 'u', 't', 'e',   2,
+    195, 186,   3, 'a', 'r', 'r',   3, 226, 134, 145,   4, 'b', 'r', 'c', 'y',
+      2, 209, 158,   5, 'b', 'r', 'e', 'v', 'e',   2, 197, 173, 132, 'c', 'i',
+    'r', 'c',   2, 195, 187,   2, 'c', 'y',   2, 209, 131,   4, 'd', 'a', 'r',
+    'r',   3, 226, 135, 133,   5, 'd', 'b', 'l', 'a', 'c',   2, 197, 177,   4,
+    'd', 'h', 'a', 'r',   3, 226, 165, 174,   5, 'f', 'i', 's', 'h', 't',   3,
+    226, 165, 190,   2, 'f', 'r',   4, 240, 157, 148, 178, 133, 'g', 'r', 'a',
+    'v', 'e',   2, 195, 185,   4, 'h', 'a', 'r', 'l',   3, 226, 134, 191,   4,
+    'h', 'a', 'r', 'r',   3, 226, 134, 190,   4, 'h', 'b', 'l', 'k',   3, 226,
+    150, 128,  69, 'l', 'c', 'o', 'r', 'n',  25,   1,   3, 226, 140, 156,   2,
+    'e', 'r',   3, 226, 140, 156,   5, 'l', 'c', 'r', 'o', 'p',   3, 226, 140,
+    143,   4, 'l', 't', 'r', 'i',   3, 226, 151, 184,   4, 'm', 'a', 'c', 'r',
+      2, 197, 171, 130, 'm', 'l',   2, 194, 168,   4, 'o', 'g', 'o', 'n',   2,
+    197, 179,   3, 'o', 'p', 'f',   4, 240, 157, 149, 166,   6, 'p', 'a', 'r',
+    'r', 'o', 'w',   3, 226, 134, 145,  10, 'p', 'd', 'o', 'w', 'n', 'a', 'r',
+    'r', 'o', 'w',   3, 226, 134, 149,  12, 'p', 'h', 'a', 'r', 'p', 'o', 'o',
+    'n', 'l', 'e', 'f', 't',   3, 226, 134, 191,  13, 'p', 'h', 'a', 'r', 'p',
+    'o', 'o', 'n', 'r', 'i', 'g', 'h', 't',   3, 226, 134, 190,   4, 'p', 'l',
+    'u', 's',   3, 226, 138, 142,  67, 'p', 's', 'i',  14,   2,   2, 207, 133,
+      1, 'h',   2, 207, 146,   3, 'l', 'o', 'n',   2, 207, 133,   9, 'p', 'u',
+    'p', 'a', 'r', 'r', 'o', 'w', 's',   3, 226, 135, 136,  69, 'r', 'c', 'o',
+    'r', 'n',  14,   1,   3, 226, 140, 157,   2, 'e', 'r',   3, 226, 140, 157,
+      5, 'r', 'c', 'r', 'o', 'p',   3, 226, 140, 142,   4, 'r', 'i', 'n', 'g',
+      2, 197, 175,   4, 'r', 't', 'r', 'i',   3, 226, 151, 185,   3, 's', 'c',
+    'r',   4, 240, 157, 147, 138,   4, 't', 'd', 'o', 't',   3, 226, 139, 176,
+      5, 't', 'i', 'l', 'd', 'e',   2, 197, 169,  67, 't', 'r', 'i',   8,   1,
+      3, 226, 150, 181,   1, 'f',   3, 226, 150, 180,   4, 'u', 'a', 'r', 'r',
+      3, 226, 135, 136, 131, 'u', 'm', 'l',   2, 195, 188,   6, 'w', 'a', 'n',
+    'g', 'l', 'e',   3, 226, 166, 167,   3, 'A', 'r', 'r',   3, 226, 135, 149,
+     67, 'B', 'a', 'r',  35,   1,   3, 226, 171, 168,   1, 'v',   3, 226, 171,
+    169,   4, 'D', 'a', 's', 'h',   3, 226, 138, 168,   5, 'a', 'n', 'g', 'r',
+    't',   3, 226, 166, 156,   9, 'a', 'r', 'e', 'p', 's', 'i', 'l', 'o', 'n',
+      2, 207, 181,   7, 'a', 'r', 'k', 'a', 'p', 'p', 'a',   2, 207, 176,   9,
+    'a', 'r', 'n', 'o', 't', 'h', 'i', 'n', 'g',   3, 226, 136, 133,   5, 'a',
+    'r', 'p', 'h', 'i',   2, 207, 149,   4, 'a', 'r', 'p', 'i',   2, 207, 150,
+      8, 'a', 'r', 'p', 'r', 'o', 'p', 't', 'o',   3, 226, 136, 157,  67, 'a',
+    'r', 'r',  27,   1,   3, 226, 134, 149,   2, 'h', 'o',   2, 207, 177,   7,
+    'a', 'r', 's', 'i', 'g', 'm', 'a',   2, 207, 130,  75, 'a', 'r', 's', 'u',
+    'b', 's', 'e', 't', 'n', 'e', 'q',  26,   1,   6, 226, 138, 138, 239, 184,
+    128,   1, 'q',   6, 226, 171, 139, 239, 184, 128,  75, 'a', 'r', 's', 'u',
+    'p', 's', 'e', 't', 'n', 'e', 'q',  26,   1,   6, 226, 138, 139, 239, 184,
+    128,   1, 'q',   6, 226, 171, 140, 239, 184, 128,   7, 'a', 'r', 't', 'h',
+    'e', 't', 'a',   2, 207, 145,  14, 'a', 'r', 't', 'r', 'i', 'a', 'n', 'g',
+    'l', 'e', 'l', 'e', 'f', 't',   3, 226, 138, 178,  15, 'a', 'r', 't', 'r',
+    'i', 'a', 'n', 'g', 'l', 'e', 'r', 'i', 'g', 'h', 't',   3, 226, 138, 179,
+      2, 'c', 'y',   2, 208, 178,   4, 'd', 'a', 's', 'h',   3, 226, 138, 162,
+     66, 'e', 'e',  21,   2,   3, 226, 136, 168,   3, 'b', 'a', 'r',   3, 226,
+    138, 187,   2, 'e', 'q',   3, 226, 137, 154,   5, 'e', 'l', 'l', 'i', 'p',
+      3, 226, 139, 174,   5, 'e', 'r', 'b', 'a', 'r',   1, '|',   3, 'e', 'r',
+    't',   1, '|',   2, 'f', 'r',   4, 240, 157, 148, 179,   4, 'l', 't', 'r',
+    'i',   3, 226, 138, 178,   4, 'n', 's', 'u', 'b',   6, 226, 138, 130, 226,
+    131, 146,   4, 'n', 's', 'u', 'p',   6, 226, 138, 131, 226, 131, 146,   3,
+    'o', 'p', 'f',   4, 240, 157, 149, 167,   4, 'p', 'r', 'o', 'p',   3, 226,
+    136, 157,   4, 'r', 't', 'r', 'i',   3, 226, 138, 179,   3, 's', 'c', 'r',
+      4, 240, 157, 147, 139,   5, 's', 'u', 'b', 'n', 'E',   6, 226, 171, 139,
+    239, 184, 128,   5, 's', 'u', 'b', 'n', 'e',   6, 226, 138, 138, 239, 184,
+    128,   5, 's', 'u', 'p', 'n', 'E',   6, 226, 171, 140, 239, 184, 128,   5,
+    's', 'u', 'p', 'n', 'e',   6, 226, 138, 139, 239, 184, 128,   6, 'z', 'i',
+    'g', 'z', 'a', 'g',   3, 226, 166, 154,   4, 'c', 'i', 'r', 'c',   2, 197,
+    181,   5, 'e', 'd', 'b', 'a', 'r',   3, 226, 169, 159,  68, 'e', 'd', 'g',
+    'e',   7,   1,   3, 226, 136, 167,   1, 'q',   3, 226, 137, 153,   5, 'e',
+    'i', 'e', 'r', 'p',   3, 226, 132, 152,   2, 'f', 'r',   4, 240, 157, 148,
+    180,   3, 'o', 'p', 'f',   4, 240, 157, 149, 168,   1, 'p',   3, 226, 132,
+    152,  65, 'r',   3,   1,   3, 226, 137, 128,   4, 'e', 'a', 't', 'h',   3,
+    226, 137, 128,   3, 's', 'c', 'r',   4, 240, 157, 147, 140,   3, 'c', 'a',
+    'p',   3, 226, 139, 130,   4, 'c', 'i', 'r', 'c',   3, 226, 151, 175,   3,
+    'c', 'u', 'p',   3, 226, 139, 131,   4, 'd', 't', 'r', 'i',   3, 226, 150,
+    189,   2, 'f', 'r',   4, 240, 157, 148, 181,   4, 'h', 'A', 'r', 'r',   3,
+    226, 159, 186,   4, 'h', 'a', 'r', 'r',   3, 226, 159, 183,   1, 'i',   2,
+    206, 190,   4, 'l', 'A', 'r', 'r',   3, 226, 159, 184,   4, 'l', 'a', 'r',
+    'r',   3, 226, 159, 181,   3, 'm', 'a', 'p',   3, 226, 159, 188,   3, 'n',
+    'i', 's',   3, 226, 139, 187,   4, 'o', 'd', 'o', 't',   3, 226, 168, 128,
+      3, 'o', 'p', 'f',   4, 240, 157, 149, 169,   5, 'o', 'p', 'l', 'u', 's',
+      3, 226, 168, 129,   5, 'o', 't', 'i', 'm', 'e',   3, 226, 168, 130,   4,
+    'r', 'A', 'r', 'r',   3, 226, 159, 185,   4, 'r', 'a', 'r', 'r',   3, 226,
+    159, 182,   3, 's', 'c', 'r',   4, 240, 157, 147, 141,   5, 's', 'q', 'c',
+    'u', 'p',   3, 226, 168, 134,   5, 'u', 'p', 'l', 'u', 's',   3, 226, 168,
+    132,   4, 'u', 't', 'r', 'i',   3, 226, 150, 179,   3, 'v', 'e', 'e',   3,
+    226, 139, 129,   5, 'w', 'e', 'd', 'g', 'e',   3, 226, 139, 128, 133, 'a',
+    'c', 'u', 't', 'e',   2, 195, 189,   3, 'a', 'c', 'y',   2, 209, 143,   4,
+    'c', 'i', 'r', 'c',   2, 197, 183,   2, 'c', 'y',   2, 209, 139, 130, 'e',
+    'n',   2, 194, 165,   2, 'f', 'r',   4, 240, 157, 148, 182,   3, 'i', 'c',
+    'y',   2, 209, 151,   3, 'o', 'p', 'f',   4, 240, 157, 149, 170,   3, 's',
+    'c', 'r',   4, 240, 157, 147, 142,   3, 'u', 'c', 'y',   2, 209, 142, 131,
+    'u', 'm', 'l',   2, 195, 191,   5, 'a', 'c', 'u', 't', 'e',   2, 197, 186,
+      5, 'c', 'a', 'r', 'o', 'n',   2, 197, 190,   2, 'c', 'y',   2, 208, 183,
+      3, 'd', 'o', 't',   2, 197, 188,   5, 'e', 'e', 't', 'r', 'f',   3, 226,
+    132, 168,   3, 'e', 't', 'a',   2, 206, 182,   2, 'f', 'r',   4, 240, 157,
+    148, 183,   3, 'h', 'c', 'y',   2, 208, 182,   6, 'i', 'g', 'r', 'a', 'r',
+    'r',   3, 226, 135, 157,   3, 'o', 'p', 'f',   4, 240, 157, 149, 171,   3,
+    's', 'c', 'r',   4, 240, 157, 147, 143,   2, 'w', 'j',   3, 226, 128, 141,
+      3, 'w', 'n', 'j',   3, 226, 128, 140
+};
+
diff --git a/include/Makefile.am b/include/Makefile.am
index 328b993..c2f978d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
 SUBDIRS=libxml private
 
-EXTRA_DIST = win32config.h wsockcompat.h meson.build
+EXTRA_DIST = wsockcompat.h meson.build
 
diff --git a/include/libxml/HTMLparser.h b/include/libxml/HTMLparser.h
index 7be3d2b..4ac1358 100644
--- a/include/libxml/HTMLparser.h
+++ b/include/libxml/HTMLparser.h
@@ -22,6 +22,11 @@
 #endif
 
 /*
+ * Backward compatibility
+ */
+#define UTF8ToHtml htmlUTF8ToHtml
+
+/*
  * Most of the back-end structures from XML and HTML are shared.
  */
 typedef xmlParserCtxt htmlParserCtxt;
@@ -42,31 +47,22 @@
 typedef htmlElemDesc *htmlElemDescPtr;
 struct _htmlElemDesc {
     const char *name;	/* The tag name */
-    char startTag;      /* Whether the start tag can be implied */
+    char startTag;      /* unused */
     char endTag;        /* Whether the end tag can be implied */
     char saveEndTag;    /* Whether the end tag should be saved */
     char empty;         /* Is this an empty element ? */
-    char depr;          /* Is this a deprecated element ? */
-    char dtd;           /* 1: only in Loose DTD, 2: only Frameset one */
+    char depr;          /* unused */
+    char dtd;           /* unused */
     char isinline;      /* is this a block 0 or inline 1 element */
     const char *desc;   /* the description */
 
-/* NRK Jan.2003
- * New fields encapsulating HTML structure
- *
- * Bugs:
- *	This is a very limited representation.  It fails to tell us when
- *	an element *requires* subelements (we only have whether they're
- *	allowed or not), and it doesn't tell us where CDATA and PCDATA
- *	are allowed.  Some element relationships are not fully represented:
- *	these are flagged with the word MODIFIER
- */
-    const char** subelts;		/* allowed sub-elements of this element */
-    const char* defaultsubelt;	/* subelement for suggested auto-repair
-					   if necessary or NULL */
-    const char** attrs_opt;		/* Optional Attributes */
-    const char** attrs_depr;		/* Additional deprecated attributes */
-    const char** attrs_req;		/* Required attributes */
+    const char** subelts XML_DEPRECATED_MEMBER;
+    const char* defaultsubelt XML_DEPRECATED_MEMBER;
+    const char** attrs_opt XML_DEPRECATED_MEMBER;
+    const char** attrs_depr XML_DEPRECATED_MEMBER;
+    const char** attrs_req XML_DEPRECATED_MEMBER;
+
+    int dataMode;
 };
 
 /*
@@ -85,11 +81,6 @@
 XML_DEPRECATED
 XMLPUBVAR const xmlSAXHandlerV1 htmlDefaultSAXHandler;
 
-#ifdef LIBXML_THREAD_ENABLED
-XML_DEPRECATED
-XMLPUBFUN const xmlSAXHandlerV1 *__htmlDefaultSAXHandler(void);
-#endif
-
 #endif /* LIBXML_SAX1_ENABLED */
 
 /*
@@ -105,9 +96,11 @@
 XMLPUBFUN const htmlEntityDesc *
 			htmlEntityValueLookup(unsigned int value);
 
+XML_DEPRECATED
 XMLPUBFUN int
 			htmlIsAutoClosed(htmlDocPtr doc,
 					 htmlNodePtr elem);
+XML_DEPRECATED
 XMLPUBFUN int
 			htmlAutoCloseTag(htmlDocPtr doc,
 					 const xmlChar *name,
@@ -157,7 +150,7 @@
 			htmlParseFile	(const char *filename,
 					 const char *encoding);
 XMLPUBFUN int
-			UTF8ToHtml	(unsigned char *out,
+			htmlUTF8ToHtml	(unsigned char *out,
 					 int *outlen,
 					 const unsigned char *in,
 					 int *inlen);
@@ -203,21 +196,27 @@
  * to the xmlReadDoc() and similar calls.
  */
 typedef enum {
-    HTML_PARSE_RECOVER  = 1<<0, /* Relaxed parsing */
+    HTML_PARSE_RECOVER  = 1<<0, /* No effect */
+    HTML_PARSE_HTML5    = 1<<1, /* HTML5 support */
     HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */
     HTML_PARSE_NOERROR	= 1<<5,	/* suppress error reports */
     HTML_PARSE_NOWARNING= 1<<6,	/* suppress warning reports */
-    HTML_PARSE_PEDANTIC	= 1<<7,	/* pedantic error reporting */
+    HTML_PARSE_PEDANTIC	= 1<<7,	/* No effect */
     HTML_PARSE_NOBLANKS	= 1<<8,	/* remove blank nodes */
-    HTML_PARSE_NONET	= 1<<11,/* Forbid network access */
+    HTML_PARSE_NONET	= 1<<11,/* No effect */
     HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */
     HTML_PARSE_COMPACT  = 1<<16,/* compact small text nodes */
-    HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */
+    HTML_PARSE_HUGE     = 1<<19,/* relax any hardcoded limit from the parser */
+    HTML_PARSE_IGNORE_ENC=1<<21,/* ignore internal document encoding hint */
+    HTML_PARSE_BIG_LINES= 1<<22 /* Store big lines numbers in text PSVI field */
 } htmlParserOption;
 
 XMLPUBFUN void
 		htmlCtxtReset		(htmlParserCtxtPtr ctxt);
 XMLPUBFUN int
+		htmlCtxtSetOptions	(htmlParserCtxtPtr ctxt,
+					 int options);
+XMLPUBFUN int
 		htmlCtxtUseOptions	(htmlParserCtxtPtr ctxt,
 					 int options);
 XMLPUBFUN htmlDocPtr
@@ -283,7 +282,7 @@
 					 const char *encoding,
 					 int options);
 
-/* NRK/Jan2003: further knowledge of HTML structure
+/* deprecated content model
  */
 typedef enum {
   HTML_NA = 0 ,		/* something we don't check at all */
@@ -296,9 +295,13 @@
 /* Using htmlElemDesc rather than name here, to emphasise the fact
    that otherwise there's a lookup overhead
 */
+XML_DEPRECATED
 XMLPUBFUN htmlStatus htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
+XML_DEPRECATED
 XMLPUBFUN int htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
+XML_DEPRECATED
 XMLPUBFUN htmlStatus htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
+XML_DEPRECATED
 XMLPUBFUN htmlStatus htmlNodeStatus(htmlNodePtr, int) ;
 /**
  * htmlDefaultSubelement:
diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h
index 8e1ba90..065254f 100644
--- a/include/libxml/HTMLtree.h
+++ b/include/libxml/HTMLtree.h
@@ -133,6 +133,7 @@
 
 #endif /* LIBXML_OUTPUT_ENABLED */
 
+XML_DEPRECATED
 XMLPUBFUN int
 		htmlIsBooleanAttr	(const xmlChar *name);
 
diff --git a/include/libxml/SAX.h b/include/libxml/SAX.h
index eea1057..c1ab58d 100644
--- a/include/libxml/SAX.h
+++ b/include/libxml/SAX.h
@@ -8,195 +8,11 @@
  * Author: Daniel Veillard
  */
 
-
 #ifndef __XML_SAX_H__
 #define __XML_SAX_H__
 
-#include <libxml/xmlversion.h>
-#include <libxml/parser.h>
-
-#ifdef LIBXML_LEGACY_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
+#ifdef __GNUC__
+  #warning "libxml/SAX.h is deprecated"
 #endif
-XML_DEPRECATED
-XMLPUBFUN const xmlChar *
-		getPublicId			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN const xmlChar *
-		getSystemId			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN void
-		setDocumentLocator		(void *ctx,
-						 xmlSAXLocatorPtr loc);
-
-XML_DEPRECATED
-XMLPUBFUN int
-		getLineNumber			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-		getColumnNumber			(void *ctx);
-
-XML_DEPRECATED
-XMLPUBFUN int
-		isStandalone			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-		hasInternalSubset		(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-		hasExternalSubset		(void *ctx);
-
-XML_DEPRECATED
-XMLPUBFUN void
-		internalSubset			(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID);
-XML_DEPRECATED
-XMLPUBFUN void
-		externalSubset			(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *ExternalID,
-						 const xmlChar *SystemID);
-XML_DEPRECATED
-XMLPUBFUN xmlEntityPtr
-		getEntity			(void *ctx,
-						 const xmlChar *name);
-XML_DEPRECATED
-XMLPUBFUN xmlEntityPtr
-		getParameterEntity		(void *ctx,
-						 const xmlChar *name);
-XML_DEPRECATED
-XMLPUBFUN xmlParserInputPtr
-		resolveEntity			(void *ctx,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId);
-
-XML_DEPRECATED
-XMLPUBFUN void
-		entityDecl			(void *ctx,
-						 const xmlChar *name,
-						 int type,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId,
-						 xmlChar *content);
-XML_DEPRECATED
-XMLPUBFUN void
-		attributeDecl			(void *ctx,
-						 const xmlChar *elem,
-						 const xmlChar *fullname,
-						 int type,
-						 int def,
-						 const xmlChar *defaultValue,
-						 xmlEnumerationPtr tree);
-XML_DEPRECATED
-XMLPUBFUN void
-		elementDecl			(void *ctx,
-						 const xmlChar *name,
-						 int type,
-						 xmlElementContentPtr content);
-XML_DEPRECATED
-XMLPUBFUN void
-		notationDecl			(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId);
-XML_DEPRECATED
-XMLPUBFUN void
-		unparsedEntityDecl		(void *ctx,
-						 const xmlChar *name,
-						 const xmlChar *publicId,
-						 const xmlChar *systemId,
-						 const xmlChar *notationName);
-
-XML_DEPRECATED
-XMLPUBFUN void
-		startDocument			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN void
-		endDocument			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN void
-		attribute			(void *ctx,
-						 const xmlChar *fullname,
-						 const xmlChar *value);
-XML_DEPRECATED
-XMLPUBFUN void
-		startElement			(void *ctx,
-						 const xmlChar *fullname,
-						 const xmlChar **atts);
-XML_DEPRECATED
-XMLPUBFUN void
-		endElement			(void *ctx,
-						 const xmlChar *name);
-XML_DEPRECATED
-XMLPUBFUN void
-		reference			(void *ctx,
-						 const xmlChar *name);
-XML_DEPRECATED
-XMLPUBFUN void
-		characters			(void *ctx,
-						 const xmlChar *ch,
-						 int len);
-XML_DEPRECATED
-XMLPUBFUN void
-		ignorableWhitespace		(void *ctx,
-						 const xmlChar *ch,
-						 int len);
-XML_DEPRECATED
-XMLPUBFUN void
-		processingInstruction		(void *ctx,
-						 const xmlChar *target,
-						 const xmlChar *data);
-XML_DEPRECATED
-XMLPUBFUN void
-		globalNamespace			(void *ctx,
-						 const xmlChar *href,
-						 const xmlChar *prefix);
-XML_DEPRECATED
-XMLPUBFUN void
-		setNamespace			(void *ctx,
-						 const xmlChar *name);
-XML_DEPRECATED
-XMLPUBFUN xmlNsPtr
-		getNamespace			(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-		checkNamespace			(void *ctx,
-						 xmlChar *nameSpace);
-XML_DEPRECATED
-XMLPUBFUN void
-		namespaceDecl			(void *ctx,
-						 const xmlChar *href,
-						 const xmlChar *prefix);
-XML_DEPRECATED
-XMLPUBFUN void
-		comment				(void *ctx,
-						 const xmlChar *value);
-XML_DEPRECATED
-XMLPUBFUN void
-		cdataBlock			(void *ctx,
-						 const xmlChar *value,
-						 int len);
-
-#ifdef LIBXML_SAX1_ENABLED
-XML_DEPRECATED
-XMLPUBFUN void
-		initxmlDefaultSAXHandler	(xmlSAXHandlerV1 *hdlr,
-						 int warning);
-#ifdef LIBXML_HTML_ENABLED
-XML_DEPRECATED
-XMLPUBFUN void
-		inithtmlDefaultSAXHandler	(xmlSAXHandlerV1 *hdlr);
-#endif
-#endif /* LIBXML_SAX1_ENABLED */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_LEGACY_ENABLED */
 
 #endif /* __XML_SAX_H__ */
diff --git a/include/libxml/SAX2.h b/include/libxml/SAX2.h
index 4c4ecce..657acb0 100644
--- a/include/libxml/SAX2.h
+++ b/include/libxml/SAX2.h
@@ -95,16 +95,15 @@
 		xmlSAX2StartDocument		(void *ctx);
 XMLPUBFUN void
 		xmlSAX2EndDocument		(void *ctx);
-#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
-    defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlSAX2StartElement		(void *ctx,
 						 const xmlChar *fullname,
 						 const xmlChar **atts);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlSAX2EndElement		(void *ctx,
 						 const xmlChar *name);
-#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */
 XMLPUBFUN void
 		xmlSAX2StartElementNs		(void *ctx,
 						 const xmlChar *localname,
diff --git a/include/libxml/catalog.h b/include/libxml/catalog.h
index 02fa7ab..442092a 100644
--- a/include/libxml/catalog.h
+++ b/include/libxml/catalog.h
@@ -161,6 +161,7 @@
  */
 XMLPUBFUN int
 		xmlCatalogSetDebug	(int level);
+XML_DEPRECATED
 XMLPUBFUN xmlCatalogPrefer
 		xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
 XMLPUBFUN void
diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h
index 1332dd7..55148d9 100644
--- a/include/libxml/debugXML.h
+++ b/include/libxml/debugXML.h
@@ -71,144 +71,6 @@
 	xmlDebugCheckDocument	(FILE * output,
 				 xmlDocPtr doc);
 
-/****************************************************************
- *								*
- *			XML shell helpers			*
- *								*
- ****************************************************************/
-
-XMLPUBFUN void
-	xmlLsOneNode		(FILE *output, xmlNodePtr node);
-XMLPUBFUN int
-	xmlLsCountNode		(xmlNodePtr node);
-
-XMLPUBFUN const char *
-	xmlBoolToText		(int boolval);
-
-/****************************************************************
- *								*
- *	 The XML shell related structures and functions		*
- *								*
- ****************************************************************/
-
-#ifdef LIBXML_XPATH_ENABLED
-/**
- * xmlShellReadlineFunc:
- * @prompt:  a string prompt
- *
- * This is a generic signature for the XML shell input function.
- *
- * Returns a string which will be freed by the Shell.
- */
-typedef char * (* xmlShellReadlineFunc)(char *prompt);
-
-/**
- * xmlShellCtxt:
- *
- * A debugging shell context.
- * TODO: add the defined function tables.
- */
-typedef struct _xmlShellCtxt xmlShellCtxt;
-typedef xmlShellCtxt *xmlShellCtxtPtr;
-struct _xmlShellCtxt {
-    char *filename;
-    xmlDocPtr doc;
-    xmlNodePtr node;
-    xmlXPathContextPtr pctxt;
-    int loaded;
-    FILE *output;
-    xmlShellReadlineFunc input;
-};
-
-/**
- * xmlShellCmd:
- * @ctxt:  a shell context
- * @arg:  a string argument
- * @node:  a first node
- * @node2:  a second node
- *
- * This is a generic signature for the XML shell functions.
- *
- * Returns an int, negative returns indicating errors.
- */
-typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
-                             char *arg,
-			     xmlNodePtr node,
-			     xmlNodePtr node2);
-
-XMLPUBFUN void
-	xmlShellPrintXPathError	(int errorType,
-				 const char *arg);
-XMLPUBFUN void
-	xmlShellPrintXPathResult(xmlXPathObjectPtr list);
-XMLPUBFUN int
-	xmlShellList		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int
-	xmlShellBase		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int
-	xmlShellDir		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int
-	xmlShellLoad		(xmlShellCtxtPtr ctxt,
-				 char *filename,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-#ifdef LIBXML_OUTPUT_ENABLED
-XMLPUBFUN void
-	xmlShellPrintNode	(xmlNodePtr node);
-XMLPUBFUN int
-	xmlShellCat		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int
-	xmlShellWrite		(xmlShellCtxtPtr ctxt,
-				 char *filename,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-XMLPUBFUN int
-	xmlShellSave		(xmlShellCtxtPtr ctxt,
-				 char *filename,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-#endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_VALID_ENABLED
-XMLPUBFUN int
-	xmlShellValidate	(xmlShellCtxtPtr ctxt,
-				 char *dtd,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-#endif /* LIBXML_VALID_ENABLED */
-XMLPUBFUN int
-	xmlShellDu		(xmlShellCtxtPtr ctxt,
-				 char *arg,
-				 xmlNodePtr tree,
-				 xmlNodePtr node2);
-XMLPUBFUN int
-	xmlShellPwd		(xmlShellCtxtPtr ctxt,
-				 char *buffer,
-				 xmlNodePtr node,
-				 xmlNodePtr node2);
-
-/*
- * The Shell interface.
- */
-XMLPUBFUN void
-	xmlShell		(xmlDocPtr doc,
-				 const char *filename,
-				 xmlShellReadlineFunc input,
-				 FILE *output);
-
-#endif /* LIBXML_XPATH_ENABLED */
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/libxml/encoding.h b/include/libxml/encoding.h
index 599a03e..9a358db 100644
--- a/include/libxml/encoding.h
+++ b/include/libxml/encoding.h
@@ -23,44 +23,30 @@
 #define __XML_CHAR_ENCODING_H__
 
 #include <libxml/xmlversion.h>
-
-#ifdef LIBXML_ICONV_ENABLED
-#include <iconv.h>
-#endif
+#include <libxml/xmlerror.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+/*
+ * Backward compatibility
+ */
+#define UTF8Toisolat1 xmlUTF8ToIsolat1
+#define isolat1ToUTF8 xmlIsolat1ToUTF8
+
 typedef enum {
     XML_ENC_ERR_SUCCESS     =  0,
-    XML_ENC_ERR_SPACE       = -1,
+    XML_ENC_ERR_INTERNAL    = -1,
     XML_ENC_ERR_INPUT       = -2,
-    XML_ENC_ERR_PARTIAL     = -3,
-    XML_ENC_ERR_INTERNAL    = -4,
-    XML_ENC_ERR_MEMORY      = -5
+    XML_ENC_ERR_SPACE       = -3,
+    XML_ENC_ERR_MEMORY      = -4
 } xmlCharEncError;
 
 /*
  * xmlCharEncoding:
  *
  * Predefined values for some standard encodings.
- * Libxml does not do beforehand translation on UTF8 and ISOLatinX.
- * It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
- *
- * Anything else would have to be translated to UTF8 before being
- * given to the parser itself. The BOM for UTF16 and the encoding
- * declaration are looked at and a converter is looked for at that
- * point. If not found the parser stops here as asked by the XML REC. A
- * converter can be registered by the user using xmlRegisterCharEncodingHandler
- * but the current form doesn't allow stateful transcoding (a serious
- * problem agreed !). If iconv has been found it will be used
- * automatically and allow stateful transcoding, the simplest is then
- * to be sure to enable iconv and to provide iconv libs for the encoding
- * support needed.
- *
- * Note that the generic "UTF-16" is not a predefined value.  Instead, only
- * the specific UTF-16LE and UTF-16BE are present.
  */
 typedef enum {
     XML_CHAR_ENCODING_ERROR=   -1, /* No char encoding detected */
@@ -86,9 +72,23 @@
     XML_CHAR_ENCODING_2022_JP=  19,/* ISO-2022-JP */
     XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
     XML_CHAR_ENCODING_EUC_JP=   21,/* EUC-JP */
-    XML_CHAR_ENCODING_ASCII=    22 /* pure ASCII */
+    XML_CHAR_ENCODING_ASCII=    22,/* pure ASCII */
+    /* Available since 2.14.0 */
+    XML_CHAR_ENCODING_UTF16=	23,/* UTF-16 native */
+    XML_CHAR_ENCODING_HTML=	24,/* HTML (output only) */
+    XML_CHAR_ENCODING_8859_10=	25,/* ISO-8859-10 */
+    XML_CHAR_ENCODING_8859_11=	26,/* ISO-8859-11 */
+    XML_CHAR_ENCODING_8859_13=	27,/* ISO-8859-13 */
+    XML_CHAR_ENCODING_8859_14=	28,/* ISO-8859-14 */
+    XML_CHAR_ENCODING_8859_15=	29,/* ISO-8859-15 */
+    XML_CHAR_ENCODING_8859_16=	30 /* ISO-8859-16 */
 } xmlCharEncoding;
 
+typedef enum {
+    XML_ENC_INPUT = (1 << 0),
+    XML_ENC_OUTPUT = (1 << 1)
+} xmlCharEncFlags;
+
 /**
  * xmlCharEncodingInputFunc:
  * @out:  a pointer to an array of bytes to store the UTF-8 result
@@ -96,17 +96,15 @@
  * @in:  a pointer to an array of chars in the original encoding
  * @inlen:  the length of @in
  *
- * Take a block of chars in the original encoding and try to convert
- * it to an UTF-8 block of chars out.
+ * Convert characters to UTF-8.
  *
- * Returns the number of bytes written, -1 if lack of space, or -2
- *     if the transcoding failed.
- * The value of @inlen after return is the number of octets consumed
- *     if the return value is positive, else unpredictiable.
- * The value of @outlen after return is the number of octets consumed.
+ * On success, the value of @inlen after return is the number of
+ * bytes consumed and @outlen is the number of bytes produced.
+ *
+ * Returns the number of bytes written or an XML_ENC_ERR code.
  */
-typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
-                                         const unsigned char *in, int *inlen);
+typedef int (*xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
+                                        const unsigned char *in, int *inlen);
 
 
 /**
@@ -116,41 +114,92 @@
  * @in:  a pointer to an array of UTF-8 chars
  * @inlen:  the length of @in
  *
- * Take a block of UTF-8 chars in and try to convert it to another
- * encoding.
- * Note: a first call designed to produce heading info is called with
- * in = NULL. If stateful this should also initialize the encoder state.
+ * Convert characters from UTF-8.
  *
- * Returns the number of bytes written, -1 if lack of space, or -2
- *     if the transcoding failed.
- * The value of @inlen after return is the number of octets consumed
- *     if the return value is positive, else unpredictiable.
- * The value of @outlen after return is the number of octets produced.
+ * On success, the value of @inlen after return is the number of
+ * bytes consumed and @outlen is the number of bytes produced.
+ *
+ * Returns the number of bytes written or an XML_ENC_ERR code.
  */
-typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
-                                          const unsigned char *in, int *inlen);
+typedef int (*xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
+                                         const unsigned char *in, int *inlen);
 
 
+/**
+ * xmlCharEncConvFunc:
+ * @vctxt:  conversion context
+ * @out:  a pointer to an array of bytes to store the result
+ * @outlen:  the length of @out
+ * @in:  a pointer to an array of input bytes
+ * @inlen:  the length of @in
+ * @flush:  end of input
+ *
+ * Convert between character encodings.
+ *
+ * The value of @inlen after return is the number of bytes consumed
+ * and @outlen is the number of bytes produced.
+ *
+ * If the converter can consume partial multi-byte sequences, the
+ * @flush flag can be used to detect truncated sequences at EOF.
+ * Otherwise, the flag can be ignored.
+ *
+ * Returns an XML_ENC_ERR code.
+ */
+typedef xmlCharEncError
+(*xmlCharEncConvFunc)(void *vctxt, unsigned char *out, int *outlen,
+                      const unsigned char *in, int *inlen, int flush);
+
+/**
+ * xmlCharEncConvCtxtDtor:
+ * @vctxt:  conversion context
+ *
+ * Free a conversion context.
+ */
+typedef void
+(*xmlCharEncConvCtxtDtor)(void *vctxt);
+
 /*
  * Block defining the handlers for non UTF-8 encodings.
- * If iconv is supported, there are two extra fields.
+ *
+ * This structure will be made private.
  */
 typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
 typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
 struct _xmlCharEncodingHandler {
-    char                       *name;
-    xmlCharEncodingInputFunc   input;
-    xmlCharEncodingOutputFunc  output;
-#ifdef LIBXML_ICONV_ENABLED
-    iconv_t                    iconv_in;
-    iconv_t                    iconv_out;
-#endif /* LIBXML_ICONV_ENABLED */
-#ifdef LIBXML_ICU_ENABLED
-    struct _uconv_t            *uconv_in;
-    struct _uconv_t            *uconv_out;
-#endif /* LIBXML_ICU_ENABLED */
+    char *name XML_DEPRECATED_MEMBER;
+    union {
+        xmlCharEncConvFunc func;
+        xmlCharEncodingInputFunc legacyFunc;
+    } input XML_DEPRECATED_MEMBER;
+    union {
+        xmlCharEncConvFunc func;
+        xmlCharEncodingOutputFunc legacyFunc;
+    } output XML_DEPRECATED_MEMBER;
+    void *inputCtxt XML_DEPRECATED_MEMBER;
+    void *outputCtxt XML_DEPRECATED_MEMBER;
+    xmlCharEncConvCtxtDtor ctxtDtor XML_DEPRECATED_MEMBER;
+    int flags XML_DEPRECATED_MEMBER;
 };
 
+/**
+ * xmlCharEncConvImpl:
+ * @vctxt:  user data
+ * @name:  encoding name
+ * @flags:  bit mask of flags
+ * @out:  pointer to resulting handler
+ *
+ * If this function returns XML_ERR_OK, it must fill the @out
+ * pointer with an encoding handler. The handler can be obtained
+ * from xmlCharEncNewCustomHandler.
+ *
+ * @flags can contain XML_ENC_INPUT, XML_ENC_OUTPUT or both.
+ *
+ * Returns an xmlParserErrors code.
+ */
+typedef xmlParserErrors
+(*xmlCharEncConvImpl)(void *vctxt, const char *name, xmlCharEncFlags flags,
+                      xmlCharEncodingHandler **out);
+
 /*
  * Interfaces for encoding handlers.
  */
@@ -162,13 +211,19 @@
 	xmlCleanupCharEncodingHandlers	(void);
 XMLPUBFUN void
 	xmlRegisterCharEncodingHandler	(xmlCharEncodingHandlerPtr handler);
-XMLPUBFUN int
+XMLPUBFUN xmlParserErrors
 	xmlLookupCharEncodingHandler	(xmlCharEncoding enc,
 					 xmlCharEncodingHandlerPtr *out);
-XMLPUBFUN int
+XMLPUBFUN xmlParserErrors
 	xmlOpenCharEncodingHandler	(const char *name,
 					 int output,
 					 xmlCharEncodingHandlerPtr *out);
+XMLPUBFUN xmlParserErrors
+	xmlCreateCharEncodingHandler	(const char *name,
+					 xmlCharEncFlags flags,
+					 xmlCharEncConvImpl impl,
+					 void *implCtxt,
+					 xmlCharEncodingHandlerPtr *out);
 XMLPUBFUN xmlCharEncodingHandlerPtr
 	xmlGetCharEncodingHandler	(xmlCharEncoding enc);
 XMLPUBFUN xmlCharEncodingHandlerPtr
@@ -177,6 +232,14 @@
 	xmlNewCharEncodingHandler	(const char *name,
 					 xmlCharEncodingInputFunc input,
 					 xmlCharEncodingOutputFunc output);
+XMLPUBFUN xmlParserErrors
+	xmlCharEncNewCustomHandler	(const char *name,
+					 xmlCharEncConvFunc input,
+					 xmlCharEncConvFunc output,
+					 xmlCharEncConvCtxtDtor ctxtDtor,
+					 void *inputCtxt,
+					 void *outputCtxt,
+					 xmlCharEncodingHandler **out);
 
 /*
  * Interfaces for encoding names and aliases.
@@ -227,13 +290,13 @@
  */
 #ifdef LIBXML_OUTPUT_ENABLED
 XMLPUBFUN int
-	UTF8Toisolat1			(unsigned char *out,
+	xmlUTF8ToIsolat1		(unsigned char *out,
 					 int *outlen,
 					 const unsigned char *in,
 					 int *inlen);
 #endif /* LIBXML_OUTPUT_ENABLED */
 XMLPUBFUN int
-	isolat1ToUTF8			(unsigned char *out,
+	xmlIsolat1ToUTF8		(unsigned char *out,
 					 int *outlen,
 					 const unsigned char *in,
 					 int *inlen);
diff --git a/include/libxml/entities.h b/include/libxml/entities.h
index a0cfca8..d17c36b 100644
--- a/include/libxml/entities.h
+++ b/include/libxml/entities.h
@@ -76,12 +76,6 @@
  * External functions:
  */
 
-#ifdef LIBXML_LEGACY_ENABLED
-XML_DEPRECATED
-XMLPUBFUN void
-		xmlInitializePredefinedEntities	(void);
-#endif /* LIBXML_LEGACY_ENABLED */
-
 XMLPUBFUN xmlEntityPtr
 			xmlNewEntity		(xmlDocPtr doc,
 						 const xmlChar *name,
@@ -125,12 +119,6 @@
 XMLPUBFUN xmlEntityPtr
 			xmlGetParameterEntity	(xmlDocPtr doc,
 						 const xmlChar *name);
-#ifdef LIBXML_LEGACY_ENABLED
-XML_DEPRECATED
-XMLPUBFUN const xmlChar *
-			xmlEncodeEntities	(xmlDocPtr doc,
-						 const xmlChar *input);
-#endif /* LIBXML_LEGACY_ENABLED */
 XMLPUBFUN xmlChar *
 			xmlEncodeEntitiesReentrant(xmlDocPtr doc,
 						 const xmlChar *input);
@@ -139,10 +127,8 @@
 						 const xmlChar *input);
 XMLPUBFUN xmlEntitiesTablePtr
 			xmlCreateEntitiesTable	(void);
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN xmlEntitiesTablePtr
 			xmlCopyEntitiesTable	(xmlEntitiesTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
 XMLPUBFUN void
 			xmlFreeEntitiesTable	(xmlEntitiesTablePtr table);
 #ifdef LIBXML_OUTPUT_ENABLED
@@ -153,11 +139,6 @@
 			xmlDumpEntityDecl	(xmlBufferPtr buf,
 						 xmlEntityPtr ent);
 #endif /* LIBXML_OUTPUT_ENABLED */
-#ifdef LIBXML_LEGACY_ENABLED
-XMLPUBFUN void
-			xmlCleanupPredefinedEntities(void);
-#endif /* LIBXML_LEGACY_ENABLED */
-
 
 #ifdef __cplusplus
 }
diff --git a/include/libxml/globals.h b/include/libxml/globals.h
index 92f4131..a5db802 100644
--- a/include/libxml/globals.h
+++ b/include/libxml/globals.h
@@ -22,20 +22,4 @@
 #include <libxml/xmlsave.h>
 #include <libxml/threads.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct _xmlGlobalState xmlGlobalState;
-typedef xmlGlobalState *xmlGlobalStatePtr;
-
-XML_DEPRECATED XMLPUBFUN void
-xmlInitializeGlobalState(xmlGlobalStatePtr gs);
-XML_DEPRECATED XMLPUBFUN
-xmlGlobalStatePtr xmlGetGlobalState(void);
-
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* __XML_GLOBALS_H */
diff --git a/include/libxml/meson.build b/include/libxml/meson.build
index 2b2cfb7..1da29aa 100644
--- a/include/libxml/meson.build
+++ b/include/libxml/meson.build
@@ -7,34 +7,32 @@
 xmlversion_h.set10('WITH_C14N', want_c14n)
 xmlversion_h.set10('WITH_CATALOG', want_catalog)
 xmlversion_h.set10('WITH_DEBUG', want_debug)
-xmlversion_h.set10('WITH_FTP', want_ftp)
 xmlversion_h.set10('WITH_HTML', want_html)
 xmlversion_h.set10('WITH_HTTP', want_http)
-xmlversion_h.set10('WITH_ICONV', iconv_dep.found())
-xmlversion_h.set10('WITH_ICU', icu_dep.found())
+xmlversion_h.set10('WITH_ICONV', want_iconv)
+xmlversion_h.set10('WITH_ICU', want_icu)
 xmlversion_h.set10('WITH_ISO8859X', want_iso8859x)
 xmlversion_h.set10('WITH_LEGACY', want_legacy)
-xmlversion_h.set10('WITH_LZMA', lzma_dep.found())
-xmlversion_h.set10('WITH_MODULES', dl_dep.found())
+xmlversion_h.set10('WITH_LZMA', want_lzma)
+xmlversion_h.set10('WITH_MODULES', want_modules)
 xmlversion_h.set('MODULE_EXTENSION', module_extension)
 xmlversion_h.set10('WITH_OUTPUT', want_output)
 xmlversion_h.set10('WITH_PATTERN', want_pattern)
 xmlversion_h.set10('WITH_PUSH', want_push)
 xmlversion_h.set10('WITH_READER', want_reader)
 xmlversion_h.set10('WITH_REGEXPS', want_regexps)
+xmlversion_h.set10('WITH_RELAXNG', want_relaxng)
 xmlversion_h.set10('WITH_SAX1', want_sax1)
 xmlversion_h.set10('WITH_SCHEMAS', want_schemas)
 xmlversion_h.set10('WITH_SCHEMATRON', want_schematron)
-xmlversion_h.set10('WITH_THREADS', threads_dep.found())
+xmlversion_h.set10('WITH_THREADS', want_threads)
 xmlversion_h.set10('WITH_THREAD_ALLOC', want_thread_alloc)
-xmlversion_h.set10('WITH_TREE', want_tree)
 xmlversion_h.set10('WITH_VALID', want_valid)
 xmlversion_h.set10('WITH_WRITER', want_writer)
 xmlversion_h.set10('WITH_XINCLUDE', want_xinclude)
 xmlversion_h.set10('WITH_XPATH', want_xpath)
 xmlversion_h.set10('WITH_XPTR', want_xptr)
-xmlversion_h.set10('WITH_XPTR_LOCS', want_xptr_locs)
-xmlversion_h.set10('WITH_ZLIB', zlib_dep.found())
+xmlversion_h.set10('WITH_ZLIB', want_zlib)
 
 configure_file(
     input: 'xmlversion.h.in',
diff --git a/include/libxml/nanoftp.h b/include/libxml/nanoftp.h
index ed3ac4f..5dda634 100644
--- a/include/libxml/nanoftp.h
+++ b/include/libxml/nanoftp.h
@@ -1,8 +1,5 @@
 /*
- * Summary: minimal FTP implementation
- * Description: minimal FTP implementation allowing to fetch resources
- *              like external subset. This module is DEPRECATED, do not
- *              use any of its functions.
+ * Summary: Removed legacy symbols for an outdated FTP client
  *
  * Copy: See Copyright for the status of this software.
  *
@@ -12,175 +9,8 @@
 #ifndef __NANO_FTP_H__
 #define __NANO_FTP_H__
 
-#include <libxml/xmlversion.h>
-
-#if defined(LIBXML_FTP_ENABLED)
-
-/* Needed for portability to Windows 64 bits */
-#if defined(_WIN32)
-#include <winsock2.h>
-#else
-/**
- * SOCKET:
- *
- * macro used to provide portability of code to windows sockets
- */
-#define SOCKET int
-/**
- * INVALID_SOCKET:
- *
- * macro used to provide portability of code to windows sockets
- * the value to be used when the socket is not valid
- */
-#undef  INVALID_SOCKET
-#define INVALID_SOCKET (-1)
+#ifdef __GNUC__
+  #warning "libxml/nanoftp.h is deprecated"
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * ftpListCallback:
- * @userData:  user provided data for the callback
- * @filename:  the file name (including "->" when links are shown)
- * @attrib:  the attribute string
- * @owner:  the owner string
- * @group:  the group string
- * @size:  the file size
- * @links:  the link count
- * @year:  the year
- * @month:  the month
- * @day:  the day
- * @hour:  the hour
- * @minute:  the minute
- *
- * A callback for the xmlNanoFTPList command.
- * Note that only one of year and day:minute are specified.
- */
-typedef void (*ftpListCallback) (void *userData,
-	                         const char *filename, const char *attrib,
-	                         const char *owner, const char *group,
-				 unsigned long size, int links, int year,
-				 const char *month, int day, int hour,
-				 int minute);
-/**
- * ftpDataCallback:
- * @userData: the user provided context
- * @data: the data received
- * @len: its size in bytes
- *
- * A callback for the xmlNanoFTPGet command.
- */
-typedef void (*ftpDataCallback) (void *userData,
-				 const char *data,
-				 int len);
-
-/*
- * Init
- */
-XML_DEPRECATED
-XMLPUBFUN void
-	xmlNanoFTPInit		(void);
-XML_DEPRECATED
-XMLPUBFUN void
-	xmlNanoFTPCleanup	(void);
-
-/*
- * Creating/freeing contexts.
- */
-XML_DEPRECATED
-XMLPUBFUN void *
-	xmlNanoFTPNewCtxt	(const char *URL);
-XML_DEPRECATED
-XMLPUBFUN void
-	xmlNanoFTPFreeCtxt	(void * ctx);
-XML_DEPRECATED
-XMLPUBFUN void *
-	xmlNanoFTPConnectTo	(const char *server,
-				 int port);
-/*
- * Opening/closing session connections.
- */
-XML_DEPRECATED
-XMLPUBFUN void *
-	xmlNanoFTPOpen		(const char *URL);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPConnect	(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPClose		(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPQuit		(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN void
-	xmlNanoFTPScanProxy	(const char *URL);
-XML_DEPRECATED
-XMLPUBFUN void
-	xmlNanoFTPProxy		(const char *host,
-				 int port,
-				 const char *user,
-				 const char *passwd,
-				 int type);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPUpdateURL	(void *ctx,
-				 const char *URL);
-
-/*
- * Rather internal commands.
- */
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPGetResponse	(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPCheckResponse	(void *ctx);
-
-/*
- * CD/DIR/GET handlers.
- */
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPCwd		(void *ctx,
-				 const char *directory);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPDele		(void *ctx,
-				 const char *file);
-
-XML_DEPRECATED
-XMLPUBFUN SOCKET
-	xmlNanoFTPGetConnection	(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPCloseConnection(void *ctx);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPList		(void *ctx,
-				 ftpListCallback callback,
-				 void *userData,
-				 const char *filename);
-XML_DEPRECATED
-XMLPUBFUN SOCKET
-	xmlNanoFTPGetSocket	(void *ctx,
-				 const char *filename);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPGet		(void *ctx,
-				 ftpDataCallback callback,
-				 void *userData,
-				 const char *filename);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlNanoFTPRead		(void *ctx,
-				 void *dest,
-				 int len);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* defined(LIBXML_FTP_ENABLED) || defined(LIBXML_LEGACY_ENABLED) */
 #endif /* __NANO_FTP_H__ */
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 78d29ca..e224752 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -40,6 +40,30 @@
  */
 #define XML_DEFAULT_VERSION	"1.0"
 
+typedef enum {
+    XML_STATUS_NOT_WELL_FORMED          = (1 << 0),
+    XML_STATUS_NOT_NS_WELL_FORMED       = (1 << 1),
+    XML_STATUS_DTD_VALIDATION_FAILED    = (1 << 2),
+    XML_STATUS_CATASTROPHIC_ERROR       = (1 << 3)
+} xmlParserStatus;
+
+typedef enum {
+    XML_RESOURCE_UNKNOWN = 0,
+    XML_RESOURCE_MAIN_DOCUMENT,
+    XML_RESOURCE_DTD,
+    XML_RESOURCE_GENERAL_ENTITY,
+    XML_RESOURCE_PARAMETER_ENTITY,
+    XML_RESOURCE_XINCLUDE,
+    XML_RESOURCE_XINCLUDE_TEXT
+} xmlResourceType;
+
+typedef enum {
+    XML_INPUT_BUF_STATIC            = (1 << 1),
+    XML_INPUT_BUF_ZERO_TERMINATED   = (1 << 2),
+    XML_INPUT_UNZIP                 = (1 << 3),
+    XML_INPUT_NETWORK               = (1 << 4)
+} xmlParserInputFlags;
+
 /**
  * xmlParserInput:
  *
@@ -61,24 +85,39 @@
 
 struct _xmlParserInput {
     /* Input buffer */
-    xmlParserInputBufferPtr buf;      /* UTF-8 encoded buffer */
-
-    const char *filename;             /* The file analyzed, if any */
-    const char *directory;            /* unused */
-    const xmlChar *base;              /* Base of the array to parse */
-    const xmlChar *cur;               /* Current char being parsed */
-    const xmlChar *end;               /* end of the array to parse */
-    int length;                       /* unused */
-    int line;                         /* Current line */
-    int col;                          /* Current column */
-    unsigned long consumed;           /* How many xmlChars already consumed */
-    xmlParserInputDeallocate free;    /* function to deallocate the base */
-    const xmlChar *encoding;          /* unused */
-    const xmlChar *version;           /* the version string for entity */
-    int flags;                        /* Flags */
-    int id;                           /* an unique identifier for the entity */
-    unsigned long parentConsumed;     /* unused */
-    xmlEntityPtr entity;              /* entity, if any */
+    xmlParserInputBufferPtr buf;
+    /* The file analyzed, if any */
+    const char *filename;
+    /* unused */
+    const char *directory XML_DEPRECATED_MEMBER;
+    /* Base of the array to parse */
+    const xmlChar *base;
+    /* Current char being parsed */
+    const xmlChar *cur;
+    /* end of the array to parse */
+    const xmlChar *end;
+    /* unused */
+    int length XML_DEPRECATED_MEMBER;
+    /* Current line */
+    int line;
+    /* Current column */
+    int col;
+    /* How many xmlChars already consumed */
+    unsigned long consumed;
+    /* function to deallocate the base */
+    xmlParserInputDeallocate free XML_DEPRECATED_MEMBER;
+    /* unused */
+    const xmlChar *encoding XML_DEPRECATED_MEMBER;
+    /* the version string for entity */
+    const xmlChar *version XML_DEPRECATED_MEMBER;
+    /* Flags */
+    int flags XML_DEPRECATED_MEMBER;
+    /* an unique identifier for the entity */
+    int id XML_DEPRECATED_MEMBER;
+    /* unused */
+    unsigned long parentConsumed XML_DEPRECATED_MEMBER;
+    /* entity, if any */
+    xmlEntityPtr entity XML_DEPRECATED_MEMBER;
 };
 
 /**
@@ -164,6 +203,29 @@
 typedef struct _xmlAttrHashBucket xmlAttrHashBucket;
 
 /**
+ * xmlResourceLoader:
+ * @ctxt:  parser context
+ * @url:  URL to load
+ * @publicId:  publid ID from DTD (optional)
+ * @type:  resource type
+ * @flags:  flags
+ * @out:  result pointer
+ *
+ * Callback for custom resource loaders.
+ *
+ * @flags can contain XML_INPUT_UNZIP and XML_INPUT_NETWORK.
+ *
+ * On success, @out should be set to a new parser input object and
+ * XML_ERR_OK should be returned.
+ *
+ * Returns an xmlParserErrors code.
+ */
+typedef xmlParserErrors
+(*xmlResourceLoader)(void *ctxt, const char *url, const char *publicId,
+                     xmlResourceType type, xmlParserInputFlags flags,
+                     xmlParserInputPtr *out);
+
+/**
  * xmlParserCtxt:
  *
  * The parser context.
@@ -176,146 +238,251 @@
  *      to a state based parser for progressive parsing shouldn't be too hard.
  */
 struct _xmlParserCtxt {
-    struct _xmlSAXHandler *sax;       /* The SAX handler */
-    void            *userData;        /* For SAX interface only, used by DOM build */
-    xmlDocPtr           myDoc;        /* the document being built */
-    int            wellFormed;        /* is the document well formed */
-    int       replaceEntities;        /* shall we replace entities ? */
-    const xmlChar    *version;        /* the XML version string */
-    const xmlChar   *encoding;        /* the declared encoding, if any */
-    int            standalone;        /* standalone document */
-    int                  html;        /* an HTML(1) document
-                                       * 3 is HTML after <head>
-                                       * 10 is HTML after <body>
-                                       */
+    /* The SAX handler */
+    struct _xmlSAXHandler *sax;
+    /* For SAX interface only, used by DOM build */
+    void *userData;
+    /* the document being built */
+    xmlDocPtr myDoc;
+    /* is the document well formed */
+    int wellFormed;
+    /* shall we replace entities ? */
+    int replaceEntities XML_DEPRECATED_MEMBER;
+    /* the XML version string */
+    const xmlChar *version;
+    /* the declared encoding, if any */
+    const xmlChar *encoding;
+    /* standalone document */
+    int standalone;
+
+    /* an HTML(1) document
+     * 3 is HTML after <head>
+     * 10 is HTML after <body>
+     */
+    int html;
 
     /* Input stream stack */
-    xmlParserInputPtr  input;         /* Current input stream */
-    int                inputNr;       /* Number of current input streams */
-    int                inputMax;      /* Max number of input streams */
-    xmlParserInputPtr *inputTab;      /* stack of inputs */
+
+    /* Current input stream */
+    xmlParserInputPtr input;
+    /* Number of current input streams */
+    int inputNr;
+    /* Max number of input streams */
+    int inputMax XML_DEPRECATED_MEMBER;
+    /* stack of inputs */
+    xmlParserInputPtr *inputTab;
 
     /* Node analysis stack only used for DOM building */
-    xmlNodePtr         node;          /* Current parsed Node */
-    int                nodeNr;        /* Depth of the parsing stack */
-    int                nodeMax;       /* Max depth of the parsing stack */
-    xmlNodePtr        *nodeTab;       /* array of nodes */
 
-    int record_info;                  /* Whether node info should be kept */
-    xmlParserNodeInfoSeq node_seq;    /* info about each node parsed */
+    /* Current parsed Node */
+    xmlNodePtr node XML_DEPRECATED_MEMBER;
+    /* Depth of the parsing stack */
+    int nodeNr XML_DEPRECATED_MEMBER;
+    /* Max depth of the parsing stack */
+    int nodeMax XML_DEPRECATED_MEMBER;
+    /* array of nodes */
+    xmlNodePtr *nodeTab XML_DEPRECATED_MEMBER;
 
-    int errNo;                        /* error code */
+    /* Whether node info should be kept */
+    int record_info;
+    /* info about each node parsed */
+    xmlParserNodeInfoSeq node_seq XML_DEPRECATED_MEMBER;
 
-    int     hasExternalSubset;        /* reference and external subset */
-    int             hasPErefs;        /* the internal subset has PE refs */
-    int              external;        /* unused */
+    /* error code */
+    int errNo;
 
-    int                 valid;        /* is the document valid */
-    int              validate;        /* shall we try to validate ? */
-    xmlValidCtxt        vctxt;        /* The validity context */
+    /* reference and external subset */
+    int hasExternalSubset XML_DEPRECATED_MEMBER;
+    /* the internal subset has PE refs */
+    int hasPErefs XML_DEPRECATED_MEMBER;
+    /* unused */
+    int external XML_DEPRECATED_MEMBER;
 
-    xmlParserInputState instate;      /* push parser state */
-    int                 token;        /* unused */
+    /* is the document valid */
+    int valid;
+    /* shall we try to validate ? */
+    int validate XML_DEPRECATED_MEMBER;
+    /* The validity context */
+    xmlValidCtxt vctxt;
 
-    char           *directory;        /* unused */
+    /* push parser state */
+    xmlParserInputState instate XML_DEPRECATED_MEMBER;
+    /* unused */
+    int token XML_DEPRECATED_MEMBER;
+
+    /* unused internally, still used downstream */
+    char *directory;
 
     /* Node name stack */
-    const xmlChar     *name;          /* Current parsed Node */
-    int                nameNr;        /* Depth of the parsing stack */
-    int                nameMax;       /* Max depth of the parsing stack */
-    const xmlChar *   *nameTab;       /* array of nodes */
 
-    long               nbChars;       /* unused */
-    long            checkIndex;       /* used by progressive parsing lookup */
-    int             keepBlanks;       /* ugly but ... */
-    int             disableSAX;       /* SAX callbacks are disabled */
-    int               inSubset;       /* Parsing is in int 1/ext 2 subset */
-    const xmlChar *    intSubName;    /* name of subset */
-    xmlChar *          extSubURI;     /* URI of external subset */
-    xmlChar *          extSubSystem;  /* SYSTEM ID of external subset */
+    /* Current parsed Node */
+    const xmlChar *name XML_DEPRECATED_MEMBER;
+    /* Depth of the parsing stack */
+    int nameNr XML_DEPRECATED_MEMBER;
+    /* Max depth of the parsing stack */
+    int nameMax XML_DEPRECATED_MEMBER;
+    /* array of nodes */
+    const xmlChar **nameTab XML_DEPRECATED_MEMBER;
+
+    /* unused */
+    long nbChars XML_DEPRECATED_MEMBER;
+    /* used by progressive parsing lookup */
+    long checkIndex XML_DEPRECATED_MEMBER;
+    /* ugly but ... */
+    int keepBlanks XML_DEPRECATED_MEMBER;
+    /* SAX callbacks are disabled */
+    int disableSAX XML_DEPRECATED_MEMBER;
+    /* Parsing is in int 1/ext 2 subset */
+    int inSubset;
+    /* name of subset */
+    const xmlChar *intSubName;
+    /* URI of external subset */
+    xmlChar *extSubURI;
+    /* SYSTEM ID of external subset */
+    xmlChar *extSubSystem;
 
     /* xml:space values */
-    int *              space;         /* Should the parser preserve spaces */
-    int                spaceNr;       /* Depth of the parsing stack */
-    int                spaceMax;      /* Max depth of the parsing stack */
-    int *              spaceTab;      /* array of space infos */
 
-    int                depth;         /* to prevent entity substitution loops */
-    xmlParserInputPtr  entity;        /* unused */
-    int                charset;       /* unused */
-    int                nodelen;       /* Those two fields are there to */
-    int                nodemem;       /* Speed up large node parsing */
-    int                pedantic;      /* signal pedantic warnings */
-    void              *_private;      /* For user data, libxml won't touch it */
+    /* Should the parser preserve spaces */
+    int *space XML_DEPRECATED_MEMBER;
+    /* Depth of the parsing stack */
+    int spaceNr XML_DEPRECATED_MEMBER;
+    /* Max depth of the parsing stack */
+    int spaceMax XML_DEPRECATED_MEMBER;
+    /* array of space infos */
+    int *spaceTab XML_DEPRECATED_MEMBER;
 
-    int                loadsubset;    /* should the external subset be loaded */
-    int                linenumbers;   /* set line number in element content */
-    void              *catalogs;      /* document's own catalog */
-    int                recovery;      /* run in recovery mode */
-    int                progressive;   /* unused */
-    xmlDictPtr         dict;          /* dictionary for the parser */
-    const xmlChar *   *atts;          /* array for the attributes callbacks */
-    int                maxatts;       /* the size of the array */
-    int                docdict;       /* unused */
+    /* to prevent entity substitution loops */
+    int depth XML_DEPRECATED_MEMBER;
+    /* unused */
+    xmlParserInputPtr entity XML_DEPRECATED_MEMBER;
+    /* unused */
+    int charset XML_DEPRECATED_MEMBER;
+    /* Those two fields are there to */
+    int nodelen XML_DEPRECATED_MEMBER;
+    /* Speed up large node parsing */
+    int nodemem XML_DEPRECATED_MEMBER;
+    /* signal pedantic warnings */
+    int pedantic XML_DEPRECATED_MEMBER;
+    /* For user data, libxml won't touch it */
+    void *_private;
+
+    /* should the external subset be loaded */
+    int loadsubset;
+    /* set line number in element content */
+    int linenumbers XML_DEPRECATED_MEMBER;
+    /* document's own catalog */
+    void *catalogs XML_DEPRECATED_MEMBER;
+    /* run in recovery mode */
+    int recovery XML_DEPRECATED_MEMBER;
+    /* unused */
+    int progressive XML_DEPRECATED_MEMBER;
+    /* dictionary for the parser */
+    xmlDictPtr dict;
+    /* array for the attributes callbacks */
+    const xmlChar **atts XML_DEPRECATED_MEMBER;
+    /* the size of the array */
+    int maxatts XML_DEPRECATED_MEMBER;
+    /* unused */
+    int docdict XML_DEPRECATED_MEMBER;
 
     /*
      * pre-interned strings
      */
-    const xmlChar *str_xml;
-    const xmlChar *str_xmlns;
-    const xmlChar *str_xml_ns;
+    const xmlChar *str_xml XML_DEPRECATED_MEMBER;
+    const xmlChar *str_xmlns XML_DEPRECATED_MEMBER;
+    const xmlChar *str_xml_ns XML_DEPRECATED_MEMBER;
 
     /*
      * Everything below is used only by the new SAX mode
      */
-    int                sax2;          /* operating in the new SAX mode */
-    int                nsNr;          /* the number of inherited namespaces */
-    int                nsMax;         /* the size of the arrays */
-    const xmlChar *   *nsTab;         /* the array of prefix/namespace name */
-    unsigned          *attallocs;     /* which attribute were allocated */
-    xmlStartTag       *pushTab;       /* array of data for push */
-    xmlHashTablePtr    attsDefault;   /* defaulted attributes if any */
-    xmlHashTablePtr    attsSpecial;   /* non-CDATA attributes if any */
-    int                nsWellFormed;  /* is the document XML Namespace okay */
-    int                options;       /* Extra options */
+
+    /* operating in the new SAX mode */
+    int sax2 XML_DEPRECATED_MEMBER;
+    /* the number of inherited namespaces */
+    int nsNr XML_DEPRECATED_MEMBER;
+    /* the size of the arrays */
+    int nsMax XML_DEPRECATED_MEMBER;
+    /* the array of prefix/namespace name */
+    const xmlChar **nsTab XML_DEPRECATED_MEMBER;
+    /* which attribute were allocated */
+    unsigned *attallocs XML_DEPRECATED_MEMBER;
+    /* array of data for push */
+    xmlStartTag *pushTab XML_DEPRECATED_MEMBER;
+    /* defaulted attributes if any */
+    xmlHashTablePtr attsDefault XML_DEPRECATED_MEMBER;
+    /* non-CDATA attributes if any */
+    xmlHashTablePtr attsSpecial XML_DEPRECATED_MEMBER;
+    /* is the document XML Namespace okay */
+    int nsWellFormed;
+    /* Extra options */
+    int options;
 
     /*
      * Those fields are needed only for streaming parsing so far
      */
-    int               dictNames;    /* Use dictionary names for the tree */
-    int               freeElemsNr;  /* number of freed element nodes */
-    xmlNodePtr        freeElems;    /* List of freed element nodes */
-    int               freeAttrsNr;  /* number of freed attributes nodes */
-    xmlAttrPtr        freeAttrs;    /* List of freed attributes nodes */
+
+    /* Use dictionary names for the tree */
+    int dictNames XML_DEPRECATED_MEMBER;
+    /* number of freed element nodes */
+    int freeElemsNr XML_DEPRECATED_MEMBER;
+    /* List of freed element nodes */
+    xmlNodePtr freeElems XML_DEPRECATED_MEMBER;
+    /* number of freed attributes nodes */
+    int freeAttrsNr XML_DEPRECATED_MEMBER;
+    /* List of freed attributes nodes */
+    xmlAttrPtr freeAttrs XML_DEPRECATED_MEMBER;
 
     /*
      * the complete error information for the last error.
      */
-    xmlError          lastError;
-    xmlParserMode     parseMode;    /* the parser mode */
-    unsigned long    nbentities;    /* unused */
-    unsigned long  sizeentities;    /* size of external entities */
+    xmlError lastError XML_DEPRECATED_MEMBER;
+    /* the parser mode */
+    xmlParserMode parseMode XML_DEPRECATED_MEMBER;
+    /* unused */
+    unsigned long nbentities XML_DEPRECATED_MEMBER;
+    /* size of external entities */
+    unsigned long sizeentities XML_DEPRECATED_MEMBER;
 
     /* for use by HTML non-recursive parser */
-    xmlParserNodeInfo *nodeInfo;      /* Current NodeInfo */
-    int                nodeInfoNr;    /* Depth of the parsing stack */
-    int                nodeInfoMax;   /* Max depth of the parsing stack */
-    xmlParserNodeInfo *nodeInfoTab;   /* array of nodeInfos */
+    /* Current NodeInfo */
+    xmlParserNodeInfo *nodeInfo XML_DEPRECATED_MEMBER;
+    /* Depth of the parsing stack */
+    int nodeInfoNr XML_DEPRECATED_MEMBER;
+    /* Max depth of the parsing stack */
+    int nodeInfoMax XML_DEPRECATED_MEMBER;
+    /* array of nodeInfos */
+    xmlParserNodeInfo *nodeInfoTab XML_DEPRECATED_MEMBER;
 
-    int                input_id;      /* we need to label inputs */
-    unsigned long      sizeentcopy;   /* volume of entity copy */
+    /* we need to label inputs */
+    int input_id XML_DEPRECATED_MEMBER;
+    /* volume of entity copy */
+    unsigned long sizeentcopy XML_DEPRECATED_MEMBER;
 
-    int           endCheckState;    /* quote state for push parser */
-    unsigned short     nbErrors;    /* number of errors */
-    unsigned short   nbWarnings;    /* number of warnings */
-    unsigned            maxAmpl;    /* maximum amplification factor */
+    /* quote state for push parser */
+    int endCheckState XML_DEPRECATED_MEMBER;
+    /* number of errors */
+    unsigned short nbErrors XML_DEPRECATED_MEMBER;
+    /* number of warnings */
+    unsigned short nbWarnings XML_DEPRECATED_MEMBER;
+    /* maximum amplification factor */
+    unsigned maxAmpl XML_DEPRECATED_MEMBER;
 
-    xmlParserNsData       *nsdb;    /* namespace database */
-    unsigned        attrHashMax;    /* allocated size */
-    xmlAttrHashBucket *attrHash;    /* atttribute hash table */
+    /* namespace database */
+    xmlParserNsData *nsdb XML_DEPRECATED_MEMBER;
+    /* allocated size */
+    unsigned attrHashMax XML_DEPRECATED_MEMBER;
+    /* atttribute hash table */
+    xmlAttrHashBucket *attrHash XML_DEPRECATED_MEMBER;
 
-    xmlStructuredErrorFunc errorHandler;
-    void *errorCtxt;
+    xmlStructuredErrorFunc errorHandler XML_DEPRECATED_MEMBER;
+    void *errorCtxt XML_DEPRECATED_MEMBER;
+
+    xmlResourceLoader resourceLoader XML_DEPRECATED_MEMBER;
+    void *resourceCtxt XML_DEPRECATED_MEMBER;
+
+    xmlCharEncConvImpl convImpl XML_DEPRECATED_MEMBER;
+    void *convCtxt XML_DEPRECATED_MEMBER;
 };
 
 /**
@@ -722,18 +889,23 @@
 
 
 struct _xmlSAXHandler {
-    internalSubsetSAXFunc internalSubset;
-    isStandaloneSAXFunc isStandalone;
-    hasInternalSubsetSAXFunc hasInternalSubset;
-    hasExternalSubsetSAXFunc hasExternalSubset;
-    resolveEntitySAXFunc resolveEntity;
-    getEntitySAXFunc getEntity;
-    entityDeclSAXFunc entityDecl;
-    notationDeclSAXFunc notationDecl;
-    attributeDeclSAXFunc attributeDecl;
-    elementDeclSAXFunc elementDecl;
-    unparsedEntityDeclSAXFunc unparsedEntityDecl;
-    setDocumentLocatorSAXFunc setDocumentLocator;
+    /*
+     * For DTD-related handlers, it's recommended to either use the
+     * original libxml2 handler or set them to NULL if DTDs can be
+     * ignored.
+     */
+    internalSubsetSAXFunc internalSubset; /* DTD */
+    isStandaloneSAXFunc isStandalone; /* unused */
+    hasInternalSubsetSAXFunc hasInternalSubset; /* DTD */
+    hasExternalSubsetSAXFunc hasExternalSubset; /* DTD */
+    resolveEntitySAXFunc resolveEntity; /* DTD */
+    getEntitySAXFunc getEntity; /* DTD */
+    entityDeclSAXFunc entityDecl; /* DTD */
+    notationDeclSAXFunc notationDecl; /* DTD */
+    attributeDeclSAXFunc attributeDecl; /* DTD */
+    elementDeclSAXFunc elementDecl; /* DTD */
+    unparsedEntityDeclSAXFunc unparsedEntityDecl; /* DTD */
+    setDocumentLocatorSAXFunc setDocumentLocator; /* deprecated */
     startDocumentSAXFunc startDocument;
     endDocumentSAXFunc endDocument;
     /*
@@ -753,15 +925,20 @@
     endElementSAXFunc endElement;
     referenceSAXFunc reference;
     charactersSAXFunc characters;
+    /*
+     * `ignorableWhitespace` should always be set to the same value
+     * as `characters`. Otherwise, the parser will try to detect
+     * whitespace which is unreliable.
+     */
     ignorableWhitespaceSAXFunc ignorableWhitespace;
     processingInstructionSAXFunc processingInstruction;
     commentSAXFunc comment;
     warningSAXFunc warning;
     errorSAXFunc error;
-    fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
-    getParameterEntitySAXFunc getParameterEntity;
+    fatalErrorSAXFunc fatalError; /* unused, `error` gets all the errors */
+    getParameterEntitySAXFunc getParameterEntity; /* DTD */
     cdataBlockSAXFunc cdataBlock;
-    externalSubsetSAXFunc externalSubset;
+    externalSubsetSAXFunc externalSubset; /* DTD */
     /*
      * `initialized` should always be set to XML_SAX2_MAGIC to enable the
      * modern SAX2 interface.
@@ -773,6 +950,10 @@
     void *_private;
     startElementNsSAX2Func startElementNs;
     endElementNsSAX2Func endElementNs;
+    /*
+     * Takes precedence over `error` or `warning`, but modern code
+     * should use xmlCtxtSetErrorHandler.
+     */
     xmlStructuredErrorFunc serror;
 };
 
@@ -832,10 +1013,8 @@
  */
 
 XMLPUBVAR const char *const xmlParserVersion;
-XML_DEPRECATED
-XMLPUBVAR const int oldXMLWDcompatibility;
-XML_DEPRECATED
-XMLPUBVAR const int xmlParserDebugEntities;
+
+/** DOC_DISABLE */
 XML_DEPRECATED
 XMLPUBVAR const xmlSAXLocator xmlDefaultSAXLocator;
 #ifdef LIBXML_SAX1_ENABLED
@@ -843,65 +1022,44 @@
 XMLPUBVAR const xmlSAXHandlerV1 xmlDefaultSAXHandler;
 #endif
 
-#ifdef LIBXML_THREAD_ENABLED
-/* backward compatibility */
-XMLPUBFUN const char *const *__xmlParserVersion(void);
 XML_DEPRECATED
-XMLPUBFUN const int *__oldXMLWDcompatibility(void);
+XMLPUBFUN int *__xmlDoValidityCheckingDefaultValue(void);
 XML_DEPRECATED
-XMLPUBFUN const int *__xmlParserDebugEntities(void);
+XMLPUBFUN int *__xmlGetWarningsDefaultValue(void);
 XML_DEPRECATED
-XMLPUBFUN const xmlSAXLocator *__xmlDefaultSAXLocator(void);
-#ifdef LIBXML_SAX1_ENABLED
+XMLPUBFUN int *__xmlKeepBlanksDefaultValue(void);
 XML_DEPRECATED
-XMLPUBFUN const xmlSAXHandlerV1 *__xmlDefaultSAXHandler(void);
-#endif
-#endif
-
-/** DOC_DISABLE */
-#define XML_GLOBALS_PARSER_CORE \
-  XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \
-  XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \
-  XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \
-  XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \
-  XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
-  XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
-  XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED)
+XMLPUBFUN int *__xmlLineNumbersDefaultValue(void);
+XML_DEPRECATED
+XMLPUBFUN int *__xmlLoadExtDtdDefaultValue(void);
+XML_DEPRECATED
+XMLPUBFUN int *__xmlPedanticParserDefaultValue(void);
+XML_DEPRECATED
+XMLPUBFUN int *__xmlSubstituteEntitiesDefaultValue(void);
 
 #ifdef LIBXML_OUTPUT_ENABLED
-  #define XML_GLOBALS_PARSER_OUTPUT \
-    XML_OP(xmlIndentTreeOutput, int, XML_NO_ATTR) \
-    XML_OP(xmlTreeIndentString, const char *, XML_NO_ATTR) \
-    XML_OP(xmlSaveNoEmptyTags, int, XML_NO_ATTR)
-#else
-  #define XML_GLOBALS_PARSER_OUTPUT
+XMLPUBFUN int *__xmlIndentTreeOutput(void);
+XMLPUBFUN const char **__xmlTreeIndentString(void);
+XMLPUBFUN int *__xmlSaveNoEmptyTags(void);
 #endif
 
-#define XML_GLOBALS_PARSER \
-  XML_GLOBALS_PARSER_CORE \
-  XML_GLOBALS_PARSER_OUTPUT
-
-#define XML_OP XML_DECLARE_GLOBAL
-XML_GLOBALS_PARSER
-#undef XML_OP
-
-#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
+#ifndef XML_GLOBALS_NO_REDEFINITION
   #define xmlDoValidityCheckingDefaultValue \
-    XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue)
+    (*__xmlDoValidityCheckingDefaultValue())
   #define xmlGetWarningsDefaultValue \
-    XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue)
-  #define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue)
+    (*__xmlGetWarningsDefaultValue())
+  #define xmlKeepBlanksDefaultValue (*__xmlKeepBlanksDefaultValue())
   #define xmlLineNumbersDefaultValue \
-    XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue)
-  #define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue)
+    (*__xmlLineNumbersDefaultValue())
+  #define xmlLoadExtDtdDefaultValue (*__xmlLoadExtDtdDefaultValue())
   #define xmlPedanticParserDefaultValue \
-    XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
+    (*__xmlPedanticParserDefaultValue())
   #define xmlSubstituteEntitiesDefaultValue \
-    XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
+    (*__xmlSubstituteEntitiesDefaultValue())
   #ifdef LIBXML_OUTPUT_ENABLED
-    #define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
-    #define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
-    #define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
+    #define xmlIndentTreeOutput (*__xmlIndentTreeOutput())
+    #define xmlTreeIndentString (*__xmlTreeIndentString())
+    #define xmlSaveNoEmptyTags (*__xmlSaveNoEmptyTags())
   #endif
 #endif
 /** DOC_ENABLE */
@@ -927,7 +1085,6 @@
 XMLPUBFUN int
 		xmlParserInputRead	(xmlParserInputPtr in,
 					 int len);
-XML_DEPRECATED
 XMLPUBFUN int
 		xmlParserInputGrow	(xmlParserInputPtr in,
 					 int len);
@@ -944,32 +1101,40 @@
 		xmlParseMemory		(const char *buffer,
 					 int size);
 #endif /* LIBXML_SAX1_ENABLED */
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
 		xmlSubstituteEntitiesDefault(int val);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
                 xmlThrDefSubstituteEntitiesDefaultValue(int v);
 XMLPUBFUN int
 		xmlKeepBlanksDefault	(int val);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
 		xmlThrDefKeepBlanksDefaultValue(int v);
 XMLPUBFUN void
 		xmlStopParser		(xmlParserCtxtPtr ctxt);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
 		xmlPedanticParserDefault(int val);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
                 xmlThrDefPedanticParserDefaultValue(int v);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
 		xmlLineNumbersDefault	(int val);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
                 xmlThrDefLineNumbersDefaultValue(int v);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
                 xmlThrDefDoValidityCheckingDefaultValue(int v);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
                 xmlThrDefGetWarningsDefaultValue(int v);
-XML_DEPRECATED XMLPUBFUN int
+XML_DEPRECATED
+XMLPUBFUN int
                 xmlThrDefLoadExtDtdDefaultValue(int v);
-XML_DEPRECATED XMLPUBFUN int
-                xmlThrDefParserDebugEntities(int v);
 
 #ifdef LIBXML_SAX1_ENABLED
 /*
@@ -992,6 +1157,7 @@
  */
 XMLPUBFUN int
 		xmlParseDocument	(xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
 XMLPUBFUN int
 		xmlParseExtParsedEnt	(xmlParserCtxtPtr ctxt);
 #ifdef LIBXML_SAX1_ENABLED
@@ -1045,6 +1211,18 @@
 #endif /* LIBXML_SAX1_ENABLED */
 
 #ifdef LIBXML_VALID_ENABLED
+XMLPUBFUN xmlDtdPtr
+		xmlCtxtParseDtd		(xmlParserCtxtPtr ctxt,
+					 xmlParserInputPtr input,
+					 const xmlChar *ExternalID,
+					 const xmlChar *SystemID);
+XMLPUBFUN int
+		xmlCtxtValidateDocument	(xmlParserCtxtPtr ctxt,
+					 xmlDocPtr doc);
+XMLPUBFUN int
+		xmlCtxtValidateDtd	(xmlParserCtxtPtr ctxt,
+					 xmlDocPtr doc,
+					 xmlDtdPtr dtd);
 XML_DEPRECATED
 XMLPUBFUN xmlDtdPtr
 		xmlSAXParseDTD		(xmlSAXHandlerPtr sax,
@@ -1122,26 +1300,6 @@
 XMLPUBFUN xmlParserCtxtPtr
 		xmlCreateDocParserCtxt	(const xmlChar *cur);
 
-#ifdef LIBXML_LEGACY_ENABLED
-/*
- * Reading/setting optional parsing features.
- */
-XML_DEPRECATED
-XMLPUBFUN int
-		xmlGetFeaturesList	(int *len,
-					 const char **result);
-XML_DEPRECATED
-XMLPUBFUN int
-		xmlGetFeature		(xmlParserCtxtPtr ctxt,
-					 const char *name,
-					 void *result);
-XML_DEPRECATED
-XMLPUBFUN int
-		xmlSetFeature		(xmlParserCtxtPtr ctxt,
-					 const char *name,
-					 void *value);
-#endif /* LIBXML_LEGACY_ENABLED */
-
 #ifdef LIBXML_PUSH_ENABLED
 /*
  * Interfaces for the Push mode.
@@ -1179,16 +1337,21 @@
 /*
  * Node infos.
  */
+XML_DEPRECATED
 XMLPUBFUN const xmlParserNodeInfo*
 		xmlParserFindNodeInfo	(xmlParserCtxtPtr ctxt,
 				         xmlNodePtr node);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlInitNodeInfoSeq	(xmlParserNodeInfoSeqPtr seq);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlClearNodeInfoSeq	(xmlParserNodeInfoSeqPtr seq);
+XML_DEPRECATED
 XMLPUBFUN unsigned long
 		xmlParserFindNodeInfoIndex(xmlParserNodeInfoSeqPtr seq,
                                          xmlNodePtr node);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlParserAddNodeInfo	(xmlParserCtxtPtr ctxt,
 					 xmlParserNodeInfoPtr info);
@@ -1206,9 +1369,7 @@
 					 const char *ID,
 					 xmlParserCtxtPtr ctxt);
 
-/*
- * Index lookup, actually implemented in the encoding module
- */
+XML_DEPRECATED
 XMLPUBFUN long
 		xmlByteConsumed		(xmlParserCtxtPtr ctxt);
 
@@ -1247,7 +1408,12 @@
     XML_PARSE_OLDSAX    = 1<<20,/* parse using SAX2 interface before 2.7.0 */
     XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
     XML_PARSE_BIG_LINES = 1<<22,/* Store big lines numbers in text PSVI field */
-    XML_PARSE_NO_XXE    = 1<<23 /* disable loading of external content */
+    /* since 2.13.0 */
+    XML_PARSE_NO_XXE    = 1<<23,/* disable loading of external content */
+    /* since 2.14.0 */
+    XML_PARSE_UNZIP          = 1<<24,/* allow compressed content */
+    XML_PARSE_NO_SYS_CATALOG = 1<<25,/* disable global system catalog */
+    XML_PARSE_CATALOG_PI     = 1<<26 /* allow catalog PIs */
 } xmlParserOption;
 
 XMLPUBFUN void
@@ -1259,16 +1425,62 @@
 					 const char *filename,
 					 const char *encoding);
 XMLPUBFUN int
+		xmlCtxtGetOptions	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN int
 		xmlCtxtSetOptions	(xmlParserCtxtPtr ctxt,
 					 int options);
 XMLPUBFUN int
 		xmlCtxtUseOptions	(xmlParserCtxtPtr ctxt,
 					 int options);
+XMLPUBFUN void *
+		xmlCtxtGetPrivate	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN void
+		xmlCtxtSetPrivate	(xmlParserCtxtPtr ctxt,
+					 void *priv);
+XMLPUBFUN void *
+		xmlCtxtGetCatalogs	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN void
+		xmlCtxtSetCatalogs	(xmlParserCtxtPtr ctxt,
+					 void *catalogs);
+XMLPUBFUN xmlDictPtr
+		xmlCtxtGetDict		(xmlParserCtxtPtr ctxt);
+XMLPUBFUN void
+		xmlCtxtSetDict		(xmlParserCtxtPtr ctxt,
+					 xmlDictPtr);
+XMLPUBFUN xmlSAXHandler *
+		xmlCtxtGetSaxHandler	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN int
+		xmlCtxtSetSaxHandler	(xmlParserCtxtPtr ctxt,
+					 const xmlSAXHandler *sax);
+XMLPUBFUN xmlDocPtr
+		xmlCtxtGetDocument	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN int
+		xmlCtxtIsHtml		(xmlParserCtxtPtr ctxt);
+XMLPUBFUN int
+		xmlCtxtIsStopped	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlValidCtxtPtr
+		xmlCtxtGetValidCtxt	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar *
+		xmlCtxtGetVersion	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN const xmlChar *
+		xmlCtxtGetDeclaredEncoding(xmlParserCtxtPtr ctxt);
+XMLPUBFUN int
+		xmlCtxtGetStandalone	(xmlParserCtxtPtr ctxt);
+XMLPUBFUN xmlParserStatus
+		xmlCtxtGetStatus	(xmlParserCtxtPtr ctxt);
 XMLPUBFUN void
 		xmlCtxtSetErrorHandler	(xmlParserCtxtPtr ctxt,
 					 xmlStructuredErrorFunc handler,
 					 void *data);
 XMLPUBFUN void
+		xmlCtxtSetResourceLoader(xmlParserCtxtPtr ctxt,
+					 xmlResourceLoader loader,
+					 void *vctxt);
+XMLPUBFUN void
+		xmlCtxtSetCharEncConvImpl(xmlParserCtxtPtr ctxt,
+					 xmlCharEncConvImpl impl,
+					 void *vctxt);
+XMLPUBFUN void
 		xmlCtxtSetMaxAmplification(xmlParserCtxtPtr ctxt,
 					 unsigned maxAmpl);
 XMLPUBFUN xmlDocPtr
@@ -1301,6 +1513,11 @@
 XMLPUBFUN xmlDocPtr
 		xmlCtxtParseDocument	(xmlParserCtxtPtr ctxt,
 					 xmlParserInputPtr input);
+XMLPUBFUN xmlNodePtr
+		xmlCtxtParseContent	(xmlParserCtxtPtr ctxt,
+					 xmlParserInputPtr input,
+					 xmlNodePtr node,
+					 int hasTextDecl);
 XMLPUBFUN xmlDocPtr
 		xmlCtxtReadDoc		(xmlParserCtxtPtr ctxt,
 					 const xmlChar *cur,
@@ -1334,6 +1551,29 @@
 					 const char *encoding,
 					 int options);
 
+/**
+ * New input API
+ */
+
+XMLPUBFUN xmlParserErrors
+xmlNewInputFromUrl(const char *url, xmlParserInputFlags flags,
+                   xmlParserInputPtr *out);
+XMLPUBFUN xmlParserInputPtr
+xmlNewInputFromMemory(const char *url, const void *mem, size_t size,
+                      xmlParserInputFlags flags);
+XMLPUBFUN xmlParserInputPtr
+xmlNewInputFromString(const char *url, const char *str,
+                      xmlParserInputFlags flags);
+XMLPUBFUN xmlParserInputPtr
+xmlNewInputFromFd(const char *url, int fd, xmlParserInputFlags flags);
+XMLPUBFUN xmlParserInputPtr
+xmlNewInputFromIO(const char *url, xmlInputReadCallback ioRead,
+                  xmlInputCloseCallback ioClose, void *ioCtxt,
+                  xmlParserInputFlags flags);
+XMLPUBFUN xmlParserErrors
+xmlInputSetEncodingHandler(xmlParserInputPtr input,
+                           xmlCharEncodingHandlerPtr handler);
+
 /*
  * Library wide options
  */
@@ -1378,6 +1618,7 @@
     XML_WITH_ZLIB = 31,
     XML_WITH_ICU = 32,
     XML_WITH_LZMA = 33,
+    XML_WITH_RELAXNG = 34, /* since 2.14.0 */
     XML_WITH_NONE = 99999 /* just to be sure of allocation size */
 } xmlFeature;
 
diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h
index c4d4363..3d259fc 100644
--- a/include/libxml/parserInternals.h
+++ b/include/libxml/parserInternals.h
@@ -22,17 +22,12 @@
 extern "C" {
 #endif
 
-/**
- * xmlParserMaxDepth:
- *
- * DEPRECATED: has no effect
- *
- * arbitrary depth limit for the XML documents that we allow to
- * process. This is not a limitation of the parser but a safety
- * boundary feature, use XML_PARSE_HUGE option to override it.
+/*
+ * Backward compatibility
  */
-XML_DEPRECATED
-XMLPUBVAR const unsigned int xmlParserMaxDepth;
+#define inputPush xmlCtxtPushInput
+#define inputPop xmlCtxtPopInput
+#define xmlParserMaxDepth 256
 
 /**
  * XML_MAX_TEXT_LENGTH:
@@ -71,7 +66,7 @@
  * use XML_PARSE_HUGE option to override it.
  * Introduced in 2.9.0
  */
-#define XML_MAX_DICTIONARY_LIMIT 10000000
+#define XML_MAX_DICTIONARY_LIMIT 100000000
 
 /**
  * XML_MAX_LOOKUP_LIMIT:
@@ -91,14 +86,6 @@
  */
 #define XML_MAX_NAMELEN 100
 
-/**
- * INPUT_CHUNK:
- *
- * The parser tries to always have that amount of input ready.
- * One of the point is providing context when reporting errors.
- */
-#define INPUT_CHUNK	250
-
 /************************************************************************
  *									*
  * UNICODE version of the macros.					*
@@ -258,8 +245,8 @@
  * Macro to check [a-zA-Z]
  *
  */
-#define IS_ASCII_LETTER(c)	(((0x41 <= (c)) && ((c) <= 0x5a)) || \
-				 ((0x61 <= (c)) && ((c) <= 0x7a)))
+#define IS_ASCII_LETTER(c)	((0x61 <= ((c) | 0x20)) && \
+                                 (((c) | 0x20) <= 0x7a))
 
 /**
  * IS_ASCII_DIGIT:
@@ -294,11 +281,10 @@
  */
 XMLPUBVAR const xmlChar xmlStringText[];
 XMLPUBVAR const xmlChar xmlStringTextNoenc[];
+XML_DEPRECATED
 XMLPUBVAR const xmlChar xmlStringComment[];
 
-/*
- * Function to finish the work of the macros where needed.
- */
+XML_DEPRECATED
 XMLPUBFUN int                   xmlIsLetter     (int c);
 
 /**
@@ -312,6 +298,7 @@
 XMLPUBFUN xmlParserCtxtPtr
 			xmlCreateMemoryParserCtxt(const char *buffer,
 						 int size);
+XML_DEPRECATED
 XMLPUBFUN xmlParserCtxtPtr
 			xmlCreateEntityParserCtxt(const xmlChar *URL,
 						 const xmlChar *ID,
@@ -344,8 +331,15 @@
 			xmlNewEntityInputStream	(xmlParserCtxtPtr ctxt,
 						 xmlEntityPtr entity);
 XMLPUBFUN int
+			xmlCtxtPushInput	(xmlParserCtxtPtr ctxt,
+						 xmlParserInputPtr input);
+XMLPUBFUN xmlParserInputPtr
+			xmlCtxtPopInput		(xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
+XMLPUBFUN int
 			xmlPushInput		(xmlParserCtxtPtr ctxt,
 						 xmlParserInputPtr input);
+XML_DEPRECATED
 XMLPUBFUN xmlChar
 			xmlPopInput		(xmlParserCtxtPtr ctxt);
 XMLPUBFUN void
@@ -511,6 +505,7 @@
 XML_DEPRECATED
 XMLPUBFUN void
 			xmlParseMisc		(xmlParserCtxtPtr ctxt);
+XML_DEPRECATED
 XMLPUBFUN void
 			xmlParseExternalSubset	(xmlParserCtxtPtr ctxt,
 						 const xmlChar *ExternalID,
@@ -559,23 +554,6 @@
 						 xmlChar end3);
 
 /*
- * 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
@@ -595,8 +573,10 @@
 XML_DEPRECATED
 XMLPUBFUN int			xmlCurrentChar		(xmlParserCtxtPtr ctxt,
 						 int *len);
+XML_DEPRECATED
 XMLPUBFUN int		xmlCopyCharMultiByte	(xmlChar *out,
 						 int val);
+XML_DEPRECATED
 XMLPUBFUN int			xmlCopyChar		(int len,
 						 xmlChar *out,
 						 int val);
@@ -605,66 +585,6 @@
 XML_DEPRECATED
 XMLPUBFUN void			xmlParserInputShrink	(xmlParserInputPtr in);
 
-/*
- * Specific function to keep track of entities references
- * and used by the XSLT debugger.
- */
-#ifdef LIBXML_LEGACY_ENABLED
-/**
- * xmlEntityReferenceFunc:
- * @ent: the entity
- * @firstNode:  the fist node in the chunk
- * @lastNode:  the last nod in the chunk
- *
- * Callback function used when one needs to be able to track back the
- * provenance of a chunk of nodes inherited from an entity replacement.
- */
-typedef	void	(*xmlEntityReferenceFunc)	(xmlEntityPtr ent,
-						 xmlNodePtr firstNode,
-						 xmlNodePtr lastNode);
-
-XML_DEPRECATED
-XMLPUBFUN void		xmlSetEntityReferenceFunc	(xmlEntityReferenceFunc func);
-
-XML_DEPRECATED
-XMLPUBFUN xmlChar *
-			xmlParseQuotedString	(xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN void
-                        xmlParseNamespace       (xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN xmlChar *
-			xmlNamespaceParseNSDef	(xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN xmlChar *
-			xmlScanName		(xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN xmlChar *
-			xmlNamespaceParseNCName	(xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN void	xmlParserHandleReference(xmlParserCtxtPtr ctxt);
-XML_DEPRECATED
-XMLPUBFUN xmlChar *
-			xmlNamespaceParseQName	(xmlParserCtxtPtr ctxt,
-						 xmlChar **prefix);
-/**
- * Entities
- */
-XML_DEPRECATED
-XMLPUBFUN xmlChar *
-		xmlDecodeEntities		(xmlParserCtxtPtr ctxt,
-						 int len,
-						 int what,
-						 xmlChar end,
-						 xmlChar  end2,
-						 xmlChar end3);
-XML_DEPRECATED
-XMLPUBFUN void
-			xmlHandleEntity		(xmlParserCtxtPtr ctxt,
-						 xmlEntityPtr entity);
-
-#endif /* LIBXML_LEGACY_ENABLED */
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h
index 079b7f1..e9cb1ec 100644
--- a/include/libxml/relaxng.h
+++ b/include/libxml/relaxng.h
@@ -14,8 +14,9 @@
 #include <libxml/xmlerror.h>
 #include <libxml/xmlstring.h>
 #include <libxml/tree.h>
+#include <libxml/parser.h>
 
-#ifdef LIBXML_SCHEMAS_ENABLED
+#ifdef LIBXML_RELAXNG_ENABLED
 
 #ifdef __cplusplus
 extern "C" {
@@ -155,6 +156,10 @@
 					 xmlRelaxNGParserCtxtPtr ctxt,
 					 xmlStructuredErrorFunc serror,
 					 void *ctx);
+XMLPUBFUN void
+		    xmlRelaxNGSetResourceLoader	(xmlRelaxNGParserCtxtPtr ctxt,
+						 xmlResourceLoader loader,
+						 void *vctxt);
 XMLPUBFUN xmlRelaxNGPtr
 		    xmlRelaxNGParse		(xmlRelaxNGParserCtxtPtr ctxt);
 XMLPUBFUN void
@@ -214,6 +219,6 @@
 }
 #endif
 
-#endif /* LIBXML_SCHEMAS_ENABLED */
+#endif /* LIBXML_RELAXNG_ENABLED */
 
 #endif /* __XML_RELAX_NG__ */
diff --git a/include/libxml/threads.h b/include/libxml/threads.h
index 8f4b6e1..ec2b16b 100644
--- a/include/libxml/threads.h
+++ b/include/libxml/threads.h
@@ -61,12 +61,6 @@
 XMLPUBFUN void
 			xmlUnlockLibrary(void);
 XML_DEPRECATED
-XMLPUBFUN int
-			xmlGetThreadId	(void);
-XML_DEPRECATED
-XMLPUBFUN int
-			xmlIsMainThread	(void);
-XML_DEPRECATED
 XMLPUBFUN void
 			xmlCleanupThreads(void);
 
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 4070375..e5a8fb7 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -33,6 +33,12 @@
 #endif
 
 /*
+ * Backward compatibility
+ */
+#define xmlBufferAllocScheme XML_BUFFER_ALLOC_EXACT
+#define xmlDefaultBufferSize 4096
+
+/*
  * Some of the basic types pointer to structures:
  */
 /* xmlIO.h */
@@ -60,13 +66,6 @@
 typedef xmlEntity *xmlEntityPtr;
 
 /**
- * BASE_BUFFER_SIZE:
- *
- * default buffer size 4000.
- */
-#define BASE_BUFFER_SIZE 4096
-
-/**
  * LIBXML_NAMESPACE_DICT:
  *
  * Defines experimental behaviour:
@@ -100,11 +99,16 @@
 typedef struct _xmlBuffer xmlBuffer;
 typedef xmlBuffer *xmlBufferPtr;
 struct _xmlBuffer {
-    xmlChar *content;		/* The buffer content UTF8 */
-    unsigned int use;		/* The buffer size used */
-    unsigned int size;		/* The buffer size */
-    xmlBufferAllocationScheme alloc; /* The realloc method */
-    xmlChar *contentIO;		/* in IO mode we may have a different base */
+    /* The buffer content UTF8 */
+    xmlChar *content XML_DEPRECATED_MEMBER;
+    /* The buffer size used */
+    unsigned int use XML_DEPRECATED_MEMBER;
+    /* The buffer size */
+    unsigned int size XML_DEPRECATED_MEMBER;
+    /* The realloc method */
+    xmlBufferAllocationScheme alloc XML_DEPRECATED_MEMBER;
+    /* in IO mode we may have a different base */
+    xmlChar *contentIO XML_DEPRECATED_MEMBER;
 };
 
 /**
@@ -674,24 +678,16 @@
  */
 
 /** DOC_DISABLE */
-#define XML_GLOBALS_TREE \
-  XML_OP(xmlBufferAllocScheme, xmlBufferAllocationScheme, XML_DEPRECATED) \
-  XML_OP(xmlDefaultBufferSize, int, XML_DEPRECATED) \
-  XML_OP(xmlRegisterNodeDefaultValue, xmlRegisterNodeFunc, XML_DEPRECATED) \
-  XML_OP(xmlDeregisterNodeDefaultValue, xmlDeregisterNodeFunc, \
-         XML_DEPRECATED)
+XML_DEPRECATED
+XMLPUBFUN xmlRegisterNodeFunc *__xmlRegisterNodeDefaultValue(void);
+XML_DEPRECATED
+XMLPUBFUN xmlDeregisterNodeFunc *__xmlDeregisterNodeDefaultValue(void);
 
-#define XML_OP XML_DECLARE_GLOBAL
-XML_GLOBALS_TREE
-#undef XML_OP
-
-#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
-  #define xmlBufferAllocScheme XML_GLOBAL_MACRO(xmlBufferAllocScheme)
-  #define xmlDefaultBufferSize XML_GLOBAL_MACRO(xmlDefaultBufferSize)
+#ifndef XML_GLOBALS_NO_REDEFINITION
   #define xmlRegisterNodeDefaultValue \
-    XML_GLOBAL_MACRO(xmlRegisterNodeDefaultValue)
+    (*__xmlRegisterNodeDefaultValue())
   #define xmlDeregisterNodeDefaultValue \
-    XML_GLOBAL_MACRO(xmlDeregisterNodeDefaultValue)
+    (*__xmlDeregisterNodeDefaultValue())
 #endif
 /** DOC_ENABLE */
 
@@ -702,7 +698,6 @@
 		xmlValidateNCName	(const xmlChar *value,
 					 int space);
 
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 XMLPUBFUN int
 		xmlValidateQName	(const xmlChar *value,
 					 int space);
@@ -712,7 +707,6 @@
 XMLPUBFUN int
 		xmlValidateNMToken	(const xmlChar *value,
 					 int space);
-#endif
 
 XMLPUBFUN xmlChar *
 		xmlBuildQName		(const xmlChar *ncname,
@@ -730,8 +724,10 @@
  * Handling Buffers, the old ones see @xmlBuf for the new ones.
  */
 
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
+XML_DEPRECATED
 XMLPUBFUN xmlBufferAllocationScheme
 		xmlGetBufferAllocationScheme(void);
 
@@ -742,6 +738,7 @@
 XMLPUBFUN xmlBufferPtr
 		xmlBufferCreateStatic	(void *mem,
 					 size_t size);
+XML_DEPRECATED
 XMLPUBFUN int
 		xmlBufferResize		(xmlBufferPtr buf,
 					 unsigned int size);
@@ -764,9 +761,11 @@
 XMLPUBFUN int
 		xmlBufferCCat		(xmlBufferPtr buf,
 					 const char *str);
+XML_DEPRECATED
 XMLPUBFUN int
 		xmlBufferShrink		(xmlBufferPtr buf,
 					 unsigned int len);
+XML_DEPRECATED
 XMLPUBFUN int
 		xmlBufferGrow		(xmlBufferPtr buf,
 					 unsigned int len);
@@ -799,13 +798,6 @@
 		xmlGetIntSubset		(const xmlDoc *doc);
 XMLPUBFUN void
 		xmlFreeDtd		(xmlDtdPtr cur);
-#ifdef LIBXML_LEGACY_ENABLED
-XML_DEPRECATED
-XMLPUBFUN xmlNsPtr
-		xmlNewGlobalNs		(xmlDocPtr doc,
-					 const xmlChar *href,
-					 const xmlChar *prefix);
-#endif /* LIBXML_LEGACY_ENABLED */
 XMLPUBFUN xmlNsPtr
 		xmlNewNs		(xmlNodePtr node,
 					 const xmlChar *href,
@@ -822,13 +814,10 @@
 		xmlNewDocProp		(xmlDocPtr doc,
 					 const xmlChar *name,
 					 const xmlChar *value);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
-    defined(LIBXML_SCHEMAS_ENABLED)
 XMLPUBFUN xmlAttrPtr
 		xmlNewProp		(xmlNodePtr node,
 					 const xmlChar *name,
 					 const xmlChar *value);
-#endif
 XMLPUBFUN xmlAttrPtr
 		xmlNewNsProp		(xmlNodePtr node,
 					 xmlNsPtr ns,
@@ -849,15 +838,11 @@
 XMLPUBFUN xmlAttrPtr
 		xmlCopyPropList		(xmlNodePtr target,
 					 xmlAttrPtr cur);
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN xmlDtdPtr
 		xmlCopyDtd		(xmlDtdPtr dtd);
-#endif /* LIBXML_TREE_ENABLED */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 XMLPUBFUN xmlDocPtr
 		xmlCopyDoc		(xmlDocPtr doc,
 					 int recursive);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
 /*
  * Creating new nodes.
  */
@@ -877,13 +862,11 @@
 XMLPUBFUN xmlNodePtr
 		xmlNewNodeEatName	(xmlNsPtr ns,
 					 xmlChar *name);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 XMLPUBFUN xmlNodePtr
 		xmlNewChild		(xmlNodePtr parent,
 					 xmlNsPtr ns,
 					 const xmlChar *name,
 					 const xmlChar *content);
-#endif
 XMLPUBFUN xmlNodePtr
 		xmlNewDocText		(const xmlDoc *doc,
 					 const xmlChar *content);
@@ -930,7 +913,6 @@
 					 xmlNodePtr node);
 XMLPUBFUN xmlNodePtr
 		xmlCopyNodeList		(xmlNodePtr node);
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN xmlNodePtr
 		xmlNewTextChild		(xmlNodePtr parent,
 					 xmlNsPtr ns,
@@ -943,17 +925,14 @@
 					 const xmlChar *content);
 XMLPUBFUN xmlNodePtr
 		xmlNewDocFragment	(xmlDocPtr doc);
-#endif /* LIBXML_TREE_ENABLED */
 
 /*
  * Navigating.
  */
 XMLPUBFUN long
 		xmlGetLineNo		(const xmlNode *node);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
 XMLPUBFUN xmlChar *
 		xmlGetNodePath		(const xmlNode *node);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
 XMLPUBFUN xmlNodePtr
 		xmlDocGetRootElement	(const xmlDoc *doc);
 XMLPUBFUN xmlNodePtr
@@ -966,33 +945,24 @@
 /*
  * Changing the structure.
  */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
 XMLPUBFUN xmlNodePtr
 		xmlDocSetRootElement	(xmlDocPtr doc,
 					 xmlNodePtr root);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN void
 		xmlNodeSetName		(xmlNodePtr cur,
 					 const xmlChar *name);
-#endif /* LIBXML_TREE_ENABLED */
 XMLPUBFUN xmlNodePtr
 		xmlAddChild		(xmlNodePtr parent,
 					 xmlNodePtr cur);
 XMLPUBFUN xmlNodePtr
 		xmlAddChildList		(xmlNodePtr parent,
 					 xmlNodePtr cur);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
 XMLPUBFUN xmlNodePtr
 		xmlReplaceNode		(xmlNodePtr old,
 					 xmlNodePtr cur);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
-    defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
 XMLPUBFUN xmlNodePtr
 		xmlAddPrevSibling	(xmlNodePtr cur,
 					 xmlNodePtr elem);
-#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
 XMLPUBFUN xmlNodePtr
 		xmlAddSibling		(xmlNodePtr cur,
 					 xmlNodePtr elem);
@@ -1029,8 +999,6 @@
 		xmlSearchNsByHref	(xmlDocPtr doc,
 					 xmlNodePtr node,
 					 const xmlChar *href);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
-    defined(LIBXML_SCHEMAS_ENABLED)
 XMLPUBFUN int
 		xmlGetNsListSafe	(const xmlDoc *doc,
 					 const xmlNode *node,
@@ -1038,7 +1006,6 @@
 XMLPUBFUN xmlNsPtr *
 		xmlGetNsList		(const xmlDoc *doc,
 					 const xmlNode *node);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
 
 XMLPUBFUN void
 		xmlSetNs		(xmlNodePtr node,
@@ -1051,8 +1018,6 @@
 /*
  * Changing the content.
  */
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
-    defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
 XMLPUBFUN xmlAttrPtr
 		xmlSetProp		(xmlNodePtr node,
 					 const xmlChar *name,
@@ -1062,8 +1027,6 @@
 					 xmlNsPtr ns,
 					 const xmlChar *name,
 					 const xmlChar *value);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
-	  defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
 XMLPUBFUN int
 		xmlNodeGetAttrValue	(const xmlNode *node,
 					 const xmlChar *name,
@@ -1097,21 +1060,17 @@
 		xmlNodeListGetString	(xmlDocPtr doc,
 					 const xmlNode *list,
 					 int inLine);
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN xmlChar *
 		xmlNodeListGetRawString	(const xmlDoc *doc,
 					 const xmlNode *list,
 					 int inLine);
-#endif /* LIBXML_TREE_ENABLED */
 XMLPUBFUN int
 		xmlNodeSetContent	(xmlNodePtr cur,
 					 const xmlChar *content);
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN int
 		xmlNodeSetContentLen	(xmlNodePtr cur,
 					 const xmlChar *content,
 					 int len);
-#endif /* LIBXML_TREE_ENABLED */
 XMLPUBFUN int
 		xmlNodeAddContent	(xmlNodePtr cur,
 					 const xmlChar *content);
@@ -1133,14 +1092,12 @@
 		xmlNodeGetLang		(const xmlNode *cur);
 XMLPUBFUN int
 		xmlNodeGetSpacePreserve	(const xmlNode *cur);
-#ifdef LIBXML_TREE_ENABLED
 XMLPUBFUN int
 		xmlNodeSetLang		(xmlNodePtr cur,
 					 const xmlChar *lang);
 XMLPUBFUN int
 		xmlNodeSetSpacePreserve (xmlNodePtr cur,
 					 int val);
-#endif /* LIBXML_TREE_ENABLED */
 XMLPUBFUN int
 		xmlNodeGetBaseSafe	(const xmlDoc *doc,
 					 const xmlNode *cur,
@@ -1148,18 +1105,15 @@
 XMLPUBFUN xmlChar *
 		xmlNodeGetBase		(const xmlDoc *doc,
 					 const xmlNode *cur);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
 XMLPUBFUN int
 		xmlNodeSetBase		(xmlNodePtr cur,
 					 const xmlChar *uri);
-#endif
 
 /*
  * Removing content.
  */
 XMLPUBFUN int
 		xmlRemoveProp		(xmlAttrPtr cur);
-#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 XMLPUBFUN int
 		xmlUnsetNsProp		(xmlNodePtr node,
 					 xmlNsPtr ns,
@@ -1167,7 +1121,6 @@
 XMLPUBFUN int
 		xmlUnsetProp		(xmlNodePtr node,
 					 const xmlChar *name);
-#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
 
 /*
  * Internal, don't use.
@@ -1189,14 +1142,12 @@
 					 const xmlChar *string);
 #endif /* LIBXML_OUTPUT_ENABLED */
 
-#ifdef LIBXML_TREE_ENABLED
 /*
  * Namespace handling.
  */
 XMLPUBFUN int
 		xmlReconciliateNs	(xmlDocPtr doc,
 					 xmlNodePtr tree);
-#endif
 
 #ifdef LIBXML_OUTPUT_ENABLED
 /*
@@ -1337,7 +1288,6 @@
 					 int deep,
 					 int options);
 
-#ifdef LIBXML_TREE_ENABLED
 /*
  * 5 interfaces from DOM ElementTraversal, but different in entities
  * traversal.
@@ -1352,7 +1302,6 @@
             xmlLastElementChild         (xmlNodePtr parent);
 XMLPUBFUN xmlNodePtr
             xmlPreviousElementSibling   (xmlNodePtr node);
-#endif
 
 XML_DEPRECATED
 XMLPUBFUN xmlRegisterNodeFunc
@@ -1367,11 +1316,6 @@
 XMLPUBFUN xmlDeregisterNodeFunc
             xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
 
-XML_DEPRECATED XMLPUBFUN xmlBufferAllocationScheme
-            xmlThrDefBufferAllocScheme  (xmlBufferAllocationScheme v);
-XML_DEPRECATED XMLPUBFUN int
-            xmlThrDefDefaultBufferSize  (int v);
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index e1698d7..00446bc 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -139,16 +139,17 @@
 typedef xmlRefTable *xmlRefTablePtr;
 
 /* Notation */
+XML_DEPRECATED
 XMLPUBFUN xmlNotationPtr
 		xmlAddNotationDecl	(xmlValidCtxtPtr ctxt,
 					 xmlDtdPtr dtd,
 					 const xmlChar *name,
 					 const xmlChar *PublicID,
 					 const xmlChar *SystemID);
-#ifdef LIBXML_TREE_ENABLED
+XML_DEPRECATED
 XMLPUBFUN xmlNotationTablePtr
 		xmlCopyNotationTable	(xmlNotationTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlFreeNotationTable	(xmlNotationTablePtr table);
 #ifdef LIBXML_OUTPUT_ENABLED
@@ -164,24 +165,31 @@
 
 /* Element Content */
 /* the non Doc version are being deprecated */
+XML_DEPRECATED
 XMLPUBFUN xmlElementContentPtr
 		xmlNewElementContent	(const xmlChar *name,
 					 xmlElementContentType type);
+XML_DEPRECATED
 XMLPUBFUN xmlElementContentPtr
 		xmlCopyElementContent	(xmlElementContentPtr content);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlFreeElementContent	(xmlElementContentPtr cur);
 /* the new versions with doc argument */
+XML_DEPRECATED
 XMLPUBFUN xmlElementContentPtr
 		xmlNewDocElementContent	(xmlDocPtr doc,
 					 const xmlChar *name,
 					 xmlElementContentType type);
+XML_DEPRECATED
 XMLPUBFUN xmlElementContentPtr
 		xmlCopyDocElementContent(xmlDocPtr doc,
 					 xmlElementContentPtr content);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlFreeDocElementContent(xmlDocPtr doc,
 					 xmlElementContentPtr cur);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlSnprintfElementContent(char *buf,
 					 int size,
@@ -196,16 +204,17 @@
 #endif /* LIBXML_OUTPUT_ENABLED */
 
 /* Element */
+XML_DEPRECATED
 XMLPUBFUN xmlElementPtr
 		xmlAddElementDecl	(xmlValidCtxtPtr ctxt,
 					 xmlDtdPtr dtd,
 					 const xmlChar *name,
 					 xmlElementTypeVal type,
 					 xmlElementContentPtr content);
-#ifdef LIBXML_TREE_ENABLED
+XML_DEPRECATED
 XMLPUBFUN xmlElementTablePtr
 		xmlCopyElementTable	(xmlElementTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlFreeElementTable	(xmlElementTablePtr table);
 #ifdef LIBXML_OUTPUT_ENABLED
@@ -220,16 +229,18 @@
 #endif /* LIBXML_OUTPUT_ENABLED */
 
 /* Enumeration */
+XML_DEPRECATED
 XMLPUBFUN xmlEnumerationPtr
 		xmlCreateEnumeration	(const xmlChar *name);
+/* XML_DEPRECATED, needed for custom attributeDecl SAX handler */
 XMLPUBFUN void
 		xmlFreeEnumeration	(xmlEnumerationPtr cur);
-#ifdef LIBXML_TREE_ENABLED
+XML_DEPRECATED
 XMLPUBFUN xmlEnumerationPtr
 		xmlCopyEnumeration	(xmlEnumerationPtr cur);
-#endif /* LIBXML_TREE_ENABLED */
 
 /* Attribute */
+XML_DEPRECATED
 XMLPUBFUN xmlAttributePtr
 		xmlAddAttributeDecl	(xmlValidCtxtPtr ctxt,
 					 xmlDtdPtr dtd,
@@ -240,10 +251,10 @@
 					 xmlAttributeDefault def,
 					 const xmlChar *defaultValue,
 					 xmlEnumerationPtr tree);
-#ifdef LIBXML_TREE_ENABLED
+XML_DEPRECATED
 XMLPUBFUN xmlAttributeTablePtr
 		xmlCopyAttributeTable  (xmlAttributeTablePtr table);
-#endif /* LIBXML_TREE_ENABLED */
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlFreeAttributeTable  (xmlAttributeTablePtr table);
 #ifdef LIBXML_OUTPUT_ENABLED
@@ -388,15 +399,12 @@
 XMLPUBFUN int
 		xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
 					 xmlDocPtr doc);
-#endif /* LIBXML_VALID_ENABLED */
-
-#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 XML_DEPRECATED
 XMLPUBFUN int
 		xmlValidateNotationUse	(xmlValidCtxtPtr ctxt,
 					 xmlDocPtr doc,
 					 const xmlChar *notationName);
-#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
+#endif /* LIBXML_VALID_ENABLED */
 
 XMLPUBFUN int
 		xmlIsMixedElement	(xmlDocPtr doc,
diff --git a/include/libxml/xinclude.h b/include/libxml/xinclude.h
index 71fa4c2..e1cb39f 100644
--- a/include/libxml/xinclude.h
+++ b/include/libxml/xinclude.h
@@ -16,6 +16,7 @@
 #include <libxml/xmlversion.h>
 #include <libxml/xmlerror.h>
 #include <libxml/tree.h>
+#include <libxml/parser.h>
 
 #ifdef LIBXML_XINCLUDE_ENABLED
 
@@ -120,6 +121,10 @@
 		xmlXIncludeSetErrorHandler(xmlXIncludeCtxtPtr ctxt,
 					 xmlStructuredErrorFunc handler,
 					 void *data);
+XMLPUBFUN void
+		xmlXIncludeSetResourceLoader(xmlXIncludeCtxtPtr ctxt,
+					 xmlResourceLoader loader,
+					 void *data);
 XMLPUBFUN int
 		xmlXIncludeGetLastError	(xmlXIncludeCtxtPtr ctxt);
 XMLPUBFUN void
diff --git a/include/libxml/xlink.h b/include/libxml/xlink.h
index 1065736..3ec83e4 100644
--- a/include/libxml/xlink.h
+++ b/include/libxml/xlink.h
@@ -160,16 +160,20 @@
  * detection callbacks.
  */
 
+XML_DEPRECATED
 XMLPUBFUN xlinkNodeDetectFunc
 		xlinkGetDefaultDetect	(void);
+XML_DEPRECATED
 XMLPUBFUN void
 		xlinkSetDefaultDetect	(xlinkNodeDetectFunc func);
 
 /*
  * Routines to set/get the default handlers.
  */
+XML_DEPRECATED
 XMLPUBFUN xlinkHandlerPtr
 		xlinkGetDefaultHandler	(void);
+XML_DEPRECATED
 XMLPUBFUN void
 		xlinkSetDefaultHandler	(xlinkHandlerPtr handler);
 
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index 5a35dc6..06472b0 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -176,21 +176,18 @@
 #endif /* LIBXML_OUTPUT_ENABLED */
 
 /** DOC_DISABLE */
-#define XML_GLOBALS_IO \
-  XML_OP(xmlParserInputBufferCreateFilenameValue, \
-           xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
-  XML_OP(xmlOutputBufferCreateFilenameValue, \
-           xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
+XML_DEPRECATED
+XMLPUBFUN xmlParserInputBufferCreateFilenameFunc *
+__xmlParserInputBufferCreateFilenameValue(void);
+XML_DEPRECATED
+XMLPUBFUN xmlOutputBufferCreateFilenameFunc *
+__xmlOutputBufferCreateFilenameValue(void);
 
-#define XML_OP XML_DECLARE_GLOBAL
-XML_GLOBALS_IO
-#undef XML_OP
-
-#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
+#ifndef XML_GLOBALS_NO_REDEFINITION
   #define xmlParserInputBufferCreateFilenameValue \
-    XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
+    (*__xmlParserInputBufferCreateFilenameValue())
   #define xmlOutputBufferCreateFilenameValue \
-    XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
+    (*__xmlOutputBufferCreateFilenameValue())
 #endif
 /** DOC_ENABLE */
 
@@ -211,6 +208,7 @@
 XMLPUBFUN xmlParserInputBufferPtr
 	xmlParserInputBufferCreateFilename	(const char *URI,
                                                  xmlCharEncoding enc);
+XML_DEPRECATED
 XMLPUBFUN xmlParserInputBufferPtr
 	xmlParserInputBufferCreateFile		(FILE *file,
                                                  xmlCharEncoding enc);
@@ -228,12 +226,15 @@
 						 xmlInputCloseCallback  ioclose,
 						 void *ioctx,
 	                                         xmlCharEncoding enc);
+XML_DEPRECATED
 XMLPUBFUN int
 	xmlParserInputBufferRead		(xmlParserInputBufferPtr in,
 						 int len);
+XML_DEPRECATED
 XMLPUBFUN int
 	xmlParserInputBufferGrow		(xmlParserInputBufferPtr in,
 						 int len);
+XML_DEPRECATED
 XMLPUBFUN int
 	xmlParserInputBufferPush		(xmlParserInputBufferPtr in,
 						 int len,
@@ -396,26 +397,6 @@
 	xmlIOHTTPClose			(void * context);
 #endif /* LIBXML_HTTP_ENABLED */
 
-/**
- * Default 'ftp://' protocol callbacks
- */
-#if defined(LIBXML_FTP_ENABLED)
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlIOFTPMatch			(const char *filename);
-XML_DEPRECATED
-XMLPUBFUN void *
-	xmlIOFTPOpen			(const char *filename);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlIOFTPRead			(void * context,
-					 char * buffer,
-					 int len);
-XML_DEPRECATED
-XMLPUBFUN int
-	xmlIOFTPClose			(void * context);
-#endif /* defined(LIBXML_FTP_ENABLED) */
-
 XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
 	xmlParserInputBufferCreateFilenameDefault(
 		xmlParserInputBufferCreateFilenameFunc func);
diff --git a/include/libxml/xmlautomata.h b/include/libxml/xmlautomata.h
index ea38eb3..97d0abf 100644
--- a/include/libxml/xmlautomata.h
+++ b/include/libxml/xmlautomata.h
@@ -13,7 +13,6 @@
 #include <libxml/xmlversion.h>
 
 #ifdef LIBXML_REGEXP_ENABLED
-#ifdef LIBXML_AUTOMATA_ENABLED
 
 #include <libxml/xmlstring.h>
 
@@ -40,24 +39,31 @@
 /*
  * Building API
  */
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataPtr
 		    xmlNewAutomata		(void);
+XML_DEPRECATED
 XMLPUBFUN void
 		    xmlFreeAutomata		(xmlAutomataPtr am);
 
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataGetInitState	(xmlAutomataPtr am);
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlAutomataSetFinalState	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr state);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewState		(xmlAutomataPtr am);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewTransition	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
 						 xmlAutomataStatePtr to,
 						 const xmlChar *token,
 						 void *data);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewTransition2	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
@@ -65,6 +71,7 @@
 						 const xmlChar *token,
 						 const xmlChar *token2,
 						 void *data);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
                     xmlAutomataNewNegTrans	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
@@ -73,6 +80,7 @@
 						 const xmlChar *token2,
 						 void *data);
 
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewCountTrans	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
@@ -81,6 +89,7 @@
 						 int min,
 						 int max,
 						 void *data);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewCountTrans2	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
@@ -90,6 +99,7 @@
 						 int min,
 						 int max,
 						 void *data);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewOnceTrans	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
@@ -98,6 +108,7 @@
 						 int min,
 						 int max,
 						 void *data);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewOnceTrans2	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
@@ -107,32 +118,39 @@
 						 int min,
 						 int max,
 						 void *data);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewAllTrans	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
 						 xmlAutomataStatePtr to,
 						 int lax);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewEpsilon	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
 						 xmlAutomataStatePtr to);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewCountedTrans	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
 						 xmlAutomataStatePtr to,
 						 int counter);
+XML_DEPRECATED
 XMLPUBFUN xmlAutomataStatePtr
 		    xmlAutomataNewCounterTrans	(xmlAutomataPtr am,
 						 xmlAutomataStatePtr from,
 						 xmlAutomataStatePtr to,
 						 int counter);
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlAutomataNewCounter	(xmlAutomataPtr am,
 						 int min,
 						 int max);
 
+XML_DEPRECATED
 XMLPUBFUN struct _xmlRegexp *
 		    xmlAutomataCompile		(xmlAutomataPtr am);
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlAutomataIsDeterminist	(xmlAutomataPtr am);
 
@@ -140,7 +158,6 @@
 }
 #endif
 
-#endif /* LIBXML_AUTOMATA_ENABLED */
 #endif /* LIBXML_REGEXP_ENABLED */
 
 #endif /* __XML_AUTOMATA_H__ */
diff --git a/include/libxml/xmlerror.h b/include/libxml/xmlerror.h
index 36381be..f59ce63 100644
--- a/include/libxml/xmlerror.h
+++ b/include/libxml/xmlerror.h
@@ -16,6 +16,11 @@
 extern "C" {
 #endif
 
+/*
+ * Backward compatibility
+ */
+#define initGenericErrorDefaultFunc(h) xmlSetGenericErrorFunc(NULL, *(h))
+
 /**
  * xmlErrorLevel:
  *
@@ -865,23 +870,20 @@
 typedef void (*xmlStructuredErrorFunc) (void *userData, const xmlError *error);
 
 /** DOC_DISABLE */
-#define XML_GLOBALS_ERROR \
-  XML_OP(xmlLastError, xmlError, XML_DEPRECATED) \
-  XML_OP(xmlGenericError, xmlGenericErrorFunc, XML_NO_ATTR) \
-  XML_OP(xmlGenericErrorContext, void *, XML_NO_ATTR) \
-  XML_OP(xmlStructuredError, xmlStructuredErrorFunc, XML_NO_ATTR) \
-  XML_OP(xmlStructuredErrorContext, void *, XML_NO_ATTR)
+XML_DEPRECATED
+XMLPUBFUN const xmlError *__xmlLastError(void);
 
-#define XML_OP XML_DECLARE_GLOBAL
-XML_GLOBALS_ERROR
-#undef XML_OP
+XMLPUBFUN xmlGenericErrorFunc *__xmlGenericError(void);
+XMLPUBFUN void **__xmlGenericErrorContext(void);
+XMLPUBFUN xmlStructuredErrorFunc *__xmlStructuredError(void);
+XMLPUBFUN void **__xmlStructuredErrorContext(void);
 
-#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
-  #define xmlLastError XML_GLOBAL_MACRO(xmlLastError)
-  #define xmlGenericError XML_GLOBAL_MACRO(xmlGenericError)
-  #define xmlGenericErrorContext XML_GLOBAL_MACRO(xmlGenericErrorContext)
-  #define xmlStructuredError XML_GLOBAL_MACRO(xmlStructuredError)
-  #define xmlStructuredErrorContext XML_GLOBAL_MACRO(xmlStructuredErrorContext)
+#ifndef XML_GLOBALS_NO_REDEFINITION
+  #define xmlLastError (*__xmlLastError())
+  #define xmlGenericError (*__xmlGenericError())
+  #define xmlGenericErrorContext (*__xmlGenericErrorContext())
+  #define xmlStructuredError (*__xmlStructuredError())
+  #define xmlStructuredErrorContext (*__xmlStructuredErrorContext())
 #endif
 /** DOC_ENABLE */
 
@@ -896,9 +898,6 @@
 XMLPUBFUN void
     xmlThrDefSetGenericErrorFunc(void *ctx,
                                  xmlGenericErrorFunc handler);
-XML_DEPRECATED
-XMLPUBFUN void
-    initGenericErrorDefaultFunc	(xmlGenericErrorFunc *handler);
 
 XMLPUBFUN void
     xmlSetStructuredErrorFunc	(void *ctx,
diff --git a/include/libxml/xmlexports.h b/include/libxml/xmlexports.h
index 3c1d83f..c4b7481 100644
--- a/include/libxml/xmlexports.h
+++ b/include/libxml/xmlexports.h
@@ -41,14 +41,6 @@
  * Attributes
  */
 
-#ifndef ATTRIBUTE_UNUSED
-  #if __GNUC__ * 100 + __GNUC_MINOR__ >= 207 || defined(__clang__)
-    #define ATTRIBUTE_UNUSED __attribute__((unused))
-  #else
-    #define ATTRIBUTE_UNUSED
-  #endif
-#endif
-
 #if !defined(__clang__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 403)
   #define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
 #else
@@ -75,56 +67,14 @@
   #endif
 #endif
 
-/*
- * Warnings pragmas, should be moved from public headers
- */
-
-#if defined(__LCC__)
-
-  #define XML_IGNORE_FPTR_CAST_WARNINGS
-  #define XML_POP_WARNINGS \
-    _Pragma("diag_default 1215")
-
-#elif defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
-
-  #if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 800)
-    #define XML_IGNORE_FPTR_CAST_WARNINGS \
-      _Pragma("GCC diagnostic push") \
-      _Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
-      _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
+#ifndef XML_DEPRECATED_MEMBER
+  #if defined(IN_LIBXML)
+    #define XML_DEPRECATED_MEMBER
+  #elif __GNUC__ * 100 + __GNUC_MINOR__ >= 301
+    #define XML_DEPRECATED_MEMBER __attribute__((deprecated))
   #else
-    #define XML_IGNORE_FPTR_CAST_WARNINGS \
-      _Pragma("GCC diagnostic push") \
-      _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
+    #define XML_DEPRECATED_MEMBER
   #endif
-  #define XML_POP_WARNINGS \
-    _Pragma("GCC diagnostic pop")
-
-#elif defined(_MSC_VER) && _MSC_VER >= 1400
-
-  #define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
-  #define XML_POP_WARNINGS __pragma(warning(pop))
-
-#else
-
-  #define XML_IGNORE_FPTR_CAST_WARNINGS
-  #define XML_POP_WARNINGS
-
-#endif
-
-/*
- * Accessors for globals
- */
-
-#define XML_NO_ATTR
-
-#ifdef LIBXML_THREAD_ENABLED
-  #define XML_DECLARE_GLOBAL(name, type, attrs) \
-    attrs XMLPUBFUN type *__##name(void);
-  #define XML_GLOBAL_MACRO(name) (*__##name())
-#else
-  #define XML_DECLARE_GLOBAL(name, type, attrs) \
-    attrs XMLPUBVAR type name;
 #endif
 
 /*
diff --git a/include/libxml/xmlmemory.h b/include/libxml/xmlmemory.h
index 1de3e9f..2b8c3aa 100644
--- a/include/libxml/xmlmemory.h
+++ b/include/libxml/xmlmemory.h
@@ -69,27 +69,25 @@
  *    - xmlMemStrdup
  *    - xmlFree
  */
-/** DOC_DISABLE */
 #ifdef LIBXML_THREAD_ALLOC_ENABLED
-  #define XML_GLOBALS_ALLOC \
-    XML_OP(xmlMalloc, xmlMallocFunc, XML_NO_ATTR) \
-    XML_OP(xmlMallocAtomic, xmlMallocFunc, XML_NO_ATTR) \
-    XML_OP(xmlRealloc, xmlReallocFunc, XML_NO_ATTR) \
-    XML_OP(xmlFree, xmlFreeFunc, XML_NO_ATTR) \
-    XML_OP(xmlMemStrdup, xmlStrdupFunc, XML_NO_ATTR)
-  #define XML_OP XML_DECLARE_GLOBAL
-    XML_GLOBALS_ALLOC
-  #undef XML_OP
-  #if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
-    #define xmlMalloc XML_GLOBAL_MACRO(xmlMalloc)
-    #define xmlMallocAtomic XML_GLOBAL_MACRO(xmlMallocAtomic)
-    #define xmlRealloc XML_GLOBAL_MACRO(xmlRealloc)
-    #define xmlFree XML_GLOBAL_MACRO(xmlFree)
-    #define xmlMemStrdup XML_GLOBAL_MACRO(xmlMemStrdup)
-  #endif
-#else
-  #define XML_GLOBALS_ALLOC
+
+/** DOC_DISABLE */
+XMLPUBFUN xmlMallocFunc *__xmlMalloc(void);
+XMLPUBFUN xmlMallocFunc *__xmlMallocAtomic(void);
+XMLPUBFUN xmlReallocFunc *__xmlRealloc(void);
+XMLPUBFUN xmlFreeFunc *__xmlFree(void);
+XMLPUBFUN xmlStrdupFunc *__xmlMemStrdup(void);
+
+#ifndef XML_GLOBALS_NO_REDEFINITION
+  #define xmlMalloc (*__xmlMalloc())
+  #define xmlMallocAtomic (*__xmlMallocAtomic())
+  #define xmlRealloc (*__xmlRealloc())
+  #define xmlFree (*__xmlFree())
+  #define xmlMemStrdup (*__xmlMemStrdup())
+#endif
 /** DOC_ENABLE */
+
+#else
   XMLPUBVAR xmlMallocFunc xmlMalloc;
   XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
   XMLPUBVAR xmlReallocFunc xmlRealloc;
@@ -112,12 +110,14 @@
 			 xmlMallocFunc *mallocFunc,
 			 xmlReallocFunc *reallocFunc,
 			 xmlStrdupFunc *strdupFunc);
+XML_DEPRECATED
 XMLPUBFUN int
 	xmlGcMemSetup	(xmlFreeFunc freeFunc,
 			 xmlMallocFunc mallocFunc,
 			 xmlMallocFunc mallocAtomicFunc,
 			 xmlReallocFunc reallocFunc,
 			 xmlStrdupFunc strdupFunc);
+XML_DEPRECATED
 XMLPUBFUN int
 	xmlGcMemGet	(xmlFreeFunc *freeFunc,
 			 xmlMallocFunc *mallocFunc,
diff --git a/include/libxml/xmlmodule.h b/include/libxml/xmlmodule.h
index 279986c..5db5585 100644
--- a/include/libxml/xmlmodule.h
+++ b/include/libxml/xmlmodule.h
@@ -37,15 +37,19 @@
     XML_MODULE_LOCAL= 2		/* local binding */
 } xmlModuleOption;
 
+XML_DEPRECATED
 XMLPUBFUN xmlModulePtr xmlModuleOpen	(const char *filename,
 						 int options);
 
+XML_DEPRECATED
 XMLPUBFUN int xmlModuleSymbol		(xmlModulePtr module,
 						 const char* name,
 						 void **result);
 
+XML_DEPRECATED
 XMLPUBFUN int xmlModuleClose		(xmlModulePtr module);
 
+XML_DEPRECATED
 XMLPUBFUN int xmlModuleFree		(xmlModulePtr module);
 
 #ifdef __cplusplus
diff --git a/include/libxml/xmlreader.h b/include/libxml/xmlreader.h
index 5d4fc5d..2344901 100644
--- a/include/libxml/xmlreader.h
+++ b/include/libxml/xmlreader.h
@@ -14,11 +14,12 @@
 #include <libxml/tree.h>
 #include <libxml/xmlerror.h>
 #include <libxml/xmlIO.h>
-#ifdef LIBXML_SCHEMAS_ENABLED
+#ifdef LIBXML_RELAXNG_ENABLED
 #include <libxml/relaxng.h>
+#endif
+#ifdef LIBXML_SCHEMAS_ENABLED
 #include <libxml/xmlschemas.h>
 #endif
-/* for compatibility */
 #include <libxml/parser.h>
 
 #ifdef __cplusplus
@@ -288,7 +289,7 @@
 		    xmlTextReaderNextSibling	(xmlTextReaderPtr reader);
 XMLPUBFUN int
 		    xmlTextReaderIsValid	(xmlTextReaderPtr reader);
-#ifdef LIBXML_SCHEMAS_ENABLED
+#ifdef LIBXML_RELAXNG_ENABLED
 XMLPUBFUN int
 		    xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
 						 const char *rng);
@@ -300,6 +301,8 @@
 XMLPUBFUN int
 		    xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
 						 xmlRelaxNGPtr schema);
+#endif
+#ifdef LIBXML_SCHEMAS_ENABLED
 XMLPUBFUN int
 		    xmlTextReaderSchemaValidate	(xmlTextReaderPtr reader,
 						 const char *xsd);
@@ -426,6 +429,11 @@
 					 xmlTextReaderErrorFunc *f,
 					 void **arg);
 
+XMLPUBFUN void
+	    xmlTextReaderSetResourceLoader(xmlTextReaderPtr reader,
+					   xmlResourceLoader loader,
+					   void *data);
+
 #endif /* LIBXML_READER_ENABLED */
 
 #ifdef __cplusplus
diff --git a/include/libxml/xmlregexp.h b/include/libxml/xmlregexp.h
index 2d66437..f7e10c3 100644
--- a/include/libxml/xmlregexp.h
+++ b/include/libxml/xmlregexp.h
@@ -47,6 +47,7 @@
 XMLPUBFUN int
 		    xmlRegexpExec	(xmlRegexpPtr comp,
 					 const xmlChar *value);
+XML_DEPRECATED
 XMLPUBFUN void
 		    xmlRegexpPrint	(FILE *output,
 					 xmlRegexpPtr regexp);
@@ -70,28 +71,34 @@
 /*
  * The progressive API
  */
+XML_DEPRECATED
 XMLPUBFUN xmlRegExecCtxtPtr
 		    xmlRegNewExecCtxt	(xmlRegexpPtr comp,
 					 xmlRegExecCallbacks callback,
 					 void *data);
+XML_DEPRECATED
 XMLPUBFUN void
 		    xmlRegFreeExecCtxt	(xmlRegExecCtxtPtr exec);
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlRegExecPushString(xmlRegExecCtxtPtr exec,
 					 const xmlChar *value,
 					 void *data);
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
 					 const xmlChar *value,
 					 const xmlChar *value2,
 					 void *data);
 
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
 					 int *nbval,
 					 int *nbneg,
 					 xmlChar **values,
 					 int *terminal);
+XML_DEPRECATED
 XMLPUBFUN int
 		    xmlRegExecErrInfo	(xmlRegExecCtxtPtr exec,
 					 const xmlChar **string,
@@ -99,113 +106,7 @@
 					 int *nbneg,
 					 xmlChar **values,
 					 int *terminal);
-#ifdef LIBXML_EXPR_ENABLED
-/*
- * Formal regular expression handling
- * Its goal is to do some formal work on content models
- */
 
-/* expressions are used within a context */
-typedef struct _xmlExpCtxt xmlExpCtxt;
-typedef xmlExpCtxt *xmlExpCtxtPtr;
-
-XMLPUBFUN void
-			xmlExpFreeCtxt	(xmlExpCtxtPtr ctxt);
-XMLPUBFUN xmlExpCtxtPtr
-			xmlExpNewCtxt	(int maxNodes,
-					 xmlDictPtr dict);
-
-XMLPUBFUN int
-			xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
-XMLPUBFUN int
-			xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
-
-/* Expressions are trees but the tree is opaque */
-typedef struct _xmlExpNode xmlExpNode;
-typedef xmlExpNode *xmlExpNodePtr;
-
-typedef enum {
-    XML_EXP_EMPTY = 0,
-    XML_EXP_FORBID = 1,
-    XML_EXP_ATOM = 2,
-    XML_EXP_SEQ = 3,
-    XML_EXP_OR = 4,
-    XML_EXP_COUNT = 5
-} xmlExpNodeType;
-
-/*
- * 2 core expressions shared by all for the empty language set
- * and for the set with just the empty token
- */
-XMLPUBVAR xmlExpNodePtr forbiddenExp;
-XMLPUBVAR xmlExpNodePtr emptyExp;
-
-/*
- * Expressions are reference counted internally
- */
-XMLPUBFUN void
-			xmlExpFree	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr);
-XMLPUBFUN void
-			xmlExpRef	(xmlExpNodePtr expr);
-
-/*
- * constructors can be either manual or from a string
- */
-XMLPUBFUN xmlExpNodePtr
-			xmlExpParse	(xmlExpCtxtPtr ctxt,
-					 const char *expr);
-XMLPUBFUN xmlExpNodePtr
-			xmlExpNewAtom	(xmlExpCtxtPtr ctxt,
-					 const xmlChar *name,
-					 int len);
-XMLPUBFUN xmlExpNodePtr
-			xmlExpNewOr	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr left,
-					 xmlExpNodePtr right);
-XMLPUBFUN xmlExpNodePtr
-			xmlExpNewSeq	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr left,
-					 xmlExpNodePtr right);
-XMLPUBFUN xmlExpNodePtr
-			xmlExpNewRange	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr subset,
-					 int min,
-					 int max);
-/*
- * The really interesting APIs
- */
-XMLPUBFUN int
-			xmlExpIsNillable(xmlExpNodePtr expr);
-XMLPUBFUN int
-			xmlExpMaxToken	(xmlExpNodePtr expr);
-XMLPUBFUN int
-			xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 const xmlChar**langList,
-					 int len);
-XMLPUBFUN int
-			xmlExpGetStart	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 const xmlChar**tokList,
-					 int len);
-XMLPUBFUN xmlExpNodePtr
-			xmlExpStringDerive(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 const xmlChar *str,
-					 int len);
-XMLPUBFUN xmlExpNodePtr
-			xmlExpExpDerive	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 xmlExpNodePtr sub);
-XMLPUBFUN int
-			xmlExpSubsume	(xmlExpCtxtPtr ctxt,
-					 xmlExpNodePtr expr,
-					 xmlExpNodePtr sub);
-XMLPUBFUN void
-			xmlExpDump	(xmlBufferPtr buf,
-					 xmlExpNodePtr expr);
-#endif /* LIBXML_EXPR_ENABLED */
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/libxml/xmlsave.h b/include/libxml/xmlsave.h
index e266e46..91d6ef9 100644
--- a/include/libxml/xmlsave.h
+++ b/include/libxml/xmlsave.h
@@ -34,7 +34,11 @@
     XML_SAVE_XHTML	= 1<<4, /* force XHTML1 specific rules */
     XML_SAVE_AS_XML     = 1<<5, /* force XML serialization on HTML doc */
     XML_SAVE_AS_HTML    = 1<<6, /* force HTML serialization on XML doc */
-    XML_SAVE_WSNONSIG   = 1<<7  /* format with non-significant whitespace */
+    XML_SAVE_WSNONSIG   = 1<<7, /* format with non-significant whitespace */
+    /* Available since 2.14.0 */
+    XML_SAVE_EMPTY      = 1<<8, /* force empty tags, overriding global */
+    XML_SAVE_NO_INDENT  = 1<<9, /* disable indenting */
+    XML_SAVE_INDENT     = 1<<10 /* force indenting, overriding global */
 } xmlSaveOption;
 
 
@@ -73,11 +77,16 @@
 		xmlSaveFlush		(xmlSaveCtxtPtr ctxt);
 XMLPUBFUN int
 		xmlSaveClose		(xmlSaveCtxtPtr ctxt);
-XMLPUBFUN int
+XMLPUBFUN xmlParserErrors
 		xmlSaveFinish		(xmlSaveCtxtPtr ctxt);
 XMLPUBFUN int
+		xmlSaveSetIndentString	(xmlSaveCtxtPtr ctxt,
+					 const char *indent);
+XML_DEPRECATED
+XMLPUBFUN int
 		xmlSaveSetEscape	(xmlSaveCtxtPtr ctxt,
 					 xmlCharEncodingOutputFunc escape);
+XML_DEPRECATED
 XMLPUBFUN int
 		xmlSaveSetAttrEscape	(xmlSaveCtxtPtr ctxt,
 					 xmlCharEncodingOutputFunc escape);
diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h
index c2af3d7..78073cd 100644
--- a/include/libxml/xmlschemas.h
+++ b/include/libxml/xmlschemas.h
@@ -18,6 +18,7 @@
 
 #include <stdio.h>
 #include <libxml/encoding.h>
+#include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libxml/xmlerror.h>
 
@@ -156,22 +157,26 @@
 					 xmlStructuredErrorFunc serror,
 					 void *ctx);
 XMLPUBFUN int
-		xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
+	    xmlSchemaGetParserErrors	(xmlSchemaParserCtxtPtr ctxt,
 					xmlSchemaValidityErrorFunc * err,
 					xmlSchemaValidityWarningFunc * warn,
 					void **ctx);
+XMLPUBFUN void
+	    xmlSchemaSetResourceLoader	(xmlSchemaParserCtxtPtr ctxt,
+					 xmlResourceLoader loader,
+					 void *data);
 XMLPUBFUN int
-		xmlSchemaIsValid	(xmlSchemaValidCtxtPtr ctxt);
+	    xmlSchemaIsValid		(xmlSchemaValidCtxtPtr ctxt);
 
 XMLPUBFUN xmlSchemaPtr
 	    xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt);
 XMLPUBFUN void
 	    xmlSchemaFree		(xmlSchemaPtr schema);
-#ifdef LIBXML_OUTPUT_ENABLED
+#ifdef LIBXML_DEBUG_ENABLED
 XMLPUBFUN void
 	    xmlSchemaDump		(FILE *output,
 					 xmlSchemaPtr schema);
-#endif /* LIBXML_OUTPUT_ENABLED */
+#endif /* LIBXML_DEBUG_ENABLED */
 /*
  * Interfaces for validating
  */
@@ -212,7 +217,7 @@
 	    xmlSchemaValidateStream	(xmlSchemaValidCtxtPtr ctxt,
 					 xmlParserInputBufferPtr input,
 					 xmlCharEncoding enc,
-					 xmlSAXHandlerPtr sax,
+					 const xmlSAXHandler *sax,
 					 void *user_data);
 XMLPUBFUN int
 	    xmlSchemaValidateFile	(xmlSchemaValidCtxtPtr ctxt,
diff --git a/include/libxml/xmlunicode.h b/include/libxml/xmlunicode.h
index b6d795b..efda81b 100644
--- a/include/libxml/xmlunicode.h
+++ b/include/libxml/xmlunicode.h
@@ -2,365 +2,14 @@
  * Summary: Unicode character APIs
  * Description: API for the Unicode character APIs
  *
- * This file is automatically generated from the
- * UCS description files of the Unicode Character Database
- * http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html
- * using the genUnicode.py Python script.
- *
- * Generation date: Tue Apr 30 17:30:38 2024
- * Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt
- * Author: Daniel Veillard
+ * Deprecated, don't use.
  */
 
 #ifndef __XML_UNICODE_H__
 #define __XML_UNICODE_H__
 
-#include <libxml/xmlversion.h>
-
-#ifdef LIBXML_UNICODE_ENABLED
-
-#ifdef __cplusplus
-extern "C" {
+#ifdef __GNUC__
+  #warning "libxml/xmlunicode.h is deprecated"
 #endif
 
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsAegeanNumbers	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsAlphabeticPresentationForms	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsArabic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsArabicPresentationFormsA	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsArabicPresentationFormsB	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsArmenian	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsArrows	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBasicLatin	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBengali	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBlockElements	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBopomofo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBopomofoExtended	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBoxDrawing	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBraillePatterns	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsBuhid	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsByzantineMusicalSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKCompatibility	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKCompatibilityForms	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographs	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographsSupplement	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKRadicalsSupplement	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKSymbolsandPunctuation	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographs	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionA	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionB	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCherokee	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarks	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarksforSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCombiningHalfMarks	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCombiningMarksforSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsControlPictures	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCurrencySymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCypriotSyllabary	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCyrillic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCyrillicSupplement	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsDeseret	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsDevanagari	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsDingbats	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsEnclosedAlphanumerics	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsEnclosedCJKLettersandMonths	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsEthiopic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGeneralPunctuation	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGeometricShapes	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGeorgian	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGothic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGreek	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGreekExtended	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGreekandCoptic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGujarati	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsGurmukhi	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHalfwidthandFullwidthForms	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHangulCompatibilityJamo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHangulJamo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHangulSyllables	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHanunoo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHebrew	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHighPrivateUseSurrogates	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHighSurrogates	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsHiragana	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsIPAExtensions	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsIdeographicDescriptionCharacters	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKanbun	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKangxiRadicals	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKannada	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKatakana	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKatakanaPhoneticExtensions	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKhmer	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsKhmerSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLao	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLatin1Supplement	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLatinExtendedA	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLatinExtendedB	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLatinExtendedAdditional	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLetterlikeSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLimbu	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLinearBIdeograms	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLinearBSyllabary	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsLowSurrogates	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMalayalam	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMathematicalAlphanumericSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMathematicalOperators	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsA	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsB	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMiscellaneousSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMiscellaneousSymbolsandArrows	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMiscellaneousTechnical	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMongolian	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMusicalSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsMyanmar	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsNumberForms	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsOgham	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsOldItalic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsOpticalCharacterRecognition	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsOriya	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsOsmanya	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsPhoneticExtensions	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsPrivateUse	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsPrivateUseArea	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsRunic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsShavian	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSinhala	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSmallFormVariants	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSpacingModifierLetters	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSpecials	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSuperscriptsandSubscripts	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSupplementalArrowsA	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSupplementalArrowsB	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSupplementalMathematicalOperators	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaA	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaB	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsSyriac	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTagalog	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTagbanwa	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTags	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTaiLe	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTaiXuanJingSymbols	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTamil	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTelugu	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsThaana	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsThai	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsTibetan	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsUgaritic	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsUnifiedCanadianAboriginalSyllabics	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsVariationSelectors	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsVariationSelectorsSupplement	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsYiRadicals	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsYiSyllables	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsYijingHexagramSymbols	(int code);
-
-XMLPUBFUN int xmlUCSIsBlock	(int code, const char *block);
-
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatC	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatCc	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatCf	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatCo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatCs	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatL	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatLl	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatLm	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatLo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatLt	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatLu	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatM	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatMc	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatMe	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatMn	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatN	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatNd	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatNl	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatNo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatP	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPc	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPd	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPe	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPf	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPi	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatPs	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatS	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatSc	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatSk	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatSm	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatSo	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatZ	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatZl	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatZp	(int code);
-XML_DEPRECATED
-XMLPUBFUN int xmlUCSIsCatZs	(int code);
-
-XMLPUBFUN int xmlUCSIsCat	(int code, const char *cat);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* LIBXML_UNICODE_ENABLED */
-
 #endif /* __XML_UNICODE_H__ */
diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h
index f2f6e60..7a5ecbd 100644
--- a/include/libxml/xmlversion.h
+++ b/include/libxml/xmlversion.h
@@ -15,28 +15,28 @@
  *
  * the version string like "1.2.3"
  */
-#define LIBXML_DOTTED_VERSION "2.13.6"
+#define LIBXML_DOTTED_VERSION "2.14.2"
 
 /**
  * LIBXML_VERSION:
  *
  * the version number: 1.2.3 value is 10203
  */
-#define LIBXML_VERSION 21306
+#define LIBXML_VERSION 21402
 
 /**
  * LIBXML_VERSION_STRING:
  *
  * the version number string, 1.2.3 value is "10203"
  */
-#define LIBXML_VERSION_STRING "21306"
+#define LIBXML_VERSION_STRING "21402"
 
 /**
  * LIBXML_VERSION_EXTRA:
  *
  * extra version information, used to show a git commit description
  */
-#define LIBXML_VERSION_EXTRA "-GITv2.13.6-113-gded66f74"
+#define LIBXML_VERSION_EXTRA "-GITv2.14.2-198-g5f13b6b3"
 
 /**
  * LIBXML_TEST_VERSION:
@@ -44,7 +44,7 @@
  * Macro to check that the libxml version in use is compatible with
  * the version the software has been compiled against
  */
-#define LIBXML_TEST_VERSION xmlCheckVersion(21306);
+#define LIBXML_TEST_VERSION xmlCheckVersion(21402);
 
 /**
  * LIBXML_THREAD_ENABLED:
@@ -67,11 +67,9 @@
 /**
  * LIBXML_TREE_ENABLED:
  *
- * Whether the DOM like tree manipulation API support is configured in
+ * Always enabled since 2.14.0
  */
-#if 1
 #define LIBXML_TREE_ENABLED
-#endif
 
 /**
  * LIBXML_OUTPUT_ENABLED:
@@ -128,15 +126,6 @@
 #endif
 
 /**
- * LIBXML_FTP_ENABLED:
- *
- * Whether the FTP support is configured in
- */
-#if 0
-#define LIBXML_FTP_ENABLED
-#endif
-
-/**
  * LIBXML_HTTP_ENABLED:
  *
  * Whether the HTTP support is configured in
@@ -166,11 +155,9 @@
 /**
  * LIBXML_LEGACY_ENABLED:
  *
- * Whether the deprecated APIs are compiled in for compatibility
+ * Removed in 2.14
  */
-#if 0
-#define LIBXML_LEGACY_ENABLED
-#endif
+#undef LIBXML_LEGACY_ENABLED
 
 /**
  * LIBXML_C14N_ENABLED:
@@ -209,15 +196,6 @@
 #endif
 
 /**
- * LIBXML_XPTR_LOCS_ENABLED:
- *
- * Whether support for XPointer locations is configured in
- */
-#if 0
-#define LIBXML_XPTR_LOCS_ENABLED
-#endif
-
-/**
  * LIBXML_XINCLUDE_ENABLED:
  *
  * Whether XInclude is configured in
@@ -265,11 +243,9 @@
 /**
  * LIBXML_UNICODE_ENABLED:
  *
- * Whether the Unicode related interfaces are compiled in
+ * Removed in 2.14
  */
-#if 1
-#define LIBXML_UNICODE_ENABLED
-#endif
+#undef LIBXML_UNICODE_ENABLED
 
 /**
  * LIBXML_REGEXP_ENABLED:
@@ -290,6 +266,15 @@
 #endif
 
 /**
+ * LIBXML_RELAXNG_ENABLED:
+ *
+ * Whether the RelaxNG validation interfaces are compiled in
+ */
+#if 1
+#define LIBXML_RELAXNG_ENABLED
+#endif
+
+/**
  * LIBXML_SCHEMAS_ENABLED:
  *
  * Whether the Schemas validation interfaces are compiled in
diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
index f153a94..c3f0e4d 100644
--- a/include/libxml/xmlversion.h.in
+++ b/include/libxml/xmlversion.h.in
@@ -67,11 +67,9 @@
 /**
  * LIBXML_TREE_ENABLED:
  *
- * Whether the DOM like tree manipulation API support is configured in
+ * Always enabled since 2.14.0
  */
-#if @WITH_TREE@
 #define LIBXML_TREE_ENABLED
-#endif
 
 /**
  * LIBXML_OUTPUT_ENABLED:
@@ -128,15 +126,6 @@
 #endif
 
 /**
- * LIBXML_FTP_ENABLED:
- *
- * Whether the FTP support is configured in
- */
-#if @WITH_FTP@
-#define LIBXML_FTP_ENABLED
-#endif
-
-/**
  * LIBXML_HTTP_ENABLED:
  *
  * Whether the HTTP support is configured in
@@ -166,11 +155,9 @@
 /**
  * LIBXML_LEGACY_ENABLED:
  *
- * Whether the deprecated APIs are compiled in for compatibility
+ * Removed in 2.14
  */
-#if @WITH_LEGACY@
-#define LIBXML_LEGACY_ENABLED
-#endif
+#undef LIBXML_LEGACY_ENABLED
 
 /**
  * LIBXML_C14N_ENABLED:
@@ -209,15 +196,6 @@
 #endif
 
 /**
- * LIBXML_XPTR_LOCS_ENABLED:
- *
- * Whether support for XPointer locations is configured in
- */
-#if @WITH_XPTR_LOCS@
-#define LIBXML_XPTR_LOCS_ENABLED
-#endif
-
-/**
  * LIBXML_XINCLUDE_ENABLED:
  *
  * Whether XInclude is configured in
@@ -265,11 +243,9 @@
 /**
  * LIBXML_UNICODE_ENABLED:
  *
- * Whether the Unicode related interfaces are compiled in
+ * Removed in 2.14
  */
-#if @WITH_REGEXPS@
-#define LIBXML_UNICODE_ENABLED
-#endif
+#undef LIBXML_UNICODE_ENABLED
 
 /**
  * LIBXML_REGEXP_ENABLED:
@@ -290,6 +266,15 @@
 #endif
 
 /**
+ * LIBXML_RELAXNG_ENABLED:
+ *
+ * Whether the RelaxNG validation interfaces are compiled in
+ */
+#if @WITH_RELAXNG@
+#define LIBXML_RELAXNG_ENABLED
+#endif
+
+/**
  * LIBXML_SCHEMAS_ENABLED:
  *
  * Whether the Schemas validation interfaces are compiled in
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h
index b89e105..e03e97d 100644
--- a/include/libxml/xpath.h
+++ b/include/libxml/xpath.h
@@ -26,15 +26,10 @@
 #include <libxml/xmlerror.h>
 #include <libxml/tree.h>
 #include <libxml/hash.h>
-#endif /* LIBXML_XPATH_ENABLED */
 
-#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
 #ifdef __cplusplus
 extern "C" {
 #endif
-#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */
-
-#ifdef LIBXML_XPATH_ENABLED
 
 typedef struct _xmlXPathContext xmlXPathContext;
 typedef xmlXPathContext *xmlXPathContextPtr;
@@ -104,22 +99,15 @@
     XPATH_BOOLEAN = 2,
     XPATH_NUMBER = 3,
     XPATH_STRING = 4,
-#ifdef LIBXML_XPTR_LOCS_ENABLED
-    XPATH_POINT = 5,
-    XPATH_RANGE = 6,
-    XPATH_LOCATIONSET = 7,
-#endif
     XPATH_USERS = 8,
     XPATH_XSLT_TREE = 9  /* An XSLT value tree, non modifiable */
 } xmlXPathObjectType;
 
-#ifndef LIBXML_XPTR_LOCS_ENABLED
 /** DOC_DISABLE */
 #define XPATH_POINT 5
 #define XPATH_RANGE 6
 #define XPATH_LOCATIONSET 7
 /** DOC_ENABLE */
-#endif
 
 typedef struct _xmlXPathObject xmlXPathObject;
 typedef xmlXPathObject *xmlXPathObjectPtr;
@@ -413,8 +401,11 @@
  * Objects and Nodesets handling
  */
 
+XML_DEPRECATED
 XMLPUBVAR double xmlXPathNAN;
+XML_DEPRECATED
 XMLPUBVAR double xmlXPathPINF;
+XML_DEPRECATED
 XMLPUBVAR double xmlXPathNINF;
 
 /* These macros may later turn into functions */
@@ -561,8 +552,7 @@
 						 xmlXPathContextPtr ctxt);
 XMLPUBFUN void
 		    xmlXPathFreeCompExpr	(xmlXPathCompExprPtr comp);
-#endif /* LIBXML_XPATH_ENABLED */
-#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+
 XML_DEPRECATED
 XMLPUBFUN void
 		    xmlXPathInit		(void);
@@ -575,5 +565,5 @@
 }
 #endif
 
-#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/
+#endif /* LIBXML_XPATH_ENABLED */
 #endif /* ! __XML_XPATH_H__ */
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h
index d1c90df..88b487a 100644
--- a/include/libxml/xpathInternals.h
+++ b/include/libxml/xpathInternals.h
@@ -22,6 +22,12 @@
 extern "C" {
 #endif
 
+/*
+ * Backward compatibility
+ */
+#define valuePush xmlXPathValuePush
+#define valuePop xmlXPathValuePop
+
 /************************************************************************
  *									*
  *			Helpers						*
@@ -478,11 +484,10 @@
 XMLPUBFUN void
 		xmlXPathFreeParserContext	(xmlXPathParserContextPtr ctxt);
 
-/* TODO: remap to xmlXPathValuePop and Push. */
 XMLPUBFUN xmlXPathObjectPtr
-		valuePop			(xmlXPathParserContextPtr ctxt);
+		xmlXPathValuePop		(xmlXPathParserContextPtr ctxt);
 XMLPUBFUN int
-		valuePush			(xmlXPathParserContextPtr ctxt,
+		xmlXPathValuePush		(xmlXPathParserContextPtr ctxt,
 						 xmlXPathObjectPtr value);
 
 XMLPUBFUN xmlXPathObjectPtr
@@ -516,6 +521,7 @@
 
 XMLPUBFUN void
 		xmlXPathRoot			(xmlXPathParserContextPtr ctxt);
+XML_DEPRECATED
 XMLPUBFUN void
 		xmlXPathEvalExpr		(xmlXPathParserContextPtr ctxt);
 XMLPUBFUN xmlChar *
diff --git a/include/libxml/xpointer.h b/include/libxml/xpointer.h
index a526000..16bd5b9 100644
--- a/include/libxml/xpointer.h
+++ b/include/libxml/xpointer.h
@@ -28,88 +28,10 @@
 extern "C" {
 #endif
 
-#if defined(LIBXML_XPTR_LOCS_ENABLED)
-/*
- * A Location Set
- */
-typedef struct _xmlLocationSet xmlLocationSet;
-typedef xmlLocationSet *xmlLocationSetPtr;
-struct _xmlLocationSet {
-    int locNr;		      /* number of locations in the set */
-    int locMax;		      /* size of the array as allocated */
-    xmlXPathObjectPtr *locTab;/* array of locations */
-};
-
-/*
- * Handling of location sets.
- */
-
-XML_DEPRECATED
-XMLPUBFUN xmlLocationSetPtr
-		    xmlXPtrLocationSetCreate	(xmlXPathObjectPtr val);
-XML_DEPRECATED
-XMLPUBFUN void
-		    xmlXPtrFreeLocationSet	(xmlLocationSetPtr obj);
-XML_DEPRECATED
-XMLPUBFUN xmlLocationSetPtr
-		    xmlXPtrLocationSetMerge	(xmlLocationSetPtr val1,
-						 xmlLocationSetPtr val2);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewRange		(xmlNodePtr start,
-						 int startindex,
-						 xmlNodePtr end,
-						 int endindex);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewRangePoints	(xmlXPathObjectPtr start,
-						 xmlXPathObjectPtr end);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewRangeNodePoint	(xmlNodePtr start,
-						 xmlXPathObjectPtr end);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewRangePointNode	(xmlXPathObjectPtr start,
-						 xmlNodePtr end);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewRangeNodes	(xmlNodePtr start,
-						 xmlNodePtr end);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewLocationSetNodes	(xmlNodePtr start,
-						 xmlNodePtr end);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewRangeNodeObject	(xmlNodePtr start,
-						 xmlXPathObjectPtr end);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrNewCollapsedRange	(xmlNodePtr start);
-XML_DEPRECATED
-XMLPUBFUN void
-		    xmlXPtrLocationSetAdd	(xmlLocationSetPtr cur,
-						 xmlXPathObjectPtr val);
-XML_DEPRECATED
-XMLPUBFUN xmlXPathObjectPtr
-		    xmlXPtrWrapLocationSet	(xmlLocationSetPtr val);
-XML_DEPRECATED
-XMLPUBFUN void
-		    xmlXPtrLocationSetDel	(xmlLocationSetPtr cur,
-						 xmlXPathObjectPtr val);
-XML_DEPRECATED
-XMLPUBFUN void
-		    xmlXPtrLocationSetRemove	(xmlLocationSetPtr cur,
-						 int val);
-#endif /* defined(LIBXML_XPTR_LOCS_ENABLED) */
-
 /*
  * Functions.
  */
+XML_DEPRECATED
 XMLPUBFUN xmlXPathContextPtr
 		    xmlXPtrNewContext		(xmlDocPtr doc,
 						 xmlNodePtr here,
@@ -118,18 +40,6 @@
 		    xmlXPtrEval			(const xmlChar *str,
 						 xmlXPathContextPtr ctx);
 
-#if defined(LIBXML_XPTR_LOCS_ENABLED)
-XML_DEPRECATED
-XMLPUBFUN void
-		    xmlXPtrRangeToFunction	(xmlXPathParserContextPtr ctxt,
-						 int nargs);
-XML_DEPRECATED
-XMLPUBFUN xmlNodePtr
-		    xmlXPtrBuildNodeList	(xmlXPathObjectPtr obj);
-XML_DEPRECATED
-XMLPUBFUN void
-		    xmlXPtrEvalRangePredicate	(xmlXPathParserContextPtr ctxt);
-#endif /* defined(LIBXML_XPTR_LOCS_ENABLED) */
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/private/Makefile.am b/include/private/Makefile.am
index 29c0bdd..7bdba3d 100644
--- a/include/private/Makefile.am
+++ b/include/private/Makefile.am
@@ -1,5 +1,6 @@
 EXTRA_DIST = \
 	buf.h \
+	cata.h \
 	dict.h \
 	enc.h \
 	entities.h \
@@ -7,6 +8,7 @@
 	globals.h \
 	html.h \
 	io.h \
+	lint.h \
 	memory.h \
 	parser.h \
 	regexp.h \
@@ -14,6 +16,7 @@
 	string.h \
 	threads.h \
 	tree.h \
+	unicode.h \
 	xinclude.h \
 	xpath.h \
 	xzlib.h
diff --git a/include/private/buf.h b/include/private/buf.h
index 982b9ee..a8a568b 100644
--- a/include/private/buf.h
+++ b/include/private/buf.h
@@ -1,57 +1,41 @@
 #ifndef XML_BUF_H_PRIVATE__
 #define XML_BUF_H_PRIVATE__
 
+#include <libxml/parser.h>
 #include <libxml/tree.h>
 
 XML_HIDDEN xmlBufPtr
-xmlBufCreate(void);
+xmlBufCreate(size_t size);
 XML_HIDDEN xmlBufPtr
-xmlBufCreateSize(size_t size);
-
-XML_HIDDEN int
-xmlBufSetAllocationScheme(xmlBufPtr buf, xmlBufferAllocationScheme scheme);
-XML_HIDDEN int
-xmlBufGetAllocationScheme(xmlBufPtr buf);
-
+xmlBufCreateMem(const xmlChar *mem, size_t size, int isStatic);
 XML_HIDDEN void
 xmlBufFree(xmlBufPtr buf);
+
 XML_HIDDEN void
 xmlBufEmpty(xmlBufPtr buf);
 
-/* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */
 XML_HIDDEN int
-xmlBufGrow(xmlBufPtr buf, int len);
-XML_HIDDEN int
-xmlBufResize(xmlBufPtr buf, size_t len);
+xmlBufGrow(xmlBufPtr buf, size_t len);
 
 XML_HIDDEN int
-xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
+xmlBufAdd(xmlBufPtr buf, const xmlChar *str, size_t len);
 XML_HIDDEN int
 xmlBufCat(xmlBufPtr buf, const xmlChar *str);
 
 XML_HIDDEN size_t
 xmlBufAvail(const xmlBufPtr buf);
-XML_HIDDEN size_t
-xmlBufLength(const xmlBufPtr buf);
-/* size_t xmlBufUse(const xmlBufPtr buf); */
 XML_HIDDEN int
 xmlBufIsEmpty(const xmlBufPtr buf);
 XML_HIDDEN int
 xmlBufAddLen(xmlBufPtr buf, size_t len);
 
-/* const xmlChar * xmlBufContent(const xmlBuf *buf); */
-/* const xmlChar * xmlBufEnd(xmlBufPtr buf); */
-
 XML_HIDDEN xmlChar *
 xmlBufDetach(xmlBufPtr buf);
 
-XML_HIDDEN size_t
-xmlBufDump(FILE *file, xmlBufPtr buf);
-
 XML_HIDDEN xmlBufPtr
 xmlBufFromBuffer(xmlBufferPtr buffer);
-XML_HIDDEN xmlBufferPtr
-xmlBufBackToBuffer(xmlBufPtr buf);
+XML_HIDDEN int
+xmlBufBackToBuffer(xmlBufPtr buf, xmlBufferPtr ret);
 
 XML_HIDDEN int
 xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
diff --git a/include/private/cata.h b/include/private/cata.h
new file mode 100644
index 0000000..789808a
--- /dev/null
+++ b/include/private/cata.h
@@ -0,0 +1,13 @@
+#ifndef XML_CATA_H_PRIVATE__
+#define XML_CATA_H_PRIVATE__
+
+#ifdef LIBXML_CATALOG_ENABLED
+
+XML_HIDDEN void
+xmlInitCatalogInternal(void);
+XML_HIDDEN void
+xmlCleanupCatalogInternal(void);
+
+#endif /* LIBXML_CATALOG_ENABLED */
+
+#endif /* XML_CATA_H_PRIVATE__ */
diff --git a/include/private/enc.h b/include/private/enc.h
index cd54914..ef8ce5a 100644
--- a/include/private/enc.h
+++ b/include/private/enc.h
@@ -7,11 +7,12 @@
 XML_HIDDEN void
 xmlInitEncodingInternal(void);
 
-XML_HIDDEN int
+XML_HIDDEN xmlCharEncError
 xmlEncInputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
-                 int *outlen, const unsigned char *in, int *inlen);
-XML_HIDDEN int
-xmlCharEncInput(xmlParserInputBufferPtr input);
+                 int *outlen, const unsigned char *in, int *inlen,
+                 int flush);
+XML_HIDDEN xmlCharEncError
+xmlCharEncInput(xmlParserInputBufferPtr input, size_t *sizeOut, int flush);
 XML_HIDDEN int
 xmlCharEncOutput(xmlOutputBufferPtr output, int init);
 
diff --git a/include/private/entities.h b/include/private/entities.h
index d262ef4..d038cf0 100644
--- a/include/private/entities.h
+++ b/include/private/entities.h
@@ -21,7 +21,22 @@
 #define XML_ENT_VALIDATED   (1u << 2)
 #define XML_ENT_EXPANDING   (1u << 3)
 
+#define XML_ESCAPE_ATTR             (1u << 0)
+#define XML_ESCAPE_NON_ASCII        (1u << 1)
+#define XML_ESCAPE_HTML             (1u << 2)
+#define XML_ESCAPE_QUOT             (1u << 3)
+#define XML_ESCAPE_ALLOW_INVALID    (1u << 4)
+
+XML_HIDDEN int
+xmlSerializeHexCharRef(char *buf, int val);
+XML_HIDDEN int
+xmlSerializeDecCharRef(char *buf, int val);
+
 XML_HIDDEN xmlChar *
-xmlEncodeAttributeEntities(xmlDocPtr doc, const xmlChar *input);
+xmlEscapeText(const xmlChar *text, int flags);
+
+XML_HIDDEN xmlChar *
+xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input,
+                          unsigned flags);
 
 #endif /* XML_ENTITIES_H_PRIVATE__ */
diff --git a/include/private/error.h b/include/private/error.h
index 506405a..b88fd82 100644
--- a/include/private/error.h
+++ b/include/private/error.h
@@ -1,6 +1,8 @@
 #ifndef XML_ERROR_H_PRIVATE__
 #define XML_ERROR_H_PRIVATE__
 
+#include <stdarg.h>
+
 #include <libxml/xmlerror.h>
 #include <libxml/xmlversion.h>
 
@@ -8,6 +10,9 @@
 
 struct _xmlNode;
 
+XML_HIDDEN int
+xmlIsCatastrophicError(int level, int code);
+
 XML_HIDDEN void
 xmlRaiseMemoryError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel,
                     void *data, int domain, xmlError *error);
@@ -19,16 +24,23 @@
                const char *str2, const char *str3, int int1, int col,
                const char *msg, va_list ap);
 XML_HIDDEN int
-__xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel,
-                void *data, void *ctx, struct _xmlNode *node,
-                int domain, int code, xmlErrorLevel level,
-                const char *file, int line, const char *str1,
-                const char *str2, const char *str3, int int1, int col,
-	        const char *msg, ...) LIBXML_ATTR_FORMAT(16,17);
+xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel,
+              void *data, void *ctx, struct _xmlNode *node,
+              int domain, int code, xmlErrorLevel level,
+              const char *file, int line, const char *str1,
+              const char *str2, const char *str3, int int1, int col,
+              const char *msg, ...) LIBXML_ATTR_FORMAT(16,17);
 XML_HIDDEN void
 xmlGenericErrorDefaultFunc(void *ctx, const char *msg,
                            ...) LIBXML_ATTR_FORMAT(2,3);
 XML_HIDDEN const char *
 xmlErrString(xmlParserErrors code);
 
+XML_HIDDEN void
+xmlVPrintErrorMessage(const char *fmt, va_list ap);
+XML_HIDDEN void
+xmlPrintErrorMessage(const char *fmt, ...);
+XML_HIDDEN void
+xmlAbort(const char *fmt, ...);
+
 #endif /* XML_ERROR_H_PRIVATE__ */
diff --git a/include/private/globals.h b/include/private/globals.h
index 828b6d5..88a3825 100644
--- a/include/private/globals.h
+++ b/include/private/globals.h
@@ -6,9 +6,10 @@
 XML_HIDDEN void
 xmlCleanupGlobalsInternal(void);
 
-#ifdef LIBXML_THREAD_ENABLED
+XML_HIDDEN xmlError *
+xmlGetLastErrorInternal(void);
+
 XML_HIDDEN unsigned *
 xmlGetLocalRngState(void);
-#endif
 
 #endif /* XML_GLOBALS_H_PRIVATE__ */
diff --git a/include/private/html.h b/include/private/html.h
index 6b49929..415be22 100644
--- a/include/private/html.h
+++ b/include/private/html.h
@@ -5,8 +5,8 @@
 
 #ifdef LIBXML_HTML_ENABLED
 
-XML_HIDDEN void
-__htmlParseContent(void *ctx);
+XML_HIDDEN xmlNodePtr
+htmlCtxtParseContentInternal(xmlParserCtxtPtr ctxt, xmlParserInputPtr input);
 
 #endif /* LIBXML_HTML_ENABLED */
 
diff --git a/include/private/io.h b/include/private/io.h
index d116fad..13aa102 100644
--- a/include/private/io.h
+++ b/include/private/io.h
@@ -5,31 +5,40 @@
 #include <libxml/tree.h>
 #include <libxml/xmlversion.h>
 
+/*
+ * Initial buffer size should include
+ *
+ * - MINLEN = 4000 (I/O chunk size)
+ * - INPUT_CHUNK = 250 (parser prefetch)
+ * - LINE_LEN = 80 (shrink limit for error messages)
+ * - some amount for unshrunken content.
+ */
+#define XML_IO_BUFFER_SIZE 6000
+
 XML_HIDDEN void
 xmlInitIOCallbacks(void);
 
 XML_HIDDEN int
-__xmlIOErr(int domain, int code, const char *extra);
-
-XML_HIDDEN int
 xmlNoNetExists(const char *filename);
 
-XML_HIDDEN int
-xmlParserInputBufferCreateFilenameSafe(const char *URI, xmlCharEncoding enc,
-                                       xmlParserInputBufferPtr *out);
+XML_HIDDEN xmlParserErrors
+xmlParserInputBufferCreateUrl(const char *URI, xmlCharEncoding enc,
+                              xmlParserInputFlags flags,
+                              xmlParserInputBufferPtr *out);
 
 XML_HIDDEN xmlParserInputBufferPtr
-xmlNewInputBufferString(const char *str, int flags);
+xmlNewInputBufferString(const char *str, xmlParserInputFlags flags);
 XML_HIDDEN xmlParserInputBufferPtr
-xmlNewInputBufferMemory(const void *mem, size_t size, int flags,
-                        xmlCharEncoding enc);
+xmlNewInputBufferMemory(const void *mem, size_t size,
+                        xmlParserInputFlags flags, xmlCharEncoding enc);
+
+XML_HIDDEN xmlParserErrors
+xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, xmlParserInputFlags flags);
 
 XML_HIDDEN int
 xmlInputFromFd(xmlParserInputBufferPtr buf, int fd, int unzip);
 
 #ifdef LIBXML_OUTPUT_ENABLED
-XML_HIDDEN xmlOutputBufferPtr
-xmlAllocOutputBufferInternal(xmlCharEncodingHandlerPtr encoder);
 XML_HIDDEN void
 xmlOutputBufferWriteQuotedString(xmlOutputBufferPtr buf,
                                  const xmlChar *string);
diff --git a/include/private/lint.h b/include/private/lint.h
new file mode 100644
index 0000000..5c055c3
--- /dev/null
+++ b/include/private/lint.h
@@ -0,0 +1,15 @@
+#ifndef XML_LINT_H_PRIVATE__
+#define XML_LINT_H_PRIVATE__
+
+#include <stdio.h>
+
+#include <libxml/parser.h>
+
+int
+xmllintMain(int argc, const char **argv, FILE *errStream,
+            xmlResourceLoader loader);
+
+void
+xmllintShell(xmlDocPtr doc, const char *filename, FILE *output);
+
+#endif /* XML_LINT_H_PRIVATE__ */
diff --git a/include/private/memory.h b/include/private/memory.h
index ef0497c..754803b 100644
--- a/include/private/memory.h
+++ b/include/private/memory.h
@@ -1,9 +1,58 @@
 #ifndef XML_MEMORY_H_PRIVATE__
 #define XML_MEMORY_H_PRIVATE__
 
+#include "../../libxml.h"
+
+#include <limits.h>
+#include <stddef.h>
+
+#ifndef SIZE_MAX
+  #define SIZE_MAX ((size_t) -1)
+#endif
+
+#define XML_MAX_ITEMS 1000000000 /* 1 billion */
+
 XML_HIDDEN void
 xmlInitMemoryInternal(void);
 XML_HIDDEN void
 xmlCleanupMemoryInternal(void);
 
+/**
+ * xmlGrowCapacity:
+ * @array:  pointer to array
+ * @capacity:  pointer to capacity (in/out)
+ * @elemSize:  size of an element in bytes
+ * @min:  elements in initial allocation
+ * @max:  maximum elements in the array
+ *
+ * Grow an array by at least one element, checking for overflow.
+ *
+ * Returns the new array size on success, -1 on failure.
+ */
+static XML_INLINE int
+xmlGrowCapacity(int capacity, size_t elemSize, int min, int max) {
+    int extra;
+
+    if (capacity <= 0) {
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+        (void) min;
+        return(1);
+#else
+        return(min);
+#endif
+    }
+
+    if ((capacity >= max) ||
+        ((size_t) capacity > SIZE_MAX / 2 / elemSize))
+        return(-1);
+
+    /* Grow by 50% */
+    extra = (capacity + 1) / 2;
+
+    if (capacity > max - extra)
+        return(max);
+
+    return(capacity + extra);
+}
+
 #endif /* XML_MEMORY_H_PRIVATE__ */
diff --git a/include/private/parser.h b/include/private/parser.h
index 4a80042..d5f2fef 100644
--- a/include/private/parser.h
+++ b/include/private/parser.h
@@ -4,6 +4,10 @@
 #include <libxml/parser.h>
 #include <libxml/xmlversion.h>
 
+#define XML_INVALID_CHAR 0x200000
+
+#define XML_MAX_URI_LENGTH 2000
+
 /**
  * XML_VCTXT_DTD_VALIDATED:
  *
@@ -17,6 +21,9 @@
  */
 #define XML_VCTXT_USE_PCTXT (1u << 1)
 
+/*
+ * TODO: Rename to avoid confusion with xmlParserInputFlags
+ */
 #define XML_INPUT_HAS_ENCODING      (1u << 0)
 #define XML_INPUT_AUTO_ENCODING     (7u << 1)
 #define XML_INPUT_AUTO_UTF8         (1u << 1)
@@ -42,6 +49,18 @@
      (((ctxt)->input->entity != NULL) && \
       ((ctxt)->input->entity->etype == XML_EXTERNAL_PARAMETER_ENTITY)))
 
+/**
+ * INPUT_CHUNK:
+ *
+ * The parser tries to always have that amount of input ready.
+ * One of the point is providing context when reporting errors.
+ */
+#define INPUT_CHUNK	250
+
+struct _xmlAttrHashBucket {
+    int index;
+};
+
 XML_HIDDEN void
 xmlCtxtVErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain,
             xmlParserErrors code, xmlErrorLevel level,
@@ -59,6 +78,8 @@
               const char *msg, const xmlChar *str1, const xmlChar *str2);
 XML_HIDDEN void
 xmlCtxtErrIO(xmlParserCtxtPtr ctxt, int code, const char *uri);
+XML_HIDDEN int
+xmlCtxtIsCatastrophicError(xmlParserCtxtPtr ctxt);
 
 XML_HIDDEN void
 xmlHaltParser(xmlParserCtxtPtr ctxt);
@@ -74,6 +95,11 @@
 XML_HIDDEN const xmlChar *
 xmlGetActualEncoding(xmlParserCtxtPtr ctxt);
 
+XML_HIDDEN int
+nodePush(xmlParserCtxtPtr ctxt, xmlNodePtr value);
+XML_HIDDEN xmlNodePtr
+nodePop(xmlParserCtxtPtr ctxt);
+
 XML_HIDDEN xmlParserNsData *
 xmlParserNsCreate(void);
 XML_HIDDEN void
@@ -88,38 +114,39 @@
 XML_HIDDEN void *
 xmlParserNsLookupSax(xmlParserCtxtPtr ctxt, const xmlChar *prefix);
 
-#define XML_INPUT_BUF_STATIC		(1u << 1)
-#define XML_INPUT_BUF_ZERO_TERMINATED	(1u << 2)
-#define XML_INPUT_UNZIP			(1u << 3)
-
-/* Internal parser option */
-#define XML_PARSE_UNZIP     (1 << 24)
-
 XML_HIDDEN xmlParserInputPtr
-xmlNewInputURL(xmlParserCtxtPtr ctxt, const char *url, const char *publicId,
-               const char *encoding, int flags);
+xmlLoadResource(xmlParserCtxtPtr ctxt, const char *url, const char *publicId,
+                xmlResourceType type);
 XML_HIDDEN xmlParserInputPtr
-xmlNewInputMemory(xmlParserCtxtPtr ctxt, const char *url,
-                  const void *mem, size_t size,
-                  const char *encoding, int flags);
+xmlCtxtNewInputFromUrl(xmlParserCtxtPtr ctxt, const char *url,
+                       const char *publicId, const char *encoding,
+                       xmlParserInputFlags flags);
 XML_HIDDEN xmlParserInputPtr
-xmlNewInputString(xmlParserCtxtPtr ctxt, const char *url, const char *str,
-                  const char *encoding, int flags);
+xmlCtxtNewInputFromMemory(xmlParserCtxtPtr ctxt, const char *url,
+                          const void *mem, size_t size,
+                          const char *encoding,
+                          xmlParserInputFlags flags);
 XML_HIDDEN xmlParserInputPtr
-xmlNewInputFd(xmlParserCtxtPtr ctxt, const char *filename, int fd,
-              const char *encoding, int flags);
+xmlCtxtNewInputFromString(xmlParserCtxtPtr ctxt, const char *url,
+                          const char *str, const char *encoding,
+                          xmlParserInputFlags flags);
 XML_HIDDEN xmlParserInputPtr
-xmlNewInputIO(xmlParserCtxtPtr ctxt, const char *url,
-              xmlInputReadCallback ioRead,
-              xmlInputCloseCallback ioClose,
-              void *ioCtxt,
-              const char *encoding, int flags);
+xmlCtxtNewInputFromFd(xmlParserCtxtPtr ctxt, const char *filename, int fd,
+                      const char *encoding, xmlParserInputFlags flags);
 XML_HIDDEN xmlParserInputPtr
-xmlNewInputPush(xmlParserCtxtPtr ctxt, const char *url,
-                const char *chunk, int size, const char *encoding);
+xmlCtxtNewInputFromIO(xmlParserCtxtPtr ctxt, const char *url,
+                      xmlInputReadCallback ioRead,
+                      xmlInputCloseCallback ioClose,
+                      void *ioCtxt,
+                      const char *encoding, xmlParserInputFlags flags);
+XML_HIDDEN xmlParserInputPtr
+xmlNewPushInput(const char *url, const char *chunk, int size);
 
 XML_HIDDEN xmlChar *
 xmlExpandEntitiesInAttValue(xmlParserCtxtPtr ctxt, const xmlChar *str,
                             int normalize);
 
+XML_HIDDEN void
+xmlParserCheckEOF(xmlParserCtxtPtr ctxt, xmlParserErrors code);
+
 #endif /* XML_PARSER_H_PRIVATE__ */
diff --git a/include/private/threads.h b/include/private/threads.h
index 473bc7c..95b3825 100644
--- a/include/private/threads.h
+++ b/include/private/threads.h
@@ -4,13 +4,17 @@
 #include <libxml/threads.h>
 
 #ifdef LIBXML_THREAD_ENABLED
-  #ifdef HAVE_PTHREAD_H
-    #include <pthread.h>
-    #define HAVE_POSIX_THREADS
-  #elif defined(_WIN32)
+  #ifdef _WIN32
     #define WIN32_LEAN_AND_MEAN
+    #ifdef _WIN32_WINNT
+      #undef _WIN32_WINNT
+    #endif
+    #define _WIN32_WINNT 0x0600
     #include <windows.h>
     #define HAVE_WIN32_THREADS
+  #else
+    #include <pthread.h>
+    #define HAVE_POSIX_THREADS
   #endif
 #endif
 
@@ -27,9 +31,31 @@
 #endif
 };
 
+/*
+ * xmlRMutex are reentrant mutual exception locks
+ */
+struct _xmlRMutex {
+#ifdef HAVE_POSIX_THREADS
+    pthread_mutex_t lock;
+    unsigned int held;
+    unsigned int waiters;
+    pthread_t tid;
+    pthread_cond_t cv;
+#elif defined HAVE_WIN32_THREADS
+    CRITICAL_SECTION cs;
+#else
+    int empty;
+#endif
+};
+
 XML_HIDDEN void
 xmlInitMutex(xmlMutexPtr mutex);
 XML_HIDDEN void
 xmlCleanupMutex(xmlMutexPtr mutex);
 
+XML_HIDDEN void
+xmlInitRMutex(xmlRMutexPtr mutex);
+XML_HIDDEN void
+xmlCleanupRMutex(xmlRMutexPtr mutex);
+
 #endif /* XML_THREADS_H_PRIVATE__ */
diff --git a/include/private/tree.h b/include/private/tree.h
index 2d651d5..131e80c 100644
--- a/include/private/tree.h
+++ b/include/private/tree.h
@@ -1,13 +1,8 @@
 #ifndef XML_TREE_H_PRIVATE__
 #define XML_TREE_H_PRIVATE__
 
-/*
- * Internal variable indicating if a callback has been registered for
- * node creation/destruction. It avoids spending a lot of time in locking
- * function while checking if the callback exists.
- */
 XML_HIDDEN extern int
-__xmlRegisterCallbacks;
+xmlRegisterCallbacks;
 
 XML_HIDDEN int
 xmlSearchNsSafe(xmlNodePtr node, const xmlChar *href, xmlNsPtr *out);
diff --git a/include/private/unicode.h b/include/private/unicode.h
new file mode 100644
index 0000000..2765263
--- /dev/null
+++ b/include/private/unicode.h
@@ -0,0 +1,44 @@
+#ifndef XML_UNICODE_H_PRIVATE__
+#define XML_UNICODE_H_PRIVATE__
+
+XML_HIDDEN int xmlUCSIsBlock	(int code, const char *block);
+XML_HIDDEN int xmlUCSIsCat	(int code, const char *cat);
+
+XML_HIDDEN int xmlUCSIsCatC	(int code);
+XML_HIDDEN int xmlUCSIsCatCc	(int code);
+XML_HIDDEN int xmlUCSIsCatCf	(int code);
+XML_HIDDEN int xmlUCSIsCatCo	(int code);
+XML_HIDDEN int xmlUCSIsCatCs	(int code);
+XML_HIDDEN int xmlUCSIsCatL	(int code);
+XML_HIDDEN int xmlUCSIsCatLl	(int code);
+XML_HIDDEN int xmlUCSIsCatLm	(int code);
+XML_HIDDEN int xmlUCSIsCatLo	(int code);
+XML_HIDDEN int xmlUCSIsCatLt	(int code);
+XML_HIDDEN int xmlUCSIsCatLu	(int code);
+XML_HIDDEN int xmlUCSIsCatM	(int code);
+XML_HIDDEN int xmlUCSIsCatMc	(int code);
+XML_HIDDEN int xmlUCSIsCatMe	(int code);
+XML_HIDDEN int xmlUCSIsCatMn	(int code);
+XML_HIDDEN int xmlUCSIsCatN	(int code);
+XML_HIDDEN int xmlUCSIsCatNd	(int code);
+XML_HIDDEN int xmlUCSIsCatNl	(int code);
+XML_HIDDEN int xmlUCSIsCatNo	(int code);
+XML_HIDDEN int xmlUCSIsCatP	(int code);
+XML_HIDDEN int xmlUCSIsCatPc	(int code);
+XML_HIDDEN int xmlUCSIsCatPd	(int code);
+XML_HIDDEN int xmlUCSIsCatPe	(int code);
+XML_HIDDEN int xmlUCSIsCatPf	(int code);
+XML_HIDDEN int xmlUCSIsCatPi	(int code);
+XML_HIDDEN int xmlUCSIsCatPo	(int code);
+XML_HIDDEN int xmlUCSIsCatPs	(int code);
+XML_HIDDEN int xmlUCSIsCatS	(int code);
+XML_HIDDEN int xmlUCSIsCatSc	(int code);
+XML_HIDDEN int xmlUCSIsCatSk	(int code);
+XML_HIDDEN int xmlUCSIsCatSm	(int code);
+XML_HIDDEN int xmlUCSIsCatSo	(int code);
+XML_HIDDEN int xmlUCSIsCatZ	(int code);
+XML_HIDDEN int xmlUCSIsCatZl	(int code);
+XML_HIDDEN int xmlUCSIsCatZp	(int code);
+XML_HIDDEN int xmlUCSIsCatZs	(int code);
+
+#endif /* XML_UNICODE_H_PRIVATE__ */
diff --git a/include/wsockcompat.h b/include/wsockcompat.h
index 141de0c..a9af26b 100644
--- a/include/wsockcompat.h
+++ b/include/wsockcompat.h
@@ -30,10 +30,6 @@
 #endif
 #endif
 
-#ifndef XML_SOCKLEN_T
-#define XML_SOCKLEN_T int
-#endif
-
 #ifndef ECONNRESET
 #define ECONNRESET WSAECONNRESET
 #endif
diff --git a/iso8859x.inc b/iso8859x.inc
new file mode 100644
index 0000000..f8d6b31
--- /dev/null
+++ b/iso8859x.inc
@@ -0,0 +1,730 @@
+/************************************************************************
+ * Lookup tables for ISO-8859-2..ISO-8859-16 transcoding                *
+ ************************************************************************/
+
+static const unsigned short xmlunicodetable_ISO8859_2 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7,
+    0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b,
+    0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7,
+    0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c,
+    0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7,
+    0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e,
+    0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7,
+    0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df,
+    0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7,
+    0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f,
+    0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7,
+    0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_2 [48 + 6 * 64] = {
+    "\x00\x00\x01\x05\x02\x04\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\xa4\x00\x00\xa7\xa8\x00\x00\x00\x00\xad\x00\x00"
+    "\xb0\x00\x00\x00\xb4\x00\x00\x00\xb8\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\xc3\xe3\xa1\xb1\xc6\xe6\x00\x00\x00\x00\xc8\xe8\xcf\xef"
+    "\xd0\xf0\x00\x00\x00\x00\x00\x00\xca\xea\xcc\xec\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc5\xe5\x00\x00\xa5\xb5\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xff\x00\xb2\x00\xbd\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\xa3\xb3\xd1\xf1\x00\x00\xd2\xf2\x00\x00\x00\x00\x00\x00\x00"
+    "\xd5\xf5\x00\x00\xc0\xe0\x00\x00\xd8\xf8\xa6\xb6\x00\x00\xaa\xba"
+    "\xa9\xb9\xde\xfe\xab\xbb\x00\x00\x00\x00\x00\x00\x00\x00\xd9\xf9"
+    "\xdb\xfb\x00\x00\x00\x00\x00\x00\x00\xac\xbc\xaf\xbf\xae\xbe\x00"
+    "\x00\xc1\xc2\x00\xc4\x00\x00\xc7\x00\xc9\x00\xcb\x00\xcd\xce\x00"
+    "\x00\x00\x00\xd3\xd4\x00\xd6\xd7\x00\x00\xda\x00\xdc\xdd\x00\xdf"
+    "\x00\xe1\xe2\x00\xe4\x00\x00\xe7\x00\xe9\x00\xeb\x00\xed\xee\x00"
+    "\x00\x00\x00\xf3\xf4\x00\xf6\xf7\x00\x00\xfa\x00\xfc\xfd\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_3 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7,
+    0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b,
+    0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7,
+    0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c,
+    0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7,
+    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+    0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7,
+    0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df,
+    0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7,
+    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7,
+    0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_3 [48 + 7 * 64] = {
+    "\x04\x00\x01\x06\x02\x05\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\xa3\xa4\x00\x00\xa7\xa8\x00\x00\x00\x00\xad\x00\x00"
+    "\xb0\x00\xb2\xb3\xb4\xb5\x00\xb7\xb8\x00\x00\x00\x00\xbd\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\xc6\xe6\xc5\xe5\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd8\xf8\xab\xbb"
+    "\xd5\xf5\x00\x00\xa6\xb6\xa1\xb1\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xa9\xb9\x00\x00\xac\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\xa2\xff\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe\xaa\xba"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\xfd\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xaf\xbf\x00\x00\x00"
+    "\xc0\xc1\xc2\x00\xc4\x00\x00\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\x00\xd1\xd2\xd3\xd4\x00\xd6\xd7\x00\xd9\xda\xdb\xdc\x00\x00\xdf"
+    "\xe0\xe1\xe2\x00\xe4\x00\x00\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\x00\xf1\xf2\xf3\xf4\x00\xf6\xf7\x00\xf9\xfa\xfb\xfc\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_4 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7,
+    0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af,
+    0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7,
+    0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b,
+    0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e,
+    0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a,
+    0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
+    0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df,
+    0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f,
+    0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b,
+    0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+    0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_4 [48 + 6 * 64] = {
+    "\x00\x00\x01\x05\x02\x03\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\xa4\x00\x00\xa7\xa8\x00\x00\x00\x00\xad\x00\xaf"
+    "\xb0\x00\x00\x00\xb4\x00\x00\x00\xb8\x00\x00\x00\x00\x00\x00\x00"
+    "\xc0\xe0\x00\x00\xa1\xb1\x00\x00\x00\x00\x00\x00\xc8\xe8\x00\x00"
+    "\xd0\xf0\xaa\xba\x00\x00\xcc\xec\xca\xea\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\xab\xbb\x00\x00\x00\x00\xa5\xb5\xcf\xef\x00\x00\xc7\xe7"
+    "\x00\x00\x00\x00\x00\x00\xd3\xf3\xa2\x00\x00\xa6\xb6\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\xd1\xf1\x00\x00\x00\xbd\xbf\xd2\xf2\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\xa3\xb3\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xa9\xb9\x00\x00\x00\x00\xac\xbc\xdd\xfd\xde\xfe\x00\x00\x00\x00"
+    "\x00\x00\xd9\xf9\x00\x00\x00\x00\x00\x00\x00\x00\x00\xae\xbe\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\xb2\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\x00"
+    "\x00\x00\x00\x00\xd4\xd5\xd6\xd7\xd8\x00\xda\xdb\xdc\x00\x00\xdf"
+    "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\x00"
+    "\x00\x00\x00\x00\xf4\xf5\xf6\xf7\xf8\x00\xfa\xfb\xfc\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_5 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
+    0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f,
+    0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
+    0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
+    0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
+    0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
+    0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
+    0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
+    0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
+    0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
+    0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
+    0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_5 [48 + 6 * 64] = {
+    "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\x00\x00\x00\xfd\x00\x00\x00\x00\x00\xad\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\x00\xae\xaf"
+    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\x00\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\x00\xfe\xff"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_6 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f,
+    0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
+    0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
+    0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
+    0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
+    0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
+    0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_6 [48 + 5 * 64] = {
+    "\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x04\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00\x00\xad\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x00\x00\xbf"
+    "\x00\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\x00\x00\x00\x00\x00"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\xf0\xf1\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_7 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x2018, 0x2019, 0x00a3, 0x0000, 0x0000, 0x00a6, 0x00a7,
+    0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015,
+    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7,
+    0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f,
+    0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
+    0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
+    0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
+    0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af,
+    0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
+    0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
+    0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
+    0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_7 [48 + 7 * 64] = {
+    "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x06"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\xa3\x00\x00\xa6\xa7\xa8\xa9\x00\xab\xac\xad\x00\x00"
+    "\xb0\xb1\xb2\xb3\x00\x00\x00\xb7\x00\x00\x00\xbb\x00\xbd\x00\x00"
+    "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\xaf\x00\x00\xa1\xa2\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\xb4\xb5\xb6\x00\xb8\xb9\xba\x00\xbc\x00\xbe\xbf"
+    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\xd0\xd1\x00\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_8 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+    0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
+    0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017,
+    0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
+    0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
+    0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
+    0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_8 [48 + 7 * 64] = {
+    "\x02\x00\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\x00\xab\xac\xad\xae\xaf"
+    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\x00\xbb\xbc\xbd\xbe\x00"
+    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\xaa\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\xba\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfd\xfe"
+    "\x00\x00\x00\x00\x00\x00\x00\xdf\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_9 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
+    0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
+    0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
+    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+    0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
+    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df,
+    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_9 [48 + 5 * 64] = {
+    "\x00\x00\x01\x02\x03\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\x00\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\x00\x00\xdf"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\x00\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\x00\x00\xff"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xf0"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xdd\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_10 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7,
+    0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a,
+    0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7,
+    0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b,
+    0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e,
+    0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf,
+    0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168,
+    0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
+    0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f,
+    0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef,
+    0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169,
+    0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_10 [48 + 7 * 64] = {
+    "\x00\x00\x01\x06\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\x00\x00\x00\xa7\x00\x00\x00\x00\x00\xad\x00\x00"
+    "\xb0\x00\x00\x00\x00\x00\x00\xb7\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xc0\xe0\x00\x00\xa1\xb1\x00\x00\x00\x00\x00\x00\xc8\xe8\x00\x00"
+    "\xa9\xb9\xa2\xb2\x00\x00\xcc\xec\xca\xea\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\xa3\xb3\x00\x00\x00\x00\xa5\xb5\xa4\xb4\x00\x00\xc7\xe7"
+    "\x00\x00\x00\x00\x00\x00\xa6\xb6\xff\x00\x00\xa8\xb8\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\xd1\xf1\x00\x00\x00\xaf\xbf\xd2\xf2\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xaa\xba\x00\x00\x00\x00\xab\xbb\xd7\xf7\xae\xbe\x00\x00\x00\x00"
+    "\x00\x00\xd9\xf9\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\xbc\x00"
+    "\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\xcf"
+    "\xd0\x00\x00\xd3\xd4\xd5\xd6\x00\xd8\x00\xda\xdb\xdc\xdd\xde\xdf"
+    "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\xef"
+    "\xf0\x00\x00\xf3\xf4\xf5\xf6\x00\xf8\x00\xfa\xfb\xfc\xfd\xfe\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_11 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
+    0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
+    0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
+    0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
+    0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
+    0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
+    0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
+    0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f,
+    0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
+    0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
+    0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
+    0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_11 [48 + 6 * 64] = {
+    "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x05\x00\x00\x00\x00\x00\x00"
+    "\x00\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
+    "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
+    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\x00\x00\x00\x00\xdf"
+    "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_13 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7,
+    0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6,
+    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7,
+    0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6,
+    0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112,
+    0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b,
+    0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7,
+    0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df,
+    0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113,
+    0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c,
+    0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7,
+    0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_13 [48 + 7 * 64] = {
+    "\x00\x00\x01\x04\x06\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\xa2\xa3\xa4\x00\xa6\xa7\x00\xa9\x00\xab\xac\xad\xae\x00"
+    "\xb0\xb1\xb2\xb3\x00\xb5\xb6\xb7\x00\xb9\x00\xbb\xbc\xbd\xbe\x00"
+    "\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x00\xb4\xa1\xa5\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\xc4\xc5\xaf\x00\x00\xc9\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\xd3\x00\xd5\xd6\xd7\xa8\x00\x00\x00\xdc\x00\x00\xdf"
+    "\x00\x00\x00\x00\xe4\xe5\xbf\x00\x00\xe9\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\xf3\x00\xf5\xf6\xf7\xb8\x00\x00\x00\xfc\x00\x00\x00"
+    "\x00\xd9\xf9\xd1\xf1\xd2\xf2\x00\x00\x00\x00\x00\xd4\xf4\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\xaa\xba\x00\x00\xda\xfa\x00\x00\x00\x00"
+    "\xd0\xf0\x00\x00\x00\x00\x00\x00\x00\x00\xdb\xfb\x00\x00\x00\x00"
+    "\x00\x00\xd8\xf8\x00\x00\x00\x00\x00\xca\xea\xdd\xfd\xde\xfe\x00"
+    "\xc2\xe2\x00\x00\xc0\xe0\xc3\xe3\x00\x00\x00\x00\xc8\xe8\x00\x00"
+    "\x00\x00\xc7\xe7\x00\x00\xcb\xeb\xc6\xe6\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\xcc\xec\x00\x00\x00\x00\x00\x00\xce\xee\x00\x00\xc1\xe1"
+    "\x00\x00\x00\x00\x00\x00\xcd\xed\x00\x00\x00\xcf\xef\x00\x00\x00"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_14 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7,
+    0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178,
+    0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56,
+    0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61,
+    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+    0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a,
+    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df,
+    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b,
+    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_14 [48 + 10 * 64] = {
+    "\x00\x00\x01\x09\x04\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\xa3\x00\x00\x00\xa7\x00\xa9\x00\x00\x00\xad\xae\x00"
+    "\x00\x00\x00\x00\x00\x00\xb6\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x08\x05\x06\x00\x00\x00\x00"
+    "\x00\x00\xa1\xa2\x00\x00\x00\x00\x00\x00\xa6\xab\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0\xb1"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\xa5\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xb2\xb3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xa8\xb8\xaa\xba\xbd\xbe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\xac\xbc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\xd0\xf0\xde\xfe\xaf\x00\x00\x00\x00\x00\x00\x00"
+    "\xb4\xb5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\xb7\xb9\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xbb\xbf\x00\x00\x00\x00\x00\x00\x00\x00\xd7\xf7\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\x00\xd1\xd2\xd3\xd4\xd5\xd6\x00\xd8\xd9\xda\xdb\xdc\xdd\x00\xdf"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\x00\xf1\xf2\xf3\xf4\xf5\xf6\x00\xf8\xf9\xfa\xfb\xfc\xfd\x00\xff"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_15 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7,
+    0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
+    0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7,
+    0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf,
+    0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
+    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+    0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
+    0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
+    0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
+    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
+    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_15 [48 + 6 * 64] = {
+    "\x00\x00\x01\x05\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\xa1\xa2\xa3\x00\xa5\x00\xa7\x00\xa9\xaa\xab\xac\xad\xae\xaf"
+    "\xb0\xb1\xb2\xb3\x00\xb5\xb6\xb7\x00\xb9\xba\xbb\x00\x00\x00\xbf"
+    "\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\xbc\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xa6\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x00\x00\x00\x00\xb4\xb8\x00"
+    "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
+    "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
+};
+
+static const unsigned short xmlunicodetable_ISO8859_16 [128] = {
+    0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
+    0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
+    0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
+    0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
+    0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7,
+    0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b,
+    0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7,
+    0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c,
+    0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7,
+    0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
+    0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a,
+    0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df,
+    0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7,
+    0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
+    0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b,
+    0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff,
+};
+
+static const unsigned char xmltranscodetable_ISO8859_16 [48 + 9 * 64] = {
+    "\x00\x00\x01\x08\x02\x03\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
+    "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
+    "\xa0\x00\x00\x00\x00\x00\x00\xa7\x00\xa9\x00\xab\x00\xad\x00\x00"
+    "\xb0\xb1\x00\x00\x00\x00\xb6\xb7\x00\x00\x00\xbb\x00\x00\x00\x00"
+    "\x00\x00\xc3\xe3\xa1\xa2\xc5\xe5\x00\x00\x00\x00\xb2\xb9\x00\x00"
+    "\xd0\xf0\x00\x00\x00\x00\x00\x00\xdd\xfd\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\xa3\xb3\xd1\xf1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xd5\xf5\xbc\xbd\x00\x00\x00\x00\x00\x00\xd7\xf7\x00\x00\x00\x00"
+    "\xa6\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xd8\xf8\x00\x00\x00\x00\x00\x00\xbe\xac\xae\xaf\xbf\xb4\xb8\x00"
+    "\x06\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xa4\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb5\xa5\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\xaa\xba\xde\xfe\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
+    "\xc0\xc1\xc2\x00\xc4\x00\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
+    "\x00\x00\xd2\xd3\xd4\x00\xd6\x00\x00\xd9\xda\xdb\xdc\x00\x00\xdf"
+    "\xe0\xe1\xe2\x00\xe4\x00\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
+    "\x00\x00\xf2\xf3\xf4\x00\xf6\x00\x00\xf9\xfa\xfb\xfc\x00\x00\xff"
+};
+
diff --git a/legacy.c b/legacy.c
deleted file mode 100644
index ac80c0e..0000000
--- a/legacy.c
+++ /dev/null
@@ -1,1776 +0,0 @@
-/*
- * legacy.c: set of deprecated routines, not to be used anymore but
- *           kept purely for ABI compatibility
- *
- * See Copyright for the status of this software.
- *
- * daniel@veillard.com
- */
-
-#define IN_LIBXML
-#include "libxml.h"
-
-#ifdef LIBXML_LEGACY_ENABLED
-#include <stdio.h>
-#include <string.h>
-
-#include <libxml/tree.h>
-#include <libxml/entities.h>
-#include <libxml/SAX.h>
-#include <libxml/parserInternals.h>
-#include <libxml/HTMLparser.h>
-
-void xmlUpgradeOldNs(xmlDocPtr doc);
-
-/************************************************************************
- *									*
- *		Deprecated functions kept for compatibility		*
- *									*
- ************************************************************************/
-
-#ifdef LIBXML_HTML_ENABLED
-xmlChar *htmlDecodeEntities(htmlParserCtxtPtr ctxt, int len, xmlChar end,
-                            xmlChar end2, xmlChar end3);
-
-/**
- * htmlDecodeEntities:
- * @ctxt:  the parser context
- * @len:  the len to decode (in bytes !), -1 for no size limit
- * @end:  an end marker xmlChar, 0 if none
- * @end2:  an end marker xmlChar, 0 if none
- * @end3:  an end marker xmlChar, 0 if none
- *
- * Substitute the HTML entities by their value
- *
- * DEPRECATED !!!!
- *
- * Returns A newly allocated string with the substitution done. The caller
- *      must deallocate it !
- */
-xmlChar *
-htmlDecodeEntities(htmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
-                   int len ATTRIBUTE_UNUSED, xmlChar end ATTRIBUTE_UNUSED,
-                   xmlChar end2 ATTRIBUTE_UNUSED,
-                   xmlChar end3 ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "htmlDecodeEntities() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-#endif
-
-/**
- * xmlInitializePredefinedEntities:
- *
- * Set up the predefined entities.
- * Deprecated call
- */
-void
-xmlInitializePredefinedEntities(void)
-{
-}
-
-/**
- * xmlCleanupPredefinedEntities:
- *
- * Cleanup up the predefined entities table.
- * Deprecated call
- */
-void
-xmlCleanupPredefinedEntities(void)
-{
-}
-
-static const char* const xmlFeaturesList[] = {
-    "validate",
-    "load subset",
-    "keep blanks",
-    "disable SAX",
-    "fetch external entities",
-    "substitute entities",
-    "gather line info",
-    "user data",
-    "is html",
-    "is standalone",
-    "stop parser",
-    "document",
-    "is well formed",
-    "is valid",
-    "SAX block",
-    "SAX function internalSubset",
-    "SAX function isStandalone",
-    "SAX function hasInternalSubset",
-    "SAX function hasExternalSubset",
-    "SAX function resolveEntity",
-    "SAX function getEntity",
-    "SAX function entityDecl",
-    "SAX function notationDecl",
-    "SAX function attributeDecl",
-    "SAX function elementDecl",
-    "SAX function unparsedEntityDecl",
-    "SAX function setDocumentLocator",
-    "SAX function startDocument",
-    "SAX function endDocument",
-    "SAX function startElement",
-    "SAX function endElement",
-    "SAX function reference",
-    "SAX function characters",
-    "SAX function ignorableWhitespace",
-    "SAX function processingInstruction",
-    "SAX function comment",
-    "SAX function warning",
-    "SAX function error",
-    "SAX function fatalError",
-    "SAX function getParameterEntity",
-    "SAX function cdataBlock",
-    "SAX function externalSubset",
-};
-
-/**
- * xmlGetFeaturesList:
- * @len:  the length of the features name array (input/output)
- * @result:  an array of string to be filled with the features name.
- *
- * Copy at most *@len feature names into the @result array
- *
- * Returns -1 in case or error, or the total number of features,
- *            len is updated with the number of strings copied,
- *            strings must not be deallocated
- */
-int
-xmlGetFeaturesList(int *len, const char **result)
-{
-    int ret, i;
-
-    ret = sizeof(xmlFeaturesList) / sizeof(xmlFeaturesList[0]);
-    if ((len == NULL) || (result == NULL))
-        return (ret);
-    if ((*len < 0) || (*len >= 1000))
-        return (-1);
-    if (*len > ret)
-        *len = ret;
-    for (i = 0; i < *len; i++)
-        result[i] = xmlFeaturesList[i];
-    return (ret);
-}
-
-/**
- * xmlGetFeature:
- * @ctxt:  an XML/HTML parser context
- * @name:  the feature name
- * @result:  location to store the result
- *
- * Read the current value of one feature of this parser instance
- *
- * Returns -1 in case or error, 0 otherwise
- */
-int
-xmlGetFeature(xmlParserCtxtPtr ctxt, const char *name, void *result)
-{
-    if ((ctxt == NULL) || (name == NULL) || (result == NULL))
-        return (-1);
-
-    if (!strcmp(name, "validate")) {
-        *((int *) result) = ctxt->validate;
-    } else if (!strcmp(name, "keep blanks")) {
-        *((int *) result) = ctxt->keepBlanks;
-    } else if (!strcmp(name, "disable SAX")) {
-        *((int *) result) = ctxt->disableSAX;
-    } else if (!strcmp(name, "fetch external entities")) {
-        *((int *) result) = ctxt->loadsubset;
-    } else if (!strcmp(name, "substitute entities")) {
-        *((int *) result) = ctxt->replaceEntities;
-    } else if (!strcmp(name, "gather line info")) {
-        *((int *) result) = ctxt->record_info;
-    } else if (!strcmp(name, "user data")) {
-        *((void **) result) = ctxt->userData;
-    } else if (!strcmp(name, "is html")) {
-        *((int *) result) = ctxt->html;
-    } else if (!strcmp(name, "is standalone")) {
-        *((int *) result) = ctxt->standalone;
-    } else if (!strcmp(name, "document")) {
-        *((xmlDocPtr *) result) = ctxt->myDoc;
-    } else if (!strcmp(name, "is well formed")) {
-        *((int *) result) = ctxt->wellFormed;
-    } else if (!strcmp(name, "is valid")) {
-        *((int *) result) = ctxt->valid;
-    } else if (!strcmp(name, "SAX block")) {
-        *((xmlSAXHandlerPtr *) result) = ctxt->sax;
-    } else if (!strcmp(name, "SAX function internalSubset")) {
-        *((internalSubsetSAXFunc *) result) = ctxt->sax->internalSubset;
-    } else if (!strcmp(name, "SAX function isStandalone")) {
-        *((isStandaloneSAXFunc *) result) = ctxt->sax->isStandalone;
-    } else if (!strcmp(name, "SAX function hasInternalSubset")) {
-        *((hasInternalSubsetSAXFunc *) result) =
-            ctxt->sax->hasInternalSubset;
-    } else if (!strcmp(name, "SAX function hasExternalSubset")) {
-        *((hasExternalSubsetSAXFunc *) result) =
-            ctxt->sax->hasExternalSubset;
-    } else if (!strcmp(name, "SAX function resolveEntity")) {
-        *((resolveEntitySAXFunc *) result) = ctxt->sax->resolveEntity;
-    } else if (!strcmp(name, "SAX function getEntity")) {
-        *((getEntitySAXFunc *) result) = ctxt->sax->getEntity;
-    } else if (!strcmp(name, "SAX function entityDecl")) {
-        *((entityDeclSAXFunc *) result) = ctxt->sax->entityDecl;
-    } else if (!strcmp(name, "SAX function notationDecl")) {
-        *((notationDeclSAXFunc *) result) = ctxt->sax->notationDecl;
-    } else if (!strcmp(name, "SAX function attributeDecl")) {
-        *((attributeDeclSAXFunc *) result) = ctxt->sax->attributeDecl;
-    } else if (!strcmp(name, "SAX function elementDecl")) {
-        *((elementDeclSAXFunc *) result) = ctxt->sax->elementDecl;
-    } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
-        *((unparsedEntityDeclSAXFunc *) result) =
-            ctxt->sax->unparsedEntityDecl;
-    } else if (!strcmp(name, "SAX function setDocumentLocator")) {
-        *((setDocumentLocatorSAXFunc *) result) =
-            ctxt->sax->setDocumentLocator;
-    } else if (!strcmp(name, "SAX function startDocument")) {
-        *((startDocumentSAXFunc *) result) = ctxt->sax->startDocument;
-    } else if (!strcmp(name, "SAX function endDocument")) {
-        *((endDocumentSAXFunc *) result) = ctxt->sax->endDocument;
-    } else if (!strcmp(name, "SAX function startElement")) {
-        *((startElementSAXFunc *) result) = ctxt->sax->startElement;
-    } else if (!strcmp(name, "SAX function endElement")) {
-        *((endElementSAXFunc *) result) = ctxt->sax->endElement;
-    } else if (!strcmp(name, "SAX function reference")) {
-        *((referenceSAXFunc *) result) = ctxt->sax->reference;
-    } else if (!strcmp(name, "SAX function characters")) {
-        *((charactersSAXFunc *) result) = ctxt->sax->characters;
-    } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
-        *((ignorableWhitespaceSAXFunc *) result) =
-            ctxt->sax->ignorableWhitespace;
-    } else if (!strcmp(name, "SAX function processingInstruction")) {
-        *((processingInstructionSAXFunc *) result) =
-            ctxt->sax->processingInstruction;
-    } else if (!strcmp(name, "SAX function comment")) {
-        *((commentSAXFunc *) result) = ctxt->sax->comment;
-    } else if (!strcmp(name, "SAX function warning")) {
-        *((warningSAXFunc *) result) = ctxt->sax->warning;
-    } else if (!strcmp(name, "SAX function error")) {
-        *((errorSAXFunc *) result) = ctxt->sax->error;
-    } else if (!strcmp(name, "SAX function fatalError")) {
-        *((fatalErrorSAXFunc *) result) = ctxt->sax->fatalError;
-    } else if (!strcmp(name, "SAX function getParameterEntity")) {
-        *((getParameterEntitySAXFunc *) result) =
-            ctxt->sax->getParameterEntity;
-    } else if (!strcmp(name, "SAX function cdataBlock")) {
-        *((cdataBlockSAXFunc *) result) = ctxt->sax->cdataBlock;
-    } else if (!strcmp(name, "SAX function externalSubset")) {
-        *((externalSubsetSAXFunc *) result) = ctxt->sax->externalSubset;
-    } else {
-        return (-1);
-    }
-    return (0);
-}
-
-/**
- * xmlSetFeature:
- * @ctxt:  an XML/HTML parser context
- * @name:  the feature name
- * @value:  pointer to the location of the new value
- *
- * Change the current value of one feature of this parser instance
- *
- * Returns -1 in case or error, 0 otherwise
- */
-int
-xmlSetFeature(xmlParserCtxtPtr ctxt, const char *name, void *value)
-{
-    if ((ctxt == NULL) || (name == NULL) || (value == NULL))
-        return (-1);
-
-    if (!strcmp(name, "validate")) {
-        int newvalidate = *((int *) value);
-
-        if ((!ctxt->validate) && (newvalidate != 0)) {
-            if (ctxt->vctxt.warning == NULL)
-                ctxt->vctxt.warning = xmlParserValidityWarning;
-            if (ctxt->vctxt.error == NULL)
-                ctxt->vctxt.error = xmlParserValidityError;
-            ctxt->vctxt.nodeMax = 0;
-        }
-        ctxt->validate = newvalidate;
-    } else if (!strcmp(name, "keep blanks")) {
-        ctxt->keepBlanks = *((int *) value);
-    } else if (!strcmp(name, "disable SAX")) {
-        ctxt->disableSAX = *((int *) value);
-    } else if (!strcmp(name, "fetch external entities")) {
-        ctxt->loadsubset = *((int *) value);
-    } else if (!strcmp(name, "substitute entities")) {
-        ctxt->replaceEntities = *((int *) value);
-    } else if (!strcmp(name, "gather line info")) {
-        ctxt->record_info = *((int *) value);
-    } else if (!strcmp(name, "user data")) {
-        ctxt->userData = *((void **) value);
-    } else if (!strcmp(name, "is html")) {
-        ctxt->html = *((int *) value);
-    } else if (!strcmp(name, "is standalone")) {
-        ctxt->standalone = *((int *) value);
-    } else if (!strcmp(name, "document")) {
-        ctxt->myDoc = *((xmlDocPtr *) value);
-    } else if (!strcmp(name, "is well formed")) {
-        ctxt->wellFormed = *((int *) value);
-    } else if (!strcmp(name, "is valid")) {
-        ctxt->valid = *((int *) value);
-    } else if (!strcmp(name, "SAX block")) {
-        ctxt->sax = *((xmlSAXHandlerPtr *) value);
-    } else if (!strcmp(name, "SAX function internalSubset")) {
-        ctxt->sax->internalSubset = *((internalSubsetSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function isStandalone")) {
-        ctxt->sax->isStandalone = *((isStandaloneSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function hasInternalSubset")) {
-        ctxt->sax->hasInternalSubset =
-            *((hasInternalSubsetSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function hasExternalSubset")) {
-        ctxt->sax->hasExternalSubset =
-            *((hasExternalSubsetSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function resolveEntity")) {
-        ctxt->sax->resolveEntity = *((resolveEntitySAXFunc *) value);
-    } else if (!strcmp(name, "SAX function getEntity")) {
-        ctxt->sax->getEntity = *((getEntitySAXFunc *) value);
-    } else if (!strcmp(name, "SAX function entityDecl")) {
-        ctxt->sax->entityDecl = *((entityDeclSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function notationDecl")) {
-        ctxt->sax->notationDecl = *((notationDeclSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function attributeDecl")) {
-        ctxt->sax->attributeDecl = *((attributeDeclSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function elementDecl")) {
-        ctxt->sax->elementDecl = *((elementDeclSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function unparsedEntityDecl")) {
-        ctxt->sax->unparsedEntityDecl =
-            *((unparsedEntityDeclSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function setDocumentLocator")) {
-        ctxt->sax->setDocumentLocator =
-            *((setDocumentLocatorSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function startDocument")) {
-        ctxt->sax->startDocument = *((startDocumentSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function endDocument")) {
-        ctxt->sax->endDocument = *((endDocumentSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function startElement")) {
-        ctxt->sax->startElement = *((startElementSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function endElement")) {
-        ctxt->sax->endElement = *((endElementSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function reference")) {
-        ctxt->sax->reference = *((referenceSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function characters")) {
-        ctxt->sax->characters = *((charactersSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function ignorableWhitespace")) {
-        ctxt->sax->ignorableWhitespace =
-            *((ignorableWhitespaceSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function processingInstruction")) {
-        ctxt->sax->processingInstruction =
-            *((processingInstructionSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function comment")) {
-        ctxt->sax->comment = *((commentSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function warning")) {
-        ctxt->sax->warning = *((warningSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function error")) {
-        ctxt->sax->error = *((errorSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function fatalError")) {
-        ctxt->sax->fatalError = *((fatalErrorSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function getParameterEntity")) {
-        ctxt->sax->getParameterEntity =
-            *((getParameterEntitySAXFunc *) value);
-    } else if (!strcmp(name, "SAX function cdataBlock")) {
-        ctxt->sax->cdataBlock = *((cdataBlockSAXFunc *) value);
-    } else if (!strcmp(name, "SAX function externalSubset")) {
-        ctxt->sax->externalSubset = *((externalSubsetSAXFunc *) value);
-    } else {
-        return (-1);
-    }
-    return (0);
-}
-
-/**
- * xmlDecodeEntities:
- * @ctxt:  the parser context
- * @len:  the len to decode (in bytes !), -1 for no size limit
- * @what:  combination of XML_SUBSTITUTE_REF and XML_SUBSTITUTE_PEREF
- * @end:  an end marker xmlChar, 0 if none
- * @end2:  an end marker xmlChar, 0 if none
- * @end3:  an end marker xmlChar, 0 if none
- *
- * This function is deprecated, we now always process entities content
- * through xmlStringDecodeEntities
- *
- * TODO: remove it in next major release.
- *
- * [67] Reference ::= EntityRef | CharRef
- *
- * [69] PEReference ::= '%' Name ';'
- *
- * Returns A newly allocated string with the substitution done. The caller
- *      must deallocate it !
- */
-xmlChar *
-xmlDecodeEntities(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
-                  int len ATTRIBUTE_UNUSED, int what ATTRIBUTE_UNUSED,
-                  xmlChar end ATTRIBUTE_UNUSED,
-                  xmlChar end2 ATTRIBUTE_UNUSED,
-                  xmlChar end3 ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlDecodeEntities() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlNamespaceParseNCName:
- * @ctxt:  an XML parser context
- *
- * parse an XML namespace name.
- *
- * TODO: this seems not in use anymore, the namespace handling is done on
- *       top of the SAX interfaces, i.e. not on raw input.
- *
- * [NS 3] NCName ::= (Letter | '_') (NCNameChar)*
- *
- * [NS 4] NCNameChar ::= Letter | Digit | '.' | '-' | '_' |
- *                       CombiningChar | Extender
- *
- * Returns the namespace name or NULL
- */
-
-xmlChar *
-xmlNamespaceParseNCName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlNamespaceParseNCName() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlNamespaceParseQName:
- * @ctxt:  an XML parser context
- * @prefix:  a xmlChar **
- *
- * TODO: this seems not in use anymore, the namespace handling is done on
- *       top of the SAX interfaces, i.e. not on raw input.
- *
- * parse an XML qualified name
- *
- * [NS 5] QName ::= (Prefix ':')? LocalPart
- *
- * [NS 6] Prefix ::= NCName
- *
- * [NS 7] LocalPart ::= NCName
- *
- * Returns the local part, and prefix is updated
- *   to get the Prefix if any.
- */
-
-xmlChar *
-xmlNamespaceParseQName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
-                       xmlChar ** prefix ATTRIBUTE_UNUSED)
-{
-
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlNamespaceParseQName() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlNamespaceParseNSDef:
- * @ctxt:  an XML parser context
- *
- * parse a namespace prefix declaration
- *
- * TODO: this seems not in use anymore, the namespace handling is done on
- *       top of the SAX interfaces, i.e. not on raw input.
- *
- * [NS 1] NSDef ::= PrefixDef Eq SystemLiteral
- *
- * [NS 2] PrefixDef ::= 'xmlns' (':' NCName)?
- *
- * Returns the namespace name
- */
-
-xmlChar *
-xmlNamespaceParseNSDef(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlNamespaceParseNSDef() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlParseQuotedString:
- * @ctxt:  an XML parser context
- *
- * Parse and return a string between quotes or doublequotes
- *
- * TODO: Deprecated, to  be removed at next drop of binary compatibility
- *
- * Returns the string parser or NULL.
- */
-xmlChar *
-xmlParseQuotedString(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlParseQuotedString() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlParseNamespace:
- * @ctxt:  an XML parser context
- *
- * xmlParseNamespace: parse specific PI '<?namespace ...' constructs.
- *
- * This is what the older xml-name Working Draft specified, a bunch of
- * other stuff may still rely on it, so support is still here as
- * if it was declared on the root of the Tree:-(
- *
- * TODO: remove from library
- *
- * To be removed at next drop of binary compatibility
- */
-
-void
-xmlParseNamespace(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlParseNamespace() deprecated function reached\n");
-        deprecated = 1;
-    }
-}
-
-/**
- * xmlScanName:
- * @ctxt:  an XML parser context
- *
- * Trickery: parse an XML name but without consuming the input flow
- * Needed for rollback cases. Used only when parsing entities references.
- *
- * TODO: seems deprecated now, only used in the default part of
- *       xmlParserHandleReference
- *
- * [4] NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |
- *                  CombiningChar | Extender
- *
- * [5] Name ::= (Letter | '_' | ':') (NameChar)*
- *
- * [6] Names ::= Name (S Name)*
- *
- * Returns the Name parsed or NULL
- */
-
-xmlChar *
-xmlScanName(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlScanName() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlParserHandleReference:
- * @ctxt:  the parser context
- *
- * TODO: Remove, now deprecated ... the test is done directly in the
- *       content parsing
- * routines.
- *
- * [67] Reference ::= EntityRef | CharRef
- *
- * [68] EntityRef ::= '&' Name ';'
- *
- * [ WFC: Entity Declared ]
- * the Name given in the entity reference must match that in an entity
- * declaration, except that well-formed documents need not declare any
- * of the following entities: amp, lt, gt, apos, quot.
- *
- * [ WFC: Parsed Entity ]
- * An entity reference must not contain the name of an unparsed entity
- *
- * [66] CharRef ::= '&#' [0-9]+ ';' |
- *                  '&#x' [0-9a-fA-F]+ ';'
- *
- * 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
- */
-void
-xmlParserHandleReference(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlParserHandleReference() deprecated function reached\n");
-        deprecated = 1;
-    }
-
-    return;
-}
-
-/**
- * xmlHandleEntity:
- * @ctxt:  an XML parser context
- * @entity:  an XML entity pointer.
- *
- * Default handling of defined entities, when should we define a new input
- * stream ? When do we just handle that as a set of chars ?
- *
- * OBSOLETE: to be removed at some point.
- */
-
-void
-xmlHandleEntity(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
-                xmlEntityPtr entity ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlHandleEntity() deprecated function reached\n");
-        deprecated = 1;
-    }
-}
-
-/**
- * xmlNewGlobalNs:
- * @doc:  the document carrying the namespace
- * @href:  the URI associated
- * @prefix:  the prefix for the namespace
- *
- * Creation of a Namespace, the old way using PI and without scoping
- *   DEPRECATED !!!
- * Returns NULL this functionality had been removed
- */
-xmlNsPtr
-xmlNewGlobalNs(xmlDocPtr doc ATTRIBUTE_UNUSED,
-               const xmlChar * href ATTRIBUTE_UNUSED,
-               const xmlChar * prefix ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlNewGlobalNs() deprecated function reached\n");
-        deprecated = 1;
-    }
-    return (NULL);
-}
-
-/**
- * xmlUpgradeOldNs:
- * @doc:  a document pointer
- *
- * Upgrade old style Namespaces (PI) and move them to the root of the document.
- * DEPRECATED
- */
-void
-xmlUpgradeOldNs(xmlDocPtr doc ATTRIBUTE_UNUSED)
-{
-    static int deprecated = 0;
-
-    if (!deprecated) {
-        fprintf(stderr,
-                        "xmlUpgradeOldNs() deprecated function reached\n");
-        deprecated = 1;
-    }
-}
-
-/**
- * xmlEncodeEntities:
- * @doc:  the document containing the string
- * @input:  A string to convert to XML.
- *
- * TODO: remove xmlEncodeEntities, once we are not afraid of breaking binary
- *       compatibility
- *
- * People must migrate their code to xmlEncodeEntitiesReentrant !
- * This routine will issue a warning when encountered.
- *
- * Returns NULL
- */
-const xmlChar *
-xmlEncodeEntities(xmlDocPtr doc ATTRIBUTE_UNUSED,
-                  const xmlChar * input ATTRIBUTE_UNUSED)
-{
-    static int warning = 1;
-
-    if (warning) {
-        fprintf(stderr,
-                        "Deprecated API xmlEncodeEntities() used\n");
-        fprintf(stderr,
-                        "   change code to use xmlEncodeEntitiesReentrant()\n");
-        warning = 0;
-    }
-    return (NULL);
-}
-
-/**
- * xmlSetEntityReferenceFunc:
- * @func: A valid function
- *
- * Set the function to call call back when a xml reference has been made
- */
-void
-xmlSetEntityReferenceFunc(xmlEntityReferenceFunc func ATTRIBUTE_UNUSED)
-{
-}
-
-/************************************************************************
- *									*
- *		Old set of SAXv1 functions				*
- *									*
- ************************************************************************/
-static int deprecated_v1_msg = 0;
-
-#define DEPRECATED(n)						\
-    if (deprecated_v1_msg == 0)					\
-	fprintf(stderr,			\
-	  "Use of deprecated SAXv1 function %s\n", n);		\
-    deprecated_v1_msg++;
-
-/**
- * getPublicId:
- * @ctx: the user data (XML parser context)
- *
- * Provides the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
- * DEPRECATED: use xmlSAX2GetPublicId()
- *
- * Returns a xmlChar *
- */
-const xmlChar *
-getPublicId(void *ctx)
-{
-    DEPRECATED("getPublicId")
-        return (xmlSAX2GetPublicId(ctx));
-}
-
-/**
- * getSystemId:
- * @ctx: the user data (XML parser context)
- *
- * Provides the system ID, basically URL or filename e.g.
- * http://www.sgmlsource.com/dtds/memo.dtd
- * DEPRECATED: use xmlSAX2GetSystemId()
- *
- * Returns a xmlChar *
- */
-const xmlChar *
-getSystemId(void *ctx)
-{
-    DEPRECATED("getSystemId")
-        return (xmlSAX2GetSystemId(ctx));
-}
-
-/**
- * getLineNumber:
- * @ctx: the user data (XML parser context)
- *
- * Provide the line number of the current parsing point.
- * DEPRECATED: use xmlSAX2GetLineNumber()
- *
- * Returns an int
- */
-int
-getLineNumber(void *ctx)
-{
-    DEPRECATED("getLineNumber")
-        return (xmlSAX2GetLineNumber(ctx));
-}
-
-/**
- * getColumnNumber:
- * @ctx: the user data (XML parser context)
- *
- * Provide the column number of the current parsing point.
- * DEPRECATED: use xmlSAX2GetColumnNumber()
- *
- * Returns an int
- */
-int
-getColumnNumber(void *ctx)
-{
-    DEPRECATED("getColumnNumber")
-        return (xmlSAX2GetColumnNumber(ctx));
-}
-
-/**
- * isStandalone:
- * @ctx: the user data (XML parser context)
- *
- * Is this document tagged standalone ?
- * DEPRECATED: use xmlSAX2IsStandalone()
- *
- * Returns 1 if true
- */
-int
-isStandalone(void *ctx)
-{
-    DEPRECATED("isStandalone")
-        return (xmlSAX2IsStandalone(ctx));
-}
-
-/**
- * hasInternalSubset:
- * @ctx: the user data (XML parser context)
- *
- * Does this document has an internal subset
- * DEPRECATED: use xmlSAX2HasInternalSubset()
- *
- * Returns 1 if true
- */
-int
-hasInternalSubset(void *ctx)
-{
-    DEPRECATED("hasInternalSubset")
-        return (xmlSAX2HasInternalSubset(ctx));
-}
-
-/**
- * hasExternalSubset:
- * @ctx: the user data (XML parser context)
- *
- * Does this document has an external subset
- * DEPRECATED: use xmlSAX2HasExternalSubset()
- *
- * Returns 1 if true
- */
-int
-hasExternalSubset(void *ctx)
-{
-    DEPRECATED("hasExternalSubset")
-        return (xmlSAX2HasExternalSubset(ctx));
-}
-
-/**
- * internalSubset:
- * @ctx:  the user data (XML parser context)
- * @name:  the root element name
- * @ExternalID:  the external ID
- * @SystemID:  the SYSTEM ID (e.g. filename or URL)
- *
- * Callback on internal subset declaration.
- * DEPRECATED: use xmlSAX2InternalSubset()
- */
-void
-internalSubset(void *ctx, const xmlChar * name,
-               const xmlChar * ExternalID, const xmlChar * SystemID)
-{
-    DEPRECATED("internalSubset")
-        xmlSAX2InternalSubset(ctx, name, ExternalID, SystemID);
-}
-
-/**
- * externalSubset:
- * @ctx: the user data (XML parser context)
- * @name:  the root element name
- * @ExternalID:  the external ID
- * @SystemID:  the SYSTEM ID (e.g. filename or URL)
- *
- * Callback on external subset declaration.
- * DEPRECATED: use xmlSAX2ExternalSubset()
- */
-void
-externalSubset(void *ctx, const xmlChar * name,
-               const xmlChar * ExternalID, const xmlChar * SystemID)
-{
-    DEPRECATED("externalSubset")
-        xmlSAX2ExternalSubset(ctx, name, ExternalID, SystemID);
-}
-
-/**
- * resolveEntity:
- * @ctx: the user data (XML parser context)
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- *
- * The entity loader, to control the loading of external entities,
- * the application can either:
- *    - override this resolveEntity() callback in the SAX block
- *    - or better use the xmlSetExternalEntityLoader() function to
- *      set up it's own entity resolution routine
- * DEPRECATED: use xmlSAX2ResolveEntity()
- *
- * Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
- */
-xmlParserInputPtr
-resolveEntity(void *ctx, const xmlChar * publicId,
-              const xmlChar * systemId)
-{
-    DEPRECATED("resolveEntity")
-        return (xmlSAX2ResolveEntity(ctx, publicId, systemId));
-}
-
-/**
- * getEntity:
- * @ctx: the user data (XML parser context)
- * @name: The entity name
- *
- * Get an entity by name
- * DEPRECATED: use xmlSAX2GetEntity()
- *
- * Returns the xmlEntityPtr if found.
- */
-xmlEntityPtr
-getEntity(void *ctx, const xmlChar * name)
-{
-    DEPRECATED("getEntity")
-        return (xmlSAX2GetEntity(ctx, name));
-}
-
-/**
- * getParameterEntity:
- * @ctx: the user data (XML parser context)
- * @name: The entity name
- *
- * Get a parameter entity by name
- * DEPRECATED: use xmlSAX2GetParameterEntity()
- *
- * Returns the xmlEntityPtr if found.
- */
-xmlEntityPtr
-getParameterEntity(void *ctx, const xmlChar * name)
-{
-    DEPRECATED("getParameterEntity")
-        return (xmlSAX2GetParameterEntity(ctx, name));
-}
-
-
-/**
- * entityDecl:
- * @ctx: the user data (XML parser context)
- * @name:  the entity name
- * @type:  the entity type
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- * @content: the entity value (without processing).
- *
- * An entity definition has been parsed
- * DEPRECATED: use xmlSAX2EntityDecl()
- */
-void
-entityDecl(void *ctx, const xmlChar * name, int type,
-           const xmlChar * publicId, const xmlChar * systemId,
-           xmlChar * content)
-{
-    DEPRECATED("entityDecl")
-        xmlSAX2EntityDecl(ctx, name, type, publicId, systemId, content);
-}
-
-/**
- * attributeDecl:
- * @ctx: the user data (XML parser context)
- * @elem:  the name of the element
- * @fullname:  the attribute name
- * @type:  the attribute type
- * @def:  the type of default value
- * @defaultValue: the attribute default value
- * @tree:  the tree of enumerated value set
- *
- * An attribute definition has been parsed
- * DEPRECATED: use xmlSAX2AttributeDecl()
- */
-void
-attributeDecl(void *ctx, const xmlChar * elem, const xmlChar * fullname,
-              int type, int def, const xmlChar * defaultValue,
-              xmlEnumerationPtr tree)
-{
-    DEPRECATED("attributeDecl")
-        xmlSAX2AttributeDecl(ctx, elem, fullname, type, def, defaultValue,
-                             tree);
-}
-
-/**
- * elementDecl:
- * @ctx: the user data (XML parser context)
- * @name:  the element name
- * @type:  the element type
- * @content: the element value tree
- *
- * An element definition has been parsed
- * DEPRECATED: use xmlSAX2ElementDecl()
- */
-void
-elementDecl(void *ctx, const xmlChar * name, int type,
-            xmlElementContentPtr content)
-{
-    DEPRECATED("elementDecl")
-        xmlSAX2ElementDecl(ctx, name, type, content);
-}
-
-/**
- * notationDecl:
- * @ctx: the user data (XML parser context)
- * @name: The name of the notation
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- *
- * What to do when a notation declaration has been parsed.
- * DEPRECATED: use xmlSAX2NotationDecl()
- */
-void
-notationDecl(void *ctx, const xmlChar * name,
-             const xmlChar * publicId, const xmlChar * systemId)
-{
-    DEPRECATED("notationDecl")
-        xmlSAX2NotationDecl(ctx, name, publicId, systemId);
-}
-
-/**
- * unparsedEntityDecl:
- * @ctx: the user data (XML parser context)
- * @name: The name of the entity
- * @publicId: The public ID of the entity
- * @systemId: The system ID of the entity
- * @notationName: the name of the notation
- *
- * What to do when an unparsed entity declaration is parsed
- * DEPRECATED: use xmlSAX2UnparsedEntityDecl()
- */
-void
-unparsedEntityDecl(void *ctx, const xmlChar * name,
-                   const xmlChar * publicId, const xmlChar * systemId,
-                   const xmlChar * notationName)
-{
-    DEPRECATED("unparsedEntityDecl")
-        xmlSAX2UnparsedEntityDecl(ctx, name, publicId, systemId,
-                                  notationName);
-}
-
-/**
- * setDocumentLocator:
- * @ctx: the user data (XML parser context)
- * @loc: A SAX Locator
- *
- * Receive the document locator at startup, actually xmlDefaultSAXLocator
- * Everything is available on the context, so this is useless in our case.
- * DEPRECATED
- */
-void
-setDocumentLocator(void *ctx ATTRIBUTE_UNUSED,
-                   xmlSAXLocatorPtr loc ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("setDocumentLocator")
-}
-
-/**
- * startDocument:
- * @ctx: the user data (XML parser context)
- *
- * called when the document start being processed.
- * DEPRECATED: use xmlSAX2StartDocument()
- */
-void
-startDocument(void *ctx)
-{
-   /* don't be too painful for glade users */
-   /*  DEPRECATED("startDocument") */
-        xmlSAX2StartDocument(ctx);
-}
-
-/**
- * endDocument:
- * @ctx: the user data (XML parser context)
- *
- * called when the document end has been detected.
- * DEPRECATED: use xmlSAX2EndDocument()
- */
-void
-endDocument(void *ctx)
-{
-    DEPRECATED("endDocument")
-        xmlSAX2EndDocument(ctx);
-}
-
-/**
- * attribute:
- * @ctx: the user data (XML parser context)
- * @fullname:  The attribute name, including namespace prefix
- * @value:  The attribute value
- *
- * Handle an attribute that has been read by the parser.
- * The default handling is to convert the attribute into an
- * DOM subtree and past it in a new xmlAttr element added to
- * the element.
- * DEPRECATED: use xmlSAX2Attribute()
- */
-void
-attribute(void *ctx ATTRIBUTE_UNUSED,
-          const xmlChar * fullname ATTRIBUTE_UNUSED,
-          const xmlChar * value ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("attribute")
-}
-
-/**
- * startElement:
- * @ctx: the user data (XML parser context)
- * @fullname:  The element name, including namespace prefix
- * @atts:  An array of name/value attributes pairs, NULL terminated
- *
- * called when an opening tag has been processed.
- * DEPRECATED: use xmlSAX2StartElement()
- */
-void
-startElement(void *ctx, const xmlChar * fullname, const xmlChar ** atts)
-{
-    xmlSAX2StartElement(ctx, fullname, atts);
-}
-
-/**
- * endElement:
- * @ctx: the user data (XML parser context)
- * @name:  The element name
- *
- * called when the end of an element has been detected.
- * DEPRECATED: use xmlSAX2EndElement()
- */
-void
-endElement(void *ctx, const xmlChar * name ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("endElement")
-    xmlSAX2EndElement(ctx, name);
-}
-
-/**
- * reference:
- * @ctx: the user data (XML parser context)
- * @name:  The entity name
- *
- * called when an entity reference is detected.
- * DEPRECATED: use xmlSAX2Reference()
- */
-void
-reference(void *ctx, const xmlChar * name)
-{
-    DEPRECATED("reference")
-        xmlSAX2Reference(ctx, name);
-}
-
-/**
- * characters:
- * @ctx: the user data (XML parser context)
- * @ch:  a xmlChar string
- * @len: the number of xmlChar
- *
- * receiving some chars from the parser.
- * DEPRECATED: use xmlSAX2Characters()
- */
-void
-characters(void *ctx, const xmlChar * ch, int len)
-{
-    DEPRECATED("characters")
-        xmlSAX2Characters(ctx, ch, len);
-}
-
-/**
- * ignorableWhitespace:
- * @ctx: the user data (XML parser context)
- * @ch:  a xmlChar string
- * @len: the number of xmlChar
- *
- * receiving some ignorable whitespaces from the parser.
- * UNUSED: by default the DOM building will use characters
- * DEPRECATED: use xmlSAX2IgnorableWhitespace()
- */
-void
-ignorableWhitespace(void *ctx ATTRIBUTE_UNUSED,
-                    const xmlChar * ch ATTRIBUTE_UNUSED,
-                    int len ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("ignorableWhitespace")
-}
-
-/**
- * processingInstruction:
- * @ctx: the user data (XML parser context)
- * @target:  the target name
- * @data: the PI data's
- *
- * A processing instruction has been parsed.
- * DEPRECATED: use xmlSAX2ProcessingInstruction()
- */
-void
-processingInstruction(void *ctx, const xmlChar * target,
-                      const xmlChar * data)
-{
-    DEPRECATED("processingInstruction")
-        xmlSAX2ProcessingInstruction(ctx, target, data);
-}
-
-/**
- * globalNamespace:
- * @ctx: the user data (XML parser context)
- * @href:  the namespace associated URN
- * @prefix: the namespace prefix
- *
- * An old global namespace has been parsed.
- * DEPRECATED
- */
-void
-globalNamespace(void *ctx ATTRIBUTE_UNUSED,
-                const xmlChar * href ATTRIBUTE_UNUSED,
-                const xmlChar * prefix ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("globalNamespace")
-}
-
-/**
- * setNamespace:
- * @ctx: the user data (XML parser context)
- * @name:  the namespace prefix
- *
- * Set the current element namespace.
- * DEPRECATED
- */
-
-void
-setNamespace(void *ctx ATTRIBUTE_UNUSED,
-             const xmlChar * name ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("setNamespace")
-}
-
-/**
- * getNamespace:
- * @ctx: the user data (XML parser context)
- *
- * Get the current element namespace.
- * DEPRECATED
- *
- * Returns the xmlNsPtr or NULL if none
- */
-
-xmlNsPtr
-getNamespace(void *ctx ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("getNamespace")
-        return (NULL);
-}
-
-/**
- * checkNamespace:
- * @ctx: the user data (XML parser context)
- * @namespace: the namespace to check against
- *
- * Check that the current element namespace is the same as the
- * one read upon parsing.
- * DEPRECATED
- *
- * Returns 1 if true 0 otherwise
- */
-
-int
-checkNamespace(void *ctx ATTRIBUTE_UNUSED,
-               xmlChar * namespace ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("checkNamespace")
-        return (0);
-}
-
-/**
- * namespaceDecl:
- * @ctx: the user data (XML parser context)
- * @href:  the namespace associated URN
- * @prefix: the namespace prefix
- *
- * A namespace has been parsed.
- * DEPRECATED
- */
-void
-namespaceDecl(void *ctx ATTRIBUTE_UNUSED,
-              const xmlChar * href ATTRIBUTE_UNUSED,
-              const xmlChar * prefix ATTRIBUTE_UNUSED)
-{
-    DEPRECATED("namespaceDecl")
-}
-
-/**
- * comment:
- * @ctx: the user data (XML parser context)
- * @value:  the comment content
- *
- * A comment has been parsed.
- * DEPRECATED: use xmlSAX2Comment()
- */
-void
-comment(void *ctx, const xmlChar * value)
-{
-    DEPRECATED("comment")
-        xmlSAX2Comment(ctx, value);
-}
-
-/**
- * cdataBlock:
- * @ctx: the user data (XML parser context)
- * @value:  The pcdata content
- * @len:  the block length
- *
- * called when a pcdata block has been parsed
- * DEPRECATED: use xmlSAX2CDataBlock()
- */
-void
-cdataBlock(void *ctx, const xmlChar * value, int len)
-{
-    DEPRECATED("cdataBlock")
-        xmlSAX2CDataBlock(ctx, value, len);
-}
-
-/*
- * nanoftp.h
- */
-
-#ifndef LIBXML_FTP_ENABLED
-
-#include <libxml/nanoftp.h>
-
-/** DOC_DISABLE */
-
-#ifdef _WIN32
-  #include <winsock2.h>
-#else
-  #define SOCKET int
-#endif
-
-typedef void
-(*ftpListCallback)(void *userData, const char *filename, const char *attrib,
-                   const char *owner, const char *group, unsigned long size,
-                   int links, int year, const char *month, int day, int hour,
-                   int minute);
-
-typedef void
-(*ftpDataCallback) (void *userData, const char *data, int len);
-
-XMLPUBFUN void
-xmlNanoFTPInit(void);
-
-void
-xmlNanoFTPInit(void) {
-}
-
-XMLPUBFUN void
-xmlNanoFTPCleanup(void);
-
-void
-xmlNanoFTPCleanup(void) {
-}
-
-XMLPUBFUN void
-xmlNanoFTPProxy(const char *host, int port, const char *user,
-                const char *passwd, int type);
-
-void
-xmlNanoFTPProxy(const char *host ATTRIBUTE_UNUSED, int port ATTRIBUTE_UNUSED,
-                const char *user ATTRIBUTE_UNUSED,
-	        const char *passwd ATTRIBUTE_UNUSED, int type ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN int
-xmlNanoFTPUpdateURL(void *ctx, const char *URL);
-
-int
-xmlNanoFTPUpdateURL(void *ctx ATTRIBUTE_UNUSED,
-                    const char *URL ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN void
-xmlNanoFTPScanProxy(const char *URL);
-
-void
-xmlNanoFTPScanProxy(const char *URL ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN void *
-xmlNanoFTPNewCtxt(const char *URL);
-
-void*
-xmlNanoFTPNewCtxt(const char *URL ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN void
-xmlNanoFTPFreeCtxt(void *ctx);
-
-void
-xmlNanoFTPFreeCtxt(void * ctx ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN int
-xmlNanoFTPGetResponse(void *ctx);
-
-int
-xmlNanoFTPGetResponse(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPCheckResponse(void *ctx);
-
-int
-xmlNanoFTPCheckResponse(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPQuit(void *ctx);
-
-int
-xmlNanoFTPQuit(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPConnect(void *ctx);
-
-int
-xmlNanoFTPConnect(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN void *
-xmlNanoFTPConnectTo(const char *server, int port);
-
-void*
-xmlNanoFTPConnectTo(const char *server ATTRIBUTE_UNUSED,
-                    int port ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN int
-xmlNanoFTPCwd(void *ctx, const char *directory);
-
-int
-xmlNanoFTPCwd(void *ctx ATTRIBUTE_UNUSED,
-              const char *directory ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPDele(void *ctx, const char *file);
-
-int
-xmlNanoFTPDele(void *ctx ATTRIBUTE_UNUSED, const char *file ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN SOCKET
-xmlNanoFTPGetConnection(void *ctx);
-
-SOCKET
-xmlNanoFTPGetConnection(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPCloseConnection(void *ctx);
-
-int
-xmlNanoFTPCloseConnection(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPList(void *ctx, ftpListCallback callback, void *userData,
-	       const char *filename);
-
-int
-xmlNanoFTPList(void *ctx ATTRIBUTE_UNUSED,
-               ftpListCallback callback ATTRIBUTE_UNUSED,
-               void *userData ATTRIBUTE_UNUSED,
-	       const char *filename ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN SOCKET
-xmlNanoFTPGetSocket(void *ctx, const char *filename);
-
-SOCKET
-xmlNanoFTPGetSocket(void *ctx ATTRIBUTE_UNUSED,
-                    const char *filename ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPGet(void *ctx, ftpDataCallback callback, void *userData,
-	      const char *filename);
-
-int
-xmlNanoFTPGet(void *ctx ATTRIBUTE_UNUSED,
-              ftpDataCallback callback ATTRIBUTE_UNUSED,
-              void *userData ATTRIBUTE_UNUSED,
-	      const char *filename ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlNanoFTPRead(void *ctx, void *dest, int len);
-
-int
-xmlNanoFTPRead(void *ctx ATTRIBUTE_UNUSED, void *dest ATTRIBUTE_UNUSED,
-               int len ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN void *
-xmlNanoFTPOpen(const char *URL);
-
-void*
-xmlNanoFTPOpen(const char *URL ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN int
-xmlNanoFTPClose(void *ctx);
-
-int
-xmlNanoFTPClose(void *ctx ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlIOFTPMatch(const char *filename);
-
-int
-xmlIOFTPMatch(const char *filename ATTRIBUTE_UNUSED) {
-    return(0);
-}
-
-XMLPUBFUN void *
-xmlIOFTPOpen(const char *filename);
-
-void *
-xmlIOFTPOpen(const char *filename ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN int
-xmlIOFTPRead(void *context, char *buffer, int len);
-
-int
-xmlIOFTPRead(void *context ATTRIBUTE_UNUSED, char *buffer ATTRIBUTE_UNUSED,
-             int len ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-XMLPUBFUN int
-xmlIOFTPClose(void *context);
-
-int
-xmlIOFTPClose(void *context ATTRIBUTE_UNUSED) {
-    return(-1);
-}
-
-/** DOC_ENABLE */
-
-#endif /* #ifndef LIBXML_FTP_ENABLED */
-
-/*
- * xpointer.h
- */
-
-#ifndef LIBXML_XPTR_LOCS_ENABLED
-
-#include <libxml/xpath.h>
-#include <libxml/xpathInternals.h>
-#include <libxml/xpointer.h>
-
-/** DOC_DISABLE */
-
-typedef struct _xmlLocationSet *xmlLocationSetPtr;
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewRange(xmlNodePtr start, int startindex,
-                xmlNodePtr end, int endindex);
-
-xmlXPathObjectPtr
-xmlXPtrNewRange(xmlNodePtr start ATTRIBUTE_UNUSED,
-                int startindex ATTRIBUTE_UNUSED,
-                xmlNodePtr end ATTRIBUTE_UNUSED,
-                int endindex ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewRangePoints(xmlXPathObjectPtr start, xmlXPathObjectPtr end);
-
-xmlXPathObjectPtr
-xmlXPtrNewRangePoints(xmlXPathObjectPtr start ATTRIBUTE_UNUSED,
-                      xmlXPathObjectPtr end ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewRangePointNode(xmlXPathObjectPtr start, xmlNodePtr end);
-
-xmlXPathObjectPtr
-xmlXPtrNewRangePointNode(xmlXPathObjectPtr start ATTRIBUTE_UNUSED,
-                         xmlNodePtr end ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewRangeNodePoint(xmlNodePtr start, xmlXPathObjectPtr end);
-
-xmlXPathObjectPtr
-xmlXPtrNewRangeNodePoint(xmlNodePtr start ATTRIBUTE_UNUSED,
-                         xmlXPathObjectPtr end ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewRangeNodes(xmlNodePtr start, xmlNodePtr end);
-
-xmlXPathObjectPtr
-xmlXPtrNewRangeNodes(xmlNodePtr start ATTRIBUTE_UNUSED,
-                     xmlNodePtr end ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewCollapsedRange(xmlNodePtr start);
-
-xmlXPathObjectPtr
-xmlXPtrNewCollapsedRange(xmlNodePtr start ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewRangeNodeObject(xmlNodePtr start, xmlXPathObjectPtr end);
-
-xmlXPathObjectPtr
-xmlXPtrNewRangeNodeObject(xmlNodePtr start ATTRIBUTE_UNUSED,
-                          xmlXPathObjectPtr end ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlLocationSetPtr
-xmlXPtrLocationSetCreate(xmlXPathObjectPtr val);
-
-xmlLocationSetPtr
-xmlXPtrLocationSetCreate(xmlXPathObjectPtr val ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN void
-xmlXPtrLocationSetAdd(xmlLocationSetPtr cur, xmlXPathObjectPtr val);
-
-void
-xmlXPtrLocationSetAdd(xmlLocationSetPtr cur ATTRIBUTE_UNUSED,
-                      xmlXPathObjectPtr val ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN xmlLocationSetPtr
-xmlXPtrLocationSetMerge(xmlLocationSetPtr val1, xmlLocationSetPtr val2);
-
-xmlLocationSetPtr
-xmlXPtrLocationSetMerge(xmlLocationSetPtr val1 ATTRIBUTE_UNUSED,
-                        xmlLocationSetPtr val2 ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN void
-xmlXPtrLocationSetDel(xmlLocationSetPtr cur, xmlXPathObjectPtr val);
-
-void
-xmlXPtrLocationSetDel(xmlLocationSetPtr cur ATTRIBUTE_UNUSED,
-                      xmlXPathObjectPtr val ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN void
-xmlXPtrLocationSetRemove(xmlLocationSetPtr cur, int val);
-
-void
-xmlXPtrLocationSetRemove(xmlLocationSetPtr cur ATTRIBUTE_UNUSED,
-                         int val ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN void
-xmlXPtrFreeLocationSet(xmlLocationSetPtr obj);
-
-void
-xmlXPtrFreeLocationSet(xmlLocationSetPtr obj ATTRIBUTE_UNUSED) {
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewLocationSetNodes(xmlNodePtr start, xmlNodePtr end);
-
-xmlXPathObjectPtr
-xmlXPtrNewLocationSetNodes(xmlNodePtr start ATTRIBUTE_UNUSED,
-                           xmlNodePtr end ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
-
-xmlXPathObjectPtr
-xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlXPathObjectPtr
-xmlXPtrWrapLocationSet(xmlLocationSetPtr val);
-
-xmlXPathObjectPtr
-xmlXPtrWrapLocationSet(xmlLocationSetPtr val ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN xmlNodePtr
-xmlXPtrBuildNodeList(xmlXPathObjectPtr obj);
-
-xmlNodePtr
-xmlXPtrBuildNodeList(xmlXPathObjectPtr obj ATTRIBUTE_UNUSED) {
-    return(NULL);
-}
-
-XMLPUBFUN void
-xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt, int nargs);
-
-void
-xmlXPtrRangeToFunction(xmlXPathParserContextPtr ctxt,
-                       int nargs ATTRIBUTE_UNUSED) {
-    XP_ERROR(XPATH_EXPR_ERROR);
-}
-
-/** DOC_ENABLE */
-
-#endif /* #ifndef LIBXML_XPTR_LOCS_ENABLED */
-
-#endif /* LIBXML_LEGACY_ENABLED */
-
diff --git a/libxml-2.0-uninstalled.pc.in b/libxml-2.0-uninstalled.pc.in
deleted file mode 100644
index a7b81fa..0000000
--- a/libxml-2.0-uninstalled.pc.in
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=
-exec_prefix=
-libdir=${pcfiledir}
-includedir=${pcfiledir}/include
-modules=@WITH_MODULES@
-
-Name: libXML
-Version: @VERSION@
-Description: libXML library version2.
-Requires@XML_PC_PRIVATE@: @XML_PC_REQUIRES@
-Libs: -L${libdir} @XML_LIBS@ @XML_PC_LIBS_PRIVATE@ @XML_PC_LIBS@ @LIBS@
-Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in
index 6d7b62f..07a7588 100644
--- a/libxml-2.0.pc.in
+++ b/libxml-2.0.pc.in
@@ -8,5 +8,5 @@
 Version: @VERSION@
 Description: libXML library version2.
 Requires@XML_PC_PRIVATE@: @XML_PC_REQUIRES@
-Libs: -L${libdir} @XML_LIBS@ @XML_PC_LIBS_PRIVATE@ @XML_PC_LIBS@ @LIBS@
-Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@
+Libs: @XML_LIBDIR@ @XML_LIBS@ @XML_PC_LIBS_PRIVATE@ @XML_PC_LIBS@ @LIBS@
+Cflags: @XML_INCLUDEDIR@ @XML_PC_CFLAGS_PRIVATE@ @XML_STATIC_CFLAGS@
diff --git a/libxml.h b/libxml.h
index d989356..52126fb 100644
--- a/libxml.h
+++ b/libxml.h
@@ -29,16 +29,36 @@
 #include "config.h"
 #include <libxml/xmlversion.h>
 
-/*
- * Due to some Autotools limitations, this variable must be passed as
- * compiler flag. Define a default value if the macro wasn't set by the
- * build system.
- */
-#ifndef SYSCONFDIR
-  #define SYSCONFDIR "/etc"
+#if defined(__has_attribute)
+#define XML_HAS_ATTRIBUTE(x) __has_attribute(x)
+#else
+#define XML_HAS_ATTRIBUTE(x) 0
 #endif
 #include <libxml/xmlstring.h>
 
+#if __STDC_VERSION__ >= 199901L
+  #define XML_INLINE inline
+#elif defined(_MSC_VER)
+  #if _MSC_VER >= 1900
+    #define XML_INLINE inline
+  #else
+    #define XML_INLINE _inline
+  #endif
+#else
+  #define XML_INLINE
+#endif
+
+#if __STDC_VERSION__ >= 199901L || (defined(_MSC_VER) && _MSC_VER >= 1900)
+  #include <stdint.h>
+  #define XML_INTPTR_T intptr_t
+#else
+  #include <stddef.h>
+  #define XML_INTPTR_T ptrdiff_t
+#endif
+
+#define XML_PTR_TO_INT(p) ((XML_INTPTR_T) (p))
+#define XML_INT_TO_PTR(i) ((void *) (XML_INTPTR_T) (i))
+
 #if !defined(_WIN32) && \
     !defined(__CYGWIN__) && \
     (defined(__clang__) || \
@@ -48,6 +68,22 @@
   #define XML_HIDDEN
 #endif
 
+#if __GNUC__ * 100 + __GNUC_MINOR__ >= 207 || defined(__clang__)
+  #define ATTRIBUTE_UNUSED __attribute__((unused))
+#else
+  #define ATTRIBUTE_UNUSED
+#endif
+
+#ifdef HAVE_FUNC_ATTRIBUTE_DESTRUCTOR
+  #define ATTRIBUTE_DESTRUCTOR __attribute__((destructor))
+#endif
+
+#if XML_HAS_ATTRIBUTE(__counted_by__)
+  #define ATTRIBUTE_COUNTED_BY(c) __attribute__((__counted_by__(c)))
+#else
+  #define ATTRIBUTE_COUNTED_BY(c)
+#endif
+
 #if defined(__clang__) || \
     (defined(__GNUC__) && (__GNUC__ >= 8) && !defined(__EDG__))
   #define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg)))
diff --git a/libxml.m4 b/libxml.m4
index 27ad84d..4c031a5 100644
--- a/libxml.m4
+++ b/libxml.m4
@@ -1,6 +1,8 @@
 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
+dnl Deprecated and unmaintained. Use pkg-config or xslt-config.
+dnl
 AC_DEFUN([AM_PATH_XML2],[
   m4_warn([obsolete], [AM_PATH_XML2 is deprecated, use PKG_CHECK_MODULES instead])
   AC_REQUIRE([PKG_PROG_PKG_CONFIG])
diff --git a/libxml2-config.cmake.cmake.in b/libxml2-config.cmake.cmake.in
index 79e9ecc..de084bd 100644
--- a/libxml2-config.cmake.cmake.in
+++ b/libxml2-config.cmake.cmake.in
@@ -31,55 +31,55 @@
 set(LIBXML2_LIBRARY_DIR    ${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_LIBDIR@)
 
 macro(select_library_location target basename)
-  if(TARGET ${target})
-    foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB)
-      get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG)
-      get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL)
-      get_target_property(${basename}_${property}_NOCONFIG ${target} ${property}_NOCONFIG)
-      get_target_property(${basename}_${property}_RELEASE ${target} ${property}_RELEASE)
-      get_target_property(${basename}_${property}_RELWITHDEBINFO ${target} ${property}_RELWITHDEBINFO)
+    if(TARGET ${target})
+        foreach(property IN ITEMS IMPORTED_LOCATION IMPORTED_IMPLIB)
+            get_target_property(${basename}_${property}_DEBUG ${target} ${property}_DEBUG)
+            get_target_property(${basename}_${property}_MINSIZEREL ${target} ${property}_MINSIZEREL)
+            get_target_property(${basename}_${property}_NOCONFIG ${target} ${property}_NOCONFIG)
+            get_target_property(${basename}_${property}_RELEASE ${target} ${property}_RELEASE)
+            get_target_property(${basename}_${property}_RELWITHDEBINFO ${target} ${property}_RELWITHDEBINFO)
 
-      if(${basename}_${property}_DEBUG AND ${basename}_${property}_RELEASE)
-        set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELEASE})
-      elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_RELWITHDEBINFO)
-        set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELWITHDEBINFO})
-      elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_MINSIZEREL)
-        set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_MINSIZEREL})
-      elseif(${basename}_${property}_RELEASE)
-        set(${basename}_LIBRARY ${${basename}_${property}_RELEASE})
-      elseif(${basename}_${property}_RELWITHDEBINFO)
-        set(${basename}_LIBRARY ${${basename}_${property}_RELWITHDEBINFO})
-      elseif(${basename}_${property}_MINSIZEREL)
-        set(${basename}_LIBRARY ${${basename}_${property}_MINSIZEREL})
-      elseif(${basename}_${property}_DEBUG)
-        set(${basename}_LIBRARY ${${basename}_${property}_DEBUG})
-      elseif(${basename}_${property}_NOCONFIG)
-        set(${basename}_LIBRARY ${${basename}_${property}_NOCONFIG})
-      endif()
-    endforeach()
-  endif()
+            if(${basename}_${property}_DEBUG AND ${basename}_${property}_RELEASE)
+                set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELEASE})
+            elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_RELWITHDEBINFO)
+                set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_RELWITHDEBINFO})
+            elseif(${basename}_${property}_DEBUG AND ${basename}_${property}_MINSIZEREL)
+                set(${basename}_LIBRARY debug ${${basename}_${property}_DEBUG} optimized ${${basename}_${property}_MINSIZEREL})
+            elseif(${basename}_${property}_RELEASE)
+                set(${basename}_LIBRARY ${${basename}_${property}_RELEASE})
+            elseif(${basename}_${property}_RELWITHDEBINFO)
+                set(${basename}_LIBRARY ${${basename}_${property}_RELWITHDEBINFO})
+            elseif(${basename}_${property}_MINSIZEREL)
+                set(${basename}_LIBRARY ${${basename}_${property}_MINSIZEREL})
+            elseif(${basename}_${property}_DEBUG)
+                set(${basename}_LIBRARY ${${basename}_${property}_DEBUG})
+            elseif(${basename}_${property}_NOCONFIG)
+                set(${basename}_LIBRARY ${${basename}_${property}_NOCONFIG})
+            endif()
+        endforeach()
+    endif()
 endmacro()
 
 macro(select_executable_location target basename)
-  if(TARGET ${target})
-    get_target_property(${basename}_IMPORTED_LOCATION_DEBUG ${target} IMPORTED_LOCATION_DEBUG)
-    get_target_property(${basename}_IMPORTED_LOCATION_MINSIZEREL ${target} IMPORTED_LOCATION_MINSIZEREL)
-    get_target_property(${basename}_IMPORTED_LOCATION_NOCONFIG ${target} IMPORTED_LOCATION_NOCONFIG)
-    get_target_property(${basename}_IMPORTED_LOCATION_RELEASE ${target} IMPORTED_LOCATION_RELEASE)
-    get_target_property(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO ${target} IMPORTED_LOCATION_RELWITHDEBINFO)
+    if(TARGET ${target})
+        get_target_property(${basename}_IMPORTED_LOCATION_DEBUG ${target} IMPORTED_LOCATION_DEBUG)
+        get_target_property(${basename}_IMPORTED_LOCATION_MINSIZEREL ${target} IMPORTED_LOCATION_MINSIZEREL)
+        get_target_property(${basename}_IMPORTED_LOCATION_NOCONFIG ${target} IMPORTED_LOCATION_NOCONFIG)
+        get_target_property(${basename}_IMPORTED_LOCATION_RELEASE ${target} IMPORTED_LOCATION_RELEASE)
+        get_target_property(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO ${target} IMPORTED_LOCATION_RELWITHDEBINFO)
 
-    if(${basename}_IMPORTED_LOCATION_RELEASE)
-      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELEASE})
-    elseif(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO)
-      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELWITHDEBINFO})
-    elseif(${basename}_IMPORTED_LOCATION_MINSIZEREL)
-      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_MINSIZEREL})
-    elseif(${basename}_IMPORTED_LOCATION_DEBUG)
-      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_DEBUG})
-    elseif(${basename}_IMPORTED_LOCATION_NOCONFIG)
-      set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_NOCONFIG})
+        if(${basename}_IMPORTED_LOCATION_RELEASE)
+            set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELEASE})
+        elseif(${basename}_IMPORTED_LOCATION_RELWITHDEBINFO)
+            set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_RELWITHDEBINFO})
+        elseif(${basename}_IMPORTED_LOCATION_MINSIZEREL)
+            set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_MINSIZEREL})
+        elseif(${basename}_IMPORTED_LOCATION_DEBUG)
+            set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_DEBUG})
+        elseif(${basename}_IMPORTED_LOCATION_NOCONFIG)
+            set(${basename}_EXECUTABLE ${${basename}_IMPORTED_LOCATION_NOCONFIG})
+        endif()
     endif()
-  endif()
 endmacro()
 
 select_library_location(LibXml2::LibXml2 LIBXML2)
@@ -97,68 +97,72 @@
 set(LIBXML2_WITH_ICU @LIBXML2_WITH_ICU@)
 set(LIBXML2_WITH_LZMA @LIBXML2_WITH_LZMA@)
 set(LIBXML2_WITH_ZLIB @LIBXML2_WITH_ZLIB@)
+set(LIBXML2_WITH_HTTP @LIBXML2_WITH_HTTP@)
 
 if(LIBXML2_WITH_ICONV)
-  find_dependency(Iconv)
-  list(APPEND LIBXML2_LIBRARIES    ${Iconv_LIBRARIES})
-  list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
-  if(NOT Iconv_FOUND)
-    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Iconv dependency was not found")
-    return()
-  endif()
+    find_dependency(Iconv)
+    list(APPEND LIBXML2_LIBRARIES    ${Iconv_LIBRARIES})
+    list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
+    if(NOT Iconv_FOUND)
+        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Iconv dependency was not found")
+        return()
+    endif()
 endif()
 
 if(NOT LIBXML2_SHARED)
-  set(LIBXML2_DEFINITIONS -DLIBXML_STATIC)
+    set(LIBXML2_DEFINITIONS -DLIBXML_STATIC)
 
-  if(LIBXML2_WITH_THREADS)
-    find_dependency(Threads)
-    list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
-    if(NOT Threads_FOUND)
-      set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-      set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Threads dependency was not found")
-      return()
+    if(LIBXML2_WITH_THREADS)
+        find_dependency(Threads)
+        list(APPEND LIBXML2_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+        if(NOT Threads_FOUND)
+            set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+            set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Threads dependency was not found")
+            return()
+        endif()
     endif()
-  endif()
 
-  if(LIBXML2_WITH_ICU)
-    find_dependency(ICU COMPONENTS data i18n uc)
-    list(APPEND LIBXML2_LIBRARIES    ${ICU_LIBRARIES})
-    if(NOT ICU_FOUND)
-      set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-      set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ICU dependency was not found")
-      return()
+    if(LIBXML2_WITH_ICU)
+        find_dependency(ICU COMPONENTS data i18n uc)
+        list(APPEND LIBXML2_LIBRARIES    ${ICU_LIBRARIES})
+        if(NOT ICU_FOUND)
+            set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+            set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ICU dependency was not found")
+            return()
+        endif()
     endif()
-  endif()
 
-  if(LIBXML2_WITH_LZMA)
-    find_dependency(LibLZMA)
-    list(APPEND LIBXML2_LIBRARIES    ${LIBLZMA_LIBRARIES})
-    if(NOT LibLZMA_FOUND)
-      set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-      set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "LibLZMA dependency was not found")
-      return()
+    if(LIBXML2_WITH_LZMA)
+        find_dependency(LibLZMA)
+        list(APPEND LIBXML2_LIBRARIES    ${LIBLZMA_LIBRARIES})
+        if(NOT LibLZMA_FOUND)
+            set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+            set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "LibLZMA dependency was not found")
+            return()
+        endif()
     endif()
-  endif()
 
-  if(LIBXML2_WITH_ZLIB)
-    find_dependency(ZLIB)
-    list(APPEND LIBXML2_LIBRARIES    ${ZLIB_LIBRARIES})
-    if(NOT ZLIB_FOUND)
-      set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-      set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ZLIB dependency was not found")
-      return()
+    if(LIBXML2_WITH_ZLIB)
+        find_dependency(ZLIB)
+        list(APPEND LIBXML2_LIBRARIES    ${ZLIB_LIBRARIES})
+        if(NOT ZLIB_FOUND)
+            set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+            set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ZLIB dependency was not found")
+            return()
+        endif()
     endif()
-  endif()
 
-  if(UNIX)
-    list(APPEND LIBXML2_LIBRARIES m)
-  endif()
+    if(UNIX)
+        list(APPEND LIBXML2_LIBRARIES m)
+    endif()
 
-  if(WIN32)
-    list(APPEND LIBXML2_LIBRARIES ws2_32;Bcrypt)
-  endif()
+    if(WIN32)
+        list(APPEND LIBXML2_LIBRARIES Bcrypt)
+        if(LIBXML2_WITH_HTTP)
+            list(APPEND LIBXML2_LIBRARIES ws2_32)
+        endif()
+    endif()
 endif()
 
 # whether libxml2 has dso support
diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in
index f35eb05..3103680 100644
--- a/libxml2-config.cmake.in
+++ b/libxml2-config.cmake.in
@@ -50,71 +50,76 @@
 set(LIBXML2_WITH_ICU @WITH_ICU@)
 set(LIBXML2_WITH_LZMA @WITH_LZMA@)
 set(LIBXML2_WITH_ZLIB @WITH_ZLIB@)
+set(LIBXML2_WITH_HTTP @WITH_HTTP@)
 
 if(LIBXML2_WITH_ICONV)
-  find_dependency(Iconv)
-  list(APPEND LIBXML2_LIBRARIES    ${Iconv_LIBRARIES})
-  list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "Iconv::Iconv")
-  if(NOT Iconv_FOUND)
-    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Iconv dependency was not found")
-    return()
-  endif()
+    find_dependency(Iconv)
+    list(APPEND LIBXML2_LIBRARIES    ${Iconv_LIBRARIES})
+    list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS})
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "Iconv::Iconv")
+    if(NOT Iconv_FOUND)
+        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Iconv dependency was not found")
+        return()
+    endif()
 endif()
 
 if(LIBXML2_WITH_THREADS)
-  find_dependency(Threads)
-  list(APPEND LIBXML2_LIBRARIES    ${CMAKE_THREAD_LIBS_INIT})
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>")
-  if(NOT Threads_FOUND)
-    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Threads dependency was not found")
-    return()
-  endif()
+    find_dependency(Threads)
+    list(APPEND LIBXML2_LIBRARIES    ${CMAKE_THREAD_LIBS_INIT})
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Threads::Threads>")
+    if(NOT Threads_FOUND)
+        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Threads dependency was not found")
+        return()
+    endif()
 endif()
 
 if(LIBXML2_WITH_ICU)
-  find_dependency(ICU COMPONENTS data i18n uc)
-  list(APPEND LIBXML2_LIBRARIES    ${ICU_LIBRARIES})
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ICU::data>;\$<LINK_ONLY:ICU::i18n>;\$<LINK_ONLY:ICU::uc>")
-  if(NOT ICU_FOUND)
-    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ICU dependency was not found")
-    return()
-  endif()
+    find_dependency(ICU COMPONENTS data i18n uc)
+    list(APPEND LIBXML2_LIBRARIES    ${ICU_LIBRARIES})
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ICU::data>;\$<LINK_ONLY:ICU::i18n>;\$<LINK_ONLY:ICU::uc>")
+    if(NOT ICU_FOUND)
+        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ICU dependency was not found")
+        return()
+    endif()
 endif()
 
 if(LIBXML2_WITH_LZMA)
-  find_dependency(LibLZMA)
-  list(APPEND LIBXML2_LIBRARIES    ${LIBLZMA_LIBRARIES})
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:LibLZMA::LibLZMA>")
-  if(NOT LibLZMA_FOUND)
-    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "LibLZMA dependency was not found")
-    return()
-  endif()
+    find_dependency(LibLZMA)
+    list(APPEND LIBXML2_LIBRARIES    ${LIBLZMA_LIBRARIES})
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:LibLZMA::LibLZMA>")
+    if(NOT LibLZMA_FOUND)
+        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "LibLZMA dependency was not found")
+        return()
+    endif()
 endif()
 
 if(LIBXML2_WITH_ZLIB)
-  find_dependency(ZLIB)
-  list(APPEND LIBXML2_LIBRARIES    ${ZLIB_LIBRARIES})
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ZLIB::ZLIB>")
-  if(NOT ZLIB_FOUND)
-    set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
-    set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ZLIB dependency was not found")
-    return()
-  endif()
+    find_dependency(ZLIB)
+    list(APPEND LIBXML2_LIBRARIES    ${ZLIB_LIBRARIES})
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ZLIB::ZLIB>")
+    if(NOT ZLIB_FOUND)
+        set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)
+        set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "ZLIB dependency was not found")
+        return()
+    endif()
 endif()
 
 if(UNIX)
-  list(APPEND LIBXML2_LIBRARIES    m)
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:m>")
+    list(APPEND LIBXML2_LIBRARIES    m)
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:m>")
 endif()
 
 if(WIN32)
-  list(APPEND LIBXML2_LIBRARIES    ws2_32;Bcrypt)
-  list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>;\$<LINK_ONLY:Bcrypt>")
+    list(APPEND LIBXML2_LIBRARIES Bcrypt)
+    list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:Bcrypt>")
+    if(LIBXML2_WITH_HTTP)
+        list(APPEND LIBXML2_LIBRARIES ws2_32)
+        list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$<LINK_ONLY:ws2_32>")
+    endif()
 endif()
 
 # whether libxml2 has dso support
@@ -123,23 +128,23 @@
 mark_as_advanced(LIBXML2_LIBRARY LIBXML2_XMLCATALOG_EXECUTABLE LIBXML2_XMLLINT_EXECUTABLE)
 
 if(DEFINED LIBXML2_LIBRARY AND DEFINED LIBXML2_INCLUDE_DIRS)
-  set(LIBXML2_FOUND TRUE)
+    set(LIBXML2_FOUND TRUE)
 endif()
 
 if(NOT TARGET LibXml2::LibXml2 AND DEFINED LIBXML2_LIBRARY AND DEFINED LIBXML2_INCLUDE_DIRS)
-  add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
-  set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
-  set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}")
-  set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}")
-  set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBXML2_INTERFACE_LINK_LIBRARIES}")
+    add_library(LibXml2::LibXml2 UNKNOWN IMPORTED)
+    set_target_properties(LibXml2::LibXml2 PROPERTIES IMPORTED_LOCATION "${LIBXML2_LIBRARY}")
+    set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXML2_DEFINITIONS}")
+    set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXML2_INCLUDE_DIRS}")
+    set_target_properties(LibXml2::LibXml2 PROPERTIES INTERFACE_LINK_LIBRARIES "${LIBXML2_INTERFACE_LINK_LIBRARIES}")
 endif()
 
 if(NOT TARGET LibXml2::xmlcatalog AND DEFINED LIBXML2_XMLCATALOG_EXECUTABLE)
-  add_executable(LibXml2::xmlcatalog IMPORTED)
-  set_target_properties(LibXml2::xmlcatalog PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLCATALOG_EXECUTABLE}")
+    add_executable(LibXml2::xmlcatalog IMPORTED)
+    set_target_properties(LibXml2::xmlcatalog PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLCATALOG_EXECUTABLE}")
 endif()
 
 if(NOT TARGET LibXml2::xmllint AND DEFINED LIBXML2_XMLLINT_EXECUTABLE)
-  add_executable(LibXml2::xmllint IMPORTED)
-  set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
+    add_executable(LibXml2::xmllint IMPORTED)
+    set_target_properties(LibXml2::xmllint PROPERTIES IMPORTED_LOCATION "${LIBXML2_XMLLINT_EXECUTABLE}")
 endif()
diff --git a/libxml2.syms b/libxml2.syms
deleted file mode 100644
index 24b8f9f..0000000
--- a/libxml2.syms
+++ /dev/null
@@ -1,2285 +0,0 @@
-#
-# Retained for backward compatibility. Don't add new symbols.
-#
-
-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/lintmain.c b/lintmain.c
new file mode 100644
index 0000000..9e49ec6
--- /dev/null
+++ b/lintmain.c
@@ -0,0 +1,14 @@
+/*
+ * lintmain.c: Main routine for xmllint
+ *
+ * See Copyright for the status of this software.
+ */
+
+#include <stdio.h>
+
+#include "private/lint.h"
+
+int
+main(int argc, char **argv) {
+    return(xmllintMain(argc, (const char **) argv, stderr, NULL));
+}
diff --git a/list.c b/list.c
index 20df26c..dce9790 100644
--- a/list.c
+++ b/list.c
@@ -188,13 +188,15 @@
 xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
 {
     xmlListPtr l;
-    if (NULL == (l = (xmlListPtr )xmlMalloc( sizeof(xmlList))))
+    l = (xmlListPtr)xmlMalloc(sizeof(xmlList));
+    if (l == NULL)
         return (NULL);
     /* Initialize the list to NULL */
     memset(l, 0, sizeof(xmlList));
 
     /* Add the sentinel */
-    if (NULL ==(l->sentinel = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) {
+    l->sentinel = (xmlLinkPtr)xmlMalloc(sizeof(xmlLink));
+    if (l->sentinel == NULL) {
 	xmlFree(l);
         return (NULL);
     }
@@ -565,7 +567,8 @@
         return(0);
     lkPlace = l->sentinel->prev;
     /* Add the new link */
-    if (NULL ==(lkNew = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink))))
+    lkNew = (xmlLinkPtr)xmlMalloc(sizeof(xmlLink));
+    if (lkNew == NULL)
         return (0);
     lkNew->data = data;
     lkNew->next = lkPlace->next;
@@ -638,12 +641,12 @@
      * an insert. This is slow...
      */
 
-    if (NULL ==(lTemp = xmlListDup(l)))
+    lTemp = xmlListDup(l);
+    if (lTemp == NULL)
         return;
     xmlListClear(l);
     xmlListMerge(l, lTemp);
     xmlListDelete(lTemp);
-    return;
 }
 
 /**
@@ -724,7 +727,8 @@
      * set it to be the old list for the time being whilst I work out
      * the answer
      */
-    if (NULL ==(cur = xmlListCreate(NULL, old->linkCompare)))
+    cur = xmlListCreate(NULL, old->linkCompare);
+    if (cur == NULL)
         return (NULL);
     if (0 != xmlListCopy(cur, old))
         return NULL;
diff --git a/m4/ac_try_compile2.m4 b/m4/ac_try_compile2.m4
deleted file mode 100644
index 7ad8630..0000000
--- a/m4/ac_try_compile2.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl Like AC_TRY_EVAL but also errors out if the compiler generates
-dnl _any_ output. Some compilers might issue warnings which we want
-dnl to catch.
-AC_DEFUN([AC_TRY_EVAL2],
-[{ (eval echo configure:__oline__: \"[$]$1\") 1>&AS_MESSAGE_LOG_FD; dnl
-(eval [$]$1) 2>&AS_MESSAGE_LOG_FD; _out=`eval [$]$1 2>&1` && test "x$_out" = x; }])
-
-dnl Like AC_TRY_COMPILE but calls AC_TRY_EVAL2 instead of AC_TRY_EVAL
-AC_DEFUN([AC_TRY_COMPILE2],
-[cat > conftest.$ac_ext <<EOF
-[#]line __oline__ "configure"
-#include "confdefs.h"
-[$1]
-int main(void) {
-[$2]
-; return 0; }
-EOF
-if AC_TRY_EVAL2(ac_compile); then
-  ifelse([$3], , :, [rm -rf conftest*
-  $3])
-else
-  echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
-  cat conftest.$ac_ext >&AS_MESSAGE_LOG_FD
-ifelse([$4], , , [  rm -rf conftest*
-  $4
-])dnl
-fi
-rm -f conftest*])
diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4
deleted file mode 100644
index dd6d8b6..0000000
--- a/m4/ax_append_flag.m4
+++ /dev/null
@@ -1,50 +0,0 @@
-# ===========================================================================
-#      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
deleted file mode 100644
index 99b9fa5..0000000
--- a/m4/ax_append_link_flags.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-# ===========================================================================
-#   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
deleted file mode 100644
index 03a30ce..0000000
--- a/m4/ax_check_link_flag.m4
+++ /dev/null
@@ -1,53 +0,0 @@
-# ===========================================================================
-#    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_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4
new file mode 100644
index 0000000..fa4e089
--- /dev/null
+++ b/m4/ax_gcc_func_attribute.m4
@@ -0,0 +1,242 @@
+# ===========================================================================
+#  https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE)
+#
+# DESCRIPTION
+#
+#   This macro checks if the compiler supports one of GCC's function
+#   attributes; many other compilers also provide function attributes with
+#   the same syntax. Compiler warnings are used to detect supported
+#   attributes as unsupported ones are ignored by default so quieting
+#   warnings when using this macro will yield false positives.
+#
+#   The ATTRIBUTE parameter holds the name of the attribute to be checked.
+#
+#   If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>.
+#
+#   The macro caches its result in the ax_cv_have_func_attribute_<attribute>
+#   variable.
+#
+#   The macro currently supports the following function attributes:
+#
+#    alias
+#    aligned
+#    alloc_size
+#    always_inline
+#    artificial
+#    cold
+#    const
+#    constructor
+#    constructor_priority for constructor attribute with priority
+#    deprecated
+#    destructor
+#    dllexport
+#    dllimport
+#    error
+#    externally_visible
+#    fallthrough
+#    flatten
+#    format
+#    format_arg
+#    gnu_format
+#    gnu_inline
+#    hot
+#    ifunc
+#    leaf
+#    malloc
+#    noclone
+#    noinline
+#    nonnull
+#    noreturn
+#    nothrow
+#    optimize
+#    pure
+#    sentinel
+#    sentinel_position
+#    unused
+#    used
+#    visibility
+#    warning
+#    warn_unused_result
+#    weak
+#    weakref
+#
+#   Unsupported function attributes will be tested with a prototype
+#   returning an int and not accepting any arguments and the result of the
+#   check might be wrong or meaningless so use with care.
+#
+# LICENSE
+#
+#   Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@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 13
+
+AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [
+    AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1])
+
+    AC_CACHE_CHECK([for __attribute__(($1))], [ac_var], [
+        AC_LINK_IFELSE([AC_LANG_PROGRAM([
+            m4_case([$1],
+                [alias], [
+                    int foo( void ) { return 0; }
+                    int bar( void ) __attribute__(($1("foo")));
+                ],
+                [aligned], [
+                    int foo( void ) __attribute__(($1(32)));
+                ],
+                [alloc_size], [
+                    void *foo(int a) __attribute__(($1(1)));
+                ],
+                [always_inline], [
+                    inline __attribute__(($1)) int foo( void ) { return 0; }
+                ],
+                [artificial], [
+                    inline __attribute__(($1)) int foo( void ) { return 0; }
+                ],
+                [cold], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [const], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [constructor_priority], [
+                    int foo( void ) __attribute__((__constructor__(65535/2)));
+                ],
+                [constructor], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [deprecated], [
+                    int foo( void ) __attribute__(($1("")));
+                ],
+                [destructor], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [dllexport], [
+                    __attribute__(($1)) int foo( void ) { return 0; }
+                ],
+                [dllimport], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [error], [
+                    int foo( void ) __attribute__(($1("")));
+                ],
+                [externally_visible], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [fallthrough], [
+                    void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }};
+                ],
+                [flatten], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [format], [
+                    int foo(const char *p, ...) __attribute__(($1(printf, 1, 2)));
+                ],
+                [gnu_format], [
+                    int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2)));
+                ],
+                [format_arg], [
+                    char *foo(const char *p) __attribute__(($1(1)));
+                ],
+                [gnu_inline], [
+                    inline __attribute__(($1)) int foo( void ) { return 0; }
+                ],
+                [hot], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [ifunc], [
+                    int my_foo( void ) { return 0; }
+                    static int (*resolve_foo(void))(void) { return my_foo; }
+                    int foo( void ) __attribute__(($1("resolve_foo")));
+                ],
+                [leaf], [
+                    __attribute__(($1)) int foo( void ) { return 0; }
+                ],
+                [malloc], [
+                    void *foo( void ) __attribute__(($1));
+                ],
+                [noclone], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [noinline], [
+                    __attribute__(($1)) int foo( void ) { return 0; }
+                ],
+                [nonnull], [
+                    int foo(char *p) __attribute__(($1(1)));
+                ],
+                [noreturn], [
+                    void foo( void ) __attribute__(($1));
+                ],
+                [nothrow], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [optimize], [
+                    __attribute__(($1(3))) int foo( void ) { return 0; }
+                ],
+                [pure], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [sentinel], [
+                    int foo(void *p, ...) __attribute__(($1));
+                ],
+                [sentinel_position], [
+                    int foo(void *p, ...) __attribute__(($1(1)));
+                ],
+                [returns_nonnull], [
+                    void *foo( void ) __attribute__(($1));
+                ],
+                [unused], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [used], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [visibility], [
+                    int foo_def( void ) __attribute__(($1("default")));
+                    int foo_hid( void ) __attribute__(($1("hidden")));
+                    int foo_int( void ) __attribute__(($1("internal")));
+                    int foo_pro( void ) __attribute__(($1("protected")));
+                ],
+                [warning], [
+                    int foo( void ) __attribute__(($1("")));
+                ],
+                [warn_unused_result], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [weak], [
+                    int foo( void ) __attribute__(($1));
+                ],
+                [weakref], [
+                    static int foo( void ) { return 0; }
+                    static int bar( void ) __attribute__(($1("foo")));
+                ],
+                [
+                 m4_warn([syntax], [Unsupported attribute $1, the test may fail])
+                 int foo( void ) __attribute__(($1));
+                ]
+            )], [])
+            ],
+            dnl GCC doesn't exit with an error if an unknown attribute is
+            dnl provided but only outputs a warning, so accept the attribute
+            dnl only if no warning were issued.
+            [AS_IF([grep -- -Wattributes conftest.err],
+                [AS_VAR_SET([ac_var], [no])],
+                [AS_VAR_SET([ac_var], [yes])])],
+            [AS_VAR_SET([ac_var], [no])])
+    ])
+
+    AS_IF([test yes = AS_VAR_GET([ac_var])],
+        [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1,
+            [Define to 1 if the system has the `$1' function attribute])], [])
+
+    AS_VAR_POPDEF([ac_var])
+])
diff --git a/m4/ax_recursive_eval.m4 b/m4/ax_recursive_eval.m4
new file mode 100644
index 0000000..0625aca
--- /dev/null
+++ b/m4/ax_recursive_eval.m4
@@ -0,0 +1,56 @@
+# ===========================================================================
+#    https://www.gnu.org/software/autoconf-archive/ax_recursive_eval.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_RECURSIVE_EVAL(VALUE, RESULT)
+#
+# DESCRIPTION
+#
+#   Interpolate the VALUE in loop until it doesn't change, and set the
+#   result to $RESULT. WARNING: It's easy to get an infinite loop with some
+#   unsane input.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Alexandre Duret-Lutz <adl@gnu.org>
+#
+#   This program is free software; you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation; either version 2 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 1
+
+AC_DEFUN([AX_RECURSIVE_EVAL],
+[_lcl_receval="$1"
+$2=`(test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+     test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+     _lcl_receval_old=''
+     while test "[$]_lcl_receval_old" != "[$]_lcl_receval"; do
+       _lcl_receval_old="[$]_lcl_receval"
+       eval _lcl_receval="\"[$]_lcl_receval\""
+     done
+     echo "[$]_lcl_receval")`])
diff --git a/m4/ax_require_defined.m4 b/m4/ax_require_defined.m4
deleted file mode 100644
index 17c3eab..0000000
--- a/m4/ax_require_defined.m4
+++ /dev/null
@@ -1,37 +0,0 @@
-# ===========================================================================
-#    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/meson.build b/meson.build
index f425f32..3e5f25d 100644
--- a/meson.build
+++ b/meson.build
@@ -1,17 +1,21 @@
 project(
     'libxml2',
     'c',
-    version: '2.13.6',
+    version: files('VERSION'),
     license: 'MIT',
-    default_options: ['buildtype=debug', 'warning_level=3'],
+    default_options: [
+        'c_std=c11,c99,c89',
+        'buildtype=debug',
+        'warning_level=3',
+    ],
     meson_version: '>= 0.61',
 )
 
 v_array = meson.project_version().split('.')
-v_maj = v_array[0]
-v_min = v_array[1]
-v_mic = v_array[2]
-v_nbr = v_maj.to_int() * 10000 + v_min.to_int() * 100 + v_mic.to_int()
+v_maj = v_array[0].to_int()
+v_min = v_array[1].to_int()
+v_mic = v_array[2].to_int()
+v_nbr = v_maj * 10000 + v_min * 100 + v_mic
 v_extra = ''
 r = run_command('git', 'describe', check: false)
 if (r.returncode() == 0)
@@ -25,7 +29,7 @@
 dir_pkginclude = dir_include / meson.project_name()
 dir_lib = dir_prefix / get_option('libdir')
 dir_data = dir_prefix / get_option('datadir')
-dir_doc = dir_data / 'doc' / 'libxml2'
+dir_doc = dir_data / 'doc' / meson.project_name()
 dir_locale = dir_prefix / get_option('localedir')
 
 # host
@@ -52,181 +56,156 @@
 # binaries
 cc = meson.get_compiler('c')
 
+# global compiler flags
+
+global_args = [
+    '-D_XOPEN_SOURCE=600',
+
+    # Enabled by warning_level=3
+    # '-pedantic',
+    # '-Wall',
+    # '-Wextra',
+
+    '-Wshadow',
+    '-Wpointer-arith',
+    '-Wcast-align',
+    '-Wwrite-strings',
+    '-Wstrict-prototypes',
+    '-Wmissing-prototypes',
+    '-Wno-long-long',
+    '-Wno-format-extra-args',
+    '-Wno-array-bounds',
+]
+global_args = cc.get_supported_arguments(global_args)
+add_project_arguments(global_args, language: 'c')
+
 # options
-want_c14n = get_option('c14n')
-want_catalog = get_option('catalog')
-want_debug = get_option('debuging')
-want_ftp = get_option('ftp')
-want_history = get_option('history')
-want_html = get_option('html')
-want_http = get_option('http')
-want_ipv6 = get_option('ipv6')
-want_iso8859x = get_option('iso8859x')
-want_legacy = get_option('legacy')
-want_output = get_option('output')
-want_pattern = get_option('pattern')
-want_push = get_option('push')
-want_python = get_option('python')
-want_reader = get_option('reader')
-want_readline = get_option('readline')
-want_regexps = get_option('regexps')
-want_sax1 = get_option('sax1')
-want_schemas = get_option('schemas')
-want_schematron = get_option('schematron')
-want_thread_alloc = get_option('thread-alloc')
-want_tls = get_option('tls')
-want_tree = get_option('tree')
-want_valid = get_option('valid')
-want_writer = get_option('writer')
-want_xinclude = get_option('xinclude')
-want_xpath = get_option('xpath')
-want_xptr = get_option('xptr')
-want_xptr_locs = get_option('xptr-locs')
 
-# TODO: Options should be three-valued: "yes", "no", default
+# disabled by default
+want_http = get_option('http').enabled()
+want_icu = get_option('icu').enabled()
+want_legacy = get_option('legacy').enabled()
+want_lzma = get_option('lzma').enabled()
+want_thread_alloc = get_option('thread-alloc').enabled()
+want_tls = get_option('tls').enabled()
 
-# TODO: Legacy defaults
+# default depends on minimum option
 
-# hard dependencies on options
+want_minimum = get_option('minimum')
 
-if want_c14n == true
-    if want_output == false
-        message('-Dc14n=true overrides -Doutput')
-    endif
-    want_output = true
-    if want_xpath == false
-        message('-Dc14n=true overrides -Dxpath')
-    endif
-    want_xpath = true
-endif
+feature = get_option('catalog')
+want_catalog = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_schemas == true
-    if want_pattern == false
-        message('-Dschemas=true overrides -Dpattern')
-    endif
-    want_pattern = true
-    if want_regexps == false
-        message('-Dschemas=true overrides -Dregexps')
-    endif
-    want_regexps = true
-endif
+feature = get_option('debugging')
+want_debug = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_schematron == true
-    if want_pattern == false
-        message('-Dschematron=true overrides -Dpattern')
-    endif
-    want_pattern = true
-    if want_tree == false
-        message('-Dschematron=true overrides -Dtree')
-    endif
-    want_tree = true
-    if want_xpath == false
-        message('-Dschematron=true overrides -Dxpath')
-    endif
-    want_xpath = true
-endif
+feature = get_option('html')
+want_html = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_reader == true
-    if want_push == false
-        message('-Dreader=true overrides -Dpush')
-    endif
-    want_push = true
-    if want_tree == false
-        message('-Dreader=true overrides -Dtree')
-    endif
-    want_tree = true
-endif
+feature = get_option('iconv')
+want_iconv = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_writer == true
-    if want_output == false
-        message('-Dwriter=true overrides -Doutput')
-    endif
-    want_output = true
-    if want_push == false
-        message('-Dwriter=true overrides -Dpush')
-    endif
-    want_push = true
-endif
+feature = get_option('iso8859x')
+want_iso8859x = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_xinclude == true
-    if want_xpath == false
-        message('-Dxinclude=true overrides -Dxpath')
-    endif
-    want_xpath = true
-endif
+feature = get_option('python')
+want_python = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_xptr_locs == true
-    if want_xptr == false
-        message('-Dxptr-locs=true overrides -Dxptr')
-    endif
-    want_xptr = true
-endif
+feature = get_option('modules')
+want_modules = want_minimum ? feature.enabled() : feature.allowed()
 
-if want_xptr == true
-    if want_xpath == false
-        message('-Dxptr=true overrides -Dxpath')
-    endif
-    want_xpath = true
-endif
+feature = get_option('sax1')
+want_sax1 = want_minimum ? feature.enabled() : feature.allowed()
 
-# minimum dependencies
+feature = get_option('threads')
+want_threads = want_minimum ? feature.enabled() : feature.allowed()
 
-if get_option('minimum')
-    # TODO: This is should allow other options
-    want_c14n = false
-    want_catalog = false
-    want_debug = false
-    want_history = false
-    want_html = false
-    want_http = false
-    want_ipv6 = false
-    want_iso8859x = false
-    want_output = false
-    want_pattern = false
-    want_push = false
-    want_python = false
-    want_reader = false
-    want_readline = false
-    want_regexps = false
-    want_sax1 = false
-    want_schemas = false
-    want_schematron = false
-    want_thread_alloc = false
-    want_tree = false
-    want_valid = false
-    want_writer = false
-    want_xinclude = false
-    want_xpath = false
-    want_xptr = false
-    want_xptr_locs = false
-else
-    # Disable dependent modules
-    if want_output == false
-        want_c14n = false
-        want_writer = false
-    endif
-    if want_pattern == false
-        want_schemas = false
-        want_schematron = false
-    endif
-    if want_push == false
-        want_reader = false
-        want_writer = false
-    endif
-    if want_regexps == false
-        want_schemas = false
-    endif
-    if want_tree == false
-        want_reader = false
-        want_schematron = false
-    endif
-    if want_xpath == false
-        want_c14n = false
-        want_schematron = false
-        want_xinclude = false
-        want_xptr = false
-    endif
-endif
+feature = get_option('valid')
+want_valid = want_minimum ? feature.enabled() : feature.allowed()
+
+feature = get_option('xinclude')
+want_xinclude = want_minimum ? feature.enabled() : feature.allowed()
+
+# default depends on legacy option
+
+feature = get_option('zlib')
+want_zlib = want_legacy ? feature.allowed() : feature.enabled()
+
+# dependencies
+
+feature = get_option('output')
+want_output = not want_minimum \
+    or get_option('c14n').enabled() \
+    or get_option('writer').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('pattern')
+want_pattern = not want_minimum \
+    or get_option('schemas').enabled() \
+    or get_option('schematron').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('regexps')
+want_regexps = not want_minimum \
+    or get_option('relaxng').enabled() \
+    or get_option('schemas').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('push')
+want_push = not want_minimum \
+    or get_option('reader').enabled() \
+    or get_option('writer').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('readline')
+want_readline = get_option('history').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('xpath')
+want_xpath = not want_minimum \
+    or get_option('c14n').enabled() \
+    or get_option('schematron').enabled() \
+    or get_option('xptr').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('c14n') \
+    .require(want_output, error_message: 'c14n requires output') \
+    .require(want_xpath, error_message: 'c14n requires xpath')
+want_c14n = want_minimum ? feature.enabled() : feature.allowed()
+
+feature = get_option('history') \
+    .require(want_readline, error_message: 'history requires readline')
+want_history = feature.enabled()
+
+feature = get_option('reader') \
+    .require(want_push, error_message: 'reader requires push')
+want_reader = want_minimum ? feature.enabled() : feature.allowed()
+
+feature = get_option('schemas') \
+    .require(want_pattern, error_message: 'schemas requires pattern') \
+    .require(want_regexps, error_message: 'schemas requires regexps')
+want_schemas = not want_minimum \
+    or get_option('relaxng').enabled() ? \
+    feature.allowed() : feature.enabled()
+
+feature = get_option('relaxng') \
+    .require(want_regexps, error_message: 'relaxng requires regexps') \
+    .require(want_schemas, error_message: 'relaxng requires schemas')
+want_relaxng = want_minimum ? feature.enabled() : feature.allowed()
+
+feature = get_option('schematron') \
+    .require(want_pattern, error_message: 'schematron requires pattern') \
+    .require(want_xpath, error_message: 'schematron requires xpath')
+want_schematron = want_minimum ? feature.enabled() : feature.allowed()
+
+feature = get_option('writer') \
+    .require(want_output, error_message: 'writer requires output') \
+    .require(want_push, error_message: 'writer requires push')
+want_writer = want_minimum ? feature.enabled() : feature.allowed()
+
+feature = get_option('xptr') \
+    .require(want_xpath, error_message: 'xptr requires xpath')
+want_xptr = want_minimum ? feature.enabled() : feature.allowed()
 
 cflags_try = []
 
@@ -241,6 +220,7 @@
         '-Wmissing-prototypes',
         '-Wno-long-long',
         '-Wno-format-extra-args',
+        '-Wno-array-bounds',
     ]
 
     if host_machine.cpu_family() == 'alpha'
@@ -267,61 +247,39 @@
 #
 # [X] config.h.in
 # [X] include/libxml/xmlversion.h.in
-# [N] libxml-2.0-uninstalled.pc.in
 # [X] libxml-2.0.pc.in
 # [X] libxml2-config.cmake.in
 # [X] python/setup.py.in
-# [N] xml2-config.in
+# [X] xml2-config.in
 
 ## config.h
 config_h = configuration_data()
-config_h.set_quoted('PACKAGE_NAME', meson.project_name())
-config_h.set_quoted('PACKAGE_VERSION', meson.project_version())
-config_h.set_quoted('PACKAGE_BIN_DIR', dir_bin)
-config_h.set_quoted('PACKAGE_LIB_DIR', dir_lib)
-config_h.set_quoted('PACKAGE_DATA_DIR', dir_data)
-config_h.set_quoted('LOCALEDIR', dir_locale)
+config_h.set_quoted('XML_SYSCONFDIR',
+                    get_option('prefix') / get_option('sysconfdir'))
 
 # header files
 xml_check_headers = [
-    'stdint.h',
-    'fcntl.h',
-    'unistd.h',
-    'sys/stat.h',
-    'sys/mman.h',
-    'sys/socket.h',
-    'netinet/in.h',
-    'arpa/inet.h',
-    'netdb.h',
-    'sys/select.h',
-    'poll.h',
-    'sys/time.h',
-    'sys/timeb.h',
-    'dl.h',
-    'dlfcn.h',
-    'glob.h',
+    [ 'stdint.h', true ],
+    [ 'poll.h', want_http ],
 ]
 
 foreach header : xml_check_headers
-    if cc.has_header(header)
-        config_h.set10('HAVE_' + header.underscorify().to_upper(), true)
+    if header[1] and cc.has_header(header[0])
+        config_h.set10('HAVE_' + header[0].underscorify().to_upper(), true)
     endif
 endforeach
 
 # library functions
 xml_check_functions = [
     # fct             | header
-    ['gettimeofday', 'sys/time.h'],
-    ['ftime', 'sys/timeb.h'],
-    ['stat', 'sys/stat.h'],
+    ['getentropy', 'sys/random.h'],
+    ['glob', 'glob.h'],
     ['mmap', 'sys/mman.h'],
-    ['munmap', 'sys/mman.h'],
 ]
 
 foreach function : xml_check_functions
-    if cc.has_header_symbol(function[1], function[0])
-        config_h.set10('HAVE_' + function[0].to_upper(), true)
-    endif
+    config_h.set10('HAVE_DECL_' + function[0].underscorify().to_upper(),
+                   cc.has_header_symbol(function[1], function[0]))
 endforeach
 
 # library
@@ -341,53 +299,18 @@
 endif
 
 ### thread local storage
-support_tls = true
-if want_tls == true
-    tls_src = '''
-#include <threads.h>
-int main()
-{
-    _Thread_local int v;
-    return 0;
-}
-    '''
-    res = cc.compiles(tls_src, name: '_Thread_local')
-    if res == true
-        config_h.set('XML_THREAD_LOCAL', '_Thread_local')
-    else
-        tls_src = '''
-int main()
-{
-    __thread int v;
-    return 0;
-}
-        '''
-        res = cc.compiles(tls_src, name: '__thread')
-        if res == true
-            config_h.set('XML_THREAD_LOCAL', '__thread')
-        else
-            tls_src = '''
-int main()
-{
-    __declspec(thread) int v;
-    return 0;
-}
-            '''
-            res = cc.compiles(tls_src, name: '__declspec(thread)')
-            if res == true
-                config_h.set('XML_THREAD_LOCAL', '__declspec(thread)')
-            else
-                want_tls = false
-                support_tls = false
-            endif
+if want_tls
+    foreach t : ['_Thread_local', '__thread', '__declspec(thread)']
+        if cc.compiles('@0@ int v;'.format(t))
+            config_h.set('XML_THREAD_LOCAL', t)
+            break
         endif
-    endif
+    endforeach
 endif
 
 ### __attribute__((destructor))
 if cc.has_function_attribute('destructor')
-    config_h.set10('HAVE_ATTRIBUTE_DESTRUCTOR', true)
-    config_h.set('ATTRIBUTE_DESTRUCTOR', '__attribute__((destructor))')
+    config_h.set10('HAVE_FUNC_ATTRIBUTE_DESTRUCTOR', true)
 endif
 
 ### DSO support
@@ -399,67 +322,39 @@
     module_extension = '.so'
 endif
 
-dl_dep = dependency('', required: false)
-if not get_option('minimum')
-    if host_machine.system() != 'windows'
-        if meson.version().version_compare('>=0.62')
-            dl_dep = dependency('dl', required: get_option('modules'))
-        else
-            dl_dep = cc.find_library('dl', required: get_option('modules'))
-        endif
-        if dl_dep.found()
-            config_h.set10('HAVE_DLOPEN', true)
-            xml_deps += dl_dep
-        endif
-    elif get_option('modules').allowed()
-        dl_dep = declare_dependency()
+if want_modules and host_machine.system() != 'windows'
+    if meson.version().version_compare('>=0.62')
+        dl_dep = dependency('dl', required: false)
+    else
+        dl_dep = cc.find_library('dl', required: false)
+    endif
+    if dl_dep.found()
+        config_h.set10('HAVE_DLOPEN', true)
+        xml_deps += dl_dep
     endif
 endif
 
 ### threads
-threads_dep = dependency('', required: false)
-if not get_option('minimum')
-    if host_machine.system() != 'windows'
-        threads_dep = dependency('threads', required: get_option('threads'))
-        if threads_dep.found()
-            config_h.set10('HAVE_PTHREAD_H', true)
-            xml_deps += threads_dep
-        endif
-    elif get_option('threads').allowed()
-        threads_dep = declare_dependency()
-    endif
+if want_threads and host_os != 'windows'
+    threads_dep = dependency('threads')
+    xml_deps += threads_dep
+else
+    threads_dep = dependency('', required: false)
 endif
 
-want_thread_alloc = threads_dep.found()
-
 ### xmllint shell history
 xmllint_deps = []
-if want_history == true and want_readline == true
-    termlib_lib = ['ncurses', 'curses', 'termcap', 'terminfo', 'termlib']
 
-    foreach tl : termlib_lib
-        termlib_dep = cc.find_library(tl)
-        if (
-            termlib_dep.found()
-            and cc.has_function('tputs', dependencies: termlib_dep)
-        )
-            xmllint_deps += termlib_dep
-            config_h.set10('HAVE_LIB' + tl.underscorify().to_upper(), true)
-            break
-        endif
-    endforeach
+if want_readline
+    readline_dep = dependency('readline')
+    config_h.set('HAVE_LIBREADLINE', true)
+    xmllint_deps += readline_dep
+endif
 
-    history_dep = dependency('history', required: false)
-    if history_dep.found()
-        xmllint_deps += history_dep
-        config_h.set10('HAVE_LIBHISTORY', true)
-    endif
-
-    readline_dep = dependency('readline', required: false)
-    if readline_dep.found()
-        xmllint_deps += readline_dep
-        config_h.set10('HAVE_LIBREADLINE', true)
-    endif
+if want_history
+    history_dep = dependency('history')
+    config_h.set('HAVE_LIBHISTORY', true)
+    xmllint_deps += history_dep
 endif
 
 ### crypto
@@ -469,142 +364,54 @@
 endif
 
 ### inet
-if want_http == true or want_ftp == true
+if want_http == true
     if sys_windows == true
-        ws2_dep = cc.find_library('ws2_32', required: true)
-        xml_deps += ws2_dep
+        net_dep = cc.find_library('ws2_32', required: true)
+        xml_deps += net_dep
     else
+        net_dep = dependency('', required: false)
         has_in_libc = cc.has_function('gethostbyname')
         if has_in_libc == false
-            nsl_dep = cc.find_library('nsl', required: true)
-            if nsl_dep.found()
+            net_dep = cc.find_library('nsl', required: true)
+            if net_dep.found()
                 has_in_nsl = cc.has_function(
                     'gethostbyname',
-                    dependencies: nsl_dep,
+                    dependencies: net_dep,
                     required: false,
                 )
                 if has_in_nsl == true
-                    xml_deps += nsl_dep
+                    xml_deps += net_dep
                 endif
             endif
         endif
     endif
-
-    ### socket length
-    socklen_src = '''
-#include <stddef.h>
-#ifdef _WIN32
-  #include <ws2tcpip.h>
-#else
-  #include <sys/socket.h>
-#endif
-int main()
-{
-    (void)getsockopt (1, 1, 1, NULL, (socklen_t *)NULL);
-    return 0;
-}
-    '''
-    res = cc.compiles(socklen_src, name: 'socket length as socklen_t')
-    if res == true
-        config_h.set('XML_SOCKLEN_T', 'socklen_t')
-    else
-        socklen_src = '''
-#include <stddef.h>
-#include <sys/socket.h>
-int main()
-{
-    (void)getsockopt (1, 1, 1, NULL, (size_t *)NULL);
-    return 0;
-}
-        '''
-        res = cc.compiles(socklen_src, name: 'socket length as size_t')
-        if res == true
-            config_h.set('XML_SOCKLEN_T', 'size_t')
-        else
-            socklen_src = '''
-#include <stddef.h>
-#include <sys/socket.h>
-int main()
-{
-    (void)getsockopt (1, 1, 1, NULL, (int *)NULL);
-    return 0;
-}
-            '''
-            res = cc.compiles(socklen_src, name: 'socket length as int')
-            if res == false
-                message('could not determine socket length type, use int')
-            endif
-            config_h.set('XML_SOCKLEN_T', 'int')
-        endif
-    endif
-
-    if want_ipv6 == true
-        ### IPV6 on Windows has been supported since Windows XP SP1 (around 2003)
-        ### see:
-        ### https://learn.microsoft.com/en-us/windows/win32/winsock/ipv6-support-2
-        ### nevertheless, we check it like autotools
-        ipv6_src = '''
-#ifdef _WIN32
-#include <winsock2.h>
-#else
-#include <sys/socket.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#endif
-int main()
-{
-    struct sockaddr_storage ss;
-    socket(AF_INET6, SOCK_STREAM, 0);
-    getaddrinfo(0, 0, 0, 0);
-    return 0;
-}
-        '''
-        res = cc.compiles(ipv6_src, name: 'support for IPV6')
-        if res == true
-            config_h.set10('SUPPORT_IP6', true)
-        endif
-    endif
 endif
 
 ### zlib
-if not get_option('minimum')
-    zlib_dep = dependency('zlib', required: get_option('zlib'))
-else
-    zlib_dep = dependency('', required: false)
+if want_zlib
+    xml_deps += dependency('zlib')
 endif
-xml_deps += zlib_dep
 
 ### lzma
-if not get_option('minimum')
-    lzma_dep = dependency('liblzma', required: get_option('lzma'))
-else
-    lzma_dep = dependency('', required: false)
-endif
-xml_deps += lzma_dep
-
-### iconv
-if not get_option('minimum')
-    iconv_dep = dependency('iconv', required: get_option('iconv'))
-else
-    iconv_dep = dependency('', required: false)
-endif
-xml_deps += iconv_dep
-
-if not iconv_dep.found() and want_iso8859x == false
-    want_iso8859x = false
-else
-    want_iso8859x = true
+if want_lzma
+    xml_deps += dependency('liblzma')
 endif
 
 # icu
-icu_dep = dependency('icu-i18n', method: 'pkg-config', required: get_option('icu'))
-if icu_dep.found()
-    def_var = icu_dep.get_variable(pkgconfig: 'DEFS')
-    config_dir += include_directories(def_var)
+if want_icu
+    icu_dep = dependency('icu-uc')
+    defs = icu_dep.get_variable(pkgconfig: 'DEFS', default_value: '')
+    if cc.has_argument(defs)
+        libxml2_cflags += defs
+    endif
     xml_deps += icu_dep
 endif
 
+### iconv
+if want_iconv
+    xml_deps += dependency('iconv')
+endif
+
 subdir('include/libxml')
 
 # Set config_h after all subdirs and dependencies have set values
@@ -639,19 +446,16 @@
     [want_c14n, ['c14n.c']],
     [want_catalog, ['catalog.c']],
     [want_debug, ['debugXML.c']],
-    [want_ftp, ['nanoftp.c']],
     [want_html, ['HTMLparser.c', 'HTMLtree.c']],
     [want_http, ['nanohttp.c']],
-    [want_legacy, ['legacy.c']],
-    [lzma_dep.found(), ['xzlib.c']],
-    [dl_dep.found(), ['xmlmodule.c']],
+    [want_lzma, ['xzlib.c']],
+    [want_modules, ['xmlmodule.c']],
     [want_output, ['xmlsave.c']],
     [want_pattern, ['pattern.c']],
     [want_reader, ['xmlreader.c']],
     [want_regexps, ['xmlregexp.c', 'xmlunicode.c']],
-    [want_sax1, ['SAX.c']],
-    [want_schemas, ['relaxng.c', 'xmlschemas.c', 'xmlschemastypes.c']],
-    [want_schemas and not want_xpath, ['xpath.c']],
+    [want_relaxng, ['relaxng.c']],
+    [want_schemas, ['xmlschemas.c', 'xmlschemastypes.c']],
     [want_schematron, ['schematron.c']],
     [want_writer, ['xmlwriter.c']],
     [want_xinclude, ['xinclude.c']],
@@ -673,6 +477,10 @@
     endif
 endforeach
 
+v_min_compat = 14
+so_version = v_maj + v_min_compat
+age = v_min - v_min_compat
+darwin_compat = v_maj + v_min + 1
 xml_lib = library(
     'xml2',
     files(xml_src),
@@ -680,7 +488,9 @@
     dependencies: xml_deps,
     include_directories: config_dir,
     install: true,
-    version: meson.project_version(),
+    version: f'@so_version@.@age@.@v_mic@',
+    soversion: so_version,
+    darwin_versions: [ darwin_compat, f'@darwin_compat@.@v_mic@' ],
 )
 
 dep_inc = include_directories('include')
@@ -690,9 +500,9 @@
 
 ## xmllint tool
 
-executable(
+xmllint = executable(
     'xmllint',
-    files('xmllint.c'),
+    files('xmllint.c', 'shell.c', 'lintmain.c'),
     dependencies: [xml_dep, xmllint_deps],
     include_directories: config_dir,
     install: true,
@@ -700,13 +510,15 @@
 
 ## xmlcatalog tool
 
-executable(
-    'xmlcatalog',
-    files('xmlcatalog.c'),
-    dependencies: [xml_dep, xmllint_deps],
-    include_directories: config_dir,
-    install: true,
-)
+if want_catalog and want_output
+    xmlcatalog = executable(
+        'xmlcatalog',
+        files('xmlcatalog.c'),
+        dependencies: [xml_dep, xmllint_deps],
+        include_directories: config_dir,
+        install: true,
+    )
+endif
 
 ## testdso module
 
@@ -720,26 +532,25 @@
 
 ## tests
 
-checks = [
-    'runsuite',
-    'runtest',
-    'runxmlconf',
+checks = {
+    'runsuite': [],
+    'runtest': threads_dep,
+    'runxmlconf': [],
 # Disabled for now, see #694
-#    'testModule',
-    'testThreads',
-    'testapi',
-    'testchar',
-    'testdict',
-    'testlimits',
-    'testparser',
-    'testrecurse',
-]
+#    'testModule': [],
+    'testapi': [],
+    'testchar': [],
+    'testdict': [],
+    'testlimits': [],
+    'testparser': [],
+    'testrecurse': [],
+}
 
-foreach check : checks
+foreach check, deps : checks
     exe = executable(
         check,
         files(check + '.c'),
-        dependencies: [threads_dep, xml_dep],
+        dependencies: [deps, xml_dep],
         include_directories: config_dir,
     )
     if check != 'testlimits'
@@ -747,6 +558,21 @@
     endif
 endforeach
 
+sh = find_program('sh', required: false)
+
+if sh.found()
+    if want_debug
+        test('xmllint shell', sh,
+             args: [ 'test/scripts/test.sh', xmllint.full_path() ],
+             workdir: meson.current_source_dir())
+    endif
+    if want_catalog and want_output
+        test('xmlcatalog shell', sh,
+             args: [ 'test/catalogs/test.sh', xmlcatalog.full_path() ],
+             workdir: meson.current_source_dir())
+    endif
+endif
+
 subdir('example')
 subdir('doc')
 
@@ -763,7 +589,8 @@
     description: 'libXML library version2.',
     filebase: 'libxml-2.0',
     name: 'libXML',
-    variables: 'modules=' + dl_dep.found().to_string('1', '0'),
+    subdirs:  [meson.project_name()],
+    variables: 'modules=' + want_modules.to_string('1', '0'),
 )
 
 ## libxml2-config.cmake file
@@ -773,30 +600,29 @@
 config_cmake.set('LIBXML_MINOR_VERSION', v_min)
 config_cmake.set('LIBXML_MICRO_VERSION', v_mic)
 config_cmake.set('VERSION', meson.project_version())
-config_cmake.set('WITH_ICONV', iconv_dep.found().to_int().to_string())
-config_cmake.set('WITH_ICU', icu_dep.found().to_int().to_string())
-config_cmake.set('WITH_LZMA', lzma_dep.found().to_int().to_string())
-config_cmake.set('WITH_MODULES', dl_dep.found().to_int().to_string())
-config_cmake.set('WITH_THREADS', threads_dep.found().to_int().to_string())
-config_cmake.set('WITH_ZLIB', zlib_dep.found().to_int().to_string())
+config_cmake.set('WITH_HTTP', want_http.to_int().to_string())
+config_cmake.set('WITH_ICONV', want_iconv.to_int().to_string())
+config_cmake.set('WITH_ICU', want_icu.to_int().to_string())
+config_cmake.set('WITH_LZMA', want_lzma.to_int().to_string())
+config_cmake.set('WITH_MODULES', want_modules.to_int().to_string())
+config_cmake.set('WITH_THREADS', want_threads.to_int().to_string())
+config_cmake.set('WITH_ZLIB', want_zlib.to_int().to_string())
 config_cmake.set('XML_CFLAGS', xml_cflags)
 configure_file(
     input: 'libxml2-config.cmake.in',
     output: 'libxml2-config.cmake',
     configuration: config_cmake,
-    install_dir: dir_lib / 'cmake' / 'libxml2',
+    install_dir: dir_lib / 'cmake' / meson.project_name(),
 )
 
-install_data(files('libxml.m4'), install_dir: dir_data / 'aclocal')
+## xml2-config script
 
-if support_tls == false
-    message('===============================================================')
-    message('WARNING: Your C compiler appears to not support thread-local')
-    message('storage. Future versions of libxml2 will require this feature')
-    message('for multi-threading.')
-    message('===============================================================\n',
-    )
-endif
+install_data(
+    'xml2-config-meson',
+    install_dir: dir_bin,
+    install_mode: 'rwxr-xr-x',
+    rename: 'xml2-config',
+)
 
 # summary
 
@@ -806,17 +632,15 @@
         'c14n': want_c14n,
         'catalog': want_catalog,
         'debug': want_debug,
-        'ftp': want_ftp,
         'history': want_history,
         'html': want_html,
         'http': want_http,
-        'iconv': iconv_dep.found(),
-        'icu': icu_dep.found(),
-        'ipv6': want_ipv6,
+        'iconv': want_iconv,
+        'icu': want_icu,
         'iso8859x': want_iso8859x,
         'legacy': want_legacy,
-        'lzma': lzma_dep.found(),
-        'modules': dl_dep.found(),
+        'lzma': want_lzma,
+        'modules': want_modules,
         'output': want_output,
         'pattern': want_pattern,
         'push': want_push,
@@ -824,20 +648,19 @@
         'reader': want_reader,
         'readline': want_readline,
         'regexps': want_regexps,
+        'relaxng': want_relaxng,
         'sax1': want_sax1,
         'schemas': want_schemas,
         'schematron': want_schematron,
-        'threads': threads_dep.found(),
+        'threads': want_threads,
         'thread-alloc': want_thread_alloc,
         'tls': want_tls,
-        'tree': want_tree,
         'valid': want_valid,
         'writer': want_writer,
         'xinclude': want_xinclude,
         'xpath': want_xpath,
         'xptr': want_xptr,
-        'xptr-locs': want_xptr_locs,
-        'zlib': zlib_dep.found(),
+        'zlib': want_zlib,
     },
     section: 'Configuration Options Summary:',
 )
diff --git a/meson_options.txt b/meson_options.txt
index 4d61f3d..0bfbebb 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -3,13 +3,11 @@
 # [X] c14n
 # [X] catalog
 # [X] debugging
-# [X] ftp         - not minimum
 # [X] history
 # [X] html
 # [X] http
 # [X] iconv
 # [X] icu         - not minimum
-# [X] ipv6
 # [X] iso8859x
 # [X] legacy
 # [X] lzma
@@ -27,59 +25,42 @@
 # [X] threads
 # [X] thread-alloc
 # [X] tls
-# [X] tree
 # [X] valid
 # [X] writer
 # [X] xinclude
 # [X] xpath
 # [X] xptr
-# [X] xptr-locs
 # [X] zlib
 
 # [X] minimum
-# [X] ipv6
-
-# TODO: Options should be three-valued: "yes", "no", default
 
 option('c14n',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'Canonical XML 1.0 support'
 )
 
 option('catalog',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'XML Catalogs support'
 )
 
-option('debuging',
-  type: 'boolean',
-  value: true,
+option('debugging',
+  type: 'feature',
   description: 'Debugging module and shell'
 )
 
-option('ftp',
-  type: 'boolean',
-  value: false,
-  description: 'FTP support'
-)
-
 option('history',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
   description: 'History support for shell'
 )
 
 option('html',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'HTML parser'
 )
 
 option('http',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
   description: 'HTTP support'
 )
 
@@ -91,24 +72,18 @@
 
 option('icu',
   type: 'feature',
+  value: 'disabled',
   description: 'ICU support'
 )
 
-option('ipv6',
-  type: 'boolean',
-  value: true,
-  description: 'Compilation of IPv6 code'
-)
-
 option('iso8859x',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'ISO-8859-X support if no iconv'
 )
 
 option('legacy',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
+  value: 'disabled',
   description: 'Maximum ABI compatibility'
 )
 
@@ -123,62 +98,57 @@
 )
 
 option('output',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'Serialization support'
 )
 
 option('pattern',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'xmlPattern selection interface'
 )
 
 option('push',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'push parser interfaces'
 )
 
 option('python',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'Python bindings'
 )
 
 option('reader',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'xmlReader parsing interface'
 )
 
 option('readline',
-  type: 'boolean',
-  value: true,
-  description: 'use readline in DIR (for shell history)'
+  type: 'feature',
+  description: 'use readline for shell history'
 )
 
 option('regexps',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'Regular expressions support'
 )
 
+option('relaxng',
+  type: 'feature',
+  description: 'RELAX NG support'
+)
+
 option('sax1',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'Older SAX1 interface'
 )
 
 option('schemas',
-  type: 'boolean',
-  value: true,
-  description: 'XML Schemas 1.0 and RELAX NG support'
+  type: 'feature',
+  description: 'XML Schemas 1.0 support'
 )
 
 option('schematron',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'Schematron support'
 )
 
@@ -188,59 +158,42 @@
 )
 
 option('thread-alloc',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
+  value: 'disabled',
   description: 'per-thread malloc hooks'
 )
 
 option('tls',
-  type: 'boolean',
-  value: false,
+  type: 'feature',
+  value: 'disabled',
   description: 'thread-local storage'
 )
 
-option('tree',
-  type: 'boolean',
-  value: true,
-  description: 'DOM like tree manipulation APIs'
-)
-
 option('valid',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'DTD validation support'
 )
 
 option('writer',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'xmlWriter serialization interface'
 )
 
 option('xinclude',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'XInclude 1.0 support'
 )
 
 option('xpath',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'XPath 1.0 support'
 )
 
 option('xptr',
-  type: 'boolean',
-  value: true,
+  type: 'feature',
   description: 'XPointer support'
 )
 
-option('xptr-locs',
-  type: 'boolean',
-  value: false,
-  description: 'XPointer ranges and points'
-)
-
 option('zlib',
   type: 'feature',
   description: 'ZLIB support'
@@ -249,5 +202,5 @@
 option('minimum',
   type: 'boolean',
   value: false,
-  description: 'build a minimally sized library (default=false)'
+  description: 'build a minimally sized library'
 )
diff --git a/nanoftp.c b/nanoftp.c
deleted file mode 100644
index fc8f8d7..0000000
--- a/nanoftp.c
+++ /dev/null
@@ -1,1982 +0,0 @@
-/*
- * nanoftp.c: basic FTP client support
- *
- *  Reference: RFC 959
- */
-
-#ifdef TESTING
-#define STANDALONE
-#define HAVE_UNISTD_H
-#define HAVE_SYS_SOCKET_H
-#define HAVE_NETINET_IN_H
-#define HAVE_NETDB_H
-#define HAVE_SYS_TIME_H
-#endif /* TESTING */
-
-#define IN_LIBXML
-#include "libxml.h"
-
-#ifdef LIBXML_FTP_ENABLED
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#elif defined (_WIN32)
-#include <io.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-
-#include <libxml/xmlmemory.h>
-#include <libxml/parser.h>
-#include <libxml/xmlerror.h>
-#include <libxml/uri.h>
-#include <libxml/nanoftp.h>
-
-#include "private/error.h"
-#include "private/io.h"
-
-#if defined(_WIN32)
-#include <wsockcompat.h>
-#endif
-
-/**
- * A couple portability macros
- */
-#ifndef _WINSOCKAPI_
-#define closesocket(s) close(s)
-#endif
-
-#ifndef XML_SOCKLEN_T
-#define XML_SOCKLEN_T unsigned int
-#endif
-
-#define GETHOSTBYNAME_ARG_CAST (char *)
-#define SEND_ARG2_CAST (char *)
-
-#define FTP_COMMAND_OK		200
-#define FTP_SYNTAX_ERROR	500
-#define FTP_GET_PASSWD		331
-#define FTP_BUF_SIZE		1024
-
-#define XML_NANO_MAX_URLBUF	4096
-
-typedef struct xmlNanoFTPCtxt {
-    char *protocol;	/* the protocol name */
-    char *hostname;	/* the host name */
-    int port;		/* the port */
-    char *path;		/* the path within the URL */
-    char *user;		/* user string */
-    char *passwd;	/* passwd string */
-#ifdef SUPPORT_IP6
-    struct sockaddr_storage ftpAddr; /* this is large enough to hold IPv6 address*/
-#else
-    struct sockaddr_in ftpAddr; /* the socket address struct */
-#endif
-    int passive;	/* currently we support only passive !!! */
-    SOCKET controlFd;	/* the file descriptor for the control socket */
-    SOCKET dataFd;	/* the file descriptor for the data socket */
-    int state;		/* WRITE / READ / CLOSED */
-    int returnValue;	/* the protocol return value */
-    /* buffer for data received from the control connection */
-    char controlBuf[FTP_BUF_SIZE + 1];
-    int controlBufIndex;
-    int controlBufUsed;
-    int controlBufAnswer;
-} xmlNanoFTPCtxt, *xmlNanoFTPCtxtPtr;
-
-static int initialized = 0;
-static char *proxy = NULL;	/* the proxy name if any */
-static int proxyPort = 0;	/* the proxy port if any */
-static char *proxyUser = NULL;	/* user for proxy authentication */
-static char *proxyPasswd = NULL;/* passwd for proxy authentication */
-static int proxyType = 0;	/* uses TYPE or a@b ? */
-
-#ifdef SUPPORT_IP6
-static
-int have_ipv6(void) {
-    int s;
-
-    s = socket (AF_INET6, SOCK_STREAM, 0);
-    if (s != -1) {
-	close (s);
-	return (1);
-    }
-    return (0);
-}
-#endif
-
-/**
- * xmlFTPErrMemory:
- * @extra:  extra information
- *
- * Handle an out of memory condition
- */
-static void
-xmlFTPErrMemory(const char *extra ATTRIBUTE_UNUSED)
-{
-    xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_FTP, NULL);
-}
-
-/**
- * xmlNanoFTPInit:
- *
- * Initialize the FTP protocol layer.
- * Currently it just checks for proxy information,
- * and get the hostname
- */
-
-void
-xmlNanoFTPInit(void) {
-    const char *env;
-#ifdef _WINSOCKAPI_
-    WSADATA wsaData;
-#endif
-
-    if (initialized)
-	return;
-
-#ifdef _WINSOCKAPI_
-    if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0)
-	return;
-#endif
-
-    proxyPort = 21;
-    env = getenv("no_proxy");
-    if (env && ((env[0] == '*' ) && (env[1] == 0)))
-	return;
-    env = getenv("ftp_proxy");
-    if (env != NULL) {
-	xmlNanoFTPScanProxy(env);